@openspecui/core 4.1.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.
Files changed (116) hide show
  1. package/dist/cli-projection-DxnVGm2B.d.mts +789 -0
  2. package/dist/cli-projection-vO3-FJg5.mjs +161 -0
  3. package/dist/cli-projection.d.mts +6 -0
  4. package/dist/cli-projection.mjs +4 -0
  5. package/dist/command-result-fkH3Ekdz.d.mts +8477 -0
  6. package/dist/common-D8YUK9dA.mjs +57 -0
  7. package/dist/dashboard-summary-transport-CQ4is5_e.d.mts +66227 -0
  8. package/dist/dashboard-summary-transport-D2VBAIxg.mjs +175 -0
  9. package/dist/dashboard-summary-transport.d.mts +25 -0
  10. package/dist/dashboard-summary-transport.mjs +6 -0
  11. package/dist/{document-translation-D4YK18I3.mjs → document-translation-CeJFGMoy.mjs} +1 -1
  12. package/dist/{document-translation-CIPGsZD8.d.mts → document-translation-D50BnvVh.d.mts} +100 -100
  13. package/dist/document-translation.d.mts +1 -1
  14. package/dist/document-translation.mjs +2 -2
  15. package/dist/{hosted-app-CzMRiEgY.mjs → hosted-app-BPU4OR41.mjs} +31 -9
  16. package/dist/hosted-app.d.mts +25 -2
  17. package/dist/hosted-app.mjs +7 -2
  18. package/dist/hosted-contract-CcRnb51e.mjs +234 -0
  19. package/dist/hosted-contract.d.mts +25 -0
  20. package/dist/hosted-contract.mjs +7 -0
  21. package/dist/index.d.mts +25 -2686
  22. package/dist/index.mjs +2114 -1098
  23. package/dist/{local-download-profiles-B30HrSO2.d.mts → local-download-profiles-BL_rtlVM.d.mts} +1 -1
  24. package/dist/local-download-profiles.d.mts +2 -2
  25. package/dist/local-download-profiles.mjs +1 -1
  26. package/dist/markdown-facts.d.mts +1 -1
  27. package/dist/markdown-facts.mjs +1 -1
  28. package/dist/{markdown-reading-CgXuXp6s.d.mts → markdown-reading-LUdqfbxH.d.mts} +1 -1
  29. package/dist/{markdown-reading-DdcB7run.mjs → markdown-reading-mG4OAbDO.mjs} +1 -1
  30. package/dist/markdown-reading.d.mts +2 -2
  31. package/dist/markdown-reading.mjs +2 -2
  32. package/dist/{notifications-AKAcmeKT.mjs → notifications-C2bxAzX_.mjs} +13 -2
  33. package/dist/{notifications-HYH-lklF.d.mts → notifications-CgJlLgLO.d.mts} +34 -8
  34. package/dist/notifications.d.mts +2 -2
  35. package/dist/notifications.mjs +3 -3
  36. package/dist/{openspec-annotations-CeXd0JIZ.d.mts → openspec-annotations-C58Aoi-V.d.mts} +2 -2
  37. package/dist/{openspec-annotations-D_6Pz7k4.mjs → openspec-annotations-DCfqBMal.mjs} +2 -2
  38. package/dist/openspec-annotations.d.mts +3 -3
  39. package/dist/openspec-annotations.mjs +3 -3
  40. package/dist/openspec-compat.d.mts +18 -11
  41. package/dist/openspec-compat.mjs +22 -14
  42. package/dist/{openspec-projection-B8s-KWQ7.mjs → openspec-projection-DCgToo0Q.mjs} +2 -2
  43. package/dist/{openspec-projection-BphzrwYP.d.mts → openspec-projection-RohNZI4p.d.mts} +3 -3
  44. package/dist/openspec-projection.d.mts +5 -5
  45. package/dist/openspec-projection.mjs +4 -4
  46. package/dist/opsx-display-path.d.mts +1 -1
  47. package/dist/opsx-display-path.mjs +1 -1
  48. package/dist/{opsx-entity-CFUCqev8.d.mts → opsx-entity-D7kDQsze.d.mts} +2 -2
  49. package/dist/opsx-entity.d.mts +7 -3
  50. package/dist/opsx-entity.mjs +1 -1
  51. package/dist/{opsx-schema-detail-DXKXqMQa.d.mts → opsx-schema-detail-BxDXEwDY.d.mts} +2 -2
  52. package/dist/opsx-schema-detail.d.mts +8 -4
  53. package/dist/opsx-schema-detail.mjs +1 -1
  54. package/dist/opsx-types-BJ8AjhrS.d.mts +3642 -0
  55. package/dist/opsx-workflows-BvnJqjfL.d.mts +36 -0
  56. package/dist/opsx-workflows-Ccc6U7IR.mjs +89 -0
  57. package/dist/opsx-workflows.d.mts +2 -0
  58. package/dist/opsx-workflows.mjs +3 -0
  59. package/dist/planning-cli-projection-DIRxeq2H.mjs +421 -0
  60. package/dist/planning-cli-projection.d.mts +25 -0
  61. package/dist/planning-cli-projection.mjs +9 -0
  62. package/dist/schemas-BFroDdOC.mjs +287 -0
  63. package/dist/{schemas-CNKCVc7m.d.mts → schemas-DS-JqAJ2.d.mts} +498 -52
  64. package/dist/{sounds-J6z7o4mt.d.mts → sounds-qhRgCy0F.d.mts} +5 -5
  65. package/dist/sounds.d.mts +1 -1
  66. package/dist/sounds.mjs +1 -1
  67. package/dist/spec-catalog-ZGuiZ4CE.mjs +901 -0
  68. package/dist/spec-catalog.d.mts +25 -0
  69. package/dist/spec-catalog.mjs +6 -0
  70. package/dist/store-mutation-protocol-5tfs-RmD.d.mts +727 -0
  71. package/dist/store-mutation-protocol-CSwD-xPO.mjs +63 -0
  72. package/dist/store-mutation-protocol.d.mts +2 -0
  73. package/dist/store-mutation-protocol.mjs +4 -0
  74. package/dist/{store-types-Cu41QSww.mjs → store-types-DlX1REBg.mjs} +39 -18
  75. package/dist/{store-types-BiE-Ey--.d.mts → store-types-b554wAQJ.d.mts} +22 -12
  76. package/dist/store-types.d.mts +6 -2
  77. package/dist/store-types.mjs +2 -2
  78. package/dist/task-progress-B_IWVXjA.mjs +216 -0
  79. package/dist/task-progress.d.mts +7 -4
  80. package/dist/task-progress.mjs +3 -3
  81. package/dist/{terminal-audio-TBoU2jSK.mjs → terminal-audio-d6KItUeJ.mjs} +1 -1
  82. package/dist/{terminal-audio-BeUXlQgj.d.mts → terminal-audio-tXDm_EDe.d.mts} +2 -2
  83. package/dist/terminal-audio.d.mts +2 -2
  84. package/dist/terminal-audio.mjs +2 -2
  85. package/dist/terminal-control.d.mts +2 -2
  86. package/dist/terminal-control.mjs +1 -1
  87. package/dist/{terminal-invocation-ClVh0HeM.d.mts → terminal-invocation-BOvxThym.d.mts} +203 -84
  88. package/dist/terminal-invocation.d.mts +1 -1
  89. package/dist/terminal-invocation.mjs +1 -1
  90. package/dist/terminal-theme.d.mts +1 -1
  91. package/dist/terminal-theme.mjs +1 -1
  92. package/dist/translation-language-pair.d.mts +1 -1
  93. package/dist/translation-language-pair.mjs +1 -1
  94. package/dist/{translator-D6t_LEVN.d.mts → translator-NKv1wo3o.d.mts} +208 -208
  95. package/dist/translator.d.mts +1 -1
  96. package/dist/translator.mjs +1 -1
  97. package/package.json +55 -7
  98. package/dist/hosted-app-DHs94gIR.d.mts +0 -43
  99. package/dist/opsx-types-2rgsQHsB.d.mts +0 -402
  100. package/dist/task-progress-BHn4bCoD.d.mts +0 -24
  101. package/dist/task-progress-DhHYHnTv.mjs +0 -70
  102. /package/dist/{local-download-profiles-kpNEcdF_.mjs → local-download-profiles-odzOdf96.mjs} +0 -0
  103. /package/dist/{markdown-facts-BBCTe_qq.mjs → markdown-facts-BUqLvFRf.mjs} +0 -0
  104. /package/dist/{markdown-facts-Dk7FKaaT.d.mts → markdown-facts-CCw3QdbM.d.mts} +0 -0
  105. /package/dist/{opsx-display-path-CUCOrHcM.mjs → opsx-display-path-D13XV20v.mjs} +0 -0
  106. /package/dist/{opsx-display-path-cIMKa1aw.d.mts → opsx-display-path-RXS5JTbV.d.mts} +0 -0
  107. /package/dist/{opsx-entity-c7m5CbgU.mjs → opsx-entity-Cn_Zu1J3.mjs} +0 -0
  108. /package/dist/{opsx-schema-detail-BH82X6aU.mjs → opsx-schema-detail-Beis4Ba2.mjs} +0 -0
  109. /package/dist/{sounds-CB3ubSnj.mjs → sounds-NXwveBqq.mjs} +0 -0
  110. /package/dist/{terminal-control-VpTuh17B.mjs → terminal-control-BSAlOTs8.mjs} +0 -0
  111. /package/dist/{terminal-invocation-C2MCNBhK.mjs → terminal-invocation-0p-j2eSP.mjs} +0 -0
  112. /package/dist/{terminal-theme-cevliJw2.mjs → terminal-theme-B8iRttTR.mjs} +0 -0
  113. /package/dist/{terminal-theme-hvQjTsNh.d.mts → terminal-theme-m3MSGJ7U.d.mts} +0 -0
  114. /package/dist/{translation-language-pair-DZ_WNp_M.mjs → translation-language-pair-Bbhk-LAC.mjs} +0 -0
  115. /package/dist/{translation-language-pair-DmaOfHqD.d.mts → translation-language-pair-C18GPATW.d.mts} +0 -0
  116. /package/dist/{translator-DbUT1Ayn.mjs → translator-Cjtv4tya.mjs} +0 -0
