mcard-js 2.1.48 → 2.1.49
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/AbstractSqlEngine-DKka6XjT.d.cts +451 -0
- package/dist/AbstractSqlEngine-DKka6XjT.d.ts +451 -0
- package/dist/CardCollection-ZQ3G3Q3A.js +10 -0
- package/dist/IndexedDBEngine-BWXAB46W.js +12 -0
- package/dist/LLMRuntime-PH3MOQ2Y.js +17 -0
- package/dist/LambdaRuntime-YH74FHIW.js +19 -0
- package/dist/Loader-WZXYG4GE.js +12 -0
- package/dist/NetworkRuntime-S4DZCGVN.js +1598 -0
- package/dist/OllamaProvider-SPGO5Z5E.js +9 -0
- package/dist/chunk-3FFEA2XK.js +149 -0
- package/dist/chunk-7AXRV7NS.js +112 -0
- package/dist/chunk-HIVVDGE5.js +497 -0
- package/dist/chunk-KVZYFZJ5.js +427 -0
- package/dist/chunk-NGTY4P6A.js +275 -0
- package/dist/chunk-OUW2SUGM.js +368 -0
- package/dist/chunk-QKH3N62B.js +2360 -0
- package/dist/chunk-QPVEUPMU.js +299 -0
- package/dist/chunk-VYDZR4ZD.js +364 -0
- package/dist/chunk-XJZOEM5F.js +903 -0
- package/dist/chunk-Z7EFXSTO.js +217 -0
- package/dist/index.browser.cjs +37 -1
- package/dist/index.browser.d.cts +20 -2
- package/dist/index.browser.d.ts +20 -2
- package/dist/index.browser.js +10 -6
- package/dist/index.cjs +618 -146
- package/dist/index.d.cts +723 -4
- package/dist/index.d.ts +723 -4
- package/dist/index.js +527 -89
- package/dist/storage/SqliteNodeEngine.cjs +7 -1
- package/dist/storage/SqliteNodeEngine.d.cts +1 -1
- package/dist/storage/SqliteNodeEngine.d.ts +1 -1
- package/dist/storage/SqliteNodeEngine.js +3 -3
- package/dist/storage/SqliteWasmEngine.cjs +7 -1
- package/dist/storage/SqliteWasmEngine.d.cts +1 -1
- package/dist/storage/SqliteWasmEngine.d.ts +1 -1
- package/dist/storage/SqliteWasmEngine.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AbstractSqlEngine,
|
|
3
|
+
initCoreSchemas
|
|
4
|
+
} from "./chunk-HIVVDGE5.js";
|
|
5
|
+
import {
|
|
6
|
+
createPage
|
|
7
|
+
} from "./chunk-3EIBJPNF.js";
|
|
8
|
+
import {
|
|
9
|
+
Handle_exports,
|
|
10
|
+
init_Handle
|
|
11
|
+
} from "./chunk-ADV52544.js";
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_PAGE_SIZE,
|
|
14
|
+
SQLITE_BUSY_TIMEOUT_MS
|
|
15
|
+
} from "./chunk-3FFEA2XK.js";
|
|
16
|
+
import {
|
|
17
|
+
MCard
|
|
18
|
+
} from "./chunk-GGQCF7ZK.js";
|
|
19
|
+
import {
|
|
20
|
+
__toCommonJS
|
|
21
|
+
} from "./chunk-PNKVD2UK.js";
|
|
22
|
+
|
|
23
|
+
// src/storage/engines/SqliteNodeEngine.ts
|
|
24
|
+
var SqliteNodeEngine = class _SqliteNodeEngine extends AbstractSqlEngine {
|
|
25
|
+
db;
|
|
26
|
+
dbPath;
|
|
27
|
+
/**
|
|
28
|
+
* Convert a database row into an MCard instance.
|
|
29
|
+
*/
|
|
30
|
+
rowToCard(row) {
|
|
31
|
+
const rawContent = row.content;
|
|
32
|
+
const content = rawContent instanceof Buffer ? new Uint8Array(rawContent) : new Uint8Array(rawContent);
|
|
33
|
+
return MCard.fromData(content, String(row.hash), String(row.g_time));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a new SqliteNodeEngine via async factory.
|
|
37
|
+
* @param dbPath Path to database file, or ':memory:' for in-memory database
|
|
38
|
+
*/
|
|
39
|
+
static async create(dbPath = ":memory:") {
|
|
40
|
+
const engine = new _SqliteNodeEngine(dbPath);
|
|
41
|
+
await engine.init();
|
|
42
|
+
return engine;
|
|
43
|
+
}
|
|
44
|
+
constructor(dbPath) {
|
|
45
|
+
super();
|
|
46
|
+
this.dbPath = dbPath;
|
|
47
|
+
}
|
|
48
|
+
async init() {
|
|
49
|
+
try {
|
|
50
|
+
const mod = await import("better-sqlite3");
|
|
51
|
+
const Database = mod.default || mod;
|
|
52
|
+
this.db = new Database(this.dbPath);
|
|
53
|
+
this.setupDatabase();
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.error(`SqliteNodeEngine: Failed to load better-sqlite3: ${e.message}`);
|
|
56
|
+
throw e;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Initialize database schema
|
|
61
|
+
*/
|
|
62
|
+
setupDatabase() {
|
|
63
|
+
this.db.pragma("journal_mode = WAL");
|
|
64
|
+
this.db.pragma(`busy_timeout = ${SQLITE_BUSY_TIMEOUT_MS}`);
|
|
65
|
+
this.db.pragma("synchronous = NORMAL");
|
|
66
|
+
initCoreSchemas(this.db);
|
|
67
|
+
}
|
|
68
|
+
// ======================================================================
|
|
69
|
+
// AbstractSqlEngine primitives
|
|
70
|
+
// ======================================================================
|
|
71
|
+
async queryRows(sql, ...params) {
|
|
72
|
+
const stmt = this.db.prepare(sql);
|
|
73
|
+
return stmt.all(...params);
|
|
74
|
+
}
|
|
75
|
+
async execSql(sql, ...params) {
|
|
76
|
+
if (params.length === 0) {
|
|
77
|
+
this.db.exec(sql);
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
const stmt = this.db.prepare(sql);
|
|
81
|
+
const result = stmt.run(...params);
|
|
82
|
+
return result.changes;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Close the database connection
|
|
86
|
+
*/
|
|
87
|
+
close() {
|
|
88
|
+
this.db.close();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the database path
|
|
92
|
+
*/
|
|
93
|
+
getDbPath() {
|
|
94
|
+
return this.dbPath;
|
|
95
|
+
}
|
|
96
|
+
// =========== Card Operations (overrides to use Buffer.from for better-sqlite3) ===========
|
|
97
|
+
async add(card) {
|
|
98
|
+
const stmt = this.db.prepare(
|
|
99
|
+
"INSERT OR REPLACE INTO card (hash, content, g_time) VALUES (?, ?, ?)"
|
|
100
|
+
);
|
|
101
|
+
stmt.run(card.hash, Buffer.from(card.content), card.g_time);
|
|
102
|
+
return card.hash;
|
|
103
|
+
}
|
|
104
|
+
// =========== Sync card operations (for performance-critical callers) ===========
|
|
105
|
+
addSync(card) {
|
|
106
|
+
const stmt = this.db.prepare(
|
|
107
|
+
"INSERT OR REPLACE INTO card (hash, content, g_time) VALUES (?, ?, ?)"
|
|
108
|
+
);
|
|
109
|
+
stmt.run(card.hash, Buffer.from(card.content), card.g_time);
|
|
110
|
+
return card.hash;
|
|
111
|
+
}
|
|
112
|
+
getSync(hash) {
|
|
113
|
+
const stmt = this.db.prepare("SELECT hash, content, g_time FROM card WHERE hash = ?");
|
|
114
|
+
const row = stmt.get(hash);
|
|
115
|
+
if (!row) return null;
|
|
116
|
+
return this.rowToCard(row);
|
|
117
|
+
}
|
|
118
|
+
deleteSync(hash) {
|
|
119
|
+
const stmt = this.db.prepare("DELETE FROM card WHERE hash = ?");
|
|
120
|
+
const result = stmt.run(hash);
|
|
121
|
+
return result.changes > 0;
|
|
122
|
+
}
|
|
123
|
+
getPageSync(pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
|
|
124
|
+
if (pageNumber < 1) throw new Error("Page number must be >= 1");
|
|
125
|
+
if (pageSize < 1) throw new Error("Page size must be >= 1");
|
|
126
|
+
const totalItems = this.countSync();
|
|
127
|
+
const offset = (pageNumber - 1) * pageSize;
|
|
128
|
+
const stmt = this.db.prepare(
|
|
129
|
+
"SELECT hash, content, g_time FROM card ORDER BY g_time DESC LIMIT ? OFFSET ?"
|
|
130
|
+
);
|
|
131
|
+
const rows = stmt.all(pageSize, offset);
|
|
132
|
+
const items = rows.map((row) => this.rowToCard(row));
|
|
133
|
+
return createPage(items, totalItems, pageNumber, pageSize);
|
|
134
|
+
}
|
|
135
|
+
countSync() {
|
|
136
|
+
const stmt = this.db.prepare("SELECT COUNT(*) as cnt FROM card");
|
|
137
|
+
const row = stmt.get();
|
|
138
|
+
return row.cnt;
|
|
139
|
+
}
|
|
140
|
+
clearSync() {
|
|
141
|
+
this.db.exec("DELETE FROM handle_history");
|
|
142
|
+
this.db.exec("DELETE FROM handle_registry");
|
|
143
|
+
this.db.exec("DELETE FROM card");
|
|
144
|
+
}
|
|
145
|
+
// =========== Additional sync search operations ===========
|
|
146
|
+
searchByString(searchString, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
|
|
147
|
+
if (pageNumber < 1) throw new Error("Page number must be >= 1");
|
|
148
|
+
if (pageSize < 1) throw new Error("Page size must be >= 1");
|
|
149
|
+
const pattern = `%${searchString}%`;
|
|
150
|
+
const offset = (pageNumber - 1) * pageSize;
|
|
151
|
+
const countStmt = this.db.prepare(`
|
|
152
|
+
SELECT COUNT(*) as cnt FROM card
|
|
153
|
+
WHERE hash LIKE ? OR g_time LIKE ? OR CAST(content AS TEXT) LIKE ?
|
|
154
|
+
`);
|
|
155
|
+
const countRow = countStmt.get(pattern, pattern, pattern);
|
|
156
|
+
const totalItems = countRow.cnt;
|
|
157
|
+
const stmt = this.db.prepare(`
|
|
158
|
+
SELECT hash, content, g_time FROM card
|
|
159
|
+
WHERE hash LIKE ? OR g_time LIKE ? OR CAST(content AS TEXT) LIKE ?
|
|
160
|
+
ORDER BY g_time DESC LIMIT ? OFFSET ?
|
|
161
|
+
`);
|
|
162
|
+
const rows = stmt.all(pattern, pattern, pattern, pageSize, offset);
|
|
163
|
+
const items = rows.map((row) => this.rowToCard(row));
|
|
164
|
+
return createPage(items, totalItems, pageNumber, pageSize);
|
|
165
|
+
}
|
|
166
|
+
searchByContent(searchPattern, pageNumber = 1, pageSize = DEFAULT_PAGE_SIZE) {
|
|
167
|
+
if (pageNumber < 1) throw new Error("Page number must be >= 1");
|
|
168
|
+
if (pageSize < 1) throw new Error("Page size must be >= 1");
|
|
169
|
+
if (!searchPattern || typeof searchPattern === "string" && searchPattern.length === 0) {
|
|
170
|
+
throw new Error("Search pattern cannot be empty");
|
|
171
|
+
}
|
|
172
|
+
const searchBytes = typeof searchPattern === "string" ? Buffer.from(searchPattern, "utf-8") : Buffer.from(searchPattern);
|
|
173
|
+
const offset = (pageNumber - 1) * pageSize;
|
|
174
|
+
const countStmt = this.db.prepare("SELECT COUNT(*) as cnt FROM card WHERE INSTR(content, ?) > 0");
|
|
175
|
+
const countRow = countStmt.get(searchBytes);
|
|
176
|
+
const totalItems = countRow.cnt;
|
|
177
|
+
const stmt = this.db.prepare(`
|
|
178
|
+
SELECT hash, content, g_time FROM card
|
|
179
|
+
WHERE INSTR(content, ?) > 0
|
|
180
|
+
ORDER BY g_time DESC LIMIT ? OFFSET ?
|
|
181
|
+
`);
|
|
182
|
+
const rows = stmt.all(searchBytes, pageSize, offset);
|
|
183
|
+
const items = rows.map((row) => this.rowToCard(row));
|
|
184
|
+
return createPage(items, totalItems, pageNumber, pageSize);
|
|
185
|
+
}
|
|
186
|
+
getAllCards() {
|
|
187
|
+
const stmt = this.db.prepare("SELECT hash, content, g_time FROM card ORDER BY g_time DESC");
|
|
188
|
+
const rows = stmt.all();
|
|
189
|
+
const items = rows.map((row) => this.rowToCard(row));
|
|
190
|
+
return createPage(items, items.length, 1, items.length || 1);
|
|
191
|
+
}
|
|
192
|
+
// =========== Unique sync method (not in AbstractSqlEngine) ===========
|
|
193
|
+
deleteHistoryEntrySync(handle, previousHash) {
|
|
194
|
+
const { validateHandle } = (init_Handle(), __toCommonJS(Handle_exports));
|
|
195
|
+
const normalized = validateHandle(handle);
|
|
196
|
+
const performStitch = this.db.transaction(() => {
|
|
197
|
+
const rOut = this.db.prepare(
|
|
198
|
+
"SELECT id, previous_hash FROM handle_history WHERE handle = ? AND previous_hash = ? ORDER BY id DESC LIMIT 1"
|
|
199
|
+
).get(normalized, previousHash);
|
|
200
|
+
if (!rOut) return;
|
|
201
|
+
const rIn = this.db.prepare(
|
|
202
|
+
"SELECT id, previous_hash FROM handle_history WHERE handle = ? AND id < ? ORDER BY id DESC LIMIT 1"
|
|
203
|
+
).get(normalized, rOut.id);
|
|
204
|
+
if (rIn) {
|
|
205
|
+
this.db.prepare("UPDATE handle_history SET previous_hash = ? WHERE id = ?").run(rIn.previous_hash, rOut.id);
|
|
206
|
+
this.db.prepare("DELETE FROM handle_history WHERE id = ?").run(rIn.id);
|
|
207
|
+
} else {
|
|
208
|
+
this.db.prepare("DELETE FROM handle_history WHERE id = ?").run(rOut.id);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
performStitch();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export {
|
|
216
|
+
SqliteNodeEngine
|
|
217
|
+
};
|
package/dist/index.browser.cjs
CHANGED
|
@@ -357,6 +357,8 @@ __export(index_browser_exports, {
|
|
|
357
357
|
MCard: () => MCard,
|
|
358
358
|
MCardStore: () => MCardStore,
|
|
359
359
|
Maybe: () => Maybe,
|
|
360
|
+
PostconditionViolation: () => PostconditionViolation,
|
|
361
|
+
PreconditionViolation: () => PreconditionViolation,
|
|
360
362
|
Reader: () => Reader,
|
|
361
363
|
ServiceWorkerPTR: () => ServiceWorkerPTR,
|
|
362
364
|
SqliteWasmEngine: () => SqliteWasmEngine,
|
|
@@ -527,6 +529,8 @@ var app_config_default = {
|
|
|
527
529
|
default_ws_host: "127.0.0.1",
|
|
528
530
|
default_ws_port: 5321,
|
|
529
531
|
default_api_port: 5320,
|
|
532
|
+
default_python_api_port: 28302,
|
|
533
|
+
default_js_api_port: 28303,
|
|
530
534
|
default_server_host: "0.0.0.0",
|
|
531
535
|
cors_origins: [
|
|
532
536
|
"http://localhost:3000",
|
|
@@ -556,7 +560,8 @@ var app_config_default = {
|
|
|
556
560
|
default_server_memory_db: "servermemory.db",
|
|
557
561
|
default_mcard_db: "mcard.db",
|
|
558
562
|
default_server_log_db: "server_log.db",
|
|
559
|
-
default_push_subscriptions_file: "subscriptions.json"
|
|
563
|
+
default_push_subscriptions_file: "subscriptions.json",
|
|
564
|
+
default_vcard_db_path: "data/vcard.db"
|
|
560
565
|
},
|
|
561
566
|
services: {
|
|
562
567
|
default_ollama_base_url: "http://localhost:11434",
|
|
@@ -609,6 +614,9 @@ var INDEXEDDB_DEFAULT_DB_VERSION = 1;
|
|
|
609
614
|
var DEFAULT_IDENTITY_PROVIDER = String(identity.provider ?? "sqlite");
|
|
610
615
|
var DEFAULT_IDENTITY_SPACE_PATH = String(identity.space_path ?? "./data/IDENTITY_SPACE.db");
|
|
611
616
|
var DEFAULT_API_PORT = Number(network.default_api_port ?? 5320);
|
|
617
|
+
var DEFAULT_PYTHON_API_PORT = Number(network.default_python_api_port ?? 28302);
|
|
618
|
+
var DEFAULT_JS_API_PORT = Number(network.default_js_api_port ?? 28303);
|
|
619
|
+
var DEFAULT_VCARD_DB_PATH = String(app_config_default.storage?.default_vcard_db_path ?? "./data/vcard.db");
|
|
612
620
|
var DEFAULT_WS_PORT = Number(network.default_ws_port ?? 5321);
|
|
613
621
|
var DEFAULT_WS_HOST = String(network.default_ws_host ?? "127.0.0.1");
|
|
614
622
|
var DEFAULT_SERVER_HOST = String(network.default_server_host ?? "0.0.0.0");
|
|
@@ -2156,6 +2164,32 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
|
|
|
2156
2164
|
VerificationStatus2["SKIPPED"] = "skipped";
|
|
2157
2165
|
return VerificationStatus2;
|
|
2158
2166
|
})(VerificationStatus || {});
|
|
2167
|
+
var PreconditionViolation = class extends Error {
|
|
2168
|
+
pcardHash;
|
|
2169
|
+
inputHash;
|
|
2170
|
+
detail;
|
|
2171
|
+
constructor(pcardHash, inputHash, detail = "") {
|
|
2172
|
+
const msg = `PreconditionViolation: PCard ${pcardHash.substring(0, 16)} rejected input ${inputHash.substring(0, 16)}${detail ? ` \u2014 ${detail}` : ""}`;
|
|
2173
|
+
super(msg);
|
|
2174
|
+
this.name = "PreconditionViolation";
|
|
2175
|
+
this.pcardHash = pcardHash;
|
|
2176
|
+
this.inputHash = inputHash;
|
|
2177
|
+
this.detail = detail;
|
|
2178
|
+
}
|
|
2179
|
+
};
|
|
2180
|
+
var PostconditionViolation = class extends Error {
|
|
2181
|
+
pcardHash;
|
|
2182
|
+
outputRepr;
|
|
2183
|
+
detail;
|
|
2184
|
+
constructor(pcardHash, outputRepr, detail = "") {
|
|
2185
|
+
const msg = `PostconditionViolation: PCard ${pcardHash.substring(0, 16)} postcondition failed for output ${outputRepr.substring(0, 64)}${detail ? ` \u2014 ${detail}` : ""}`;
|
|
2186
|
+
super(msg);
|
|
2187
|
+
this.name = "PostconditionViolation";
|
|
2188
|
+
this.pcardHash = pcardHash;
|
|
2189
|
+
this.outputRepr = outputRepr;
|
|
2190
|
+
this.detail = detail;
|
|
2191
|
+
}
|
|
2192
|
+
};
|
|
2159
2193
|
|
|
2160
2194
|
// src/ptr/browser/storage/MCardStore.ts
|
|
2161
2195
|
var import_idb2 = require("idb");
|
|
@@ -2790,6 +2824,8 @@ var validationRegistry = new ValidationRegistry();
|
|
|
2790
2824
|
MCard,
|
|
2791
2825
|
MCardStore,
|
|
2792
2826
|
Maybe,
|
|
2827
|
+
PostconditionViolation,
|
|
2828
|
+
PreconditionViolation,
|
|
2793
2829
|
Reader,
|
|
2794
2830
|
ServiceWorkerPTR,
|
|
2795
2831
|
SqliteWasmEngine,
|
package/dist/index.browser.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StorageEngine, M as MCard, P as Page } from './AbstractSqlEngine-
|
|
1
|
+
import { S as StorageEngine, M as MCard, P as Page } from './AbstractSqlEngine-DKka6XjT.cjs';
|
|
2
2
|
export { SqliteWasmEngine } from './storage/SqliteWasmEngine.cjs';
|
|
3
3
|
import { getWebInstrumentations, Faro } from '@grafana/faro-web-sdk';
|
|
4
4
|
|
|
@@ -700,6 +700,24 @@ interface ExecutionResult {
|
|
|
700
700
|
liveness_metrics: LivenessMetric[];
|
|
701
701
|
error_message?: string;
|
|
702
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* Raised when a PCard's precondition check fails during VCard Sandwich evaluation.
|
|
705
|
+
*/
|
|
706
|
+
declare class PreconditionViolation extends Error {
|
|
707
|
+
readonly pcardHash: string;
|
|
708
|
+
readonly inputHash: string;
|
|
709
|
+
readonly detail: string;
|
|
710
|
+
constructor(pcardHash: string, inputHash: string, detail?: string);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Raised when a PCard's postcondition check fails during VCard Sandwich evaluation.
|
|
714
|
+
*/
|
|
715
|
+
declare class PostconditionViolation extends Error {
|
|
716
|
+
readonly pcardHash: string;
|
|
717
|
+
readonly outputRepr: string;
|
|
718
|
+
readonly detail: string;
|
|
719
|
+
constructor(pcardHash: string, outputRepr: string, detail?: string);
|
|
720
|
+
}
|
|
703
721
|
|
|
704
722
|
type StoredMCardContent = string | Uint8Array | Record<string, unknown>;
|
|
705
723
|
type CardRecord = {
|
|
@@ -820,4 +838,4 @@ declare class ValidationRegistry {
|
|
|
820
838
|
}
|
|
821
839
|
declare const validationRegistry: ValidationRegistry;
|
|
822
840
|
|
|
823
|
-
export { ALGORITHM_HIERARCHY, CardCollection, ContentHandle, ContentTypeInterpreter, EVENT_CONSTANTS, Either, ErrorCodes, type ExecutionResult, FaroSidecar, type FaroSidecarConfig, GTime, HandleValidationError, HashValidator, IO, IndexedDBEngine, type JsonRpcRequest, type JsonRpcResponse, LensProtocol, type LivenessMetric, MCard, MCardStore, Maybe, Page, type PolynomialTerm, type PrimeHash, Reader, type SafetyViolation, ServiceWorkerPTR, State, StorageEngine, ValidationRegistry, VerificationStatus, Writer, computeHash, validateHandle, validationRegistry };
|
|
841
|
+
export { ALGORITHM_HIERARCHY, CardCollection, ContentHandle, ContentTypeInterpreter, EVENT_CONSTANTS, Either, ErrorCodes, type ExecutionResult, FaroSidecar, type FaroSidecarConfig, GTime, HandleValidationError, HashValidator, IO, IndexedDBEngine, type JsonRpcRequest, type JsonRpcResponse, LensProtocol, type LivenessMetric, MCard, MCardStore, Maybe, Page, type PolynomialTerm, PostconditionViolation, PreconditionViolation, type PrimeHash, Reader, type SafetyViolation, ServiceWorkerPTR, State, StorageEngine, ValidationRegistry, VerificationStatus, Writer, computeHash, validateHandle, validationRegistry };
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StorageEngine, M as MCard, P as Page } from './AbstractSqlEngine-
|
|
1
|
+
import { S as StorageEngine, M as MCard, P as Page } from './AbstractSqlEngine-DKka6XjT.js';
|
|
2
2
|
export { SqliteWasmEngine } from './storage/SqliteWasmEngine.js';
|
|
3
3
|
import { getWebInstrumentations, Faro } from '@grafana/faro-web-sdk';
|
|
4
4
|
|
|
@@ -700,6 +700,24 @@ interface ExecutionResult {
|
|
|
700
700
|
liveness_metrics: LivenessMetric[];
|
|
701
701
|
error_message?: string;
|
|
702
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* Raised when a PCard's precondition check fails during VCard Sandwich evaluation.
|
|
705
|
+
*/
|
|
706
|
+
declare class PreconditionViolation extends Error {
|
|
707
|
+
readonly pcardHash: string;
|
|
708
|
+
readonly inputHash: string;
|
|
709
|
+
readonly detail: string;
|
|
710
|
+
constructor(pcardHash: string, inputHash: string, detail?: string);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Raised when a PCard's postcondition check fails during VCard Sandwich evaluation.
|
|
714
|
+
*/
|
|
715
|
+
declare class PostconditionViolation extends Error {
|
|
716
|
+
readonly pcardHash: string;
|
|
717
|
+
readonly outputRepr: string;
|
|
718
|
+
readonly detail: string;
|
|
719
|
+
constructor(pcardHash: string, outputRepr: string, detail?: string);
|
|
720
|
+
}
|
|
703
721
|
|
|
704
722
|
type StoredMCardContent = string | Uint8Array | Record<string, unknown>;
|
|
705
723
|
type CardRecord = {
|
|
@@ -820,4 +838,4 @@ declare class ValidationRegistry {
|
|
|
820
838
|
}
|
|
821
839
|
declare const validationRegistry: ValidationRegistry;
|
|
822
840
|
|
|
823
|
-
export { ALGORITHM_HIERARCHY, CardCollection, ContentHandle, ContentTypeInterpreter, EVENT_CONSTANTS, Either, ErrorCodes, type ExecutionResult, FaroSidecar, type FaroSidecarConfig, GTime, HandleValidationError, HashValidator, IO, IndexedDBEngine, type JsonRpcRequest, type JsonRpcResponse, LensProtocol, type LivenessMetric, MCard, MCardStore, Maybe, Page, type PolynomialTerm, type PrimeHash, Reader, type SafetyViolation, ServiceWorkerPTR, State, StorageEngine, ValidationRegistry, VerificationStatus, Writer, computeHash, validateHandle, validationRegistry };
|
|
841
|
+
export { ALGORITHM_HIERARCHY, CardCollection, ContentHandle, ContentTypeInterpreter, EVENT_CONSTANTS, Either, ErrorCodes, type ExecutionResult, FaroSidecar, type FaroSidecarConfig, GTime, HandleValidationError, HashValidator, IO, IndexedDBEngine, type JsonRpcRequest, type JsonRpcResponse, LensProtocol, type LivenessMetric, MCard, MCardStore, Maybe, Page, type PolynomialTerm, PostconditionViolation, PreconditionViolation, type PrimeHash, Reader, type SafetyViolation, ServiceWorkerPTR, State, StorageEngine, ValidationRegistry, VerificationStatus, Writer, computeHash, validateHandle, validationRegistry };
|
package/dist/index.browser.js
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
FaroSidecar,
|
|
4
4
|
LensProtocol,
|
|
5
5
|
MCardStore,
|
|
6
|
+
PostconditionViolation,
|
|
7
|
+
PreconditionViolation,
|
|
6
8
|
Reader,
|
|
7
9
|
ServiceWorkerPTR,
|
|
8
10
|
State,
|
|
@@ -11,10 +13,10 @@ import {
|
|
|
11
13
|
Writer,
|
|
12
14
|
computeHash,
|
|
13
15
|
validationRegistry
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XJZOEM5F.js";
|
|
15
17
|
import {
|
|
16
18
|
IndexedDBEngine
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NGTY4P6A.js";
|
|
18
20
|
import {
|
|
19
21
|
IO
|
|
20
22
|
} from "./chunk-MPMRBT5R.js";
|
|
@@ -23,8 +25,8 @@ import {
|
|
|
23
25
|
} from "./chunk-2KADE3SE.js";
|
|
24
26
|
import {
|
|
25
27
|
SqliteWasmEngine
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-7AXRV7NS.js";
|
|
29
|
+
import "./chunk-HIVVDGE5.js";
|
|
28
30
|
import "./chunk-3EIBJPNF.js";
|
|
29
31
|
import {
|
|
30
32
|
ContentHandle,
|
|
@@ -39,8 +41,8 @@ import {
|
|
|
39
41
|
import {
|
|
40
42
|
CardCollection,
|
|
41
43
|
Maybe
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
+
} from "./chunk-QPVEUPMU.js";
|
|
45
|
+
import "./chunk-3FFEA2XK.js";
|
|
44
46
|
import {
|
|
45
47
|
ContentTypeInterpreter,
|
|
46
48
|
MCard
|
|
@@ -71,6 +73,8 @@ export {
|
|
|
71
73
|
MCard,
|
|
72
74
|
MCardStore,
|
|
73
75
|
Maybe,
|
|
76
|
+
PostconditionViolation,
|
|
77
|
+
PreconditionViolation,
|
|
74
78
|
Reader,
|
|
75
79
|
ServiceWorkerPTR,
|
|
76
80
|
SqliteWasmEngine,
|