@isparling/engram-harness 0.1.0 → 0.2.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/package.json +5 -1
- package/src/captureTypes.ts +31 -0
- package/src/knowledgeTypes.ts +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isparling/engram-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -11,11 +11,15 @@
|
|
|
11
11
|
},
|
|
12
12
|
"./knowledge-types": {
|
|
13
13
|
"import": "./src/knowledgeTypes.ts"
|
|
14
|
+
},
|
|
15
|
+
"./capture-types": {
|
|
16
|
+
"import": "./src/captureTypes.ts"
|
|
14
17
|
}
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
17
20
|
"src/packTypes.ts",
|
|
18
21
|
"src/knowledgeTypes.ts",
|
|
22
|
+
"src/captureTypes.ts",
|
|
19
23
|
"README.md"
|
|
20
24
|
],
|
|
21
25
|
"publishConfig": {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Public host-capture DTOs shared between the OMP adapter and external packs.
|
|
2
|
+
// JSON-safe by construction: these shapes cross process boundaries verbatim,
|
|
3
|
+
// so they deliberately carry no functions, classes, or host handles.
|
|
4
|
+
|
|
5
|
+
import type { JsonObject, KnowledgeError, KnowledgeRecord } from "./knowledgeTypes.ts";
|
|
6
|
+
|
|
7
|
+
export type CaptureMutationView = {
|
|
8
|
+
recordId: string;
|
|
9
|
+
action: "create" | "update";
|
|
10
|
+
beforeHash: string | null;
|
|
11
|
+
after: KnowledgeRecord;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type HostCapturePreview =
|
|
15
|
+
| { schemaVersion: 0; status: "ready"; planHash: string; mutations: CaptureMutationView[] }
|
|
16
|
+
| { schemaVersion: 0; status: "blocked"; errors: KnowledgeError[] };
|
|
17
|
+
|
|
18
|
+
export type HostCaptureApply = {
|
|
19
|
+
schemaVersion: 0;
|
|
20
|
+
status: "committed" | "no-change" | "stale" | "failed";
|
|
21
|
+
planHash: string;
|
|
22
|
+
mutations: CaptureMutationView[];
|
|
23
|
+
index: "fresh" | "stale" | "not-attempted";
|
|
24
|
+
errors: string[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ArtifactReplacementResult = { status: "replaced" | "unchanged"; path: string };
|
|
28
|
+
|
|
29
|
+
export type CompletionRequest = { model: string; prompt: string; system: string; timeoutSeconds: number };
|
|
30
|
+
|
|
31
|
+
export type CaptureChangeSetInput = JsonObject;
|
package/src/knowledgeTypes.ts
CHANGED
|
@@ -121,11 +121,19 @@ export type PackReconciliation = {
|
|
|
121
121
|
mutations: PackMutation[];
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
+
export type RelatedRecordSelection =
|
|
125
|
+
| { mode: "search"; query: string }
|
|
126
|
+
| {
|
|
127
|
+
mode: "exact";
|
|
128
|
+
description: string;
|
|
129
|
+
matches: (record: KnowledgeRecord) => boolean;
|
|
130
|
+
};
|
|
131
|
+
|
|
124
132
|
export type KnowledgePack = {
|
|
125
133
|
id: string;
|
|
126
134
|
version: string;
|
|
127
135
|
validateEnvelope: (envelope: KnowledgeEnvelope) => KnowledgeResult<void>;
|
|
128
|
-
|
|
136
|
+
selectRelatedRecords: (envelope: KnowledgeEnvelope) => RelatedRecordSelection;
|
|
129
137
|
reconcile: (input: PackReconcileInput) => KnowledgeResult<PackReconciliation>;
|
|
130
138
|
};
|
|
131
139
|
|