@openspecui/core 3.11.3 → 3.11.5

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 (29) hide show
  1. package/dist/{document-translation-BrlCvnLZ.mjs → document-translation-B6VWf7ll.mjs} +26 -2
  2. package/dist/{document-translation-Cv6BIGL5.d.mts → document-translation-DhFREeHW.d.mts} +254 -52
  3. package/dist/document-translation.d.mts +2 -2
  4. package/dist/document-translation.mjs +3 -3
  5. package/dist/index.d.mts +410 -89
  6. package/dist/index.mjs +226 -89
  7. package/dist/{local-download-profiles-GKs2OOqJ.d.mts → local-download-profiles-DIVr0mFh.d.mts} +1 -1
  8. package/dist/local-download-profiles.d.mts +2 -2
  9. package/dist/{notifications-CJQ_F_Un.d.mts → notifications-BDBbeTRk.d.mts} +16 -16
  10. package/dist/notifications.d.mts +2 -2
  11. package/dist/{openspec-projection-BbuPTbvj.d.mts → openspec-projection-CmxjMsxS.d.mts} +1 -1
  12. package/dist/openspec-projection.d.mts +2 -2
  13. package/dist/{opsx-entity-BO9G2SCW.d.mts → opsx-entity-CRa2u1j3.d.mts} +1 -1
  14. package/dist/opsx-entity.d.mts +2 -2
  15. package/dist/{opsx-schema-detail-DTajJW4g.d.mts → opsx-schema-detail-aVlqvbro.d.mts} +1 -1
  16. package/dist/opsx-schema-detail.d.mts +3 -3
  17. package/dist/{schemas-DQzd1hgp.d.mts → schemas-Dp8-Wm-X.d.mts} +28 -28
  18. package/dist/sounds.d.mts +1 -1
  19. package/dist/{terminal-audio-UCLlM1qN.d.mts → terminal-audio-DLOmaKqa.d.mts} +1 -1
  20. package/dist/terminal-audio.d.mts +2 -2
  21. package/dist/terminal-control.d.mts +2 -2
  22. package/dist/{terminal-invocation-DCPc8hmm.d.mts → terminal-invocation-B3js0mEF.d.mts} +81 -81
  23. package/dist/terminal-invocation.d.mts +1 -1
  24. package/dist/{translator-prn3W9lf.d.mts → translator-CS7MsNZp.d.mts} +387 -138
  25. package/dist/{translator-Car0_7uk.mjs → translator-Cx9j32Og.mjs} +164 -6
  26. package/dist/translator.d.mts +2 -2
  27. package/dist/translator.mjs +2 -2
  28. package/package.json +1 -1
  29. /package/dist/{sounds-3yEx1YXT.d.mts → sounds-6KwglrL2.d.mts} +0 -0
package/dist/index.mjs CHANGED
@@ -3,8 +3,8 @@ import { n as toMarkdownFactKind, t as parseMarkdownFacts } from "./markdown-fac
3
3
  import { a as getMarkdownAnnotation, c as getMarkdownHeadingEnd, d as trimMarkdownSlice, i as createMarkdownReadingDocumentFromFacts, l as getMarkdownHeadingFacts, n as buildMarkdownParentMap, o as getMarkdownAnnotationsForFact, r as createMarkdownReadingDocument, s as getMarkdownFactSpan, t as MarkdownReadingPluginRegistry, u as sortMarkdownReadingPlugins } from "./markdown-reading-DSlcirYV.mjs";
4
4
  import { a as getOpenSpecAnnotationsForFact, i as getOpenSpecAnnotation, n as annotateOpenSpecMarkdown, o as openSpecAnnotationRules, r as builtinOpenSpecReadingPlugin, t as annotateOpenSpecFacts } from "./openspec-annotations-dNJentSE.mjs";
5
5
  import { a as getOpenSpecReadingSections, c as projectOpenSpecMarkdown, i as getOpenSpecProjectionAnnotation, n as OPEN_SPEC_SPEC_PROJECTION_ID, o as parseOpenSpecMarkdownToSpec, r as createOpenSpecReadingPlugin, s as projectAnnotatedOpenSpecToSpec, t as OPEN_SPEC_READING_SECTIONS_PROJECTION_ID } from "./openspec-projection-yqwKIKnp.mjs";
