@unson/brainbase-mcp 0.6.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/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 +139 -3
- 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
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { FoundationRevisionStore } from './foundation-store.js';
|
|
2
|
+
import type { FoundationAcl, FoundationRevision, FoundationScope } from './ontology-foundation.js';
|
|
3
|
+
/**
|
|
4
|
+
* Problem candidates are evidence-sidecar records. They are deliberately not
|
|
5
|
+
* Graph entities: a candidate is a reviewable input to problem selection, not
|
|
6
|
+
* an approved problem or a canonical fact.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PROBLEM_CANDIDATES_CONTRACT_VERSION: "problem-candidates.v1";
|
|
9
|
+
export declare const PROBLEM_CANDIDATE_CATALOG_VERSION: 1;
|
|
10
|
+
export declare const PROBLEM_CANDIDATES_SIDECAR: "evidence/problem-candidates.json";
|
|
11
|
+
export type ProblemCandidateKind = 'gap' | 'opportunity' | 'threat' | 'uncertainty';
|
|
12
|
+
export type ProblemCandidateStatus = 'candidate' | 'merged' | 'dismissed';
|
|
13
|
+
export type ProblemCandidateSourceKind = 'event' | 'observation' | 'document' | 'decision' | 'import' | 'candidate' | 'evidence';
|
|
14
|
+
export interface ProblemCandidateKnown<T> {
|
|
15
|
+
readonly status: 'known';
|
|
16
|
+
readonly value: T;
|
|
17
|
+
}
|
|
18
|
+
export interface ProblemCandidateUnknown {
|
|
19
|
+
readonly status: 'unknown';
|
|
20
|
+
readonly reason: string;
|
|
21
|
+
}
|
|
22
|
+
/** Unknown is explicit so missing data cannot become zero, empty, or success. */
|
|
23
|
+
export type ProblemCandidateField<T> = ProblemCandidateKnown<T> | ProblemCandidateUnknown;
|
|
24
|
+
export interface ProblemCandidateSourceRef {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly kind: ProblemCandidateSourceKind;
|
|
27
|
+
/** Optional immutable source digest. Evidence content is never embedded. */
|
|
28
|
+
readonly digest?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ProblemCandidateEventInput {
|
|
31
|
+
readonly id: string;
|
|
32
|
+
readonly occurredAt: string;
|
|
33
|
+
readonly recordedAt: string;
|
|
34
|
+
readonly sourceRefs: readonly ProblemCandidateSourceRef[];
|
|
35
|
+
}
|
|
36
|
+
export interface ProblemCandidateEvent extends ProblemCandidateEventInput {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly occurredAt: string;
|
|
39
|
+
readonly recordedAt: string;
|
|
40
|
+
readonly sourceRefs: readonly ProblemCandidateSourceRef[];
|
|
41
|
+
}
|
|
42
|
+
/** Exact Objective revision plus its canonical definition digest. */
|
|
43
|
+
export interface ProblemCandidateObjectiveReference extends FoundationRevision {
|
|
44
|
+
readonly type: 'objective';
|
|
45
|
+
readonly digest: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ProblemCandidateDeadline {
|
|
48
|
+
readonly dueAt: string;
|
|
49
|
+
readonly evaluationAt?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ProblemCandidateResource {
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly kind: string;
|
|
54
|
+
readonly quantity?: number;
|
|
55
|
+
readonly unit?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ProblemCandidateInput {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly kind: ProblemCandidateKind;
|
|
60
|
+
readonly statement: string;
|
|
61
|
+
readonly objectiveRefs: readonly ProblemCandidateObjectiveReference[];
|
|
62
|
+
readonly event: ProblemCandidateEventInput;
|
|
63
|
+
readonly observedGap: ProblemCandidateField<string>;
|
|
64
|
+
readonly opportunity: ProblemCandidateField<string>;
|
|
65
|
+
readonly threat: ProblemCandidateField<string>;
|
|
66
|
+
readonly uncertainty: ProblemCandidateField<string>;
|
|
67
|
+
readonly deadline: ProblemCandidateField<ProblemCandidateDeadline>;
|
|
68
|
+
readonly expectedEffect: ProblemCandidateField<string>;
|
|
69
|
+
readonly requiredResources: ProblemCandidateField<readonly ProblemCandidateResource[]>;
|
|
70
|
+
readonly responsibleId: ProblemCandidateField<string>;
|
|
71
|
+
readonly ownerScope: FoundationScope;
|
|
72
|
+
readonly acl: FoundationAcl;
|
|
73
|
+
/** Only mergeCandidates may set this field. */
|
|
74
|
+
readonly mergedFrom?: readonly string[];
|
|
75
|
+
/** Optional creation time; defaults to event.recordedAt. */
|
|
76
|
+
readonly createdAt?: string;
|
|
77
|
+
/** Runtime input may carry candidate only; selection states are rejected. */
|
|
78
|
+
readonly status?: ProblemCandidateStatus;
|
|
79
|
+
}
|
|
80
|
+
export interface ProblemCandidateProvenance {
|
|
81
|
+
readonly eventIds: readonly string[];
|
|
82
|
+
readonly sourceRefs: readonly ProblemCandidateSourceRef[];
|
|
83
|
+
readonly candidateIds: readonly string[];
|
|
84
|
+
}
|
|
85
|
+
export interface ProblemCandidateRecord extends Omit<ProblemCandidateInput, 'mergedFrom' | 'createdAt' | 'status'> {
|
|
86
|
+
readonly contractVersion: typeof PROBLEM_CANDIDATES_CONTRACT_VERSION;
|
|
87
|
+
readonly status: ProblemCandidateStatus;
|
|
88
|
+
readonly mergedFrom: readonly string[];
|
|
89
|
+
readonly createdAt: string;
|
|
90
|
+
readonly updatedAt: string;
|
|
91
|
+
readonly provenance: ProblemCandidateProvenance;
|
|
92
|
+
readonly payloadDigest: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ProblemCandidateQuery {
|
|
95
|
+
readonly ownerScope?: FoundationScope;
|
|
96
|
+
readonly responsibleId?: string;
|
|
97
|
+
readonly status?: ProblemCandidateStatus;
|
|
98
|
+
}
|
|
99
|
+
export interface ProblemCandidateMergeInput extends ProblemCandidateInput {
|
|
100
|
+
readonly sourceCandidateIds: readonly string[];
|
|
101
|
+
}
|
|
102
|
+
export interface ProblemCandidateStoreContext {
|
|
103
|
+
/** Identity and optional scope must come from a trusted caller boundary. */
|
|
104
|
+
readonly principal: string;
|
|
105
|
+
readonly scope?: FoundationScope;
|
|
106
|
+
}
|
|
107
|
+
export type ProblemCandidateEvidenceOperation = 'save' | 'read';
|
|
108
|
+
/**
|
|
109
|
+
* Trusted current-access boundary for source evidence. Candidate ACLs are not
|
|
110
|
+
* evidence ACLs: every source reference, including roots reached through a
|
|
111
|
+
* merge, must be authorized by this provider before candidate text is exposed.
|
|
112
|
+
* The provider must fail closed when a source is missing or its digest is no
|
|
113
|
+
* longer readable for the principal.
|
|
114
|
+
*/
|
|
115
|
+
export interface ProblemCandidateEvidenceAccessProvider {
|
|
116
|
+
authorize(input: {
|
|
117
|
+
readonly operation: ProblemCandidateEvidenceOperation;
|
|
118
|
+
readonly context: ProblemCandidateStoreContext;
|
|
119
|
+
readonly source: ProblemCandidateSourceRef;
|
|
120
|
+
}): void | boolean | Promise<void | boolean>;
|
|
121
|
+
}
|
|
122
|
+
export type ProblemCandidateStoreErrorCode = 'invalid_input' | 'not_found' | 'revision_conflict' | 'event_conflict' | 'authorization_denied' | 'scope_violation' | 'unsupported_graph' | 'corrupt_record' | 'readback_mismatch';
|
|
123
|
+
export declare class ProblemCandidateStoreError extends Error {
|
|
124
|
+
readonly code: ProblemCandidateStoreErrorCode;
|
|
125
|
+
constructor(code: ProblemCandidateStoreErrorCode, message: string);
|
|
126
|
+
}
|
|
127
|
+
export interface ProblemCandidateStore {
|
|
128
|
+
saveCandidate(input: ProblemCandidateInput, context: ProblemCandidateStoreContext): Promise<ProblemCandidateRecord>;
|
|
129
|
+
/** Alias kept explicit for callers that name the resource in the method. */
|
|
130
|
+
saveProblemCandidate(input: ProblemCandidateInput, context: ProblemCandidateStoreContext): Promise<ProblemCandidateRecord>;
|
|
131
|
+
mergeCandidates(input: ProblemCandidateMergeInput, context: ProblemCandidateStoreContext): Promise<ProblemCandidateRecord>;
|
|
132
|
+
readCandidate(id: string, context: ProblemCandidateStoreContext): Promise<ProblemCandidateRecord | null>;
|
|
133
|
+
listCandidates(query: ProblemCandidateQuery | undefined, context: ProblemCandidateStoreContext): Promise<readonly ProblemCandidateRecord[]>;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Validates, clones, and freezes a candidate input. The function is also a
|
|
137
|
+
* pure contract surface for providers that want to validate before storage.
|
|
138
|
+
*/
|
|
139
|
+
export declare function normalizeProblemCandidate(input: ProblemCandidateInput): ProblemCandidateInput;
|
|
140
|
+
/** Returns validation without throwing, useful for contract fixtures. */
|
|
141
|
+
export declare function validateProblemCandidate(input: ProblemCandidateInput): {
|
|
142
|
+
readonly valid: boolean;
|
|
143
|
+
readonly issues: readonly string[];
|
|
144
|
+
};
|
|
145
|
+
export declare function createProblemCandidateStore(options: {
|
|
146
|
+
readonly dataDir: string;
|
|
147
|
+
readonly foundationStore: FoundationRevisionStore;
|
|
148
|
+
readonly evidenceAccessProvider: ProblemCandidateEvidenceAccessProvider;
|
|
149
|
+
}): ProblemCandidateStore;
|