@signetai/core 0.157.4 → 0.158.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.
Files changed (71) hide show
  1. package/dist/database.d.ts.map +1 -1
  2. package/dist/index.d.ts +4 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +508 -3168
  5. package/dist/memory-provenance.d.ts +4 -0
  6. package/dist/memory-provenance.d.ts.map +1 -0
  7. package/dist/migrations/093-dreaming-evidence-cursor.d.ts +4 -0
  8. package/dist/migrations/093-dreaming-evidence-cursor.d.ts.map +1 -0
  9. package/dist/migrations/094-memory-kind.d.ts +41 -0
  10. package/dist/migrations/094-memory-kind.d.ts.map +1 -0
  11. package/dist/migrations/095-compaction-recall-projections.d.ts +8 -0
  12. package/dist/migrations/095-compaction-recall-projections.d.ts.map +1 -0
  13. package/dist/migrations/096-retire-legacy-ingestion.d.ts +11 -0
  14. package/dist/migrations/096-retire-legacy-ingestion.d.ts.map +1 -0
  15. package/dist/migrations/097-dreaming-failure-backoff.d.ts +4 -0
  16. package/dist/migrations/097-dreaming-failure-backoff.d.ts.map +1 -0
  17. package/dist/migrations/098-dreaming-evidence-exclusions.d.ts +7 -0
  18. package/dist/migrations/098-dreaming-evidence-exclusions.d.ts.map +1 -0
  19. package/dist/migrations/099-dreaming-tool-calls.d.ts +8 -0
  20. package/dist/migrations/099-dreaming-tool-calls.d.ts.map +1 -0
  21. package/dist/migrations/100-dreaming-runbook.d.ts +8 -0
  22. package/dist/migrations/100-dreaming-runbook.d.ts.map +1 -0
  23. package/dist/migrations/101-dreaming-attention.d.ts +8 -0
  24. package/dist/migrations/101-dreaming-attention.d.ts.map +1 -0
  25. package/dist/migrations/102-attribute-semantic-memories.d.ts +8 -0
  26. package/dist/migrations/102-attribute-semantic-memories.d.ts.map +1 -0
  27. package/dist/migrations/103-semantic-memory-kind.d.ts +9 -0
  28. package/dist/migrations/103-semantic-memory-kind.d.ts.map +1 -0
  29. package/dist/migrations/104-derived-memory-provenance.d.ts +10 -0
  30. package/dist/migrations/104-derived-memory-provenance.d.ts.map +1 -0
  31. package/dist/migrations/index.d.ts.map +1 -1
  32. package/dist/ontology-topology.d.ts +3 -0
  33. package/dist/ontology-topology.d.ts.map +1 -0
  34. package/dist/routing.d.ts +3 -8
  35. package/dist/routing.d.ts.map +1 -1
  36. package/dist/signet-installation.d.ts.map +1 -1
  37. package/dist/types.d.ts +3 -41
  38. package/dist/types.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/ingest/chat-extractor.d.ts +0 -35
  41. package/dist/ingest/chat-extractor.d.ts.map +0 -1
  42. package/dist/ingest/chat-utils.d.ts +0 -18
  43. package/dist/ingest/chat-utils.d.ts.map +0 -1
  44. package/dist/ingest/chunker.d.ts +0 -27
  45. package/dist/ingest/chunker.d.ts.map +0 -1
  46. package/dist/ingest/code-parser.d.ts +0 -30
  47. package/dist/ingest/code-parser.d.ts.map +0 -1
  48. package/dist/ingest/discord-parser.d.ts +0 -30
  49. package/dist/ingest/discord-parser.d.ts.map +0 -1
  50. package/dist/ingest/entire-extractor.d.ts +0 -33
  51. package/dist/ingest/entire-extractor.d.ts.map +0 -1
  52. package/dist/ingest/entire-parser.d.ts +0 -51
  53. package/dist/ingest/entire-parser.d.ts.map +0 -1
  54. package/dist/ingest/extractor.d.ts +0 -27
  55. package/dist/ingest/extractor.d.ts.map +0 -1
  56. package/dist/ingest/git-utils.d.ts +0 -9
  57. package/dist/ingest/git-utils.d.ts.map +0 -1
  58. package/dist/ingest/index.d.ts +0 -52
  59. package/dist/ingest/index.d.ts.map +0 -1
  60. package/dist/ingest/markdown-parser.d.ts +0 -26
  61. package/dist/ingest/markdown-parser.d.ts.map +0 -1
  62. package/dist/ingest/pdf-parser.d.ts +0 -14
  63. package/dist/ingest/pdf-parser.d.ts.map +0 -1
  64. package/dist/ingest/provenance.d.ts +0 -55
  65. package/dist/ingest/provenance.d.ts.map +0 -1
  66. package/dist/ingest/response-parser.d.ts +0 -40
  67. package/dist/ingest/response-parser.d.ts.map +0 -1
  68. package/dist/ingest/slack-parser.d.ts +0 -34
  69. package/dist/ingest/slack-parser.d.ts.map +0 -1
  70. package/dist/ingest/types.d.ts +0 -163
  71. package/dist/ingest/types.d.ts.map +0 -1
