@slicenfer/project-memory-runtime-core 0.3.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/LICENSE +674 -0
- package/README.md +12 -0
- package/dist/activation/engine.d.ts +27 -0
- package/dist/activation/engine.d.ts.map +1 -0
- package/dist/activation/engine.js +294 -0
- package/dist/activation/engine.js.map +1 -0
- package/dist/checkpoints.d.ts +12 -0
- package/dist/checkpoints.d.ts.map +1 -0
- package/dist/checkpoints.js +94 -0
- package/dist/checkpoints.js.map +1 -0
- package/dist/compiler/deterministic.d.ts +7 -0
- package/dist/compiler/deterministic.d.ts.map +1 -0
- package/dist/compiler/deterministic.js +385 -0
- package/dist/compiler/deterministic.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/ingestion/service.d.ts +7 -0
- package/dist/ingestion/service.d.ts.map +1 -0
- package/dist/ingestion/service.js +5 -0
- package/dist/ingestion/service.js.map +1 -0
- package/dist/recall/packet.d.ts +13 -0
- package/dist/recall/packet.d.ts.map +1 -0
- package/dist/recall/packet.js +155 -0
- package/dist/recall/packet.js.map +1 -0
- package/dist/runtime.d.ts +53 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +708 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scope.d.ts +6 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +50 -0
- package/dist/scope.js.map +1 -0
- package/dist/storage/migrations/001_init.sql +113 -0
- package/dist/storage/migrations/002_constraints.sql +148 -0
- package/dist/storage/migrations/003_event_provenance.sql +36 -0
- package/dist/storage/migrations/004_event_capture_path.sql +37 -0
- package/dist/storage/migrations/005_activation_indices.sql +15 -0
- package/dist/storage/migrations/006_session_checkpoints.sql +54 -0
- package/dist/storage/migrations.d.ts +6 -0
- package/dist/storage/migrations.d.ts.map +1 -0
- package/dist/storage/migrations.js +19 -0
- package/dist/storage/migrations.js.map +1 -0
- package/dist/storage/sqlite.d.ts +36 -0
- package/dist/storage/sqlite.d.ts.map +1 -0
- package/dist/storage/sqlite.js +601 -0
- package/dist/storage/sqlite.js.map +1 -0
- package/dist/types.d.ts +294 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +36 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +16 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +36 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation.d.ts +24 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +323 -0
- package/dist/validation.js.map +1 -0
- package/package.json +52 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
export type EventType = "user_message" | "agent_message" | "file_edit" | "command_result" | "test_result" | "build_result" | "lint_result" | "benchmark_result" | "deploy_result" | "git_commit" | "git_revert" | "pr_opened" | "pr_merged" | "pr_closed" | "issue_link" | "issue_closed" | "issue_reopened" | "human_edit_after_agent" | "manual_override" | "session_start" | "session_end" | "user_confirmation";
|
|
2
|
+
export declare const STABLE_OUTCOME_TYPES: readonly ["test_pass", "test_fail", "build_pass", "build_fail", "commit_kept", "commit_reverted", "issue_closed", "issue_reopened", "human_kept", "human_corrected", "manual_override"];
|
|
3
|
+
export type OutcomeType = (typeof STABLE_OUTCOME_TYPES)[number];
|
|
4
|
+
export declare const POSITIVE_OUTCOME_TYPES: readonly ["test_pass", "build_pass", "commit_kept", "issue_closed", "human_kept"];
|
|
5
|
+
export declare const NEGATIVE_OUTCOME_TYPES: readonly ["test_fail", "build_fail", "commit_reverted", "issue_reopened", "human_corrected", "manual_override"];
|
|
6
|
+
export declare const SESSION_CHECKPOINT_STATUSES: readonly ["active", "stale"];
|
|
7
|
+
export type SessionCheckpointStatus = (typeof SESSION_CHECKPOINT_STATUSES)[number];
|
|
8
|
+
export declare const SESSION_CHECKPOINT_SOURCES: readonly ["precompact", "session_end", "postcompact", "stop_failure"];
|
|
9
|
+
export type SessionCheckpointSource = (typeof SESSION_CHECKPOINT_SOURCES)[number];
|
|
10
|
+
export interface EventScope {
|
|
11
|
+
repo?: string;
|
|
12
|
+
branch?: string;
|
|
13
|
+
cwd?: string;
|
|
14
|
+
files?: string[];
|
|
15
|
+
}
|
|
16
|
+
export type EventSourceKind = "user" | "agent" | "system" | "operator" | "imported";
|
|
17
|
+
export type EventTrustLevel = "low" | "medium" | "high";
|
|
18
|
+
export type EventCapturePath = "fixture.user_confirmation" | "fixture.user_message" | "claude_code.hook.user_confirmation" | "claude_code.hook.user_message" | "import.transcript" | "system.tool_observation" | "operator.manual";
|
|
19
|
+
export interface NormalizedEvent {
|
|
20
|
+
id: string;
|
|
21
|
+
ts: string;
|
|
22
|
+
project_id: string;
|
|
23
|
+
agent_id: string;
|
|
24
|
+
agent_version: string;
|
|
25
|
+
event_type: EventType;
|
|
26
|
+
content: string;
|
|
27
|
+
session_id?: string;
|
|
28
|
+
workspace_id?: string;
|
|
29
|
+
repo_id?: string;
|
|
30
|
+
parent_event_id?: string;
|
|
31
|
+
causation_id?: string;
|
|
32
|
+
capture_path?: EventCapturePath;
|
|
33
|
+
source_kind?: EventSourceKind;
|
|
34
|
+
trust_level?: EventTrustLevel;
|
|
35
|
+
scope?: EventScope;
|
|
36
|
+
metadata?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export type ClaimType = "fact" | "decision" | "thread";
|
|
39
|
+
export type ClaimCardinality = "singleton" | "set";
|
|
40
|
+
export type VerificationStatus = "unverified" | "inferred" | "user_confirmed" | "system_verified" | "outcome_verified" | "disputed";
|
|
41
|
+
export type ClaimStatus = "active" | "stale" | "superseded" | "archived";
|
|
42
|
+
export type ThreadStatus = "open" | "resolved" | "blocked";
|
|
43
|
+
export interface ClaimScope {
|
|
44
|
+
repo?: string;
|
|
45
|
+
branch?: string;
|
|
46
|
+
cwd_prefix?: string;
|
|
47
|
+
files?: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface ResolutionRuleIssueClosed {
|
|
50
|
+
type: "issue_closed";
|
|
51
|
+
issue_id: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ResolutionRulePrMerged {
|
|
54
|
+
type: "pr_merged";
|
|
55
|
+
pr_id: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ResolutionRuleBranchDeleted {
|
|
58
|
+
type: "branch_deleted";
|
|
59
|
+
branch: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ResolutionRuleCommitContains {
|
|
62
|
+
type: "commit_contains";
|
|
63
|
+
pattern: string;
|
|
64
|
+
}
|
|
65
|
+
export interface ResolutionRuleTestPass {
|
|
66
|
+
type: "test_pass";
|
|
67
|
+
test_name: string;
|
|
68
|
+
}
|
|
69
|
+
export type ResolutionRule = ResolutionRuleIssueClosed | ResolutionRulePrMerged | ResolutionRuleBranchDeleted | ResolutionRuleCommitContains | ResolutionRuleTestPass;
|
|
70
|
+
export interface Claim {
|
|
71
|
+
id: string;
|
|
72
|
+
created_at: string;
|
|
73
|
+
project_id: string;
|
|
74
|
+
type: ClaimType;
|
|
75
|
+
assertion_kind: "fact" | "hypothesis" | "instruction" | "preference" | "todo" | "outcome";
|
|
76
|
+
canonical_key: string;
|
|
77
|
+
cardinality: ClaimCardinality;
|
|
78
|
+
content: string;
|
|
79
|
+
source_event_ids: string[];
|
|
80
|
+
confidence: number;
|
|
81
|
+
importance: number;
|
|
82
|
+
outcome_score: number;
|
|
83
|
+
verification_status: VerificationStatus;
|
|
84
|
+
verification_method?: string;
|
|
85
|
+
status: ClaimStatus;
|
|
86
|
+
pinned?: boolean;
|
|
87
|
+
valid_from?: string;
|
|
88
|
+
valid_to?: string;
|
|
89
|
+
supersedes?: string[];
|
|
90
|
+
last_verified_at?: string;
|
|
91
|
+
last_activated_at?: string;
|
|
92
|
+
scope?: ClaimScope;
|
|
93
|
+
thread_status?: ThreadStatus;
|
|
94
|
+
resolved_at?: string;
|
|
95
|
+
resolution_rules?: ResolutionRule[];
|
|
96
|
+
}
|
|
97
|
+
export interface Outcome {
|
|
98
|
+
id: string;
|
|
99
|
+
ts: string;
|
|
100
|
+
project_id: string;
|
|
101
|
+
related_event_ids: string[];
|
|
102
|
+
related_claim_ids?: string[];
|
|
103
|
+
outcome_type: OutcomeType;
|
|
104
|
+
strength: number;
|
|
105
|
+
notes?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ClaimTransition {
|
|
108
|
+
id: string;
|
|
109
|
+
ts: string;
|
|
110
|
+
project_id: string;
|
|
111
|
+
claim_id: string;
|
|
112
|
+
from_status?: ClaimStatus;
|
|
113
|
+
to_status: ClaimStatus;
|
|
114
|
+
reason: string;
|
|
115
|
+
trigger_type: string;
|
|
116
|
+
trigger_ref?: string;
|
|
117
|
+
actor: string;
|
|
118
|
+
}
|
|
119
|
+
export type SuppressionReason = "project_mismatch" | "scope_mismatch" | "verification_guard" | "superseded" | "archived" | "expired" | "low_rank" | "token_budget";
|
|
120
|
+
export interface ActivationLog {
|
|
121
|
+
id: string;
|
|
122
|
+
ts: string;
|
|
123
|
+
project_id: string;
|
|
124
|
+
claim_id: string;
|
|
125
|
+
eligibility_result: "passed" | "filtered";
|
|
126
|
+
suppression_reason?: SuppressionReason;
|
|
127
|
+
rank_score?: number;
|
|
128
|
+
packing_decision?: "included" | "dropped";
|
|
129
|
+
activation_reasons?: string[];
|
|
130
|
+
}
|
|
131
|
+
export interface OutcomeSummary {
|
|
132
|
+
positive_count: number;
|
|
133
|
+
negative_count: number;
|
|
134
|
+
outcome_types: OutcomeType[];
|
|
135
|
+
last_outcome_at?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface SessionCheckpoint {
|
|
138
|
+
id: string;
|
|
139
|
+
created_at: string;
|
|
140
|
+
project_id: string;
|
|
141
|
+
session_id: string;
|
|
142
|
+
workspace_id?: string;
|
|
143
|
+
branch?: string;
|
|
144
|
+
repo_head?: string;
|
|
145
|
+
status: SessionCheckpointStatus;
|
|
146
|
+
source: SessionCheckpointSource;
|
|
147
|
+
summary: string;
|
|
148
|
+
current_goal?: string;
|
|
149
|
+
next_action?: string;
|
|
150
|
+
blocking_reason?: string;
|
|
151
|
+
hot_claim_ids: string[];
|
|
152
|
+
hot_files: string[];
|
|
153
|
+
evidence_refs: string[];
|
|
154
|
+
packet_hash: string;
|
|
155
|
+
hot_file_digests?: Record<string, string>;
|
|
156
|
+
stale_reason?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface RecallCheckpoint {
|
|
159
|
+
id: string;
|
|
160
|
+
created_at: string;
|
|
161
|
+
project_id: string;
|
|
162
|
+
session_id: string;
|
|
163
|
+
workspace_id?: string;
|
|
164
|
+
branch?: string;
|
|
165
|
+
repo_head?: string;
|
|
166
|
+
status: SessionCheckpointStatus;
|
|
167
|
+
source: SessionCheckpointSource;
|
|
168
|
+
summary: string;
|
|
169
|
+
current_goal?: string;
|
|
170
|
+
next_action?: string;
|
|
171
|
+
blocking_reason?: string;
|
|
172
|
+
hot_claim_ids: string[];
|
|
173
|
+
hot_files: string[];
|
|
174
|
+
evidence_refs: string[];
|
|
175
|
+
stale_reason?: string;
|
|
176
|
+
}
|
|
177
|
+
export interface RecallClaim extends Claim {
|
|
178
|
+
recall_rank: number;
|
|
179
|
+
activation_reasons: string[];
|
|
180
|
+
evidence_refs: string[];
|
|
181
|
+
outcome_summary?: OutcomeSummary;
|
|
182
|
+
}
|
|
183
|
+
export interface RecallPacket {
|
|
184
|
+
project_id: string;
|
|
185
|
+
generated_at: string;
|
|
186
|
+
agent_id: string;
|
|
187
|
+
brief: string;
|
|
188
|
+
checkpoint?: RecallCheckpoint;
|
|
189
|
+
active_claims: RecallClaim[];
|
|
190
|
+
open_threads: RecallClaim[];
|
|
191
|
+
recent_evidence_refs: string[];
|
|
192
|
+
warnings?: string[];
|
|
193
|
+
}
|
|
194
|
+
export interface SessionBriefInput {
|
|
195
|
+
project_id: string;
|
|
196
|
+
session_id?: string;
|
|
197
|
+
workspace_id?: string;
|
|
198
|
+
agent_id: string;
|
|
199
|
+
scope?: ClaimScope;
|
|
200
|
+
debug?: boolean;
|
|
201
|
+
cwd?: string;
|
|
202
|
+
}
|
|
203
|
+
export interface ProjectSnapshotInput {
|
|
204
|
+
project_id: string;
|
|
205
|
+
agent_id: string;
|
|
206
|
+
scope?: ClaimScope;
|
|
207
|
+
debug?: boolean;
|
|
208
|
+
workspace_id?: string;
|
|
209
|
+
cwd?: string;
|
|
210
|
+
}
|
|
211
|
+
export interface SearchClaimsInput {
|
|
212
|
+
project_id: string;
|
|
213
|
+
query: string;
|
|
214
|
+
scope?: ClaimScope;
|
|
215
|
+
debug?: boolean;
|
|
216
|
+
limit?: number;
|
|
217
|
+
}
|
|
218
|
+
export interface RuntimeConfig {
|
|
219
|
+
dataDir?: string;
|
|
220
|
+
dbPath?: string;
|
|
221
|
+
allowed_capture_paths?: EventCapturePath[];
|
|
222
|
+
}
|
|
223
|
+
export interface RuntimePaths {
|
|
224
|
+
dataDir: string;
|
|
225
|
+
dbPath: string;
|
|
226
|
+
}
|
|
227
|
+
export interface RuntimeStats {
|
|
228
|
+
events: number;
|
|
229
|
+
claims: number;
|
|
230
|
+
outcomes: number;
|
|
231
|
+
transitions: number;
|
|
232
|
+
activationLogs: number;
|
|
233
|
+
checkpoints: number;
|
|
234
|
+
migrationsApplied: number;
|
|
235
|
+
}
|
|
236
|
+
export interface RuntimeAdminApi {
|
|
237
|
+
insertClaimRecord(claim: Claim): void;
|
|
238
|
+
insertOutcomeRecord(outcome: Outcome): void;
|
|
239
|
+
insertSessionCheckpointRecord(checkpoint: SessionCheckpoint): void;
|
|
240
|
+
}
|
|
241
|
+
export interface VerifyClaimInput {
|
|
242
|
+
claim_id: string;
|
|
243
|
+
status: "system_verified" | "user_confirmed" | "disputed";
|
|
244
|
+
method: string;
|
|
245
|
+
ts?: string;
|
|
246
|
+
actor?: string;
|
|
247
|
+
}
|
|
248
|
+
export interface MarkClaimStaleInput {
|
|
249
|
+
claim_id: string;
|
|
250
|
+
reason: string;
|
|
251
|
+
ts?: string;
|
|
252
|
+
actor?: string;
|
|
253
|
+
}
|
|
254
|
+
export interface OutcomeTimelineEntry {
|
|
255
|
+
ts: string;
|
|
256
|
+
event_type: string;
|
|
257
|
+
description: string;
|
|
258
|
+
score_before?: number;
|
|
259
|
+
score_after?: number;
|
|
260
|
+
}
|
|
261
|
+
export interface ExplainClaimResult {
|
|
262
|
+
claim: Claim;
|
|
263
|
+
transitions: ClaimTransition[];
|
|
264
|
+
activation_logs: ActivationLog[];
|
|
265
|
+
related_outcomes: Outcome[];
|
|
266
|
+
outcome_timeline: OutcomeTimelineEntry[];
|
|
267
|
+
}
|
|
268
|
+
export interface RecordSessionCheckpointInput {
|
|
269
|
+
project_id: string;
|
|
270
|
+
session_id: string;
|
|
271
|
+
workspace_id?: string;
|
|
272
|
+
agent_id: string;
|
|
273
|
+
scope?: ClaimScope;
|
|
274
|
+
cwd?: string;
|
|
275
|
+
source: SessionCheckpointSource;
|
|
276
|
+
summary_hint?: string;
|
|
277
|
+
blocking_hint?: string;
|
|
278
|
+
}
|
|
279
|
+
export interface GetLatestCheckpointInput {
|
|
280
|
+
project_id: string;
|
|
281
|
+
workspace_id?: string;
|
|
282
|
+
status?: SessionCheckpointStatus;
|
|
283
|
+
}
|
|
284
|
+
export interface VerifyCheckpointForSessionStartInput {
|
|
285
|
+
project_id: string;
|
|
286
|
+
workspace_id?: string;
|
|
287
|
+
branch?: string;
|
|
288
|
+
cwd?: string;
|
|
289
|
+
}
|
|
290
|
+
export interface VerifyCheckpointForSessionStartResult {
|
|
291
|
+
checkpoint?: RecallCheckpoint;
|
|
292
|
+
warnings: string[];
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,cAAc,GACd,eAAe,GACf,WAAW,GACX,gBAAgB,GAChB,aA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,qCAAqC;IACpD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const STABLE_OUTCOME_TYPES = [
|
|
2
|
+
"test_pass",
|
|
3
|
+
"test_fail",
|
|
4
|
+
"build_pass",
|
|
5
|
+
"build_fail",
|
|
6
|
+
"commit_kept",
|
|
7
|
+
"commit_reverted",
|
|
8
|
+
"issue_closed",
|
|
9
|
+
"issue_reopened",
|
|
10
|
+
"human_kept",
|
|
11
|
+
"human_corrected",
|
|
12
|
+
"manual_override",
|
|
13
|
+
];
|
|
14
|
+
export const POSITIVE_OUTCOME_TYPES = [
|
|
15
|
+
"test_pass",
|
|
16
|
+
"build_pass",
|
|
17
|
+
"commit_kept",
|
|
18
|
+
"issue_closed",
|
|
19
|
+
"human_kept",
|
|
20
|
+
];
|
|
21
|
+
export const NEGATIVE_OUTCOME_TYPES = [
|
|
22
|
+
"test_fail",
|
|
23
|
+
"build_fail",
|
|
24
|
+
"commit_reverted",
|
|
25
|
+
"issue_reopened",
|
|
26
|
+
"human_corrected",
|
|
27
|
+
"manual_override",
|
|
28
|
+
];
|
|
29
|
+
export const SESSION_CHECKPOINT_STATUSES = ["active", "stale"];
|
|
30
|
+
export const SESSION_CHECKPOINT_SOURCES = [
|
|
31
|
+
"precompact",
|
|
32
|
+
"session_end",
|
|
33
|
+
"postcompact",
|
|
34
|
+
"stop_failure",
|
|
35
|
+
];
|
|
36
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,iBAAiB;IACjB,cAAc;IACd,gBAAgB;IAChB,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;CACT,CAAC;AAIX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,WAAW;IACX,YAAY;IACZ,aAAa;IACb,cAAc;IACd,YAAY;CAC6B,CAAC;AAE5C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;CACwB,CAAC;AAE5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AAGxE,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,YAAY;IACZ,aAAa;IACb,aAAa;IACb,cAAc;CACN,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type OutcomeType } from "./types.js";
|
|
2
|
+
/** Returns the current timestamp in ISO 8601 format. */
|
|
3
|
+
export declare function nowIso(): string;
|
|
4
|
+
/** Clamps a number between min and max bounds. */
|
|
5
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
6
|
+
/** Calculates the non-negative number of days between two ISO timestamps. */
|
|
7
|
+
export declare function daysBetween(fromIso: string, toIso: string): number;
|
|
8
|
+
/** Safely converts an unknown value to a trimmed string, or undefined if empty/non-string. */
|
|
9
|
+
export declare function asString(value: unknown): string | undefined;
|
|
10
|
+
/** Generates a deterministic 24-char hex ID from input parts via SHA-256. */
|
|
11
|
+
export declare function hashId(...parts: string[]): string;
|
|
12
|
+
/** Canonical set of positive outcome types. Single source of truth. */
|
|
13
|
+
export declare const POSITIVE_OUTCOME_TYPES: ReadonlySet<OutcomeType>;
|
|
14
|
+
/** Canonical set of negative outcome types. Single source of truth. */
|
|
15
|
+
export declare const NEGATIVE_OUTCOME_TYPES: ReadonlySet<OutcomeType>;
|
|
16
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAEpB,wDAAwD;AACxD,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED,kDAAkD;AAClD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIlE;AAED,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAIjD;AAED,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,WAAW,CAE1D,CAAC;AAEH,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,WAAW,CAE1D,CAAC"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { NEGATIVE_OUTCOME_TYPES as NEGATIVE_OUTCOME_TYPE_VALUES, POSITIVE_OUTCOME_TYPES as POSITIVE_OUTCOME_TYPE_VALUES, } from "./types.js";
|
|
3
|
+
/** Returns the current timestamp in ISO 8601 format. */
|
|
4
|
+
export function nowIso() {
|
|
5
|
+
return new Date().toISOString();
|
|
6
|
+
}
|
|
7
|
+
/** Clamps a number between min and max bounds. */
|
|
8
|
+
export function clamp(value, min, max) {
|
|
9
|
+
return Math.max(min, Math.min(max, value));
|
|
10
|
+
}
|
|
11
|
+
/** Calculates the non-negative number of days between two ISO timestamps. */
|
|
12
|
+
export function daysBetween(fromIso, toIso) {
|
|
13
|
+
const from = new Date(fromIso).getTime();
|
|
14
|
+
const to = new Date(toIso).getTime();
|
|
15
|
+
return Math.max(0, (to - from) / (1000 * 60 * 60 * 24));
|
|
16
|
+
}
|
|
17
|
+
/** Safely converts an unknown value to a trimmed string, or undefined if empty/non-string. */
|
|
18
|
+
export function asString(value) {
|
|
19
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Generates a deterministic 24-char hex ID from input parts via SHA-256. */
|
|
22
|
+
export function hashId(...parts) {
|
|
23
|
+
const hash = createHash("sha256");
|
|
24
|
+
for (const part of parts)
|
|
25
|
+
hash.update(part);
|
|
26
|
+
return hash.digest("hex").slice(0, 24);
|
|
27
|
+
}
|
|
28
|
+
/** Canonical set of positive outcome types. Single source of truth. */
|
|
29
|
+
export const POSITIVE_OUTCOME_TYPES = new Set([
|
|
30
|
+
...POSITIVE_OUTCOME_TYPE_VALUES,
|
|
31
|
+
]);
|
|
32
|
+
/** Canonical set of negative outcome types. Single source of truth. */
|
|
33
|
+
export const NEGATIVE_OUTCOME_TYPES = new Set([
|
|
34
|
+
...NEGATIVE_OUTCOME_TYPE_VALUES,
|
|
35
|
+
]);
|
|
36
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,sBAAsB,IAAI,4BAA4B,EACtD,sBAAsB,IAAI,4BAA4B,GAEvD,MAAM,YAAY,CAAC;AAEpB,wDAAwD;AACxD,MAAM,UAAU,MAAM;IACpB,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IAC3D,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE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 @@
|
|
|
1
|
+
import type { Claim, EventCapturePath, ClaimStatus, EventType, NormalizedEvent, Outcome, OutcomeType, ResolutionRule, SessionCheckpoint, SessionCheckpointStatus, VerificationStatus } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_ALLOWED_CAPTURE_PATHS: EventCapturePath[];
|
|
3
|
+
export declare class RuntimeInvariantError extends Error {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
6
|
+
export declare function assertEventType(eventType: string): asserts eventType is EventType;
|
|
7
|
+
export declare function assertCapturePath(capturePath: string): asserts capturePath is EventCapturePath;
|
|
8
|
+
export declare function assertVerificationStatus(status: string): asserts status is VerificationStatus;
|
|
9
|
+
export declare function assertOutcomeType(outcomeType: string): asserts outcomeType is OutcomeType;
|
|
10
|
+
export declare function assertClaimTransitionAllowed(fromStatus: ClaimStatus, toStatus: ClaimStatus, reason: string): void;
|
|
11
|
+
export declare function validateClaimRecord(claim: Claim): void;
|
|
12
|
+
export declare function validateOutcomeRecord(outcome: Outcome): void;
|
|
13
|
+
export declare function assertSessionCheckpointStatus(status: string): asserts status is SessionCheckpointStatus;
|
|
14
|
+
export declare function validateSessionCheckpointRecord(checkpoint: SessionCheckpoint): void;
|
|
15
|
+
export declare function validateEventRecord(event: NormalizedEvent): void;
|
|
16
|
+
export declare function assertCapturePathAllowed(capturePath: EventCapturePath, allowedCapturePaths: ReadonlySet<EventCapturePath>): void;
|
|
17
|
+
export declare function deriveEventProvenance(event: NormalizedEvent): NormalizedEvent;
|
|
18
|
+
export declare function hasTrustedUserConfirmationCapturePath(event: NormalizedEvent): boolean;
|
|
19
|
+
export declare function hasTrustedUserMessageCapturePath(event: NormalizedEvent): boolean;
|
|
20
|
+
export declare function hasTrustedNegativeLifecycleCapturePath(event: NormalizedEvent): boolean;
|
|
21
|
+
export declare function isExplicitVerificationStatus(status: VerificationStatus): boolean;
|
|
22
|
+
export declare function familyHintAllowedForEvent(family: "current_strategy" | "blocker" | "rejected_strategy" | "open_question", event: NormalizedEvent): boolean;
|
|
23
|
+
export declare function resolutionRuleSummary(rule: ResolutionRule): string;
|
|
24
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,EAGT,eAAe,EACf,OAAO,EACP,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AA+IpB,eAAO,MAAM,6BAA6B,EAAE,gBAAgB,EAM3D,CAAC;AAEF,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI5B;AAyBD,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,IAAI,SAAS,CAEjF;AAED,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,IAAI,gBAAgB,CAEzC;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAMtC;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,IAAI,WAAW,CAEzF;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,WAAW,EACvB,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,MAAM,GACb,IAAI,CAON;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAiCtD;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM5D;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,IAAI,uBAAuB,CAM3C;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAA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