@@ -0,0 +1,161 @@
1
+ import { n as CliDiagnosticSchema } from "./common-D8YUK9dA.mjs";
2
+ import { z } from "zod";
3
+
4
+ //#region src/cli-projection.ts
5
+ /**
6
+ * Orthogonal intents (updated 2026-07-26 Asia/Shanghai):
7
+ * 1. Define the browser-safe lifecycle for one cached CLI-backed projection.
8
+ * 2. Keep settled snapshot provenance separate from replacement Work lifecycle.
9
+ * 3. Define lifecycle-only Push notices for typed client Pull.
10
+ * 4. Preserve exact typed CLI failure evidence without fabricating it for infrastructure errors.
11
+ *
12
+ * Original request (2026-07-26): "即便现在有正在的任务,界面上仍然可以读到缓存,但它也能知道这个缓存现在正在被更新中。"
13
+ */
14
+ const CliJsonValueSchema = z.lazy(() => z.union([
15
+ z.string(),
16
+ z.number(),
17
+ z.boolean(),
18
+ z.null(),
19
+ z.array(CliJsonValueSchema),
20
+ z.record(z.string(), CliJsonValueSchema)
21
+ ]));
22
+ /** Complete CLI attempt evidence retained when a Projection Work command rejects. */
23
+ const CliProjectionCommandEvidenceSchema = z.object({
24
+ success: z.boolean(),
25
+ stdout: z.string(),
26
+ stderr: z.string(),
27
+ exitCode: z.number().int().nullable(),
28
+ payload: CliJsonValueSchema.nullable(),
29
+ diagnostics: z.array(CliDiagnosticSchema),
30
+ contractError: z.string().optional()
31
+ });
32
+ /** Serializable infrastructure failure for one Projection Work attempt. */
33
+ const CliProjectionFailureSchema = z.object({
34
+ name: z.string(),
35
+ message: z.string(),
36
+ cliEvidence: CliProjectionCommandEvidenceSchema.nullable()
37
+ });
38
+ const cliProjectionStates = [
39
+ "loading",
40
+ "ready",
41
+ "revalidating",
42
+ "error",
43
+ "refresh-error"
44
+ ];
45
+ const CliProjectionStateNameSchema = z.enum(cliProjectionStates);
46
+ const cliProjectionInvalidationCauses = [
47
+ "initial",
48
+ "dependency",
49
+ "explicit-refresh",
50
+ "subscriber-resume"
51
+ ];
52
+ const CliProjectionInvalidationCauseSchema = z.enum(cliProjectionInvalidationCauses);
53
+ /** Build a runtime decoder for one concrete CLI projection payload. */
54
+ function createCliProjectionStateSchema(dataSchema) {
55
+ const base = {
56
+ identity: z.string().min(1),
57
+ workGeneration: z.number().int().nonnegative(),
58
+ invalidationCause: CliProjectionInvalidationCauseSchema
59
+ };
60
+ return z.discriminatedUnion("state", [
61
+ z.object({
62
+ ...base,
63
+ state: z.literal("loading"),
64
+ data: z.null(),
65
+ freshness: z.null(),
66
+ snapshotGeneration: z.null(),
67
+ error: z.null()
68
+ }),
69
+ z.object({
70
+ ...base,
71
+ state: z.literal("ready"),
72
+ data: dataSchema,
73
+ freshness: z.literal("current"),
74
+ snapshotGeneration: z.number().int().nonnegative(),
75
+ error: z.null()
76
+ }),
77
+ z.object({
78
+ ...base,
79
+ state: z.literal("revalidating"),
80
+ data: dataSchema,
81
+ freshness: z.literal("stale-display-only"),
82
+ snapshotGeneration: z.number().int().nonnegative(),
83
+ error: z.null()
84
+ }),
85
+ z.object({
86
+ ...base,
87
+ state: z.literal("error"),
88
+ data: z.null(),
89
+ freshness: z.null(),
90
+ snapshotGeneration: z.null(),
91
+ error: CliProjectionFailureSchema
92
+ }),
93
+ z.object({
94
+ ...base,
95
+ state: z.literal("refresh-error"),
96
+ data: dataSchema,
97
+ freshness: z.literal("stale-display-only"),
98
+ snapshotGeneration: z.number().int().nonnegative(),
99
+ error: CliProjectionFailureSchema
100
+ })
101
+ ]);
102
+ }
103
+ /** Lifecycle-only Server Push that wakes a client Pull without duplicating projection data. */
104
+ const CliProjectionNoticeSchema = z.object({
105
+ identity: z.string().min(1),
106
+ workGeneration: z.number().int().nonnegative(),
107
+ snapshotGeneration: z.number().int().nonnegative().nullable(),
108
+ state: CliProjectionStateNameSchema,
109
+ invalidationCause: CliProjectionInvalidationCauseSchema
110
+ });
111
+ /** Error raised by a typed CLI reader while retaining its complete command evidence. */
112
+ var CliProjectionCommandError = class extends Error {
113
+ cliEvidence;
114
+ constructor(message, result) {
115
+ super(message);
116
+ this.name = "CliProjectionCommandError";
117
+ this.cliEvidence = toCliProjectionCommandEvidence(result);
118
+ }
119
+ };
120
+ /** Remove typed business data while retaining every process/parser fact for public projection evidence. */
121
+ function toCliProjectionCommandEvidence(result) {
122
+ return CliProjectionCommandEvidenceSchema.parse({
123
+ success: result.success,
124
+ stdout: result.stdout,
125
+ stderr: result.stderr,
126
+ exitCode: result.exitCode,
127
+ payload: result.payload,
128
+ diagnostics: result.diagnostics,
129
+ ...result.contractError ? { contractError: result.contractError } : {}
130
+ });
131
+ }
132
+ /** Convert an unknown Work rejection into the stable public failure boundary. */
133
+ function toCliProjectionFailure(error) {
134
+ if (error instanceof CliProjectionCommandError) return {
135
+ name: error.name,
136
+ message: error.message,
137
+ cliEvidence: error.cliEvidence
138
+ };
139
+ return error instanceof Error ? {
140
+ name: error.name,
141
+ message: error.message,
142
+ cliEvidence: null
143
+ } : {
144
+ name: "Error",
145
+ message: String(error),
146
+ cliEvidence: null
147
+ };
148
+ }
149
+ /** Drop business data and exact errors from one Pull state before Server Push. */
150
+ function toCliProjectionNotice(state) {
151
+ return {
152
+ identity: state.identity,
153
+ workGeneration: state.workGeneration,
154
+ snapshotGeneration: state.snapshotGeneration,
155
+ state: state.state,
156
+ invalidationCause: state.invalidationCause
157
+ };
158
+ }
159
+
160
+ //#endregion
161
+ export { CliProjectionInvalidationCauseSchema as a, cliProjectionInvalidationCauses as c, toCliProjectionCommandEvidence as d, toCliProjectionFailure as f, CliProjectionFailureSchema as i, cliProjectionStates as l, CliProjectionCommandError as n, CliProjectionNoticeSchema as o, toCliProjectionNotice as p, CliProjectionCommandEvidenceSchema as r, CliProjectionStateNameSchema as s, CliJsonValueSchema as t, createCliProjectionStateSchema as u };
@@ -0,0 +1,6 @@
1
+ import "./command-result-fkH3Ekdz.mjs";
2
+ import "./document-translation-D50BnvVh.mjs";
3
+ import "./sounds-qhRgCy0F.mjs";
4
+ import "./notifications-CgJlLgLO.mjs";
5
+ import { _ as toCliProjectionCommandEvidence, a as CliProjectionFailure, c as CliProjectionInvalidationCauseSchema, d as CliProjectionState, f as CliProjectionStateName, g as createCliProjectionStateSchema, h as cliProjectionStates, i as CliProjectionCommandEvidenceSchema, l as CliProjectionNotice, m as cliProjectionInvalidationCauses, n as CliProjectionCommandError, o as CliProjectionFailureSchema, p as CliProjectionStateNameSchema, r as CliProjectionCommandEvidence, s as CliProjectionInvalidationCause, t as CliJsonValueSchema, u as CliProjectionNoticeSchema, v as toCliProjectionFailure, y as toCliProjectionNotice } from "./cli-projection-DxnVGm2B.mjs";
6
+ export { CliJsonValueSchema, CliProjectionCommandError, CliProjectionCommandEvidence, CliProjectionCommandEvidenceSchema, CliProjectionFailure, CliProjectionFailureSchema, CliProjectionInvalidationCause, CliProjectionInvalidationCauseSchema, CliProjectionNotice, CliProjectionNoticeSchema, CliProjectionState, CliProjectionStateName, CliProjectionStateNameSchema, cliProjectionInvalidationCauses, cliProjectionStates, createCliProjectionStateSchema, toCliProjectionCommandEvidence, toCliProjectionFailure, toCliProjectionNotice };
@@ -0,0 +1,4 @@
1
+ import "./common-D8YUK9dA.mjs";
2
+ import { a as CliProjectionInvalidationCauseSchema, c as cliProjectionInvalidationCauses, d as toCliProjectionCommandEvidence, f as toCliProjectionFailure, i as CliProjectionFailureSchema, l as cliProjectionStates, n as CliProjectionCommandError, o as CliProjectionNoticeSchema, p as toCliProjectionNotice, r as CliProjectionCommandEvidenceSchema, s as CliProjectionStateNameSchema, t as CliJsonValueSchema, u as createCliProjectionStateSchema } from "./cli-projection-vO3-FJg5.mjs";
3
+
4
+ export { CliJsonValueSchema, CliProjectionCommandError, CliProjectionCommandEvidenceSchema, CliProjectionFailureSchema, CliProjectionInvalidationCauseSchema, CliProjectionNoticeSchema, CliProjectionStateNameSchema, cliProjectionInvalidationCauses, cliProjectionStates, createCliProjectionStateSchema, toCliProjectionCommandEvidence, toCliProjectionFailure, toCliProjectionNotice };