@longtable/memory 0.1.45 → 0.1.48
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/state.js +32 -4
- package/dist/types.d.ts +6 -2
- package/package.json +2 -2
package/dist/state.js
CHANGED
|
@@ -17,7 +17,11 @@ export function createEmptyResearchState() {
|
|
|
17
17
|
invocationLog: [],
|
|
18
18
|
questionLog: [],
|
|
19
19
|
artifactRecords: [],
|
|
20
|
-
narrativeTraces: []
|
|
20
|
+
narrativeTraces: [],
|
|
21
|
+
interviewTurns: [],
|
|
22
|
+
evidenceRecords: [],
|
|
23
|
+
specPatches: [],
|
|
24
|
+
specRevisions: []
|
|
21
25
|
};
|
|
22
26
|
}
|
|
23
27
|
export function addInferredHypothesis(state, hypothesis) {
|
|
@@ -46,6 +50,10 @@ export function promoteHypothesisToExplicitState(state, hypothesisText, explicit
|
|
|
46
50
|
questionLog: state.questionLog ?? [],
|
|
47
51
|
artifactRecords: state.artifactRecords,
|
|
48
52
|
narrativeTraces: state.narrativeTraces,
|
|
53
|
+
interviewTurns: state.interviewTurns ?? [],
|
|
54
|
+
evidenceRecords: state.evidenceRecords ?? [],
|
|
55
|
+
specPatches: state.specPatches ?? [],
|
|
56
|
+
specRevisions: state.specRevisions ?? [],
|
|
49
57
|
studyContract: state.studyContract
|
|
50
58
|
};
|
|
51
59
|
}
|
|
@@ -114,6 +122,10 @@ export function restoreWorkingState(state) {
|
|
|
114
122
|
questionLog: [...(state.questionLog ?? [])],
|
|
115
123
|
artifactRecords: [...state.artifactRecords],
|
|
116
124
|
narrativeTraces: [...state.narrativeTraces],
|
|
125
|
+
interviewTurns: [...(state.interviewTurns ?? [])],
|
|
126
|
+
evidenceRecords: [...(state.evidenceRecords ?? [])],
|
|
127
|
+
specPatches: [...(state.specPatches ?? [])],
|
|
128
|
+
specRevisions: [...(state.specRevisions ?? [])],
|
|
117
129
|
studyContract: state.studyContract
|
|
118
130
|
? {
|
|
119
131
|
...state.studyContract,
|
|
@@ -141,7 +153,15 @@ export function summarizeForCheckpoint(state, mode) {
|
|
|
141
153
|
: state.artifactRecords.slice(-2),
|
|
142
154
|
narrativeTraces: mode === "commit" || mode === "submit"
|
|
143
155
|
? state.narrativeTraces.slice(-5)
|
|
144
|
-
: state.narrativeTraces.slice(-2)
|
|
156
|
+
: state.narrativeTraces.slice(-2),
|
|
157
|
+
interviewTurns: mode === "commit" || mode === "submit"
|
|
158
|
+
? (state.interviewTurns ?? []).slice(-5)
|
|
159
|
+
: (state.interviewTurns ?? []).slice(-2),
|
|
160
|
+
evidenceRecords: mode === "commit" || mode === "submit"
|
|
161
|
+
? (state.evidenceRecords ?? []).slice(-5)
|
|
162
|
+
: (state.evidenceRecords ?? []).slice(-2),
|
|
163
|
+
specPatches: (state.specPatches ?? []).slice(-3),
|
|
164
|
+
specRevisions: (state.specRevisions ?? []).slice(-3)
|
|
145
165
|
};
|
|
146
166
|
}
|
|
147
167
|
export function summarizeStateForMode(state, mode) {
|
|
@@ -154,7 +174,11 @@ export function summarizeStateForMode(state, mode) {
|
|
|
154
174
|
invocationLog: [],
|
|
155
175
|
questionLog: [],
|
|
156
176
|
artifactRecords: [],
|
|
157
|
-
narrativeTraces: []
|
|
177
|
+
narrativeTraces: [],
|
|
178
|
+
interviewTurns: [],
|
|
179
|
+
evidenceRecords: [],
|
|
180
|
+
specPatches: [],
|
|
181
|
+
specRevisions: []
|
|
158
182
|
};
|
|
159
183
|
if (mode === "explore" || mode === "review" || mode === "draft") {
|
|
160
184
|
return baseSummary;
|
|
@@ -174,6 +198,10 @@ export function summarizeStateForMode(state, mode) {
|
|
|
174
198
|
invocationLog: (state.invocationLog ?? []).slice(-3),
|
|
175
199
|
questionLog: (state.questionLog ?? []).slice(-3),
|
|
176
200
|
artifactRecords: state.artifactRecords.slice(-3),
|
|
177
|
-
narrativeTraces: state.narrativeTraces.slice(-3)
|
|
201
|
+
narrativeTraces: state.narrativeTraces.slice(-3),
|
|
202
|
+
interviewTurns: (state.interviewTurns ?? []).slice(-3),
|
|
203
|
+
evidenceRecords: (state.evidenceRecords ?? []).slice(-3),
|
|
204
|
+
specPatches: (state.specPatches ?? []).slice(-3),
|
|
205
|
+
specRevisions: (state.specRevisions ?? []).slice(-3)
|
|
178
206
|
};
|
|
179
207
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArtifactRecord, DecisionRecord, InferredHypothesis, InvocationRecord, NarrativeTrace, QuestionRecord } from "@longtable/core";
|
|
1
|
+
import type { ArtifactRecord, DecisionRecord, EvidenceRecord, InferredHypothesis, InvocationRecord, NarrativeTrace, QuestionRecord, ResearchSpecificationPatch, ResearchSpecificationRevision, LongTableInterviewTurn } from "@longtable/core";
|
|
2
2
|
export interface MemorySummary {
|
|
3
3
|
explicitState: Record<string, unknown>;
|
|
4
4
|
workingState: Record<string, unknown>;
|
|
@@ -9,5 +9,9 @@ export interface MemorySummary {
|
|
|
9
9
|
questionLog: QuestionRecord[];
|
|
10
10
|
artifactRecords: ArtifactRecord[];
|
|
11
11
|
narrativeTraces: NarrativeTrace[];
|
|
12
|
+
interviewTurns?: LongTableInterviewTurn[];
|
|
13
|
+
evidenceRecords?: EvidenceRecord[];
|
|
14
|
+
specPatches?: ResearchSpecificationPatch[];
|
|
15
|
+
specRevisions?: ResearchSpecificationRevision[];
|
|
12
16
|
}
|
|
13
|
-
export type { ArtifactRecord, DecisionRecord, InferredHypothesis, InteractionMode, InvocationRecord, NarrativeTrace, QuestionRecord, ResearchState } from "@longtable/core";
|
|
17
|
+
export type { ArtifactRecord, DecisionRecord, EvidenceRecord, InferredHypothesis, InteractionMode, InvocationRecord, LongTableInterviewTurn, NarrativeTrace, QuestionRecord, ResearchSpecificationPatch, ResearchSpecificationRevision, ResearchState } from "@longtable/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longtable/memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Memory contracts for LongTable explicit state, inferred hypotheses, and open tensions",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@longtable/core": "0.1.
|
|
24
|
+
"@longtable/core": "0.1.48"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"typescript": "^5.6.0"
|