@unson/brainbase-mcp 0.6.0 → 0.8.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/contracts/foundation/graph-history.sql +634 -0
- package/contracts/judgment-value-proof/schema.json +43 -1
- 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 +820 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +107 -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 +63 -0
- package/dist/company-os-objectives.js +234 -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-authenticated-tools.d.ts +56 -0
- package/dist/foundation-authenticated-tools.js +347 -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-graph-http.d.ts +43 -0
- package/dist/foundation-graph-http.js +243 -0
- package/dist/foundation-graph-write.d.ts +90 -0
- package/dist/foundation-graph-write.js +447 -0
- package/dist/foundation-http.d.ts +90 -0
- package/dist/foundation-http.js +439 -0
- package/dist/foundation-public-provider.d.ts +140 -0
- package/dist/foundation-public-provider.js +192 -0
- package/dist/foundation-store.d.ts +132 -0
- package/dist/foundation-store.js +654 -0
- package/dist/graph-corrections.d.ts +157 -0
- package/dist/graph-corrections.js +620 -0
- package/dist/graph-foundation-reader.d.ts +60 -0
- package/dist/graph-foundation-reader.js +494 -0
- package/dist/graph-retrieval.d.ts +6 -1
- package/dist/graph-revision-reader.d.ts +80 -0
- package/dist/graph-revision-reader.js +246 -0
- package/dist/graph-web-http.d.ts +26 -0
- package/dist/graph-web-http.js +215 -0
- package/dist/graph-web.d.ts +364 -0
- package/dist/graph-web.js +639 -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 +213 -0
- package/dist/judgment-problem-snapshot.js +1073 -0
- package/dist/judgment-value-proof-review.d.ts +166 -0
- package/dist/judgment-value-proof-review.js +437 -0
- package/dist/judgment-value-proof.d.ts +28 -1
- package/dist/judgment-value-proof.js +53 -8
- 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/knowledge-continuation.d.ts +127 -0
- package/dist/knowledge-continuation.js +446 -0
- package/dist/knowledge-lookup.d.ts +178 -0
- package/dist/knowledge-lookup.js +758 -0
- package/dist/local-web-fetch-bridge.d.ts +5 -0
- package/dist/local-web-fetch-bridge.js +37 -0
- package/dist/local-web-host.d.ts +109 -0
- package/dist/local-web-host.js +688 -0
- package/dist/local-web-security.d.ts +25 -0
- package/dist/local-web-security.js +95 -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/organization-graph.d.ts +15 -0
- package/dist/organization-graph.js +24 -4
- package/dist/personal-knowledge.d.ts +132 -0
- package/dist/personal-knowledge.js +779 -0
- package/dist/personal-memory-handover.d.ts +108 -0
- package/dist/personal-memory-handover.js +369 -0
- package/dist/philosophy-revision-reader.d.ts +85 -0
- package/dist/philosophy-revision-reader.js +241 -0
- package/dist/portable-graph.d.ts +24 -0
- package/dist/portable-graph.js +77 -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 +104 -2
- package/dist/server.js +186 -4
- 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/value-proof-review-http.d.ts +25 -0
- package/dist/value-proof-review-http.js +185 -0
- package/dist/world-model.d.ts +199 -0
- package/dist/world-model.js +955 -0
- package/package.json +230 -3
- package/ui/brainbase-tokens.css +56 -0
- package/ui/graph-own-share.js +367 -0
- package/ui/graph-projects-view.css +23 -0
- package/ui/graph-projects-view.js +730 -0
- package/ui/graph-registry-view.css +101 -0
- package/ui/graph-registry-view.js +804 -0
- package/ui/graph-view-shared.css +522 -0
- package/ui/graph-view-shared.js +1227 -0
- package/ui/judgment-view.css +312 -0
- package/ui/judgment-view.js +508 -0
- package/ui/local-web-shell.css +396 -0
- package/ui/local-web-shell.js +378 -0
- package/ui/objective-editor-http-port.js +154 -0
- package/ui/objective-editor.css +286 -0
- package/ui/objective-editor.js +1586 -0
- package/ui/outcome-knowledge.css +50 -14
- package/ui/outcome-knowledge.js +15 -1
- package/ui/outcome-mana.css +91 -14
- package/ui/outcome-mana.js +958 -61
- package/ui/value-proof-review.css +504 -0
- package/ui/value-proof-review.js +1104 -0
- package/ui/workspace-kit.css +485 -0
- package/ui/workspace-kit.js +229 -0
- package/ui/world-model-view.css +188 -0
- package/ui/world-model-view.js +486 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A purpose based, bounded Graph lookup.
|
|
4
|
+
*
|
|
5
|
+
* This module deliberately has no knowledge of tenants, authentication
|
|
6
|
+
* tokens, internal endpoints, or a particular Graph transport. Hosts inject
|
|
7
|
+
* those concerns through `KnowledgeLookupDependencies`; the lookup contract
|
|
8
|
+
* only decides which single bounded action to execute and how to report its
|
|
9
|
+
* evidence.
|
|
10
|
+
*/
|
|
11
|
+
export type KnowledgeLookupOutcome = 'retrieved' | 'empty' | 'incomplete' | 'transport_error' | 'forbidden' | 'ambiguous' | 'unsupported';
|
|
12
|
+
export type KnowledgeLookupActionKind = 'search' | 'read' | 'follow_relation' | 'finish';
|
|
13
|
+
export interface KnowledgeLookupScope {
|
|
14
|
+
readonly project_codes: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface KnowledgeLookupError {
|
|
17
|
+
readonly code: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly http_status?: number;
|
|
20
|
+
readonly details?: unknown;
|
|
21
|
+
}
|
|
22
|
+
export type KnowledgeLookupDependencyStatus = 'ok' | 'error' | 'unavailable';
|
|
23
|
+
/** The result shape expected from one host-owned Graph operation. */
|
|
24
|
+
export interface KnowledgeLookupDependencyResult {
|
|
25
|
+
readonly status: KnowledgeLookupDependencyStatus;
|
|
26
|
+
readonly scope: KnowledgeLookupScope;
|
|
27
|
+
readonly data?: unknown;
|
|
28
|
+
readonly error?: KnowledgeLookupError;
|
|
29
|
+
}
|
|
30
|
+
export interface KnowledgeLookupSearchRequest {
|
|
31
|
+
readonly query: string;
|
|
32
|
+
readonly entity_types: string[];
|
|
33
|
+
readonly required_fields: string[];
|
|
34
|
+
readonly seed_ids?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface KnowledgeLookupReadRequest {
|
|
37
|
+
readonly entity_id: string;
|
|
38
|
+
readonly entity_type: string;
|
|
39
|
+
readonly required_fields: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface KnowledgeLookupRelationRequest {
|
|
42
|
+
readonly query: string;
|
|
43
|
+
readonly entity_types: string[];
|
|
44
|
+
readonly required_fields: string[];
|
|
45
|
+
readonly seed_ids: string[];
|
|
46
|
+
readonly relation: string;
|
|
47
|
+
readonly direction: 'incoming' | 'outgoing';
|
|
48
|
+
readonly target_types?: string[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A host may return any transport-specific candidate shape as long as it
|
|
52
|
+
* exposes these fields. Unknown candidate fields are treated as data and
|
|
53
|
+
* never used to change authorization scope.
|
|
54
|
+
*/
|
|
55
|
+
export interface KnowledgeLookupSearchData {
|
|
56
|
+
readonly candidates?: readonly unknown[];
|
|
57
|
+
readonly coverage?: 'complete' | 'partial' | 'unknown';
|
|
58
|
+
}
|
|
59
|
+
export interface KnowledgeLookupReadData {
|
|
60
|
+
readonly entity?: unknown | null;
|
|
61
|
+
readonly coverage?: 'complete' | 'partial' | 'unknown';
|
|
62
|
+
}
|
|
63
|
+
export interface KnowledgeLookupProjection {
|
|
64
|
+
readonly body: Record<string, unknown>;
|
|
65
|
+
readonly entity_type?: string;
|
|
66
|
+
}
|
|
67
|
+
export type KnowledgeLookupProjectEntity = (entity: Record<string, unknown>) => KnowledgeLookupProjection;
|
|
68
|
+
/**
|
|
69
|
+
* The only host boundary needed by the purpose-based lookup. Implementations
|
|
70
|
+
* should authenticate and enforce their own source scope before returning a
|
|
71
|
+
* result. They must not derive scope from `target_hint` or `context_hints`.
|
|
72
|
+
*/
|
|
73
|
+
export interface KnowledgeLookupDependencies {
|
|
74
|
+
search(input: KnowledgeLookupSearchRequest): Promise<KnowledgeLookupDependencyResult>;
|
|
75
|
+
read(input: KnowledgeLookupReadRequest): Promise<KnowledgeLookupDependencyResult>;
|
|
76
|
+
followRelation(input: KnowledgeLookupRelationRequest): Promise<KnowledgeLookupDependencyResult>;
|
|
77
|
+
readonly projectEntity: KnowledgeLookupProjectEntity;
|
|
78
|
+
}
|
|
79
|
+
export interface KnowledgeLookupReference {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly entity_type: string;
|
|
82
|
+
readonly evidence_fields: string[];
|
|
83
|
+
}
|
|
84
|
+
export interface KnowledgeLookupCandidateSummary {
|
|
85
|
+
readonly id: string;
|
|
86
|
+
readonly entity_type: string;
|
|
87
|
+
readonly name?: string;
|
|
88
|
+
readonly title?: string;
|
|
89
|
+
readonly display_name?: string;
|
|
90
|
+
readonly excerpt?: string;
|
|
91
|
+
readonly evidence?: Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
export interface KnowledgeLookupAction {
|
|
94
|
+
readonly kind: KnowledgeLookupActionKind;
|
|
95
|
+
readonly required_fields: string[];
|
|
96
|
+
readonly why_different?: string;
|
|
97
|
+
readonly query?: string;
|
|
98
|
+
readonly entity_types?: string[];
|
|
99
|
+
readonly seed_ids?: string[];
|
|
100
|
+
readonly entity_id?: string;
|
|
101
|
+
readonly entity_type?: string;
|
|
102
|
+
readonly relation?: string;
|
|
103
|
+
readonly direction?: 'incoming' | 'outgoing';
|
|
104
|
+
readonly target_types?: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface KnowledgeLookupFinishProposal {
|
|
107
|
+
readonly assessment: 'sufficient' | 'insufficient';
|
|
108
|
+
readonly status: 'satisfied' | 'unresolved' | 'needs_user_input';
|
|
109
|
+
readonly reference_ids: string[];
|
|
110
|
+
readonly field_evidence: Array<{
|
|
111
|
+
field: string;
|
|
112
|
+
reference_id: string;
|
|
113
|
+
attempt_id: string;
|
|
114
|
+
}>;
|
|
115
|
+
readonly unresolved_items: string[];
|
|
116
|
+
readonly termination_reason: string;
|
|
117
|
+
}
|
|
118
|
+
export type KnowledgeLookupFinishValidation = {
|
|
119
|
+
readonly valid: true;
|
|
120
|
+
readonly finish: KnowledgeLookupFinishProposal;
|
|
121
|
+
} | {
|
|
122
|
+
readonly valid: false;
|
|
123
|
+
readonly code: string;
|
|
124
|
+
readonly message: string;
|
|
125
|
+
};
|
|
126
|
+
export interface KnowledgeLookupResultData {
|
|
127
|
+
readonly lookup_id: string | null;
|
|
128
|
+
readonly revision: number | null;
|
|
129
|
+
readonly attempt_id: string | null;
|
|
130
|
+
readonly outcome: KnowledgeLookupOutcome;
|
|
131
|
+
readonly searched_scope: KnowledgeLookupScope;
|
|
132
|
+
readonly references: KnowledgeLookupReference[];
|
|
133
|
+
readonly available_fields: string[];
|
|
134
|
+
readonly missing_fields: string[];
|
|
135
|
+
readonly coverage: 'complete' | 'partial' | 'unknown';
|
|
136
|
+
readonly absence_confirmed: false;
|
|
137
|
+
readonly body: Record<string, unknown> | null;
|
|
138
|
+
readonly action: KnowledgeLookupAction;
|
|
139
|
+
readonly error_kind?: string;
|
|
140
|
+
readonly proposed_finish?: KnowledgeLookupFinishProposal;
|
|
141
|
+
readonly model_metadata?: {
|
|
142
|
+
readonly assessment?: 'sufficient' | 'insufficient';
|
|
143
|
+
readonly missing_information: string[];
|
|
144
|
+
readonly why_different?: string;
|
|
145
|
+
readonly based_on_attempt_ids: string[];
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export interface KnowledgeLookupToolResult {
|
|
149
|
+
readonly status: KnowledgeLookupDependencyStatus;
|
|
150
|
+
readonly scope: KnowledgeLookupScope;
|
|
151
|
+
readonly data?: KnowledgeLookupResultData;
|
|
152
|
+
readonly error?: KnowledgeLookupError;
|
|
153
|
+
}
|
|
154
|
+
/** Public roots accepted in a projection. Unknown payload roots are dropped. */
|
|
155
|
+
export declare const KNOWLEDGE_LOOKUP_ALLOWED_FIELD_ROOTS: Set<string>;
|
|
156
|
+
/**
|
|
157
|
+
* Validate field paths at a host boundary without exposing the lookup
|
|
158
|
+
* implementation's input-error class. The continuation host uses this
|
|
159
|
+
* result before it freezes required_fields, so both boundaries enforce the
|
|
160
|
+
* same public and forbidden roots.
|
|
161
|
+
*/
|
|
162
|
+
export type KnowledgeLookupFieldValidation = {
|
|
163
|
+
readonly valid: true;
|
|
164
|
+
readonly fields: string[];
|
|
165
|
+
} | {
|
|
166
|
+
readonly valid: false;
|
|
167
|
+
readonly code: string;
|
|
168
|
+
readonly message: string;
|
|
169
|
+
};
|
|
170
|
+
export declare function validateKnowledgeLookupFields(value: unknown, label?: string): KnowledgeLookupFieldValidation;
|
|
171
|
+
/**
|
|
172
|
+
* Validate and normalize the public finish proposal shape. The continuation
|
|
173
|
+
* host calls this before its evidence checks so the API and host enforce the
|
|
174
|
+
* same bounds, identifier rules, and public field paths.
|
|
175
|
+
*/
|
|
176
|
+
export declare function validateKnowledgeLookupFinish(value: unknown): KnowledgeLookupFinishValidation;
|
|
177
|
+
export declare const knowledgeLookupTools: Tool[];
|
|
178
|
+
export declare function handleKnowledgeLookupToolCall(name: string, args: Record<string, unknown>, dependencies: KnowledgeLookupDependencies): Promise<KnowledgeLookupToolResult | null>;
|