@openspecui/core 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+ //#region src/hosted-app.ts
2
+ const OFFICIAL_APP_BASE_URL = "https://app.openspecui.com";
3
+ function isRecord(value) {
4
+ return typeof value === "object" && value !== null;
5
+ }
6
+ function withHttpsProtocol(value) {
7
+ if (/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//.test(value)) return value;
8
+ return `https://${value}`;
9
+ }
10
+ function parseVersionTuple(raw) {
11
+ const match = raw.trim().match(/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/);
12
+ if (!match) return null;
13
+ return {
14
+ major: Number(match[1]),
15
+ minor: Number(match[2]),
16
+ patch: Number(match[3])
17
+ };
18
+ }
19
+ function parseCompatibilityRange(range) {
20
+ const match = range.trim().match(/^~(\d+)\.(\d+)\.\d+$/);
21
+ if (!match) return null;
22
+ return {
23
+ major: Number(match[1]),
24
+ minor: Number(match[2])
25
+ };
26
+ }
27
+ function normalizeHostedAppBaseUrl(input) {
28
+ const trimmed = input.trim();
29
+ if (!trimmed) throw new Error("Hosted app base URL must not be empty");
30
+ let parsed;
31
+ try {
32
+ parsed = new URL(withHttpsProtocol(trimmed));
33
+ } catch (error) {
34
+ throw new Error(`Invalid hosted app base URL: ${error instanceof Error ? error.message : String(error)}`);
35
+ }
36
+ parsed.hash = "";
37
+ parsed.search = "";
38
+ const pathname = parsed.pathname.replace(/\/+$/, "");
39
+ parsed.pathname = pathname.length > 0 ? pathname : "/";
40
+ return parsed.toString().replace(/\/$/, parsed.pathname === "/" ? "" : "");
41
+ }
42
+ function resolveHostedAppBaseUrl(options) {
43
+ return normalizeHostedAppBaseUrl(options.override?.trim() || options.configured?.trim() || OFFICIAL_APP_BASE_URL);
44
+ }
45
+ function buildHostedVersionManifestUrl(baseUrl) {
46
+ return `${normalizeHostedAppBaseUrl(baseUrl)}/version.json`;
47
+ }
48
+ function buildHostedLaunchUrl(options) {
49
+ const url = new URL(normalizeHostedAppBaseUrl(options.baseUrl));
50
+ url.searchParams.set("api", options.apiBaseUrl);
51
+ return url.toString();
52
+ }
53
+ function isHostedAppVersionManifest(value) {
54
+ if (!isRecord(value)) return false;
55
+ if (value.packageName !== "openspecui") return false;
56
+ if (typeof value.generatedAt !== "string") return false;
57
+ if (typeof value.defaultChannel !== "string") return false;
58
+ if (!isRecord(value.channels)) return false;
59
+ if (!Array.isArray(value.compatibility)) return false;
60
+ return Object.values(value.channels).every((channel) => {
61
+ if (!isRecord(channel)) return false;
62
+ return typeof channel.id === "string" && typeof channel.kind === "string" && typeof channel.selector === "string" && typeof channel.resolvedVersion === "string" && typeof channel.rootPath === "string" && typeof channel.shellPath === "string" && typeof channel.major === "number";
63
+ });
64
+ }
65
+ function isHostedBackendHealthResponse(value) {
66
+ if (!isRecord(value)) return false;
67
+ return value.status === "ok" && typeof value.projectDir === "string" && typeof value.projectName === "string" && typeof value.watcherEnabled === "boolean" && typeof value.openspecuiVersion === "string";
68
+ }
69
+ function resolveHostedChannelForVersion(manifest, version) {
70
+ const parsed = parseVersionTuple(version);
71
+ if (!parsed) return null;
72
+ for (const entry of manifest.compatibility) {
73
+ const range = parseCompatibilityRange(entry.range);
74
+ if (!range) continue;
75
+ if (!manifest.channels[entry.channel]) continue;
76
+ if (range.major === parsed.major && range.minor === parsed.minor) return entry.channel;
77
+ }
78
+ const exactMinorChannel = `v${parsed.major}.${parsed.minor}`;
79
+ if (manifest.channels[exactMinorChannel]) return exactMinorChannel;
80
+ const majorChannel = `v${parsed.major}`;
81
+ if (manifest.channels[majorChannel]) return majorChannel;
82
+ return manifest.channels[manifest.defaultChannel] ? manifest.defaultChannel : null;
83
+ }
84
+
85
+ //#endregion
86
+ export { isHostedBackendHealthResponse as a, resolveHostedChannelForVersion as c, isHostedAppVersionManifest as i, buildHostedLaunchUrl as n, normalizeHostedAppBaseUrl as o, buildHostedVersionManifestUrl as r, resolveHostedAppBaseUrl as s, OFFICIAL_APP_BASE_URL as t };
@@ -0,0 +1,46 @@
1
+ //#region src/hosted-app.d.ts
2
+ declare const OFFICIAL_APP_BASE_URL = "https://app.openspecui.com";
3
+ type HostedAppChannelKind = 'latest' | 'major' | 'minor';
4
+ interface HostedAppChannelManifest {
5
+ id: string;
6
+ kind: HostedAppChannelKind;
7
+ selector: string;
8
+ resolvedVersion: string;
9
+ rootPath: string;
10
+ shellPath: string;
11
+ major: number;
12
+ minor?: number;
13
+ }
14
+ interface HostedAppCompatibilityEntry {
15
+ range: string;
16
+ channel: string;
17
+ }
18
+ interface HostedAppVersionManifest {
19
+ packageName: 'openspecui';
20
+ generatedAt: string;
21
+ defaultChannel: string;
22
+ channels: Record<string, HostedAppChannelManifest>;
23
+ compatibility: HostedAppCompatibilityEntry[];
24
+ }
25
+ interface HostedBackendHealthResponse {
26
+ status: 'ok';
27
+ projectDir: string;
28
+ projectName: string;
29
+ watcherEnabled: boolean;
30
+ openspecuiVersion: string;
31
+ }
32
+ declare function normalizeHostedAppBaseUrl(input: string): string;
33
+ declare function resolveHostedAppBaseUrl(options: {
34
+ override?: string | null;
35
+ configured?: string | null;
36
+ }): string;
37
+ declare function buildHostedVersionManifestUrl(baseUrl: string): string;
38
+ declare function buildHostedLaunchUrl(options: {
39
+ baseUrl: string;
40
+ apiBaseUrl: string;
41
+ }): string;
42
+ declare function isHostedAppVersionManifest(value: unknown): value is HostedAppVersionManifest;
43
+ declare function isHostedBackendHealthResponse(value: unknown): value is HostedBackendHealthResponse;
44
+ declare function resolveHostedChannelForVersion(manifest: HostedAppVersionManifest, version: string): string | null;
45
+ //#endregion
46
+ export { HostedBackendHealthResponse as a, buildHostedVersionManifestUrl as c, normalizeHostedAppBaseUrl as d, resolveHostedAppBaseUrl as f, HostedAppVersionManifest as i, isHostedAppVersionManifest as l, HostedAppChannelManifest as n, OFFICIAL_APP_BASE_URL as o, resolveHostedChannelForVersion as p, HostedAppCompatibilityEntry as r, buildHostedLaunchUrl as s, HostedAppChannelKind as t, isHostedBackendHealthResponse as u };
@@ -0,0 +1,2 @@
1
+ import { a as HostedBackendHealthResponse, c as buildHostedVersionManifestUrl, d as normalizeHostedAppBaseUrl, f as resolveHostedAppBaseUrl, i as HostedAppVersionManifest, l as isHostedAppVersionManifest, n as HostedAppChannelManifest, o as OFFICIAL_APP_BASE_URL, p as resolveHostedChannelForVersion, r as HostedAppCompatibilityEntry, s as buildHostedLaunchUrl, t as HostedAppChannelKind, u as isHostedBackendHealthResponse } from "./hosted-app-CY1XHUcf.mjs";
2
+ export { HostedAppChannelKind, HostedAppChannelManifest, HostedAppCompatibilityEntry, HostedAppVersionManifest, HostedBackendHealthResponse, OFFICIAL_APP_BASE_URL, buildHostedLaunchUrl, buildHostedVersionManifestUrl, isHostedAppVersionManifest, isHostedBackendHealthResponse, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl, resolveHostedChannelForVersion };
@@ -0,0 +1,3 @@
1
+ import { a as isHostedBackendHealthResponse, c as resolveHostedChannelForVersion, i as isHostedAppVersionManifest, n as buildHostedLaunchUrl, o as normalizeHostedAppBaseUrl, r as buildHostedVersionManifestUrl, s as resolveHostedAppBaseUrl, t as OFFICIAL_APP_BASE_URL } from "./hosted-app-Bn-MNDZ0.mjs";
2
+
3
+ export { OFFICIAL_APP_BASE_URL, buildHostedLaunchUrl, buildHostedVersionManifestUrl, isHostedAppVersionManifest, isHostedBackendHealthResponse, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl, resolveHostedChannelForVersion };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-RBULE8_G.mjs";
1
+ import { a as HostedBackendHealthResponse, c as buildHostedVersionManifestUrl, d as normalizeHostedAppBaseUrl, f as resolveHostedAppBaseUrl, i as HostedAppVersionManifest, l as isHostedAppVersionManifest, n as HostedAppChannelManifest, o as OFFICIAL_APP_BASE_URL, p as resolveHostedChannelForVersion, r as HostedAppCompatibilityEntry, s as buildHostedLaunchUrl, t as HostedAppChannelKind, u as isHostedBackendHealthResponse } from "./hosted-app-CY1XHUcf.mjs";
2
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-k65bc8bW.mjs";
2
3
  import { AsyncLocalStorage } from "node:async_hooks";
3
4
  import { z } from "zod";
4
5
  import { EventEmitter } from "events";
@@ -1442,6 +1443,8 @@ declare const OpenSpecUIConfigSchema: z.ZodObject<{
1442
1443
  }, {
1443
1444
  theme?: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord" | undefined;
1444
1445
  }>>;
1446
+ /** Hosted app 基础 URL(空字符串表示使用官方默认值) */
1447
+ appBaseUrl: z.ZodDefault<z.ZodString>;
1445
1448
  /** 终端配置 */
1446
1449
  terminal: z.ZodDefault<z.ZodObject<{
1447
1450
  fontSize: z.ZodDefault<z.ZodNumber>;
@@ -1482,6 +1485,7 @@ declare const OpenSpecUIConfigSchema: z.ZodObject<{
1482
1485
  codeEditor: {
1483
1486
  theme: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord";
1484
1487
  };
1488
+ appBaseUrl: string;
1485
1489
  terminal: {
1486
1490
  fontSize: number;
1487
1491
  fontFamily: string;
@@ -1502,6 +1506,7 @@ declare const OpenSpecUIConfigSchema: z.ZodObject<{
1502
1506
  codeEditor?: {
1503
1507
  theme?: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord" | undefined;
1504
1508
  } | undefined;
1509
+ appBaseUrl?: string | undefined;
1505
1510
  terminal?: {
1506
1511
  fontSize?: number | undefined;
1507
1512
  fontFamily?: string | undefined;
@@ -1522,6 +1527,7 @@ type OpenSpecUIConfigUpdate = {
1522
1527
  };
1523
1528
  theme?: OpenSpecUIConfig['theme'];
1524
1529
  codeEditor?: Partial<OpenSpecUIConfig['codeEditor']>;
1530
+ appBaseUrl?: OpenSpecUIConfig['appBaseUrl'];
1525
1531
  terminal?: Partial<TerminalConfig>;
1526
1532
  dashboard?: Partial<DashboardConfig>;
1527
1533
  };
@@ -1808,6 +1814,7 @@ interface DashboardGitWorktree {
1808
1814
  path: string;
1809
1815
  relativePath: string;
1810
1816
  branchName: string;
1817
+ detached: boolean;
1811
1818
  isCurrent: boolean;
1812
1819
  ahead: number;
1813
1820
  behind: number;
@@ -2504,19 +2511,19 @@ declare const PtyCreateMessageSchema: z.ZodObject<{
2504
2511
  }, "strip", z.ZodTypeAny, {
2505
2512
  type: "create";
2506
2513
  requestId: string;
2507
- command?: string | undefined;
2508
- args?: string[] | undefined;
2509
2514
  cols?: number | undefined;
2510
2515
  rows?: number | undefined;
2516
+ command?: string | undefined;
2517
+ args?: string[] | undefined;
2511
2518
  closeTip?: string | undefined;
2512
2519
  closeCallbackUrl?: string | Record<string, string> | undefined;
2513
2520
  }, {
2514
2521
  type: "create";
2515
2522
  requestId: string;
2516
- command?: string | undefined;
2517
- args?: string[] | undefined;
2518
2523
  cols?: number | undefined;
2519
2524
  rows?: number | undefined;
2525
+ command?: string | undefined;
2526
+ args?: string[] | undefined;
2520
2527
  closeTip?: string | undefined;
2521
2528
  closeCallbackUrl?: string | Record<string, string> | undefined;
2522
2529
  }>;
@@ -2594,19 +2601,19 @@ declare const PtyClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2594
2601
  }, "strip", z.ZodTypeAny, {
2595
2602
  type: "create";
2596
2603
  requestId: string;
2597
- command?: string | undefined;
2598
- args?: string[] | undefined;
2599
2604
  cols?: number | undefined;
2600
2605
  rows?: number | undefined;
2606
+ command?: string | undefined;
2607
+ args?: string[] | undefined;
2601
2608
  closeTip?: string | undefined;
2602
2609
  closeCallbackUrl?: string | Record<string, string> | undefined;
2603
2610
  }, {
2604
2611
  type: "create";
2605
2612
  requestId: string;
2606
- command?: string | undefined;
2607
- args?: string[] | undefined;
2608
2613
  cols?: number | undefined;
2609
2614
  rows?: number | undefined;
2615
+ command?: string | undefined;
2616
+ args?: string[] | undefined;
2610
2617
  closeTip?: string | undefined;
2611
2618
  closeCallbackUrl?: string | Record<string, string> | undefined;
2612
2619
  }>, z.ZodObject<{
@@ -2955,4 +2962,4 @@ type PtyServerMessage = z.infer<typeof PtyServerMessageSchema>;
2955
2962
  type PtySessionInfo = z.infer<typeof PtySessionInfoSchema>;
2956
2963
  type PtyPlatform = z.infer<typeof PtyPlatformSchema>;
2957
2964
  //#endregion
2958
- export { type AIToolOption, AI_TOOLS, type ApplyInstructions, ApplyInstructionsSchema, type ApplyTask, ApplyTaskSchema, type ArchiveMeta, type ArtifactInstructions, ArtifactInstructionsSchema, type ArtifactStatus, ArtifactStatusSchema, CODE_EDITOR_THEME_VALUES, type Change, type ChangeFile, ChangeFileSchema, type ChangeMeta, ChangeSchema, type ChangeStatus, ChangeStatusSchema, CliExecutor, type CliResult, type CliRunnerAttempt, type CliSniffResult, type CliStreamEvent, type CodeEditorTheme, CodeEditorThemeSchema, ConfigManager, DASHBOARD_METRIC_KEYS, DEFAULT_CONFIG, type DashboardCardAvailability, type DashboardConfig, DashboardConfigSchema, type DashboardGitCommitEntry, type DashboardGitDiffStats, type DashboardGitEntry, type DashboardGitSnapshot, type DashboardGitUncommittedEntry, type DashboardGitWorktree, type DashboardMetricKey, type DashboardOverview, type DashboardSummary, type DashboardTrendKind, type DashboardTrendMeta, type DashboardTrendPoint, type DashboardTriColorTrendPoint, type Delta, type DeltaOperation, DeltaOperationType, DeltaSchema, type DeltaSpec, DeltaSpecSchema, type DependencyInfo, DependencyInfoSchema, type ExportSnapshot, type FileChangeEvent, type FileChangeType, MarkdownParser, OpenSpecAdapter, type OpenSpecUIConfig, OpenSpecUIConfigSchema, type OpenSpecUIConfigUpdate, OpenSpecWatcher, OpsxKernel, type PathCallback, ProjectWatcher, type ProjectWatcherReinitializeReason, type ProjectWatcherRuntimeStatus, PtyAttachMessageSchema, PtyBufferResponseSchema, type PtyClientMessage, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, type PtyPlatform, PtyPlatformSchema, PtyResizeMessageSchema, type PtyServerMessage, PtyServerMessageSchema, type PtySessionInfo, PtyTitleResponseSchema, ReactiveContext, ReactiveState, type ReactiveStateOptions, type Requirement, RequirementSchema, type ResolvedCliRunner, type SchemaArtifact, SchemaArtifactSchema, type SchemaDetail, SchemaDetailSchema, type SchemaInfo, SchemaInfoSchema, type SchemaResolution, SchemaResolutionSchema, type Spec, type SpecMeta, SpecSchema, type Task, TaskSchema, type TemplateContentMap, type TemplatesMap, TemplatesSchema, type TerminalConfig, TerminalConfigSchema, type TerminalRendererEngine, TerminalRendererEngineSchema, type ToolConfig, VIRTUAL_PROJECT_DIRNAME, type ValidationIssue, type ValidationResult, Validator, type WatchEvent, type WatchEventType, type WatcherRuntimeStatus, acquireWatcher, buildCliRunnerCandidates, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createCleanCliEnv, createFileChangeObservable, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getProjectWatcher, getToolById, getWatchedProjectDir, getWatcherRuntimeStatus, initWatcherPool, isGlobPattern, isTerminalRendererEngine, isToolConfigured, isWatcherPoolInitialized, parseCliCommand, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, sniffGlobalCli, toOpsxDisplayPath };
2965
+ export { type AIToolOption, AI_TOOLS, type ApplyInstructions, ApplyInstructionsSchema, type ApplyTask, ApplyTaskSchema, type ArchiveMeta, type ArtifactInstructions, ArtifactInstructionsSchema, type ArtifactStatus, ArtifactStatusSchema, CODE_EDITOR_THEME_VALUES, type Change, type ChangeFile, ChangeFileSchema, type ChangeMeta, ChangeSchema, type ChangeStatus, ChangeStatusSchema, CliExecutor, type CliResult, type CliRunnerAttempt, type CliSniffResult, type CliStreamEvent, type CodeEditorTheme, CodeEditorThemeSchema, ConfigManager, DASHBOARD_METRIC_KEYS, DEFAULT_CONFIG, type DashboardCardAvailability, type DashboardConfig, DashboardConfigSchema, type DashboardGitCommitEntry, type DashboardGitDiffStats, type DashboardGitEntry, type DashboardGitSnapshot, type DashboardGitUncommittedEntry, type DashboardGitWorktree, type DashboardMetricKey, type DashboardOverview, type DashboardSummary, type DashboardTrendKind, type DashboardTrendMeta, type DashboardTrendPoint, type DashboardTriColorTrendPoint, type Delta, type DeltaOperation, DeltaOperationType, DeltaSchema, type DeltaSpec, DeltaSpecSchema, type DependencyInfo, DependencyInfoSchema, type ExportSnapshot, type FileChangeEvent, type FileChangeType, type HostedAppChannelKind, type HostedAppChannelManifest, type HostedAppCompatibilityEntry, type HostedAppVersionManifest, type HostedBackendHealthResponse, MarkdownParser, OFFICIAL_APP_BASE_URL, OpenSpecAdapter, type OpenSpecUIConfig, OpenSpecUIConfigSchema, type OpenSpecUIConfigUpdate, OpenSpecWatcher, OpsxKernel, type PathCallback, ProjectWatcher, type ProjectWatcherReinitializeReason, type ProjectWatcherRuntimeStatus, PtyAttachMessageSchema, PtyBufferResponseSchema, type PtyClientMessage, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, type PtyPlatform, PtyPlatformSchema, PtyResizeMessageSchema, type PtyServerMessage, PtyServerMessageSchema, type PtySessionInfo, PtyTitleResponseSchema, ReactiveContext, ReactiveState, type ReactiveStateOptions, type Requirement, RequirementSchema, type ResolvedCliRunner, type SchemaArtifact, SchemaArtifactSchema, type SchemaDetail, SchemaDetailSchema, type SchemaInfo, SchemaInfoSchema, type SchemaResolution, SchemaResolutionSchema, type Spec, type SpecMeta, SpecSchema, type Task, TaskSchema, type TemplateContentMap, type TemplatesMap, TemplatesSchema, type TerminalConfig, TerminalConfigSchema, type TerminalRendererEngine, TerminalRendererEngineSchema, type ToolConfig, VIRTUAL_PROJECT_DIRNAME, type ValidationIssue, type ValidationResult, Validator, type WatchEvent, type WatchEventType, type WatcherRuntimeStatus, acquireWatcher, buildCliRunnerCandidates, buildHostedLaunchUrl, buildHostedVersionManifestUrl, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createCleanCliEnv, createFileChangeObservable, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getProjectWatcher, getToolById, getWatchedProjectDir, getWatcherRuntimeStatus, initWatcherPool, isGlobPattern, isHostedAppVersionManifest, isHostedBackendHealthResponse, isTerminalRendererEngine, isToolConfigured, isWatcherPoolInitialized, normalizeHostedAppBaseUrl, parseCliCommand, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, resolveHostedAppBaseUrl, resolveHostedChannelForVersion, sniffGlobalCli, toOpsxDisplayPath };
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-DYIjMsbM.mjs";
1
+ import { a as isHostedBackendHealthResponse, c as resolveHostedChannelForVersion, i as isHostedAppVersionManifest, n as buildHostedLaunchUrl, o as normalizeHostedAppBaseUrl, r as buildHostedVersionManifestUrl, s as resolveHostedAppBaseUrl, t as OFFICIAL_APP_BASE_URL } from "./hosted-app-Bn-MNDZ0.mjs";
2
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-D-YbNUvQ.mjs";
2
3
  import { mkdir, readFile, rename, writeFile } from "fs/promises";
3
4
  import { dirname, join } from "path";
4
5
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -2330,6 +2331,7 @@ const OpenSpecUIConfigSchema = z.object({
2330
2331
  }).default({}),
2331
2332
  theme: z.enum(THEME_VALUES).default("system"),
2332
2333
  codeEditor: CodeEditorConfigSchema.default(CodeEditorConfigSchema.parse({})),
2334
+ appBaseUrl: z.string().default(""),
2333
2335
  terminal: TerminalConfigSchema.default(TerminalConfigSchema.parse({})),
2334
2336
  dashboard: DashboardConfigSchema.default(DashboardConfigSchema.parse({}))
2335
2337
  });
@@ -2338,6 +2340,7 @@ const DEFAULT_CONFIG = {
2338
2340
  cli: {},
2339
2341
  theme: "system",
2340
2342
  codeEditor: CodeEditorConfigSchema.parse({}),
2343
+ appBaseUrl: "",
2341
2344
  terminal: TerminalConfigSchema.parse({}),
2342
2345
  dashboard: DashboardConfigSchema.parse({})
2343
2346
  };
@@ -2406,6 +2409,7 @@ var ConfigManager = class {
2406
2409
  ...current.codeEditor,
2407
2410
  ...config.codeEditor
2408
2411
  },
2412
+ appBaseUrl: config.appBaseUrl ?? current.appBaseUrl,
2409
2413
  terminal: {
2410
2414
  ...current.terminal,
2411
2415
  ...config.terminal
@@ -4075,4 +4079,4 @@ const PtyServerMessageSchema = z.discriminatedUnion("type", [
4075
4079
  ]);
4076
4080
 
4077
4081
  //#endregion
4078
- export { AI_TOOLS, ApplyInstructionsSchema, ApplyTaskSchema, ArtifactInstructionsSchema, ArtifactStatusSchema, CODE_EDITOR_THEME_VALUES, ChangeFileSchema, ChangeSchema, ChangeStatusSchema, CliExecutor, CodeEditorThemeSchema, ConfigManager, DASHBOARD_METRIC_KEYS, DEFAULT_CONFIG, DashboardConfigSchema, DeltaOperationType, DeltaSchema, DeltaSpecSchema, DependencyInfoSchema, MarkdownParser, OpenSpecAdapter, OpenSpecUIConfigSchema, OpenSpecWatcher, OpsxKernel, ProjectWatcher, PtyAttachMessageSchema, PtyBufferResponseSchema, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, PtyPlatformSchema, PtyResizeMessageSchema, PtyServerMessageSchema, PtyTitleResponseSchema, ReactiveContext, ReactiveState, RequirementSchema, SchemaArtifactSchema, SchemaDetailSchema, SchemaInfoSchema, SchemaResolutionSchema, SpecSchema, TaskSchema, TemplatesSchema, TerminalConfigSchema, TerminalRendererEngineSchema, VIRTUAL_PROJECT_DIRNAME, Validator, acquireWatcher, buildCliRunnerCandidates, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createCleanCliEnv, createFileChangeObservable, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getProjectWatcher, getToolById, getWatchedProjectDir, getWatcherRuntimeStatus, initWatcherPool, isGlobPattern, isTerminalRendererEngine, isToolConfigured, isWatcherPoolInitialized, parseCliCommand, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, sniffGlobalCli, toOpsxDisplayPath };
4082
+ export { AI_TOOLS, ApplyInstructionsSchema, ApplyTaskSchema, ArtifactInstructionsSchema, ArtifactStatusSchema, CODE_EDITOR_THEME_VALUES, ChangeFileSchema, ChangeSchema, ChangeStatusSchema, CliExecutor, CodeEditorThemeSchema, ConfigManager, DASHBOARD_METRIC_KEYS, DEFAULT_CONFIG, DashboardConfigSchema, DeltaOperationType, DeltaSchema, DeltaSpecSchema, DependencyInfoSchema, MarkdownParser, OFFICIAL_APP_BASE_URL, OpenSpecAdapter, OpenSpecUIConfigSchema, OpenSpecWatcher, OpsxKernel, ProjectWatcher, PtyAttachMessageSchema, PtyBufferResponseSchema, PtyClientMessageSchema, PtyCloseMessageSchema, PtyCreateMessageSchema, PtyCreatedResponseSchema, PtyErrorCodeSchema, PtyErrorResponseSchema, PtyExitResponseSchema, PtyInputMessageSchema, PtyListMessageSchema, PtyListResponseSchema, PtyOutputResponseSchema, PtyPlatformSchema, PtyResizeMessageSchema, PtyServerMessageSchema, PtyTitleResponseSchema, ReactiveContext, ReactiveState, RequirementSchema, SchemaArtifactSchema, SchemaDetailSchema, SchemaInfoSchema, SchemaResolutionSchema, SpecSchema, TaskSchema, TemplatesSchema, TerminalConfigSchema, TerminalRendererEngineSchema, VIRTUAL_PROJECT_DIRNAME, Validator, acquireWatcher, buildCliRunnerCandidates, buildHostedLaunchUrl, buildHostedVersionManifestUrl, clearCache, closeAllProjectWatchers, closeAllWatchers, contextStorage, createCleanCliEnv, createFileChangeObservable, getActiveWatcherCount, getAllToolIds, getAllTools, getAvailableToolIds, getAvailableTools, getCacheSize, getConfiguredTools, getDefaultCliCommand, getDefaultCliCommandString, getProjectWatcher, getToolById, getWatchedProjectDir, getWatcherRuntimeStatus, initWatcherPool, isGlobPattern, isHostedAppVersionManifest, isHostedBackendHealthResponse, isTerminalRendererEngine, isToolConfigured, isWatcherPoolInitialized, normalizeHostedAppBaseUrl, parseCliCommand, reactiveExists, reactiveReadDir, reactiveReadFile, reactiveStat, resolveHostedAppBaseUrl, resolveHostedChannelForVersion, sniffGlobalCli, toOpsxDisplayPath };
@@ -1,2 +1,2 @@
1
- import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-RBULE8_G.mjs";
1
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-k65bc8bW.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-DYIjMsbM.mjs";
1
+ import { n as toOpsxDisplayPath, t as VIRTUAL_PROJECT_DIRNAME } from "./opsx-display-path-D-YbNUvQ.mjs";
2
2
 
3
3
  export { VIRTUAL_PROJECT_DIRNAME, toOpsxDisplayPath };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openspecui/core",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "Core OpenSpec adapter and parser",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -10,6 +10,10 @@
10
10
  "import": "./dist/index.mjs",
11
11
  "types": "./dist/index.d.mts"
12
12
  },
13
+ "./hosted-app": {
14
+ "import": "./dist/hosted-app.mjs",
15
+ "types": "./dist/hosted-app.d.mts"
16
+ },
13
17
  "./opsx-display-path": {
14
18
  "import": "./dist/opsx-display-path.mjs",
15
19
  "types": "./dist/opsx-display-path.d.mts"
@@ -18,6 +22,13 @@
18
22
  "files": [
19
23
  "dist"
20
24
  ],
25
+ "scripts": {
26
+ "build": "tsdown src/index.ts src/opsx-display-path.ts src/hosted-app.ts --format esm --dts",
27
+ "dev": "tsdown src/index.ts src/opsx-display-path.ts src/hosted-app.ts --format esm --dts --watch",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest",
30
+ "typecheck": "tsc --noEmit"
31
+ },
21
32
  "dependencies": {
22
33
  "@parcel/watcher": "^2.5.1",
23
34
  "yaml": "^2.8.2",
@@ -32,11 +43,8 @@
32
43
  "peerDependencies": {
33
44
  "typescript": "^5.0.0"
34
45
  },
35
- "scripts": {
36
- "build": "tsdown src/index.ts src/opsx-display-path.ts --format esm --dts",
37
- "dev": "tsdown src/index.ts src/opsx-display-path.ts --format esm --dts --watch",
38
- "test": "vitest run",
39
- "test:watch": "vitest",
40
- "typecheck": "tsc --noEmit"
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/jixoai/openspecui"
41
49
  }
42
- }
50
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 OpenSpecUI Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.