@qmilab/lodestar-core 0.1.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/LICENSE +216 -0
- package/README.md +87 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +20 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +57 -0
- package/dist/registry.js.map +1 -0
- package/dist/schemas/action.d.ts +378 -0
- package/dist/schemas/action.d.ts.map +1 -0
- package/dist/schemas/action.js +122 -0
- package/dist/schemas/action.js.map +1 -0
- package/dist/schemas/actor.d.ts +87 -0
- package/dist/schemas/actor.d.ts.map +1 -0
- package/dist/schemas/actor.js +48 -0
- package/dist/schemas/actor.js.map +1 -0
- package/dist/schemas/belief.d.ts +141 -0
- package/dist/schemas/belief.d.ts.map +1 -0
- package/dist/schemas/belief.js +107 -0
- package/dist/schemas/belief.js.map +1 -0
- package/dist/schemas/claim.d.ts +234 -0
- package/dist/schemas/claim.d.ts.map +1 -0
- package/dist/schemas/claim.js +88 -0
- package/dist/schemas/claim.js.map +1 -0
- package/dist/schemas/common.d.ts +73 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +45 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/decision.d.ts +102 -0
- package/dist/schemas/decision.d.ts.map +1 -0
- package/dist/schemas/decision.js +37 -0
- package/dist/schemas/decision.js.map +1 -0
- package/dist/schemas/event.d.ts +171 -0
- package/dist/schemas/event.d.ts.map +1 -0
- package/dist/schemas/event.js +55 -0
- package/dist/schemas/event.js.map +1 -0
- package/dist/schemas/observation.d.ts +88 -0
- package/dist/schemas/observation.d.ts.map +1 -0
- package/dist/schemas/observation.js +39 -0
- package/dist/schemas/observation.js.map +1 -0
- package/dist/schemas/revision.d.ts +120 -0
- package/dist/schemas/revision.d.ts.map +1 -0
- package/dist/schemas/revision.js +72 -0
- package/dist/schemas/revision.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TruthStatusSchema: z.ZodEnum<["unverified", "supported", "contradicted", "superseded"]>;
|
|
3
|
+
export type TruthStatus = z.infer<typeof TruthStatusSchema>;
|
|
4
|
+
export declare const RetrievalStatusSchema: z.ZodEnum<["hidden", "restricted", "normal", "privileged_only", "blocked"]>;
|
|
5
|
+
export type RetrievalStatus = z.infer<typeof RetrievalStatusSchema>;
|
|
6
|
+
export declare const SecurityStatusSchema: z.ZodEnum<["clean", "suspicious", "quarantined", "malicious"]>;
|
|
7
|
+
export type SecurityStatus = z.infer<typeof SecurityStatusSchema>;
|
|
8
|
+
export declare const FreshnessStatusSchema: z.ZodEnum<["fresh", "stale", "expired"]>;
|
|
9
|
+
export type FreshnessStatus = z.infer<typeof FreshnessStatusSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* How a belief came to be adopted.
|
|
12
|
+
*
|
|
13
|
+
* - observed: derived from tool observations
|
|
14
|
+
* - inferred: derived by an LLM from other context
|
|
15
|
+
* - user_asserted: user said so directly
|
|
16
|
+
* - policy_asserted: policy configuration (e.g. "do not push to main")
|
|
17
|
+
* - imported: from an external knowledge import
|
|
18
|
+
* - synthetic: from a probe; never affects real reasoning
|
|
19
|
+
*
|
|
20
|
+
* user_asserted and policy_asserted beliefs do NOT decay like
|
|
21
|
+
* observations. They expire only via explicit revision.
|
|
22
|
+
*/
|
|
23
|
+
export declare const BeliefAuthoritySchema: z.ZodEnum<["observed", "inferred", "user_asserted", "policy_asserted", "imported", "synthetic"]>;
|
|
24
|
+
export type BeliefAuthority = z.infer<typeof BeliefAuthoritySchema>;
|
|
25
|
+
/**
|
|
26
|
+
* A claim the system has provisionally adopted.
|
|
27
|
+
*
|
|
28
|
+
* Every belief points to a claim (`claim_id`). The belief carries
|
|
29
|
+
* lifecycle state, confidence, calibration class, scope, sensitivity,
|
|
30
|
+
* and authority. The claim carries the statement itself.
|
|
31
|
+
*
|
|
32
|
+
* Confidence is the agent's stated confidence. The Calibrator measures
|
|
33
|
+
* empirical accuracy per calibration_class and can require the Policy
|
|
34
|
+
* Kernel to downweight confidence in classes where the agent is
|
|
35
|
+
* historically overconfident.
|
|
36
|
+
*/
|
|
37
|
+
export declare const BeliefSchema: z.ZodObject<{
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
claim_id: z.ZodString;
|
|
40
|
+
confidence: z.ZodNumber;
|
|
41
|
+
calibration_class: z.ZodString;
|
|
42
|
+
scope: z.ZodObject<{
|
|
43
|
+
level: z.ZodEnum<["global", "organization", "user", "project", "repo", "session"]>;
|
|
44
|
+
identifier: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
47
|
+
identifier: string;
|
|
48
|
+
}, {
|
|
49
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
50
|
+
identifier: string;
|
|
51
|
+
}>;
|
|
52
|
+
sensitivity: z.ZodEnum<["public", "internal", "confidential", "secret"]>;
|
|
53
|
+
authority: z.ZodEnum<["observed", "inferred", "user_asserted", "policy_asserted", "imported", "synthetic"]>;
|
|
54
|
+
truth_status: z.ZodEnum<["unverified", "supported", "contradicted", "superseded"]>;
|
|
55
|
+
retrieval_status: z.ZodEnum<["hidden", "restricted", "normal", "privileged_only", "blocked"]>;
|
|
56
|
+
security_status: z.ZodEnum<["clean", "suspicious", "quarantined", "malicious"]>;
|
|
57
|
+
freshness_status: z.ZodEnum<["fresh", "stale", "expired"]>;
|
|
58
|
+
observed_at: z.ZodString;
|
|
59
|
+
last_verified_at: z.ZodOptional<z.ZodString>;
|
|
60
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
61
|
+
superseded_by: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
id: string;
|
|
64
|
+
sensitivity: "public" | "internal" | "confidential" | "secret";
|
|
65
|
+
scope: {
|
|
66
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
67
|
+
identifier: string;
|
|
68
|
+
};
|
|
69
|
+
claim_id: string;
|
|
70
|
+
confidence: number;
|
|
71
|
+
calibration_class: string;
|
|
72
|
+
authority: "imported" | "synthetic" | "observed" | "inferred" | "user_asserted" | "policy_asserted";
|
|
73
|
+
truth_status: "unverified" | "supported" | "contradicted" | "superseded";
|
|
74
|
+
retrieval_status: "hidden" | "restricted" | "normal" | "privileged_only" | "blocked";
|
|
75
|
+
security_status: "clean" | "suspicious" | "quarantined" | "malicious";
|
|
76
|
+
freshness_status: "fresh" | "stale" | "expired";
|
|
77
|
+
observed_at: string;
|
|
78
|
+
last_verified_at?: string | undefined;
|
|
79
|
+
expires_at?: string | undefined;
|
|
80
|
+
superseded_by?: string | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
id: string;
|
|
83
|
+
sensitivity: "public" | "internal" | "confidential" | "secret";
|
|
84
|
+
scope: {
|
|
85
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
86
|
+
identifier: string;
|
|
87
|
+
};
|
|
88
|
+
claim_id: string;
|
|
89
|
+
confidence: number;
|
|
90
|
+
calibration_class: string;
|
|
91
|
+
authority: "imported" | "synthetic" | "observed" | "inferred" | "user_asserted" | "policy_asserted";
|
|
92
|
+
truth_status: "unverified" | "supported" | "contradicted" | "superseded";
|
|
93
|
+
retrieval_status: "hidden" | "restricted" | "normal" | "privileged_only" | "blocked";
|
|
94
|
+
security_status: "clean" | "suspicious" | "quarantined" | "malicious";
|
|
95
|
+
freshness_status: "fresh" | "stale" | "expired";
|
|
96
|
+
observed_at: string;
|
|
97
|
+
last_verified_at?: string | undefined;
|
|
98
|
+
expires_at?: string | undefined;
|
|
99
|
+
superseded_by?: string | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
export type Belief = z.infer<typeof BeliefSchema>;
|
|
102
|
+
export declare const ContextPolicySchema: z.ZodObject<{
|
|
103
|
+
allowed_truth_statuses: z.ZodArray<z.ZodEnum<["unverified", "supported", "contradicted", "superseded"]>, "many">;
|
|
104
|
+
allowed_retrieval_statuses: z.ZodArray<z.ZodEnum<["hidden", "restricted", "normal", "privileged_only", "blocked"]>, "many">;
|
|
105
|
+
allowed_security_statuses: z.ZodArray<z.ZodEnum<["clean", "suspicious", "quarantined", "malicious"]>, "many">;
|
|
106
|
+
freshness_max_age: z.ZodOptional<z.ZodString>;
|
|
107
|
+
sensitivity_ceiling: z.ZodEnum<["public", "internal", "confidential", "secret"]>;
|
|
108
|
+
include_contradictions: z.ZodBoolean;
|
|
109
|
+
include_uncertainties: z.ZodBoolean;
|
|
110
|
+
require_evidence_for_decisions: z.ZodBoolean;
|
|
111
|
+
user_asserted_takes_priority: z.ZodBoolean;
|
|
112
|
+
policy_asserted_takes_priority: z.ZodBoolean;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
allowed_truth_statuses: ("unverified" | "supported" | "contradicted" | "superseded")[];
|
|
115
|
+
allowed_retrieval_statuses: ("hidden" | "restricted" | "normal" | "privileged_only" | "blocked")[];
|
|
116
|
+
allowed_security_statuses: ("clean" | "suspicious" | "quarantined" | "malicious")[];
|
|
117
|
+
sensitivity_ceiling: "public" | "internal" | "confidential" | "secret";
|
|
118
|
+
include_contradictions: boolean;
|
|
119
|
+
include_uncertainties: boolean;
|
|
120
|
+
require_evidence_for_decisions: boolean;
|
|
121
|
+
user_asserted_takes_priority: boolean;
|
|
122
|
+
policy_asserted_takes_priority: boolean;
|
|
123
|
+
freshness_max_age?: string | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
allowed_truth_statuses: ("unverified" | "supported" | "contradicted" | "superseded")[];
|
|
126
|
+
allowed_retrieval_statuses: ("hidden" | "restricted" | "normal" | "privileged_only" | "blocked")[];
|
|
127
|
+
allowed_security_statuses: ("clean" | "suspicious" | "quarantined" | "malicious")[];
|
|
128
|
+
sensitivity_ceiling: "public" | "internal" | "confidential" | "secret";
|
|
129
|
+
include_contradictions: boolean;
|
|
130
|
+
include_uncertainties: boolean;
|
|
131
|
+
require_evidence_for_decisions: boolean;
|
|
132
|
+
user_asserted_takes_priority: boolean;
|
|
133
|
+
policy_asserted_takes_priority: boolean;
|
|
134
|
+
freshness_max_age?: string | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
export type ContextPolicy = z.infer<typeof ContextPolicySchema>;
|
|
137
|
+
/**
|
|
138
|
+
* Conservative v0 default. Tightens up as the system proves itself.
|
|
139
|
+
*/
|
|
140
|
+
export declare const DEFAULT_CONTEXT_POLICY: ContextPolicy;
|
|
141
|
+
//# sourceMappingURL=belief.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"belief.d.ts","sourceRoot":"","sources":["../../src/schemas/belief.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAkBvB,eAAO,MAAM,iBAAiB,sEAAoE,CAAA;AAClG,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,qBAAqB,6EAA2E,CAAA;AAC7G,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,oBAAoB,gEAA8D,CAAA;AAC/F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,qBAAqB,0CAAwC,CAAA;AAC1E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,kGAOhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBvB,CAAA;AACF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAWjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAWpC,CAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DurationSchema, ResourceScopeSchema, SensitivitySchema, TimestampSchema, } from "./common";
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
// Orthogonal lifecycle axes
|
|
5
|
+
//
|
|
6
|
+
// A belief's state is described by four independent dimensions. Collapsing
|
|
7
|
+
// them into a single enum is the wrong abstraction: a belief can be
|
|
8
|
+
// "supported but stale", "supported but quarantined", "contradicted but
|
|
9
|
+
// fresh", and so on. The axes are independently updated and independently
|
|
10
|
+
// gate retrieval.
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
export const TruthStatusSchema = z.enum(["unverified", "supported", "contradicted", "superseded"]);
|
|
13
|
+
export const RetrievalStatusSchema = z.enum(["hidden", "restricted", "normal", "privileged_only", "blocked"]);
|
|
14
|
+
export const SecurityStatusSchema = z.enum(["clean", "suspicious", "quarantined", "malicious"]);
|
|
15
|
+
export const FreshnessStatusSchema = z.enum(["fresh", "stale", "expired"]);
|
|
16
|
+
/**
|
|
17
|
+
* How a belief came to be adopted.
|
|
18
|
+
*
|
|
19
|
+
* - observed: derived from tool observations
|
|
20
|
+
* - inferred: derived by an LLM from other context
|
|
21
|
+
* - user_asserted: user said so directly
|
|
22
|
+
* - policy_asserted: policy configuration (e.g. "do not push to main")
|
|
23
|
+
* - imported: from an external knowledge import
|
|
24
|
+
* - synthetic: from a probe; never affects real reasoning
|
|
25
|
+
*
|
|
26
|
+
* user_asserted and policy_asserted beliefs do NOT decay like
|
|
27
|
+
* observations. They expire only via explicit revision.
|
|
28
|
+
*/
|
|
29
|
+
export const BeliefAuthoritySchema = z.enum([
|
|
30
|
+
"observed",
|
|
31
|
+
"inferred",
|
|
32
|
+
"user_asserted",
|
|
33
|
+
"policy_asserted",
|
|
34
|
+
"imported",
|
|
35
|
+
"synthetic",
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* A claim the system has provisionally adopted.
|
|
39
|
+
*
|
|
40
|
+
* Every belief points to a claim (`claim_id`). The belief carries
|
|
41
|
+
* lifecycle state, confidence, calibration class, scope, sensitivity,
|
|
42
|
+
* and authority. The claim carries the statement itself.
|
|
43
|
+
*
|
|
44
|
+
* Confidence is the agent's stated confidence. The Calibrator measures
|
|
45
|
+
* empirical accuracy per calibration_class and can require the Policy
|
|
46
|
+
* Kernel to downweight confidence in classes where the agent is
|
|
47
|
+
* historically overconfident.
|
|
48
|
+
*/
|
|
49
|
+
export const BeliefSchema = z.object({
|
|
50
|
+
id: z.string(),
|
|
51
|
+
claim_id: z.string(),
|
|
52
|
+
confidence: z.number().min(0).max(1),
|
|
53
|
+
calibration_class: z.string().describe("groups similar beliefs for calibrator"),
|
|
54
|
+
scope: ResourceScopeSchema,
|
|
55
|
+
sensitivity: SensitivitySchema,
|
|
56
|
+
authority: BeliefAuthoritySchema,
|
|
57
|
+
// Orthogonal lifecycle axes
|
|
58
|
+
truth_status: TruthStatusSchema,
|
|
59
|
+
retrieval_status: RetrievalStatusSchema,
|
|
60
|
+
security_status: SecurityStatusSchema,
|
|
61
|
+
freshness_status: FreshnessStatusSchema,
|
|
62
|
+
observed_at: TimestampSchema,
|
|
63
|
+
last_verified_at: TimestampSchema.optional(),
|
|
64
|
+
expires_at: TimestampSchema.optional(),
|
|
65
|
+
superseded_by: z.string().optional().describe("belief_id of successor"),
|
|
66
|
+
});
|
|
67
|
+
// -----------------------------------------------------------------------------
|
|
68
|
+
// ContextPolicy
|
|
69
|
+
//
|
|
70
|
+
// What the cognitive core may load into model context. Without an explicit
|
|
71
|
+
// policy, "the planner used a stale belief" or "the explanation leaked a
|
|
72
|
+
// secret claim" become invisible bugs. With it, those become testable
|
|
73
|
+
// invariants.
|
|
74
|
+
// -----------------------------------------------------------------------------
|
|
75
|
+
export const ContextPolicySchema = z.object({
|
|
76
|
+
// Which lifecycle states may be loaded
|
|
77
|
+
allowed_truth_statuses: z.array(TruthStatusSchema),
|
|
78
|
+
allowed_retrieval_statuses: z.array(RetrievalStatusSchema),
|
|
79
|
+
allowed_security_statuses: z.array(SecurityStatusSchema),
|
|
80
|
+
// Freshness gate
|
|
81
|
+
freshness_max_age: DurationSchema.optional(),
|
|
82
|
+
// Sensitivity ceiling for what can enter context
|
|
83
|
+
sensitivity_ceiling: SensitivitySchema,
|
|
84
|
+
// What the planner sees
|
|
85
|
+
include_contradictions: z.boolean(),
|
|
86
|
+
include_uncertainties: z.boolean(),
|
|
87
|
+
require_evidence_for_decisions: z.boolean(),
|
|
88
|
+
// Authority handling
|
|
89
|
+
user_asserted_takes_priority: z.boolean(),
|
|
90
|
+
policy_asserted_takes_priority: z.boolean(),
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* Conservative v0 default. Tightens up as the system proves itself.
|
|
94
|
+
*/
|
|
95
|
+
export const DEFAULT_CONTEXT_POLICY = {
|
|
96
|
+
allowed_truth_statuses: ["supported"],
|
|
97
|
+
allowed_retrieval_statuses: ["normal"],
|
|
98
|
+
allowed_security_statuses: ["clean"],
|
|
99
|
+
freshness_max_age: "P30D",
|
|
100
|
+
sensitivity_ceiling: "internal",
|
|
101
|
+
include_contradictions: true,
|
|
102
|
+
include_uncertainties: true,
|
|
103
|
+
require_evidence_for_decisions: true,
|
|
104
|
+
user_asserted_takes_priority: true,
|
|
105
|
+
policy_asserted_takes_priority: true,
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=belief.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"belief.js","sourceRoot":"","sources":["../../src/schemas/belief.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* How a claim was extracted from observation(s).
|
|
4
|
+
*/
|
|
5
|
+
export declare const ExtractionMethodSchema: z.ZodEnum<["tool", "llm", "human", "import"]>;
|
|
6
|
+
export type ExtractionMethod = z.infer<typeof ExtractionMethodSchema>;
|
|
7
|
+
/**
|
|
8
|
+
* Lifecycle of a claim before it becomes a belief.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ClaimStatusSchema: z.ZodEnum<["extracted", "contested", "accepted", "rejected"]>;
|
|
11
|
+
export type ClaimStatus = z.infer<typeof ClaimStatusSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Dissent recorded against a claim. Reserved for multi-agent futures;
|
|
14
|
+
* v0 captures it but the resolution algorithm is deferred.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DissentSchema: z.ZodObject<{
|
|
17
|
+
by_actor_id: z.ZodString;
|
|
18
|
+
reason: z.ZodString;
|
|
19
|
+
at: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
at: string;
|
|
22
|
+
by_actor_id: string;
|
|
23
|
+
reason: string;
|
|
24
|
+
}, {
|
|
25
|
+
at: string;
|
|
26
|
+
by_actor_id: string;
|
|
27
|
+
reason: string;
|
|
28
|
+
}>;
|
|
29
|
+
export type Dissent = z.infer<typeof DissentSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* A statement extracted from one or more observations.
|
|
32
|
+
*
|
|
33
|
+
* Claims are the second link in the epistemic chain. Every claim
|
|
34
|
+
* records its extraction method and the actor that extracted it,
|
|
35
|
+
* so the source of an eventual belief can always be traced back to
|
|
36
|
+
* the original observation(s).
|
|
37
|
+
*/
|
|
38
|
+
export declare const ClaimSchema: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
statement: z.ZodString;
|
|
41
|
+
structured_predicate: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
subject: z.ZodString;
|
|
43
|
+
relation: z.ZodString;
|
|
44
|
+
object: z.ZodUnknown;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
subject: string;
|
|
47
|
+
relation: string;
|
|
48
|
+
object?: unknown;
|
|
49
|
+
}, {
|
|
50
|
+
subject: string;
|
|
51
|
+
relation: string;
|
|
52
|
+
object?: unknown;
|
|
53
|
+
}>>;
|
|
54
|
+
source_observation_ids: z.ZodArray<z.ZodString, "many">;
|
|
55
|
+
extraction_method: z.ZodEnum<["tool", "llm", "human", "import"]>;
|
|
56
|
+
extracted_by: z.ZodString;
|
|
57
|
+
status: z.ZodEnum<["extracted", "contested", "accepted", "rejected"]>;
|
|
58
|
+
scope: z.ZodObject<{
|
|
59
|
+
level: z.ZodEnum<["global", "organization", "user", "project", "repo", "session"]>;
|
|
60
|
+
identifier: z.ZodString;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
63
|
+
identifier: string;
|
|
64
|
+
}, {
|
|
65
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
66
|
+
identifier: string;
|
|
67
|
+
}>;
|
|
68
|
+
sensitivity: z.ZodEnum<["public", "internal", "confidential", "secret"]>;
|
|
69
|
+
authors: z.ZodArray<z.ZodString, "many">;
|
|
70
|
+
dissent: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
|
+
by_actor_id: z.ZodString;
|
|
72
|
+
reason: z.ZodString;
|
|
73
|
+
at: z.ZodString;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
at: string;
|
|
76
|
+
by_actor_id: string;
|
|
77
|
+
reason: string;
|
|
78
|
+
}, {
|
|
79
|
+
at: string;
|
|
80
|
+
by_actor_id: string;
|
|
81
|
+
reason: string;
|
|
82
|
+
}>, "many">>;
|
|
83
|
+
created_at: z.ZodString;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
status: "extracted" | "contested" | "accepted" | "rejected";
|
|
86
|
+
id: string;
|
|
87
|
+
created_at: string;
|
|
88
|
+
sensitivity: "public" | "internal" | "confidential" | "secret";
|
|
89
|
+
statement: string;
|
|
90
|
+
source_observation_ids: string[];
|
|
91
|
+
extraction_method: "human" | "tool" | "llm" | "import";
|
|
92
|
+
extracted_by: string;
|
|
93
|
+
scope: {
|
|
94
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
95
|
+
identifier: string;
|
|
96
|
+
};
|
|
97
|
+
authors: string[];
|
|
98
|
+
structured_predicate?: {
|
|
99
|
+
subject: string;
|
|
100
|
+
relation: string;
|
|
101
|
+
object?: unknown;
|
|
102
|
+
} | undefined;
|
|
103
|
+
dissent?: {
|
|
104
|
+
at: string;
|
|
105
|
+
by_actor_id: string;
|
|
106
|
+
reason: string;
|
|
107
|
+
}[] | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
status: "extracted" | "contested" | "accepted" | "rejected";
|
|
110
|
+
id: string;
|
|
111
|
+
created_at: string;
|
|
112
|
+
sensitivity: "public" | "internal" | "confidential" | "secret";
|
|
113
|
+
statement: string;
|
|
114
|
+
source_observation_ids: string[];
|
|
115
|
+
extraction_method: "human" | "tool" | "llm" | "import";
|
|
116
|
+
extracted_by: string;
|
|
117
|
+
scope: {
|
|
118
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
119
|
+
identifier: string;
|
|
120
|
+
};
|
|
121
|
+
authors: string[];
|
|
122
|
+
structured_predicate?: {
|
|
123
|
+
subject: string;
|
|
124
|
+
relation: string;
|
|
125
|
+
object?: unknown;
|
|
126
|
+
} | undefined;
|
|
127
|
+
dissent?: {
|
|
128
|
+
at: string;
|
|
129
|
+
by_actor_id: string;
|
|
130
|
+
reason: string;
|
|
131
|
+
}[] | undefined;
|
|
132
|
+
}>;
|
|
133
|
+
export type Claim = z.infer<typeof ClaimSchema>;
|
|
134
|
+
/**
|
|
135
|
+
* Quality of a single piece of evidence.
|
|
136
|
+
*
|
|
137
|
+
* v0 uses a categorical taxonomy. A scalar evidence strength is
|
|
138
|
+
* deferred to later versions once enough data exists to calibrate
|
|
139
|
+
* a scoring function.
|
|
140
|
+
*/
|
|
141
|
+
export declare const EvidenceQualitySchema: z.ZodEnum<["direct_observation", "tool_result", "human_assertion", "model_inference", "external_document", "synthetic_probe"]>;
|
|
142
|
+
export type EvidenceQuality = z.infer<typeof EvidenceQualitySchema>;
|
|
143
|
+
/**
|
|
144
|
+
* One piece of evidence for or against a claim.
|
|
145
|
+
*
|
|
146
|
+
* `independence_group` is used by aggregators: items in the same group
|
|
147
|
+
* are NOT independent. This matters because three citations to the same
|
|
148
|
+
* source are not three independent supporting items.
|
|
149
|
+
*/
|
|
150
|
+
export declare const EvidenceItemSchema: z.ZodObject<{
|
|
151
|
+
source_id: z.ZodString;
|
|
152
|
+
relation: z.ZodEnum<["supports", "contradicts", "contextualizes"]>;
|
|
153
|
+
quality: z.ZodEnum<["direct_observation", "tool_result", "human_assertion", "model_inference", "external_document", "synthetic_probe"]>;
|
|
154
|
+
independence_group: z.ZodOptional<z.ZodString>;
|
|
155
|
+
freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
|
|
156
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
relation: "supports" | "contradicts" | "contextualizes";
|
|
159
|
+
source_id: string;
|
|
160
|
+
quality: "direct_observation" | "tool_result" | "human_assertion" | "model_inference" | "external_document" | "synthetic_probe";
|
|
161
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
162
|
+
independence_group?: string | undefined;
|
|
163
|
+
notes?: string | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
relation: "supports" | "contradicts" | "contextualizes";
|
|
166
|
+
source_id: string;
|
|
167
|
+
quality: "direct_observation" | "tool_result" | "human_assertion" | "model_inference" | "external_document" | "synthetic_probe";
|
|
168
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
169
|
+
independence_group?: string | undefined;
|
|
170
|
+
notes?: string | undefined;
|
|
171
|
+
}>;
|
|
172
|
+
export type EvidenceItem = z.infer<typeof EvidenceItemSchema>;
|
|
173
|
+
/**
|
|
174
|
+
* Set of evidence assessed against a claim.
|
|
175
|
+
*
|
|
176
|
+
* No scalar `strength` field in v0. Strength is computed lazily by
|
|
177
|
+
* an aggregator that may evolve as data accumulates.
|
|
178
|
+
*/
|
|
179
|
+
export declare const EvidenceSetSchema: z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
claim_id: z.ZodString;
|
|
182
|
+
items: z.ZodArray<z.ZodObject<{
|
|
183
|
+
source_id: z.ZodString;
|
|
184
|
+
relation: z.ZodEnum<["supports", "contradicts", "contextualizes"]>;
|
|
185
|
+
quality: z.ZodEnum<["direct_observation", "tool_result", "human_assertion", "model_inference", "external_document", "synthetic_probe"]>;
|
|
186
|
+
independence_group: z.ZodOptional<z.ZodString>;
|
|
187
|
+
freshness: z.ZodEnum<["fresh", "stale", "unknown"]>;
|
|
188
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
relation: "supports" | "contradicts" | "contextualizes";
|
|
191
|
+
source_id: string;
|
|
192
|
+
quality: "direct_observation" | "tool_result" | "human_assertion" | "model_inference" | "external_document" | "synthetic_probe";
|
|
193
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
194
|
+
independence_group?: string | undefined;
|
|
195
|
+
notes?: string | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
relation: "supports" | "contradicts" | "contextualizes";
|
|
198
|
+
source_id: string;
|
|
199
|
+
quality: "direct_observation" | "tool_result" | "human_assertion" | "model_inference" | "external_document" | "synthetic_probe";
|
|
200
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
201
|
+
independence_group?: string | undefined;
|
|
202
|
+
notes?: string | undefined;
|
|
203
|
+
}>, "many">;
|
|
204
|
+
assessed_by: z.ZodString;
|
|
205
|
+
assessed_at: z.ZodString;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
id: string;
|
|
208
|
+
claim_id: string;
|
|
209
|
+
items: {
|
|
210
|
+
relation: "supports" | "contradicts" | "contextualizes";
|
|
211
|
+
source_id: string;
|
|
212
|
+
quality: "direct_observation" | "tool_result" | "human_assertion" | "model_inference" | "external_document" | "synthetic_probe";
|
|
213
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
214
|
+
independence_group?: string | undefined;
|
|
215
|
+
notes?: string | undefined;
|
|
216
|
+
}[];
|
|
217
|
+
assessed_by: string;
|
|
218
|
+
assessed_at: string;
|
|
219
|
+
}, {
|
|
220
|
+
id: string;
|
|
221
|
+
claim_id: string;
|
|
222
|
+
items: {
|
|
223
|
+
relation: "supports" | "contradicts" | "contextualizes";
|
|
224
|
+
source_id: string;
|
|
225
|
+
quality: "direct_observation" | "tool_result" | "human_assertion" | "model_inference" | "external_document" | "synthetic_probe";
|
|
226
|
+
freshness: "unknown" | "fresh" | "stale";
|
|
227
|
+
independence_group?: string | undefined;
|
|
228
|
+
notes?: string | undefined;
|
|
229
|
+
}[];
|
|
230
|
+
assessed_by: string;
|
|
231
|
+
assessed_at: string;
|
|
232
|
+
}>;
|
|
233
|
+
export type EvidenceSet = z.infer<typeof EvidenceSetSchema>;
|
|
234
|
+
//# sourceMappingURL=claim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/schemas/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;GAEG;AACH,eAAO,MAAM,sBAAsB,+CAA6C,CAAA;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;GAEG;AACH,eAAO,MAAM,iBAAiB,+DAA6D,CAAA;AAC3F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;EAIxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAatB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAM/C;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,gIAOhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAO7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PredicateSchema, ResourceScopeSchema, SensitivitySchema, TimestampSchema } from "./common";
|
|
3
|
+
/**
|
|
4
|
+
* How a claim was extracted from observation(s).
|
|
5
|
+
*/
|
|
6
|
+
export const ExtractionMethodSchema = z.enum(["tool", "llm", "human", "import"]);
|
|
7
|
+
/**
|
|
8
|
+
* Lifecycle of a claim before it becomes a belief.
|
|
9
|
+
*/
|
|
10
|
+
export const ClaimStatusSchema = z.enum(["extracted", "contested", "accepted", "rejected"]);
|
|
11
|
+
/**
|
|
12
|
+
* Dissent recorded against a claim. Reserved for multi-agent futures;
|
|
13
|
+
* v0 captures it but the resolution algorithm is deferred.
|
|
14
|
+
*/
|
|
15
|
+
export const DissentSchema = z.object({
|
|
16
|
+
by_actor_id: z.string(),
|
|
17
|
+
reason: z.string(),
|
|
18
|
+
at: TimestampSchema,
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* A statement extracted from one or more observations.
|
|
22
|
+
*
|
|
23
|
+
* Claims are the second link in the epistemic chain. Every claim
|
|
24
|
+
* records its extraction method and the actor that extracted it,
|
|
25
|
+
* so the source of an eventual belief can always be traced back to
|
|
26
|
+
* the original observation(s).
|
|
27
|
+
*/
|
|
28
|
+
export const ClaimSchema = z.object({
|
|
29
|
+
id: z.string(),
|
|
30
|
+
statement: z.string().describe("human-readable claim"),
|
|
31
|
+
structured_predicate: PredicateSchema.optional().describe("for queryable claims"),
|
|
32
|
+
source_observation_ids: z.array(z.string()).min(1, "a claim must reference at least one observation"),
|
|
33
|
+
extraction_method: ExtractionMethodSchema,
|
|
34
|
+
extracted_by: z.string().describe("actor_id of the extractor"),
|
|
35
|
+
status: ClaimStatusSchema,
|
|
36
|
+
scope: ResourceScopeSchema,
|
|
37
|
+
sensitivity: SensitivitySchema,
|
|
38
|
+
authors: z.array(z.string()).describe("actor_ids; usually one in v0, multi for v1.5+"),
|
|
39
|
+
dissent: z.array(DissentSchema).optional(),
|
|
40
|
+
created_at: TimestampSchema,
|
|
41
|
+
});
|
|
42
|
+
// -----------------------------------------------------------------------------
|
|
43
|
+
// Evidence
|
|
44
|
+
// -----------------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* Quality of a single piece of evidence.
|
|
47
|
+
*
|
|
48
|
+
* v0 uses a categorical taxonomy. A scalar evidence strength is
|
|
49
|
+
* deferred to later versions once enough data exists to calibrate
|
|
50
|
+
* a scoring function.
|
|
51
|
+
*/
|
|
52
|
+
export const EvidenceQualitySchema = z.enum([
|
|
53
|
+
"direct_observation", // tool output describing world state
|
|
54
|
+
"tool_result", // computed result from a tool
|
|
55
|
+
"human_assertion", // user said so
|
|
56
|
+
"model_inference", // an LLM concluded so from other context
|
|
57
|
+
"external_document", // file, webpage, email — high risk for poisoning
|
|
58
|
+
"synthetic_probe", // from a Harness probe; never affects real beliefs
|
|
59
|
+
]);
|
|
60
|
+
/**
|
|
61
|
+
* One piece of evidence for or against a claim.
|
|
62
|
+
*
|
|
63
|
+
* `independence_group` is used by aggregators: items in the same group
|
|
64
|
+
* are NOT independent. This matters because three citations to the same
|
|
65
|
+
* source are not three independent supporting items.
|
|
66
|
+
*/
|
|
67
|
+
export const EvidenceItemSchema = z.object({
|
|
68
|
+
source_id: z.string().describe("observation_id, belief_id, or external ref"),
|
|
69
|
+
relation: z.enum(["supports", "contradicts", "contextualizes"]),
|
|
70
|
+
quality: EvidenceQualitySchema,
|
|
71
|
+
independence_group: z.string().optional(),
|
|
72
|
+
freshness: z.enum(["fresh", "stale", "unknown"]),
|
|
73
|
+
notes: z.string().optional(),
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* Set of evidence assessed against a claim.
|
|
77
|
+
*
|
|
78
|
+
* No scalar `strength` field in v0. Strength is computed lazily by
|
|
79
|
+
* an aggregator that may evolve as data accumulates.
|
|
80
|
+
*/
|
|
81
|
+
export const EvidenceSetSchema = z.object({
|
|
82
|
+
id: z.string(),
|
|
83
|
+
claim_id: z.string(),
|
|
84
|
+
items: z.array(EvidenceItemSchema),
|
|
85
|
+
assessed_by: z.string().describe("actor_id of the assessor"),
|
|
86
|
+
assessed_at: TimestampSchema,
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=claim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/schemas/claim.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Sensitivity of content. Affects retrieval, explanation generation,
|
|
4
|
+
* OTel export, and final reports.
|
|
5
|
+
*
|
|
6
|
+
* Sensitivity is a content attribute. It is NOT a lifecycle axis —
|
|
7
|
+
* truth/retrieval/security/freshness describe the *state* of a belief,
|
|
8
|
+
* sensitivity describes its *content*.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SensitivitySchema: z.ZodEnum<["public", "internal", "confidential", "secret"]>;
|
|
11
|
+
export type Sensitivity = z.infer<typeof SensitivitySchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Scope a claim, belief, memory, or action applies to. Hierarchical
|
|
14
|
+
* from broadest (global) to narrowest (session).
|
|
15
|
+
*/
|
|
16
|
+
export declare const ResourceScopeSchema: z.ZodObject<{
|
|
17
|
+
level: z.ZodEnum<["global", "organization", "user", "project", "repo", "session"]>;
|
|
18
|
+
identifier: z.ZodString;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
21
|
+
identifier: string;
|
|
22
|
+
}, {
|
|
23
|
+
level: "global" | "organization" | "user" | "project" | "repo" | "session";
|
|
24
|
+
identifier: string;
|
|
25
|
+
}>;
|
|
26
|
+
export type ResourceScope = z.infer<typeof ResourceScopeSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* Structured predicate for queryable claims and beliefs.
|
|
29
|
+
* Free-form for v0; refined in later versions as the planner matures.
|
|
30
|
+
*/
|
|
31
|
+
export declare const PredicateSchema: z.ZodObject<{
|
|
32
|
+
subject: z.ZodString;
|
|
33
|
+
relation: z.ZodString;
|
|
34
|
+
object: z.ZodUnknown;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
subject: string;
|
|
37
|
+
relation: string;
|
|
38
|
+
object?: unknown;
|
|
39
|
+
}, {
|
|
40
|
+
subject: string;
|
|
41
|
+
relation: string;
|
|
42
|
+
object?: unknown;
|
|
43
|
+
}>;
|
|
44
|
+
export type Predicate = z.infer<typeof PredicateSchema>;
|
|
45
|
+
/**
|
|
46
|
+
* ISO 8601 timestamp string.
|
|
47
|
+
*/
|
|
48
|
+
export declare const TimestampSchema: z.ZodString;
|
|
49
|
+
export type Timestamp = z.infer<typeof TimestampSchema>;
|
|
50
|
+
/**
|
|
51
|
+
* ISO 8601 duration string (e.g. "P30D", "PT1H").
|
|
52
|
+
*/
|
|
53
|
+
export declare const DurationSchema: z.ZodString;
|
|
54
|
+
export type Duration = z.infer<typeof DurationSchema>;
|
|
55
|
+
/**
|
|
56
|
+
* Generic Source reference used in evidence and explanations.
|
|
57
|
+
* Points to an observation, belief, or external identifier.
|
|
58
|
+
*/
|
|
59
|
+
export declare const SourceSchema: z.ZodObject<{
|
|
60
|
+
type: z.ZodEnum<["observation", "belief", "claim", "memory", "skill", "external"]>;
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
type: "observation" | "belief" | "claim" | "memory" | "skill" | "external";
|
|
65
|
+
id: string;
|
|
66
|
+
uri?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
type: "observation" | "belief" | "claim" | "memory" | "skill" | "external";
|
|
69
|
+
id: string;
|
|
70
|
+
uri?: string | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
export type Source = z.infer<typeof SourceSchema>;
|
|
73
|
+
//# sourceMappingURL=common.d.ts.map
|