@openspecui/core 5.0.0 → 6.0.0-beta.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/cli-projection-DxnVGm2B.d.mts +789 -0
- package/dist/cli-projection-vO3-FJg5.mjs +161 -0
- package/dist/cli-projection.d.mts +6 -0
- package/dist/cli-projection.mjs +4 -0
- package/dist/command-result-fkH3Ekdz.d.mts +8477 -0
- package/dist/common-D8YUK9dA.mjs +57 -0
- package/dist/dashboard-summary-transport-CQ4is5_e.d.mts +66227 -0
- package/dist/dashboard-summary-transport-D2VBAIxg.mjs +175 -0
- package/dist/dashboard-summary-transport.d.mts +25 -0
- package/dist/dashboard-summary-transport.mjs +6 -0
- package/dist/{document-translation-D4YK18I3.mjs → document-translation-CeJFGMoy.mjs} +1 -1
- package/dist/{document-translation-7R8cf8_B.d.mts → document-translation-D50BnvVh.d.mts} +2 -2
- package/dist/document-translation.d.mts +1 -1
- package/dist/document-translation.mjs +2 -2
- package/dist/{hosted-app-CzMRiEgY.mjs → hosted-app-BPU4OR41.mjs} +31 -9
- package/dist/hosted-app.d.mts +25 -2
- package/dist/hosted-app.mjs +7 -2
- package/dist/hosted-contract-CcRnb51e.mjs +234 -0
- package/dist/hosted-contract.d.mts +25 -0
- package/dist/hosted-contract.mjs +7 -0
- package/dist/index.d.mts +25 -2686
- package/dist/index.mjs +2114 -1098
- package/dist/{local-download-profiles-caa4PECd.d.mts → local-download-profiles-BL_rtlVM.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-CgXuXp6s.d.mts → markdown-reading-LUdqfbxH.d.mts} +1 -1
- package/dist/{markdown-reading-DdcB7run.mjs → markdown-reading-mG4OAbDO.mjs} +1 -1
- package/dist/markdown-reading.d.mts +2 -2
- package/dist/markdown-reading.mjs +2 -2
- package/dist/{notifications-AKAcmeKT.mjs → notifications-C2bxAzX_.mjs} +13 -2
- package/dist/{notifications-DZeOl4HV.d.mts → notifications-CgJlLgLO.d.mts} +51 -25
- package/dist/notifications.d.mts +2 -2
- package/dist/notifications.mjs +3 -3
- package/dist/{openspec-annotations-CeXd0JIZ.d.mts → openspec-annotations-C58Aoi-V.d.mts} +2 -2
- package/dist/{openspec-annotations-D_6Pz7k4.mjs → openspec-annotations-DCfqBMal.mjs} +2 -2
- package/dist/openspec-annotations.d.mts +3 -3
- package/dist/openspec-annotations.mjs +3 -3
- package/dist/openspec-compat.d.mts +18 -11
- package/dist/openspec-compat.mjs +20 -13
- package/dist/{openspec-projection-B8s-KWQ7.mjs → openspec-projection-DCgToo0Q.mjs} +2 -2
- package/dist/{openspec-projection-B0ch1rZw.d.mts → openspec-projection-RohNZI4p.d.mts} +3 -3
- 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-DZyl-uhQ.d.mts → opsx-entity-D7kDQsze.d.mts} +2 -2
- package/dist/opsx-entity.d.mts +7 -3
- package/dist/opsx-entity.mjs +1 -1
- package/dist/{opsx-schema-detail-CS0tWa9v.d.mts → opsx-schema-detail-BxDXEwDY.d.mts} +2 -2
- package/dist/opsx-schema-detail.d.mts +8 -4
- package/dist/opsx-schema-detail.mjs +1 -1
- package/dist/opsx-types-BJ8AjhrS.d.mts +3642 -0
- package/dist/opsx-workflows-BvnJqjfL.d.mts +36 -0
- package/dist/opsx-workflows-Ccc6U7IR.mjs +89 -0
- package/dist/opsx-workflows.d.mts +2 -0
- package/dist/opsx-workflows.mjs +3 -0
- package/dist/planning-cli-projection-DIRxeq2H.mjs +421 -0
- package/dist/planning-cli-projection.d.mts +25 -0
- package/dist/planning-cli-projection.mjs +9 -0
- package/dist/schemas-BFroDdOC.mjs +287 -0
- package/dist/{schemas-D01aQnV4.d.mts → schemas-DS-JqAJ2.d.mts} +524 -78
- package/dist/{sounds-kgDn4x8v.d.mts → sounds-qhRgCy0F.d.mts} +12 -12
- package/dist/sounds.d.mts +1 -1
- package/dist/sounds.mjs +1 -1
- package/dist/spec-catalog-ZGuiZ4CE.mjs +901 -0
- package/dist/spec-catalog.d.mts +25 -0
- package/dist/spec-catalog.mjs +6 -0
- package/dist/store-mutation-protocol-5tfs-RmD.d.mts +727 -0
- package/dist/store-mutation-protocol-CSwD-xPO.mjs +63 -0
- package/dist/store-mutation-protocol.d.mts +2 -0
- package/dist/store-mutation-protocol.mjs +4 -0
- package/dist/{store-types-Cu41QSww.mjs → store-types-DlX1REBg.mjs} +39 -18
- package/dist/{store-types-BiE-Ey--.d.mts → store-types-b554wAQJ.d.mts} +22 -12
- package/dist/store-types.d.mts +6 -2
- package/dist/store-types.mjs +2 -2
- package/dist/task-progress-B_IWVXjA.mjs +216 -0
- package/dist/task-progress.d.mts +7 -4
- package/dist/task-progress.mjs +3 -3
- package/dist/{terminal-audio-TBoU2jSK.mjs → terminal-audio-d6KItUeJ.mjs} +1 -1
- package/dist/{terminal-audio-CsuGTNV-.d.mts → terminal-audio-tXDm_EDe.d.mts} +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-BlFwKpIc.d.mts → terminal-invocation-BOvxThym.d.mts} +239 -120
- 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-BErXgQxx.d.mts → translator-NKv1wo3o.d.mts} +86 -86
- package/dist/translator.d.mts +1 -1
- package/dist/translator.mjs +1 -1
- package/package.json +55 -7
- package/dist/hosted-app-DHs94gIR.d.mts +0 -43
- package/dist/opsx-types-Dnb06uff.d.mts +0 -402
- package/dist/task-progress-C1TGMbIR.d.mts +0 -24
- package/dist/task-progress-DhHYHnTv.mjs +0 -70
- /package/dist/{local-download-profiles-kpNEcdF_.mjs → local-download-profiles-odzOdf96.mjs} +0 -0
- /package/dist/{markdown-facts-BBCTe_qq.mjs → markdown-facts-BUqLvFRf.mjs} +0 -0
- /package/dist/{markdown-facts-Dk7FKaaT.d.mts → markdown-facts-CCw3QdbM.d.mts} +0 -0
- /package/dist/{opsx-display-path-CUCOrHcM.mjs → opsx-display-path-D13XV20v.mjs} +0 -0
- /package/dist/{opsx-display-path-cIMKa1aw.d.mts → opsx-display-path-RXS5JTbV.d.mts} +0 -0
- /package/dist/{opsx-entity-c7m5CbgU.mjs → opsx-entity-Cn_Zu1J3.mjs} +0 -0
- /package/dist/{opsx-schema-detail-BH82X6aU.mjs → opsx-schema-detail-Beis4Ba2.mjs} +0 -0
- /package/dist/{sounds-CB3ubSnj.mjs → sounds-NXwveBqq.mjs} +0 -0
- /package/dist/{terminal-control-VpTuh17B.mjs → terminal-control-BSAlOTs8.mjs} +0 -0
- /package/dist/{terminal-invocation-C2MCNBhK.mjs → terminal-invocation-0p-j2eSP.mjs} +0 -0
- /package/dist/{terminal-theme-cevliJw2.mjs → terminal-theme-B8iRttTR.mjs} +0 -0
- /package/dist/{terminal-theme-hvQjTsNh.d.mts → terminal-theme-m3MSGJ7U.d.mts} +0 -0
- /package/dist/{translation-language-pair-DZ_WNp_M.mjs → translation-language-pair-Bbhk-LAC.mjs} +0 -0
- /package/dist/{translation-language-pair-DmaOfHqD.d.mts → translation-language-pair-C18GPATW.d.mts} +0 -0
- /package/dist/{translator-DbUT1Ayn.mjs → translator-Cjtv4tya.mjs} +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { d as TrackedTaskProgressSchema } from "./schemas-BFroDdOC.mjs";
|
|
2
|
+
import { s as CliProjectionStateNameSchema, u as createCliProjectionStateSchema } from "./cli-projection-vO3-FJg5.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/dashboard-types.ts
|
|
6
|
+
/**
|
|
7
|
+
* Orthogonal intents (updated 2026-07-23 Asia/Shanghai):
|
|
8
|
+
* 1. Define Dashboard metrics, trends, planning projections, and Git snapshot contracts.
|
|
9
|
+
* 2. Preserve backend-issued Code binding provenance on live Git snapshots.
|
|
10
|
+
* 3. Split independently refreshable Summary and Trends facts from the aggregate Dashboard compatibility view.
|
|
11
|
+
*
|
|
12
|
+
* Original request (2026-07-19): "代码已经提交,开始review。如果有问题,那么可更新change。"
|
|
13
|
+
* Derived requirement (2026-07-19): Checkpoint 6.11 binds Dashboard snapshots to their Code token.
|
|
14
|
+
* Original request (2026-07-23): "现在页面数据的加载数据非常慢(比如dashboard页面、changes页面都要等待非常久,页面刷新后,似乎后台没有缓存一样,也要加载很久。"
|
|
15
|
+
*/
|
|
16
|
+
const DASHBOARD_METRIC_KEYS = [
|
|
17
|
+
"specifications",
|
|
18
|
+
"requirements",
|
|
19
|
+
"activeChanges",
|
|
20
|
+
"inProgressChanges",
|
|
21
|
+
"completedChanges",
|
|
22
|
+
"taskCompletionPercent"
|
|
23
|
+
];
|
|
24
|
+
const DashboardTrendPointSchema = z.object({
|
|
25
|
+
ts: z.number(),
|
|
26
|
+
value: z.number()
|
|
27
|
+
});
|
|
28
|
+
const DashboardTriColorTrendPointSchema = z.object({
|
|
29
|
+
ts: z.number(),
|
|
30
|
+
add: z.number(),
|
|
31
|
+
modify: z.number(),
|
|
32
|
+
delete: z.number()
|
|
33
|
+
});
|
|
34
|
+
const DashboardTrendRecordSchema = z.object({
|
|
35
|
+
specifications: z.array(DashboardTrendPointSchema),
|
|
36
|
+
requirements: z.array(DashboardTrendPointSchema),
|
|
37
|
+
activeChanges: z.array(DashboardTrendPointSchema),
|
|
38
|
+
inProgressChanges: z.array(DashboardTrendPointSchema),
|
|
39
|
+
completedChanges: z.array(DashboardTrendPointSchema),
|
|
40
|
+
taskCompletionPercent: z.array(DashboardTrendPointSchema)
|
|
41
|
+
});
|
|
42
|
+
const DashboardTriColorTrendRecordSchema = z.object({
|
|
43
|
+
specifications: z.array(DashboardTriColorTrendPointSchema),
|
|
44
|
+
requirements: z.array(DashboardTriColorTrendPointSchema),
|
|
45
|
+
activeChanges: z.array(DashboardTriColorTrendPointSchema),
|
|
46
|
+
inProgressChanges: z.array(DashboardTriColorTrendPointSchema),
|
|
47
|
+
completedChanges: z.array(DashboardTriColorTrendPointSchema),
|
|
48
|
+
taskCompletionPercent: z.array(DashboardTriColorTrendPointSchema)
|
|
49
|
+
});
|
|
50
|
+
const DashboardTrendKindsSchema = z.object({
|
|
51
|
+
specifications: z.enum(["monotonic", "bidirectional"]),
|
|
52
|
+
requirements: z.enum(["monotonic", "bidirectional"]),
|
|
53
|
+
activeChanges: z.enum(["monotonic", "bidirectional"]),
|
|
54
|
+
inProgressChanges: z.enum(["monotonic", "bidirectional"]),
|
|
55
|
+
completedChanges: z.enum(["monotonic", "bidirectional"]),
|
|
56
|
+
taskCompletionPercent: z.enum(["monotonic", "bidirectional"])
|
|
57
|
+
});
|
|
58
|
+
const DashboardCardAvailabilitySchema = z.discriminatedUnion("state", [z.object({ state: z.literal("ok") }), z.object({
|
|
59
|
+
state: z.literal("invalid"),
|
|
60
|
+
reason: z.enum(["semantic-uncomputable", "objective-history-unavailable"])
|
|
61
|
+
})]);
|
|
62
|
+
const DashboardCardAvailabilityRecordSchema = z.object({
|
|
63
|
+
specifications: DashboardCardAvailabilitySchema,
|
|
64
|
+
requirements: DashboardCardAvailabilitySchema,
|
|
65
|
+
activeChanges: DashboardCardAvailabilitySchema,
|
|
66
|
+
inProgressChanges: DashboardCardAvailabilitySchema,
|
|
67
|
+
completedChanges: DashboardCardAvailabilitySchema,
|
|
68
|
+
taskCompletionPercent: DashboardCardAvailabilitySchema
|
|
69
|
+
});
|
|
70
|
+
const DashboardSummarySchema = z.object({
|
|
71
|
+
specifications: z.number(),
|
|
72
|
+
requirements: z.number(),
|
|
73
|
+
activeChanges: z.number(),
|
|
74
|
+
inProgressChanges: z.number(),
|
|
75
|
+
completedChanges: z.number(),
|
|
76
|
+
archivedTasksCompleted: z.number(),
|
|
77
|
+
tasksTotal: z.number(),
|
|
78
|
+
tasksCompleted: z.number(),
|
|
79
|
+
taskCompletionPercent: z.number().nullable()
|
|
80
|
+
});
|
|
81
|
+
const DashboardGitDiffStatsSchema = z.object({
|
|
82
|
+
files: z.number(),
|
|
83
|
+
insertions: z.number(),
|
|
84
|
+
deletions: z.number()
|
|
85
|
+
});
|
|
86
|
+
const DashboardGitEntrySchema = z.discriminatedUnion("type", [z.object({
|
|
87
|
+
type: z.literal("commit"),
|
|
88
|
+
hash: z.string(),
|
|
89
|
+
title: z.string(),
|
|
90
|
+
committedAt: z.number(),
|
|
91
|
+
relatedChanges: z.array(z.string()),
|
|
92
|
+
diff: DashboardGitDiffStatsSchema
|
|
93
|
+
}), z.object({
|
|
94
|
+
type: z.literal("uncommitted"),
|
|
95
|
+
title: z.string(),
|
|
96
|
+
updatedAt: z.number().nullable(),
|
|
97
|
+
relatedChanges: z.array(z.string()),
|
|
98
|
+
diff: DashboardGitDiffStatsSchema
|
|
99
|
+
})]);
|
|
100
|
+
const DashboardGitWorktreeSchema = z.object({
|
|
101
|
+
path: z.string(),
|
|
102
|
+
relativePath: z.string(),
|
|
103
|
+
pathAvailable: z.boolean(),
|
|
104
|
+
branchName: z.string(),
|
|
105
|
+
detached: z.boolean(),
|
|
106
|
+
isCurrent: z.boolean(),
|
|
107
|
+
ahead: z.number(),
|
|
108
|
+
behind: z.number(),
|
|
109
|
+
diff: DashboardGitDiffStatsSchema,
|
|
110
|
+
entries: z.array(DashboardGitEntrySchema)
|
|
111
|
+
});
|
|
112
|
+
const DashboardGitSnapshotSchema = z.object({
|
|
113
|
+
bindingToken: z.string().nullable(),
|
|
114
|
+
defaultBranch: z.string(),
|
|
115
|
+
worktrees: z.array(DashboardGitWorktreeSchema)
|
|
116
|
+
});
|
|
117
|
+
const DashboardSummaryProjectionSchema = z.object({
|
|
118
|
+
summary: DashboardSummarySchema,
|
|
119
|
+
specifications: z.array(z.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
name: z.string(),
|
|
122
|
+
requirements: z.number(),
|
|
123
|
+
updatedAt: z.number()
|
|
124
|
+
})),
|
|
125
|
+
activeChanges: z.array(z.object({
|
|
126
|
+
id: z.string(),
|
|
127
|
+
name: z.string(),
|
|
128
|
+
trackedTaskProgress: TrackedTaskProgressSchema,
|
|
129
|
+
updatedAt: z.number()
|
|
130
|
+
}))
|
|
131
|
+
});
|
|
132
|
+
const DashboardTrendsProjectionSchema = z.object({
|
|
133
|
+
trends: DashboardTrendRecordSchema,
|
|
134
|
+
triColorTrends: DashboardTriColorTrendRecordSchema,
|
|
135
|
+
trendKinds: DashboardTrendKindsSchema,
|
|
136
|
+
cardAvailability: DashboardCardAvailabilityRecordSchema,
|
|
137
|
+
trendMeta: z.object({
|
|
138
|
+
pointLimit: z.number(),
|
|
139
|
+
lastUpdatedAt: z.number()
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
const DashboardOverviewSchema = DashboardSummaryProjectionSchema.merge(DashboardTrendsProjectionSchema).extend({ git: DashboardGitSnapshotSchema });
|
|
143
|
+
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/dashboard-summary-transport.ts
|
|
146
|
+
/**
|
|
147
|
+
* Orthogonal intents (updated 2026-07-27 Asia/Shanghai):
|
|
148
|
+
* 1. Define browser-safe opaque identity and wake-up contracts for Dashboard Summary v2.
|
|
149
|
+
* 2. Define the full typed Summary projection state without exposing Planning-root filesystem provenance.
|
|
150
|
+
* 3. Preserve retained versus current authority across fresh browser Documents.
|
|
151
|
+
*
|
|
152
|
+
* Original request (2026-07-23): "在已有content的时候,服务端推送变更,然后客户端收到推送通知,于是开始加载更新数据。"
|
|
153
|
+
* Original request (2026-07-27): "Dashboard页面每次页面刷新的时候,它仍然要加载很多?"
|
|
154
|
+
*/
|
|
155
|
+
/** Opaque Server-issued identity; it is derived from, but never contains, a Planning-root path. */
|
|
156
|
+
const DashboardSummaryIdentitySchema = z.string().regex(/^dashboard-summary-v2:[A-Za-z0-9_-]{43}$/);
|
|
157
|
+
/** Reasons that can wake the migrated Summary adapter in this bounded v2 slice. */
|
|
158
|
+
const DashboardSummaryInvalidationCauseSchema = z.enum([
|
|
159
|
+
"initial",
|
|
160
|
+
"server-push",
|
|
161
|
+
"root-rebind"
|
|
162
|
+
]);
|
|
163
|
+
/** Data-free subscription event. Replacement Summary data always arrives through the typed pull. */
|
|
164
|
+
const DashboardSummaryInvalidationSchema = z.object({
|
|
165
|
+
identity: DashboardSummaryIdentitySchema,
|
|
166
|
+
workGeneration: z.number().int().nonnegative(),
|
|
167
|
+
snapshotGeneration: z.number().int().nonnegative().nullable(),
|
|
168
|
+
state: CliProjectionStateNameSchema,
|
|
169
|
+
cause: DashboardSummaryInvalidationCauseSchema
|
|
170
|
+
}).strict();
|
|
171
|
+
/** Full Summary Pull state correlated to the exact Server-owned work identity and generation. */
|
|
172
|
+
const DashboardSummaryProjectionStateSchema = createCliProjectionStateSchema(DashboardSummaryProjectionSchema);
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
export { DASHBOARD_METRIC_KEYS as a, DashboardSummaryProjectionSchema as c, DashboardSummaryProjectionStateSchema as i, DashboardTrendsProjectionSchema as l, DashboardSummaryInvalidationCauseSchema as n, DashboardGitSnapshotSchema as o, DashboardSummaryInvalidationSchema as r, DashboardOverviewSchema as s, DashboardSummaryIdentitySchema as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./command-result-fkH3Ekdz.mjs";
|
|
2
|
+
import "./document-translation-D50BnvVh.mjs";
|
|
3
|
+
import "./sounds-qhRgCy0F.mjs";
|
|
4
|
+
import "./notifications-CgJlLgLO.mjs";
|
|
5
|
+
import "./cli-projection-DxnVGm2B.mjs";
|
|
6
|
+
import "./schemas-DS-JqAJ2.mjs";
|
|
7
|
+
import "./opsx-types-BJ8AjhrS.mjs";
|
|
8
|
+
import "./opsx-entity-D7kDQsze.mjs";
|
|
9
|
+
import { a as DashboardSummaryInvalidationCauseSchema, c as DashboardSummaryProjectionStateSchema, i as DashboardSummaryInvalidationCause, n as DashboardSummaryIdentitySchema, o as DashboardSummaryInvalidationSchema, r as DashboardSummaryInvalidation, s as DashboardSummaryProjectionState, t as DashboardSummaryIdentity } from "./dashboard-summary-transport-CQ4is5_e.mjs";
|
|
10
|
+
import "./markdown-facts-CCw3QdbM.mjs";
|
|
11
|
+
import "./markdown-reading-LUdqfbxH.mjs";
|
|
12
|
+
import "./openspec-annotations-C58Aoi-V.mjs";
|
|
13
|
+
import "./openspec-projection-RohNZI4p.mjs";
|
|
14
|
+
import "./translator-NKv1wo3o.mjs";
|
|
15
|
+
import "./terminal-audio-tXDm_EDe.mjs";
|
|
16
|
+
import "./local-download-profiles-BL_rtlVM.mjs";
|
|
17
|
+
import "./translation-language-pair-C18GPATW.mjs";
|
|
18
|
+
import "./opsx-workflows-BvnJqjfL.mjs";
|
|
19
|
+
import "./opsx-display-path-RXS5JTbV.mjs";
|
|
20
|
+
import "./store-mutation-protocol-5tfs-RmD.mjs";
|
|
21
|
+
import "./store-types-b554wAQJ.mjs";
|
|
22
|
+
import "./terminal-invocation-BOvxThym.mjs";
|
|
23
|
+
import "./terminal-theme-m3MSGJ7U.mjs";
|
|
24
|
+
import "./opsx-schema-detail-BxDXEwDY.mjs";
|
|
25
|
+
export { DashboardSummaryIdentity, DashboardSummaryIdentitySchema, DashboardSummaryInvalidation, DashboardSummaryInvalidationCause, DashboardSummaryInvalidationCauseSchema, DashboardSummaryInvalidationSchema, DashboardSummaryProjectionState, DashboardSummaryProjectionStateSchema };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./schemas-BFroDdOC.mjs";
|
|
2
|
+
import "./common-D8YUK9dA.mjs";
|
|
3
|
+
import "./cli-projection-vO3-FJg5.mjs";
|
|
4
|
+
import { i as DashboardSummaryProjectionStateSchema, n as DashboardSummaryInvalidationCauseSchema, r as DashboardSummaryInvalidationSchema, t as DashboardSummaryIdentitySchema } from "./dashboard-summary-transport-D2VBAIxg.mjs";
|
|
5
|
+
|
|
6
|
+
export { DashboardSummaryIdentitySchema, DashboardSummaryInvalidationCauseSchema, DashboardSummaryInvalidationSchema, DashboardSummaryProjectionStateSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as TranslationEngineIdSchema, i as DEFAULT_TRANSLATION_ENGINE_ID } from "./translator-
|
|
1
|
+
import { A as TranslationEngineIdSchema, i as DEFAULT_TRANSLATION_ENGINE_ID } from "./translator-Cjtv4tya.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/document-translation.ts
|
|
@@ -449,7 +449,6 @@ declare const TranslationCacheEntrySchema: z.ZodObject<{
|
|
|
449
449
|
createdAt: z.ZodNumber;
|
|
450
450
|
lastAccessedAt: z.ZodNumber;
|
|
451
451
|
}, "strip", z.ZodTypeAny, {
|
|
452
|
-
createdAt: number;
|
|
453
452
|
targetLanguage: string;
|
|
454
453
|
engineId: "local" | "openai" | "browser" | "local-ct2" | "local-llama";
|
|
455
454
|
key: string;
|
|
@@ -461,12 +460,12 @@ declare const TranslationCacheEntrySchema: z.ZodObject<{
|
|
|
461
460
|
attributeTopologyHash: string;
|
|
462
461
|
displayPolicyVersion: number;
|
|
463
462
|
translatorContractVersion: number;
|
|
463
|
+
createdAt: number;
|
|
464
464
|
lastAccessedAt: number;
|
|
465
465
|
model?: string | undefined;
|
|
466
466
|
targetNodesJson?: string | undefined;
|
|
467
467
|
engineVersion?: string | undefined;
|
|
468
468
|
}, {
|
|
469
|
-
createdAt: number;
|
|
470
469
|
targetLanguage: string;
|
|
471
470
|
key: string;
|
|
472
471
|
keyHash: string;
|
|
@@ -476,6 +475,7 @@ declare const TranslationCacheEntrySchema: z.ZodObject<{
|
|
|
476
475
|
placeholderTopologyHash: string;
|
|
477
476
|
attributeTopologyHash: string;
|
|
478
477
|
displayPolicyVersion: number;
|
|
478
|
+
createdAt: number;
|
|
479
479
|
lastAccessedAt: number;
|
|
480
480
|
model?: string | undefined;
|
|
481
481
|
engineId?: "local" | "openai" | "browser" | "local-ct2" | "local-llama" | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as TranslationCacheWriteInputSchema, D as TranslationEngineProjectSettingsUpdateSchema, E as TranslationEngineProjectSettingsUpdate, S as TranslationCacheWriteInput, T as TranslationEngineProjectSettingsSchema, _ as TranslationCacheSettings, a as DocumentTranslationConfigSchema, b as TranslationCacheStats, c as DocumentTranslationDisplayMode, d as MIN_TRANSLATION_CACHE_ENTRY_LIMIT, f as TRANSLATION_CACHE_POLICY_VERSION, g as TranslationCacheReadInputSchema, h as TranslationCacheReadInput, i as DocumentTranslationConfigInput, l as DocumentTranslationDisplayModeSchema, m as TranslationCacheEntrySchema, n as DOCUMENT_TRANSLATION_DISPLAY_MODES, o as DocumentTranslationConfigUpdate, p as TranslationCacheEntry, r as DocumentTranslationConfig, s as DocumentTranslationConfigUpdateSchema, t as DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, u as MAX_TRANSLATION_CACHE_ENTRY_LIMIT, v as TranslationCacheSettingsSchema, w as TranslationEngineProjectSettings, x as TranslationCacheStatsSchema, y as TranslationCacheSettingsUpdateSchema } from "./document-translation-
|
|
1
|
+
import { C as TranslationCacheWriteInputSchema, D as TranslationEngineProjectSettingsUpdateSchema, E as TranslationEngineProjectSettingsUpdate, S as TranslationCacheWriteInput, T as TranslationEngineProjectSettingsSchema, _ as TranslationCacheSettings, a as DocumentTranslationConfigSchema, b as TranslationCacheStats, c as DocumentTranslationDisplayMode, d as MIN_TRANSLATION_CACHE_ENTRY_LIMIT, f as TRANSLATION_CACHE_POLICY_VERSION, g as TranslationCacheReadInputSchema, h as TranslationCacheReadInput, i as DocumentTranslationConfigInput, l as DocumentTranslationDisplayModeSchema, m as TranslationCacheEntrySchema, n as DOCUMENT_TRANSLATION_DISPLAY_MODES, o as DocumentTranslationConfigUpdate, p as TranslationCacheEntry, r as DocumentTranslationConfig, s as DocumentTranslationConfigUpdateSchema, t as DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, u as MAX_TRANSLATION_CACHE_ENTRY_LIMIT, v as TranslationCacheSettingsSchema, w as TranslationEngineProjectSettings, x as TranslationCacheStatsSchema, y as TranslationCacheSettingsUpdateSchema } from "./document-translation-D50BnvVh.mjs";
|
|
2
2
|
export { DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, DOCUMENT_TRANSLATION_DISPLAY_MODES, DocumentTranslationConfig, DocumentTranslationConfigInput, DocumentTranslationConfigSchema, DocumentTranslationConfigUpdate, DocumentTranslationConfigUpdateSchema, DocumentTranslationDisplayMode, DocumentTranslationDisplayModeSchema, MAX_TRANSLATION_CACHE_ENTRY_LIMIT, MIN_TRANSLATION_CACHE_ENTRY_LIMIT, TRANSLATION_CACHE_POLICY_VERSION, TranslationCacheEntry, TranslationCacheEntrySchema, TranslationCacheReadInput, TranslationCacheReadInputSchema, TranslationCacheSettings, TranslationCacheSettingsSchema, TranslationCacheSettingsUpdateSchema, TranslationCacheStats, TranslationCacheStatsSchema, TranslationCacheWriteInput, TranslationCacheWriteInputSchema, TranslationEngineProjectSettings, TranslationEngineProjectSettingsSchema, TranslationEngineProjectSettingsUpdate, TranslationEngineProjectSettingsUpdateSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./translator-
|
|
2
|
-
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-
|
|
1
|
+
import "./translator-Cjtv4tya.mjs";
|
|
2
|
+
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-CeJFGMoy.mjs";
|
|
3
3
|
|
|
4
4
|
export { DEFAULT_TRANSLATION_CACHE_ENTRY_LIMIT, DOCUMENT_TRANSLATION_DISPLAY_MODES, DocumentTranslationConfigSchema, DocumentTranslationConfigUpdateSchema, DocumentTranslationDisplayModeSchema, MAX_TRANSLATION_CACHE_ENTRY_LIMIT, MIN_TRANSLATION_CACHE_ENTRY_LIMIT, TRANSLATION_CACHE_POLICY_VERSION, TranslationCacheEntrySchema, TranslationCacheReadInputSchema, TranslationCacheSettingsSchema, TranslationCacheSettingsUpdateSchema, TranslationCacheStatsSchema, TranslationCacheWriteInputSchema, TranslationEngineProjectSettingsSchema, TranslationEngineProjectSettingsUpdateSchema };
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { i as HostedBackendHealthResponseSchema, n as HOSTED_STORE_CAPABILITIES, t as HOSTED_SHELL_PROTOCOL_VERSION, v as OPENSPECUI_RUNTIME_CAPABILITIES } from "./hosted-contract-CcRnb51e.mjs";
|
|
2
|
+
|
|
1
3
|
//#region src/hosted-app.ts
|
|
4
|
+
/**
|
|
5
|
+
* Orthogonal intents (updated 2026-07-25 Asia/Shanghai):
|
|
6
|
+
* 1. Define browser-safe hosted backend metadata and compatibility capability facts.
|
|
7
|
+
* 2. Normalize App/embedded launch locators and carry session-only credentials in fragments.
|
|
8
|
+
* 3. Validate embedded UI origins without inventing backend authority.
|
|
9
|
+
* 4. Re-export the browser-safe hosted runtime schema source without a Node-bearing Core root import.
|
|
10
|
+
*
|
|
11
|
+
* Original request (2026-07-15): "app 模式提供了多标签管理。"
|
|
12
|
+
* Delivery correction (2026-07-24): privately carry the exact Access Gate credential to Project Web.
|
|
13
|
+
*/
|
|
2
14
|
const OFFICIAL_APP_BASE_URL = "https://app.openspecui.com";
|
|
3
|
-
const
|
|
4
|
-
const OPENSPECUI_RUNTIME_CAPABILITIES = ["notifications.subscribe", "config.notifications"];
|
|
5
|
-
function isRecord(value) {
|
|
6
|
-
return typeof value === "object" && value !== null;
|
|
7
|
-
}
|
|
15
|
+
const ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM = "credential";
|
|
8
16
|
function withHttpsProtocol(value) {
|
|
9
17
|
if (/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//.test(value)) return value;
|
|
10
18
|
return `https://${value}`;
|
|
@@ -55,15 +63,23 @@ function isSupportedEmbeddedUiUrl(input) {
|
|
|
55
63
|
if (parsed.protocol === "https:") return true;
|
|
56
64
|
return parsed.protocol === "http:" && isLoopbackHostname(parsed.hostname);
|
|
57
65
|
}
|
|
66
|
+
function setAccessGateCredentialFragment(url, credential) {
|
|
67
|
+
if (!credential) return;
|
|
68
|
+
const fragment = new URLSearchParams(url.hash.slice(1));
|
|
69
|
+
fragment.set(ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM, credential);
|
|
70
|
+
url.hash = fragment.toString();
|
|
71
|
+
}
|
|
58
72
|
function buildHostedLaunchUrl(options) {
|
|
59
73
|
const url = new URL(normalizeHostedAppBaseUrl(options.baseUrl));
|
|
60
74
|
url.searchParams.set("api", options.apiBaseUrl);
|
|
75
|
+
setAccessGateCredentialFragment(url, options.credential);
|
|
61
76
|
return url.toString();
|
|
62
77
|
}
|
|
63
78
|
function buildEmbeddedUiLaunchUrl(options) {
|
|
64
79
|
const url = new URL(normalizeEmbeddedUiUrl(options.embeddedUiUrl));
|
|
65
80
|
url.searchParams.set("api", options.apiBaseUrl);
|
|
66
81
|
url.searchParams.set("session", options.sessionId);
|
|
82
|
+
setAccessGateCredentialFragment(url, options.credential);
|
|
67
83
|
return url.toString();
|
|
68
84
|
}
|
|
69
85
|
function buildBackendHealthPayload(input) {
|
|
@@ -75,7 +91,13 @@ function buildBackendHealthPayload(input) {
|
|
|
75
91
|
openspecuiVersion: input.openspecuiVersion,
|
|
76
92
|
hostedShellProtocolVersion: HOSTED_SHELL_PROTOCOL_VERSION,
|
|
77
93
|
embeddedUiUrl: input.embeddedUiUrl,
|
|
78
|
-
runtimeCapabilities: OPENSPECUI_RUNTIME_CAPABILITIES
|
|
94
|
+
runtimeCapabilities: [...OPENSPECUI_RUNTIME_CAPABILITIES],
|
|
95
|
+
apiBaseUrl: input.apiBaseUrl,
|
|
96
|
+
cliVersion: input.cliVersion,
|
|
97
|
+
envUri: input.envUri,
|
|
98
|
+
rootSummary: input.rootSummary,
|
|
99
|
+
hostedCapabilities: [...HOSTED_STORE_CAPABILITIES],
|
|
100
|
+
accessGateEnabled: input.accessGateEnabled
|
|
79
101
|
};
|
|
80
102
|
}
|
|
81
103
|
function hasRequiredRuntimeCapabilities(value) {
|
|
@@ -84,12 +106,12 @@ function hasRequiredRuntimeCapabilities(value) {
|
|
|
84
106
|
return OPENSPECUI_RUNTIME_CAPABILITIES.every((capability) => capabilities.has(capability));
|
|
85
107
|
}
|
|
86
108
|
function isBackendHealthRuntimeMetadata(value) {
|
|
87
|
-
|
|
88
|
-
return
|
|
109
|
+
const decoded = HostedBackendHealthResponseSchema.safeParse(value);
|
|
110
|
+
return decoded.success && hasRequiredRuntimeCapabilities(decoded.data.runtimeCapabilities);
|
|
89
111
|
}
|
|
90
112
|
function isHostedBackendHealthResponse(value) {
|
|
91
113
|
return isBackendHealthRuntimeMetadata(value) && isSupportedEmbeddedUiUrl(value.embeddedUiUrl);
|
|
92
114
|
}
|
|
93
115
|
|
|
94
116
|
//#endregion
|
|
95
|
-
export {
|
|
117
|
+
export { buildHostedLaunchUrl as a, isSupportedEmbeddedUiUrl as c, resolveHostedAppBaseUrl as d, buildEmbeddedUiLaunchUrl as i, normalizeEmbeddedUiUrl as l, OFFICIAL_APP_BASE_URL as n, isBackendHealthRuntimeMetadata as o, buildBackendHealthPayload as r, isHostedBackendHealthResponse as s, ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM as t, normalizeHostedAppBaseUrl as u };
|
package/dist/hosted-app.d.mts
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "./command-result-fkH3Ekdz.mjs";
|
|
2
|
+
import "./document-translation-D50BnvVh.mjs";
|
|
3
|
+
import "./sounds-qhRgCy0F.mjs";
|
|
4
|
+
import "./notifications-CgJlLgLO.mjs";
|
|
5
|
+
import "./cli-projection-DxnVGm2B.mjs";
|
|
6
|
+
import "./schemas-DS-JqAJ2.mjs";
|
|
7
|
+
import "./opsx-types-BJ8AjhrS.mjs";
|
|
8
|
+
import "./opsx-entity-D7kDQsze.mjs";
|
|
9
|
+
import { A as buildHostedLaunchUrl, B as HostedBackendHealthResponse, D as OpenSpecUIRuntimeCapability, E as OFFICIAL_APP_BASE_URL, F as normalizeHostedAppBaseUrl, H as HostedBackendRootSummary, I as resolveHostedAppBaseUrl, L as HOSTED_SHELL_PROTOCOL_VERSION, M as isHostedBackendHealthResponse, N as isSupportedEmbeddedUiUrl, O as buildBackendHealthPayload, P as normalizeEmbeddedUiUrl, R as HOSTED_STORE_CAPABILITIES, T as BackendHealthPayloadInput, V as HostedBackendHealthResponseSchema, gt as OPENSPECUI_RUNTIME_CAPABILITIES, j as isBackendHealthRuntimeMetadata, k as buildEmbeddedUiLaunchUrl, w as ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM } from "./dashboard-summary-transport-CQ4is5_e.mjs";
|
|
10
|
+
import "./markdown-facts-CCw3QdbM.mjs";
|
|
11
|
+
import "./markdown-reading-LUdqfbxH.mjs";
|
|
12
|
+
import "./openspec-annotations-C58Aoi-V.mjs";
|
|
13
|
+
import "./openspec-projection-RohNZI4p.mjs";
|
|
14
|
+
import "./translator-NKv1wo3o.mjs";
|
|
15
|
+
import "./terminal-audio-tXDm_EDe.mjs";
|
|
16
|
+
import "./local-download-profiles-BL_rtlVM.mjs";
|
|
17
|
+
import "./translation-language-pair-C18GPATW.mjs";
|
|
18
|
+
import "./opsx-workflows-BvnJqjfL.mjs";
|
|
19
|
+
import "./opsx-display-path-RXS5JTbV.mjs";
|
|
20
|
+
import "./store-mutation-protocol-5tfs-RmD.mjs";
|
|
21
|
+
import "./store-types-b554wAQJ.mjs";
|
|
22
|
+
import "./terminal-invocation-BOvxThym.mjs";
|
|
23
|
+
import "./terminal-theme-m3MSGJ7U.mjs";
|
|
24
|
+
import "./opsx-schema-detail-BxDXEwDY.mjs";
|
|
25
|
+
export { ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM, BackendHealthPayloadInput, HOSTED_SHELL_PROTOCOL_VERSION, HOSTED_STORE_CAPABILITIES, HostedBackendHealthResponse, HostedBackendHealthResponseSchema, HostedBackendRootSummary, OFFICIAL_APP_BASE_URL, OPENSPECUI_RUNTIME_CAPABILITIES, OpenSpecUIRuntimeCapability, buildBackendHealthPayload, buildEmbeddedUiLaunchUrl, buildHostedLaunchUrl, isBackendHealthRuntimeMetadata, isHostedBackendHealthResponse, isSupportedEmbeddedUiUrl, normalizeEmbeddedUiUrl, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl };
|
package/dist/hosted-app.mjs
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./common-D8YUK9dA.mjs";
|
|
2
|
+
import "./cli-projection-vO3-FJg5.mjs";
|
|
3
|
+
import "./store-mutation-protocol-CSwD-xPO.mjs";
|
|
4
|
+
import "./store-types-DlX1REBg.mjs";
|
|
5
|
+
import { i as HostedBackendHealthResponseSchema, n as HOSTED_STORE_CAPABILITIES, t as HOSTED_SHELL_PROTOCOL_VERSION, v as OPENSPECUI_RUNTIME_CAPABILITIES } from "./hosted-contract-CcRnb51e.mjs";
|
|
6
|
+
import { a as buildHostedLaunchUrl, c as isSupportedEmbeddedUiUrl, d as resolveHostedAppBaseUrl, i as buildEmbeddedUiLaunchUrl, l as normalizeEmbeddedUiUrl, n as OFFICIAL_APP_BASE_URL, o as isBackendHealthRuntimeMetadata, r as buildBackendHealthPayload, s as isHostedBackendHealthResponse, t as ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM, u as normalizeHostedAppBaseUrl } from "./hosted-app-BPU4OR41.mjs";
|
|
2
7
|
|
|
3
|
-
export { HOSTED_SHELL_PROTOCOL_VERSION, OFFICIAL_APP_BASE_URL, OPENSPECUI_RUNTIME_CAPABILITIES, buildBackendHealthPayload, buildEmbeddedUiLaunchUrl, buildHostedLaunchUrl, isBackendHealthRuntimeMetadata, isHostedBackendHealthResponse, isSupportedEmbeddedUiUrl, normalizeEmbeddedUiUrl, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl };
|
|
8
|
+
export { ACCESS_GATE_CREDENTIAL_FRAGMENT_PARAM, HOSTED_SHELL_PROTOCOL_VERSION, HOSTED_STORE_CAPABILITIES, HostedBackendHealthResponseSchema, OFFICIAL_APP_BASE_URL, OPENSPECUI_RUNTIME_CAPABILITIES, buildBackendHealthPayload, buildEmbeddedUiLaunchUrl, buildHostedLaunchUrl, isBackendHealthRuntimeMetadata, isHostedBackendHealthResponse, isSupportedEmbeddedUiUrl, normalizeEmbeddedUiUrl, normalizeHostedAppBaseUrl, resolveHostedAppBaseUrl };
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { a as CliRootSchema, n as CliDiagnosticSchema, o as CliRootSourceSchema, r as CliDoctorReferenceEntrySchema } from "./common-D8YUK9dA.mjs";
|
|
2
|
+
import { o as CliProjectionNoticeSchema, u as createCliProjectionStateSchema } from "./cli-projection-vO3-FJg5.mjs";
|
|
3
|
+
import { i as StoreMutationStartResponseSchema } from "./store-mutation-protocol-CSwD-xPO.mjs";
|
|
4
|
+
import { i as StoreListEntrySchema, r as StoreDoctorStoreSchema } from "./store-types-DlX1REBg.mjs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
//#region src/hosted-protocol-browser.ts
|
|
8
|
+
/** Mark a backend-issued string as an opaque `EnvUri` without dereferencing or reconstructing it. */
|
|
9
|
+
function asEnvUri(value) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
/** Whether a backend advertises a compatibility fact. This authorizes nothing. */
|
|
13
|
+
function hasCapability(capabilities, capability) {
|
|
14
|
+
return Boolean(capabilities?.includes(capability));
|
|
15
|
+
}
|
|
16
|
+
/** Whether a Store mutation status is terminal. */
|
|
17
|
+
function isTerminalMutationStatus(status) {
|
|
18
|
+
return status === "succeeded" || status === "failed" || status === "indeterminate";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/hosted-contract.ts
|
|
23
|
+
/**
|
|
24
|
+
* Orthogonal intents (created 2026-07-25 Asia/Shanghai):
|
|
25
|
+
* 1. Publish the browser-safe runtime schemas for hosted Health, Store, Root Context, and mutation facts.
|
|
26
|
+
* 2. Decode one successful tRPC result envelope into typed data or retained contract-error evidence.
|
|
27
|
+
* 3. Preserve upstream Store and OpenSpec diagnostic facts without inferring health or ownership.
|
|
28
|
+
* 4. Keep this protocol entry free of Node runtime dependencies for hosted browser consumers.
|
|
29
|
+
* 5. Publish Store CLI projection lifecycle Pull schemas and data-free Push notices.
|
|
30
|
+
*
|
|
31
|
+
* Original request (2026-07-24): "可以归档旧change了,然后我们继续新的change 的开发推进"
|
|
32
|
+
* P4.1 contract boundary: malformed successful hosted payloads must not become asserted public facts.
|
|
33
|
+
* Original request (2026-07-26): "这是一套通用的数据拉取推送技术。"
|
|
34
|
+
*/
|
|
35
|
+
const HOSTED_SHELL_PROTOCOL_VERSION = 1;
|
|
36
|
+
const OPENSPECUI_RUNTIME_CAPABILITIES = ["notifications.subscribe", "config.notifications"];
|
|
37
|
+
const HOSTED_STORE_CAPABILITIES = [
|
|
38
|
+
"stores.inspect",
|
|
39
|
+
"stores.mutate",
|
|
40
|
+
"contexts.inspect"
|
|
41
|
+
];
|
|
42
|
+
/** Display-safe summary emitted with a hosted backend health response. */
|
|
43
|
+
const HostedBackendRootSummarySchema = z.object({
|
|
44
|
+
planningRootPath: z.string().nullable(),
|
|
45
|
+
rootSource: CliRootSourceSchema,
|
|
46
|
+
storeId: z.string().nullable(),
|
|
47
|
+
ready: z.boolean()
|
|
48
|
+
}).passthrough();
|
|
49
|
+
/** Browser-safe runtime contract for one hosted backend health response. */
|
|
50
|
+
const HostedBackendHealthResponseSchema = z.object({
|
|
51
|
+
status: z.literal("ok"),
|
|
52
|
+
projectDir: z.string(),
|
|
53
|
+
projectName: z.string(),
|
|
54
|
+
watcherEnabled: z.boolean(),
|
|
55
|
+
openspecuiVersion: z.string(),
|
|
56
|
+
hostedShellProtocolVersion: z.literal(HOSTED_SHELL_PROTOCOL_VERSION),
|
|
57
|
+
embeddedUiUrl: z.string(),
|
|
58
|
+
runtimeCapabilities: z.array(z.enum(OPENSPECUI_RUNTIME_CAPABILITIES)),
|
|
59
|
+
apiBaseUrl: z.string().optional(),
|
|
60
|
+
cliVersion: z.string().nullable().optional(),
|
|
61
|
+
envUri: z.string().optional(),
|
|
62
|
+
rootSummary: HostedBackendRootSummarySchema.nullable().optional(),
|
|
63
|
+
hostedCapabilities: z.array(z.enum(HOSTED_STORE_CAPABILITIES)).optional(),
|
|
64
|
+
accessGateEnabled: z.boolean().optional()
|
|
65
|
+
}).passthrough();
|
|
66
|
+
const HostedStoreFeatureErrorSchema = z.object({
|
|
67
|
+
kind: z.string(),
|
|
68
|
+
message: z.string(),
|
|
69
|
+
cliVersion: z.string().optional()
|
|
70
|
+
}).passthrough();
|
|
71
|
+
/** Browser-safe Store-list projection wrapper returned by the hosted router. */
|
|
72
|
+
const HostedStoreListEnvelopeSchema = z.object({
|
|
73
|
+
available: z.boolean(),
|
|
74
|
+
stores: z.array(StoreListEntrySchema),
|
|
75
|
+
evidence: z.unknown().nullable().optional(),
|
|
76
|
+
error: HostedStoreFeatureErrorSchema.optional(),
|
|
77
|
+
cliVersion: z.string().optional()
|
|
78
|
+
}).passthrough();
|
|
79
|
+
/** Browser-safe Store-Doctor projection wrapper returned by the hosted router. */
|
|
80
|
+
const HostedStoreDoctorEnvelopeSchema = z.object({
|
|
81
|
+
available: z.boolean(),
|
|
82
|
+
stores: z.array(StoreDoctorStoreSchema),
|
|
83
|
+
evidence: z.unknown().nullable().optional(),
|
|
84
|
+
error: HostedStoreFeatureErrorSchema.optional(),
|
|
85
|
+
cliVersion: z.string().optional()
|
|
86
|
+
}).passthrough();
|
|
87
|
+
/** Browser-safe Pull state for Store Inventory CLI Projection Work. */
|
|
88
|
+
const HostedStoreListProjectionStateSchema = createCliProjectionStateSchema(HostedStoreListEnvelopeSchema);
|
|
89
|
+
/** Browser-safe Pull state for Store Doctor CLI Projection Work. */
|
|
90
|
+
const HostedStoreDoctorProjectionStateSchema = createCliProjectionStateSchema(HostedStoreDoctorEnvelopeSchema);
|
|
91
|
+
/** Browser-safe lifecycle-only Push shared by hosted CLI projections. */
|
|
92
|
+
const HostedCliProjectionNoticeSchema = CliProjectionNoticeSchema;
|
|
93
|
+
const HostedRootContextCliSchema = z.object({
|
|
94
|
+
available: z.boolean(),
|
|
95
|
+
version: z.string().optional(),
|
|
96
|
+
error: z.string().optional(),
|
|
97
|
+
effectiveCommand: z.string().optional(),
|
|
98
|
+
tried: z.array(z.string()).optional()
|
|
99
|
+
}).passthrough();
|
|
100
|
+
const HostedRootContextCommandEvidenceSchema = z.object({
|
|
101
|
+
success: z.boolean(),
|
|
102
|
+
stdout: z.string(),
|
|
103
|
+
stderr: z.string(),
|
|
104
|
+
exitCode: z.number().int().nullable(),
|
|
105
|
+
diagnostics: z.array(CliDiagnosticSchema),
|
|
106
|
+
contractError: z.string().optional()
|
|
107
|
+
}).passthrough();
|
|
108
|
+
const HostedPlanningRootSchema = CliRootSchema.extend({
|
|
109
|
+
healthy: z.boolean(),
|
|
110
|
+
status: z.array(CliDiagnosticSchema)
|
|
111
|
+
}).passthrough();
|
|
112
|
+
const HostedContextMemberSchema = z.object({
|
|
113
|
+
role: z.literal("referenced_store"),
|
|
114
|
+
id: z.string(),
|
|
115
|
+
path: z.string().optional(),
|
|
116
|
+
remote: z.string().optional(),
|
|
117
|
+
fetch: z.string().optional(),
|
|
118
|
+
status: z.array(CliDiagnosticSchema)
|
|
119
|
+
}).passthrough();
|
|
120
|
+
/** Browser-safe complete Root Context fact retained by the hosted App projection. */
|
|
121
|
+
const HostedRootContextSchema = z.object({
|
|
122
|
+
launchProject: z.object({ path: z.string() }).passthrough(),
|
|
123
|
+
planningRoot: HostedPlanningRootSchema.nullable(),
|
|
124
|
+
storeId: z.string().nullable(),
|
|
125
|
+
generation: z.string().optional(),
|
|
126
|
+
cli: HostedRootContextCliSchema,
|
|
127
|
+
references: z.array(CliDoctorReferenceEntrySchema),
|
|
128
|
+
contextMembers: z.array(HostedContextMemberSchema),
|
|
129
|
+
dataScope: z.object({
|
|
130
|
+
path: z.string(),
|
|
131
|
+
source: z.enum([
|
|
132
|
+
"xdg-data-home",
|
|
133
|
+
"local-app-data",
|
|
134
|
+
"user-home-default"
|
|
135
|
+
]),
|
|
136
|
+
environmentVariable: z.enum(["XDG_DATA_HOME", "LOCALAPPDATA"]).nullable()
|
|
137
|
+
}).passthrough(),
|
|
138
|
+
diagnostics: z.object({
|
|
139
|
+
root: z.array(CliDiagnosticSchema),
|
|
140
|
+
doctor: z.array(CliDiagnosticSchema),
|
|
141
|
+
context: z.array(CliDiagnosticSchema)
|
|
142
|
+
}).passthrough(),
|
|
143
|
+
evidence: z.object({
|
|
144
|
+
doctor: HostedRootContextCommandEvidenceSchema.nullable(),
|
|
145
|
+
context: HostedRootContextCommandEvidenceSchema.nullable()
|
|
146
|
+
}).passthrough(),
|
|
147
|
+
observedAt: z.number()
|
|
148
|
+
}).passthrough();
|
|
149
|
+
const HostedRootContextErrorCodeSchema = z.enum([
|
|
150
|
+
"cli-unavailable",
|
|
151
|
+
"doctor-command-failed",
|
|
152
|
+
"doctor-contract-drift",
|
|
153
|
+
"root-unresolved",
|
|
154
|
+
"root-unhealthy",
|
|
155
|
+
"context-command-failed",
|
|
156
|
+
"context-contract-drift",
|
|
157
|
+
"context-root-mismatch",
|
|
158
|
+
"references-unresolved",
|
|
159
|
+
"resolver-failed"
|
|
160
|
+
]);
|
|
161
|
+
const HostedRootContextLoadingStateSchema = z.object({
|
|
162
|
+
state: z.literal("loading"),
|
|
163
|
+
data: z.null(),
|
|
164
|
+
attempt: z.null(),
|
|
165
|
+
error: z.null(),
|
|
166
|
+
observedAt: z.number()
|
|
167
|
+
});
|
|
168
|
+
const HostedRootContextReadyStateSchema = z.object({
|
|
169
|
+
state: z.literal("ready"),
|
|
170
|
+
data: HostedRootContextSchema,
|
|
171
|
+
attempt: z.null(),
|
|
172
|
+
error: z.null(),
|
|
173
|
+
observedAt: z.number()
|
|
174
|
+
});
|
|
175
|
+
const HostedRootContextRefreshingStateSchema = z.object({
|
|
176
|
+
state: z.literal("refreshing"),
|
|
177
|
+
data: HostedRootContextSchema,
|
|
178
|
+
attempt: z.null(),
|
|
179
|
+
error: z.null(),
|
|
180
|
+
observedAt: z.number()
|
|
181
|
+
});
|
|
182
|
+
const HostedRootContextErrorStateSchema = z.object({
|
|
183
|
+
state: z.literal("error"),
|
|
184
|
+
data: HostedRootContextSchema.nullable(),
|
|
185
|
+
attempt: HostedRootContextSchema,
|
|
186
|
+
error: z.object({
|
|
187
|
+
code: HostedRootContextErrorCodeSchema,
|
|
188
|
+
message: z.string()
|
|
189
|
+
}),
|
|
190
|
+
observedAt: z.number()
|
|
191
|
+
});
|
|
192
|
+
/** Browser-safe settled CLI result cached by Root Context Projection Work. */
|
|
193
|
+
const HostedRootContextResolvedStateSchema = z.discriminatedUnion("state", [HostedRootContextReadyStateSchema, HostedRootContextErrorStateSchema]);
|
|
194
|
+
/** Browser-safe Pull lifecycle for cached Root Context CLI Projection Work. */
|
|
195
|
+
const HostedRootContextProjectionStateSchema = createCliProjectionStateSchema(HostedRootContextResolvedStateSchema);
|
|
196
|
+
/** Browser-safe legacy Root Context lifecycle retained for project-workspace adapters. */
|
|
197
|
+
const HostedRootContextStateSchema = z.discriminatedUnion("state", [
|
|
198
|
+
HostedRootContextLoadingStateSchema,
|
|
199
|
+
HostedRootContextReadyStateSchema,
|
|
200
|
+
HostedRootContextRefreshingStateSchema,
|
|
201
|
+
HostedRootContextErrorStateSchema
|
|
202
|
+
]);
|
|
203
|
+
/** Hosted mutation admission shares the Server-owned P3 lifecycle schema. */
|
|
204
|
+
const HostedStoreMutationStartResponseSchema = StoreMutationStartResponseSchema;
|
|
205
|
+
/** One explicit browser-visible contract error, retaining the decoder's parse cause. */
|
|
206
|
+
var HostedBackendContractError = class extends Error {
|
|
207
|
+
kind = "contract";
|
|
208
|
+
constructor(message, options) {
|
|
209
|
+
super(message, options);
|
|
210
|
+
this.name = "HostedBackendContractError";
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
/** Structural tRPC envelope used by every successful hosted router ingress. */
|
|
214
|
+
const HostedTrpcResultEnvelopeSchema = z.object({ result: z.object({ data: z.unknown() }).passthrough() }).passthrough();
|
|
215
|
+
/** Decode one successful hosted tRPC `{ result: { data } }` envelope into typed data. */
|
|
216
|
+
function decodeHostedTrpcData(schema, payload) {
|
|
217
|
+
const envelope = HostedTrpcResultEnvelopeSchema.safeParse(payload);
|
|
218
|
+
if (!envelope.success) return {
|
|
219
|
+
kind: "contract-error",
|
|
220
|
+
error: new HostedBackendContractError("Malformed hosted tRPC result envelope.", { cause: envelope.error })
|
|
221
|
+
};
|
|
222
|
+
const decoded = schema.safeParse(envelope.data.result.data);
|
|
223
|
+
if (!decoded.success) return {
|
|
224
|
+
kind: "contract-error",
|
|
225
|
+
error: new HostedBackendContractError("Malformed hosted tRPC result data.", { cause: decoded.error })
|
|
226
|
+
};
|
|
227
|
+
return {
|
|
228
|
+
kind: "success",
|
|
229
|
+
data: decoded.data
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
export { isTerminalMutationStatus as S, HostedTrpcResultEnvelopeSchema as _, HostedBackendRootSummarySchema as a, asEnvUri as b, HostedRootContextProjectionStateSchema as c, HostedRootContextStateSchema as d, HostedStoreDoctorEnvelopeSchema as f, HostedStoreMutationStartResponseSchema as g, HostedStoreListProjectionStateSchema as h, HostedBackendHealthResponseSchema as i, HostedRootContextResolvedStateSchema as l, HostedStoreListEnvelopeSchema as m, HOSTED_STORE_CAPABILITIES as n, HostedCliProjectionNoticeSchema as o, HostedStoreDoctorProjectionStateSchema as p, HostedBackendContractError as r, HostedRootContextErrorCodeSchema as s, HOSTED_SHELL_PROTOCOL_VERSION as t, HostedRootContextSchema as u, OPENSPECUI_RUNTIME_CAPABILITIES as v, hasCapability as x, decodeHostedTrpcData as y };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./command-result-fkH3Ekdz.mjs";
|
|
2
|
+
import "./document-translation-D50BnvVh.mjs";
|
|
3
|
+
import "./sounds-qhRgCy0F.mjs";
|
|
4
|
+
import "./notifications-CgJlLgLO.mjs";
|
|
5
|
+
import "./cli-projection-DxnVGm2B.mjs";
|
|
6
|
+
import "./schemas-DS-JqAJ2.mjs";
|
|
7
|
+
import "./opsx-types-BJ8AjhrS.mjs";
|
|
8
|
+
import "./opsx-entity-D7kDQsze.mjs";
|
|
9
|
+
import { $ as HostedRootContextResolvedStateSchema, B as HostedBackendHealthResponse, Ct as StoreMutationResult, Dt as isTerminalMutationStatus, Et as hasCapability, G as HostedCliProjectionNotice, H as HostedBackendRootSummary, J as HostedRootContextErrorCode, K as HostedCliProjectionNoticeSchema, L as HOSTED_SHELL_PROTOCOL_VERSION, Q as HostedRootContextResolvedState, R as HOSTED_STORE_CAPABILITIES, St as StoreMutationKind, Tt as asEnvUri, U as HostedBackendRootSummarySchema, V as HostedBackendHealthResponseSchema, W as HostedCliDiagnostic, X as HostedRootContextProjectionState, Y as HostedRootContextErrorCodeSchema, Z as HostedRootContextProjectionStateSchema, _t as decodeHostedTrpcData, at as HostedStoreDoctorEnvelopeSchema, bt as StoreCapabilitySet, ct as HostedStoreListEnvelope, dt as HostedStoreListProjectionStateSchema, et as HostedRootContextSchema, ft as HostedStoreMutationStartResponse, gt as OPENSPECUI_RUNTIME_CAPABILITIES, ht as HostedTrpcResultEnvelopeSchema, it as HostedStoreDoctorEnvelope, lt as HostedStoreListEnvelopeSchema, mt as HostedTrpcDecodeResult, nt as HostedRootContextStateSchema, ot as HostedStoreDoctorProjectionState, pt as HostedStoreMutationStartResponseSchema, q as HostedRootContext, rt as HostedRootSource, st as HostedStoreDoctorProjectionStateSchema, tt as HostedRootContextState, ut as HostedStoreListProjectionState, vt as EnvUri, wt as StoreMutationStatus, xt as StoreMutation, yt as StoreCapability, z as HostedBackendContractError } from "./dashboard-summary-transport-CQ4is5_e.mjs";
|
|
10
|
+
import "./markdown-facts-CCw3QdbM.mjs";
|
|
11
|
+
import "./markdown-reading-LUdqfbxH.mjs";
|
|
12
|
+
import "./openspec-annotations-C58Aoi-V.mjs";
|
|
13
|
+
import "./openspec-projection-RohNZI4p.mjs";
|
|
14
|
+
import "./translator-NKv1wo3o.mjs";
|
|
15
|
+
import "./terminal-audio-tXDm_EDe.mjs";
|
|
16
|
+
import "./local-download-profiles-BL_rtlVM.mjs";
|
|
17
|
+
import "./translation-language-pair-C18GPATW.mjs";
|
|
18
|
+
import "./opsx-workflows-BvnJqjfL.mjs";
|
|
19
|
+
import "./opsx-display-path-RXS5JTbV.mjs";
|
|
20
|
+
import "./store-mutation-protocol-5tfs-RmD.mjs";
|
|
21
|
+
import "./store-types-b554wAQJ.mjs";
|
|
22
|
+
import "./terminal-invocation-BOvxThym.mjs";
|
|
23
|
+
import "./terminal-theme-m3MSGJ7U.mjs";
|
|
24
|
+
import "./opsx-schema-detail-BxDXEwDY.mjs";
|
|
25
|
+
export { EnvUri, HOSTED_SHELL_PROTOCOL_VERSION, HOSTED_STORE_CAPABILITIES, HostedBackendContractError, HostedBackendHealthResponse, HostedBackendHealthResponseSchema, HostedBackendRootSummary, HostedBackendRootSummarySchema, HostedCliDiagnostic, HostedCliProjectionNotice, HostedCliProjectionNoticeSchema, HostedRootContext, HostedRootContextErrorCode, HostedRootContextErrorCodeSchema, HostedRootContextProjectionState, HostedRootContextProjectionStateSchema, HostedRootContextResolvedState, HostedRootContextResolvedStateSchema, HostedRootContextSchema, HostedRootContextState, HostedRootContextStateSchema, HostedRootSource, HostedStoreDoctorEnvelope, HostedStoreDoctorEnvelopeSchema, HostedStoreDoctorProjectionState, HostedStoreDoctorProjectionStateSchema, HostedStoreListEnvelope, HostedStoreListEnvelopeSchema, HostedStoreListProjectionState, HostedStoreListProjectionStateSchema, HostedStoreMutationStartResponse, HostedStoreMutationStartResponseSchema, HostedTrpcDecodeResult, HostedTrpcResultEnvelopeSchema, OPENSPECUI_RUNTIME_CAPABILITIES, StoreCapability, StoreCapabilitySet, StoreMutation, StoreMutationKind, StoreMutationResult, StoreMutationStatus, asEnvUri, decodeHostedTrpcData, hasCapability, isTerminalMutationStatus };
|