@openspecui/core 1.6.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -18,13 +18,13 @@ declare const ChangeFileSchema: z.ZodObject<{
18
18
  /** Optional byte size for files */
19
19
  size: z.ZodOptional<z.ZodNumber>;
20
20
  }, "strip", z.ZodTypeAny, {
21
- type: "file" | "directory";
22
21
  path: string;
22
+ type: "file" | "directory";
23
23
  content?: string | undefined;
24
24
  size?: number | undefined;
25
25
  }, {
26
- type: "file" | "directory";
27
26
  path: string;
27
+ type: "file" | "directory";
28
28
  content?: string | undefined;
29
29
  size?: number | undefined;
30
30
  }>;
@@ -678,14 +678,16 @@ declare class OpenSpecAdapter {
678
678
  listChanges(): Promise<string[]>;
679
679
  /**
680
680
  * List changes with metadata (id, name, progress, and time info)
681
- * Only returns changes that have valid proposal.md
681
+ * Returns every change directory, including schema-specific layouts that
682
+ * don't use proposal.md/tasks.md.
682
683
  * Sorted by updatedAt descending (most recent first)
683
684
  */
684
685
  listChangesWithMeta(): Promise<ChangeMeta[]>;
685
686
  listArchivedChanges(): Promise<string[]>;
686
687
  /**
687
688
  * List archived changes with metadata and time info
688
- * Only returns archives that have valid proposal.md
689
+ * Returns every archive directory, including schema-specific layouts that
690
+ * don't use proposal.md/tasks.md.
689
691
  * Sorted by updatedAt descending (most recent first)
690
692
  */
691
693
  listArchivedChangesWithMeta(): Promise<ArchiveMeta[]>;
@@ -1309,8 +1311,11 @@ declare function createFileChangeObservable(watcher: OpenSpecWatcher): {
1309
1311
  };
1310
1312
  //#endregion
1311
1313
  //#region src/config.d.ts
1314
+ declare const CODE_EDITOR_THEME_VALUES: readonly ["github", "material", "vscode", "tokyo", "gruvbox", "monokai", "nord"];
1312
1315
  declare const TerminalRendererEngineSchema: z.ZodEnum<["xterm", "ghostty"]>;
1313
1316
  type TerminalRendererEngine = z.infer<typeof TerminalRendererEngineSchema>;
1317
+ declare const CodeEditorThemeSchema: z.ZodEnum<["github", "material", "vscode", "tokyo", "gruvbox", "monokai", "nord"]>;
1318
+ type CodeEditorTheme = z.infer<typeof CodeEditorThemeSchema>;
1314
1319
  declare function isTerminalRendererEngine(value: string): value is TerminalRendererEngine;
1315
1320
  type RunnerId = 'configured' | 'openspec' | 'npx' | 'bunx' | 'deno' | 'pnpm' | 'yarn';
1316
1321
  interface CliRunnerCandidate {
@@ -1429,6 +1434,14 @@ declare const OpenSpecUIConfigSchema: z.ZodObject<{
1429
1434
  }>>;
1430
1435
  /** 主题 */
1431
1436
  theme: z.ZodDefault<z.ZodEnum<["light", "dark", "system"]>>;
1437
+ /** 代码编辑器配置 */
1438
+ codeEditor: z.ZodDefault<z.ZodObject<{
1439
+ theme: z.ZodDefault<z.ZodEnum<["github", "material", "vscode", "tokyo", "gruvbox", "monokai", "nord"]>>;
1440
+ }, "strip", z.ZodTypeAny, {
1441
+ theme: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord";
1442
+ }, {
1443
+ theme?: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord" | undefined;
1444
+ }>>;
1432
1445
  /** 终端配置 */
1433
1446
  terminal: z.ZodDefault<z.ZodObject<{
1434
1447
  fontSize: z.ZodDefault<z.ZodNumber>;
@@ -1461,11 +1474,14 @@ declare const OpenSpecUIConfigSchema: z.ZodObject<{
1461
1474
  trendPointLimit?: number | undefined;
1462
1475
  }>>;
1463
1476
  }, "strip", z.ZodTypeAny, {
1477
+ theme: "light" | "dark" | "system";
1464
1478
  cli: {
1465
1479
  command?: string | undefined;
1466
1480
  args?: string[] | undefined;
1467
1481
  };
1468
- theme: "light" | "dark" | "system";
1482
+ codeEditor: {
1483
+ theme: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord";
1484
+ };
1469
1485
  terminal: {
1470
1486
  fontSize: number;
1471
1487
  fontFamily: string;
@@ -1478,11 +1494,14 @@ declare const OpenSpecUIConfigSchema: z.ZodObject<{
1478
1494
  trendPointLimit: number;
1479
1495
  };
1480
1496
  }, {
1497
+ theme?: "light" | "dark" | "system" | undefined;
1481
1498
  cli?: {
1482
1499
  command?: string | undefined;
1483
1500
  args?: string[] | undefined;
1484
1501
  } | undefined;
1485
- theme?: "light" | "dark" | "system" | undefined;
1502
+ codeEditor?: {
1503
+ theme?: "github" | "material" | "vscode" | "tokyo" | "gruvbox" | "monokai" | "nord" | undefined;
1504
+ } | undefined;
1486
1505
  terminal?: {
1487
1506
  fontSize?: number | undefined;
1488
1507
  fontFamily?: string | undefined;
@@ -1502,6 +1521,7 @@ type OpenSpecUIConfigUpdate = {
1502
1521
  args?: string[] | null;
1503
1522
  };
1504
1523
  theme?: OpenSpecUIConfig['theme'];
1524
+ codeEditor?: Partial<OpenSpecUIConfig['codeEditor']>;
1505
1525
  terminal?: Partial<TerminalConfig>;
1506
1526
  dashboard?: Partial<DashboardConfig>;
1507
1527
  };
@@ -1602,7 +1622,11 @@ declare class CliExecutor {
1602
1622
  /**
1603
1623
  * 执行 openspec init(非交互式)
1604
1624
  */
1605
- init(tools?: string[] | 'all' | 'none'): Promise<CliResult>;
1625
+ init(options?: {
1626
+ tools?: string[] | 'all' | 'none';
1627
+ profile?: 'core' | 'custom';
1628
+ force?: boolean;
1629
+ }): Promise<CliResult>;
1606
1630
  /**
1607
1631
  * 执行 openspec archive <changeId>(非交互式)
1608
1632
  */
@@ -1647,7 +1671,11 @@ declare class CliExecutor {
1647
1671
  /**
1648
1672
  * 流式执行 openspec init
1649
1673
  */
1650
- initStream(tools: string[] | 'all' | 'none', onEvent: (event: CliStreamEvent) => void): Promise<() => void>;
1674
+ initStream(options: {
1675
+ tools?: string[] | 'all' | 'none';
1676
+ profile?: 'core' | 'custom';
1677
+ force?: boolean;
1678
+ }, onEvent: (event: CliStreamEvent) => void): Promise<() => void>;
1651
1679
  /**
1652
1680
  * 流式执行 openspec archive
1653
1681
  */
@@ -1825,14 +1853,14 @@ declare const ArtifactStatusSchema: z.ZodObject<{
1825
1853
  missingDeps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1826
1854
  relativePath: z.ZodOptional<z.ZodString>;
1827
1855
  }, "strip", z.ZodTypeAny, {
1828
- status: "done" | "ready" | "blocked";
1829
1856
  id: string;
1857
+ status: "done" | "ready" | "blocked";
1830
1858
  outputPath: string;
1831
1859
  missingDeps?: string[] | undefined;
1832
1860
  relativePath?: string | undefined;
1833
1861
  }, {
1834
- status: "done" | "ready" | "blocked";
1835
1862
  id: string;
1863
+ status: "done" | "ready" | "blocked";
1836
1864
  outputPath: string;
1837
1865
  missingDeps?: string[] | undefined;
1838
1866
  relativePath?: string | undefined;
@@ -1850,14 +1878,14 @@ declare const ChangeStatusSchema: z.ZodObject<{
1850
1878
  missingDeps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1851
1879
  relativePath: z.ZodOptional<z.ZodString>;
1852
1880
  }, "strip", z.ZodTypeAny, {
1853
- status: "done" | "ready" | "blocked";
1854
1881
  id: string;
1882
+ status: "done" | "ready" | "blocked";
1855
1883
  outputPath: string;
1856
1884
  missingDeps?: string[] | undefined;
1857
1885
  relativePath?: string | undefined;
1858
1886
  }, {
1859
- status: "done" | "ready" | "blocked";
1860
1887
  id: string;
1888
+ status: "done" | "ready" | "blocked";
1861
1889
  outputPath: string;
1862
1890
  missingDeps?: string[] | undefined;
1863
1891
  relativePath?: string | undefined;
@@ -1868,8 +1896,8 @@ declare const ChangeStatusSchema: z.ZodObject<{
1868
1896
  isComplete: boolean;
1869
1897
  applyRequires: string[];
1870
1898
  artifacts: {
1871
- status: "done" | "ready" | "blocked";
1872
1899
  id: string;
1900
+ status: "done" | "ready" | "blocked";
1873
1901
  outputPath: string;
1874
1902
  missingDeps?: string[] | undefined;
1875
1903
  relativePath?: string | undefined;
@@ -1880,8 +1908,8 @@ declare const ChangeStatusSchema: z.ZodObject<{
1880
1908
  isComplete: boolean;
1881
1909
  applyRequires: string[];
1882
1910
  artifacts: {
1883
- status: "done" | "ready" | "blocked";
1884
1911
  id: string;
1912
+ status: "done" | "ready" | "blocked";
1885
1913
  outputPath: string;
1886
1914
  missingDeps?: string[] | undefined;
1887
1915
  relativePath?: string | undefined;
@@ -1894,13 +1922,13 @@ declare const DependencyInfoSchema: z.ZodObject<{
1894
1922
  path: z.ZodString;
1895
1923
  description: z.ZodString;
1896
1924
  }, "strip", z.ZodTypeAny, {
1897
- path: string;
1898
1925
  id: string;
1926
+ path: string;
1899
1927
  description: string;
1900
1928
  done: boolean;
1901
1929
  }, {
1902
- path: string;
1903
1930
  id: string;
1931
+ path: string;
1904
1932
  description: string;
1905
1933
  done: boolean;
1906
1934
  }>;
@@ -2008,13 +2036,13 @@ declare const ArtifactInstructionsSchema: z.ZodObject<{
2008
2036
  path: z.ZodString;
2009
2037
  description: z.ZodString;
2010
2038
  }, "strip", z.ZodTypeAny, {
2011
- path: string;
2012
2039
  id: string;
2040
+ path: string;
2013
2041
  description: string;
2014
2042
  done: boolean;
2015
2043
  }, {
2016
- path: string;
2017
2044
  id: string;
2045
+ path: string;
2018
2046
  description: string;
2019
2047
  done: boolean;
2020
2048
  }>, "many">;
@@ -2028,8 +2056,8 @@ declare const ArtifactInstructionsSchema: z.ZodObject<{
2028
2056
  artifactId: string;
2029
2057
  template: string;
2030
2058
  dependencies: {
2031
- path: string;
2032
2059
  id: string;
2060
+ path: string;
2033
2061
  description: string;
2034
2062
  done: boolean;
2035
2063
  }[];
@@ -2046,8 +2074,8 @@ declare const ArtifactInstructionsSchema: z.ZodObject<{
2046
2074
  artifactId: string;
2047
2075
  template: string;
2048
2076
  dependencies: {
2049
- path: string;
2050
2077
  id: string;
2078
+ path: string;
2051
2079
  description: string;
2052
2080
  done: boolean;
2053
2081
  }[];
@@ -2093,8 +2121,8 @@ declare const SchemaResolutionSchema: z.ZodObject<{
2093
2121
  displayPath?: string | undefined;
2094
2122
  }>, "many">;
2095
2123
  }, "strip", z.ZodTypeAny, {
2096
- path: string;
2097
2124
  name: string;
2125
+ path: string;
2098
2126
  source: "project" | "user" | "package";
2099
2127
  shadows: {
2100
2128
  path: string;
@@ -2103,8 +2131,8 @@ declare const SchemaResolutionSchema: z.ZodObject<{
2103
2131
  }[];
2104
2132
  displayPath?: string | undefined;
2105
2133
  }, {
2106
- path: string;
2107
2134
  name: string;
2135
+ path: string;
2108
2136
  source: "project" | "user" | "package";
2109
2137
  shadows: {
2110
2138
  path: string;
@@ -2444,22 +2472,22 @@ declare const PtySessionInfoSchema: z.ZodObject<{
2444
2472
  closeTip: z.ZodOptional<z.ZodString>;
2445
2473
  closeCallbackUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
2446
2474
  }, "strip", z.ZodTypeAny, {
2475
+ id: string;
2447
2476
  command: string;
2448
2477
  args: string[];
2449
2478
  platform: "windows" | "macos" | "common";
2450
2479
  exitCode: number | null;
2451
2480
  title: string;
2452
- id: string;
2453
2481
  isExited: boolean;
2454
2482
  closeTip?: string | undefined;
2455
2483
  closeCallbackUrl?: string | Record<string, string> | undefined;
2456
2484
  }, {
2485
+ id: string;
2457
2486
  command: string;
2458
2487
  args: string[];
2459
2488
  platform: "windows" | "macos" | "common";
2460
2489
  exitCode: number | null;
2461
2490
  title: string;
2462
- id: string;
2463
2491
  isExited: boolean;
2464
2492
  closeTip?: string | undefined;
2465
2493
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2476,19 +2504,19 @@ declare const PtyCreateMessageSchema: z.ZodObject<{
2476
2504
  }, "strip", z.ZodTypeAny, {
2477
2505
  type: "create";
2478
2506
  requestId: string;
2479
- cols?: number | undefined;
2480
- rows?: number | undefined;
2481
2507
  command?: string | undefined;
2482
2508
  args?: string[] | undefined;
2509
+ cols?: number | undefined;
2510
+ rows?: number | undefined;
2483
2511
  closeTip?: string | undefined;
2484
2512
  closeCallbackUrl?: string | Record<string, string> | undefined;
2485
2513
  }, {
2486
2514
  type: "create";
2487
2515
  requestId: string;
2488
- cols?: number | undefined;
2489
- rows?: number | undefined;
2490
2516
  command?: string | undefined;
2491
2517
  args?: string[] | undefined;
2518
+ cols?: number | undefined;
2519
+ rows?: number | undefined;
2492
2520
  closeTip?: string | undefined;
2493
2521
  closeCallbackUrl?: string | Record<string, string> | undefined;
2494
2522
  }>;
@@ -2566,19 +2594,19 @@ declare const PtyClientMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2566
2594
  }, "strip", z.ZodTypeAny, {
2567
2595
  type: "create";
2568
2596
  requestId: string;
2569
- cols?: number | undefined;
2570
- rows?: number | undefined;
2571
2597
  command?: string | undefined;
2572
2598
  args?: string[] | undefined;
2599
+ cols?: number | undefined;
2600
+ rows?: number | undefined;
2573
2601
  closeTip?: string | undefined;
2574
2602
  closeCallbackUrl?: string | Record<string, string> | undefined;
2575
2603
  }, {
2576
2604
  type: "create";
2577
2605
  requestId: string;
2578
- cols?: number | undefined;
2579
- rows?: number | undefined;
2580
2606
  command?: string | undefined;
2581
2607
  args?: string[] | undefined;
2608
+ cols?: number | undefined;
2609
+ rows?: number | undefined;
2582
2610
  closeTip?: string | undefined;
2583
2611
  closeCallbackUrl?: string | Record<string, string> | undefined;
2584
2612
  }>, z.ZodObject<{
@@ -2720,22 +2748,22 @@ declare const PtyListResponseSchema: z.ZodObject<{
2720
2748
  closeTip: z.ZodOptional<z.ZodString>;
2721
2749
  closeCallbackUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
2722
2750
  }, "strip", z.ZodTypeAny, {
2751
+ id: string;
2723
2752
  command: string;
2724
2753
  args: string[];
2725
2754
  platform: "windows" | "macos" | "common";
2726
2755
  exitCode: number | null;
2727
2756
  title: string;
2728
- id: string;
2729
2757
  isExited: boolean;
2730
2758
  closeTip?: string | undefined;
2731
2759
  closeCallbackUrl?: string | Record<string, string> | undefined;
2732
2760
  }, {
2761
+ id: string;
2733
2762
  command: string;
2734
2763
  args: string[];
2735
2764
  platform: "windows" | "macos" | "common";
2736
2765
  exitCode: number | null;
2737
2766
  title: string;
2738
- id: string;
2739
2767
  isExited: boolean;
2740
2768
  closeTip?: string | undefined;
2741
2769
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2743,12 +2771,12 @@ declare const PtyListResponseSchema: z.ZodObject<{
2743
2771
  }, "strip", z.ZodTypeAny, {
2744
2772
  type: "list";
2745
2773
  sessions: {
2774
+ id: string;
2746
2775
  command: string;
2747
2776
  args: string[];
2748
2777
  platform: "windows" | "macos" | "common";
2749
2778
  exitCode: number | null;
2750
2779
  title: string;
2751
- id: string;
2752
2780
  isExited: boolean;
2753
2781
  closeTip?: string | undefined;
2754
2782
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2756,12 +2784,12 @@ declare const PtyListResponseSchema: z.ZodObject<{
2756
2784
  }, {
2757
2785
  type: "list";
2758
2786
  sessions: {
2787
+ id: string;
2759
2788
  command: string;
2760
2789
  args: string[];
2761
2790
  platform: "windows" | "macos" | "common";
2762
2791
  exitCode: number | null;
2763
2792
  title: string;
2764
- id: string;
2765
2793
  isExited: boolean;
2766
2794
  closeTip?: string | undefined;
2767
2795
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2774,14 +2802,14 @@ declare const PtyErrorResponseSchema: z.ZodObject<{
2774
2802
  message: z.ZodString;
2775
2803
  sessionId: z.ZodOptional<z.ZodString>;
2776
2804
  }, "strip", z.ZodTypeAny, {
2777
- type: "error";
2778
2805
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2779
2806
  message: string;
2807
+ type: "error";
2780
2808
  sessionId?: string | undefined;
2781
2809
  }, {
2782
- type: "error";
2783
2810
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2784
2811
  message: string;
2812
+ type: "error";
2785
2813
  sessionId?: string | undefined;
2786
2814
  }>;
2787
2815
  declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -2860,22 +2888,22 @@ declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2860
2888
  closeTip: z.ZodOptional<z.ZodString>;
2861
2889
  closeCallbackUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
2862
2890
  }, "strip", z.ZodTypeAny, {
2891
+ id: string;
2863
2892
  command: string;
2864
2893
  args: string[];
2865
2894
  platform: "windows" | "macos" | "common";
2866
2895
  exitCode: number | null;
2867
2896
  title: string;
2868
- id: string;
2869
2897
  isExited: boolean;
2870
2898
  closeTip?: string | undefined;
2871
2899
  closeCallbackUrl?: string | Record<string, string> | undefined;
2872
2900
  }, {
2901
+ id: string;
2873
2902
  command: string;
2874
2903
  args: string[];
2875
2904
  platform: "windows" | "macos" | "common";
2876
2905
  exitCode: number | null;
2877
2906
  title: string;
2878
- id: string;
2879
2907
  isExited: boolean;
2880
2908
  closeTip?: string | undefined;
2881
2909
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2883,12 +2911,12 @@ declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2883
2911
  }, "strip", z.ZodTypeAny, {
2884
2912
  type: "list";
2885
2913
  sessions: {
2914
+ id: string;
2886
2915
  command: string;
2887
2916
  args: string[];
2888
2917
  platform: "windows" | "macos" | "common";
2889
2918
  exitCode: number | null;
2890
2919
  title: string;
2891
- id: string;
2892
2920
  isExited: boolean;
2893
2921
  closeTip?: string | undefined;
2894
2922
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2896,12 +2924,12 @@ declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2896
2924
  }, {
2897
2925
  type: "list";
2898
2926
  sessions: {
2927
+ id: string;
2899
2928
  command: string;
2900
2929
  args: string[];
2901
2930
  platform: "windows" | "macos" | "common";
2902
2931
  exitCode: number | null;
2903
2932
  title: string;
2904
- id: string;
2905
2933
  isExited: boolean;
2906
2934
  closeTip?: string | undefined;
2907
2935
  closeCallbackUrl?: string | Record<string, string> | undefined;
@@ -2912,14 +2940,14 @@ declare const PtyServerMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2912
2940
  message: z.ZodString;
2913
2941
  sessionId: z.ZodOptional<z.ZodString>;
2914
2942
  }, "strip", z.ZodTypeAny, {
2915
- type: "error";
2916
2943
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2917
2944
  message: string;
2945
+ type: "error";
2918
2946
  sessionId?: string | undefined;
2919
2947
  }, {
2920
- type: "error";
2921
2948
  code: "INVALID_JSON" | "INVALID_MESSAGE" | "SESSION_NOT_FOUND" | "PTY_CREATE_FAILED";
2922
2949
  message: string;
2950
+ type: "error";
2923
2951
  sessionId?: string | undefined;
2924
2952
  }>]>;
2925
2953
  type PtyClientMessage = z.infer<typeof PtyClientMessageSchema>;
@@ -2927,4 +2955,4 @@ type PtyServerMessage = z.infer<typeof PtyServerMessageSchema>;
2927
2955
  type PtySessionInfo = z.infer<typeof PtySessionInfoSchema>;
2928
2956
  type PtyPlatform = z.infer<typeof PtyPlatformSchema>;
2929
2957
  //#endregion
2930
- export { type AIToolOption, AI_TOOLS, type ApplyInstructions, ApplyInstructionsSchema, type ApplyTask, ApplyTaskSchema, type ArchiveMeta, type ArtifactInstructions, ArtifactInstructionsSchema, type ArtifactStatus, ArtifactStatusSchema, type Change, type ChangeFile, ChangeFileSchema, type ChangeMeta, ChangeSchema, type ChangeStatus, ChangeStatusSchema, CliExecutor, type CliResult, type CliRunnerAttempt, type CliSniffResult, type CliStreamEvent, 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 };
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 };
package/dist/index.mjs CHANGED
@@ -1364,47 +1364,50 @@ var OpenSpecAdapter = class {
1364
1364
  }
1365
1365
  /**
1366
1366
  * List changes with metadata (id, name, progress, and time info)
1367
- * Only returns changes that have valid proposal.md
1367
+ * Returns every change directory, including schema-specific layouts that
1368
+ * don't use proposal.md/tasks.md.
1368
1369
  * Sorted by updatedAt descending (most recent first)
1369
1370
  */
1370
1371
  async listChangesWithMeta() {
1371
1372
  const ids = await this.listChanges();
1372
1373
  return (await Promise.all(ids.map(async (id) => {
1373
1374
  const change = await this.readChange(id);
1374
- if (!change) return null;
1375
- const proposalPath = join(this.changesDir, id, "proposal.md");
1376
- const timeInfo = await this.getFileTimeInfo(proposalPath);
1375
+ const changeDir = join(this.changesDir, id);
1376
+ const timeInfo = await this.getFileTimeInfo(changeDir);
1377
1377
  return {
1378
1378
  id,
1379
- name: change.name,
1380
- progress: change.progress,
1379
+ name: change?.name ?? id,
1380
+ progress: change?.progress ?? {
1381
+ total: 0,
1382
+ completed: 0
1383
+ },
1381
1384
  createdAt: timeInfo?.createdAt ?? 0,
1382
1385
  updatedAt: timeInfo?.updatedAt ?? 0
1383
1386
  };
1384
- }))).filter((r) => r !== null).sort((a, b) => b.updatedAt - a.updatedAt);
1387
+ }))).sort((a, b) => b.updatedAt - a.updatedAt);
1385
1388
  }
1386
1389
  async listArchivedChanges() {
1387
1390
  return reactiveReadDir(this.archiveDir, { directoriesOnly: true });
1388
1391
  }
1389
1392
  /**
1390
1393
  * List archived changes with metadata and time info
1391
- * Only returns archives that have valid proposal.md
1394
+ * Returns every archive directory, including schema-specific layouts that
1395
+ * don't use proposal.md/tasks.md.
1392
1396
  * Sorted by updatedAt descending (most recent first)
1393
1397
  */
1394
1398
  async listArchivedChangesWithMeta() {
1395
1399
  const ids = await this.listArchivedChanges();
1396
1400
  return (await Promise.all(ids.map(async (id) => {
1397
1401
  const change = await this.readArchivedChange(id);
1398
- if (!change) return null;
1399
- const proposalPath = join(this.archiveDir, id, "proposal.md");
1400
- const timeInfo = await this.getFileTimeInfo(proposalPath);
1402
+ const archiveDir = join(this.archiveDir, id);
1403
+ const timeInfo = await this.getFileTimeInfo(archiveDir);
1401
1404
  return {
1402
1405
  id,
1403
- name: change.name,
1406
+ name: change?.name ?? id,
1404
1407
  createdAt: timeInfo?.createdAt ?? 0,
1405
1408
  updatedAt: timeInfo?.updatedAt ?? 0
1406
1409
  };
1407
- }))).filter((r) => r !== null).sort((a, b) => b.updatedAt - a.updatedAt);
1410
+ }))).sort((a, b) => b.updatedAt - a.updatedAt);
1408
1411
  }
1409
1412
  /**
1410
1413
  * Read project.md content (reactive)
@@ -1470,7 +1473,7 @@ var OpenSpecAdapter = class {
1470
1473
  });
1471
1474
  }
1472
1475
  async collectChangeFiles(root, dir) {
1473
- const names = await reactiveReadDir(dir, { includeHidden: false });
1476
+ const names = await reactiveReadDir(dir, { includeHidden: true });
1474
1477
  const files = [];
1475
1478
  for (const name of names) {
1476
1479
  const fullPath = join(dir, name);
@@ -1958,8 +1961,18 @@ const CURSOR_STYLE_VALUES = [
1958
1961
  "underline",
1959
1962
  "bar"
1960
1963
  ];
1964
+ const CODE_EDITOR_THEME_VALUES = [
1965
+ "github",
1966
+ "material",
1967
+ "vscode",
1968
+ "tokyo",
1969
+ "gruvbox",
1970
+ "monokai",
1971
+ "nord"
1972
+ ];
1961
1973
  const TERMINAL_RENDERER_ENGINE_VALUES = ["xterm", "ghostty"];
1962
1974
  const TerminalRendererEngineSchema = z.enum(TERMINAL_RENDERER_ENGINE_VALUES);
1975
+ const CodeEditorThemeSchema = z.enum(CODE_EDITOR_THEME_VALUES);
1963
1976
  function isTerminalRendererEngine(value) {
1964
1977
  return TERMINAL_RENDERER_ENGINE_VALUES.includes(value);
1965
1978
  }
@@ -2304,6 +2317,7 @@ const TerminalConfigSchema = z.object({
2304
2317
  rendererEngine: z.string().default("xterm")
2305
2318
  });
2306
2319
  const DashboardConfigSchema = z.object({ trendPointLimit: z.number().int().min(20).max(500).default(100) });
2320
+ const CodeEditorConfigSchema = z.object({ theme: CodeEditorThemeSchema.default("github") });
2307
2321
  /**
2308
2322
  * OpenSpecUI 配置 Schema
2309
2323
  *
@@ -2315,6 +2329,7 @@ const OpenSpecUIConfigSchema = z.object({
2315
2329
  args: z.array(z.string()).optional()
2316
2330
  }).default({}),
2317
2331
  theme: z.enum(THEME_VALUES).default("system"),
2332
+ codeEditor: CodeEditorConfigSchema.default(CodeEditorConfigSchema.parse({})),
2318
2333
  terminal: TerminalConfigSchema.default(TerminalConfigSchema.parse({})),
2319
2334
  dashboard: DashboardConfigSchema.default(DashboardConfigSchema.parse({}))
2320
2335
  });
@@ -2322,6 +2337,7 @@ const OpenSpecUIConfigSchema = z.object({
2322
2337
  const DEFAULT_CONFIG = {
2323
2338
  cli: {},
2324
2339
  theme: "system",
2340
+ codeEditor: CodeEditorConfigSchema.parse({}),
2325
2341
  terminal: TerminalConfigSchema.parse({}),
2326
2342
  dashboard: DashboardConfigSchema.parse({})
2327
2343
  };
@@ -2386,6 +2402,10 @@ var ConfigManager = class {
2386
2402
  ...current,
2387
2403
  cli: nextCli,
2388
2404
  theme: config.theme ?? current.theme,
2405
+ codeEditor: {
2406
+ ...current.codeEditor,
2407
+ ...config.codeEditor
2408
+ },
2389
2409
  terminal: {
2390
2410
  ...current.terminal,
2391
2411
  ...config.terminal
@@ -2599,13 +2619,15 @@ var CliExecutor = class {
2599
2619
  /**
2600
2620
  * 执行 openspec init(非交互式)
2601
2621
  */
2602
- async init(tools = "all") {
2603
- const toolsArg = Array.isArray(tools) ? tools.join(",") : tools;
2604
- return this.execute([
2605
- "init",
2606
- "--tools",
2607
- toolsArg
2608
- ]);
2622
+ async init(options) {
2623
+ const args = ["init"];
2624
+ if (options?.tools !== void 0) {
2625
+ const toolsArg = Array.isArray(options.tools) ? options.tools.join(",") : options.tools;
2626
+ args.push("--tools", toolsArg);
2627
+ }
2628
+ if (options?.profile) args.push("--profile", options.profile);
2629
+ if (options?.force) args.push("--force");
2630
+ return this.execute(args);
2609
2631
  }
2610
2632
  /**
2611
2633
  * 执行 openspec archive <changeId>(非交互式)
@@ -2772,13 +2794,15 @@ var CliExecutor = class {
2772
2794
  /**
2773
2795
  * 流式执行 openspec init
2774
2796
  */
2775
- initStream(tools, onEvent) {
2776
- const toolsArg = Array.isArray(tools) ? tools.join(",") : tools;
2777
- return this.executeStream([
2778
- "init",
2779
- "--tools",
2780
- toolsArg
2781
- ], onEvent);
2797
+ initStream(options, onEvent) {
2798
+ const args = ["init"];
2799
+ if (options.tools !== void 0) {
2800
+ const toolsArg = Array.isArray(options.tools) ? options.tools.join(",") : options.tools;
2801
+ args.push("--tools", toolsArg);
2802
+ }
2803
+ if (options.profile) args.push("--profile", options.profile);
2804
+ if (options.force) args.push("--force");
2805
+ return this.executeStream(args, onEvent);
2782
2806
  }
2783
2807
  /**
2784
2808
  * 流式执行 openspec archive
@@ -2863,7 +2887,9 @@ const SKILL_NAMES = [
2863
2887
  "openspec-sync-specs",
2864
2888
  "openspec-archive-change",
2865
2889
  "openspec-bulk-archive-change",
2866
- "openspec-verify-change"
2890
+ "openspec-verify-change",
2891
+ "openspec-onboard",
2892
+ "openspec-propose"
2867
2893
  ];
2868
2894
  /**
2869
2895
  * 所有支持的 AI 工具配置
@@ -2982,6 +3008,13 @@ const AI_TOOLS = [
2982
3008
  successLabel: "Kilo Code",
2983
3009
  skillsDir: ".kilocode"
2984
3010
  },
3011
+ {
3012
+ name: "Kiro",
3013
+ value: "kiro",
3014
+ available: true,
3015
+ successLabel: "Kiro",
3016
+ skillsDir: ".kiro"
3017
+ },
2985
3018
  {
2986
3019
  name: "OpenCode",
2987
3020
  value: "opencode",
@@ -2989,6 +3022,13 @@ const AI_TOOLS = [
2989
3022
  successLabel: "OpenCode",
2990
3023
  skillsDir: ".opencode"
2991
3024
  },
3025
+ {
3026
+ name: "Pi",
3027
+ value: "pi",
3028
+ available: true,
3029
+ successLabel: "Pi",
3030
+ skillsDir: ".pi"
3031
+ },
2992
3032
  {
2993
3033
  name: "Qoder",
2994
3034
  value: "qoder",
@@ -4035,4 +4075,4 @@ const PtyServerMessageSchema = z.discriminatedUnion("type", [
4035
4075
  ]);
4036
4076
 
4037
4077
  //#endregion
4038
- export { AI_TOOLS, ApplyInstructionsSchema, ApplyTaskSchema, ArtifactInstructionsSchema, ArtifactStatusSchema, ChangeFileSchema, ChangeSchema, ChangeStatusSchema, CliExecutor, 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openspecui/core",
3
- "version": "1.6.0",
3
+ "version": "2.0.0",
4
4
  "description": "Core OpenSpec adapter and parser",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",