@siteverb/contracts 0.1.0-rc.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/README.md +25 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.d.ts +698 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +316 -0
- package/dist/schema.js.map +1 -0
- package/package.json +55 -0
- package/schema/report.schema.json +157 -0
- package/schema/siteverb.webmcp.schema.json +269 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @siteverb/contracts
|
|
2
|
+
|
|
3
|
+
Portable, versioned JSON contracts shared by the Siteverb installer skill, deterministic runner,
|
|
4
|
+
GitHub Action, and future hosted control plane.
|
|
5
|
+
|
|
6
|
+
## Project contract
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { parseProjectContract } from '@siteverb/contracts';
|
|
10
|
+
|
|
11
|
+
const contract = parseProjectContract(JSON.parse(source));
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package also publishes `@siteverb/contracts/siteverb.webmcp.schema.json` for editors and
|
|
15
|
+
non-TypeScript consumers. A contract defines stable tool identities, wire names, risk, examples,
|
|
16
|
+
deterministic journeys, postconditions, cleanup, ownership, and evidence-labeled support profiles.
|
|
17
|
+
|
|
18
|
+
Unknown fields fail validation. Tool and journey references are checked after parsing. Read-only
|
|
19
|
+
annotations must agree with declared risk.
|
|
20
|
+
|
|
21
|
+
## Evidence report
|
|
22
|
+
|
|
23
|
+
`parseRunReport()` validates the bounded report emitted by `@siteverb/runner`. Reports contain
|
|
24
|
+
browser provenance, step status, duration, and bounded errors. Raw prompts, tool inputs, tool
|
|
25
|
+
results, DOM snapshots, cookies, and credentials are not part of the default report contract.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { compatibilityAssessmentSchema, compatibilityFindingSchema, domExpectationSchema, journeyContractSchema, journeyReportSchema, journeyStepSchema, projectContractSchema, resultExpectationSchema, runReportSchema, stepExpectationSchema, stepReportSchema, toolContractSchema, urlExpectationSchema } from './schema.js';
|
|
3
|
+
export { compatibilityAssessmentSchema, compatibilityFindingSchema, domExpectationSchema, evidenceLevelSchema, journeyContractSchema, journeyReportSchema, journeyStepSchema, jsonValueSchema, projectContractJsonSchema, projectContractSchema, resultExpectationSchema, runReportJsonSchema, runReportSchema, stepExpectationSchema, stepReportSchema, supportProfileSchema, toolAnnotationsSchema, toolContractSchema, toolExampleSchema, urlExpectationSchema, } from './schema.js';
|
|
4
|
+
export type ProjectContract = z.infer<typeof projectContractSchema>;
|
|
5
|
+
export type ToolContract = z.infer<typeof toolContractSchema>;
|
|
6
|
+
export type JourneyContract = z.infer<typeof journeyContractSchema>;
|
|
7
|
+
export type JourneyStep = z.infer<typeof journeyStepSchema>;
|
|
8
|
+
export type StepExpectation = z.infer<typeof stepExpectationSchema>;
|
|
9
|
+
export type ResultExpectation = z.infer<typeof resultExpectationSchema>;
|
|
10
|
+
export type UrlExpectation = z.infer<typeof urlExpectationSchema>;
|
|
11
|
+
export type DomExpectation = z.infer<typeof domExpectationSchema>;
|
|
12
|
+
export type StepReport = z.infer<typeof stepReportSchema>;
|
|
13
|
+
export type JourneyReport = z.infer<typeof journeyReportSchema>;
|
|
14
|
+
export type CompatibilityFinding = z.infer<typeof compatibilityFindingSchema>;
|
|
15
|
+
export type CompatibilityAssessment = z.infer<typeof compatibilityAssessmentSchema>;
|
|
16
|
+
export type RunReport = z.infer<typeof runReportSchema>;
|
|
17
|
+
export type { JsonValue } from './schema.js';
|
|
18
|
+
export declare function parseProjectContract(input: unknown): ProjectContract;
|
|
19
|
+
export declare function parseRunReport(input: unknown): RunReport;
|
|
20
|
+
export declare function safeParseProjectContract(input: unknown): z.ZodSafeParseResult<{
|
|
21
|
+
$schema?: string | undefined;
|
|
22
|
+
version: 1;
|
|
23
|
+
project: string;
|
|
24
|
+
support: {
|
|
25
|
+
id: string;
|
|
26
|
+
version: string;
|
|
27
|
+
evidence: "documented-profile" | "official-sdk" | "real-browser" | "real-client";
|
|
28
|
+
}[];
|
|
29
|
+
tools: {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
title?: string | undefined;
|
|
33
|
+
description: string;
|
|
34
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
35
|
+
annotations?: {
|
|
36
|
+
readOnlyHint?: boolean | undefined;
|
|
37
|
+
untrustedContentHint?: boolean | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
risk: "consequential" | "read-only" | "reversible";
|
|
40
|
+
registration: "declarative" | "imperative";
|
|
41
|
+
frame: "cross-origin-iframe" | "same-origin-iframe" | "top-level";
|
|
42
|
+
routes?: string[] | undefined;
|
|
43
|
+
owners?: string[] | undefined;
|
|
44
|
+
examples: {
|
|
45
|
+
name: string;
|
|
46
|
+
input: Record<string, import("./schema.js").JsonValue>;
|
|
47
|
+
}[];
|
|
48
|
+
}[];
|
|
49
|
+
journeys: {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
start: string;
|
|
54
|
+
auth?: string | undefined;
|
|
55
|
+
owners?: string[] | undefined;
|
|
56
|
+
steps: {
|
|
57
|
+
tool: string;
|
|
58
|
+
input: Record<string, import("./schema.js").JsonValue>;
|
|
59
|
+
expect?: {
|
|
60
|
+
result?: {
|
|
61
|
+
equals?: import("./schema.js").JsonValue | undefined;
|
|
62
|
+
contains?: import("./schema.js").JsonValue | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
url?: {
|
|
65
|
+
pathname?: string | undefined;
|
|
66
|
+
searchParams?: Record<string, string> | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
dom?: {
|
|
69
|
+
selector: string;
|
|
70
|
+
state: "attached" | "detached" | "hidden" | "visible";
|
|
71
|
+
textContains?: string | undefined;
|
|
72
|
+
attribute?: {
|
|
73
|
+
name: string;
|
|
74
|
+
equals: string;
|
|
75
|
+
} | undefined;
|
|
76
|
+
}[] | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
}[];
|
|
79
|
+
cleanup?: {
|
|
80
|
+
tool: string;
|
|
81
|
+
input: Record<string, import("./schema.js").JsonValue>;
|
|
82
|
+
expect?: {
|
|
83
|
+
result?: {
|
|
84
|
+
equals?: import("./schema.js").JsonValue | undefined;
|
|
85
|
+
contains?: import("./schema.js").JsonValue | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
url?: {
|
|
88
|
+
pathname?: string | undefined;
|
|
89
|
+
searchParams?: Record<string, string> | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
dom?: {
|
|
92
|
+
selector: string;
|
|
93
|
+
state: "attached" | "detached" | "hidden" | "visible";
|
|
94
|
+
textContains?: string | undefined;
|
|
95
|
+
attribute?: {
|
|
96
|
+
name: string;
|
|
97
|
+
equals: string;
|
|
98
|
+
} | undefined;
|
|
99
|
+
}[] | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}[] | undefined;
|
|
102
|
+
policy: {
|
|
103
|
+
requireHumanBefore: string[];
|
|
104
|
+
};
|
|
105
|
+
}[];
|
|
106
|
+
}>;
|
|
107
|
+
export declare function safeParseRunReport(input: unknown): z.ZodSafeParseResult<{
|
|
108
|
+
version: 1;
|
|
109
|
+
runId: string;
|
|
110
|
+
startedAt: string;
|
|
111
|
+
finishedAt: string;
|
|
112
|
+
targetUrl: string;
|
|
113
|
+
project: string;
|
|
114
|
+
contractHash: string;
|
|
115
|
+
runner: {
|
|
116
|
+
name: string;
|
|
117
|
+
version: string;
|
|
118
|
+
};
|
|
119
|
+
browser: {
|
|
120
|
+
name: string;
|
|
121
|
+
version: string;
|
|
122
|
+
channel: string;
|
|
123
|
+
evidence: "documented-profile" | "official-sdk" | "real-browser" | "real-client" | "spec-only";
|
|
124
|
+
};
|
|
125
|
+
summary: {
|
|
126
|
+
passed: number;
|
|
127
|
+
failed: number;
|
|
128
|
+
skipped: number;
|
|
129
|
+
};
|
|
130
|
+
compatibility: {
|
|
131
|
+
profileId: string;
|
|
132
|
+
status: "compatible" | "incompatible" | "unknown";
|
|
133
|
+
findings: {
|
|
134
|
+
code: string;
|
|
135
|
+
evidence: "documented-profile" | "official-sdk" | "real-browser" | "real-client" | "spec-only";
|
|
136
|
+
message: string;
|
|
137
|
+
severity: "error" | "warning";
|
|
138
|
+
source: string;
|
|
139
|
+
toolId: string;
|
|
140
|
+
}[];
|
|
141
|
+
}[];
|
|
142
|
+
journeys: {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
status: "failed" | "passed" | "skipped";
|
|
146
|
+
durationMs: number;
|
|
147
|
+
steps: {
|
|
148
|
+
index: number;
|
|
149
|
+
toolId: string;
|
|
150
|
+
toolName: string;
|
|
151
|
+
status: "failed" | "passed" | "skipped";
|
|
152
|
+
durationMs: number;
|
|
153
|
+
error?: string | undefined;
|
|
154
|
+
}[];
|
|
155
|
+
cleanup: {
|
|
156
|
+
index: number;
|
|
157
|
+
toolId: string;
|
|
158
|
+
toolName: string;
|
|
159
|
+
status: "failed" | "passed" | "skipped";
|
|
160
|
+
durationMs: number;
|
|
161
|
+
error?: string | undefined;
|
|
162
|
+
}[];
|
|
163
|
+
error?: string | undefined;
|
|
164
|
+
}[];
|
|
165
|
+
}>;
|
|
166
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe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BAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAEpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAExD;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEtD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEhD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { compatibilityAssessmentSchema, compatibilityFindingSchema, domExpectationSchema, journeyContractSchema, journeyReportSchema, journeyStepSchema, projectContractSchema, resultExpectationSchema, runReportSchema, stepExpectationSchema, stepReportSchema, toolContractSchema, urlExpectationSchema, } from './schema.js';
|
|
2
|
+
export { compatibilityAssessmentSchema, compatibilityFindingSchema, domExpectationSchema, evidenceLevelSchema, journeyContractSchema, journeyReportSchema, journeyStepSchema, jsonValueSchema, projectContractJsonSchema, projectContractSchema, resultExpectationSchema, runReportJsonSchema, runReportSchema, stepExpectationSchema, stepReportSchema, supportProfileSchema, toolAnnotationsSchema, toolContractSchema, toolExampleSchema, urlExpectationSchema, } from './schema.js';
|
|
3
|
+
export function parseProjectContract(input) {
|
|
4
|
+
return projectContractSchema.parse(input);
|
|
5
|
+
}
|
|
6
|
+
export function parseRunReport(input) {
|
|
7
|
+
return runReportSchema.parse(input);
|
|
8
|
+
}
|
|
9
|
+
export function safeParseProjectContract(input) {
|
|
10
|
+
return projectContractSchema.safeParse(input);
|
|
11
|
+
}
|
|
12
|
+
export function safeParseRunReport(input) {
|
|
13
|
+
return runReportSchema.safeParse(input);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAiBrB,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,OAAO,eAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC"}
|