@@ -1,163 +0,0 @@
1
- /**
2
- * Types for the document ingestion engine.
3
- *
4
- * The ingestion pipeline: detect → parse → chunk → extract → store
5
- */
6
- export interface DatabaseLike {
7
- prepare(sql: string): {
8
- run(...args: unknown[]): void;
9
- get(...args: unknown[]): Record<string, unknown> | undefined;
10
- all(...args: unknown[]): Record<string, unknown>[];
11
- };
12
- }
13
- export interface IngestOptions {
14
- /** Force file type detection */
15
- readonly type?: "markdown" | "pdf" | "txt" | "code" | "slack" | "discord" | "repo" | "entire";
16
- /** Show what would be extracted without saving */
17
- readonly dryRun?: boolean;
18
- /** Show each extracted fact */
19
- readonly verbose?: boolean;
20
- /** Skip LLM extraction (store raw chunks only) */
21
- readonly skipExtraction?: boolean;
22
- /** Maximum chunks to process (for testing) */
23
- readonly maxChunks?: number;
24
- /** Database instance (required unless dryRun) */
25
- readonly db?: DatabaseLike | undefined;
26
- /** Agent DID for signing */
27
- readonly signerDid?: string;
28
- /** Workspace name for memory attribution */
29
- readonly workspace?: string;
30
- /** Force re-ingestion even if file was already ingested */
31
- readonly force?: boolean;
32
- }
33
- export interface IngestResult {
34
- /** Total files processed */
35
- readonly filesProcessed: number;
36
- /** Total files that errored */
37
- readonly filesErrored: number;
38
- /** Total chunks generated */
39
- readonly totalChunks: number;
40
- /** Total memories created */
41
- readonly memoriesCreated: number;
42
- /** Breakdown by memory type */
43
- readonly byType: Record<string, number>;
44
- /** Per-file results */
45
- readonly files: readonly FileIngestResult[];
46
- /** Ingestion job ID (if tracking enabled) */
47
- readonly jobId?: string;
48
- }
49
- export interface FileIngestResult {
50
- readonly filePath: string;
51
- readonly status: "success" | "error" | "skipped";
52
- readonly error?: string;
53
- readonly chunks: number;
54
- readonly memoriesCreated: number;
55
- readonly byType: Record<string, number>;
56
- }
57
- export interface ParsedSection {
58
- /** Heading text, or null for top-level content */
59
- readonly heading: string | null;
60
- /** Nesting depth (1 = H1, 2 = H2, etc.) */
61
- readonly depth: number;
62
- /** Raw text content of this section */
63
- readonly content: string;
64
- /** Content type hint */
65
- readonly contentType: "text" | "code" | "table" | "list" | "blockquote";
66
- /** Language hint for code blocks */
67
- readonly language?: string;
68
- /** Page number (for PDFs) */
69
- readonly page?: number;
70
- /** Line range in original file */
71
- readonly lineStart?: number;
72
- readonly lineEnd?: number;
73
- }
74
- export interface ParsedDocument {
75
- /** Source format */
76
- readonly format: string;
77
- /** Document title (if available) */
78
- readonly title: string | null;
79
- /** Sections */
80
- readonly sections: readonly ParsedSection[];
81
- /** Raw metadata from the original file */
82
- readonly metadata: Record<string, unknown>;
83
- /** Total character count of extracted text */
84
- readonly totalChars: number;
85
- }
86
- export interface ChunkResult {
87
- /** Unique chunk index within the source */
88
- readonly index: number;
89
- /** The text content of this chunk */
90
- readonly text: string;
91
- /** Content type */
92
- readonly chunkType: "text" | "code" | "table" | "heading" | "conversation";
93
- /** Estimated token count (chars / 4 rough estimate) */
94
- readonly tokenCount: number;
95
- /** Provenance: which section heading this came from */
96
- readonly sourceSection: string | null;
97
- /** Provenance: page number (PDF) */
98
- readonly sourcePage: number | null;
99
- /** Provenance: line range */
100
- readonly sourceLineStart: number | null;
101
- readonly sourceLineEnd: number | null;
102
- /** Provenance: speaker (chat/email) */
103
- readonly speaker?: string | null;
104
- /** Provenance: thread ID (chat/email) */
105
- readonly threadId?: string | null;
106
- }
107
- export interface ExtractedItem {
108
- readonly content: string;
109
- readonly type: string;
110
- readonly confidence: number;
111
- readonly metadata?: Record<string, unknown>;
112
- }
113
- export interface ExtractedRelation {
114
- readonly source: string;
115
- readonly relationship: string;
116
- readonly target: string;
117
- readonly confidence: number;
118
- }
119
- export interface ExtractionResult {
120
- readonly chunkIndex: number;
121
- readonly items: readonly ExtractedItem[];
122
- readonly relations: readonly ExtractedRelation[];
123
- readonly warnings: readonly string[];
124
- }
125
- export interface ProvenanceRecord {
126
- readonly sourcePath: string;
127
- readonly sourceType: string;
128
- readonly sourceSection: string | null;
129
- readonly sourcePage: number | null;
130
- readonly sourceLineStart: number | null;
131
- readonly sourceLineEnd: number | null;
132
- readonly fileHash: string;
133
- readonly ingestedAt: string;
134
- readonly chunkIndex: number;
135
- }
136
- export type ProgressCallback = (event: ProgressEvent) => void;
137
- export type ProgressEvent = {
138
- type: "file-start";
139
- filePath: string;
140
- fileIndex: number;
141
- totalFiles: number;
142
- } | {
143
- type: "file-done";
144
- filePath: string;
145
- chunks: number;
146
- memories: number;
147
- } | {
148
- type: "file-error";
149
- filePath: string;
150
- error: string;
151
- } | {
152
- type: "chunk-start";
153
- chunkIndex: number;
154
- totalChunks: number;
155
- } | {
156
- type: "chunk-done";
157
- chunkIndex: number;
158
- items: number;
159
- } | {
160
- type: "complete";
161
- result: IngestResult;
162
- };
163
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ingest/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,WAAW,YAAY;IAC5B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QACrB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC9B,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;QAC7D,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;KACnD,CAAC;CACF;AAMD,MAAM,WAAW,aAAa;IAC7B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,G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