6
- import { A as TranslationEngineInstallLogStreamSchema, B as getManagedLocalTranslationEngineManifest, C as TranslationEngineAssetStateSchema, D as TranslationEngineGlobalSettingsSchema, E as TranslationEngineDependencyStatusSchema, F as TranslationLocalCt2SettingsSchema, G as isTranslationEngineDependencyReady, H as getTranslationEngineManifest, I as TranslationLocalLlamaSettingsSchema, K as isTranslationEngineRuntimeReady, L as TranslationLocalSettingsSchema, M as TranslationEngineLifecycleStatusSchema, N as TranslationEngineRuntimeStateSchema, O as TranslationEngineIdSchema, P as TranslationEngineRuntimeStatusSchema, R as TranslationOpenAISettingsSchema, S as TranslationDownloadGroupPlanSchema, T as TranslationEngineDependencyStateSchema, U as isDirectionalManagedLocalTranslationEngineId, V as getTranslationEngineLifecycleMessage, W as isManagedLocalTranslationEngineId, _ as ServiceTranslationEngineIdSchema, a as LocalModelAssetPlanSnapshotSchema, b as TRANSLATOR_CONTRACT_VERSION, c as LocalModelLifecycleFileStateSchema, d as LocalModelProfileManifestFileSchema, f as LocalModelProfileManifestGroupSchema, g as SERVICE_TRANSLATION_ENGINE_IDS, h as ManagedLocalCatalogSourceSchema, i as LocalModelAssetLogSchema, j as TranslationEngineLifecycleEventSchema, k as TranslationEngineInstallLogEventSchema, l as LocalModelLifecycleGroupStateSchema, m as LocalModelProfileStatusSchema, n as BatchTranslateInputSchema, o as LocalModelAssetStateSchema, p as LocalModelProfileManifestSchema, q as shouldShowTranslationEngineInstallGate, r as DEFAULT_TRANSLATION_ENGINE_ID, s as LocalModelDownloadStatusSchema, t as BatchTranslateEventSchema, u as LocalModelProfileLoadStateSchema, v as TRANSLATION_ENGINE_IDS, w as TranslationEngineAssetStatusSchema, x as TranslationDownloadFilePlanSchema, y as TRANSLATION_ENGINE_MANIFESTS, z as createTranslationEngineLifecycleStatus } from "./translator-Car0_7uk.mjs";
7
- import { a as MAX_TRANSLATION_CACHE_ENTRY_LIMIT, c as TranslationCacheEntrySchema, d as TranslationCacheStatsSchema, f as TranslationCacheWriteInputSchema, i as DocumentTranslationDisplayModeSchema, l as TranslationCacheReadInputSchema, n as DOCUMENT_TRANSLATION_DISPLAY_MODES, o as MIN_TRANSLATION_CACHE_ENTRY_LIMIT, p as TranslationEngineProjectSettingsSchema, r as DocumentTranslationConfigSchema, s as TRANSLATION_CACHE_POLICY_VERSION, t as DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, u as TranslationCacheSettingsSchema } from "./document-translation-BrlCvnLZ.mjs";
6
+ import { $ as shouldShowTranslationEngineInstallGate, A as TranslationEngineIdSchema, B as TranslationLocalLlamaSettingsUpdateSchema, C as TranslationDownloadGroupPlanSchema, D as TranslationEngineDependencyStatusSchema, E as TranslationEngineDependencyStateSchema, F as TranslationEngineRuntimeStateSchema, G as createTranslationEngineLifecycleStatus, H as TranslationLocalSettingsUpdateSchema, I as TranslationEngineRuntimeStatusSchema, J as getTranslationEngineManifest, K as getManagedLocalTranslationEngineManifest, L as TranslationLocalCt2SettingsSchema, M as TranslationEngineInstallLogStreamSchema, N as TranslationEngineLifecycleEventSchema, O as TranslationEngineGlobalSettingsSchema, P as TranslationEngineLifecycleStatusSchema, Q as isTranslationEngineRuntimeReady, R as TranslationLocalCt2SettingsUpdateSchema, S as TranslationDownloadFilePlanSchema, T as TranslationEngineAssetStatusSchema, U as TranslationOpenAISettingsSchema, V as TranslationLocalSettingsSchema, W as TranslationOpenAISettingsUpdateSchema, X as isManagedLocalTranslationEngineId, Y as isDirectionalManagedLocalTranslationEngineId, Z as isTranslationEngineDependencyReady, _ as SERVICE_TRANSLATION_ENGINE_IDS, a as LocalModelAssetLogSchema, b as TRANSLATION_ENGINE_MANIFESTS, c as LocalModelDownloadStatusSchema, d as LocalModelProfileLoadStateSchema, et as isBatchTranslationAbort, f as LocalModelProfileManifestFileSchema, g as ManagedLocalCatalogSourceSchema, h as LocalModelProfileStatusSchema, i as DEFAULT_TRANSLATION_ENGINE_ID, j as TranslationEngineInstallLogEventSchema, k as TranslationEngineGlobalSettingsUpdateSchema, l as LocalModelLifecycleFileStateSchema, m as LocalModelProfileManifestSchema, n as BatchTranslateInputSchema, nt as runControlledTranslationTask, o as LocalModelAssetPlanSnapshotSchema, p as LocalModelProfileManifestGroupSchema, q as getTranslationEngineLifecycleMessage, s as LocalModelAssetStateSchema, t as BatchTranslateEventSchema, tt as normalizeBatchTranslationError, u as LocalModelLifecycleGroupStateSchema, v as ServiceTranslationEngineIdSchema, w as TranslationEngineAssetStateSchema, x as TRANSLATOR_CONTRACT_VERSION, y as TRANSLATION_ENGINE_IDS, z as TranslationLocalLlamaSettingsSchema } from "./translator-Cx9j32Og.mjs";
7
+ import { a as DocumentTranslationDisplayModeSchema, c as TRANSLATION_CACHE_POLICY_VERSION, d as TranslationCacheSettingsSchema, f as TranslationCacheSettingsUpdateSchema, g as TranslationEngineProjectSettingsUpdateSchema, h as TranslationEngineProjectSettingsSchema, i as DocumentTranslationConfigUpdateSchema, l as TranslationCacheEntrySchema, m as TranslationCacheWriteInputSchema, n as DOCUMENT_TRANSLATION_DISPLAY_MODES, o as MAX_TRANSLATION_CACHE_ENTRY_LIMIT, p as TranslationCacheStatsSchema, r as DocumentTranslationConfigSchema, s as MIN_TRANSLATION_CACHE_ENTRY_LIMIT, t as DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, u as TranslationCacheReadInputSchema } from "./document-translation-B6VWf7ll.mjs";
8
8
  import { _ as customHashFromSoundId, a as CustomSoundHashSchema, b as soundIdFromCustomHash, c as CustomSoundMetadataSchema, 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-50cYk5b0.mjs";
9
9
  import { n as terminalNotificationEventToPublishInput, t as TerminalControlParser } from "./terminal-control-CYZhk7FM.mjs";
10
10
  import { a as NotificationPublishInputSchema, c as NotificationSoundSchema, 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-Xs9VPFWD.mjs";
@@ -3014,6 +3014,56 @@ function toPersistedConfig(config, options = {}) {
3014
3014
  function isPersistedConfigEmpty(config) {
3015
3015
  return !hasOwnEntries$1(config);
3016
3016
  }
3017
+ function parsePersistedConfigObject(content) {
3018
+ if (!content) return {};
3019
+ try {
3020
+ const parsed = JSON.parse(content);
3021
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : {};
3022
+ } catch {
3023
+ return {};
3024
+ }
3025
+ }
3026
+ function hasOwnPath(value, path) {
3027
+ let current = value;
3028
+ for (const segment of path) {
3029
+ if (typeof current !== "object" || current === null) return false;
3030
+ if (!Object.prototype.hasOwnProperty.call(current, segment)) return false;
3031
+ current = Reflect.get(current, segment);
3032
+ }
3033
+ return true;
3034
+ }
3035
+ function readConfigPresenceFromContent(content) {
3036
+ const parsed = parsePersistedConfigObject(content);
3037
+ return { translation: {
3038
+ enabled: hasOwnPath(parsed, ["translation", "enabled"]),
3039
+ targetLanguage: hasOwnPath(parsed, ["translation", "targetLanguage"]),
3040
+ displayMode: hasOwnPath(parsed, ["translation", "displayMode"]),
3041
+ cacheEnabled: hasOwnPath(parsed, ["translation", "cacheEnabled"]),
3042
+ engineId: hasOwnPath(parsed, ["translation", "engineId"]),
3043
+ engines: {
3044
+ local: hasOwnPath(parsed, [
3045
+ "translation",
3046
+ "engines",
3047
+ "local"
3048
+ ]),
3049
+ localCt2: hasOwnPath(parsed, [
3050
+ "translation",
3051
+ "engines",
3052
+ "localCt2"
3053
+ ]),
3054
+ localLlama: hasOwnPath(parsed, [
3055
+ "translation",
3056
+ "engines",
3057
+ "localLlama"
3058
+ ]),
3059
+ openai: hasOwnPath(parsed, [
3060
+ "translation",
3061
+ "engines",
3062
+ "openai"
3063
+ ])
3064
+ }
3065
+ } };
3066
+ }
3017
3067
  /**
3018
3068
  * 配置管理器
3019
3069
  *
@@ -3028,6 +3078,7 @@ var ConfigManager = class {
3028
3078
  projectDir;
3029
3079
  resolvedRunner = null;
3030
3080
  resolvingRunnerPromise = null;
3081
+ writeChain = Promise.resolve();
3031
3082
  constructor(projectDir) {
3032
3083
  this.projectDir = projectDir;
3033
3084
  this.configPath = join(projectDir, "openspec", ".openspecui.json");
@@ -3055,77 +3106,87 @@ var ConfigManager = class {
3055
3106
  const content = await reactiveReadFile(this.configPath);
3056
3107
  return this.parseConfigContent(content);
3057
3108
  }
3109
+ async readConfigPresence() {
3110
+ return readConfigPresenceFromContent(await reactiveReadFile(this.configPath));
3111
+ }
3058
3112
  /**
3059
3113
  * 写入配置
3060
3114
  *
3061
3115
  * 会触发文件监听,自动更新订阅者。
3062
3116
  */
3063
3117
  async writeConfig(config) {
3064
- const currentContent = await reactiveReadFile(this.configPath);
3065
- const fileExists = currentContent !== null;
3066
- const current = this.parseConfigContent(currentContent);
3067
- const nextCli = { ...current.cli };
3068
- if (config.cli && Object.prototype.hasOwnProperty.call(config.cli, "command")) {
3069
- const trimmed = config.cli.command?.trim();
3070
- if (trimmed) nextCli.command = trimmed;
3071
- else {
3072
- delete nextCli.command;
3073
- delete nextCli.args;
3074
- }
3075
- }
3076
- if (config.cli && Object.prototype.hasOwnProperty.call(config.cli, "args")) {
3077
- const args = (config.cli.args ?? []).map((arg) => arg.trim()).filter(Boolean);
3078
- if (args.length > 0) nextCli.args = args;
3079
- else delete nextCli.args;
3080
- }
3081
- if (!nextCli.command) delete nextCli.args;
3082
- const persisted = toPersistedConfig({
3083
- ...current,
3084
- cli: nextCli,
3085
- theme: config.theme ?? current.theme,
3086
- codeEditor: {
3087
- ...current.codeEditor,
3088
- ...config.codeEditor
3089
- },
3090
- appBaseUrl: config.appBaseUrl ?? current.appBaseUrl,
3091
- opsx: {
3092
- ...current.opsx,
3093
- ...config.opsx
3094
- },
3095
- terminal: {
3096
- ...current.terminal,
3097
- ...config.terminal
3098
- },
3099
- dashboard: {
3100
- ...current.dashboard,
3101
- ...config.dashboard
3102
- },
3103
- git: {
3104
- ...current.git,
3105
- ...config.git
3106
- },
3107
- notifications: {
3108
- ...current.notifications,
3109
- ...config.notifications
3110
- },
3111
- translation: {
3112
- ...current.translation,
3113
- ...config.translation,
3114
- engines: {
3115
- local: mergeNullablePatch$1(current.translation.engines.local, config.translation?.engines?.local),
3116
- localCt2: mergeNullablePatch$1(current.translation.engines.localCt2, config.translation?.engines?.localCt2),
3117
- localLlama: mergeNullablePatch$1(current.translation.engines.localLlama, config.translation?.engines?.localLlama),
3118
- openai: mergeNullablePatch$1(current.translation.engines.openai, config.translation?.engines?.openai)
3118
+ return this.enqueueWrite(async () => {
3119
+ const currentContent = await reactiveReadFile(this.configPath);
3120
+ const fileExists = currentContent !== null;
3121
+ const current = this.parseConfigContent(currentContent);
3122
+ const nextCli = { ...current.cli };
3123
+ if (config.cli && Object.prototype.hasOwnProperty.call(config.cli, "command")) {
3124
+ const trimmed = config.cli.command?.trim();
3125
+ if (trimmed) nextCli.command = trimmed;
3126
+ else {
3127
+ delete nextCli.command;
3128
+ delete nextCli.args;
3119
3129
  }
3120
3130
  }
3131
+ if (config.cli && Object.prototype.hasOwnProperty.call(config.cli, "args")) {
3132
+ const args = (config.cli.args ?? []).map((arg) => arg.trim()).filter(Boolean);
3133
+ if (args.length > 0) nextCli.args = args;
3134
+ else delete nextCli.args;
3135
+ }
3136
+ if (!nextCli.command) delete nextCli.args;
3137
+ const persisted = toPersistedConfig({
3138
+ ...current,
3139
+ cli: nextCli,
3140
+ theme: config.theme ?? current.theme,
3141
+ codeEditor: {
3142
+ ...current.codeEditor,
3143
+ ...config.codeEditor
3144
+ },
3145
+ appBaseUrl: config.appBaseUrl ?? current.appBaseUrl,
3146
+ opsx: {
3147
+ ...current.opsx,
3148
+ ...config.opsx
3149
+ },
3150
+ terminal: {
3151
+ ...current.terminal,
3152
+ ...config.terminal
3153
+ },
3154
+ dashboard: {
3155
+ ...current.dashboard,
3156
+ ...config.dashboard
3157
+ },
3158
+ git: {
3159
+ ...current.git,
3160
+ ...config.git
3161
+ },
3162
+ notifications: {
3163
+ ...current.notifications,
3164
+ ...config.notifications
3165
+ },
3166
+ translation: {
3167
+ ...current.translation,
3168
+ ...config.translation,
3169
+ engines: {
3170
+ local: mergeNullablePatch$1(current.translation.engines.local, config.translation?.engines?.local),
3171
+ localCt2: mergeNullablePatch$1(current.translation.engines.localCt2, config.translation?.engines?.localCt2),
3172
+ localLlama: mergeNullablePatch$1(current.translation.engines.localLlama, config.translation?.engines?.localLlama),
3173
+ openai: mergeNullablePatch$1(current.translation.engines.openai, config.translation?.engines?.openai)
3174
+ }
3175
+ }
3176
+ });
3177
+ if (isPersistedConfigEmpty(persisted) && !fileExists) return;
3178
+ const serialized = isPersistedConfigEmpty(persisted) ? "{}" : JSON.stringify(persisted, null, 2);
3179
+ if (currentContent === serialized) return;
3180
+ await mkdir(dirname(this.configPath), { recursive: true });
3181
+ await writeFile(this.configPath, serialized, "utf-8");
3182
+ updateReactiveFileCache(this.configPath, serialized);
3183
+ this.invalidateResolvedCliRunner();
3121
3184
  });
3122
- if (isPersistedConfigEmpty(persisted) && !fileExists) return;
3123
- const serialized = isPersistedConfigEmpty(persisted) ? "{}" : JSON.stringify(persisted, null, 2);
3124
- if (currentContent === serialized) return;
3125
- await mkdir(dirname(this.configPath), { recursive: true });
3126
- await writeFile(this.configPath, serialized, "utf-8");
3127
- updateReactiveFileCache(this.configPath, serialized);
3128
- this.invalidateResolvedCliRunner();
3185
+ }
3186
+ enqueueWrite(operation) {
3187
+ const run = this.writeChain.then(operation, operation);
3188
+ this.writeChain = run.then(() => void 0, () => void 0);
3189
+ return run;
3129
3190
  }
3130
3191
  async resolveDefaultCliCommandParts() {
3131
3192
  return (await resolveCliRunner(buildCliRunnerCandidates({ userAgent: process.env.npm_config_user_agent }).filter((candidate) => candidate.id !== "configured"), this.projectDir, createCleanCliEnv())).commandParts;
@@ -3243,12 +3304,59 @@ var ConfigManager = class {
3243
3304
 
3244
3305
  //#endregion
3245
3306
  //#region src/global-settings.ts
3307
+ const DocumentTranslationGlobalSettingsSchema = z.object({
3308
+ enabled: z.boolean().default(false),
3309
+ targetLanguage: z.string().min(1).default("zh"),
3310
+ displayMode: DocumentTranslationDisplayModeSchema.default("direct"),
3311
+ cacheEnabled: z.boolean().default(false)
3312
+ });
3313
+ const DocumentTranslationGlobalSettingsUpdateSchema = z.object({
3314
+ enabled: z.boolean().optional(),
3315
+ targetLanguage: z.string().min(1).optional(),
3316
+ displayMode: DocumentTranslationDisplayModeSchema.optional(),
3317
+ cacheEnabled: z.boolean().optional()
3318
+ });
3246
3319
  const OpenSpecUIGlobalSettingsSchema = z.object({
3320
+ translation: DocumentTranslationGlobalSettingsSchema.default(DocumentTranslationGlobalSettingsSchema.parse({})),
3247
3321
  translationCache: TranslationCacheSettingsSchema.default(TranslationCacheSettingsSchema.parse({})),
3248
3322
  translationEngines: TranslationEngineGlobalSettingsSchema.default(TranslationEngineGlobalSettingsSchema.parse({}))
3249
3323
  });
3324
+ const OpenSpecUIGlobalSettingsUpdateSchema = z.object({
3325
+ translation: DocumentTranslationGlobalSettingsUpdateSchema.optional(),
3326
+ translationCache: TranslationCacheSettingsUpdateSchema.optional(),
3327
+ translationEngines: TranslationEngineGlobalSettingsUpdateSchema.optional()
3328
+ });
3250
3329
  const DEFAULT_GLOBAL_SETTINGS = OpenSpecUIGlobalSettingsSchema.parse({});
3251
3330
  const PERSISTED_GLOBAL_SETTINGS_SANITIZE_RULES = [
3331
+ {
3332
+ kind: "object",
3333
+ path: ["translation"],
3334
+ fallback: {}
3335
+ },
3336
+ {
3337
+ kind: "field",
3338
+ path: ["translation", "enabled"],
3339
+ schema: DocumentTranslationGlobalSettingsSchema.shape.enabled,
3340
+ fallback: DEFAULT_GLOBAL_SETTINGS.translation.enabled
3341
+ },
3342
+ {
3343
+ kind: "field",
3344
+ path: ["translation", "targetLanguage"],
3345
+ schema: DocumentTranslationGlobalSettingsSchema.shape.targetLanguage,
3346
+ fallback: DEFAULT_GLOBAL_SETTINGS.translation.targetLanguage
3347
+ },
3348
+ {
3349
+ kind: "field",
3350
+ path: ["translation", "displayMode"],
3351
+ schema: DocumentTranslationGlobalSettingsSchema.shape.displayMode,
3352
+ fallback: DEFAULT_GLOBAL_SETTINGS.translation.displayMode
3353
+ },
3354
+ {
3355
+ kind: "field",
3356
+ path: ["translation", "cacheEnabled"],
3357
+ schema: DocumentTranslationGlobalSettingsSchema.shape.cacheEnabled,
3358
+ fallback: DEFAULT_GLOBAL_SETTINGS.translation.cacheEnabled
3359
+ },
3252
3360
  {
3253
3361
  kind: "object",
3254
3362
  path: ["translationCache"],
@@ -3259,6 +3367,12 @@ const PERSISTED_GLOBAL_SETTINGS_SANITIZE_RULES = [
3259
3367
  path: ["translationEngines"],
3260
3368
  fallback: {}
3261
3369
  },
3370
+ {
3371
+ kind: "field",
3372
+ path: ["translationEngines", "engineId"],
3373
+ schema: TranslationEngineIdSchema,
3374
+ fallback: DEFAULT_GLOBAL_SETTINGS.translationEngines.engineId
3375
+ },
3262
3376
  {
3263
3377
  kind: "object",
3264
3378
  path: ["translationEngines", "openai"],
@@ -3304,11 +3418,18 @@ function mergeNullablePatch(current, patch) {
3304
3418
  }
3305
3419
  function toPersistedGlobalSettings(settings) {
3306
3420
  const persisted = {};
3421
+ const translation = {};
3307
3422
  const translationCache = {};
3423
+ if (settings.translation.enabled !== DEFAULT_GLOBAL_SETTINGS.translation.enabled) translation.enabled = settings.translation.enabled;
3424
+ if (settings.translation.targetLanguage !== DEFAULT_GLOBAL_SETTINGS.translation.targetLanguage) translation.targetLanguage = settings.translation.targetLanguage;
3425
+ if (settings.translation.displayMode !== DEFAULT_GLOBAL_SETTINGS.translation.displayMode) translation.displayMode = settings.translation.displayMode;
3426
+ if (settings.translation.cacheEnabled !== DEFAULT_GLOBAL_SETTINGS.translation.cacheEnabled) translation.cacheEnabled = settings.translation.cacheEnabled;
3308
3427
  if (settings.translationCache.entryLimit !== DEFAULT_GLOBAL_SETTINGS.translationCache.entryLimit) translationCache.entryLimit = settings.translationCache.entryLimit;
3428
+ if (hasOwnEntries(translation)) persisted.translation = translation;
3309
3429
  if (hasOwnEntries(translationCache)) persisted.translationCache = translationCache;
3310
3430
  const translationEngines = {};
3311
3431
  const defaultTranslationEngines = DEFAULT_GLOBAL_SETTINGS.translationEngines;
3432
+ if (settings.translationEngines.engineId !== defaultTranslationEngines.engineId) translationEngines.engineId = settings.translationEngines.engineId;
3312
3433
  const openai = {};
3313
3434
  if (settings.translationEngines.openai.baseUrl !== defaultTranslationEngines.openai.baseUrl) openai.baseUrl = settings.translationEngines.openai.baseUrl;
3314
3435
  if (settings.translationEngines.openai.token !== defaultTranslationEngines.openai.token) openai.token = settings.translationEngines.openai.token;
@@ -3318,16 +3439,19 @@ function toPersistedGlobalSettings(settings) {
3318
3439
  if (settings.translationEngines.local.model !== defaultTranslationEngines.local.model) local.model = settings.translationEngines.local.model;
3319
3440
  if (settings.translationEngines.local.selectedGroupId !== defaultTranslationEngines.local.selectedGroupId) local.selectedGroupId = settings.translationEngines.local.selectedGroupId;
3320
3441
  if (settings.translationEngines.local.hfEndpoint !== defaultTranslationEngines.local.hfEndpoint) local.hfEndpoint = settings.translationEngines.local.hfEndpoint;
3442
+ if (settings.translationEngines.local.memoryBudgetPercent !== defaultTranslationEngines.local.memoryBudgetPercent) local.memoryBudgetPercent = settings.translationEngines.local.memoryBudgetPercent;
3321
3443
  if (hasOwnEntries(local)) translationEngines.local = local;
3322
3444
  const localCt2 = {};
3323
3445
  if (settings.translationEngines.localCt2.model !== defaultTranslationEngines.localCt2.model) localCt2.model = settings.translationEngines.localCt2.model;
3324
3446
  if (settings.translationEngines.localCt2.selectedGroupId !== defaultTranslationEngines.localCt2.selectedGroupId) localCt2.selectedGroupId = settings.translationEngines.localCt2.selectedGroupId;
3325
3447
  if (settings.translationEngines.localCt2.hfEndpoint !== defaultTranslationEngines.localCt2.hfEndpoint) localCt2.hfEndpoint = settings.translationEngines.localCt2.hfEndpoint;
3448
+ if (settings.translationEngines.localCt2.memoryBudgetPercent !== defaultTranslationEngines.localCt2.memoryBudgetPercent) localCt2.memoryBudgetPercent = settings.translationEngines.localCt2.memoryBudgetPercent;
3326
3449
  if (hasOwnEntries(localCt2)) translationEngines.localCt2 = localCt2;
3327
3450
  const localLlama = {};
3328
3451
  if (settings.translationEngines.localLlama.model !== defaultTranslationEngines.localLlama.model) localLlama.model = settings.translationEngines.localLlama.model;
3329
3452
  if (settings.translationEngines.localLlama.selectedGroupId !== defaultTranslationEngines.localLlama.selectedGroupId) localLlama.selectedGroupId = settings.translationEngines.localLlama.selectedGroupId;
3330
3453
  if (settings.translationEngines.localLlama.hfEndpoint !== defaultTranslationEngines.localLlama.hfEndpoint) localLlama.hfEndpoint = settings.translationEngines.localLlama.hfEndpoint;
3454
+ if (settings.translationEngines.localLlama.memoryBudgetPercent !== defaultTranslationEngines.localLlama.memoryBudgetPercent) localLlama.memoryBudgetPercent = settings.translationEngines.localLlama.memoryBudgetPercent;
3331
3455
  if (hasOwnEntries(localLlama)) translationEngines.localLlama = localLlama;
3332
3456
  if (hasOwnEntries(translationEngines)) persisted.translationEngines = translationEngines;
3333
3457
  return persisted;
@@ -3343,6 +3467,7 @@ function isPersistedGlobalSettingsEmpty(settings) {
3343
3467
  */
3344
3468
  var GlobalSettingsManager = class {
3345
3469
  settingsPath;
3470
+ writeChain = Promise.resolve();
3346
3471
  constructor(settingsPath = getDefaultGlobalSettingsPath()) {
3347
3472
  this.settingsPath = settingsPath;
3348
3473
  }
@@ -3367,29 +3492,41 @@ var GlobalSettingsManager = class {
3367
3492
  return this.parseSettingsContent(content);
3368
3493
  }
3369
3494
  async writeSettings(update) {
3370
- const currentContent = await reactiveReadFile(this.settingsPath);
3371
- const fileExists = currentContent !== null;
3372
- const current = this.parseSettingsContent(currentContent);
3373
- const persisted = toPersistedGlobalSettings(OpenSpecUIGlobalSettingsSchema.parse({
3374
- ...current,
3375
- translationCache: {
3376
- ...current.translationCache,
3377
- ...update.translationCache
3378
- },
3379
- translationEngines: {
3380
- ...current.translationEngines,
3381
- openai: mergeNullablePatch(current.translationEngines.openai, update.translationEngines?.openai),
3382
- local: mergeNullablePatch(current.translationEngines.local, update.translationEngines?.local),
3383
- localCt2: mergeNullablePatch(current.translationEngines.localCt2, update.translationEngines?.localCt2),
3384
- localLlama: mergeNullablePatch(current.translationEngines.localLlama, update.translationEngines?.localLlama)
3385
- }
3386
- }));
3387
- if (isPersistedGlobalSettingsEmpty(persisted) && !fileExists) return;
3388
- const serialized = isPersistedGlobalSettingsEmpty(persisted) ? "{}" : JSON.stringify(persisted, null, 2);
3389
- if (currentContent === serialized) return;
3390
- await mkdir$1(dirname$1(this.settingsPath), { recursive: true });
3391
- await writeFile$1(this.settingsPath, serialized, "utf-8");
3392
- updateReactiveFileCache(this.settingsPath, serialized);
3495
+ return this.enqueueWrite(async () => {
3496
+ const currentContent = await reactiveReadFile(this.settingsPath);
3497
+ const fileExists = currentContent !== null;
3498
+ const current = this.parseSettingsContent(currentContent);
3499
+ const persisted = toPersistedGlobalSettings(OpenSpecUIGlobalSettingsSchema.parse({
3500
+ ...current,
3501
+ translation: {
3502
+ ...current.translation,
3503
+ ...update.translation
3504
+ },
3505
+ translationCache: {
3506
+ ...current.translationCache,
3507
+ ...update.translationCache
3508
+ },
3509
+ translationEngines: {
3510
+ ...current.translationEngines,
3511
+ engineId: update.translationEngines?.engineId ?? current.translationEngines.engineId,
3512
+ openai: mergeNullablePatch(current.translationEngines.openai, update.translationEngines?.openai),
3513
+ local: mergeNullablePatch(current.translationEngines.local, update.translationEngines?.local),
3514
+ localCt2: mergeNullablePatch(current.translationEngines.localCt2, update.translationEngines?.localCt2),
3515
+ localLlama: mergeNullablePatch(current.translationEngines.localLlama, update.translationEngines?.localLlama)
3516
+ }
3517
+ }));
3518
+ if (isPersistedGlobalSettingsEmpty(persisted) && !fileExists) return;
3519
+ const serialized = isPersistedGlobalSettingsEmpty(persisted) ? "{}" : JSON.stringify(persisted, null, 2);
3520
+ if (currentContent === serialized) return;
3521
+ await mkdir$1(dirname$1(this.settingsPath), { recursive: true });
3522
+ await writeFile$1(this.settingsPath, serialized, "utf-8");
3523
+ updateReactiveFileCache(this.settingsPath, serialized);
3524
+ });
3525
+ }
3526
+ enqueueWrite(operation) {
3527
+ const run = this.writeChain.then(operation, operation);
3528
+ this.writeChain = run.then(() => void 0, () => void 0);
3529
+ return run;
3393
3530
  }
3394
3531
  };
3395
3532
 
@@ -3508,7 +3645,7 @@ function appendOptionalDependencyFlag(args, field) {
3508
3645
  args.push("--save-optional");
3509
3646
  }
3510
3647
  function appendAllowBuildFlags(args, packages) {
3511
- for (const packageName of packages) args.push("--allow-build", packageName);
3648
+ for (const packageName of packages) args.push(`--allow-build=${packageName}`);
3512
3649
  }
3513
3650
  const RUNTIME_PACKAGE_INSTALL_STRATEGIES = [
3514
3651
  {
@@ -5432,4 +5569,4 @@ const PtyServerMessageSchema = z.discriminatedUnion("type", [
5432
5569
  ]);
5433
5570
 
5434
5571
  //#endregion
5435
- export { AI_TOOLS, ApplyInstructionsContextFilesSchema, ApplyInstructionsSchema, ApplyTaskSchema, ArtifactInstructionsSchema, ArtifactStatusSchema, BUILTIN_SOUND_IDS, BUILTIN_SOUND_OPTIONS, BUILTIN_TERMINAL_SPAWN_COMMANDS, BatchTranslateEventSchema, BatchTranslateInputSchema, BuiltinSoundIdSchema, CODE_EDITOR_THEME_VALUES, CUSTOM_SOUND_ADD_VALUE, ChangeFileSchema, ChangeSchema, ChangeStatusSchema, CliExecutor, CodeEditorThemeSchema, ConfigManager, CustomSoundHashSchema, CustomSoundIdSchema, CustomSoundMetadataFileSchema, CustomSoundMetadataSchema, DASHBOARD_METRIC_KEYS, DEFAULT_BELL_SOUND_ID, DEFAULT_CONFIG, DEFAULT_GIT_DIFF_EAGER_LINE_BUDGET, DEFAULT_GLOBAL_SETTINGS, DEFAULT_NOTIFICATION_SOUND_ID, DEFAULT_TERMINAL_DARK_THEME, DEFAULT_TERMINAL_LIGHT_THEME, DEFAULT_TERMINAL_THEME_MODE, DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, DEFAULT_TRANSLATION_ENGINE_ID, DOCUMENT_TRANSLATION_DISPLAY_MODES, DashboardConfigSchema, DeltaOperationType, DeltaSchema, DeltaSpecSchema, DependencyInfoSchema, DocumentTranslationConfigSchema, DocumentTranslationDisplayModeSchema, FILE_PREVIEW_KINDS, GitConfigSchema, GlobalSettingsManager, HOSTED_SHELL_PROTOCOL_VERSION, LEGACY_SOUND_ID_MAP, LOCAL_MODEL_PROFILE_DEFINITIONS, LocalModelAssetLogSchema, LocalModelAssetPlanSnapshotSchema, LocalModelAssetStateSchema, LocalModelDownloadStatusSchema, LocalModelLifecycleFileStateSchema, LocalModelLifecycleGroupStateSchema, LocalModelProfileLoadStateSchema, LocalModelProfileManifestFileSchema, LocalModelProfileManifestGroupSchema, LocalModelProfileManifestSchema, LocalModelProfileStatusSchema, MAX_TRANSLATION_CACHE_ENTRY_LIMIT, MIN_TRANSLATION_CACHE_ENTRY_LIMIT, ManagedLocalCatalogSourceSchema, MarkdownParser, MarkdownReadingPluginRegistry, NOTIFICATION_SOUND_OPTIONS, NOTIFICATION_SOUND_VALUES, NotificationActionSchema, NotificationGroupKeySchema, NotificationPublishInputSchema, NotificationRecordSchema, NotificationSettingsSchema, NotificationSoundSchema, NotificationSourceSchema, OFFICIAL_APP_BASE_URL, OPENSPECUI_HOOKS_VERSION, OPENSPECUI_RUNTIME_CAPABILITIES, OPEN_SPEC_READING_SECTIONS_PROJECTION_ID, OPEN_SPEC_SPEC_PROJECTION_ID, OPSX_AGENT_INVOCATION_MODE_VALUES, OpenSpecAdapter, OpenSpecUIConfigSchema, OpenSpecUIGlobalSettingsSchema, OpenSpecWatcher, OpsxAgentInvocationModeSchema, OpsxConfigSchema, OpsxKernel, ProjectWatcher, PtyAttachMessageSchema, PtyBellResponseSchema, PtyBufferResponseSchema, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, PtyPlatformSchema, PtyProcessTitleResponseSchema, PtyResizeMessageSchema, PtyServerMessageSchema, PtyTitleResponseSchema, ReactiveContext, ReactiveState, RequirementSchema, SERVICE_TRANSLATION_ENGINE_IDS, SILENT_SOUND_ID, ScenarioStepKeywordSchema, ScenarioStepSchema, SchemaArtifactSchema, SchemaDetailSchema, SchemaInfoSchema, SchemaResolutionSchema, ServiceTranslationEngineIdSchema, SoundConfigIdSchema, SoundIdSchema, SpecSchema, TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TERMINAL_COMMAND_FIELD_TYPE_VALUES, TERMINAL_SHELL_QUOTE_STYLE_VALUES, TERMINAL_THEME_MODE_VALUES, TERMINAL_THEME_VALUES, TOOL_WORKFLOW_TO_SKILL_DIR, TRANSLATION_CACHE_POLICY_VERSION, TRANSLATION_ENGINE_IDS, TRANSLATION_ENGINE_MANIFESTS, TRANSLATOR_CONTRACT_VERSION, TaskSchema, TemplatesSchema, TerminalBellSoundSchema, TerminalCommandFieldSchema, TerminalConfigSchema, TerminalControlParser, TerminalInvocationSettingsSchema, TerminalNotificationParser, TerminalRendererEngineSchema, TerminalShellProfileSchema, TerminalShellQuoteStyleSchema, TerminalSpawnCommandSchema, TerminalThemeModeSchema, TerminalThemeSchema, TranslationCacheEntrySchema, TranslationCacheReadInputSchema, TranslationCacheSettingsSchema, TranslationCacheStatsSchema, TranslationCacheWriteInputSchema, TranslationDownloadFilePlanSchema, TranslationDownloadGroupPlanSchema, TranslationEngineAssetStateSchema, TranslationEngineAssetStatusSchema, TranslationEngineDependencyStateSchema, TranslationEngineDependencyStatusSchema, TranslationEngineGlobalSettingsSchema, TranslationEngineIdSchema, TranslationEngineInstallLogEventSchema, TranslationEngineInstallLogStreamSchema, TranslationEngineLifecycleEventSchema, TranslationEngineLifecycleStatusSchema, TranslationEngineProjectSettingsSchema, TranslationEngineRuntimeStateSchema, TranslationEngineRuntimeStatusSchema, TranslationLocalCt2SettingsSchema, TranslationLocalLlamaSettingsSchema, TranslationLocalSettingsSchema, TranslationOpenAISettingsSchema, VIRTUAL_PROJECT_DIRNAME, Validator, acquireWatcher, annotateOpenSpecFacts, annotateOpenSpecMarkdown, buildBackendHealthPayload, buildCliRunnerCandidates, buildEmbeddedUiLaunchUrl, buildHostedLaunchUrl, buildLocalDownloadPlanFromRepositoryFiles, buildLocalDownloadPlanFromRuntimeProfileFiles, buildMarkdownParentMap, buildOpsxEntityDetail, buildRuntimePackageInstallCommand, builtinOpenSpecReadingPlugin, checkLocalDirectionalModelLanguagePair, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createCleanCliEnv, createFileChangeObservable, createMarkdownReadingDocument, createMarkdownReadingDocumentFromFacts, createOpenSpecReadingPlugin, createTranslationEngineLifecycleStatus, customHashFromSoundId, detectRuntimePackageManager, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getBuiltinSoundUrl, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getDefaultGlobalSettingsPath, getDetectedProjectTools, getManagedLocalTranslationEngineManifest, getMarkdownAnnotation, getMarkdownAnnotationsForFact, getMarkdownFactSpan, getMarkdownHeadingEnd, getMarkdownHeadingFacts, getNotificationGroupKey, getNotificationGroupLabel, getOpenSpecAnnotation, getOpenSpecAnnotationsForFact, getOpenSpecProjectionAnnotation, getOpenSpecReadingSections, getOpsxEntityMetadataPath, getOpsxEntityRootRelativePath, getProjectWatcher, getTerminalCommandDefaultValues, getToolById, getToolInitStates, getTranslationEngineLifecycleMessage, getTranslationEngineManifest, getWatchedProjectDir, getWatcherRuntimeStatus, groupNotifications, inferFileMime, inferFilePreviewKind, inferLocalDirectionalModelLanguagePair, initWatcherPool, isBackendHealthRuntimeMetadata, isDirectionalManagedLocalTranslationEngineId, isGlobPattern, isHostedBackendHealthResponse, isManagedLocalTranslationEngineId, isOpsxGlobPattern, isPreviewableFile, isSupportedEmbeddedUiUrl, isTerminalRendererEngine, isTextLikeFile, isTextLikeMime, isToolConfigured, isTranslationEngineDependencyReady, isTranslationEngineRuntimeReady, isWatcherPoolInitialized, normalizeEmbeddedUiUrl, normalizeHostedAppBaseUrl, normalizeLegacySoundId, normalizeOpsxEntityPath, openSpecAnnotationRules, opsxGlobToRegex, opsxPathMatchesPattern, parseCliCommand, parseMarkdownFacts, parseOpenSpecMarkdownToSpec, parseOpsxEntityMetadata, parseOpsxSchemaDetail, projectAnnotatedOpenSpecToSpec, projectOpenSpecMarkdown, quoteTerminalShellArg, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, renderTerminalCommandArgs, renderTerminalSpawnCommandLine, resolveHostedAppBaseUrl, resolveRuntimePackageInstallStrategy, resolveTerminalShellDefaults, selectLocalDownloadGroup, shouldShowTranslationEngineInstallGate, sniffGlobalCli, sortMarkdownReadingPlugins, soundIdFromCustomHash, subscribeWatcherRuntimeStatus, terminalNotificationEventToPublishInput, toMarkdownFactKind, toOpsxDisplayPath, toPersistedGlobalSettings, trimMarkdownSlice };
5572
+ export { AI_TOOLS, ApplyInstructionsContextFilesSchema, ApplyInstructionsSchema, ApplyTaskSchema, ArtifactInstructionsSchema, ArtifactStatusSchema, BUILTIN_SOUND_IDS, BUILTIN_SOUND_OPTIONS, BUILTIN_TERMINAL_SPAWN_COMMANDS, BatchTranslateEventSchema, BatchTranslateInputSchema, BuiltinSoundIdSchema, CODE_EDITOR_THEME_VALUES, CUSTOM_SOUND_ADD_VALUE, ChangeFileSchema, ChangeSchema, ChangeStatusSchema, CliExecutor, CodeEditorThemeSchema, ConfigManager, CustomSoundHashSchema, CustomSoundIdSchema, CustomSoundMetadataFileSchema, CustomSoundMetadataSchema, DASHBOARD_METRIC_KEYS, DEFAULT_BELL_SOUND_ID, DEFAULT_CONFIG, DEFAULT_GIT_DIFF_EAGER_LINE_BUDGET, DEFAULT_GLOBAL_SETTINGS, DEFAULT_NOTIFICATION_SOUND_ID, DEFAULT_TERMINAL_DARK_THEME, DEFAULT_TERMINAL_LIGHT_THEME, DEFAULT_TERMINAL_THEME_MODE, DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, DEFAULT_TRANSLATION_ENGINE_ID, DOCUMENT_TRANSLATION_DISPLAY_MODES, DashboardConfigSchema, DeltaOperationType, DeltaSchema, DeltaSpecSchema, DependencyInfoSchema, DocumentTranslationConfigSchema, DocumentTranslationConfigUpdateSchema, DocumentTranslationDisplayModeSchema, DocumentTranslationGlobalSettingsUpdateSchema, FILE_PREVIEW_KINDS, GitConfigSchema, GlobalSettingsManager, HOSTED_SHELL_PROTOCOL_VERSION, LEGACY_SOUND_ID_MAP, LOCAL_MODEL_PROFILE_DEFINITIONS, LocalModelAssetLogSchema, LocalModelAssetPlanSnapshotSchema, LocalModelAssetStateSchema, LocalModelDownloadStatusSchema, LocalModelLifecycleFileStateSchema, LocalModelLifecycleGroupStateSchema, LocalModelProfileLoadStateSchema, LocalModelProfileManifestFileSchema, LocalModelProfileManifestGroupSchema, LocalModelProfileManifestSchema, LocalModelProfileStatusSchema, MAX_TRANSLATION_CACHE_ENTRY_LIMIT, MIN_TRANSLATION_CACHE_ENTRY_LIMIT, ManagedLocalCatalogSourceSchema, MarkdownParser, MarkdownReadingPluginRegistry, NOTIFICATION_SOUND_OPTIONS, NOTIFICATION_SOUND_VALUES, NotificationActionSchema, NotificationGroupKeySchema, NotificationPublishInputSchema, NotificationRecordSchema, NotificationSettingsSchema, NotificationSoundSchema, NotificationSourceSchema, OFFICIAL_APP_BASE_URL, OPENSPECUI_HOOKS_VERSION, OPENSPECUI_RUNTIME_CAPABILITIES, OPEN_SPEC_READING_SECTIONS_PROJECTION_ID, OPEN_SPEC_SPEC_PROJECTION_ID, OPSX_AGENT_INVOCATION_MODE_VALUES, OpenSpecAdapter, OpenSpecUIConfigSchema, OpenSpecUIGlobalSettingsSchema, OpenSpecUIGlobalSettingsUpdateSchema, OpenSpecWatcher, OpsxAgentInvocationModeSchema, OpsxConfigSchema, OpsxKernel, ProjectWatcher, PtyAttachMessageSchema, PtyBellResponseSchema, PtyBufferResponseSchema, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, PtyPlatformSchema, PtyProcessTitleResponseSchema, PtyResizeMessageSchema, PtyServerMessageSchema, PtyTitleResponseSchema, ReactiveContext, ReactiveState, RequirementSchema, SERVICE_TRANSLATION_ENGINE_IDS, SILENT_SOUND_ID, ScenarioStepKeywordSchema, ScenarioStepSchema, SchemaArtifactSchema, SchemaDetailSchema, SchemaInfoSchema, SchemaResolutionSchema, ServiceTranslationEngineIdSchema, SoundConfigIdSchema, SoundIdSchema, SpecSchema, TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TERMINAL_COMMAND_FIELD_TYPE_VALUES, TERMINAL_SHELL_QUOTE_STYLE_VALUES, TERMINAL_THEME_MODE_VALUES, TERMINAL_THEME_VALUES, TOOL_WORKFLOW_TO_SKILL_DIR, TRANSLATION_CACHE_POLICY_VERSION, TRANSLATION_ENGINE_IDS, TRANSLATION_ENGINE_MANIFESTS, TRANSLATOR_CONTRACT_VERSION, TaskSchema, TemplatesSchema, TerminalBellSoundSchema, TerminalCommandFieldSchema, TerminalConfigSchema, TerminalControlParser, TerminalInvocationSettingsSchema, TerminalNotificationParser, TerminalRendererEngineSchema, TerminalShellProfileSchema, TerminalShellQuoteStyleSchema, TerminalSpawnCommandSchema, TerminalThemeModeSchema, TerminalThemeSchema, TranslationCacheEntrySchema, TranslationCacheReadInputSchema, TranslationCacheSettingsSchema, TranslationCacheSettingsUpdateSchema, TranslationCacheStatsSchema, TranslationCacheWriteInputSchema, TranslationDownloadFilePlanSchema, TranslationDownloadGroupPlanSchema, TranslationEngineAssetStateSchema, TranslationEngineAssetStatusSchema, TranslationEngineDependencyStateSchema, TranslationEngineDependencyStatusSchema, TranslationEngineGlobalSettingsSchema, TranslationEngineGlobalSettingsUpdateSchema, TranslationEngineIdSchema, TranslationEngineInstallLogEventSchema, TranslationEngineInstallLogStreamSchema, TranslationEngineLifecycleEventSchema, TranslationEngineLifecycleStatusSchema, TranslationEngineProjectSettingsSchema, TranslationEngineProjectSettingsUpdateSchema, TranslationEngineRuntimeStateSchema, TranslationEngineRuntimeStatusSchema, TranslationLocalCt2SettingsSchema, TranslationLocalCt2SettingsUpdateSchema, TranslationLocalLlamaSettingsSchema, TranslationLocalLlamaSettingsUpdateSchema, TranslationLocalSettingsSchema, TranslationLocalSettingsUpdateSchema, TranslationOpenAISettingsSchema, TranslationOpenAISettingsUpdateSchema, VIRTUAL_PROJECT_DIRNAME, Validator, acquireWatcher, annotateOpenSpecFacts, annotateOpenSpecMarkdown, buildBackendHealthPayload, buildCliRunnerCandidates, buildEmbeddedUiLaunchUrl, buildHostedLaunchUrl, buildLocalDownloadPlanFromRepositoryFiles, buildLocalDownloadPlanFromRuntimeProfileFiles, buildMarkdownParentMap, buildOpsxEntityDetail, buildRuntimePackageInstallCommand, builtinOpenSpecReadingPlugin, checkLocalDirectionalModelLanguagePair, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createCleanCliEnv, createFileChangeObservable, createMarkdownReadingDocument, createMarkdownReadingDocumentFromFacts, createOpenSpecReadingPlugin, createTranslationEngineLifecycleStatus, customHashFromSoundId, detectRuntimePackageManager, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getBuiltinSoundUrl, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getDefaultGlobalSettingsPath, getDetectedProjectTools, getManagedLocalTranslationEngineManifest, getMarkdownAnnotation, getMarkdownAnnotationsForFact, getMarkdownFactSpan, getMarkdownHeadingEnd, getMarkdownHeadingFacts, getNotificationGroupKey, getNotificationGroupLabel, getOpenSpecAnnotation, getOpenSpecAnnotationsForFact, getOpenSpecProjectionAnnotation, getOpenSpecReadingSections, getOpsxEntityMetadataPath, getOpsxEntityRootRelativePath, getProjectWatcher, getTerminalCommandDefaultValues, getToolById, getToolInitStates, getTranslationEngineLifecycleMessage, getTranslationEngineManifest, getWatchedProjectDir, getWatcherRuntimeStatus, groupNotifications, inferFileMime, inferFilePreviewKind, inferLocalDirectionalModelLanguagePair, initWatcherPool, isBackendHealthRuntimeMetadata, isBatchTranslationAbort, isDirectionalManagedLocalTranslationEngineId, isGlobPattern, isHostedBackendHealthResponse, isManagedLocalTranslationEngineId, isOpsxGlobPattern, isPreviewableFile, isSupportedEmbeddedUiUrl, isTerminalRendererEngine, isTextLikeFile, isTextLikeMime, isToolConfigured, isTranslationEngineDependencyReady, isTranslationEngineRuntimeReady, isWatcherPoolInitialized, normalizeBatchTranslationError, normalizeEmbeddedUiUrl, normalizeHostedAppBaseUrl, normalizeLegacySoundId, normalizeOpsxEntityPath, openSpecAnnotationRules, opsxGlobToRegex, opsxPathMatchesPattern, parseCliCommand, parseMarkdownFacts, parseOpenSpecMarkdownToSpec, parseOpsxEntityMetadata, parseOpsxSchemaDetail, projectAnnotatedOpenSpecToSpec, projectOpenSpecMarkdown, quoteTerminalShellArg, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, renderTerminalCommandArgs, renderTerminalSpawnCommandLine, resolveHostedAppBaseUrl, resolveRuntimePackageInstallStrategy, resolveTerminalShellDefaults, runControlledTranslationTask, selectLocalDownloadGroup, shouldShowTranslationEngineInstallGate, sniffGlobalCli, sortMarkdownReadingPlugins, soundIdFromCustomHash, subscribeWatcherRuntimeStatus, terminalNotificationEventToPublishInput, toMarkdownFactKind, toOpsxDisplayPath, toPersistedGlobalSettings, trimMarkdownSlice };
@@ -1,4 +1,4 @@
1
- import { Nt as TranslationModelDownloadPlan, W as TranslationDownloadGroupPlan } from "./translator-prn3W9lf.mjs";
1
+ import { G as TranslationDownloadGroupPlan, Rt as TranslationModelDownloadPlan } from "./translator-CS7MsNZp.mjs";
2
2
 
3
3
  //#region src/local-download-profiles.d.ts
4
4
  declare const LOCAL_MODEL_PROFILE_DEFINITIONS: readonly [{
@@ -1,3 +1,3 @@
1
- import "./translator-prn3W9lf.mjs";
2
- import { a as buildLocalDownloadPlanFromRepositoryFiles, i as LocalRuntimeProfileFiles, n as LocalModelProfileId, o as buildLocalDownloadPlanFromRuntimeProfileFiles, r as LocalRepositoryFile, s as selectLocalDownloadGroup, t as LOCAL_MODEL_PROFILE_DEFINITIONS } from "./local-download-profiles-GKs2OOqJ.mjs";
1
+ import "./translator-CS7MsNZp.mjs";
2
+ import { a as buildLocalDownloadPlanFromRepositoryFiles, i as LocalRuntimeProfileFiles, n as LocalModelProfileId, o as buildLocalDownloadPlanFromRuntimeProfileFiles, r as LocalRepositoryFile, s as selectLocalDownloadGroup, t as LOCAL_MODEL_PROFILE_DEFINITIONS } from "./local-download-profiles-DIVr0mFh.mjs";
3
3
  export { LOCAL_MODEL_PROFILE_DEFINITIONS, LocalModelProfileId, LocalRepositoryFile, LocalRuntimeProfileFiles, buildLocalDownloadPlanFromRepositoryFiles, buildLocalDownloadPlanFromRuntimeProfileFiles, selectLocalDownloadGroup };
@@ -1,4 +1,4 @@
1
- import { x as SoundId } from "./sounds-3yEx1YXT.mjs";
1
+ import { x as SoundId } from "./sounds-6KwglrL2.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/terminal-control.d.ts
@@ -272,8 +272,6 @@ declare const NotificationPublishInputSchema: z.ZodObject<{
272
272
  level: z.ZodDefault<z.ZodEnum<["info", "success", "warning", "error"]>>;
273
273
  createdAt: z.ZodOptional<z.ZodNumber>;
274
274
  }, "strip", z.ZodTypeAny, {
275
- title: string;
276
- body: string;
277
275
  source: {
278
276
  type: "terminal";
279
277
  sessionId: string;
@@ -291,6 +289,8 @@ declare const NotificationPublishInputSchema: z.ZodObject<{
291
289
  groupId: string;
292
290
  title?: string | undefined;
293
291
  };
292
+ title: string;
293
+ body: string;
294
294
  actions: ({
295
295
  type: "terminal.focus";
296
296
  label: string;
@@ -304,10 +304,9 @@ declare const NotificationPublishInputSchema: z.ZodObject<{
304
304
  href: string;
305
305
  };
306
306
  })[];
307
- level: "info" | "success" | "warning" | "error";
307
+ level: "error" | "info" | "success" | "warning";
308
308
  createdAt?: number | undefined;
309
309
  }, {
310
- title: string;
311
310
  source: {
312
311
  type: "terminal";
313
312
  sessionId: string;
@@ -325,6 +324,8 @@ declare const NotificationPublishInputSchema: z.ZodObject<{
325
324
  groupId: string;
326
325
  title?: string | undefined;
327
326
  };
327
+ title: string;
328
+ createdAt?: number | undefined;
328
329
  body?: string | undefined;
329
330
  actions?: ({
330
331
  type: "terminal.focus";
@@ -339,8 +340,7 @@ declare const NotificationPublishInputSchema: z.ZodObject<{
339
340
  };
340
341
  label?: string | undefined;
341
342
  })[] | undefined;
342
- level?: "info" | "success" | "warning" | "error" | undefined;
343
- createdAt?: number | undefined;
343
+ level?: "error" | "info" | "success" | "warning" | undefined;
344
344
  }>;
345
345
  type NotificationPublishInput = z.infer<typeof NotificationPublishInputSchema>;
346
346
  declare const NotificationRecordSchema: z.ZodObject<{
@@ -446,8 +446,8 @@ declare const NotificationRecordSchema: z.ZodObject<{
446
446
  createdAt: z.ZodNumber;
447
447
  groupKey: z.ZodString;
448
448
  }, "strip", z.ZodTypeAny, {
449
- title: string;
450
- body: string;
449
+ createdAt: number;
450
+ id: string;
451
451
  source: {
452
452
  type: "terminal";
453
453
  sessionId: string;
@@ -465,6 +465,8 @@ declare const NotificationRecordSchema: z.ZodObject<{
465
465
  groupId: string;
466
466
  title?: string | undefined;
467
467
  };
468
+ title: string;
469
+ body: string;
468
470
  actions: ({
469
471
  type: "terminal.focus";
470
472
  label: string;
@@ -478,12 +480,11 @@ declare const NotificationRecordSchema: z.ZodObject<{
478
480
  href: string;
479
481
  };
480
482
  })[];
481
- level: "info" | "success" | "warning" | "error";
482
- createdAt: number;
483
- id: string;
483
+ level: "error" | "info" | "success" | "warning";
484
484
  groupKey: string;
485
485
  }, {
486
- title: string;
486
+ createdAt: number;
487
+ id: string;
487
488
  source: {
488
489
  type: "terminal";
489
490
  sessionId: string;
@@ -501,8 +502,7 @@ declare const NotificationRecordSchema: z.ZodObject<{
501
502
  groupId: string;
502
503
  title?: string | undefined;
503
504
  };
504
- createdAt: number;
505
- id: string;
505
+ title: string;
506
506
  groupKey: string;
507
507
  body?: string | undefined;
508
508
  actions?: ({
@@ -518,7 +518,7 @@ declare const NotificationRecordSchema: z.ZodObject<{
518
518
  };
519
519
  label?: string | undefined;
520
520
  })[] | undefined;
521
- level?: "info" | "success" | "warning" | "error" | undefined;
521
+ level?: "error" | "info" | "success" | "warning" | undefined;
522
522
  }>;
523
523
  type NotificationRecord = z.infer<typeof NotificationRecordSchema>;
524
524
  interface NotificationAggregate {
@@ -1,3 +1,3 @@
1
- import "./sounds-3yEx1YXT.mjs";
2
- import { C as getNotificationAggregateKey, E as groupNotifications, P as terminalNotificationEventToPublishInput, S as aggregateNotifications, T as getNotificationGroupLabel, _ as NotificationSource, a as NotificationAggregate, b as TerminalNotificationParseResult, c as NotificationGroupKeySchema, d as NotificationRecord, f as NotificationRecordSchema, g as NotificationSoundSchema, h as NotificationSound, i as NotificationActionSchema, k as TerminalControlParser, l as NotificationPublishInput, m as NotificationSettingsSchema, n as NOTIFICATION_SOUND_VALUES, o as NotificationGroup, p as NotificationSettings, r as NotificationAction, s as NotificationGroupKey, t as NOTIFICATION_SOUND_OPTIONS, u as NotificationPublishInputSchema, v as NotificationSourceSchema, w as getNotificationGroupKey, x as TerminalNotificationParser, y as TerminalNotificationEvent } from "./notifications-CJQ_F_Un.mjs";
1
+ import "./sounds-6KwglrL2.mjs";
2
+ import { C as getNotificationAggregateKey, E as groupNotifications, P as terminalNotificationEventToPublishInput, S as aggregateNotifications, T as getNotificationGroupLabel, _ as NotificationSource, a as NotificationAggregate, b as TerminalNotificationParseResult, c as NotificationGroupKeySchema, d as NotificationRecord, f as NotificationRecordSchema, g as NotificationSoundSchema, h as NotificationSound, i as NotificationActionSchema, k as TerminalControlParser, l as NotificationPublishInput, m as NotificationSettingsSchema, n as NOTIFICATION_SOUND_VALUES, o as NotificationGroup, p as NotificationSettings, r as NotificationAction, s as NotificationGroupKey, t as NOTIFICATION_SOUND_OPTIONS, u as NotificationPublishInputSchema, v as NotificationSourceSchema, w as getNotificationGroupKey, x as TerminalNotificationParser, y as TerminalNotificationEvent } from "./notifications-BDBbeTRk.mjs";
3
3
  export { NOTIFICATION_SOUND_OPTIONS, NOTIFICATION_SOUND_VALUES, NotificationAction, NotificationActionSchema, NotificationAggregate, NotificationGroup, NotificationGroupKey, NotificationGroupKeySchema, NotificationPublishInput, NotificationPublishInputSchema, NotificationRecord, NotificationRecordSchema, NotificationSettings, NotificationSettingsSchema, NotificationSound, NotificationSoundSchema, NotificationSource, NotificationSourceSchema, TerminalControlParser, TerminalNotificationEvent, TerminalNotificationParseResult, TerminalNotificationParser, aggregateNotifications, getNotificationAggregateKey, getNotificationGroupKey, getNotificationGroupLabel, groupNotifications, terminalNotificationEventToPublishInput };
@@ -1,4 +1,4 @@
1
- import { g as Spec } from "./schemas-DQzd1hgp.mjs";
1
+ import { g as Spec } from "./schemas-Dp8-Wm-X.mjs";
2
2
  import { d as MarkdownReadingPlugin, l as MarkdownReadingDocument } from "./markdown-reading-BaHZTf5f.mjs";
3
3
  import { n as OpenSpecAnnotation, t as AnnotatedOpenSpecDocument } from "./openspec-annotations-DYyP_HQh.mjs";
4
4
 
@@ -1,6 +1,6 @@
1
- import "./schemas-DQzd1hgp.mjs";
1
+ import "./schemas-Dp8-Wm-X.mjs";
2
2
  import "./markdown-facts-DempqdIX.mjs";
3
3
  import "./markdown-reading-BaHZTf5f.mjs";
4
4
  import "./openspec-annotations-DYyP_HQh.mjs";
5
- import { a as OpenSpecReadingSectionsProjection, c as ProjectedOpenSpecDocument, d as getOpenSpecReadingSections, f as parseOpenSpecMarkdownToSpec, i as OpenSpecProjectionOptions, l as createOpenSpecReadingPlugin, m as projectOpenSpecMarkdown, n as OPEN_SPEC_SPEC_PROJECTION_ID, o as OpenSpecRequirementBlock, p as projectAnnotatedOpenSpecToSpec, r as OpenSpecHeadingSection, s as OpenSpecScenarioBlock, t as OPEN_SPEC_READING_SECTIONS_PROJECTION_ID, u as getOpenSpecProjectionAnnotation } from "./openspec-projection-BbuPTbvj.mjs";
5
+ import { a as OpenSpecReadingSectionsProjection, c as ProjectedOpenSpecDocument, d as getOpenSpecReadingSections, f as parseOpenSpecMarkdownToSpec, i as OpenSpecProjectionOptions, l as createOpenSpecReadingPlugin, m as projectOpenSpecMarkdown, n as OPEN_SPEC_SPEC_PROJECTION_ID, o as OpenSpecRequirementBlock, p as projectAnnotatedOpenSpecToSpec, r as OpenSpecHeadingSection, s as OpenSpecScenarioBlock, t as OPEN_SPEC_READING_SECTIONS_PROJECTION_ID, u as getOpenSpecProjectionAnnotation } from "./openspec-projection-CmxjMsxS.mjs";
6
6
  export { OPEN_SPEC_READING_SECTIONS_PROJECTION_ID, OPEN_SPEC_SPEC_PROJECTION_ID, OpenSpecHeadingSection, OpenSpecProjectionOptions, OpenSpecReadingSectionsProjection, OpenSpecRequirementBlock, OpenSpecScenarioBlock, ProjectedOpenSpecDocument, createOpenSpecReadingPlugin, getOpenSpecProjectionAnnotation, getOpenSpecReadingSections, parseOpenSpecMarkdownToSpec, projectAnnotatedOpenSpecToSpec, projectOpenSpecMarkdown };
@@ -1,4 +1,4 @@
1
- import { n as ChangeFile } from "./schemas-DQzd1hgp.mjs";
1
+ import { n as ChangeFile } from "./schemas-Dp8-Wm-X.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/opsx-types.d.ts
@@ -1,3 +1,3 @@
1
- import { a as OpsxEntityFile, c as buildOpsxEntityDetail, d as isOpsxGlobPattern, f as normalizeOpsxEntityPath, h as parseOpsxEntityMetadata, i as OpsxEntityDiagnostic, l as getOpsxEntityMetadataPath, m as opsxPathMatchesPattern, n as OpsxEntityArtifactFile, o as OpsxEntityReadOptions, p as opsxGlobToRegex, r as OpsxEntityDetail, s as OpsxEntityStage, t as OpsxEntityArtifact, u as getOpsxEntityRootRelativePath } from "./opsx-entity-BO9G2SCW.mjs";
2
- import "./schemas-DQzd1hgp.mjs";
1
+ import { a as OpsxEntityFile, c as buildOpsxEntityDetail, d as isOpsxGlobPattern, f as normalizeOpsxEntityPath, h as parseOpsxEntityMetadata, i as OpsxEntityDiagnostic, l as getOpsxEntityMetadataPath, m as opsxPathMatchesPattern, n as OpsxEntityArtifactFile, o as OpsxEntityReadOptions, p as opsxGlobToRegex, r as OpsxEntityDetail, s as OpsxEntityStage, t as OpsxEntityArtifact, u as getOpsxEntityRootRelativePath } from "./opsx-entity-CRa2u1j3.mjs";
2
+ import "./schemas-Dp8-Wm-X.mjs";
3
3
  export { OpsxEntityArtifact, OpsxEntityArtifactFile, OpsxEntityDetail, OpsxEntityDiagnostic, OpsxEntityFile, OpsxEntityReadOptions, OpsxEntityStage, buildOpsxEntityDetail, getOpsxEntityMetadataPath, getOpsxEntityRootRelativePath, isOpsxGlobPattern, normalizeOpsxEntityPath, opsxGlobToRegex, opsxPathMatchesPattern, parseOpsxEntityMetadata };
@@ -1,4 +1,4 @@
1
- import { i as OpsxEntityDiagnostic, j as SchemaDetail } from "./opsx-entity-BO9G2SCW.mjs";
1
+ import { i as OpsxEntityDiagnostic, j as SchemaDetail } from "./opsx-entity-CRa2u1j3.mjs";
2
2
 
3
3
  //#region src/opsx-schema-detail.d.ts
4
4
  interface ParsedOpsxSchemaDetail {