@unson/brainbase-mcp 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/contracts/judgment-dag/digest.json +2 -2
- package/dist/canonical-task-contract.d.ts +9 -0
- package/dist/canonical-task-contract.js +39 -0
- package/dist/canonical-task-principal.d.ts +16 -0
- package/dist/canonical-task-principal.js +36 -0
- package/dist/canonical-task-service.d.ts +251 -0
- package/dist/canonical-task-service.js +809 -0
- package/dist/company-os-evaluation.d.ts +193 -0
- package/dist/company-os-evaluation.js +1150 -0
- package/dist/company-os-impact-review.d.ts +248 -0
- package/dist/company-os-impact-review.js +663 -0
- package/dist/company-os-learning-adoption.d.ts +288 -0
- package/dist/company-os-learning-adoption.js +944 -0
- package/dist/company-os-objectives.d.ts +52 -0
- package/dist/company-os-objectives.js +197 -0
- package/dist/company-os-receipt-adapter.d.ts +109 -0
- package/dist/company-os-receipt-adapter.js +636 -0
- package/dist/constraint-exception-store.d.ts +23 -0
- package/dist/constraint-exception-store.js +108 -0
- package/dist/constraint-resolution.d.ts +175 -0
- package/dist/constraint-resolution.js +922 -0
- package/dist/decision-adapter.d.ts +145 -0
- package/dist/decision-adapter.js +586 -0
- package/dist/durable-wait-http.d.ts +51 -0
- package/dist/durable-wait-http.js +497 -0
- package/dist/durable-waits.d.ts +234 -0
- package/dist/durable-waits.js +944 -0
- package/dist/execution-authority-http.d.ts +28 -0
- package/dist/execution-authority-http.js +359 -0
- package/dist/execution-authority.d.ts +201 -0
- package/dist/execution-authority.js +634 -0
- package/dist/foundation-catalog.d.ts +26 -0
- package/dist/foundation-catalog.js +206 -0
- package/dist/foundation-constraint-store.d.ts +50 -0
- package/dist/foundation-constraint-store.js +215 -0
- package/dist/foundation-http.d.ts +90 -0
- package/dist/foundation-http.js +439 -0
- package/dist/foundation-store.d.ts +132 -0
- package/dist/foundation-store.js +654 -0
- package/dist/judgment-dag-composition.d.ts +224 -0
- package/dist/judgment-dag-composition.js +731 -0
- package/dist/judgment-dag.d.ts +2 -0
- package/dist/judgment-dag.js +1 -0
- package/dist/judgment-problem-snapshot.d.ts +185 -0
- package/dist/judgment-problem-snapshot.js +777 -0
- package/dist/judgment-view-http.d.ts +22 -0
- package/dist/judgment-view-http.js +128 -0
- package/dist/judgment-view.d.ts +222 -0
- package/dist/judgment-view.js +627 -0
- package/dist/knowledge-adapter.d.ts +112 -0
- package/dist/knowledge-adapter.js +691 -0
- package/dist/ontology-foundation.d.ts +209 -0
- package/dist/ontology-foundation.js +1000 -0
- package/dist/ontology.d.ts +13 -0
- package/dist/ontology.js +14 -0
- package/dist/organization-connection.d.ts +164 -0
- package/dist/organization-connection.js +428 -0
- package/dist/personal-knowledge.d.ts +120 -0
- package/dist/personal-knowledge.js +750 -0
- package/dist/problem-candidates.d.ts +149 -0
- package/dist/problem-candidates.js +898 -0
- package/dist/problem-selection.d.ts +238 -0
- package/dist/problem-selection.js +995 -0
- package/dist/resource-reservation-http.d.ts +31 -0
- package/dist/resource-reservation-http.js +371 -0
- package/dist/resource-reservations.d.ts +221 -0
- package/dist/resource-reservations.js +577 -0
- package/dist/server.d.ts +97 -0
- package/dist/server.js +180 -1
- package/dist/ssot.d.ts +6 -1
- package/dist/ssot.js +63 -5
- package/dist/streamable-http.d.ts +42 -0
- package/dist/streamable-http.js +288 -0
- package/dist/types.d.ts +20 -0
- package/dist/world-model.d.ts +181 -0
- package/dist/world-model.js +873 -0
- package/package.json +145 -3
- package/ui/icons/mana/LICENSE.tabler.txt +21 -0
- package/ui/icons/mana/affiliate.svg +20 -0
- package/ui/icons/mana/brand-github.svg +15 -0
- package/ui/icons/mana/brand-google-drive.svg +17 -0
- package/ui/icons/mana/brand-slack.svg +18 -0
- package/ui/icons/mana/cpu.svg +24 -0
- package/ui/judgment-view.css +238 -0
- package/ui/judgment-view.js +508 -0
- package/ui/objective-editor.css +180 -0
- package/ui/objective-editor.js +1139 -0
- package/ui/outcome-knowledge.css +365 -0
- package/ui/outcome-knowledge.js +1570 -0
- package/ui/outcome-mana.css +255 -0
- package/ui/outcome-mana.js +2325 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { FoundationAcl, FoundationEvaluationDescriptor, FoundationScope, ObjectiveCriterion } from './ontology-foundation.js';
|
|
2
|
+
import { type FoundationRef } from './foundation-catalog.js';
|
|
3
|
+
import type { FoundationRevisionStore, FoundationStoreContext } from './foundation-store.js';
|
|
4
|
+
import type { FoundationCatalogRecord } from './types.js';
|
|
5
|
+
import { type JudgmentProblemReferenceProvider, type JudgmentProblemSnapshotAccessContext, type JudgmentProblemSnapshotAccessProvider } from './judgment-problem-snapshot.js';
|
|
6
|
+
/**
|
|
7
|
+
* Evaluation is an evidence record over a pinned Problem. It does not own
|
|
8
|
+
* Objective or Variable definitions and it does not close an OutcomeCase.
|
|
9
|
+
*/
|
|
10
|
+
export declare const COMPANY_OS_EVALUATION_CONTRACT_VERSION: "0.1.0";
|
|
11
|
+
export declare const COMPANY_OS_EVALUATION_RECORD_CATALOG_VERSION: 1;
|
|
12
|
+
export declare const COMPANY_OS_EVALUATION_SIDECAR: "evidence/company-os-evaluation.json";
|
|
13
|
+
export type EvaluationMeasurementStatus = 'observed' | 'missing' | 'not_arrived';
|
|
14
|
+
export type EvaluationJudgmentValidity = 'valid' | 'invalid' | 'indeterminate';
|
|
15
|
+
export type EvaluationResultStatus = 'achieved' | 'not_achieved' | 'indeterminate';
|
|
16
|
+
export type PredictionComparisonStatus = 'matched' | 'missed' | 'indeterminate';
|
|
17
|
+
export type EvaluationScalar = string | number | boolean;
|
|
18
|
+
export interface EvaluationMeasurementDescriptor extends Omit<FoundationEvaluationDescriptor, 'variableRef'> {
|
|
19
|
+
}
|
|
20
|
+
export interface EvaluationConversionProvenance {
|
|
21
|
+
/** Stable evidence or transformation identifier, not a free-form assertion. */
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
}
|
|
25
|
+
export interface EvaluationMeasurementConversion {
|
|
26
|
+
/** The input measurement's exact source definition. */
|
|
27
|
+
readonly sourceRef: FoundationRef;
|
|
28
|
+
/** The exact criterion definition used after the conversion. */
|
|
29
|
+
readonly targetRef: FoundationRef;
|
|
30
|
+
readonly provenance: EvaluationConversionProvenance;
|
|
31
|
+
}
|
|
32
|
+
export interface EvaluationMeasurementInput {
|
|
33
|
+
readonly variableRef: FoundationRef;
|
|
34
|
+
/** The descriptor describes the effective (possibly converted) definition. */
|
|
35
|
+
readonly descriptor: EvaluationMeasurementDescriptor;
|
|
36
|
+
readonly status: EvaluationMeasurementStatus;
|
|
37
|
+
readonly value?: EvaluationScalar;
|
|
38
|
+
readonly recordedAt: string;
|
|
39
|
+
readonly evidenceRef?: string;
|
|
40
|
+
readonly conversion?: EvaluationMeasurementConversion;
|
|
41
|
+
}
|
|
42
|
+
export interface EvaluationMeasurement extends EvaluationMeasurementInput {
|
|
43
|
+
readonly effectiveVariableRef: FoundationRef;
|
|
44
|
+
}
|
|
45
|
+
export interface JudgmentValidityInput {
|
|
46
|
+
readonly status: EvaluationJudgmentValidity;
|
|
47
|
+
readonly basis: string;
|
|
48
|
+
readonly evidenceRefs?: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
export interface JudgmentValidity extends JudgmentValidityInput {
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A port owned by OSS and implemented by an OutcomeCase provider. The port
|
|
54
|
+
* deliberately has a read operation only: closure, approval, and case
|
|
55
|
+
* mutation remain outside this repository.
|
|
56
|
+
*/
|
|
57
|
+
export interface OutcomeCaseReference {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly revision?: string;
|
|
60
|
+
readonly digest?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface OutcomeCaseCanonicalReference {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly revision: string;
|
|
65
|
+
readonly digest: string;
|
|
66
|
+
}
|
|
67
|
+
export type OutcomeCaseOwnerUnknownReason = 'not_recorded' | 'legacy_untyped' | 'source_unavailable';
|
|
68
|
+
export interface OutcomeCaseEntityReference {
|
|
69
|
+
readonly id: string;
|
|
70
|
+
readonly type: string;
|
|
71
|
+
readonly revision?: string;
|
|
72
|
+
readonly digest?: string;
|
|
73
|
+
}
|
|
74
|
+
export type OutcomeCaseOwnerReference = {
|
|
75
|
+
readonly status: 'typed';
|
|
76
|
+
readonly ref: OutcomeCaseEntityReference;
|
|
77
|
+
} | {
|
|
78
|
+
readonly status: 'unknown';
|
|
79
|
+
readonly reason: OutcomeCaseOwnerUnknownReason;
|
|
80
|
+
};
|
|
81
|
+
export type OutcomeCaseConditionValue = string | number | boolean | null | readonly OutcomeCaseConditionValue[] | {
|
|
82
|
+
readonly [key: string]: OutcomeCaseConditionValue;
|
|
83
|
+
};
|
|
84
|
+
export type OutcomeCaseConditions = Readonly<Record<string, OutcomeCaseConditionValue>>;
|
|
85
|
+
/**
|
|
86
|
+
* Trusted source-owned metadata returned with an OutcomeCase read. The
|
|
87
|
+
* adapter must use this projection when creating a receipt link; caller
|
|
88
|
+
* supplied receipt state, owners, or conditions are lookup input only.
|
|
89
|
+
*/
|
|
90
|
+
export interface OutcomeCaseCanonicalSource {
|
|
91
|
+
readonly state: string;
|
|
92
|
+
readonly owner_refs: readonly OutcomeCaseOwnerReference[];
|
|
93
|
+
readonly conditions?: OutcomeCaseConditions;
|
|
94
|
+
}
|
|
95
|
+
export interface OutcomeCaseRead {
|
|
96
|
+
readonly reference: OutcomeCaseCanonicalReference;
|
|
97
|
+
/** Current source-owned identity/state projection, checked at read time. */
|
|
98
|
+
readonly source: OutcomeCaseCanonicalSource;
|
|
99
|
+
/** Current ACL, evaluated at read time. */
|
|
100
|
+
readonly acl: FoundationAcl;
|
|
101
|
+
readonly scope: FoundationScope;
|
|
102
|
+
}
|
|
103
|
+
export interface EvaluationAccessContext extends JudgmentProblemSnapshotAccessContext {
|
|
104
|
+
readonly scope?: FoundationScope;
|
|
105
|
+
}
|
|
106
|
+
export interface OutcomeCasePort {
|
|
107
|
+
read(reference: OutcomeCaseReference, actor: EvaluationAccessContext): Promise<OutcomeCaseRead>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Exact definition read used by evaluation. A caller cannot supply an
|
|
111
|
+
* Objective or criterion body as an evaluation input; this port resolves the
|
|
112
|
+
* requested revision and verifies its digest from the canonical store.
|
|
113
|
+
*/
|
|
114
|
+
export interface FoundationDefinitionLoadPort {
|
|
115
|
+
readExact(reference: FoundationRef, context: FoundationStoreContext): Promise<FoundationCatalogRecord | null>;
|
|
116
|
+
}
|
|
117
|
+
export declare function createFoundationDefinitionLoadPort(store: Pick<FoundationRevisionStore, 'read'>): FoundationDefinitionLoadPort;
|
|
118
|
+
export interface CriterionEvaluation {
|
|
119
|
+
readonly criterionIndex: number;
|
|
120
|
+
readonly variableRef: FoundationRef;
|
|
121
|
+
readonly operator: ObjectiveCriterion['operator'];
|
|
122
|
+
readonly target?: string | number | boolean;
|
|
123
|
+
readonly status: EvaluationResultStatus;
|
|
124
|
+
readonly reason: string;
|
|
125
|
+
}
|
|
126
|
+
export interface PredictionComparison {
|
|
127
|
+
readonly criterionIndex: number;
|
|
128
|
+
readonly variableRef: FoundationRef;
|
|
129
|
+
readonly status: PredictionComparisonStatus;
|
|
130
|
+
readonly reason: string;
|
|
131
|
+
readonly predictionStatus?: EvaluationMeasurementStatus;
|
|
132
|
+
readonly actualStatus?: EvaluationMeasurementStatus;
|
|
133
|
+
readonly predictionValue?: EvaluationScalar;
|
|
134
|
+
readonly actualValue?: EvaluationScalar;
|
|
135
|
+
}
|
|
136
|
+
export interface CompanyOsEvaluationRecord {
|
|
137
|
+
readonly version: typeof COMPANY_OS_EVALUATION_RECORD_CATALOG_VERSION;
|
|
138
|
+
readonly id: string;
|
|
139
|
+
readonly snapshot: {
|
|
140
|
+
readonly snapshotId: string;
|
|
141
|
+
readonly problemId: string;
|
|
142
|
+
readonly revision: string;
|
|
143
|
+
readonly digest: string;
|
|
144
|
+
};
|
|
145
|
+
readonly objectiveRef: FoundationRef;
|
|
146
|
+
readonly outcomeCaseRef: OutcomeCaseCanonicalReference;
|
|
147
|
+
readonly predictions: readonly EvaluationMeasurement[];
|
|
148
|
+
readonly actuals: readonly EvaluationMeasurement[];
|
|
149
|
+
readonly criteria: readonly CriterionEvaluation[];
|
|
150
|
+
readonly predictionComparisons: readonly PredictionComparison[];
|
|
151
|
+
readonly achievement: EvaluationResultStatus;
|
|
152
|
+
readonly judgmentAtTimeValidity: JudgmentValidity;
|
|
153
|
+
readonly evaluatedAt: string;
|
|
154
|
+
}
|
|
155
|
+
export interface EvaluateCompanyOsProblemRequest {
|
|
156
|
+
readonly id: string;
|
|
157
|
+
readonly snapshot: {
|
|
158
|
+
readonly root: string;
|
|
159
|
+
readonly snapshotId?: string;
|
|
160
|
+
readonly problemId?: string;
|
|
161
|
+
readonly revision?: string;
|
|
162
|
+
readonly accessProvider?: JudgmentProblemSnapshotAccessProvider;
|
|
163
|
+
readonly referenceProvider: JudgmentProblemReferenceProvider;
|
|
164
|
+
};
|
|
165
|
+
readonly access: EvaluationAccessContext;
|
|
166
|
+
readonly outcomeCase: OutcomeCaseReference;
|
|
167
|
+
readonly predictions: readonly EvaluationMeasurementInput[];
|
|
168
|
+
readonly actuals: readonly EvaluationMeasurementInput[];
|
|
169
|
+
readonly judgmentAtTimeValidity: JudgmentValidityInput;
|
|
170
|
+
readonly evaluatedAt: string;
|
|
171
|
+
}
|
|
172
|
+
export interface CompanyOsEvaluationStore {
|
|
173
|
+
evaluate(request: EvaluateCompanyOsProblemRequest): Promise<CompanyOsEvaluationRecord>;
|
|
174
|
+
read(id: string, access: EvaluationAccessContext): Promise<CompanyOsEvaluationRecord | null>;
|
|
175
|
+
list(access: EvaluationAccessContext): Promise<readonly CompanyOsEvaluationRecord[]>;
|
|
176
|
+
}
|
|
177
|
+
export interface CompanyOsEvaluationStoreOptions {
|
|
178
|
+
readonly dataDir: string;
|
|
179
|
+
readonly foundation: FoundationDefinitionLoadPort;
|
|
180
|
+
readonly outcomeCase: OutcomeCasePort;
|
|
181
|
+
/**
|
|
182
|
+
* Resolver used when a stored evaluation is read back. The evaluation
|
|
183
|
+
* record only stores a snapshot reference, so reads must resolve that exact
|
|
184
|
+
* snapshot again under the provider's current ACL/digest checks.
|
|
185
|
+
*/
|
|
186
|
+
readonly snapshotReferenceProvider: JudgmentProblemReferenceProvider;
|
|
187
|
+
}
|
|
188
|
+
export type CompanyOsEvaluationErrorCode = 'invalid_input' | 'not_found' | 'authorization_denied' | 'scope_violation' | 'integrity_mismatch' | 'incompatible_measurement' | 'revision_conflict' | 'unsupported_graph' | 'corrupt_record' | 'readback_mismatch';
|
|
189
|
+
export declare class CompanyOsEvaluationError extends Error {
|
|
190
|
+
readonly code: CompanyOsEvaluationErrorCode;
|
|
191
|
+
constructor(code: CompanyOsEvaluationErrorCode, message: string);
|
|
192
|
+
}
|
|
193
|
+
export declare function createCompanyOsEvaluationStore(options: CompanyOsEvaluationStoreOptions): CompanyOsEvaluationStore;
|