@jinn-network/core 0.1.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-json.d.ts +1 -0
- package/dist/canonical-json.js +67 -0
- package/dist/captured-task.d.ts +140 -0
- package/dist/captured-task.js +122 -0
- package/dist/contribution-store.d.ts +97 -0
- package/dist/contribution-store.js +770 -0
- package/dist/corpus-read/acquire.d.ts +39 -0
- package/dist/corpus-read/acquire.js +212 -0
- package/dist/corpus-read/cache.d.ts +14 -0
- package/dist/corpus-read/cache.js +17 -0
- package/dist/corpus-read/capture-meta.d.ts +16 -0
- package/dist/corpus-read/capture-meta.js +18 -0
- package/dist/corpus-read/create-corpus.d.ts +2 -0
- package/dist/corpus-read/create-corpus.js +97 -0
- package/dist/corpus-read/fetch-artifact.d.ts +21 -0
- package/dist/corpus-read/fetch-artifact.js +32 -0
- package/dist/corpus-read/fetch.d.ts +12 -0
- package/dist/corpus-read/fetch.js +24 -0
- package/dist/corpus-read/http-discovery.d.ts +9 -0
- package/dist/corpus-read/http-discovery.js +128 -0
- package/dist/corpus-read/index.d.ts +10 -0
- package/dist/corpus-read/index.js +10 -0
- package/dist/corpus-read/ipfs.d.ts +5 -0
- package/dist/corpus-read/ipfs.js +72 -0
- package/dist/corpus-read/route-resolver.d.ts +16 -0
- package/dist/corpus-read/route-resolver.js +19 -0
- package/dist/corpus-read/types.d.ts +177 -0
- package/dist/corpus-read/types.js +42 -0
- package/dist/envelope.d.ts +134 -0
- package/dist/envelope.js +162 -0
- package/dist/evidence-adapter.d.ts +26 -0
- package/dist/evidence-adapter.js +321 -0
- package/dist/evidence-filesystem.d.ts +40 -0
- package/dist/evidence-filesystem.js +267 -0
- package/dist/evidence-index.d.ts +117 -0
- package/dist/evidence-index.js +1083 -0
- package/dist/evidence-store-lock.d.ts +2 -0
- package/dist/evidence-store-lock.js +208 -0
- package/dist/execution-envelope.d.ts +3142 -0
- package/dist/execution-envelope.js +203 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/manifest.d.ts +75 -0
- package/dist/manifest.js +184 -0
- package/dist/paired.d.ts +68 -0
- package/dist/paired.js +92 -0
- package/dist/scrub/build.d.ts +52 -0
- package/dist/scrub/build.js +84 -0
- package/dist/scrub/emit-scrub.d.ts +41 -0
- package/dist/scrub/emit-scrub.js +87 -0
- package/dist/scrub/index.d.ts +12 -0
- package/dist/scrub/index.js +12 -0
- package/dist/scrub/key-policy.d.ts +20 -0
- package/dist/scrub/key-policy.js +42 -0
- package/dist/scrub/layer2.d.ts +23 -0
- package/dist/scrub/layer2.js +32 -0
- package/dist/scrub/ml-pii-stage.d.ts +24 -0
- package/dist/scrub/ml-pii-stage.js +42 -0
- package/dist/scrub/openredaction-stage.d.ts +196 -0
- package/dist/scrub/openredaction-stage.js +270 -0
- package/dist/scrub/pii-build.d.ts +38 -0
- package/dist/scrub/pii-build.js +67 -0
- package/dist/scrub/pipeline.d.ts +38 -0
- package/dist/scrub/pipeline.js +83 -0
- package/dist/scrub/plain-patterns-stage.d.ts +31 -0
- package/dist/scrub/plain-patterns-stage.js +84 -0
- package/dist/scrub/secretlint-stage.d.ts +36 -0
- package/dist/scrub/secretlint-stage.js +249 -0
- package/dist/scrub/transformers-detector.d.ts +35 -0
- package/dist/scrub/transformers-detector.js +67 -0
- package/dist/scrub/types.d.ts +25 -0
- package/dist/scrub/types.js +1 -0
- package/dist/session-provenance.d.ts +75 -0
- package/dist/session-provenance.js +20 -0
- package/dist/skill-artifact.d.ts +442 -0
- package/dist/skill-artifact.js +136 -0
- package/dist/trajectory/hash-chain.d.ts +18 -0
- package/dist/trajectory/hash-chain.js +47 -0
- package/dist/trajectory/index.d.ts +4 -0
- package/dist/trajectory/index.js +4 -0
- package/dist/trajectory/schema.d.ts +606 -0
- package/dist/trajectory/schema.js +110 -0
- package/dist/trajectory/transcript-parsers/aider-history.d.ts +42 -0
- package/dist/trajectory/transcript-parsers/aider-history.js +181 -0
- package/dist/trajectory/transcript-parsers/claude-code-jsonl.d.ts +37 -0
- package/dist/trajectory/transcript-parsers/claude-code-jsonl.js +142 -0
- package/dist/trajectory/transcript-parsers/codex-session.d.ts +42 -0
- package/dist/trajectory/transcript-parsers/codex-session.js +235 -0
- package/dist/trajectory/transcript-parsers/continue-devdata.d.ts +41 -0
- package/dist/trajectory/transcript-parsers/continue-devdata.js +190 -0
- package/dist/trajectory/transcript-parsers/cursor-sqlite.d.ts +38 -0
- package/dist/trajectory/transcript-parsers/cursor-sqlite.js +118 -0
- package/dist/trajectory/transcript-parsers/gemini-session.d.ts +35 -0
- package/dist/trajectory/transcript-parsers/gemini-session.js +137 -0
- package/dist/trajectory/transcript-parsers/index.d.ts +7 -0
- package/dist/trajectory/transcript-parsers/index.js +7 -0
- package/dist/trajectory/transcript-parsers/types.d.ts +101 -0
- package/dist/trajectory/transcript-parsers/types.js +32 -0
- package/dist/trajectory/transcript-to-spans/attrs.d.ts +4 -0
- package/dist/trajectory/transcript-to-spans/attrs.js +30 -0
- package/dist/trajectory/transcript-to-spans/claude-code-stream-json.d.ts +8 -0
- package/dist/trajectory/transcript-to-spans/claude-code-stream-json.js +162 -0
- package/dist/trajectory/transcript-to-spans/codex-exec-json.d.ts +8 -0
- package/dist/trajectory/transcript-to-spans/codex-exec-json.js +253 -0
- package/dist/trajectory/transcript-to-spans/index.d.ts +4 -0
- package/dist/trajectory/transcript-to-spans/index.js +4 -0
- package/dist/trajectory/transcript-to-spans/types.d.ts +18 -0
- package/dist/trajectory/transcript-to-spans/types.js +1 -0
- package/dist/window.d.ts +12 -0
- package/dist/window.js +5 -0
- package/package.json +67 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type EpisodeV1 } from '@jinn-network/plugin';
|
|
2
|
+
export type EvidenceSourceKind = 'canonical-episode' | 'misnamed-episode' | 'legacy-capture';
|
|
3
|
+
export type EvidenceOriginKind = 'stamped' | 'legacy-unstamped';
|
|
4
|
+
export interface IndexedEpisode {
|
|
5
|
+
episodeId: string;
|
|
6
|
+
sessionId: string;
|
|
7
|
+
capturedAt: string;
|
|
8
|
+
sourcePath: string;
|
|
9
|
+
sourceKind: EvidenceSourceKind;
|
|
10
|
+
originKind: EvidenceOriginKind;
|
|
11
|
+
originWriter?: string;
|
|
12
|
+
originBuild?: string;
|
|
13
|
+
outcomeStatus: EpisodeV1['outcome']['status'];
|
|
14
|
+
verificationStrength: EpisodeV1['outcome']['verificationStrength'];
|
|
15
|
+
durationMs: number;
|
|
16
|
+
activity: EpisodeV1['activity'] | null;
|
|
17
|
+
episode: EpisodeV1;
|
|
18
|
+
contentSha256: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UnreadableEvidence {
|
|
21
|
+
sourcePath: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ExcludedEvidence {
|
|
25
|
+
sourcePath: string;
|
|
26
|
+
episodeId: string;
|
|
27
|
+
rule: 'legacy-short-session-placeholder-model-v1' | 'legacy-known-smoke-payload-v1';
|
|
28
|
+
reason: string;
|
|
29
|
+
contentSha256: string;
|
|
30
|
+
}
|
|
31
|
+
export type ReindexMutation = {
|
|
32
|
+
kind: 'normalized-json';
|
|
33
|
+
sourcePath: string;
|
|
34
|
+
nullFieldsRemoved: number;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'normalization-recovery-retained';
|
|
37
|
+
sourcePath: string;
|
|
38
|
+
journalPath: string;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'rescued-misnamed-episode';
|
|
41
|
+
sourcePath: string;
|
|
42
|
+
targetPath: string;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'rescue-target-published';
|
|
45
|
+
sourcePath: string;
|
|
46
|
+
targetPath: string;
|
|
47
|
+
};
|
|
48
|
+
export interface ReindexReport {
|
|
49
|
+
scannedFiles: number;
|
|
50
|
+
indexedEpisodes: number;
|
|
51
|
+
unreadableFiles: number;
|
|
52
|
+
unreadable: Array<{
|
|
53
|
+
path: string;
|
|
54
|
+
reason: string;
|
|
55
|
+
}>;
|
|
56
|
+
nullToleratedFiles: number;
|
|
57
|
+
nullFieldsRemoved: number;
|
|
58
|
+
misnamedEpisodes: number;
|
|
59
|
+
renamedFiles: number;
|
|
60
|
+
legacyUnstampedFiles: number;
|
|
61
|
+
syntheticExcludedFiles: number;
|
|
62
|
+
syntheticExcluded: Array<{
|
|
63
|
+
path: string;
|
|
64
|
+
episodeId: string;
|
|
65
|
+
rule: ExcludedEvidence['rule'];
|
|
66
|
+
reason: string;
|
|
67
|
+
}>;
|
|
68
|
+
mutations: ReindexMutation[];
|
|
69
|
+
/** False for inspection and for a failed derived-index publication. */
|
|
70
|
+
indexUpdated: boolean;
|
|
71
|
+
/** Present only when source scanning/repair completed but publication failed. */
|
|
72
|
+
indexError?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ReindexEvidenceStoreOptions {
|
|
75
|
+
episodesDir: string;
|
|
76
|
+
indexPath: string;
|
|
77
|
+
repair?: boolean;
|
|
78
|
+
/** @internal Deterministic concurrency-test seam; called while the store lock is held. */
|
|
79
|
+
onScanComplete?: () => void;
|
|
80
|
+
/** @internal Race-regression seam; called after a source descriptor is pinned. */
|
|
81
|
+
onBeforeSourceMutation?: (kind: 'normalize' | 'rescue-remove', sourcePath: string) => void;
|
|
82
|
+
}
|
|
83
|
+
export interface InspectEvidenceStoreOptions {
|
|
84
|
+
episodesDir: string;
|
|
85
|
+
}
|
|
86
|
+
export declare function defaultEvidenceIndexPath(episodesDir: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* The affected operator files carry null in exactly these four optional
|
|
89
|
+
* fields (#1811). Keep required nullable fields (notably parentSpanId) intact.
|
|
90
|
+
*/
|
|
91
|
+
export declare function tolerateNullQuartet(value: unknown): {
|
|
92
|
+
value: unknown;
|
|
93
|
+
removed: number;
|
|
94
|
+
};
|
|
95
|
+
export interface EvidenceIndexOptions {
|
|
96
|
+
dbPath: string;
|
|
97
|
+
/** Only the default dedicated state parent is safe to normalize to 0700. */
|
|
98
|
+
secureParent?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export declare class EvidenceIndex {
|
|
101
|
+
private readonly db;
|
|
102
|
+
private readonly dbPath;
|
|
103
|
+
private readonly dbIdentity;
|
|
104
|
+
constructor(options: EvidenceIndexOptions);
|
|
105
|
+
journalMode(): string;
|
|
106
|
+
replace(rows: IndexedEpisode[], unreadable: UnreadableEvidence[], excluded: ExcludedEvidence[]): void;
|
|
107
|
+
listEpisodes(): IndexedEpisode[];
|
|
108
|
+
listUnreadable(): UnreadableEvidence[];
|
|
109
|
+
listExcluded(): ExcludedEvidence[];
|
|
110
|
+
close(): void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Read-only store inspection for doctor/status surfaces. It deliberately
|
|
114
|
+
* shares the reindex scanner while neither opening SQLite nor repairing files.
|
|
115
|
+
*/
|
|
116
|
+
export declare function inspectEvidenceStore(options: InspectEvidenceStoreOptions): ReindexReport;
|
|
117
|
+
export declare function reindexEvidenceStore(options: ReindexEvidenceStoreOptions): ReindexReport;
|