@zh-xx/antu 0.10.0 → 0.12.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 +8 -0
- package/assets/viewer.html +55 -55
- package/bin/antu-mcp.mjs +53 -53
- package/bin/antu.mjs +55 -55
- package/embed/antu-embed.d.ts +95 -0
- package/embed/antu-embed.js +81139 -0
- package/examples/agent/fact/1-minimal.en.json +8 -11
- package/examples/agent/fact/1-minimal.zh-CN.json +34 -9
- package/examples/agent/fact/2-single-actor.en.json +4 -30
- package/examples/agent/fact/2-single-actor.zh-CN.json +22 -10
- package/examples/agent/fact/{3-groups.en.json → 3-sides.en.json} +9 -9
- package/examples/agent/fact/{3-groups.zh-CN.json → 3-sides.zh-CN.json} +9 -9
- package/examples/agent/fact/4-one-side-several.en.json +44 -0
- package/examples/agent/fact/4-one-side-several.zh-CN.json +44 -0
- package/examples/agent/fact/5-duration.en.json +31 -8
- package/examples/agent/fact/5-duration.zh-CN.json +31 -8
- package/examples/agent/fact/6-sources.en.json +51 -12
- package/examples/agent/fact/6-sources.zh-CN.json +51 -12
- package/examples/agent/fact/7-undated.en.json +26 -9
- package/examples/agent/fact/7-undated.zh-CN.json +26 -9
- package/examples/fact/fang-yuan-loan-and-conflict.en.json +7 -66
- package/examples/fact/fang-yuan-loan-and-conflict.zh-CN.json +6 -29
- package/examples/fact/gym-membership-face-scan.en.json +15 -20
- package/examples/fact/gym-membership-face-scan.zh-CN.json +15 -20
- package/examples/fact/lin-fang-v-zhao-lei-private-lending.en.json +6 -19
- package/examples/fact/lin-fang-v-zhao-lei-private-lending.zh-CN.json +6 -19
- package/examples/fact/marketplace-platform-liability.en.json +5 -24
- package/examples/fact/marketplace-platform-liability.zh-CN.json +5 -24
- package/examples/fact/neighbour-corridor-charging.en.json +3 -25
- package/examples/fact/neighbour-corridor-charging.zh-CN.json +3 -25
- package/examples/fact/sample-construction-payment.en.json +8 -82
- package/examples/fact/sample-construction-payment.zh-CN.json +7 -25
- package/examples/fact/sample-four-parties-four-slots.en.json +8 -81
- package/examples/fact/sample-four-parties-four-slots.zh-CN.json +5 -22
- package/examples/fact/sample-no-groups.en.json +1 -1
- package/examples/fact/sample-no-groups.zh-CN.json +1 -1
- package/examples/fact/sample-three-slots.en.json +3 -15
- package/examples/fact/sample-three-slots.zh-CN.json +3 -15
- package/examples/fact/sample-two-actors-one-side.en.json +4 -23
- package/examples/fact/sample-two-actors-one-side.zh-CN.json +4 -23
- package/examples/fact/sample-two-parties-each-side.en.json +7 -34
- package/examples/fact/sample-two-parties-each-side.zh-CN.json +7 -34
- package/examples/raw//357/274/2102031/357/274/211/347/244/272/346/260/221/345/210/2352/345/217/267-/345/201/245/350/272/253/346/210/277/345/210/267/350/204/270/345/205/245/345/234/272/346/241/210-/344/270/200/345/256/241.md +1 -1
- package/lib/chunks/report-BbG7HCJA.mjs +1462 -0
- package/lib/html.d.ts +9 -0
- package/lib/html.mjs +1425 -0
- package/lib/validate.d.ts +38 -0
- package/lib/validate.mjs +1425 -0
- package/package.json +17 -2
- package/server.json +2 -2
- package/spec/agent/fact/guide.md +38 -38
- package/examples/agent/fact/4-views.en.json +0 -44
- package/examples/agent/fact/4-views.zh-CN.json +0 -44
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Declarations of `@zh-xx/antu/validate` (tools/api/validate.mjs). The contract is in spec/embed.md;
|
|
2
|
+
// test/embed.test.mjs checks that every function the module exports is declared here and nothing else.
|
|
3
|
+
|
|
4
|
+
export interface ValidateResult {
|
|
5
|
+
ok: boolean
|
|
6
|
+
/** Each names its field, e.g. `nodes[2] (n-3): \`kind\` is "bogus", …` */
|
|
7
|
+
errors: string[]
|
|
8
|
+
/** Not errors, but the author should see them; only when there are no errors */
|
|
9
|
+
notes: string[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type LayoutResult =
|
|
13
|
+
| ({ ok: true; type: string; kind: string; text: string } & Record<string, unknown>)
|
|
14
|
+
| { ok: false; reason: string; errors?: string[] }
|
|
15
|
+
|
|
16
|
+
export interface VersionsReport {
|
|
17
|
+
release: string
|
|
18
|
+
types: Array<{
|
|
19
|
+
type: string
|
|
20
|
+
specVersion: number
|
|
21
|
+
diagrams: Array<{ kind: string; version: number; status: 'experimental' | 'stable' | 'deprecated'; since: string }>
|
|
22
|
+
}>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function validate(spec: unknown): ValidateResult
|
|
26
|
+
export function layout(spec: unknown, options?: { kind?: string; orientation?: 'vertical' | 'horizontal' }): LayoutResult
|
|
27
|
+
export interface NormalizeResult {
|
|
28
|
+
/** A repaired copy; the input is not modified */
|
|
29
|
+
spec: unknown
|
|
30
|
+
/** What was changed, in words an agent can read; empty when nothing was */
|
|
31
|
+
changes: string[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Repair what is inconsistent in the marks of a spec but not in its content (a procedure's main line). Call it before `validate` */
|
|
35
|
+
export function normalize(spec: unknown): NormalizeResult
|
|
36
|
+
/** Each type and its kinds, the first kind being the one a diagram opens in */
|
|
37
|
+
export function kinds(): Record<string, string[]>
|
|
38
|
+
export function versions(): VersionsReport
|