@astra-spec/sdk 0.0.1
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/LICENSE +28 -0
- package/README.md +117 -0
- package/dist/helpers.d.ts +26 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +165 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/index.d.ts +35 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +85 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/types.d.ts +122 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/validation/index.d.ts +4 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +4 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/narrative.d.ts +23 -0
- package/dist/validation/narrative.d.ts.map +1 -0
- package/dist/validation/narrative.js +337 -0
- package/dist/validation/narrative.js.map +1 -0
- package/dist/validation/schema.d.ts +16 -0
- package/dist/validation/schema.d.ts.map +1 -0
- package/dist/validation/schema.js +82 -0
- package/dist/validation/schema.js.map +1 -0
- package/dist/validation/semantic.d.ts +18 -0
- package/dist/validation/semantic.d.ts.map +1 -0
- package/dist/validation/semantic.js +751 -0
- package/dist/validation/semantic.js.map +1 -0
- package/package.json +60 -0
- package/src/helpers.ts +171 -0
- package/src/index.ts +69 -0
- package/src/schema/index.ts +113 -0
- package/src/types.ts +139 -0
- package/src/validation/index.ts +26 -0
- package/src/validation/narrative.ts +389 -0
- package/src/validation/schema.ts +132 -0
- package/src/validation/semantic.ts +1129 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Lightcone Research
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# astra-typescript
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for the **Agentic Schema for Transparent Research Analysis (ASTRA)** — published as `@astra-spec/sdk`.
|
|
4
|
+
|
|
5
|
+
Parse, validate, and inspect ASTRA analysis specifications. The package mirrors the validation surface of the Python `astra-tools` SDK and is intended as a foundation for downstream TypeScript tooling (editors, web validators, agent harnesses).
|
|
6
|
+
|
|
7
|
+
The canonical specification lives at https://astra-spec.org/.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @astra-spec/sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires Node ≥18 (uses global `fetch`).
|
|
16
|
+
|
|
17
|
+
## Schema source
|
|
18
|
+
|
|
19
|
+
The package does **not** bundle the JSON Schema. It fetches a frozen, versioned copy from astra-spec.org on first use and caches it:
|
|
20
|
+
|
|
21
|
+
- in memory for the current process
|
|
22
|
+
- on disk under `<tmpdir>/astra-schema-cache/<hash>.json` for re-runs
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { loadAstraSchema, astraSchemaUrl } from "@astra-spec/sdk";
|
|
26
|
+
|
|
27
|
+
// Defaults to https://astra-spec.org/latest/schema/astra.schema.json
|
|
28
|
+
await loadAstraSchema();
|
|
29
|
+
|
|
30
|
+
// Pin a specific version
|
|
31
|
+
await loadAstraSchema({ version: "0.0.10" });
|
|
32
|
+
// → https://astra-spec.org/0.0.10/schema/astra.schema.json
|
|
33
|
+
|
|
34
|
+
// Or supply your own URL (https:// or file://)
|
|
35
|
+
await loadAstraSchema({ url: "file:///path/to/astra.schema.json" });
|
|
36
|
+
|
|
37
|
+
// Or pre-install a schema you already have
|
|
38
|
+
import { setAstraSchema } from "@astra-spec/sdk";
|
|
39
|
+
setAstraSchema(mySchema, { version: "latest" });
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Disable disk caching with `cacheDir: false`. Force a refetch with `force: true`.
|
|
43
|
+
|
|
44
|
+
## Validate an analysis
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import {
|
|
48
|
+
validateAnalysisFile, // structural (JSON Schema)
|
|
49
|
+
semanticValidateAnalysisFile, // cross-references, constraints, from-paths
|
|
50
|
+
validateNarrativeAnchorsFile, // markdown anchor resolution
|
|
51
|
+
} from "@astra-spec/sdk";
|
|
52
|
+
|
|
53
|
+
const structural = await validateAnalysisFile("astra.yaml"); // string[]
|
|
54
|
+
const semantic = semanticValidateAnalysisFile("astra.yaml"); // SemanticError[]
|
|
55
|
+
const narrative = validateNarrativeAnchorsFile("astra.yaml"); // SemanticError[]
|
|
56
|
+
|
|
57
|
+
if (structural.length || semantic.length || narrative.length) {
|
|
58
|
+
for (const e of [...structural, ...semantic, ...narrative]) console.error(String(e));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Pin to a specific spec version per call:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
await validateAnalysisFile("astra.yaml", { version: "0.0.10" });
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Validate a universe
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import {
|
|
73
|
+
validateUniverseFile, // structural
|
|
74
|
+
validateUniverse, // semantic, against an analysis
|
|
75
|
+
loadYaml,
|
|
76
|
+
} from "@astra-spec/sdk";
|
|
77
|
+
|
|
78
|
+
const structural = await validateUniverseFile("universes/baseline.yaml");
|
|
79
|
+
const semantic = validateUniverse(
|
|
80
|
+
loadYaml("universes/baseline.yaml"),
|
|
81
|
+
loadYaml("astra.yaml"),
|
|
82
|
+
);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## What ships
|
|
86
|
+
|
|
87
|
+
| Module | Exports |
|
|
88
|
+
|---|---|
|
|
89
|
+
| Schema loader | `loadAstraSchema`, `setAstraSchema`, `clearAstraSchemaCache`, `astraSchemaUrl`, `ASTRA_SPEC_HOST`, `JsonSchema`, `SchemaLoadOptions` |
|
|
90
|
+
| Structural validation | `validateAnalysisData`, `validateAnalysisFile`, `validateUniverseData`, `validateUniverseFile`, `isValidAnalysis`, `isValidUniverse` (all async) |
|
|
91
|
+
| Semantic validation | `validateAnalysis`, `validateUniverse`, `semanticValidateAnalysisFile`, `semanticValidateUniverseFile`, `SemanticError` |
|
|
92
|
+
| Narrative validation | `validateNarrativeAnchors`, `checkNarrativeCoverage`, `validateNarrativeSections` (and `*File` variants), `NarrativeWarning` |
|
|
93
|
+
| Helpers | `loadYaml`, `parseYamlString`, `isConditionMet`, `collectNodeDecisions`, `resolveAnalysisTree`, `getInputIds`, `getOutputIds` |
|
|
94
|
+
| Types | `Analysis`, `Universe`, `UniverseNode`, `Input`, `Output`, `Decision`, `Option`, `Recipe`, `Resources`, `Insight`, `Evidence`, `Narrative`, `TextQuoteSelector`, `FragmentSelector` |
|
|
95
|
+
|
|
96
|
+
## Validation layers
|
|
97
|
+
|
|
98
|
+
ASTRA validation is layered, matching the Python implementation:
|
|
99
|
+
|
|
100
|
+
1. **Structural** — JSON Schema (Ajv, draft 2019-09). Shape, types, required fields, ID patterns, `from`-alias forbidden-field rules. Async because it fetches/loads the schema.
|
|
101
|
+
2. **Semantic** — cross-references and constraint resolution: duplicate IDs, default option existence, `from:` direction rules, `Output.inputs` / `Output.decisions` resolution, recipe template placeholders, output dependency cycles, universe selections, constraint compatibility. Synchronous.
|
|
102
|
+
3. **Narrative** — Markdown anchor resolution, coverage warnings (decisions/findings/outputs/sub-analyses unmentioned), and section-required-when-data-present. Synchronous.
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install
|
|
108
|
+
npm test # vitest
|
|
109
|
+
npm run build # tsc → dist/
|
|
110
|
+
npm run typecheck
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The test suite runs offline against a sibling `astra-spec` checkout (expected at `../astra-spec` relative to this repo). It pulls the schema, fixtures, and example projects from there rather than vendoring copies.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
BSD-3-Clause. See `LICENSE`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Analysis, Decision, Universe } from "./types.js";
|
|
2
|
+
/** Parse a YAML string into an unknown record. */
|
|
3
|
+
export declare function parseYamlString(text: string): Record<string, unknown>;
|
|
4
|
+
/** Read a YAML file from disk as a parsed object. */
|
|
5
|
+
export declare function loadYaml(filePath: string): Record<string, unknown>;
|
|
6
|
+
/** Evaluate a `when` clause (string | string[] | undefined) against a
|
|
7
|
+
* flat decision selection. AND across entries; `~` prefix negates. */
|
|
8
|
+
export declare function isConditionMet(when: string | string[] | undefined | null, selections: Record<string, string>): boolean;
|
|
9
|
+
/** Locally-defined decisions on a node (skips `from:` aliases). */
|
|
10
|
+
export declare function collectNodeDecisions(node: Record<string, unknown>): Record<string, Decision>;
|
|
11
|
+
export declare function getInputIds(node: Record<string, unknown>): Set<string>;
|
|
12
|
+
export declare function getOutputIds(node: Record<string, unknown>): Set<string>;
|
|
13
|
+
/** Walk `analyses.*.path` references and inline external `astra.yaml`
|
|
14
|
+
* files. Returns a new object only if at least one path was resolved. */
|
|
15
|
+
export declare function resolveAnalysisTree(data: Record<string, unknown>, basePath: string): Record<string, unknown>;
|
|
16
|
+
/** Inject mapping keys as `id` fields on each value, mirroring the
|
|
17
|
+
* Python-side preprocessing. ASTRA YAML is keyed-dict, but the JSON
|
|
18
|
+
* Schema requires `id` to be set. Mutates the supplied data in place. */
|
|
19
|
+
export declare function injectAnalysisIdsInPlace(data: Record<string, unknown>): void;
|
|
20
|
+
export declare function injectUniverseIdsInPlace(node: Record<string, unknown>): void;
|
|
21
|
+
/** Deep clone via JSON round-trip. ASTRA documents are pure data — no
|
|
22
|
+
* cycles, no functions — so this is sufficient and avoids a dep. */
|
|
23
|
+
export declare function deepClone<T>(value: T): T;
|
|
24
|
+
export declare function dirOf(filePath: string): string;
|
|
25
|
+
export type { Analysis, Universe };
|
|
26
|
+
//# sourceMappingURL=helpers.d.ts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AAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAU5E;AAED;qEACqE;AACrE,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAExC;AAED,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9C;AAGD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Dict-based helpers that operate on parsed YAML data structures. Mirrors
|
|
2
|
+
// the Python `astra.helpers` module so semantic validation can resolve
|
|
3
|
+
// `from:` paths, `when:` conditions, and tree lookups without requiring a
|
|
4
|
+
// strongly-typed model.
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { dirname, isAbsolute, resolve as resolvePath } from "node:path";
|
|
7
|
+
import { parse as parseYaml } from "yaml";
|
|
8
|
+
/** Parse a YAML string into an unknown record. */
|
|
9
|
+
export function parseYamlString(text) {
|
|
10
|
+
const data = parseYaml(text);
|
|
11
|
+
if (data == null || typeof data !== "object" || Array.isArray(data)) {
|
|
12
|
+
throw new Error("YAML root must be a mapping/object");
|
|
13
|
+
}
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
/** Read a YAML file from disk as a parsed object. */
|
|
17
|
+
export function loadYaml(filePath) {
|
|
18
|
+
const text = readFileSync(filePath, "utf8");
|
|
19
|
+
return parseYamlString(text);
|
|
20
|
+
}
|
|
21
|
+
/** Evaluate a `when` clause (string | string[] | undefined) against a
|
|
22
|
+
* flat decision selection. AND across entries; `~` prefix negates. */
|
|
23
|
+
export function isConditionMet(when, selections) {
|
|
24
|
+
if (when == null)
|
|
25
|
+
return true;
|
|
26
|
+
const conditions = typeof when === "string" ? [when] : when;
|
|
27
|
+
for (const cond of conditions) {
|
|
28
|
+
const negate = cond.startsWith("~");
|
|
29
|
+
const ref = negate ? cond.slice(1) : cond;
|
|
30
|
+
const dot = ref.indexOf(".");
|
|
31
|
+
if (dot < 0)
|
|
32
|
+
return false;
|
|
33
|
+
const decisionId = ref.slice(0, dot);
|
|
34
|
+
const optionId = ref.slice(dot + 1);
|
|
35
|
+
const selected = selections[decisionId];
|
|
36
|
+
let match = selected === optionId;
|
|
37
|
+
if (negate)
|
|
38
|
+
match = !match;
|
|
39
|
+
if (!match)
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
/** Locally-defined decisions on a node (skips `from:` aliases). */
|
|
45
|
+
export function collectNodeDecisions(node) {
|
|
46
|
+
const out = {};
|
|
47
|
+
const decisions = (node.decisions ?? {});
|
|
48
|
+
for (const [id, decision] of Object.entries(decisions)) {
|
|
49
|
+
if (decision && typeof decision === "object" && decision.from)
|
|
50
|
+
continue;
|
|
51
|
+
out[id] = decision;
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
export function getInputIds(node) {
|
|
56
|
+
const inputs = (node.inputs ?? []);
|
|
57
|
+
const out = new Set();
|
|
58
|
+
for (const inp of inputs)
|
|
59
|
+
if (inp?.id)
|
|
60
|
+
out.add(inp.id);
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
export function getOutputIds(node) {
|
|
64
|
+
const outputs = (node.outputs ?? []);
|
|
65
|
+
const out = new Set();
|
|
66
|
+
for (const o of outputs)
|
|
67
|
+
if (o?.id)
|
|
68
|
+
out.add(o.id);
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
/** Walk `analyses.*.path` references and inline external `astra.yaml`
|
|
72
|
+
* files. Returns a new object only if at least one path was resolved. */
|
|
73
|
+
export function resolveAnalysisTree(data, basePath) {
|
|
74
|
+
const analyses = data.analyses;
|
|
75
|
+
if (!analyses || typeof analyses !== "object")
|
|
76
|
+
return data;
|
|
77
|
+
const resolved = {};
|
|
78
|
+
let changed = false;
|
|
79
|
+
for (const [id, raw] of Object.entries(analyses)) {
|
|
80
|
+
if (!raw || typeof raw !== "object") {
|
|
81
|
+
resolved[id] = raw;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const node = raw;
|
|
85
|
+
const subPath = node.path;
|
|
86
|
+
if (typeof subPath === "string" && subPath) {
|
|
87
|
+
const absDir = isAbsolute(subPath) ? subPath : resolvePath(basePath, subPath);
|
|
88
|
+
const yamlPath = resolvePath(absDir, "astra.yaml");
|
|
89
|
+
try {
|
|
90
|
+
const subData = loadYaml(yamlPath);
|
|
91
|
+
subData.path = subPath;
|
|
92
|
+
resolved[id] = resolveAnalysisTree(subData, absDir);
|
|
93
|
+
changed = true;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// If the file doesn't exist, leave the stub in place — a
|
|
97
|
+
// higher-layer warning surfaces the problem.
|
|
98
|
+
resolved[id] = node;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const sub = resolveAnalysisTree(node, basePath);
|
|
103
|
+
resolved[id] = sub;
|
|
104
|
+
if (sub !== node)
|
|
105
|
+
changed = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!changed)
|
|
109
|
+
return data;
|
|
110
|
+
return { ...data, analyses: resolved };
|
|
111
|
+
}
|
|
112
|
+
/** Inject mapping keys as `id` fields on each value, mirroring the
|
|
113
|
+
* Python-side preprocessing. ASTRA YAML is keyed-dict, but the JSON
|
|
114
|
+
* Schema requires `id` to be set. Mutates the supplied data in place. */
|
|
115
|
+
export function injectAnalysisIdsInPlace(data) {
|
|
116
|
+
for (const field of ["decisions", "analyses", "prior_insights", "findings"]) {
|
|
117
|
+
const mapping = data[field];
|
|
118
|
+
if (!mapping || typeof mapping !== "object" || Array.isArray(mapping))
|
|
119
|
+
continue;
|
|
120
|
+
for (const [key, value] of Object.entries(mapping)) {
|
|
121
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
122
|
+
continue;
|
|
123
|
+
const obj = value;
|
|
124
|
+
if (obj.id === undefined)
|
|
125
|
+
obj.id = key;
|
|
126
|
+
if (field === "decisions") {
|
|
127
|
+
const opts = obj.options;
|
|
128
|
+
if (opts && typeof opts === "object" && !Array.isArray(opts)) {
|
|
129
|
+
for (const [okey, ovalue] of Object.entries(opts)) {
|
|
130
|
+
if (ovalue && typeof ovalue === "object" && !Array.isArray(ovalue)) {
|
|
131
|
+
const o = ovalue;
|
|
132
|
+
if (o.id === undefined)
|
|
133
|
+
o.id = okey;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (field === "analyses") {
|
|
139
|
+
injectAnalysisIdsInPlace(obj);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export function injectUniverseIdsInPlace(node) {
|
|
145
|
+
const analyses = node.analyses;
|
|
146
|
+
if (!analyses || typeof analyses !== "object" || Array.isArray(analyses))
|
|
147
|
+
return;
|
|
148
|
+
for (const [key, value] of Object.entries(analyses)) {
|
|
149
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
150
|
+
const obj = value;
|
|
151
|
+
if (obj.id === undefined)
|
|
152
|
+
obj.id = key;
|
|
153
|
+
injectUniverseIdsInPlace(obj);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Deep clone via JSON round-trip. ASTRA documents are pure data — no
|
|
158
|
+
* cycles, no functions — so this is sufficient and avoids a dep. */
|
|
159
|
+
export function deepClone(value) {
|
|
160
|
+
return JSON.parse(JSON.stringify(value));
|
|
161
|
+
}
|
|
162
|
+
export function dirOf(filePath) {
|
|
163
|
+
return dirname(filePath);
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings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AAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,GAAG,GAAG,KAAgC,CAAC;YAC7C,IAAI,GAAG,CAAC,EAAE,KAAK,SAAS;gBAAE,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC;YACvC,wBAAwB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;AACH,CAAC;AAED;qEACqE;AACrE,MAAM,UAAU,SAAS,CAAI,KAAQ;IACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAM,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,QAAgB;IACpC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { Analysis, Decision, Evidence, FragmentSelector, Input, InputType, Insight, Narrative, Option, Output, OutputType, Recipe, Resources, TextQuoteSelector, Universe, UniverseNode, } from "./types.js";
|
|
2
|
+
export { loadYaml, parseYamlString, isConditionMet, collectNodeDecisions, resolveAnalysisTree, injectAnalysisIdsInPlace, injectUniverseIdsInPlace, getInputIds, getOutputIds, } from "./helpers.js";
|
|
3
|
+
export { validateAnalysisData, validateUniverseData, validateAnalysisFile, validateUniverseFile, isValidAnalysis, isValidUniverse, SemanticError, validateAnalysis, validateUniverse, semanticValidateAnalysisFile, semanticValidateUniverseFile, NarrativeWarning, validateNarrativeAnchors, validateNarrativeAnchorsFile, checkNarrativeCoverage, checkNarrativeCoverageFile, validateNarrativeSections, validateNarrativeSectionsFile, } from "./validation/index.js";
|
|
4
|
+
export { type JsonSchema, type SchemaLoadOptions, ASTRA_SPEC_HOST, astraSchemaUrl, loadAstraSchema, setAstraSchema, clearAstraSchemaCache, } from "./schema/index.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe,EAGf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAG5B,gBAAgB,EAChB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,qBAAqB,GACtB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Public API for @astra-spec/sdk. The package focuses on parsing and
|
|
2
|
+
// validating ASTRA analyses; downstream tools layer their own UX on top.
|
|
3
|
+
export { loadYaml, parseYamlString, isConditionMet, collectNodeDecisions, resolveAnalysisTree, injectAnalysisIdsInPlace, injectUniverseIdsInPlace, getInputIds, getOutputIds, } from "./helpers.js";
|
|
4
|
+
export {
|
|
5
|
+
// Structural (JSON Schema)
|
|
6
|
+
validateAnalysisData, validateUniverseData, validateAnalysisFile, validateUniverseFile, isValidAnalysis, isValidUniverse,
|
|
7
|
+
// Semantic
|
|
8
|
+
SemanticError, validateAnalysis, validateUniverse, semanticValidateAnalysisFile, semanticValidateUniverseFile,
|
|
9
|
+
// Narrative
|
|
10
|
+
NarrativeWarning, validateNarrativeAnchors, validateNarrativeAnchorsFile, checkNarrativeCoverage, checkNarrativeCoverageFile, validateNarrativeSections, validateNarrativeSectionsFile, } from "./validation/index.js";
|
|
11
|
+
export { ASTRA_SPEC_HOST, astraSchemaUrl, loadAstraSchema, setAstraSchema, clearAstraSchemaCache, } from "./schema/index.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,yEAAyE;AAqBzE,OAAO,EACL,QAAQ,EACR,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO;AACL,2BAA2B;AAC3B,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,eAAe;AAEf,WAAW;AACX,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B;AAE5B,YAAY;AACZ,gBAAgB,EAChB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAGL,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,qBAAqB,GACtB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type JsonSchema = Record<string, unknown>;
|
|
2
|
+
export interface SchemaLoadOptions {
|
|
3
|
+
/** Version segment in the URL path. Defaults to "latest". */
|
|
4
|
+
version?: string;
|
|
5
|
+
/** Explicit URL override. Wins over `version`. Supports `https://` and `file://`. */
|
|
6
|
+
url?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Directory used as the on-disk cache. Set to `null` (or `false`) to
|
|
9
|
+
* disable disk caching entirely. Defaults to `<tmpdir>/astra-schema-cache`.
|
|
10
|
+
*/
|
|
11
|
+
cacheDir?: string | null | false;
|
|
12
|
+
/** Bypass both in-memory and on-disk caches and fetch fresh. */
|
|
13
|
+
force?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ASTRA_SPEC_HOST = "https://astra-spec.org";
|
|
16
|
+
/** Build the canonical schema URL for a given version. */
|
|
17
|
+
export declare function astraSchemaUrl(version?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Load the ASTRA JSON Schema. Default source is
|
|
20
|
+
* `https://astra-spec.org/latest/schema/astra.schema.json`.
|
|
21
|
+
*
|
|
22
|
+
* Subsequent calls with the same URL hit an in-memory cache. With disk
|
|
23
|
+
* caching enabled (the default), the schema is also persisted under
|
|
24
|
+
* `<tmpdir>/astra-schema-cache` so future processes don't have to refetch.
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadAstraSchema(opts?: SchemaLoadOptions): Promise<JsonSchema>;
|
|
27
|
+
/** Install a pre-loaded schema in the in-memory cache. Useful for tests
|
|
28
|
+
* and for environments where the consumer prefers to manage fetching. */
|
|
29
|
+
export declare function setAstraSchema(schema: JsonSchema, opts?: {
|
|
30
|
+
url?: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
}): void;
|
|
33
|
+
/** Drop all cached schemas from memory. */
|
|
34
|
+
export declare function clearAstraSchemaCache(): void;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;IACjC,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,OAAO,SAAW,GAAG,MAAM,CAEzD;AAuBD;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC,CAoCvF;AAED;0EAC0E;AAC1E,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,IAAI,CAGtG;AAED,2CAA2C;AAC3C,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Schema loader. The package no longer bundles the JSON Schema —
|
|
2
|
+
// instead we fetch the frozen, versioned artifact from astra-spec.org
|
|
3
|
+
// (cached in memory, with an optional on-disk cache for repeat runs).
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
const _memoryCache = new Map();
|
|
10
|
+
export const ASTRA_SPEC_HOST = "https://astra-spec.org";
|
|
11
|
+
/** Build the canonical schema URL for a given version. */
|
|
12
|
+
export function astraSchemaUrl(version = "latest") {
|
|
13
|
+
return `${ASTRA_SPEC_HOST}/${version}/schema/astra.schema.json`;
|
|
14
|
+
}
|
|
15
|
+
function defaultCacheDir() {
|
|
16
|
+
return join(tmpdir(), "astra-schema-cache");
|
|
17
|
+
}
|
|
18
|
+
function cacheFileFor(url, dir) {
|
|
19
|
+
const hash = createHash("sha256").update(url).digest("hex").slice(0, 16);
|
|
20
|
+
return join(dir, `${hash}.json`);
|
|
21
|
+
}
|
|
22
|
+
async function readUrl(url) {
|
|
23
|
+
if (url.startsWith("file://")) {
|
|
24
|
+
const text = readFileSync(fileURLToPath(url), "utf8");
|
|
25
|
+
return JSON.parse(text);
|
|
26
|
+
}
|
|
27
|
+
const res = await fetch(url);
|
|
28
|
+
if (!res.ok) {
|
|
29
|
+
throw new Error(`Failed to fetch ASTRA schema from ${url}: HTTP ${res.status}`);
|
|
30
|
+
}
|
|
31
|
+
return (await res.json());
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load the ASTRA JSON Schema. Default source is
|
|
35
|
+
* `https://astra-spec.org/latest/schema/astra.schema.json`.
|
|
36
|
+
*
|
|
37
|
+
* Subsequent calls with the same URL hit an in-memory cache. With disk
|
|
38
|
+
* caching enabled (the default), the schema is also persisted under
|
|
39
|
+
* `<tmpdir>/astra-schema-cache` so future processes don't have to refetch.
|
|
40
|
+
*/
|
|
41
|
+
export async function loadAstraSchema(opts = {}) {
|
|
42
|
+
const url = opts.url ?? astraSchemaUrl(opts.version ?? "latest");
|
|
43
|
+
if (!opts.force) {
|
|
44
|
+
const cached = _memoryCache.get(url);
|
|
45
|
+
if (cached)
|
|
46
|
+
return cached;
|
|
47
|
+
}
|
|
48
|
+
const useDisk = opts.cacheDir !== null && opts.cacheDir !== false;
|
|
49
|
+
const cacheDir = typeof opts.cacheDir === "string" ? opts.cacheDir : defaultCacheDir();
|
|
50
|
+
const cachePath = useDisk ? cacheFileFor(url, cacheDir) : null;
|
|
51
|
+
if (cachePath && !opts.force) {
|
|
52
|
+
try {
|
|
53
|
+
const text = readFileSync(cachePath, "utf8");
|
|
54
|
+
const schema = JSON.parse(text);
|
|
55
|
+
_memoryCache.set(url, schema);
|
|
56
|
+
return schema;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Fall through to network fetch.
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const schema = await readUrl(url);
|
|
63
|
+
_memoryCache.set(url, schema);
|
|
64
|
+
if (cachePath) {
|
|
65
|
+
try {
|
|
66
|
+
mkdirSync(cacheDir, { recursive: true });
|
|
67
|
+
writeFileSync(cachePath, JSON.stringify(schema));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Best-effort cache; ignore write failures.
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return schema;
|
|
74
|
+
}
|
|
75
|
+
/** Install a pre-loaded schema in the in-memory cache. Useful for tests
|
|
76
|
+
* and for environments where the consumer prefers to manage fetching. */
|
|
77
|
+
export function setAstraSchema(schema, opts = {}) {
|
|
78
|
+
const url = opts.url ?? astraSchemaUrl(opts.version ?? "latest");
|
|
79
|
+
_memoryCache.set(url, schema);
|
|
80
|
+
}
|
|
81
|
+
/** Drop all cached schemas from memory. */
|
|
82
|
+
export function clearAstraSchemaCache() {
|
|
83
|
+
_memoryCache.clear();
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,sEAAsE;AACtE,sEAAsE;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAkBzC,MAAM,YAA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C,MAAM,CAAC,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,4CAA4C;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;0EAC0E;AAC1E,MAAM,UAAU,cAAc,CAAC,MAAkB,EAAE,OAA2C,EAAE;IAC9F,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC;IACjE,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,qBAAqB;IACnC,YAAY,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export type InputType = "data" | "analysis";
|
|
2
|
+
export type OutputType = "metric" | "figure" | "table" | "data" | "report";
|
|
3
|
+
export interface TextQuoteSelector {
|
|
4
|
+
exact: string;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
suffix?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FragmentSelector {
|
|
9
|
+
value?: string;
|
|
10
|
+
page?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface Evidence {
|
|
13
|
+
id: string;
|
|
14
|
+
doi?: string;
|
|
15
|
+
artifact?: string;
|
|
16
|
+
version?: number;
|
|
17
|
+
snapshot?: string;
|
|
18
|
+
source_commit?: string;
|
|
19
|
+
quote?: TextQuoteSelector;
|
|
20
|
+
location?: FragmentSelector;
|
|
21
|
+
}
|
|
22
|
+
export interface Insight {
|
|
23
|
+
id: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
claim: string;
|
|
26
|
+
created_at: string;
|
|
27
|
+
evidence: Evidence[];
|
|
28
|
+
derived?: boolean;
|
|
29
|
+
scope?: string;
|
|
30
|
+
tags?: string[];
|
|
31
|
+
notes?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface Resources {
|
|
34
|
+
cpus?: number;
|
|
35
|
+
memory?: string;
|
|
36
|
+
time_limit?: string;
|
|
37
|
+
disk?: string;
|
|
38
|
+
gpus?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface Recipe {
|
|
41
|
+
command?: string;
|
|
42
|
+
resources?: Resources;
|
|
43
|
+
container?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface Input {
|
|
46
|
+
id: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
type?: InputType;
|
|
49
|
+
description?: string;
|
|
50
|
+
source?: string;
|
|
51
|
+
ref?: string;
|
|
52
|
+
ref_version?: string;
|
|
53
|
+
use_outputs?: string[];
|
|
54
|
+
from?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface Output {
|
|
57
|
+
id: string;
|
|
58
|
+
label?: string;
|
|
59
|
+
type?: OutputType;
|
|
60
|
+
description?: string;
|
|
61
|
+
inputs?: string[];
|
|
62
|
+
decisions?: string[];
|
|
63
|
+
recipe?: Recipe;
|
|
64
|
+
from?: string;
|
|
65
|
+
when?: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface Option {
|
|
68
|
+
id?: string;
|
|
69
|
+
label: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
insights?: string[];
|
|
72
|
+
incompatible_with?: string[];
|
|
73
|
+
requires?: string[];
|
|
74
|
+
excluded?: boolean;
|
|
75
|
+
excluded_reason?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface Decision {
|
|
78
|
+
id?: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
rationale?: string;
|
|
81
|
+
tags?: string[];
|
|
82
|
+
default?: string;
|
|
83
|
+
options?: Record<string, Option>;
|
|
84
|
+
from?: string;
|
|
85
|
+
when?: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface Narrative {
|
|
88
|
+
summary?: string;
|
|
89
|
+
findings?: string;
|
|
90
|
+
methods?: string;
|
|
91
|
+
inputs?: string;
|
|
92
|
+
outputs?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface Analysis {
|
|
95
|
+
id?: string;
|
|
96
|
+
version?: string;
|
|
97
|
+
name?: string;
|
|
98
|
+
narrative?: Narrative;
|
|
99
|
+
authors?: string[];
|
|
100
|
+
tags?: string[];
|
|
101
|
+
inputs?: Input[];
|
|
102
|
+
outputs?: Output[];
|
|
103
|
+
decisions?: Record<string, Decision>;
|
|
104
|
+
prior_insights?: Record<string, Insight>;
|
|
105
|
+
findings?: Record<string, Insight>;
|
|
106
|
+
container?: string;
|
|
107
|
+
path?: string;
|
|
108
|
+
analyses?: Record<string, Analysis>;
|
|
109
|
+
}
|
|
110
|
+
export interface UniverseNode {
|
|
111
|
+
id?: string;
|
|
112
|
+
universe?: string;
|
|
113
|
+
decisions?: Record<string, string>;
|
|
114
|
+
analyses?: Record<string, UniverseNode>;
|
|
115
|
+
}
|
|
116
|
+
export interface Universe {
|
|
117
|
+
id: string;
|
|
118
|
+
description?: string;
|
|
119
|
+
decisions?: Record<string, string>;
|
|
120
|
+
analyses?: Record<string, UniverseNode>;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;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CAAC,CAAC;CACzC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Hand-curated TypeScript types matching the LinkML schema published at
|
|
2
|
+
// https://astra-spec.org/. The shapes are deliberately permissive (string
|
|
3
|
+
// IDs, optional fields) — strict structural checks happen in `validation`.
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=types.js.map
|