@openspecui/core 4.0.2 → 5.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/{document-translation-BAhXJaIl.d.mts → document-translation-7R8cf8_B.d.mts} +2 -2
- package/dist/{document-translation-C3SE2CBJ.mjs → document-translation-D4YK18I3.mjs} +1 -1
- package/dist/document-translation.d.mts +1 -1
- package/dist/document-translation.mjs +2 -2
- package/dist/hosted-app.d.mts +1 -1
- package/dist/hosted-app.mjs +1 -1
- package/dist/index.d.mts +53 -38
- package/dist/index.mjs +46 -20
- package/dist/{local-download-profiles-C6VVRttC.d.mts → local-download-profiles-caa4PECd.d.mts} +1 -1
- package/dist/local-download-profiles.d.mts +2 -2
- package/dist/local-download-profiles.mjs +1 -1
- package/dist/markdown-facts.d.mts +1 -1
- package/dist/markdown-facts.mjs +1 -1
- package/dist/{markdown-reading-BnoDddEA.d.mts → markdown-reading-CgXuXp6s.d.mts} +1 -1
- package/dist/{markdown-reading-4d3w3xgw.mjs → markdown-reading-DdcB7run.mjs} +1 -1
- package/dist/markdown-reading.d.mts +2 -2
- package/dist/markdown-reading.mjs +2 -2
- package/dist/{notifications-3ZJ6BBzT.mjs → notifications-AKAcmeKT.mjs} +2 -2
- package/dist/{notifications-DcBVI03P.d.mts → notifications-DZeOl4HV.d.mts} +16 -16
- package/dist/notifications.d.mts +2 -2
- package/dist/notifications.mjs +3 -3
- package/dist/{openspec-annotations-DDKeedpf.d.mts → openspec-annotations-CeXd0JIZ.d.mts} +2 -2
- package/dist/{openspec-annotations-DZDb0Qox.mjs → openspec-annotations-D_6Pz7k4.mjs} +2 -2
- package/dist/openspec-annotations.d.mts +3 -3
- package/dist/openspec-annotations.mjs +3 -3
- package/dist/openspec-compat.d.mts +12 -11
- package/dist/openspec-compat.mjs +28 -12
- package/dist/{openspec-projection-i2pkZ4hQ.d.mts → openspec-projection-B0ch1rZw.d.mts} +3 -3
- package/dist/{openspec-projection-DJ_mSfmq.mjs → openspec-projection-B8s-KWQ7.mjs} +2 -2
- package/dist/openspec-projection.d.mts +5 -5
- package/dist/openspec-projection.mjs +4 -4
- package/dist/opsx-display-path.d.mts +1 -1
- package/dist/opsx-display-path.mjs +1 -1
- package/dist/{opsx-entity-DNzyALN-.d.mts → opsx-entity-DZyl-uhQ.d.mts} +2 -2
- package/dist/opsx-entity.d.mts +3 -3
- package/dist/opsx-entity.mjs +1 -1
- package/dist/{opsx-schema-detail-BZpl9jiW.d.mts → opsx-schema-detail-CS0tWa9v.d.mts} +2 -2
- package/dist/opsx-schema-detail.d.mts +4 -4
- package/dist/opsx-schema-detail.mjs +1 -1
- package/dist/{opsx-types-Ccrsvb3l.d.mts → opsx-types-Dnb06uff.d.mts} +8 -8
- package/dist/{schemas-C01jZKK1.d.mts → schemas-D01aQnV4.d.mts} +46 -46
- package/dist/{sounds-BhmJDMmO.d.mts → sounds-kgDn4x8v.d.mts} +4 -4
- package/dist/sounds.d.mts +1 -1
- package/dist/sounds.mjs +1 -1
- package/dist/store-types-BiE-Ey--.d.mts +1092 -0
- package/dist/store-types-Cu41QSww.mjs +109 -0
- package/dist/store-types.d.mts +2 -0
- package/dist/store-types.mjs +3 -0
- package/dist/{task-progress-C2YCGSyC.d.mts → task-progress-C1TGMbIR.d.mts} +2 -2
- package/dist/{task-progress-RLYFNkpL.mjs → task-progress-DhHYHnTv.mjs} +1 -1
- package/dist/task-progress.d.mts +3 -3
- package/dist/task-progress.mjs +2 -2
- package/dist/{terminal-audio-BDbVowLy.d.mts → terminal-audio-CsuGTNV-.d.mts} +1 -1
- package/dist/{terminal-audio-DhslppvD.mjs → terminal-audio-TBoU2jSK.mjs} +1 -1
- package/dist/terminal-audio.d.mts +2 -2
- package/dist/terminal-audio.mjs +2 -2
- package/dist/terminal-control.d.mts +2 -2
- package/dist/terminal-control.mjs +1 -1
- package/dist/{terminal-invocation-Be3YlFOI.d.mts → terminal-invocation-BlFwKpIc.d.mts} +75 -75
- package/dist/terminal-invocation.d.mts +1 -1
- package/dist/terminal-invocation.mjs +1 -1
- package/dist/terminal-theme.d.mts +1 -1
- package/dist/terminal-theme.mjs +1 -1
- package/dist/translation-language-pair.d.mts +1 -1
- package/dist/translation-language-pair.mjs +1 -1
- package/dist/{translator-CZeKoeLW.d.mts → translator-BErXgQxx.d.mts} +132 -132
- package/dist/translator.d.mts +1 -1
- package/dist/translator.mjs +1 -1
- package/package.json +9 -3
- /package/dist/{hosted-app-DfEh4rR3.mjs → hosted-app-CzMRiEgY.mjs} +0 -0
- /package/dist/{hosted-app-BZvbSDOk.d.mts → hosted-app-DHs94gIR.d.mts} +0 -0
- /package/dist/{local-download-profiles-C8ZHpk2F.mjs → local-download-profiles-kpNEcdF_.mjs} +0 -0
- /package/dist/{markdown-facts-ByM-tdm5.mjs → markdown-facts-BBCTe_qq.mjs} +0 -0
- /package/dist/{markdown-facts-DQe77Xbc.d.mts → markdown-facts-Dk7FKaaT.d.mts} +0 -0
- /package/dist/{opsx-display-path-DGjayJTF.mjs → opsx-display-path-CUCOrHcM.mjs} +0 -0
- /package/dist/{opsx-display-path-dEtDIqJD.d.mts → opsx-display-path-cIMKa1aw.d.mts} +0 -0
- /package/dist/{opsx-entity-DrY7pgMe.mjs → opsx-entity-c7m5CbgU.mjs} +0 -0
- /package/dist/{opsx-schema-detail-B-4bLoZS.mjs → opsx-schema-detail-BH82X6aU.mjs} +0 -0
- /package/dist/{sounds-CuSsy7X-.mjs → sounds-CB3ubSnj.mjs} +0 -0
- /package/dist/{terminal-control-D5dCna6A.mjs → terminal-control-VpTuh17B.mjs} +0 -0
- /package/dist/{terminal-invocation-BSrS_0zu.mjs → terminal-invocation-C2MCNBhK.mjs} +0 -0
- /package/dist/{terminal-theme-TogWGicr.mjs → terminal-theme-cevliJw2.mjs} +0 -0
- /package/dist/{terminal-theme-DO6B6-o0.d.mts → terminal-theme-hvQjTsNh.d.mts} +0 -0
- /package/dist/{translation-language-pair-D2B_LoN1.mjs → translation-language-pair-DZ_WNp_M.mjs} +0 -0
- /package/dist/{translation-language-pair-C1tou_ks.d.mts → translation-language-pair-DmaOfHqD.d.mts} +0 -0
- /package/dist/{translator-bwybQ07U.mjs → translator-DbUT1Ayn.mjs} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/store-types.ts
|
|
4
|
+
/**
|
|
5
|
+
* Beta feature fault-tolerance model (manager directive).
|
|
6
|
+
*
|
|
7
|
+
* 对于 beta 功能,openspecui 不负责兼容性。但这也意味着所有功能在后台需要有较强的容错能力
|
|
8
|
+
* (没有这个功能也要能捕捉到错误),然后前端显示这个错误。这个错误一般是两种:
|
|
9
|
+
*
|
|
10
|
+
* 1. 数据不兼容 — 当前的 openspecui 不支持/不兼容 openspec-cli 提供的数据。通过 zod 对 CLI
|
|
11
|
+
* 输出做宽松验证,所以除非 openspec-cli 破坏性更新提供了不兼容的数据结构,我们才会异常。
|
|
12
|
+
* → 前端处理:客观显示错误,并提供错误的版本来源信息(版本信息非常重要)。
|
|
13
|
+
*
|
|
14
|
+
* 2. 指令用法变了 — openspec-cli 直接修改了指令的用法,属于 openspec 上了比较大的破坏性更新。
|
|
15
|
+
* → 前端处理:直接隐藏入口(对弱 beta 入口而言)。
|
|
16
|
+
*
|
|
17
|
+
* 不论哪种情况,前端都不能因此崩溃。
|
|
18
|
+
*
|
|
19
|
+
* Stores (OpenSpec 1.5.0, very early beta) 是这个范式的首个落地:它是个很弱的入口——低版本
|
|
20
|
+
* 没有、当前版本不稳定,因此异常一只需客观显示版本信息,异常二直接隐藏入口即可。
|
|
21
|
+
*
|
|
22
|
+
* Spec: openspec-cli-integration › "Beta Feature Fault Tolerance".
|
|
23
|
+
*/
|
|
24
|
+
const StoreDiagnosticSchema = z.object({
|
|
25
|
+
severity: z.string().optional(),
|
|
26
|
+
code: z.string().optional(),
|
|
27
|
+
message: z.string().optional(),
|
|
28
|
+
target: z.string().optional(),
|
|
29
|
+
fix: z.string().optional()
|
|
30
|
+
}).passthrough();
|
|
31
|
+
const StoreListEntrySchema = z.object({
|
|
32
|
+
id: z.string(),
|
|
33
|
+
root: z.string()
|
|
34
|
+
}).passthrough();
|
|
35
|
+
const StoreListResultSchema = z.object({
|
|
36
|
+
stores: z.array(StoreListEntrySchema).default([]),
|
|
37
|
+
status: z.array(StoreDiagnosticSchema).optional()
|
|
38
|
+
}).passthrough();
|
|
39
|
+
const StoreOpenSpecRootSchema = z.object({
|
|
40
|
+
present: z.boolean().nullable().optional(),
|
|
41
|
+
healthy: z.boolean().nullable().optional()
|
|
42
|
+
}).passthrough();
|
|
43
|
+
const StoreMetadataSchema = z.object({
|
|
44
|
+
present: z.boolean().nullable().optional(),
|
|
45
|
+
valid: z.boolean().nullable().optional(),
|
|
46
|
+
id: z.string().nullable().optional(),
|
|
47
|
+
remote: z.string().nullable().optional()
|
|
48
|
+
}).passthrough();
|
|
49
|
+
const StoreGitFactsSchema = z.object({
|
|
50
|
+
is_repository: z.boolean().nullable().optional(),
|
|
51
|
+
has_commits: z.boolean().nullable().optional(),
|
|
52
|
+
has_uncommitted_changes: z.boolean().nullable().optional(),
|
|
53
|
+
has_remote: z.boolean().nullable().optional(),
|
|
54
|
+
origin_url: z.string().nullable().optional()
|
|
55
|
+
}).passthrough();
|
|
56
|
+
const StoreDoctorStoreSchema = z.object({
|
|
57
|
+
id: z.string().optional(),
|
|
58
|
+
root: z.string().optional(),
|
|
59
|
+
metadata_path: z.string().nullable().optional(),
|
|
60
|
+
openspec_root: StoreOpenSpecRootSchema.optional(),
|
|
61
|
+
metadata: StoreMetadataSchema.optional(),
|
|
62
|
+
git: StoreGitFactsSchema.optional(),
|
|
63
|
+
status: z.array(StoreDiagnosticSchema).optional()
|
|
64
|
+
}).passthrough();
|
|
65
|
+
const StoreDoctorResultSchema = z.object({
|
|
66
|
+
stores: z.array(StoreDoctorStoreSchema).default([]),
|
|
67
|
+
status: z.array(StoreDiagnosticSchema).optional()
|
|
68
|
+
}).passthrough();
|
|
69
|
+
function classifyStoreCliOutput(input) {
|
|
70
|
+
const { success, stdout, stderr, parse, cliVersion } = input;
|
|
71
|
+
if (!success) return {
|
|
72
|
+
kind: "command-unavailable",
|
|
73
|
+
message: stderr.trim() || "OpenSpec CLI store command failed or is unavailable.",
|
|
74
|
+
...cliVersion ? { cliVersion } : {}
|
|
75
|
+
};
|
|
76
|
+
try {
|
|
77
|
+
return {
|
|
78
|
+
kind: "ok",
|
|
79
|
+
data: parse(stdout)
|
|
80
|
+
};
|
|
81
|
+
} catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
kind: "data-incompatible",
|
|
84
|
+
message: `OpenSpec CLI returned an incompatible stores payload: ${error instanceof Error ? error.message : String(error)}`,
|
|
85
|
+
...cliVersion ? { cliVersion } : {}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 把归类结果转换成端点返回型。成功时 stores = data,失败时 stores = fallback(通常是空数组)
|
|
91
|
+
* 并附上 error。始终尽力带上 cliVersion(版本信息非常重要)。
|
|
92
|
+
*/
|
|
93
|
+
function toStoreFeatureResult(classification, options) {
|
|
94
|
+
const cliVersion = options.cliVersion;
|
|
95
|
+
if (classification.kind === "ok") return {
|
|
96
|
+
available: true,
|
|
97
|
+
stores: options.fromData(classification.data),
|
|
98
|
+
...cliVersion ? { cliVersion } : {}
|
|
99
|
+
};
|
|
100
|
+
return {
|
|
101
|
+
available: false,
|
|
102
|
+
stores: options.fallback,
|
|
103
|
+
error: classification,
|
|
104
|
+
...cliVersion ? { cliVersion } : {}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
export { toStoreFeatureResult as i, StoreListResultSchema as n, classifyStoreCliOutput as r, StoreDoctorResultSchema as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as StoreDoctorResult, c as StoreFeatureError, d as StoreListResult, f as StoreListResultSchema, i as StoreDiagnostic, l as StoreFeatureResult, m as toStoreFeatureResult, n as StoreCommandUnavailableError, o as StoreDoctorResultSchema, p as classifyStoreCliOutput, r as StoreDataIncompatibleError, s as StoreDoctorStore, t as StoreClassification, u as StoreListEntry } from "./store-types-BiE-Ey--.mjs";
|
|
2
|
+
export { StoreClassification, StoreCommandUnavailableError, StoreDataIncompatibleError, StoreDiagnostic, StoreDoctorResult, StoreDoctorResultSchema, StoreDoctorStore, StoreFeatureError, StoreFeatureResult, StoreListEntry, StoreListResult, StoreListResultSchema, classifyStoreCliOutput, toStoreFeatureResult };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as SchemaDetail } from "./opsx-types-
|
|
2
|
-
import { n as ChangeFile, v as Task } from "./schemas-
|
|
1
|
+
import { g as SchemaDetail } from "./opsx-types-Dnb06uff.mjs";
|
|
2
|
+
import { n as ChangeFile, v as Task } from "./schemas-D01aQnV4.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/task-progress.d.ts
|
|
5
5
|
interface TaskProgress {
|
package/dist/task-progress.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./opsx-types-
|
|
2
|
-
import "./schemas-
|
|
3
|
-
import { a as isMarkdownTaskSourcePath, i as computeTaskProgress, n as TaskProjection, o as parseMarkdownTasks, r as TaskProjectionOptions, s as projectTasksFromMarkdownFiles, t as TaskProgress } from "./task-progress-
|
|
1
|
+
import "./opsx-types-Dnb06uff.mjs";
|
|
2
|
+
import "./schemas-D01aQnV4.mjs";
|
|
3
|
+
import { a as isMarkdownTaskSourcePath, i as computeTaskProgress, n as TaskProjection, o as parseMarkdownTasks, r as TaskProjectionOptions, s as projectTasksFromMarkdownFiles, t as TaskProgress } from "./task-progress-C1TGMbIR.mjs";
|
|
4
4
|
export { TaskProgress, TaskProjection, TaskProjectionOptions, computeTaskProgress, isMarkdownTaskSourcePath, parseMarkdownTasks, projectTasksFromMarkdownFiles };
|
package/dist/task-progress.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./opsx-entity-
|
|
2
|
-
import { i as projectTasksFromMarkdownFiles, n as isMarkdownTaskSourcePath, r as parseMarkdownTasks, t as computeTaskProgress } from "./task-progress-
|
|
1
|
+
import "./opsx-entity-c7m5CbgU.mjs";
|
|
2
|
+
import { i as projectTasksFromMarkdownFiles, n as isMarkdownTaskSourcePath, r as parseMarkdownTasks, t as computeTaskProgress } from "./task-progress-DhHYHnTv.mjs";
|
|
3
3
|
|
|
4
4
|
export { computeTaskProgress, isMarkdownTaskSourcePath, parseMarkdownTasks, projectTasksFromMarkdownFiles };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./sounds-
|
|
2
|
-
import { i as TerminalBellSoundSchema, n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSound, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-
|
|
1
|
+
import "./sounds-kgDn4x8v.mjs";
|
|
2
|
+
import { i as TerminalBellSoundSchema, n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSound, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-CsuGTNV-.mjs";
|
|
3
3
|
export { TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TerminalBellSound, TerminalBellSoundSchema };
|
package/dist/terminal-audio.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./sounds-
|
|
2
|
-
import { n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSoundSchema, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-
|
|
1
|
+
import "./sounds-CB3ubSnj.mjs";
|
|
2
|
+
import { n as TERMINAL_BELL_SOUND_VALUES, r as TerminalBellSoundSchema, t as TERMINAL_BELL_SOUND_OPTIONS } from "./terminal-audio-TBoU2jSK.mjs";
|
|
3
3
|
|
|
4
4
|
export { TERMINAL_BELL_SOUND_OPTIONS, TERMINAL_BELL_SOUND_VALUES, TerminalBellSoundSchema };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./sounds-
|
|
2
|
-
import { A as TerminalNotificationProtocol, D as TerminalControlEvent, M as TerminalPromptState, N as TerminalTitleTarget, O as TerminalControlParseResult, P as terminalNotificationEventToPublishInput, j as TerminalProgressState, k as TerminalControlParser } from "./notifications-
|
|
1
|
+
import "./sounds-kgDn4x8v.mjs";
|
|
2
|
+
import { A as TerminalNotificationProtocol, D as TerminalControlEvent, M as TerminalPromptState, N as TerminalTitleTarget, O as TerminalControlParseResult, P as terminalNotificationEventToPublishInput, j as TerminalProgressState, k as TerminalControlParser } from "./notifications-DZeOl4HV.mjs";
|
|
3
3
|
export { TerminalControlEvent, TerminalControlParseResult, TerminalControlParser, TerminalNotificationProtocol, TerminalProgressState, TerminalPromptState, TerminalTitleTarget, terminalNotificationEventToPublishInput };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as terminalNotificationEventToPublishInput, t as TerminalControlParser } from "./terminal-control-
|
|
1
|
+
import { n as terminalNotificationEventToPublishInput, t as TerminalControlParser } from "./terminal-control-VpTuh17B.mjs";
|
|
2
2
|
|
|
3
3
|
export { TerminalControlParser, terminalNotificationEventToPublishInput };
|