@openspecui/core 11.0.0 → 12.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/{active-root-config-B-ZjoeVr.d.mts → active-root-config-Ba57tJrq.d.mts} +7 -7
- package/dist/active-root-config.d.mts +4 -4
- package/dist/app-daemon-control.d.mts +10 -10
- package/dist/{cli-projection-CpEtZ-tN.d.mts → cli-projection-CvtX601c.d.mts} +1 -1
- package/dist/cli-projection.d.mts +4 -4
- package/dist/{command-result-DWMmDl6I.mjs → command-result-DbXO8ZgG.mjs} +106 -13
- package/dist/{dashboard-summary-transport-Cv-UaYcc.d.mts → dashboard-summary-transport-edeWQPi7.d.mts} +194 -139
- package/dist/dashboard-summary-transport.d.mts +17 -17
- package/dist/hosted-app.d.mts +17 -17
- package/dist/hosted-contract.d.mts +17 -17
- package/dist/{index-BXSLb96t.d.mts → index-D9qYKNqh.d.mts} +2048 -22
- package/dist/index.d.mts +18 -18
- package/dist/index.mjs +127 -59
- package/dist/{local-download-profiles-C9LmIa9_.d.mts → local-download-profiles-DaFozMhH.d.mts} +1 -1
- package/dist/local-download-profiles.d.mts +2 -2
- package/dist/{notifications-C_Dvqaej.d.mts → notifications-Dkoh_xrs.d.mts} +1 -1
- package/dist/notifications.d.mts +2 -2
- package/dist/{openspec-compat-DctIDxRM.mjs → openspec-compat-CpMO8-dz.mjs} +20 -16
- package/dist/openspec-compat.d.mts +4 -4
- package/dist/openspec-compat.mjs +3 -3
- package/dist/{openspec-projection-DTu73p25.d.mts → openspec-projection-46QLZ6b8.d.mts} +1 -1
- package/dist/openspec-projection.d.mts +2 -2
- package/dist/{opsx-entity-Cq5yqzjd.d.mts → opsx-entity-Btqm5OhC.d.mts} +2 -2
- package/dist/opsx-entity.d.mts +6 -6
- package/dist/{opsx-schema-detail-DwKh5cRx.d.mts → opsx-schema-detail-C4VyWZ8B.d.mts} +2 -2
- package/dist/opsx-schema-detail.d.mts +7 -7
- package/dist/{opsx-types-Dxq7Yyjz.d.mts → opsx-types-hVFHL9Cb.d.mts} +2 -2
- package/dist/{planning-cli-projection-pq8vZC1r.mjs → planning-cli-projection-BUU26bEw.mjs} +2 -2
- package/dist/planning-cli-projection.d.mts +17 -17
- package/dist/planning-cli-projection.mjs +3 -3
- package/dist/{schemas-7hc46y5c.d.mts → schemas-Ce7B_SNx.d.mts} +2 -2
- package/dist/{sounds-B0GiWqBN.d.mts → sounds-DzDkqTIX.d.mts} +4 -4
- package/dist/sounds.d.mts +1 -1
- package/dist/{spec-catalog-BkX0tZp9.mjs → spec-catalog-DshONoJ9.mjs} +31 -2
- package/dist/spec-catalog.d.mts +17 -17
- package/dist/spec-catalog.mjs +2 -2
- package/dist/{store-mutation-protocol-BriXl_0I.d.mts → store-mutation-protocol-DHjp76v0.d.mts} +12 -12
- package/dist/store-mutation-protocol.d.mts +1 -1
- package/dist/{store-types-C4d1cqYC.d.mts → store-types-vKTsXtfb.d.mts} +1 -1
- package/dist/store-types.d.mts +4 -4
- package/dist/task-progress.d.mts +5 -5
- package/dist/{terminal-audio-BpfUW_eB.d.mts → terminal-audio-C6kc0fbX.d.mts} +1 -1
- package/dist/terminal-audio.d.mts +2 -2
- package/dist/terminal-control.d.mts +2 -2
- package/dist/{terminal-invocation-B2F24Dw6.d.mts → terminal-invocation-zNp8J57-.d.mts} +12 -12
- package/dist/terminal-invocation.d.mts +1 -1
- package/dist/{translator-CLbxLmcj.d.mts → translator-DZO_bY1X.d.mts} +50 -50
- package/dist/translator.d.mts +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as CliJsonValue, Ft as CliRootSource, Lt as CliExecutor, Rt as CliResult, Tt as CliDiagnostic, f as CliDoctor, kt as CliDoctorReferenceEntry, l as OpenSpecCliContractExecutor, n as CliRootSelector, u as CliContext, xt as CliCommandResult } from "./index-D9qYKNqh.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/open-spec-data-scope.d.ts
|
|
@@ -552,7 +552,7 @@ declare const ActiveRootMutationSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodOb
|
|
|
552
552
|
revision: z.ZodString;
|
|
553
553
|
}, "strict", z.ZodTypeAny, {
|
|
554
554
|
mode: "structured";
|
|
555
|
-
|
|
555
|
+
revision: string;
|
|
556
556
|
update: {
|
|
557
557
|
schema: string;
|
|
558
558
|
context: string | null;
|
|
@@ -566,11 +566,11 @@ declare const ActiveRootMutationSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodOb
|
|
|
566
566
|
} | null;
|
|
567
567
|
} | null;
|
|
568
568
|
};
|
|
569
|
-
|
|
569
|
+
filePath: string;
|
|
570
570
|
ownerPath: string;
|
|
571
571
|
}, {
|
|
572
572
|
mode: "structured";
|
|
573
|
-
|
|
573
|
+
revision: string;
|
|
574
574
|
update: {
|
|
575
575
|
schema: string;
|
|
576
576
|
context: string | null;
|
|
@@ -584,7 +584,7 @@ declare const ActiveRootMutationSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodOb
|
|
|
584
584
|
} | null;
|
|
585
585
|
} | null;
|
|
586
586
|
};
|
|
587
|
-
|
|
587
|
+
filePath: string;
|
|
588
588
|
ownerPath: string;
|
|
589
589
|
}>, z.ZodObject<{
|
|
590
590
|
mode: z.ZodLiteral<"raw">;
|
|
@@ -595,14 +595,14 @@ declare const ActiveRootMutationSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodOb
|
|
|
595
595
|
}, "strict", z.ZodTypeAny, {
|
|
596
596
|
mode: "raw";
|
|
597
597
|
content: string;
|
|
598
|
-
filePath: string;
|
|
599
598
|
revision: string;
|
|
599
|
+
filePath: string;
|
|
600
600
|
ownerPath: string;
|
|
601
601
|
}, {
|
|
602
602
|
mode: "raw";
|
|
603
603
|
content: string;
|
|
604
|
-
filePath: string;
|
|
605
604
|
revision: string;
|
|
605
|
+
filePath: string;
|
|
606
606
|
ownerPath: string;
|
|
607
607
|
}>]>;
|
|
608
608
|
/** Revision-aware Active Root mutation request. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-D9qYKNqh.mjs";
|
|
2
2
|
import "./document-translation-CGMD0RLA.mjs";
|
|
3
|
-
import "./sounds-
|
|
4
|
-
import "./notifications-
|
|
5
|
-
import { _ as ActiveRootStructuredUpdateSchema, a as ActiveRootConfigDiagnostic, c as ActiveRootMutation, d as ActiveRootOfficialConfig, f as ActiveRootOfficialConfigSchema, g as ActiveRootStructuredUpdate, h as ActiveRootRevisionSchema, i as ActiveRootConfig, l as ActiveRootMutationResult, m as ActiveRootRevision, n as patchActiveRootOfficialFields, o as ActiveRootConfigFile, p as ActiveRootRawValidation, r as validateActiveRootRawYaml, s as ActiveRootConfigInspection, t as inspectActiveRootOfficialConfig, u as ActiveRootMutationSchema, v as MAX_ACTIVE_ROOT_CONTEXT_BYTES } from "./active-root-config-
|
|
3
|
+
import "./sounds-DzDkqTIX.mjs";
|
|
4
|
+
import "./notifications-Dkoh_xrs.mjs";
|
|
5
|
+
import { _ as ActiveRootStructuredUpdateSchema, a as ActiveRootConfigDiagnostic, c as ActiveRootMutation, d as ActiveRootOfficialConfig, f as ActiveRootOfficialConfigSchema, g as ActiveRootStructuredUpdate, h as ActiveRootRevisionSchema, i as ActiveRootConfig, l as ActiveRootMutationResult, m as ActiveRootRevision, n as patchActiveRootOfficialFields, o as ActiveRootConfigFile, p as ActiveRootRawValidation, r as validateActiveRootRawYaml, s as ActiveRootConfigInspection, t as inspectActiveRootOfficialConfig, u as ActiveRootMutationSchema, v as MAX_ACTIVE_ROOT_CONTEXT_BYTES } from "./active-root-config-Ba57tJrq.mjs";
|
|
6
6
|
export { ActiveRootConfig, ActiveRootConfigDiagnostic, ActiveRootConfigFile, ActiveRootConfigInspection, ActiveRootMutation, ActiveRootMutationResult, ActiveRootMutationSchema, ActiveRootOfficialConfig, ActiveRootOfficialConfigSchema, ActiveRootRawValidation, ActiveRootRevision, ActiveRootRevisionSchema, ActiveRootStructuredUpdate, ActiveRootStructuredUpdateSchema, MAX_ACTIVE_ROOT_CONTEXT_BYTES, inspectActiveRootOfficialConfig, patchActiveRootOfficialFields, validateActiveRootRawYaml };
|
|
@@ -27,8 +27,8 @@ declare const AppDaemonWorkspaceBindingSchema: z.ZodObject<{
|
|
|
27
27
|
}>>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
id: string;
|
|
30
|
-
credential: string | null;
|
|
31
30
|
backendUrl: string;
|
|
31
|
+
credential: string | null;
|
|
32
32
|
projectDir: string;
|
|
33
33
|
ownership: "daemon-managed" | "external";
|
|
34
34
|
registeredAt: number;
|
|
@@ -41,8 +41,8 @@ declare const AppDaemonWorkspaceBindingSchema: z.ZodObject<{
|
|
|
41
41
|
} | null;
|
|
42
42
|
}, {
|
|
43
43
|
id: string;
|
|
44
|
-
credential: string | null;
|
|
45
44
|
backendUrl: string;
|
|
45
|
+
credential: string | null;
|
|
46
46
|
projectDir: string;
|
|
47
47
|
ownership: "daemon-managed" | "external";
|
|
48
48
|
registeredAt: number;
|
|
@@ -82,8 +82,8 @@ declare const AppDaemonWorkspaceSnapshotSchema: z.ZodObject<{
|
|
|
82
82
|
}>>;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
84
|
id: string;
|
|
85
|
-
credential: string | null;
|
|
86
85
|
backendUrl: string;
|
|
86
|
+
credential: string | null;
|
|
87
87
|
projectDir: string;
|
|
88
88
|
ownership: "daemon-managed" | "external";
|
|
89
89
|
registeredAt: number;
|
|
@@ -96,8 +96,8 @@ declare const AppDaemonWorkspaceSnapshotSchema: z.ZodObject<{
|
|
|
96
96
|
} | null;
|
|
97
97
|
}, {
|
|
98
98
|
id: string;
|
|
99
|
-
credential: string | null;
|
|
100
99
|
backendUrl: string;
|
|
100
|
+
credential: string | null;
|
|
101
101
|
projectDir: string;
|
|
102
102
|
ownership: "daemon-managed" | "external";
|
|
103
103
|
registeredAt: number;
|
|
@@ -113,8 +113,8 @@ declare const AppDaemonWorkspaceSnapshotSchema: z.ZodObject<{
|
|
|
113
113
|
revision: number;
|
|
114
114
|
workspaces: {
|
|
115
115
|
id: string;
|
|
116
|
-
credential: string | null;
|
|
117
116
|
backendUrl: string;
|
|
117
|
+
credential: string | null;
|
|
118
118
|
projectDir: string;
|
|
119
119
|
ownership: "daemon-managed" | "external";
|
|
120
120
|
registeredAt: number;
|
|
@@ -130,8 +130,8 @@ declare const AppDaemonWorkspaceSnapshotSchema: z.ZodObject<{
|
|
|
130
130
|
revision: number;
|
|
131
131
|
workspaces: {
|
|
132
132
|
id: string;
|
|
133
|
-
credential: string | null;
|
|
134
133
|
backendUrl: string;
|
|
134
|
+
credential: string | null;
|
|
135
135
|
projectDir: string;
|
|
136
136
|
ownership: "daemon-managed" | "external";
|
|
137
137
|
registeredAt: number;
|
|
@@ -232,8 +232,8 @@ declare const AppDaemonStartManagedProjectResponseSchema: z.ZodDiscriminatedUnio
|
|
|
232
232
|
}>>;
|
|
233
233
|
}, "strip", z.ZodTypeAny, {
|
|
234
234
|
id: string;
|
|
235
|
-
credential: string | null;
|
|
236
235
|
backendUrl: string;
|
|
236
|
+
credential: string | null;
|
|
237
237
|
projectDir: string;
|
|
238
238
|
ownership: "daemon-managed" | "external";
|
|
239
239
|
registeredAt: number;
|
|
@@ -246,8 +246,8 @@ declare const AppDaemonStartManagedProjectResponseSchema: z.ZodDiscriminatedUnio
|
|
|
246
246
|
} | null;
|
|
247
247
|
}, {
|
|
248
248
|
id: string;
|
|
249
|
-
credential: string | null;
|
|
250
249
|
backendUrl: string;
|
|
250
|
+
credential: string | null;
|
|
251
251
|
projectDir: string;
|
|
252
252
|
ownership: "daemon-managed" | "external";
|
|
253
253
|
registeredAt: number;
|
|
@@ -264,8 +264,8 @@ declare const AppDaemonStartManagedProjectResponseSchema: z.ZodDiscriminatedUnio
|
|
|
264
264
|
ok: true;
|
|
265
265
|
workspace: {
|
|
266
266
|
id: string;
|
|
267
|
-
credential: string | null;
|
|
268
267
|
backendUrl: string;
|
|
268
|
+
credential: string | null;
|
|
269
269
|
projectDir: string;
|
|
270
270
|
ownership: "daemon-managed" | "external";
|
|
271
271
|
registeredAt: number;
|
|
@@ -282,8 +282,8 @@ declare const AppDaemonStartManagedProjectResponseSchema: z.ZodDiscriminatedUnio
|
|
|
282
282
|
ok: true;
|
|
283
283
|
workspace: {
|
|
284
284
|
id: string;
|
|
285
|
-
credential: string | null;
|
|
286
285
|
backendUrl: string;
|
|
286
|
+
credential: string | null;
|
|
287
287
|
projectDir: string;
|
|
288
288
|
ownership: "daemon-managed" | "external";
|
|
289
289
|
registeredAt: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-D9qYKNqh.mjs";
|
|
2
2
|
import "./document-translation-CGMD0RLA.mjs";
|
|
3
|
-
import "./sounds-
|
|
4
|
-
import "./notifications-
|
|
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-
|
|
3
|
+
import "./sounds-DzDkqTIX.mjs";
|
|
4
|
+
import "./notifications-Dkoh_xrs.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-CvtX601c.mjs";
|
|
6
6
|
export { CliJsonValueSchema, CliProjectionCommandError, CliProjectionCommandEvidence, CliProjectionCommandEvidenceSchema, CliProjectionFailure, CliProjectionFailureSchema, CliProjectionInvalidationCause, CliProjectionInvalidationCauseSchema, CliProjectionNotice, CliProjectionNoticeSchema, CliProjectionState, CliProjectionStateName, CliProjectionStateNameSchema, cliProjectionInvalidationCauses, cliProjectionStates, createCliProjectionStateSchema, toCliProjectionCommandEvidence, toCliProjectionFailure, toCliProjectionNotice };
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
|
|
4
4
|
//#region src/cli-contracts/workflow.ts
|
|
5
5
|
/**
|
|
6
|
-
* Orthogonal intents (updated 2026-
|
|
6
|
+
* Orthogonal intents (updated 2026-09-03 Asia/Shanghai):
|
|
7
7
|
* 1. Model camelCase workflow JSON independently from Store-family JSON.
|
|
8
8
|
* 2. Preserve strict, archived, and bulk Validate plus Archive outcomes, including failure payloads.
|
|
9
9
|
* 3. Preserve multiline requirement bodies from `show --json`.
|
|
@@ -11,11 +11,18 @@ import { z } from "zod";
|
|
|
11
11
|
* 5. Export the successful Spec-document schema for browser-safe projection validation.
|
|
12
12
|
* 6. Export the root-less Status payload fields and Requirement shape shared with the
|
|
13
13
|
* OpenSpec 1.11 batch Status and show --diff contracts.
|
|
14
|
+
* 7. Model the OpenSpec 1.12 `validate --report findings` document beside (never inside) the
|
|
15
|
+
* full Validate report, sharing the bulk-item and summary shapes while keeping decoding
|
|
16
|
+
* independent of the process exit code and of full-report validation truth. Decode owns
|
|
17
|
+
* the upstream-guaranteed invariants (non-empty per-item issues, returnedItems bounded
|
|
18
|
+
* by totalItems), and the union guard validates the discriminator shape rather than
|
|
19
|
+
* mere `report`-key presence.
|
|
14
20
|
*
|
|
15
21
|
* Original request (2026-07-15): "为不同命令建立强类型适配器,不实现平行解析规则。"
|
|
16
22
|
* Original request (2026-07-26): "展开全面的接口升级和内核升级和测试升级。"
|
|
17
23
|
* Original request (2026-08-15): "v9的适配需要同时适配 1.8和1.9。"
|
|
18
24
|
* Original request (2026-08-28): "直接将 0.10.0 和 0.11.0 一起适配,然后发布 v11。"
|
|
25
|
+
* Original request (2026-09-03): "Openspec 1.12.0 刚刚放出来,你更新一下,调查变更内容,然后开始规划适配工作,我们将用标准工作流worktree来推进"
|
|
19
26
|
*/
|
|
20
27
|
const CliChangeListEntrySchema = z.object({
|
|
21
28
|
name: z.string(),
|
|
@@ -240,24 +247,110 @@ const CliValidationTotalsSchema = z.object({
|
|
|
240
247
|
passed: z.number(),
|
|
241
248
|
failed: z.number()
|
|
242
249
|
}).passthrough();
|
|
250
|
+
/** One bulk Validate item: verdict, full issue array, and runtime-dependent duration. */
|
|
251
|
+
const CliValidateItemSchema = z.object({
|
|
252
|
+
id: z.string(),
|
|
253
|
+
type: z.enum(["change", "spec"]),
|
|
254
|
+
valid: z.boolean(),
|
|
255
|
+
issues: z.array(CliValidationIssueSchema),
|
|
256
|
+
durationMs: z.number()
|
|
257
|
+
}).passthrough();
|
|
258
|
+
/** Shared Validate summary: full-run totals plus per-type totals, never the filtered view. */
|
|
259
|
+
const CliValidateSummarySchema = z.object({
|
|
260
|
+
totals: CliValidationTotalsSchema,
|
|
261
|
+
byType: z.record(CliValidationTotalsSchema)
|
|
262
|
+
}).passthrough();
|
|
243
263
|
/** Typed ordinary Validate report, also used by 1.9 `validate --archived --json`. */
|
|
244
264
|
const CliValidateReportSchema = z.object({
|
|
245
|
-
items: z.array(
|
|
246
|
-
|
|
247
|
-
type: z.enum(["change", "spec"]),
|
|
248
|
-
valid: z.boolean(),
|
|
249
|
-
issues: z.array(CliValidationIssueSchema),
|
|
250
|
-
durationMs: z.number()
|
|
251
|
-
}).passthrough()),
|
|
252
|
-
summary: z.object({
|
|
253
|
-
totals: CliValidationTotalsSchema,
|
|
254
|
-
byType: z.record(CliValidationTotalsSchema)
|
|
255
|
-
}).passthrough(),
|
|
265
|
+
items: z.array(CliValidateItemSchema),
|
|
266
|
+
summary: CliValidateSummarySchema,
|
|
256
267
|
version: z.string(),
|
|
257
268
|
root: CliRootSchema
|
|
258
269
|
}).passthrough();
|
|
259
270
|
/** Typed strict, non-strict, or archived Validate result, including failure diagnostics. */
|
|
260
271
|
const CliValidateSchema = z.union([CliValidateReportSchema, CliDiagnosticFailureSchema]);
|
|
272
|
+
/**
|
|
273
|
+
* Typed OpenSpec 1.12 `validate --report findings` document.
|
|
274
|
+
*
|
|
275
|
+
* The findings report is a filtered evidence transport beside the full report, never the
|
|
276
|
+
* validation truth: `itemFindings` carries only items with issues, while `summary` and
|
|
277
|
+
* `root` stay the full-run values the CLI computed over every item in scope.
|
|
278
|
+
* `report.returnedItems`/`report.totalItems` distinguish the filtered view from the run
|
|
279
|
+
* size, and the process exit code keeps the full-run rule (`failed > 0 -> 1`), so decoding
|
|
280
|
+
* never consults it. An empty scope is the success document
|
|
281
|
+
* `{ returnedItems: 0, totalItems: 0, itemFindings: [] }`, not a failure sum type.
|
|
282
|
+
*
|
|
283
|
+
* Two upstream-guaranteed invariants are decode-level facts (pinned v1.12.0
|
|
284
|
+
* `projectValidationFindings`): every `itemFindings` entry carries at least one issue
|
|
285
|
+
* (upstream filters `item.issues.length > 0`), and `returnedItems` never exceeds
|
|
286
|
+
* `totalItems` (the filtered view is a subset of the full run). Upstream also happens to
|
|
287
|
+
* set `returnedItems === itemFindings.length` today; that equality stays unasserted so a
|
|
288
|
+
* future patch-level count adjustment inside the admitted range cannot fabricate a
|
|
289
|
+
* contract error out of otherwise well-formed CLI evidence.
|
|
290
|
+
*/
|
|
291
|
+
const CliValidateFindingsSchema = z.object({
|
|
292
|
+
report: z.object({
|
|
293
|
+
kind: z.literal("validation-findings"),
|
|
294
|
+
version: z.string(),
|
|
295
|
+
scope: z.enum([
|
|
296
|
+
"all",
|
|
297
|
+
"changes",
|
|
298
|
+
"specs",
|
|
299
|
+
"archived"
|
|
300
|
+
]),
|
|
301
|
+
returnedItems: z.number(),
|
|
302
|
+
totalItems: z.number()
|
|
303
|
+
}).passthrough(),
|
|
304
|
+
itemFindings: z.array(CliValidateItemSchema),
|
|
305
|
+
summary: CliValidateSummarySchema,
|
|
306
|
+
root: CliRootSchema
|
|
307
|
+
}).passthrough().superRefine((document, ctx) => {
|
|
308
|
+
if (document.report.returnedItems > document.report.totalItems) ctx.addIssue({
|
|
309
|
+
code: z.ZodIssueCode.custom,
|
|
310
|
+
path: ["report", "returnedItems"],
|
|
311
|
+
message: `returnedItems (${document.report.returnedItems}) must not exceed totalItems (${document.report.totalItems}).`
|
|
312
|
+
});
|
|
313
|
+
document.itemFindings.forEach((finding, index) => {
|
|
314
|
+
if (finding.issues.length === 0) ctx.addIssue({
|
|
315
|
+
code: z.ZodIssueCode.custom,
|
|
316
|
+
path: [
|
|
317
|
+
"itemFindings",
|
|
318
|
+
index,
|
|
319
|
+
"issues"
|
|
320
|
+
],
|
|
321
|
+
message: "Every findings item must carry at least one issue."
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
/**
|
|
326
|
+
* Typed findings or request-failure result of `validate --report findings --json`.
|
|
327
|
+
*
|
|
328
|
+
* Invalid requests (no bulk scope, an item name, archived+active mixing, or an unknown
|
|
329
|
+
* report value) produce the shared status-array failure envelope with code
|
|
330
|
+
* `invalid_validation_report_request`, decoded here through the shared diagnostic
|
|
331
|
+
* failure schema including its optional `fix` string.
|
|
332
|
+
*/
|
|
333
|
+
const CliValidateFindingsResultSchema = z.union([CliValidateFindingsSchema, CliDiagnosticFailureSchema]);
|
|
334
|
+
/**
|
|
335
|
+
* Whether a findings result is the findings document rather than the request-failure
|
|
336
|
+
* envelope. Passthrough tolerance means a failure envelope may legally carry unknown
|
|
337
|
+
* keys, so mere `report`-key presence cannot discriminate the union: the guard validates
|
|
338
|
+
* the upstream discriminator shape — `report` is an object whose `kind` is the
|
|
339
|
+
* `validation-findings` literal and whose count fields are numbers.
|
|
340
|
+
*
|
|
341
|
+
* The input is deliberately `unknown`: route and evidence consumers receive the union
|
|
342
|
+
* of every validate transport (`CliValidate | CliValidateFindingsResult | null`), so the
|
|
343
|
+
* guard must accept the consumed boundary, not only the already-narrowed findings union.
|
|
344
|
+
* It stays a cheap shape check, never a second decode: schema-level invariants
|
|
345
|
+
* (issue presence, count bounds) belong to `CliValidateFindingsSchema` alone.
|
|
346
|
+
*/
|
|
347
|
+
function isCliValidateFindings(result) {
|
|
348
|
+
if (typeof result !== "object" || result === null) return false;
|
|
349
|
+
const report = result.report;
|
|
350
|
+
if (typeof report !== "object" || report === null) return false;
|
|
351
|
+
const { kind, returnedItems, totalItems } = report;
|
|
352
|
+
return kind === "validation-findings" && typeof returnedItems === "number" && typeof totalItems === "number";
|
|
353
|
+
}
|
|
261
354
|
const CliArchiveTotalsSchema = z.object({
|
|
262
355
|
added: z.number(),
|
|
263
356
|
modified: z.number(),
|
|
@@ -352,4 +445,4 @@ function parseCliCommandResult(result, schema) {
|
|
|
352
445
|
}
|
|
353
446
|
|
|
354
447
|
//#endregion
|
|
355
|
-
export {
|
|
448
|
+
export { isCliValidateFindings as A, CliValidateFindingsResultSchema as C, CliWorkflowStatusFieldsSchema as D, CliValidateSchema as E, CliWorkflowStatusSchema as O, CliTemplatesSchema as S, CliValidateReportSchema as T, CliShowSpecDocumentSchema as _, CliApplyInstructionsSuccessSchema as a, CliSpecRequirementSchema as b, CliArchiveSchema as c, CliArtifactPathSchema as d, CliChangeListSchema as f, CliSchemaWhichSchema as g, CliSchemaShadowSchema as h, CliApplyInstructionsSchema as i, CliWorkflowStatusSuccessSchema as k, CliArtifactInstructionsSchema as l, CliSchemaResolutionSchema as m, parseCliCommandResult as n, CliArchiveInstructionsSchema as o, CliPlanningHomeSchema as p, CliActionContextSchema as r, CliArchiveInstructionsSuccessSchema as s, CliCommandTransportSchema as t, CliArtifactInstructionsSuccessSchema as u, CliShowSpecSchema as v, CliValidateFindingsSchema as w, CliTemplateEntrySchema as x, CliSpecListSchema as y };
|