@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
package/dist/judgment-dag.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export { JUDGMENT_DAG_EDGE_RELATIONS, JUDGMENT_DAG_ALLOWED_KEYS, JUDGMENT_DAG_LA
|
|
|
8
8
|
export { executeJudgmentDAG, JudgmentDAGExecutionError } from './judgment-dag-runner.js';
|
|
9
9
|
export { computeJudgmentDAGRunArtifactId, JUDGMENT_DAG_RUN_ARTIFACT_VERSION, JudgmentDAGArtifactError, loadJudgmentDAGRunArtifact, saveJudgmentDAGRunArtifact } from './judgment-dag-artifact-store.js';
|
|
10
10
|
export { JUDGMENT_DAG_EVALUATION_EVENT_SET_VERSION, JUDGMENT_DAG_OUTCOME_ATTACHMENT_VERSION, JudgmentDAGReplayEvaluationError, createJudgmentDAGEvaluationEventSet, createJudgmentDAGOutcomeAttachment, evaluateJudgmentDAGVersions, replayJudgmentDAGRun } from './judgment-dag-replay-evaluation.js';
|
|
11
|
+
export { JUDGMENT_DAG_COMPOSITION_STATUSES, JUDGMENT_DAG_COMPOSITION_VERSION, JUDGMENT_DAG_SUBDAG_STATUSES, JudgmentDAGCompositionError, assertValidJudgmentDAGComposition, createJudgmentDAGCompositionDefinition, executeJudgmentDAGComposition, validateJudgmentDAGComposition } from './judgment-dag-composition.js';
|
|
11
12
|
export type { JudgmentDAG, JudgmentDAGEdge, JudgmentDAGEdgeRelation, JudgmentDAGLayer, JudgmentDAGMetadata, JudgmentDAGNode, JudgmentDAGNodeType, JudgmentDAGRunnerType, JudgmentDAGScope, JudgmentDAGScopeType, JudgmentDAGValidationCode, JudgmentDAGValidationDetails, JudgmentDAGValidationResult } from './judgment-dag-core.js';
|
|
12
13
|
export type { JudgmentDAGDependencyOutput, JudgmentDAGExecutionCode, JudgmentDAGExecutionErrorDetails, JudgmentDAGJSONValue, JudgmentDAGNodeRunRecord, JudgmentDAGRunRecord, JudgmentDAGRunRequest, JudgmentDAGRunnerFailureKind, JudgmentDAGRunnerInput, JudgmentDAGRunnerRegistration, JudgmentDAGRunnerVersion } from './judgment-dag-runner.js';
|
|
13
14
|
export type { JudgmentDAGArtifactErrorCode, JudgmentDAGRunArtifactId, JudgmentDAGRunArtifactReceipt, LoadJudgmentDAGRunArtifactRequest, SaveJudgmentDAGRunArtifactRequest } from './judgment-dag-artifact-store.js';
|
|
14
15
|
export type { CreateJudgmentDAGEvaluationEventSetRequest, CreateJudgmentDAGOutcomeAttachmentRequest, EvaluateJudgmentDAGVersionsRequest, JudgmentDAGEvaluationCriterion, JudgmentDAGEvaluationEvent, JudgmentDAGEvaluationEventSet, JudgmentDAGEvaluationRun, JudgmentDAGEvaluationScoring, JudgmentDAGNodeCalibration, JudgmentDAGNodeCalibrationStatus, JudgmentDAGOutcomeAttachment, JudgmentDAGOutcomeObservation, JudgmentDAGReplayEvaluationErrorCode, JudgmentDAGReplayResult, JudgmentDAGRunArtifactReference, JudgmentDAGScoreSummary, JudgmentDAGVersionComparison, ReplayJudgmentDAGRunRequest } from './judgment-dag-replay-evaluation.js';
|
|
16
|
+
export type { JudgmentDAGCompositionChildRunSource, JudgmentDAGCompositionDefinition, JudgmentDAGCompositionErrorCode, JudgmentDAGCompositionRunRecord, JudgmentDAGCompositionRunRequest, JudgmentDAGCompositionStatus, JudgmentDAGCompositionValidationResult, JudgmentDAGDelegationScope, JudgmentDAGEvidenceReference, JudgmentDAGInputOutputContractValidationRequest, JudgmentDAGInputOutputContractValidator, JudgmentDAGProblemSnapshotId, JudgmentDAGProblemSnapshotReadRequest, JudgmentDAGProblemSnapshotReadResult, JudgmentDAGProblemSnapshotReader, JudgmentDAGProblemSnapshotReference, JudgmentDAGRunReference, JudgmentDAGRunArtifactReadRequest, JudgmentDAGRunArtifactReader, JudgmentDAGSubDAGDefinition, JudgmentDAGSubDAGExecutionPort, JudgmentDAGSubDAGExecutionRequest, JudgmentDAGSubDAGEvaluationPort, JudgmentDAGSubDAGResult, JudgmentDAGSubDAGRunRecord, JudgmentDAGSubDAGStatus, JudgmentDAGVersionResolution, JudgmentDAGVersionReference, JudgmentDAGVersionResolver, JudgmentDAGVersionResolverRequest } from './judgment-dag-composition.js';
|
package/dist/judgment-dag.js
CHANGED
|
@@ -8,3 +8,4 @@ export { JUDGMENT_DAG_EDGE_RELATIONS, JUDGMENT_DAG_ALLOWED_KEYS, JUDGMENT_DAG_LA
|
|
|
8
8
|
export { executeJudgmentDAG, JudgmentDAGExecutionError } from './judgment-dag-runner.js';
|
|
9
9
|
export { computeJudgmentDAGRunArtifactId, JUDGMENT_DAG_RUN_ARTIFACT_VERSION, JudgmentDAGArtifactError, loadJudgmentDAGRunArtifact, saveJudgmentDAGRunArtifact } from './judgment-dag-artifact-store.js';
|
|
10
10
|
export { JUDGMENT_DAG_EVALUATION_EVENT_SET_VERSION, JUDGMENT_DAG_OUTCOME_ATTACHMENT_VERSION, JudgmentDAGReplayEvaluationError, createJudgmentDAGEvaluationEventSet, createJudgmentDAGOutcomeAttachment, evaluateJudgmentDAGVersions, replayJudgmentDAGRun } from './judgment-dag-replay-evaluation.js';
|
|
11
|
+
export { JUDGMENT_DAG_COMPOSITION_STATUSES, JUDGMENT_DAG_COMPOSITION_VERSION, JUDGMENT_DAG_SUBDAG_STATUSES, JudgmentDAGCompositionError, assertValidJudgmentDAGComposition, createJudgmentDAGCompositionDefinition, executeJudgmentDAGComposition, validateJudgmentDAGComposition } from './judgment-dag-composition.js';
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { type FoundationDefinition, type FoundationAcl, type FoundationRevision } from './ontology-foundation.js';
|
|
2
|
+
/**
|
|
3
|
+
* An immutable input bundle for one judgment.
|
|
4
|
+
*
|
|
5
|
+
* The bundle deliberately stores references to canonical objects instead of
|
|
6
|
+
* copying Objective, Model, or Constraint definitions into a second SSOT.
|
|
7
|
+
* Providers validate those references at the boundary of save/load.
|
|
8
|
+
*/
|
|
9
|
+
export declare const JUDGMENT_PROBLEM_SNAPSHOT_VERSION: "judgment-problem-snapshot.v1";
|
|
10
|
+
export type JudgmentProblemSnapshotId = `sha256:${string}`;
|
|
11
|
+
export type JudgmentProblemReferenceKind = 'objective' | 'criterion' | 'variable' | 'observation' | 'model' | 'constraint' | 'authority' | 'resource' | 'deadline' | 'dag' | 'evidence';
|
|
12
|
+
export type JudgmentProblemScopeType = 'personal' | 'project' | 'organization';
|
|
13
|
+
export interface JudgmentProblemScope {
|
|
14
|
+
readonly type: JudgmentProblemScopeType;
|
|
15
|
+
readonly id: string;
|
|
16
|
+
}
|
|
17
|
+
export interface JudgmentProblemEvidenceAccess extends FoundationAcl {
|
|
18
|
+
}
|
|
19
|
+
export type JudgmentProblemJSONValue = null | string | boolean | number | JudgmentProblemJSONValue[] | {
|
|
20
|
+
readonly [key: string]: JudgmentProblemJSONValue;
|
|
21
|
+
};
|
|
22
|
+
export interface JudgmentProblemEvidenceBinding {
|
|
23
|
+
readonly mode: 'embedded_content' | 'immutable_reference';
|
|
24
|
+
readonly digest: JudgmentProblemSnapshotId;
|
|
25
|
+
readonly reference_id?: string;
|
|
26
|
+
readonly reference_revision?: string;
|
|
27
|
+
readonly content?: JudgmentProblemJSONValue;
|
|
28
|
+
readonly access: JudgmentProblemEvidenceAccess;
|
|
29
|
+
}
|
|
30
|
+
export interface JudgmentProblemReference {
|
|
31
|
+
readonly kind: JudgmentProblemReferenceKind;
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly revision: string;
|
|
34
|
+
readonly digest: JudgmentProblemSnapshotId;
|
|
35
|
+
readonly scope: JudgmentProblemScope;
|
|
36
|
+
readonly valid_from: string;
|
|
37
|
+
readonly valid_to?: string | null;
|
|
38
|
+
readonly evidence?: JudgmentProblemEvidenceBinding;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Stable name shared by sub-DAG and reservation consumers. A ProblemRef is
|
|
42
|
+
* intentionally only a versioned, scoped reference; it never carries an
|
|
43
|
+
* execution grant or a mutable canonical definition.
|
|
44
|
+
*/
|
|
45
|
+
export type ProblemRef = JudgmentProblemReference;
|
|
46
|
+
export interface JudgmentProblemSnapshot {
|
|
47
|
+
readonly snapshot_version: typeof JUDGMENT_PROBLEM_SNAPSHOT_VERSION;
|
|
48
|
+
readonly problem_id: string;
|
|
49
|
+
readonly revision: string;
|
|
50
|
+
readonly question: string;
|
|
51
|
+
readonly owner_scope: JudgmentProblemScope;
|
|
52
|
+
readonly references: readonly JudgmentProblemReference[];
|
|
53
|
+
/** A FoundationAcl keeps owner/readers/writers separate from truth status. */
|
|
54
|
+
readonly read_policy: FoundationAcl;
|
|
55
|
+
/** A snapshot never grants execution permission. */
|
|
56
|
+
readonly execution_permission: 'none';
|
|
57
|
+
readonly created_at: string;
|
|
58
|
+
}
|
|
59
|
+
export interface JudgmentProblemSnapshotAccessContext {
|
|
60
|
+
/** Identity resolved by the caller's trusted boundary. */
|
|
61
|
+
readonly principal: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* `current` revalidates canonical references for a new judgment. `historical`
|
|
65
|
+
* rechecks only the current read ACL and exact digest of each canonical
|
|
66
|
+
* reference, while preserving the recorded use/applicability conditions for
|
|
67
|
+
* audit/replay. Neither mode grants execution.
|
|
68
|
+
*/
|
|
69
|
+
export type JudgmentProblemReferenceResolutionMode = 'current' | 'historical';
|
|
70
|
+
/** The resolver phase makes historical ACL checks explicit at the port. */
|
|
71
|
+
export type JudgmentProblemReferenceResolutionPhase = 'save' | 'read' | 'historical_read';
|
|
72
|
+
export type JudgmentProblemSnapshotAccessAction = 'read' | 'write';
|
|
73
|
+
/**
|
|
74
|
+
* Organization-specific authorization is a provider boundary. The default
|
|
75
|
+
* implementation below is intentionally limited to the ACL carried by the
|
|
76
|
+
* snapshot; tenants can inject a provider that checks current authority.
|
|
77
|
+
*/
|
|
78
|
+
export interface JudgmentProblemSnapshotAccessProvider {
|
|
79
|
+
authorize(input: {
|
|
80
|
+
readonly action: JudgmentProblemSnapshotAccessAction;
|
|
81
|
+
readonly context: JudgmentProblemSnapshotAccessContext;
|
|
82
|
+
readonly acl: FoundationAcl;
|
|
83
|
+
readonly snapshot?: JudgmentProblemSnapshot;
|
|
84
|
+
readonly reference?: JudgmentProblemReference;
|
|
85
|
+
}): void | boolean | Promise<void | boolean>;
|
|
86
|
+
}
|
|
87
|
+
export type JudgmentProblemReferenceResolutionStatus = 'resolved' | 'missing' | 'not_applicable' | 'unauthorized' | 'unresolved';
|
|
88
|
+
export interface JudgmentProblemReferenceResolution {
|
|
89
|
+
readonly status: JudgmentProblemReferenceResolutionStatus;
|
|
90
|
+
/** The provider must return the digest of the exact revision it resolved. */
|
|
91
|
+
readonly digest?: JudgmentProblemSnapshotId;
|
|
92
|
+
readonly message?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A provider is the only place that knows how an Observation, authority,
|
|
96
|
+
* Model, or Constraint is resolved. This store does not duplicate their
|
|
97
|
+
* validation rules. It is called on save and on every load. A
|
|
98
|
+
* `historical_read` must still pass the provider's trusted current read ACL and
|
|
99
|
+
* exact revision/digest check, but must not re-evaluate recorded use or scope
|
|
100
|
+
* applicability.
|
|
101
|
+
*/
|
|
102
|
+
export interface JudgmentProblemReferenceProvider {
|
|
103
|
+
resolve(input: {
|
|
104
|
+
readonly reference: JudgmentProblemReference;
|
|
105
|
+
readonly phase: JudgmentProblemReferenceResolutionPhase;
|
|
106
|
+
readonly context: JudgmentProblemSnapshotAccessContext;
|
|
107
|
+
}): JudgmentProblemReferenceResolution | Promise<JudgmentProblemReferenceResolution>;
|
|
108
|
+
}
|
|
109
|
+
export interface SaveJudgmentProblemSnapshotRequest {
|
|
110
|
+
readonly root: string;
|
|
111
|
+
readonly snapshot: JudgmentProblemSnapshot;
|
|
112
|
+
readonly access: JudgmentProblemSnapshotAccessContext;
|
|
113
|
+
readonly accessProvider?: JudgmentProblemSnapshotAccessProvider;
|
|
114
|
+
readonly referenceProvider: JudgmentProblemReferenceProvider;
|
|
115
|
+
}
|
|
116
|
+
export interface LoadJudgmentProblemSnapshotRequest {
|
|
117
|
+
readonly root: string;
|
|
118
|
+
readonly snapshot_id?: string;
|
|
119
|
+
readonly problem_id?: string;
|
|
120
|
+
readonly revision?: string;
|
|
121
|
+
readonly access: JudgmentProblemSnapshotAccessContext;
|
|
122
|
+
readonly accessProvider?: JudgmentProblemSnapshotAccessProvider;
|
|
123
|
+
/** Defaults to `current`; historical reads still require the provider for current ACL/digest checks. */
|
|
124
|
+
readonly reference_resolution?: JudgmentProblemReferenceResolutionMode;
|
|
125
|
+
readonly referenceProvider?: JudgmentProblemReferenceProvider;
|
|
126
|
+
}
|
|
127
|
+
export interface JudgmentProblemSnapshotReceipt {
|
|
128
|
+
readonly snapshot_id: JudgmentProblemSnapshotId;
|
|
129
|
+
readonly snapshot_version: typeof JUDGMENT_PROBLEM_SNAPSHOT_VERSION;
|
|
130
|
+
readonly problem_id: string;
|
|
131
|
+
readonly revision: string;
|
|
132
|
+
readonly status: 'created' | 'existing';
|
|
133
|
+
}
|
|
134
|
+
export type JudgmentProblemSnapshotErrorCode = 'invalid_request' | 'missing_reference' | 'not_applicable' | 'unresolved_constraint' | 'unauthorized' | 'not_found' | 'conflict' | 'integrity_mismatch' | 'storage_io_error';
|
|
135
|
+
export declare class JudgmentProblemSnapshotError extends Error {
|
|
136
|
+
readonly code: JudgmentProblemSnapshotErrorCode;
|
|
137
|
+
readonly reference?: JudgmentProblemReference;
|
|
138
|
+
constructor(code: JudgmentProblemSnapshotErrorCode, message: string, options?: {
|
|
139
|
+
readonly reference?: JudgmentProblemReference;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
export declare const defaultJudgmentProblemSnapshotAccessProvider: JudgmentProblemSnapshotAccessProvider;
|
|
143
|
+
/**
|
|
144
|
+
* Derive the content address without writing. This validates only the
|
|
145
|
+
* snapshot shape; canonical reference resolution belongs to providers.
|
|
146
|
+
*/
|
|
147
|
+
export declare function computeJudgmentProblemSnapshotId(value: JudgmentProblemSnapshot): JudgmentProblemSnapshotId;
|
|
148
|
+
export declare function saveJudgmentProblemSnapshot(request: SaveJudgmentProblemSnapshotRequest): Promise<JudgmentProblemSnapshotReceipt>;
|
|
149
|
+
export declare function loadJudgmentProblemSnapshot(request: LoadJudgmentProblemSnapshotRequest): Promise<JudgmentProblemSnapshot>;
|
|
150
|
+
/** Structural adapter for FoundationRevisionStore-like readers. */
|
|
151
|
+
export interface JudgmentProblemFoundationReferenceReader {
|
|
152
|
+
read(reference: FoundationRevision, context: {
|
|
153
|
+
readonly principal: string;
|
|
154
|
+
}): Promise<{
|
|
155
|
+
readonly digest: string;
|
|
156
|
+
readonly definition?: unknown;
|
|
157
|
+
} | null>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Adapt the generic foundation store to the snapshot resolver. The store
|
|
161
|
+
* read and exact digest check always run before an optional caller validator.
|
|
162
|
+
* `save`/`read` additionally validate the definition for judgment use and
|
|
163
|
+
* reference scope. `historical_read` deliberately skips those past-use and
|
|
164
|
+
* applicability checks, but the trusted store must still enforce its current
|
|
165
|
+
* read ACL; an old revision cannot be read through a revoked current ACL.
|
|
166
|
+
* The optional validator can add organization-specific policy, but cannot
|
|
167
|
+
* bypass the canonical store or digest check.
|
|
168
|
+
*/
|
|
169
|
+
export declare function createJudgmentProblemFoundationReferenceProvider(options: {
|
|
170
|
+
readonly store: JudgmentProblemFoundationReferenceReader;
|
|
171
|
+
readonly validate?: (input: {
|
|
172
|
+
readonly reference: JudgmentProblemReference;
|
|
173
|
+
readonly phase: JudgmentProblemReferenceResolutionPhase;
|
|
174
|
+
readonly context: JudgmentProblemSnapshotAccessContext;
|
|
175
|
+
readonly record: {
|
|
176
|
+
readonly definition: FoundationDefinition;
|
|
177
|
+
readonly digest: string;
|
|
178
|
+
};
|
|
179
|
+
}) => JudgmentProblemReferenceResolution | Promise<JudgmentProblemReferenceResolution>;
|
|
180
|
+
readonly resolveOther?: (input: {
|
|
181
|
+
readonly reference: JudgmentProblemReference;
|
|
182
|
+
readonly phase: JudgmentProblemReferenceResolutionPhase;
|
|
183
|
+
readonly context: JudgmentProblemSnapshotAccessContext;
|
|
184
|
+
}) => JudgmentProblemReferenceResolution | Promise<JudgmentProblemReferenceResolution>;
|
|
185
|
+
}): JudgmentProblemReferenceProvider;
|