@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,120 @@
|
|
|
1
|
+
/** The context header used by the v1 register and search contracts. */
|
|
2
|
+
export declare const PERSONAL_KNOWLEDGE_CONTEXT_HEADER = "X-Brainbase-Personal-Context";
|
|
3
|
+
export declare const PERSONAL_KNOWLEDGE_CONTEXT_VERSION_HEADER = "X-Brainbase-Personal-Context-Version";
|
|
4
|
+
/** Short alias retained for consumers that call this a personal context header. */
|
|
5
|
+
export declare const PERSONAL_CONTEXT_HEADER = "X-Brainbase-Personal-Context";
|
|
6
|
+
export declare const PERSONAL_KNOWLEDGE_CONTRACT_VERSION: 1;
|
|
7
|
+
export declare const PERSONAL_KNOWLEDGE_LOCAL_DIRECTORY = "personal-knowledge-v1";
|
|
8
|
+
export type PersonalKnowledgeScope = 'personal_owned' | 'organization_private';
|
|
9
|
+
export type PersonalKnowledgeStorageMode = 'local' | 'managed_cloud';
|
|
10
|
+
export interface PersonalKnowledgeContext {
|
|
11
|
+
contract_version: typeof PERSONAL_KNOWLEDGE_CONTRACT_VERSION;
|
|
12
|
+
scope: PersonalKnowledgeScope;
|
|
13
|
+
owner_person_id: string;
|
|
14
|
+
organization_id: string | null;
|
|
15
|
+
source_id: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PersonalKnowledgeContextError extends Error {
|
|
18
|
+
readonly code: string;
|
|
19
|
+
readonly field?: string;
|
|
20
|
+
constructor(message: string, code?: string, field?: string);
|
|
21
|
+
}
|
|
22
|
+
/** Validate and return a copy of a strict v1 context object. */
|
|
23
|
+
export declare function validatePersonalKnowledgeContext(value: unknown): PersonalKnowledgeContext;
|
|
24
|
+
export declare const assertPersonalKnowledgeContext: typeof validatePersonalKnowledgeContext;
|
|
25
|
+
/** Encode a trusted expected context for `X-Brainbase-Personal-Context`. */
|
|
26
|
+
export declare function encodePersonalKnowledgeContextHeader(value: unknown): string;
|
|
27
|
+
export declare const encodeExpectedPersonalKnowledgeContextHeader: typeof encodePersonalKnowledgeContextHeader;
|
|
28
|
+
/** Decode and strictly validate a v1 context header. */
|
|
29
|
+
export declare function decodePersonalKnowledgeContextHeader(value: unknown): PersonalKnowledgeContext;
|
|
30
|
+
export declare const decodeExpectedPersonalKnowledgeContextHeader: typeof decodePersonalKnowledgeContextHeader;
|
|
31
|
+
/** Assert that two contexts identify exactly the same source of truth. */
|
|
32
|
+
export declare function assertPersonalKnowledgeContextMatch(expected: unknown, actual: unknown): PersonalKnowledgeContext;
|
|
33
|
+
export interface PersonalKnowledgeEvent {
|
|
34
|
+
event_id: string;
|
|
35
|
+
body: string;
|
|
36
|
+
body_hash: string;
|
|
37
|
+
occurred_at?: string;
|
|
38
|
+
captured_at?: string;
|
|
39
|
+
source?: unknown;
|
|
40
|
+
source_pointer?: unknown;
|
|
41
|
+
parent_episode_id?: string | null;
|
|
42
|
+
permission_snapshot?: Record<string, unknown>;
|
|
43
|
+
sensitivity?: string;
|
|
44
|
+
kind?: string;
|
|
45
|
+
type?: string;
|
|
46
|
+
tags?: string[];
|
|
47
|
+
metadata?: Record<string, unknown>;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
export type PersonalKnowledgeEventInput = Omit<PersonalKnowledgeEvent, 'body_hash'> & {
|
|
51
|
+
body_hash?: string;
|
|
52
|
+
content?: string;
|
|
53
|
+
};
|
|
54
|
+
/** Normalize a caller event without allowing caller-controlled identity fields. */
|
|
55
|
+
export declare function normalizePersonalKnowledgeEvent(value: unknown): PersonalKnowledgeEvent;
|
|
56
|
+
export declare function normalizePersonalKnowledgeSearchInput(query: string, limit?: number): {
|
|
57
|
+
query: string;
|
|
58
|
+
limit: number;
|
|
59
|
+
};
|
|
60
|
+
export interface PersonalKnowledgeContextEnvelope {
|
|
61
|
+
context: PersonalKnowledgeContext;
|
|
62
|
+
}
|
|
63
|
+
export interface PersonalKnowledgeRegisterEnvelope extends PersonalKnowledgeContextEnvelope {
|
|
64
|
+
event: PersonalKnowledgeEvent;
|
|
65
|
+
}
|
|
66
|
+
export interface PersonalKnowledgeSearchEnvelope extends PersonalKnowledgeContextEnvelope {
|
|
67
|
+
results: PersonalKnowledgeEvent[];
|
|
68
|
+
}
|
|
69
|
+
export interface PersonalKnowledgeStore {
|
|
70
|
+
readonly mode: 'local';
|
|
71
|
+
readonly dataDir: string;
|
|
72
|
+
getContext(): Promise<PersonalKnowledgeContextEnvelope>;
|
|
73
|
+
register(event: PersonalKnowledgeEventInput): Promise<PersonalKnowledgeRegisterEnvelope>;
|
|
74
|
+
search(query: string, limit?: number): Promise<PersonalKnowledgeSearchEnvelope>;
|
|
75
|
+
}
|
|
76
|
+
export interface PersonalKnowledgeStoreOptions {
|
|
77
|
+
/** Parent Personal OS directory. The v1 store always uses a child directory. */
|
|
78
|
+
dataDir?: string;
|
|
79
|
+
/** Trusted context from configuration; never a model-controlled MCP argument. */
|
|
80
|
+
context?: PersonalKnowledgeContext;
|
|
81
|
+
ownerPersonId?: string;
|
|
82
|
+
sourceId?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare function createLocalPersonalKnowledgeStore(options?: PersonalKnowledgeStoreOptions): PersonalKnowledgeStore;
|
|
85
|
+
export declare const createPersonalKnowledgeStore: typeof createLocalPersonalKnowledgeStore;
|
|
86
|
+
export interface PersonalKnowledgeClientOptions {
|
|
87
|
+
mode: PersonalKnowledgeStorageMode;
|
|
88
|
+
apiUrl: string;
|
|
89
|
+
expectedContext: PersonalKnowledgeContext;
|
|
90
|
+
token?: string;
|
|
91
|
+
getToken?: () => Promise<string>;
|
|
92
|
+
tokenManager?: {
|
|
93
|
+
getToken(): Promise<string>;
|
|
94
|
+
};
|
|
95
|
+
fetch?: FetchLike;
|
|
96
|
+
}
|
|
97
|
+
type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
98
|
+
export declare class PersonalKnowledgeClientError extends Error {
|
|
99
|
+
readonly status: number | null;
|
|
100
|
+
readonly responseBody: unknown;
|
|
101
|
+
constructor(message: string, options?: {
|
|
102
|
+
status?: number | null;
|
|
103
|
+
responseBody?: unknown;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export declare function normalizePersonalKnowledgeApiUrl(apiUrl: string, mode: PersonalKnowledgeStorageMode): string;
|
|
107
|
+
export declare class PersonalKnowledgeClient {
|
|
108
|
+
readonly mode: PersonalKnowledgeStorageMode;
|
|
109
|
+
readonly apiUrl: string;
|
|
110
|
+
readonly expectedContext: PersonalKnowledgeContext;
|
|
111
|
+
private readonly getToken;
|
|
112
|
+
private readonly fetchImpl;
|
|
113
|
+
constructor(options: PersonalKnowledgeClientOptions);
|
|
114
|
+
getContext(): Promise<PersonalKnowledgeContextEnvelope>;
|
|
115
|
+
register(input: PersonalKnowledgeEventInput): Promise<PersonalKnowledgeRegisterEnvelope>;
|
|
116
|
+
search(query: string, limit?: number): Promise<PersonalKnowledgeSearchEnvelope>;
|
|
117
|
+
private request;
|
|
118
|
+
}
|
|
119
|
+
export declare function createPersonalKnowledgeClient(options: PersonalKnowledgeClientOptions): PersonalKnowledgeClient;
|
|
120
|
+
export {};
|