@inflexa-ai/harness 0.17.0 → 0.18.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/agents/report-builder.d.ts +2 -0
- package/dist/agents/report-builder.js +2 -0
- package/dist/app/spawn-report-session.d.ts +85 -0
- package/dist/app/spawn-report-session.js +83 -0
- package/dist/contracts/chat-events.d.ts +9 -0
- package/dist/contracts/index.d.ts +6 -2
- package/dist/contracts/index.js +3 -1
- package/dist/contracts/organ-system.d.ts +49 -0
- package/dist/contracts/organ-system.js +67 -0
- package/dist/contracts/report-blocks.d.ts +564 -0
- package/dist/contracts/report-blocks.js +117 -0
- package/dist/contracts/report-reference.d.ts +459 -0
- package/dist/contracts/report-reference.js +256 -0
- package/dist/contracts/schemas/chat-events.d.ts +2 -0
- package/dist/contracts/schemas/chat-events.js +2 -0
- package/dist/contracts/severity.d.ts +15 -0
- package/dist/contracts/severity.js +10 -0
- package/dist/contracts/target-dossier.d.ts +8675 -12972
- package/dist/contracts/target-dossier.js +534 -591
- package/dist/data/safety-panel-schema.d.ts +18 -5
- package/dist/data/safety-panel-schema.js +4 -4
- package/dist/execution/artifact-metadata.js +1 -0
- package/dist/execution/report-runner.js +1 -3
- package/dist/execution/run-synthesis.js +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +19 -0
- package/dist/lib/async-utils.d.ts +16 -4
- package/dist/lib/async-utils.js +20 -15
- package/dist/lib/host-concurrency.js +1 -0
- package/dist/loop/__fixtures__/scripted-provider.js +23 -2
- package/dist/loop/run-agent.js +58 -10
- package/dist/loop/tool-detail.d.ts +40 -0
- package/dist/loop/tool-detail.js +35 -3
- package/dist/loop/types.d.ts +13 -0
- package/dist/memory/thread-history.d.ts +10 -0
- package/dist/memory/thread-history.js +12 -1
- package/dist/prompts/target-assessment/briefs/executive-recommendation.d.ts +1 -1
- package/dist/prompts/target-assessment/briefs/executive-recommendation.js +5 -5
- package/dist/prompts/target-assessment/briefs/liability-bullets.d.ts +1 -1
- package/dist/prompts/target-assessment/briefs/liability-bullets.js +1 -1
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.d.ts +1 -1
- package/dist/prompts/target-assessment/briefs/target-organ-liabilities.js +11 -3
- package/dist/prompts/target-assessment/investigation/adversarial-critique.d.ts +1 -0
- package/dist/prompts/target-assessment/investigation/adversarial-critique.js +67 -0
- package/dist/prompts/target-assessment/investigation/claim-reverification.d.ts +1 -0
- package/dist/prompts/target-assessment/investigation/claim-reverification.js +49 -0
- package/dist/prompts/target-assessment/investigation/index.d.ts +3 -0
- package/dist/prompts/target-assessment/investigation/index.js +3 -0
- package/dist/prompts/target-assessment/investigation/mechanism-proposal.d.ts +1 -0
- package/dist/prompts/target-assessment/investigation/mechanism-proposal.js +49 -0
- package/dist/prompts/target-assessment/tox-voice/index.d.ts +1 -1
- package/dist/prompts/target-assessment/tox-voice/vocabulary.d.ts +8 -5
- package/dist/prompts/target-assessment/tox-voice/vocabulary.js +9 -20
- package/dist/providers/__fixtures__/session.d.ts +5 -4
- package/dist/providers/__fixtures__/session.js +4 -4
- package/dist/report-model/block-walk.d.ts +56 -0
- package/dist/report-model/block-walk.js +89 -0
- package/dist/report-model/draft-finish.d.ts +60 -0
- package/dist/report-model/draft-finish.js +56 -0
- package/dist/report-model/draft-operations.d.ts +125 -0
- package/dist/report-model/draft-operations.js +341 -0
- package/dist/report-model/draft-read.d.ts +59 -0
- package/dist/report-model/draft-read.js +109 -0
- package/dist/report-model/draft.d.ts +51 -0
- package/dist/report-model/draft.js +32 -0
- package/dist/report-model/fixture-resolver.d.ts +8 -0
- package/dist/report-model/fixture-resolver.js +252 -0
- package/dist/report-model/mint-snapshot.d.ts +30 -0
- package/dist/report-model/mint-snapshot.js +40 -0
- package/dist/report-model/reference-resolver.d.ts +113 -0
- package/dist/report-model/reference-resolver.js +60 -0
- package/dist/report-model/structural-validation.d.ts +22 -0
- package/dist/report-model/structural-validation.js +68 -0
- package/dist/report-model/validate.d.ts +40 -0
- package/dist/report-model/validate.js +80 -0
- package/dist/report-render/chart.d.ts +33 -0
- package/dist/report-render/chart.js +538 -0
- package/dist/report-render/page.d.ts +127 -0
- package/dist/report-render/page.js +307 -0
- package/dist/report-render/references.d.ts +32 -0
- package/dist/report-render/references.js +44 -0
- package/dist/report-render/render.d.ts +25 -0
- package/dist/report-render/render.js +125 -0
- package/dist/report-render/script-json.d.ts +13 -0
- package/dist/report-render/script-json.js +15 -0
- package/dist/report-render/types.d.ts +39 -0
- package/dist/report-render/types.js +10 -0
- package/dist/report-render/views/chart-view.d.ts +11 -0
- package/dist/report-render/views/chart-view.js +23 -0
- package/dist/report-render/views/page-view.d.ts +20 -0
- package/dist/report-render/views/page-view.js +49 -0
- package/dist/report-render/views/prose.d.ts +28 -0
- package/dist/report-render/views/prose.js +75 -0
- package/dist/report-render/views/references-view.d.ts +20 -0
- package/dist/report-render/views/references-view.js +64 -0
- package/dist/report-render/views/values.d.ts +42 -0
- package/dist/report-render/views/values.js +43 -0
- package/dist/runtime/boot.d.ts +3 -3
- package/dist/runtime/boot.js +15 -4
- package/dist/runtime/dbos.d.ts +4 -4
- package/dist/state/artifacts.d.ts +16 -0
- package/dist/state/artifacts.js +18 -0
- package/dist/state/init.js +31 -0
- package/dist/state/purge-analysis.js +1 -0
- package/dist/state/report-versions.d.ts +132 -0
- package/dist/state/report-versions.js +194 -0
- package/dist/tasks/data-profile.js +1 -0
- package/dist/tools/bio/chembl.js +1 -0
- package/dist/tools/bio/comptox.js +1 -0
- package/dist/tools/bio/drug-gene-interactions.js +1 -0
- package/dist/tools/bio/gene-disease-evidence.js +1 -0
- package/dist/tools/bio/gene-preclinical-profile.js +1 -0
- package/dist/tools/bio/keys.d.ts +3 -2
- package/dist/tools/bio/keys.js +3 -2
- package/dist/tools/bio/lookup-annotation.js +1 -0
- package/dist/tools/bio/opentargets.d.ts +3 -3
- package/dist/tools/bio/opentargets.js +4 -3
- package/dist/tools/bio/pubchem.js +1 -0
- package/dist/tools/bio/search-clinical-trials.js +1 -0
- package/dist/tools/bio/search-faers.js +1 -0
- package/dist/tools/bio/search-geo-datasets.js +1 -0
- package/dist/tools/bio/search-interactions.js +1 -0
- package/dist/tools/bio/target-safety.d.ts +4 -6
- package/dist/tools/bio/target-safety.js +7 -6
- package/dist/tools/define-tool.d.ts +19 -12
- package/dist/tools/define-tool.js +4 -2
- package/dist/tools/display/show-user.js +1 -0
- package/dist/tools/iterate-report.js +2 -0
- package/dist/tools/lib/chembl-client.d.ts +2 -0
- package/dist/tools/lib/chembl-client.js +1 -0
- package/dist/tools/lib/monarch-client.d.ts +42 -0
- package/dist/tools/lib/monarch-client.js +100 -0
- package/dist/tools/report/build-report.js +1 -0
- package/dist/tools/report/mint-preview-url.js +1 -0
- package/dist/tools/report/preview-snapshot.js +1 -0
- package/dist/tools/report/submit-report.js +1 -0
- package/dist/tools/report/version-fs.js +4 -0
- package/dist/tools/report-authoring/authoring-tools.d.ts +134 -0
- package/dist/tools/report-authoring/authoring-tools.js +352 -0
- package/dist/tools/research/context7-docs.js +2 -0
- package/dist/tools/research/generate-analogy-report.js +1 -0
- package/dist/tools/research/generate-plan.js +3 -0
- package/dist/tools/research/inspect-data-profile.js +4 -0
- package/dist/tools/research/literature-reviewer.js +1 -0
- package/dist/tools/research/search-arxiv.js +1 -0
- package/dist/tools/research/search-github-repos.js +1 -0
- package/dist/tools/research/search-semantic-scholar.js +1 -0
- package/dist/tools/sandbox/list-available-packages.js +23 -0
- package/dist/tools/sandbox/list-available-refs.js +36 -0
- package/dist/tools/sandbox/report-blocker.js +1 -0
- package/dist/tools/sandbox/skills.js +2 -0
- package/dist/tools/workspace/file-stat.js +1 -0
- package/dist/tools/workspace/show-file.js +2 -0
- package/dist/tools/workspace/show-plan.js +1 -0
- package/dist/workflows/execute-analysis.d.ts +5 -1
- package/dist/workflows/execute-analysis.js +5 -5
- package/dist/workflows/execute-target-assessment.d.ts +13 -2
- package/dist/workflows/execute-target-assessment.js +78 -16
- package/dist/workflows/target-assessment/assemblers/index.d.ts +1 -1
- package/dist/workflows/target-assessment/assemblers/index.js +1 -1
- package/dist/workflows/target-assessment/assemblers/literature.d.ts +9 -27
- package/dist/workflows/target-assessment/assemblers/literature.js +32 -48
- package/dist/workflows/target-assessment/assemblers/orchestrator.d.ts +17 -9
- package/dist/workflows/target-assessment/assemblers/orchestrator.js +195 -85
- package/dist/workflows/target-assessment/assemblers/safety.d.ts +70 -48
- package/dist/workflows/target-assessment/assemblers/safety.js +125 -42
- package/dist/workflows/target-assessment/collectors/index.d.ts +5 -2
- package/dist/workflows/target-assessment/collectors/index.js +48 -5
- package/dist/workflows/target-assessment/coverage.d.ts +43 -27
- package/dist/workflows/target-assessment/coverage.js +33 -29
- package/dist/workflows/target-assessment/fanout/index.js +1 -0
- package/dist/workflows/target-assessment/investigation/index.d.ts +97 -0
- package/dist/workflows/target-assessment/investigation/index.js +419 -0
- package/dist/workflows/target-assessment/lib/approval-precedents.d.ts +26 -5
- package/dist/workflows/target-assessment/lib/approval-precedents.js +95 -29
- package/dist/workflows/target-assessment/lib/citation-validator.js +1 -1
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.d.ts +2 -2
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.d.ts +2 -3
- package/dist/workflows/target-assessment/lib/clinical-evidence-attribution.js +0 -4
- package/dist/workflows/target-assessment/lib/compute-derived.d.ts +6 -5
- package/dist/workflows/target-assessment/lib/compute-derived.js +14 -5
- package/dist/workflows/target-assessment/lib/family-complex-supplement.d.ts +5 -6
- package/dist/workflows/target-assessment/lib/family-complex-supplement.js +2 -3
- package/dist/workflows/target-assessment/lib/fda-label-safety.d.ts +72 -0
- package/dist/workflows/target-assessment/lib/fda-label-safety.js +166 -0
- package/dist/workflows/target-assessment/lib/heterodimer-filter.d.ts +0 -9
- package/dist/workflows/target-assessment/lib/heterodimer-filter.js +0 -10
- package/dist/workflows/target-assessment/lib/hpo-organ-map.d.ts +34 -0
- package/dist/workflows/target-assessment/lib/hpo-organ-map.js +63 -0
- package/dist/workflows/target-assessment/lib/impc-organ-map.d.ts +19 -0
- package/dist/workflows/target-assessment/lib/impc-organ-map.js +39 -0
- package/dist/workflows/target-assessment/lib/meddra-organ-map.d.ts +24 -14
- package/dist/workflows/target-assessment/lib/meddra-organ-map.js +59 -47
- package/dist/workflows/target-assessment/lib/recommendation-sanitizer.js +1 -1
- package/dist/workflows/target-assessment/lib/regulatory-actions.d.ts +2 -3
- package/dist/workflows/target-assessment/lib/regulatory-actions.js +33 -4
- package/dist/workflows/target-assessment/lib/safety-corroboration.d.ts +44 -0
- package/dist/workflows/target-assessment/lib/safety-corroboration.js +273 -0
- package/dist/workflows/target-assessment/lib/target-identity-filter.d.ts +5 -7
- package/dist/workflows/target-assessment/lib/target-identity-filter.js +5 -7
- package/dist/workflows/target-assessment/metrics.d.ts +1 -6
- package/dist/workflows/target-assessment/metrics.js +1 -13
- package/dist/workflows/target-assessment/phase4-assemble.d.ts +2147 -807
- package/dist/workflows/target-assessment/phase4-assemble.js +19 -19
- package/dist/workflows/target-assessment/phase5-persist.d.ts +20 -21
- package/dist/workflows/target-assessment/phase5-persist.js +56 -173
- package/dist/workflows/target-assessment/schemas.d.ts +46 -1
- package/dist/workflows/target-assessment/schemas.js +19 -0
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.d.ts +1 -0
- package/dist/workflows/target-assessment/steps/fanout/polypharm-for-one-modulator-step.js +2 -0
- package/dist/workflows/target-assessment/steps/phase2-aggregate.d.ts +26 -62
- package/dist/workflows/target-assessment/steps/phase2-aggregate.js +0 -4
- package/dist/workflows/target-assessment/steps/phase3-aggregate.d.ts +27 -154
- package/dist/workflows/target-assessment/steps/phase3-aggregate.js +0 -6
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.d.ts +0 -6
- package/dist/workflows/target-assessment/steps/synthesis/diagnostics.js +0 -18
- package/dist/workflows/target-assessment/sub-workflows/per-modulator-polypharm.d.ts +1 -0
- package/dist/workflows/target-assessment/synthesis/index.d.ts +52 -5
- package/dist/workflows/target-assessment/synthesis/index.js +4 -1
- package/dist/workflows/target-assessment/synthesis-probes.d.ts +3 -3
- package/package.json +4 -1
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reference binds a report block to the evidence that justifies it. It is the one canonical way a
|
|
3
|
+
* block points at a value, a table, a derived quantity, or an external source.
|
|
4
|
+
*
|
|
5
|
+
* The reference lives here, in `contracts/`, because a consumer reads it back after a run. The consumer
|
|
6
|
+
* imports this module without the harness's own dependencies, thus it holds a reference as plain data.
|
|
7
|
+
*
|
|
8
|
+
* Resolution reads the evidence again at render time. The `assert` field is the authored belief, and
|
|
9
|
+
* the resolver matches the fresh read against it.
|
|
10
|
+
*/
|
|
11
|
+
import { type Result } from "neverthrow";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
/**
|
|
14
|
+
* A reference to one scalar value inside an artifact, addressed by a locator. It resolves to a scalar,
|
|
15
|
+
* thus it carries the value assert.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ArtifactValueReferenceSchema: z.ZodObject<{
|
|
18
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
19
|
+
format: z.ZodOptional<z.ZodString>;
|
|
20
|
+
locator: z.ZodObject<{
|
|
21
|
+
column: z.ZodString;
|
|
22
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
column: z.ZodString;
|
|
24
|
+
op: z.ZodLiteral<"eq">;
|
|
25
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
31
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
run: z.ZodOptional<z.ZodString>;
|
|
34
|
+
path: z.ZodString;
|
|
35
|
+
hash: z.ZodString;
|
|
36
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
37
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
/**
|
|
40
|
+
* A reference to a whole table artifact. It carries no locator, because it binds every row.
|
|
41
|
+
*
|
|
42
|
+
* It carries no assert. A table is not one value, thus the only belief that an author can hold about it
|
|
43
|
+
* is its bytes, and the pinned `hash` already carries that belief.
|
|
44
|
+
*/
|
|
45
|
+
export declare const ArtifactTableReferenceSchema: z.ZodObject<{
|
|
46
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
47
|
+
format: z.ZodOptional<z.ZodString>;
|
|
48
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
run: z.ZodOptional<z.ZodString>;
|
|
50
|
+
path: z.ZodString;
|
|
51
|
+
hash: z.ZodString;
|
|
52
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
53
|
+
kind: z.ZodLiteral<"artifact-table">;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
/**
|
|
56
|
+
* A reference to a whole artifact file, for example an image. It carries no locator and no columns,
|
|
57
|
+
* because a file is pinned whole and has no addressable cell inside it. It carries no assert, for the
|
|
58
|
+
* same reason as a table reference.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ArtifactFileReferenceSchema: z.ZodObject<{
|
|
61
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
62
|
+
format: z.ZodOptional<z.ZodString>;
|
|
63
|
+
run: z.ZodOptional<z.ZodString>;
|
|
64
|
+
path: z.ZodString;
|
|
65
|
+
hash: z.ZodString;
|
|
66
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
67
|
+
kind: z.ZodLiteral<"artifact-file">;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
/**
|
|
70
|
+
* A reference to an external source, addressed by an external identifier. It resolves to the prefixed
|
|
71
|
+
* key, thus its assert compares against that key and carries no hash.
|
|
72
|
+
*/
|
|
73
|
+
export declare const CitationReferenceSchema: z.ZodObject<{
|
|
74
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
75
|
+
format: z.ZodOptional<z.ZodString>;
|
|
76
|
+
kind: z.ZodLiteral<"citation">;
|
|
77
|
+
idKind: z.ZodEnum<{
|
|
78
|
+
doi: "doi";
|
|
79
|
+
pmid: "pmid";
|
|
80
|
+
arxiv: "arxiv";
|
|
81
|
+
}>;
|
|
82
|
+
id: z.ZodString;
|
|
83
|
+
raw: z.ZodString;
|
|
84
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
value: z.ZodString;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
/**
|
|
89
|
+
* The one reference kind that a derivation can consume.
|
|
90
|
+
*
|
|
91
|
+
* The arithmetic needs a scalar, and `artifact-value` is the only reference that resolves to one without
|
|
92
|
+
* itself being a derivation. A table, a file, and a citation resolve to something else, thus each is
|
|
93
|
+
* unrepresentable here rather than a parse that succeeds and then always fails at resolution. A
|
|
94
|
+
* derivation is out of the set too, thus a derivation over a derivation stays unrepresentable.
|
|
95
|
+
*/
|
|
96
|
+
export declare const DerivationInputReferenceSchema: z.ZodObject<{
|
|
97
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
98
|
+
format: z.ZodOptional<z.ZodString>;
|
|
99
|
+
locator: z.ZodObject<{
|
|
100
|
+
column: z.ZodString;
|
|
101
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
column: z.ZodString;
|
|
103
|
+
op: z.ZodLiteral<"eq">;
|
|
104
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
105
|
+
}, z.core.$strict>>;
|
|
106
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
}, z.core.$strict>;
|
|
108
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
110
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
run: z.ZodOptional<z.ZodString>;
|
|
113
|
+
path: z.ZodString;
|
|
114
|
+
hash: z.ZodString;
|
|
115
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
116
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
/**
|
|
119
|
+
* A reference to a value computed from other references. Each of the three operations takes two inputs,
|
|
120
|
+
* thus `inputs` holds exactly two scalar-resolving references and no other count is representable. The
|
|
121
|
+
* result is computed and not artifact-backed, thus its assert carries the value fields only.
|
|
122
|
+
*/
|
|
123
|
+
export declare const DerivationReferenceSchema: z.ZodObject<{
|
|
124
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
125
|
+
format: z.ZodOptional<z.ZodString>;
|
|
126
|
+
kind: z.ZodLiteral<"derivation">;
|
|
127
|
+
op: z.ZodEnum<{
|
|
128
|
+
ratio: "ratio";
|
|
129
|
+
delta: "delta";
|
|
130
|
+
pctChange: "pctChange";
|
|
131
|
+
}>;
|
|
132
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
133
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
134
|
+
format: z.ZodOptional<z.ZodString>;
|
|
135
|
+
locator: z.ZodObject<{
|
|
136
|
+
column: z.ZodString;
|
|
137
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
column: z.ZodString;
|
|
139
|
+
op: z.ZodLiteral<"eq">;
|
|
140
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
141
|
+
}, z.core.$strict>>;
|
|
142
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
146
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strict>>;
|
|
148
|
+
run: z.ZodOptional<z.ZodString>;
|
|
149
|
+
path: z.ZodString;
|
|
150
|
+
hash: z.ZodString;
|
|
151
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
152
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
153
|
+
}, z.core.$strict>>;
|
|
154
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
156
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
}, z.core.$strict>>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
/** The full reference union. A block binds to one of these. */
|
|
160
|
+
export declare const ReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
161
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
162
|
+
format: z.ZodOptional<z.ZodString>;
|
|
163
|
+
locator: z.ZodObject<{
|
|
164
|
+
column: z.ZodString;
|
|
165
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
column: z.ZodString;
|
|
167
|
+
op: z.ZodLiteral<"eq">;
|
|
168
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
169
|
+
}, z.core.$strict>>;
|
|
170
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
173
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
174
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
}, z.core.$strict>>;
|
|
176
|
+
run: z.ZodOptional<z.ZodString>;
|
|
177
|
+
path: z.ZodString;
|
|
178
|
+
hash: z.ZodString;
|
|
179
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
180
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
181
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
183
|
+
format: z.ZodOptional<z.ZodString>;
|
|
184
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
185
|
+
run: z.ZodOptional<z.ZodString>;
|
|
186
|
+
path: z.ZodString;
|
|
187
|
+
hash: z.ZodString;
|
|
188
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
189
|
+
kind: z.ZodLiteral<"artifact-table">;
|
|
190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
191
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
192
|
+
format: z.ZodOptional<z.ZodString>;
|
|
193
|
+
run: z.ZodOptional<z.ZodString>;
|
|
194
|
+
path: z.ZodString;
|
|
195
|
+
hash: z.ZodString;
|
|
196
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
197
|
+
kind: z.ZodLiteral<"artifact-file">;
|
|
198
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
199
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
200
|
+
format: z.ZodOptional<z.ZodString>;
|
|
201
|
+
kind: z.ZodLiteral<"derivation">;
|
|
202
|
+
op: z.ZodEnum<{
|
|
203
|
+
ratio: "ratio";
|
|
204
|
+
delta: "delta";
|
|
205
|
+
pctChange: "pctChange";
|
|
206
|
+
}>;
|
|
207
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
208
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
209
|
+
format: z.ZodOptional<z.ZodString>;
|
|
210
|
+
locator: z.ZodObject<{
|
|
211
|
+
column: z.ZodString;
|
|
212
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
213
|
+
column: z.ZodString;
|
|
214
|
+
op: z.ZodLiteral<"eq">;
|
|
215
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
216
|
+
}, z.core.$strict>>;
|
|
217
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
220
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
221
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
}, z.core.$strict>>;
|
|
223
|
+
run: z.ZodOptional<z.ZodString>;
|
|
224
|
+
path: z.ZodString;
|
|
225
|
+
hash: z.ZodString;
|
|
226
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
227
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
228
|
+
}, z.core.$strict>>;
|
|
229
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
231
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
234
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
235
|
+
format: z.ZodOptional<z.ZodString>;
|
|
236
|
+
kind: z.ZodLiteral<"citation">;
|
|
237
|
+
idKind: z.ZodEnum<{
|
|
238
|
+
doi: "doi";
|
|
239
|
+
pmid: "pmid";
|
|
240
|
+
arxiv: "arxiv";
|
|
241
|
+
}>;
|
|
242
|
+
id: z.ZodString;
|
|
243
|
+
raw: z.ZodString;
|
|
244
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
245
|
+
value: z.ZodString;
|
|
246
|
+
}, z.core.$strict>>;
|
|
247
|
+
}, z.core.$strict>], "kind">;
|
|
248
|
+
/**
|
|
249
|
+
* The references that resolve to one scalar value. A metric's value slot admits only these, thus no
|
|
250
|
+
* numeric literal can sit in the slot: the type admits a reference only.
|
|
251
|
+
*/
|
|
252
|
+
export declare const ScalarReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
253
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
254
|
+
format: z.ZodOptional<z.ZodString>;
|
|
255
|
+
locator: z.ZodObject<{
|
|
256
|
+
column: z.ZodString;
|
|
257
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
258
|
+
column: z.ZodString;
|
|
259
|
+
op: z.ZodLiteral<"eq">;
|
|
260
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
261
|
+
}, z.core.$strict>>;
|
|
262
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
265
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
266
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
267
|
+
}, z.core.$strict>>;
|
|
268
|
+
run: z.ZodOptional<z.ZodString>;
|
|
269
|
+
path: z.ZodString;
|
|
270
|
+
hash: z.ZodString;
|
|
271
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
272
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
273
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
274
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
275
|
+
format: z.ZodOptional<z.ZodString>;
|
|
276
|
+
kind: z.ZodLiteral<"derivation">;
|
|
277
|
+
op: z.ZodEnum<{
|
|
278
|
+
ratio: "ratio";
|
|
279
|
+
delta: "delta";
|
|
280
|
+
pctChange: "pctChange";
|
|
281
|
+
}>;
|
|
282
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
283
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
284
|
+
format: z.ZodOptional<z.ZodString>;
|
|
285
|
+
locator: z.ZodObject<{
|
|
286
|
+
column: z.ZodString;
|
|
287
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
column: z.ZodString;
|
|
289
|
+
op: z.ZodLiteral<"eq">;
|
|
290
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
291
|
+
}, z.core.$strict>>;
|
|
292
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
}, z.core.$strict>;
|
|
294
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
295
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
296
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
}, z.core.$strict>>;
|
|
298
|
+
run: z.ZodOptional<z.ZodString>;
|
|
299
|
+
path: z.ZodString;
|
|
300
|
+
hash: z.ZodString;
|
|
301
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
302
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
303
|
+
}, z.core.$strict>>;
|
|
304
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
305
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
306
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
}, z.core.$strict>], "kind">;
|
|
309
|
+
/**
|
|
310
|
+
* The reason that a reference did not resolve.
|
|
311
|
+
*
|
|
312
|
+
* Two of the reasons are easy to confuse. `artifact-missing` means that the snapshot holds no entry for
|
|
313
|
+
* the path. `unreadable-artifact` means that the entry exists, and that the resolver cannot read the
|
|
314
|
+
* artifact as a table. Two conditions give the second reason. The file type refuses a read of a cell, or
|
|
315
|
+
* the bytes are unrecoverable.
|
|
316
|
+
*/
|
|
317
|
+
export declare const UnresolvedReasonSchema: z.ZodEnum<{
|
|
318
|
+
"artifact-missing": "artifact-missing";
|
|
319
|
+
"hash-mismatch": "hash-mismatch";
|
|
320
|
+
"locator-out-of-range": "locator-out-of-range";
|
|
321
|
+
"ambiguous-match": "ambiguous-match";
|
|
322
|
+
"assertion-failed": "assertion-failed";
|
|
323
|
+
"unreadable-artifact": "unreadable-artifact";
|
|
324
|
+
}>;
|
|
325
|
+
/** A reference that resolution could not bind, with the reason and an optional detail. */
|
|
326
|
+
export declare const UnresolvedReferenceSchema: z.ZodObject<{
|
|
327
|
+
reference: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
328
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
329
|
+
format: z.ZodOptional<z.ZodString>;
|
|
330
|
+
locator: z.ZodObject<{
|
|
331
|
+
column: z.ZodString;
|
|
332
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
333
|
+
column: z.ZodString;
|
|
334
|
+
op: z.ZodLiteral<"eq">;
|
|
335
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
336
|
+
}, z.core.$strict>>;
|
|
337
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
}, z.core.$strict>;
|
|
339
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
340
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
341
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
342
|
+
}, z.core.$strict>>;
|
|
343
|
+
run: z.ZodOptional<z.ZodString>;
|
|
344
|
+
path: z.ZodString;
|
|
345
|
+
hash: z.ZodString;
|
|
346
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
347
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
348
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
349
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
350
|
+
format: z.ZodOptional<z.ZodString>;
|
|
351
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
352
|
+
run: z.ZodOptional<z.ZodString>;
|
|
353
|
+
path: z.ZodString;
|
|
354
|
+
hash: z.ZodString;
|
|
355
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
356
|
+
kind: z.ZodLiteral<"artifact-table">;
|
|
357
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
358
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
359
|
+
format: z.ZodOptional<z.ZodString>;
|
|
360
|
+
run: z.ZodOptional<z.ZodString>;
|
|
361
|
+
path: z.ZodString;
|
|
362
|
+
hash: z.ZodString;
|
|
363
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
364
|
+
kind: z.ZodLiteral<"artifact-file">;
|
|
365
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
366
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
367
|
+
format: z.ZodOptional<z.ZodString>;
|
|
368
|
+
kind: z.ZodLiteral<"derivation">;
|
|
369
|
+
op: z.ZodEnum<{
|
|
370
|
+
ratio: "ratio";
|
|
371
|
+
delta: "delta";
|
|
372
|
+
pctChange: "pctChange";
|
|
373
|
+
}>;
|
|
374
|
+
inputs: z.ZodArray<z.ZodObject<{
|
|
375
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
376
|
+
format: z.ZodOptional<z.ZodString>;
|
|
377
|
+
locator: z.ZodObject<{
|
|
378
|
+
column: z.ZodString;
|
|
379
|
+
rowFilter: z.ZodOptional<z.ZodObject<{
|
|
380
|
+
column: z.ZodString;
|
|
381
|
+
op: z.ZodLiteral<"eq">;
|
|
382
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
383
|
+
}, z.core.$strict>>;
|
|
384
|
+
row: z.ZodOptional<z.ZodNumber>;
|
|
385
|
+
}, z.core.$strict>;
|
|
386
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
387
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
388
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
}, z.core.$strict>>;
|
|
390
|
+
run: z.ZodOptional<z.ZodString>;
|
|
391
|
+
path: z.ZodString;
|
|
392
|
+
hash: z.ZodString;
|
|
393
|
+
snapshot: z.ZodOptional<z.ZodString>;
|
|
394
|
+
kind: z.ZodLiteral<"artifact-value">;
|
|
395
|
+
}, z.core.$strict>>;
|
|
396
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
397
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
398
|
+
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
399
|
+
}, z.core.$strict>>;
|
|
400
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
401
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
402
|
+
format: z.ZodOptional<z.ZodString>;
|
|
403
|
+
kind: z.ZodLiteral<"citation">;
|
|
404
|
+
idKind: z.ZodEnum<{
|
|
405
|
+
doi: "doi";
|
|
406
|
+
pmid: "pmid";
|
|
407
|
+
arxiv: "arxiv";
|
|
408
|
+
}>;
|
|
409
|
+
id: z.ZodString;
|
|
410
|
+
raw: z.ZodString;
|
|
411
|
+
assert: z.ZodOptional<z.ZodObject<{
|
|
412
|
+
value: z.ZodString;
|
|
413
|
+
}, z.core.$strict>>;
|
|
414
|
+
}, z.core.$strict>], "kind">;
|
|
415
|
+
reason: z.ZodEnum<{
|
|
416
|
+
"artifact-missing": "artifact-missing";
|
|
417
|
+
"hash-mismatch": "hash-mismatch";
|
|
418
|
+
"locator-out-of-range": "locator-out-of-range";
|
|
419
|
+
"ambiguous-match": "ambiguous-match";
|
|
420
|
+
"assertion-failed": "assertion-failed";
|
|
421
|
+
"unreadable-artifact": "unreadable-artifact";
|
|
422
|
+
}>;
|
|
423
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
424
|
+
}, z.core.$strict>;
|
|
425
|
+
export type ArtifactValueReference = z.infer<typeof ArtifactValueReferenceSchema>;
|
|
426
|
+
export type ArtifactTableReference = z.infer<typeof ArtifactTableReferenceSchema>;
|
|
427
|
+
export type ArtifactFileReference = z.infer<typeof ArtifactFileReferenceSchema>;
|
|
428
|
+
export type CitationReference = z.infer<typeof CitationReferenceSchema>;
|
|
429
|
+
export type DerivationInputReference = z.infer<typeof DerivationInputReferenceSchema>;
|
|
430
|
+
export type DerivationReference = z.infer<typeof DerivationReferenceSchema>;
|
|
431
|
+
export type Reference = z.infer<typeof ReferenceSchema>;
|
|
432
|
+
export type ScalarReference = z.infer<typeof ScalarReferenceSchema>;
|
|
433
|
+
export type UnresolvedReason = z.infer<typeof UnresolvedReasonSchema>;
|
|
434
|
+
export type UnresolvedReference = z.infer<typeof UnresolvedReferenceSchema>;
|
|
435
|
+
/**
|
|
436
|
+
* Serialize a reference to a canonical URI.
|
|
437
|
+
*
|
|
438
|
+
* The payload is an opaque base64url of the canonical JSON, and not a structured URI with a field for
|
|
439
|
+
* each property. The reference object is the source of truth. A structured URI re-parses field by
|
|
440
|
+
* field, and it drifts from the object as the shape grows. An opaque payload cannot drift, because it
|
|
441
|
+
* round-trips the whole object.
|
|
442
|
+
*/
|
|
443
|
+
export declare function serializeReference(reference: Reference): string;
|
|
444
|
+
/**
|
|
445
|
+
* The reason that a reference URI did not parse. Each of the four modes is distinct: a wrong prefix, a
|
|
446
|
+
* payload that is empty or holds a character outside the base64url alphabet, JSON that does not parse,
|
|
447
|
+
* and a value that the schema rejects. A caller reads the `kind` to tell them apart. `detail` carries no
|
|
448
|
+
* secret, thus a schema mismatch gives the kind alone.
|
|
449
|
+
*/
|
|
450
|
+
export type ParseReferenceError = {
|
|
451
|
+
kind: "bad-prefix" | "invalid-payload" | "invalid-json" | "schema-mismatch";
|
|
452
|
+
detail?: string;
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* Parse a reference URI. Each failure mode gives its own `Err` `kind`, thus a caller tells a wrong
|
|
456
|
+
* prefix from malformed bytes, malformed JSON, and a schema mismatch. This function never throws, thus a
|
|
457
|
+
* caller treats a failed parse as a normal condition.
|
|
458
|
+
*/
|
|
459
|
+
export declare function parseReference(uri: string): Result<Reference, ParseReferenceError>;
|