@tangle-network/agent-app 0.46.16 → 0.46.17
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/README.md +6 -5
- package/dist/assets/schema.d.ts +10 -10
- package/dist/assistant/index.js +1 -1
- package/dist/chat-react/index.js +1 -1
- package/dist/chat-routes/index.js +1 -1
- package/dist/chat-store/schema.d.ts +5 -5
- package/dist/{chunk-QL7HXXXL.js → chunk-55E3K3Q6.js} +2 -1
- package/dist/chunk-55E3K3Q6.js.map +1 -0
- package/dist/{chunk-3PFKLSIZ.js → chunk-P2EC5VHG.js} +1 -1
- package/dist/{chunk-3PFKLSIZ.js.map → chunk-P2EC5VHG.js.map} +1 -1
- package/dist/{chunk-FVTGGN3G.js → chunk-RXHGOLZR.js} +1 -1
- package/dist/chunk-RXHGOLZR.js.map +1 -0
- package/dist/config/index.d.ts +62 -62
- package/dist/design-canvas/schema.d.ts +6 -6
- package/dist/documents/pdf-inspector.d.ts +5 -7
- package/dist/documents/pdf-inspector.js.map +1 -1
- package/dist/intakes/drizzle/schema.d.ts +2 -2
- package/dist/interactions/contract.d.ts +3 -3
- package/dist/peer-floors/check.js +1 -1
- package/dist/peer-floors/cli.js +1 -1
- package/dist/plans/index.d.ts +1 -1
- package/dist/preset-cloudflare/index.d.ts +36 -36
- package/dist/record/drizzle/schema.d.ts +1 -1
- package/dist/run/index.d.ts +1 -1
- package/dist/sandbox/index.d.ts +2 -2
- package/dist/sandbox/index.js +1 -1
- package/dist/sequences/schema.d.ts +10 -10
- package/dist/signoff/proof-record.d.ts +11 -11
- package/dist/studio-react/styles.d.ts +2 -0
- package/dist/teams/drizzle/invitations-schema.d.ts +3 -3
- package/dist/teams/drizzle/schema.d.ts +6 -6
- package/dist/teams/roles.d.ts +3 -3
- package/dist/theme/styles.d.ts +2 -0
- package/dist/theme/tailwind-preset.d.ts +1 -1
- package/dist/tools/mcp-rpc.d.ts +1 -1
- package/dist/tools/openai.d.ts +1 -1
- package/dist/turn-stream/core.d.ts +15 -15
- package/dist/web/index.d.ts +5 -5
- package/dist/web-react/entry-composer.d.ts +1 -3
- package/dist/web-react/index.js +1 -1
- package/package.json +59 -52
- package/dist/chunk-FVTGGN3G.js.map +0 -1
- package/dist/chunk-QL7HXXXL.js.map +0 -1
package/dist/config/index.d.ts
CHANGED
|
@@ -177,162 +177,162 @@ export declare function defineAgentApp<const T extends AgentAppConfig>(config: T
|
|
|
177
177
|
* `../knowledge`; this floor pins only the fields the config contract owns.
|
|
178
178
|
*/
|
|
179
179
|
export declare const agentAppConfigJsonSchema: {
|
|
180
|
-
readonly $schema:
|
|
181
|
-
readonly $id:
|
|
182
|
-
readonly title:
|
|
183
|
-
readonly description:
|
|
184
|
-
readonly type:
|
|
180
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
181
|
+
readonly $id: 'https://tangle.tools/schemas/agent-app-config.json';
|
|
182
|
+
readonly title: 'AgentAppConfig';
|
|
183
|
+
readonly description: 'The declarative domain surface of a Tangle agent product.';
|
|
184
|
+
readonly type: 'object';
|
|
185
185
|
readonly additionalProperties: false;
|
|
186
|
-
readonly required: readonly [
|
|
186
|
+
readonly required: readonly ['identity', 'taxonomy', 'knowledge', 'integrations'];
|
|
187
187
|
readonly properties: {
|
|
188
188
|
readonly identity: {
|
|
189
|
-
readonly type:
|
|
189
|
+
readonly type: 'object';
|
|
190
190
|
readonly additionalProperties: false;
|
|
191
|
-
readonly required: readonly [
|
|
191
|
+
readonly required: readonly ['name', 'persona'];
|
|
192
192
|
readonly properties: {
|
|
193
193
|
readonly name: {
|
|
194
|
-
readonly type:
|
|
195
|
-
readonly description:
|
|
194
|
+
readonly type: 'string';
|
|
195
|
+
readonly description: 'Product/agent name.';
|
|
196
196
|
};
|
|
197
197
|
readonly persona: {
|
|
198
|
-
readonly type:
|
|
199
|
-
readonly description:
|
|
198
|
+
readonly type: 'string';
|
|
199
|
+
readonly description: 'One-paragraph persona — the system-prompt spine.';
|
|
200
200
|
};
|
|
201
201
|
readonly systemPromptFragments: {
|
|
202
|
-
readonly type:
|
|
202
|
+
readonly type: 'array';
|
|
203
203
|
readonly items: {
|
|
204
|
-
readonly type:
|
|
204
|
+
readonly type: 'string';
|
|
205
205
|
};
|
|
206
|
-
readonly description:
|
|
206
|
+
readonly description: 'Verbatim system-prompt fragments appended after the persona, in order.';
|
|
207
207
|
};
|
|
208
208
|
readonly disclaimers: {
|
|
209
|
-
readonly type:
|
|
209
|
+
readonly type: 'object';
|
|
210
210
|
readonly additionalProperties: {
|
|
211
|
-
readonly type:
|
|
211
|
+
readonly type: 'string';
|
|
212
212
|
};
|
|
213
|
-
readonly description:
|
|
213
|
+
readonly description: 'Named disclaimers keyed by stable id; values are literal text.';
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
216
|
};
|
|
217
217
|
readonly taxonomy: {
|
|
218
|
-
readonly type:
|
|
218
|
+
readonly type: 'object';
|
|
219
219
|
readonly additionalProperties: false;
|
|
220
|
-
readonly required: readonly [
|
|
220
|
+
readonly required: readonly ['proposalTypes', 'regulatedTypes'];
|
|
221
221
|
readonly properties: {
|
|
222
222
|
readonly proposalTypes: {
|
|
223
|
-
readonly type:
|
|
223
|
+
readonly type: 'array';
|
|
224
224
|
readonly items: {
|
|
225
|
-
readonly type:
|
|
225
|
+
readonly type: 'string';
|
|
226
226
|
};
|
|
227
|
-
readonly description:
|
|
227
|
+
readonly description: 'Closed allow-list of proposal types the product can emit.';
|
|
228
228
|
};
|
|
229
229
|
readonly regulatedTypes: {
|
|
230
|
-
readonly type:
|
|
230
|
+
readonly type: 'array';
|
|
231
231
|
readonly items: {
|
|
232
|
-
readonly type:
|
|
232
|
+
readonly type: 'string';
|
|
233
233
|
};
|
|
234
|
-
readonly description:
|
|
234
|
+
readonly description: 'Subset of proposalTypes that is approval-gated (certified-human required).';
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
};
|
|
238
238
|
readonly knowledge: {
|
|
239
|
-
readonly type:
|
|
239
|
+
readonly type: 'object';
|
|
240
240
|
readonly additionalProperties: false;
|
|
241
|
-
readonly required: readonly [
|
|
241
|
+
readonly required: readonly ['sources', 'requirements'];
|
|
242
242
|
readonly properties: {
|
|
243
243
|
readonly sources: {
|
|
244
|
-
readonly type:
|
|
245
|
-
readonly description:
|
|
244
|
+
readonly type: 'array';
|
|
245
|
+
readonly description: 'Sources the acquisition loop may draw on.';
|
|
246
246
|
readonly items: {
|
|
247
|
-
readonly type:
|
|
247
|
+
readonly type: 'object';
|
|
248
248
|
readonly additionalProperties: false;
|
|
249
|
-
readonly required: readonly [
|
|
249
|
+
readonly required: readonly ['uri'];
|
|
250
250
|
readonly properties: {
|
|
251
251
|
readonly uri: {
|
|
252
|
-
readonly type:
|
|
253
|
-
readonly description:
|
|
252
|
+
readonly type: 'string';
|
|
253
|
+
readonly description: 'Where the source lives (opaque to agent-app).';
|
|
254
254
|
};
|
|
255
255
|
readonly kind: {
|
|
256
|
-
readonly type:
|
|
257
|
-
readonly description:
|
|
256
|
+
readonly type: 'string';
|
|
257
|
+
readonly description: 'Optional source classifier (web/vault/regulation/…).';
|
|
258
258
|
};
|
|
259
259
|
};
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
262
|
readonly requirements: {
|
|
263
|
-
readonly type:
|
|
263
|
+
readonly type: 'array';
|
|
264
264
|
readonly description: "Declarative KnowledgeRequirementSpec[] (../knowledge) that gate the loop.";
|
|
265
265
|
readonly items: {
|
|
266
|
-
readonly type:
|
|
266
|
+
readonly type: 'object';
|
|
267
267
|
readonly additionalProperties: true;
|
|
268
268
|
};
|
|
269
269
|
};
|
|
270
270
|
readonly loop: {
|
|
271
|
-
readonly type:
|
|
271
|
+
readonly type: 'object';
|
|
272
272
|
readonly additionalProperties: false;
|
|
273
|
-
readonly description:
|
|
273
|
+
readonly description: 'Acquisition-loop config.';
|
|
274
274
|
readonly properties: {
|
|
275
275
|
readonly goal: {
|
|
276
|
-
readonly type:
|
|
277
|
-
readonly description:
|
|
276
|
+
readonly type: 'string';
|
|
277
|
+
readonly description: 'Acquisition goal in natural language.';
|
|
278
278
|
};
|
|
279
279
|
readonly minConfidence: {
|
|
280
|
-
readonly type:
|
|
280
|
+
readonly type: 'number';
|
|
281
281
|
readonly minimum: 0;
|
|
282
282
|
readonly maximum: 1;
|
|
283
|
-
readonly description:
|
|
283
|
+
readonly description: 'Minimum aggregate confidence the loop must reach.';
|
|
284
284
|
};
|
|
285
285
|
readonly freshness: {
|
|
286
|
-
readonly type:
|
|
287
|
-
readonly description:
|
|
286
|
+
readonly type: 'string';
|
|
287
|
+
readonly description: 'How fresh acquired knowledge must be.';
|
|
288
288
|
};
|
|
289
289
|
};
|
|
290
290
|
};
|
|
291
291
|
};
|
|
292
292
|
};
|
|
293
293
|
readonly integrations: {
|
|
294
|
-
readonly type:
|
|
294
|
+
readonly type: 'object';
|
|
295
295
|
readonly additionalProperties: false;
|
|
296
|
-
readonly required: readonly [
|
|
296
|
+
readonly required: readonly ['enabled'];
|
|
297
297
|
readonly properties: {
|
|
298
298
|
readonly enabled: {
|
|
299
|
-
readonly type:
|
|
299
|
+
readonly type: 'array';
|
|
300
300
|
readonly items: {
|
|
301
|
-
readonly type:
|
|
301
|
+
readonly type: 'string';
|
|
302
302
|
};
|
|
303
|
-
readonly description:
|
|
303
|
+
readonly description: 'Enabled agent-integrations catalog kinds.';
|
|
304
304
|
};
|
|
305
305
|
};
|
|
306
306
|
};
|
|
307
307
|
readonly ui: {
|
|
308
|
-
readonly type:
|
|
308
|
+
readonly type: 'object';
|
|
309
309
|
readonly additionalProperties: false;
|
|
310
|
-
readonly description:
|
|
310
|
+
readonly description: 'UI capability flags.';
|
|
311
311
|
readonly properties: {
|
|
312
312
|
readonly generatedUi: {
|
|
313
|
-
readonly type:
|
|
314
|
-
readonly description:
|
|
313
|
+
readonly type: 'boolean';
|
|
314
|
+
readonly description: 'Whether the agent may emit generated UI.';
|
|
315
315
|
};
|
|
316
316
|
};
|
|
317
317
|
};
|
|
318
318
|
readonly model: {
|
|
319
|
-
readonly type:
|
|
319
|
+
readonly type: 'object';
|
|
320
320
|
readonly additionalProperties: false;
|
|
321
321
|
readonly description: "Resolved TangleModelConfig (../runtime). Omit to resolve from env.";
|
|
322
|
-
readonly required: readonly [
|
|
322
|
+
readonly required: readonly ['provider', 'model', 'apiKey', 'baseUrl'];
|
|
323
323
|
readonly properties: {
|
|
324
324
|
readonly provider: {
|
|
325
|
-
readonly type:
|
|
326
|
-
readonly enum: readonly [
|
|
325
|
+
readonly type: 'string';
|
|
326
|
+
readonly enum: readonly ['openai-compat', 'anthropic'];
|
|
327
327
|
};
|
|
328
328
|
readonly model: {
|
|
329
|
-
readonly type:
|
|
329
|
+
readonly type: 'string';
|
|
330
330
|
};
|
|
331
331
|
readonly apiKey: {
|
|
332
|
-
readonly type:
|
|
332
|
+
readonly type: 'string';
|
|
333
333
|
};
|
|
334
334
|
readonly baseUrl: {
|
|
335
|
-
readonly type:
|
|
335
|
+
readonly type: 'string';
|
|
336
336
|
};
|
|
337
337
|
};
|
|
338
338
|
};
|
|
@@ -193,7 +193,7 @@ export declare function createDesignCanvasTables(opts: CreateDesignCanvasTablesO
|
|
|
193
193
|
generated: undefined;
|
|
194
194
|
}, {}, {}>;
|
|
195
195
|
};
|
|
196
|
-
dialect:
|
|
196
|
+
dialect: 'sqlite';
|
|
197
197
|
}>;
|
|
198
198
|
designDecisions: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
199
199
|
name: "design_decision";
|
|
@@ -261,7 +261,7 @@ export declare function createDesignCanvasTables(opts: CreateDesignCanvasTablesO
|
|
|
261
261
|
tableName: "design_decision";
|
|
262
262
|
dataType: "string";
|
|
263
263
|
columnType: "SQLiteText";
|
|
264
|
-
data: "
|
|
264
|
+
data: "agent_edit" | "agent_proposal" | "export" | "human_edit" | "note";
|
|
265
265
|
driverParam: string;
|
|
266
266
|
notNull: true;
|
|
267
267
|
hasDefault: false;
|
|
@@ -369,7 +369,7 @@ export declare function createDesignCanvasTables(opts: CreateDesignCanvasTablesO
|
|
|
369
369
|
generated: undefined;
|
|
370
370
|
}, {}, {}>;
|
|
371
371
|
};
|
|
372
|
-
dialect:
|
|
372
|
+
dialect: 'sqlite';
|
|
373
373
|
}>;
|
|
374
374
|
designExports: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
375
375
|
name: "design_export";
|
|
@@ -437,7 +437,7 @@ export declare function createDesignCanvasTables(opts: CreateDesignCanvasTablesO
|
|
|
437
437
|
tableName: "design_export";
|
|
438
438
|
dataType: "string";
|
|
439
439
|
columnType: "SQLiteText";
|
|
440
|
-
data: "
|
|
440
|
+
data: "jpeg" | "json" | "png";
|
|
441
441
|
driverParam: string;
|
|
442
442
|
notNull: true;
|
|
443
443
|
hasDefault: false;
|
|
@@ -456,7 +456,7 @@ export declare function createDesignCanvasTables(opts: CreateDesignCanvasTablesO
|
|
|
456
456
|
tableName: "design_export";
|
|
457
457
|
dataType: "string";
|
|
458
458
|
columnType: "SQLiteText";
|
|
459
|
-
data: "completed" | "
|
|
459
|
+
data: "completed" | "failed" | "processing" | "queued";
|
|
460
460
|
driverParam: string;
|
|
461
461
|
notNull: true;
|
|
462
462
|
hasDefault: true;
|
|
@@ -545,7 +545,7 @@ export declare function createDesignCanvasTables(opts: CreateDesignCanvasTablesO
|
|
|
545
545
|
generated: undefined;
|
|
546
546
|
}, {}, {}>;
|
|
547
547
|
};
|
|
548
|
-
dialect:
|
|
548
|
+
dialect: 'sqlite';
|
|
549
549
|
}>;
|
|
550
550
|
};
|
|
551
551
|
/** Resolve the structure and data of design canvas tables for rendering and manipulation */
|
|
@@ -18,13 +18,11 @@
|
|
|
18
18
|
*
|
|
19
19
|
* **Engine behaviour this wrapper is built around, measured on real fixture
|
|
20
20
|
* PDFs (`tests/documents/pdf.test.ts` re-measures all of it):**
|
|
21
|
-
* - `extractText`
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* returns the readable pages' markdown, which is why `extract` uses it for
|
|
27
|
-
* markdown and for anything partially scanned.
|
|
21
|
+
* - `extractText` emits an image placeholder for a page with no text layer.
|
|
22
|
+
* Classification must run first so a placeholder is not reported as a
|
|
23
|
+
* complete extraction.
|
|
24
|
+
* - `processPdf` returns the readable pages' markdown, which is why `extract`
|
|
25
|
+
* uses it for markdown and for anything partially scanned.
|
|
28
26
|
* - `detectPdf` reports OCR pages 1-INDEXED, while `classifyPdf` reports the
|
|
29
27
|
* same pages 0-indexed. This wrapper uses `detectPdf` (it carries per-page
|
|
30
28
|
* reasons and layout that `classifyPdf` does not) and publishes 1-indexed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/documents/pdf-inspector.ts"],"sourcesContent":["/**\n * The wasm-backed {@link PdfEngine}, binding `@firecrawl/pdf-inspector-wasm`\n * (MIT, Rust→wasm).\n *\n * **Why this is its own subpath.** The engine's `.wasm` must reach the runtime\n * as a build-time module asset produced by the CONSUMER's bundler — workerd\n * forbids compiling wasm from bytes at request time — so a shared library\n * cannot import it. This file therefore imports only the JS glue and takes the\n * compiled module as an argument. Keeping it out of\n * `@tangle-network/agent-app/documents` also means a product that only handles\n * DOCX and text never needs the package installed at all.\n *\n * **Why this engine.** It is the one PDF extractor proven to run under real\n * workerd: the wasm imports nothing but its own JS glue (no WASI), and\n * `initSync` instantiates an already-compiled `WebAssembly.Module`, which is\n * exactly the case workerd permits. The napi build does not run there, and\n * pdfjs-based extractors need DOM globals workerd does not have.\n *\n * **Engine behaviour this wrapper is built around, measured on real fixture\n * PDFs (`tests/documents/pdf.test.ts` re-measures all of it):**\n * - `extractText` PANICS (`RuntimeError: unreachable`, an out-of-bounds index\n * in the engine's layout table) on any document with a page that has no text\n * layer — including a `mixed` document whose other pages are fine. The\n * instance survives the panic, but nothing recovers the text.\n * - `detectPdf` and `processPdf` do NOT panic on those documents; `processPdf`\n * returns the readable pages' markdown, which is why `extract` uses it for\n * markdown and for anything partially scanned.\n * - `detectPdf` reports OCR pages 1-INDEXED, while `classifyPdf` reports the\n * same pages 0-indexed. This wrapper uses `detectPdf` (it carries per-page\n * reasons and layout that `classifyPdf` does not) and publishes 1-indexed.\n * - `processPdf`'s own `pagesNeedingOcr` is unreliable — it reported both pages\n * of a fully text-based 2-page PDF as needing OCR — so the classification a\n * caller sees always comes from `detectPdf`.\n */\n\nimport { detectPdf, initSync, processPdf, extractText, version } from '@firecrawl/pdf-inspector-wasm'\n\nimport type {\n DocumentOutcome,\n PdfClassification,\n PdfContentKind,\n PdfEngine,\n PdfPageClassification,\n PdfTextFormat,\n} from './types'\n\n/**\n * The compiled wasm, or a thunk that produces it on first use.\n *\n * A Worker passes the `.wasm` module import (a `WebAssembly.Module`); Node\n * passes raw bytes. A thunk defers reading either until a PDF actually arrives.\n */\nexport type PdfInspectorWasm =\n | WebAssembly.Module\n | BufferSource\n | (() => WebAssembly.Module | BufferSource)\n\n// `initSync` binds a module-global inside the engine's glue, so readiness is\n// per-isolate, not per-engine-instance: two engines built from the same wasm\n// must not each re-instantiate it.\nlet initialized = false\n\nfunction detail(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction fail(\n code: 'classification-failed' | 'extraction-failed',\n stage: 'classify' | 'extract',\n message: string,\n): { succeeded: false; error: { code: 'classification-failed' | 'extraction-failed'; stage: 'classify' | 'extract'; message: string; mediaType: string } } {\n return { succeeded: false, error: { code, stage, message, mediaType: 'application/pdf' } }\n}\n\nconst KINDS: Readonly<Record<string, PdfContentKind>> = {\n TextBased: 'text-based',\n Scanned: 'scanned',\n ImageBased: 'image-based',\n Mixed: 'mixed',\n}\n\n/** Instantiate the engine for this isolate. Idempotent; safe to call per\n * request. Exported so a product can warm the wasm at startup instead of\n * paying instantiation on a user's first upload. */\nexport function initPdfInspector(wasm: PdfInspectorWasm): DocumentOutcome<{ version: string }> {\n try {\n if (!initialized) {\n initSync({ module: typeof wasm === 'function' ? wasm() : wasm })\n initialized = true\n }\n return { succeeded: true, value: { version: version() } }\n } catch (error) {\n initialized = false\n return {\n succeeded: false,\n error: {\n code: 'classification-failed',\n stage: 'classify',\n mediaType: 'application/pdf',\n message: `The PDF engine's wasm failed to instantiate — ${detail(error)}. Check that the .wasm asset reaches the runtime as a compiled module (see the documents module docs).`,\n },\n }\n }\n}\n\n/** Whether the engine has been instantiated in this isolate. */\nexport function isPdfInspectorReady(): boolean {\n return initialized\n}\n\nfunction toClassification(result: {\n pdfType: string\n pageCount: number\n pagesNeedingOcr: number[]\n ocrReasonsByPage: { page: number; reasons: string[] }[]\n confidence: number\n layout: { isComplex: boolean; pagesWithTables: number[]; pagesWithColumns: number[] }\n hasEncodingIssues: boolean\n}): PdfClassification {\n const kind = KINDS[result.pdfType] ?? 'mixed'\n const needing = new Set(result.pagesNeedingOcr)\n const reasons = new Map(result.ocrReasonsByPage.map((entry) => [entry.page, entry.reasons]))\n const tables = new Set(result.layout.pagesWithTables)\n const columns = new Set(result.layout.pagesWithColumns)\n\n const pages: PdfPageClassification[] = []\n for (let pageNumber = 1; pageNumber <= result.pageCount; pageNumber++) {\n pages.push({\n pageNumber,\n index: pageNumber - 1,\n needsOcr: needing.has(pageNumber),\n ocrReasons: reasons.get(pageNumber) ?? [],\n hasTable: tables.has(pageNumber),\n hasColumns: columns.has(pageNumber),\n })\n }\n\n const pagesNeedingOcr = pages.filter((page) => page.needsOcr).map((page) => page.pageNumber)\n // `kind` alone cannot decide this: a 1-page scan and a 40-page document with\n // one scanned exhibit can both come back `Scanned`/`Mixed` depending on the\n // engine's confidence, so the page count is what separates \"no text at all\"\n // from \"text on most pages\".\n const noTextAnywhere = result.pageCount > 0 && pagesNeedingOcr.length === result.pageCount\n return {\n kind,\n pageCount: result.pageCount,\n confidence: result.confidence,\n pages,\n pagesNeedingOcr,\n needsOcr: noTextAnywhere || ((kind === 'scanned' || kind === 'image-based') && pagesNeedingOcr.length === 0),\n partiallyScanned: pagesNeedingOcr.length > 0 && !noTextAnywhere,\n complexLayout: result.layout.isComplex,\n hasEncodingIssues: result.hasEncodingIssues,\n }\n}\n\n/**\n * Build the wasm-backed engine. Instantiation is lazy — the first classify or\n * extract call initializes it — so importing this costs nothing until a PDF\n * arrives.\n */\nexport function createPdfInspectorEngine(wasm: PdfInspectorWasm): PdfEngine {\n const ready = (): DocumentOutcome<{ version: string }> => initPdfInspector(wasm)\n\n return {\n classify(bytes: Uint8Array) {\n const init = ready()\n if (!init.succeeded) return init\n try {\n return { succeeded: true, value: toClassification(detectPdf(bytes)) }\n } catch (error) {\n return fail('classification-failed', 'classify', `The PDF could not be read — ${detail(error)}.`)\n }\n },\n extract(bytes: Uint8Array, format: PdfTextFormat) {\n const init = ready()\n if (!init.succeeded) return { succeeded: false, error: { ...init.error, code: 'extraction-failed', stage: 'extract' } }\n try {\n if (format === 'text') return { succeeded: true, value: extractText(bytes) }\n const processed = processPdf(bytes, { profile: 'fidelity', includePageMarkers: true })\n return { succeeded: true, value: processed.markdown ?? '' }\n } catch (error) {\n return fail('extraction-failed', 'extract', `The PDF's text could not be extracted — ${detail(error)}.`)\n }\n },\n }\n}\n"],"mappings":";AAmCA,SAAS,WAAW,UAAU,YAAY,aAAa,eAAe;AAyBtE,IAAI,cAAc;AAElB,SAAS,OAAO,OAAwB;AACtC,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AAEA,SAAS,KACP,MACA,OACA,SACyJ;AACzJ,SAAO,EAAE,WAAW,OAAO,OAAO,EAAE,MAAM,OAAO,SAAS,WAAW,kBAAkB,EAAE;AAC3F;AAEA,IAAM,QAAkD;AAAA,EACtD,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,OAAO;AACT;AAKO,SAAS,iBAAiB,MAA8D;AAC7F,MAAI;AACF,QAAI,CAAC,aAAa;AAChB,eAAS,EAAE,QAAQ,OAAO,SAAS,aAAa,KAAK,IAAI,KAAK,CAAC;AAC/D,oBAAc;AAAA,IAChB;AACA,WAAO,EAAE,WA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gBAAgB,WAAW;AAAA,IAC1G,kBAAkB,gBAAgB,SAAS,KAAK,CAAC;AAAA,IACjD,eAAe,OAAO,OAAO;AAAA,IAC7B,mBAAmB,OAAO;AAAA,EAC5B;AACF;AAOO,SAAS,yBAAyB,MAAmC;AAC1E,QAAM,QAAQ,MAA4C,iBAAiB,IAAI;AAE/E,SAAO;AAAA,IACL,SAAS,OAAmB;AAC1B,YAAM,OAAO,MAAM;AACnB,UAAI,CAAC,KAAK,UAAW,QAAO;AAC5B,UAAI;AACF,eAAO,EAAE,WAAW,MAAM,OAAO,iBAAiB,UAAU,KAAK,CAAC,EAAE;AAAA,MACtE,SAAS,OAAO;AACd,eAAO,KAAK,yBAAyB,YAAY,oCAA+B,OAAO,KAAK,CAAC,GAAG;AAAA,MAClG;AAAA,IACF;AAAA,IACA,QAAQ,OAAmB,QAAuB;AAChD,YAAM,OAAO,MAAM;AACnB,UAAI,CAAC,KAAK,UAAW,QAAO,EAAE,WAAW,OAAO,OAAO,EAAE,GAAG,KAAK,OAAO,MAAM,qBAAqB,OAAO,UAAU,EAAE;AACtH,UAAI;AACF,YAAI,WAAW,OAAQ,QAAO,EAAE,WAAW,MAAM,OAAO,YAAY,KAAK,EAAE;AAC3E,cAAM,YAAY,WAAW,OAAO,EAAE,SAAS,YAAY,oBAAoB,KAAK,CAAC;AACrF,eAAO,EAAE,WAAW,MAAM,OAAO,UAAU,YAAY,GAAG;AAAA,MAC5D,SAAS,OAAO;AACd,eAAO,KAAK,qBAAqB,WAAW,gDAA2C,OAAO,KAAK,CAAC,GAAG;AAAA,MACzG;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/documents/pdf-inspector.ts"],"sourcesContent":["/**\n * The wasm-backed {@link PdfEngine}, binding `@firecrawl/pdf-inspector-wasm`\n * (MIT, Rust→wasm).\n *\n * **Why this is its own subpath.** The engine's `.wasm` must reach the runtime\n * as a build-time module asset produced by the CONSUMER's bundler — workerd\n * forbids compiling wasm from bytes at request time — so a shared library\n * cannot import it. This file therefore imports only the JS glue and takes the\n * compiled module as an argument. Keeping it out of\n * `@tangle-network/agent-app/documents` also means a product that only handles\n * DOCX and text never needs the package installed at all.\n *\n * **Why this engine.** It is the one PDF extractor proven to run under real\n * workerd: the wasm imports nothing but its own JS glue (no WASI), and\n * `initSync` instantiates an already-compiled `WebAssembly.Module`, which is\n * exactly the case workerd permits. The napi build does not run there, and\n * pdfjs-based extractors need DOM globals workerd does not have.\n *\n * **Engine behaviour this wrapper is built around, measured on real fixture\n * PDFs (`tests/documents/pdf.test.ts` re-measures all of it):**\n * - `extractText` emits an image placeholder for a page with no text layer.\n * Classification must run first so a placeholder is not reported as a\n * complete extraction.\n * - `processPdf` returns the readable pages' markdown, which is why `extract`\n * uses it for markdown and for anything partially scanned.\n * - `detectPdf` reports OCR pages 1-INDEXED, while `classifyPdf` reports the\n * same pages 0-indexed. This wrapper uses `detectPdf` (it carries per-page\n * reasons and layout that `classifyPdf` does not) and publishes 1-indexed.\n * - `processPdf`'s own `pagesNeedingOcr` is unreliable — it reported both pages\n * of a fully text-based 2-page PDF as needing OCR — so the classification a\n * caller sees always comes from `detectPdf`.\n */\n\nimport { detectPdf, initSync, processPdf, extractText, version } from '@firecrawl/pdf-inspector-wasm'\n\nimport type {\n DocumentOutcome,\n PdfClassification,\n PdfContentKind,\n PdfEngine,\n PdfPageClassification,\n PdfTextFormat,\n} from './types'\n\n/**\n * The compiled wasm, or a thunk that produces it on first use.\n *\n * A Worker passes the `.wasm` module import (a `WebAssembly.Module`); Node\n * passes raw bytes. A thunk defers reading either until a PDF actually arrives.\n */\nexport type PdfInspectorWasm =\n | WebAssembly.Module\n | BufferSource\n | (() => WebAssembly.Module | BufferSource)\n\n// `initSync` binds a module-global inside the engine's glue, so readiness is\n// per-isolate, not per-engine-instance: two engines built from the same wasm\n// must not each re-instantiate it.\nlet initialized = false\n\nfunction detail(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction fail(\n code: 'classification-failed' | 'extraction-failed',\n stage: 'classify' | 'extract',\n message: string,\n): { succeeded: false; error: { code: 'classification-failed' | 'extraction-failed'; stage: 'classify' | 'extract'; message: string; mediaType: string } } {\n return { succeeded: false, error: { code, stage, message, mediaType: 'application/pdf' } }\n}\n\nconst KINDS: Readonly<Record<string, PdfContentKind>> = {\n TextBased: 'text-based',\n Scanned: 'scanned',\n ImageBased: 'image-based',\n Mixed: 'mixed',\n}\n\n/** Instantiate the engine for this isolate. Idempotent; safe to call per\n * request. Exported so a product can warm the wasm at startup instead of\n * paying instantiation on a user's first upload. */\nexport function initPdfInspector(wasm: PdfInspectorWasm): DocumentOutcome<{ version: string }> {\n try {\n if (!initialized) {\n initSync({ module: typeof wasm === 'function' ? wasm() : wasm })\n initialized = true\n }\n return { succeeded: true, value: { version: version() } }\n } catch (error) {\n initialized = false\n return {\n succeeded: false,\n error: {\n code: 'classification-failed',\n stage: 'classify',\n mediaType: 'application/pdf',\n message: `The PDF engine's wasm failed to instantiate — ${detail(error)}. Check that the .wasm asset reaches the runtime as a compiled module (see the documents module docs).`,\n },\n }\n }\n}\n\n/** Whether the engine has been instantiated in this isolate. */\nexport function isPdfInspectorReady(): boolean {\n return initialized\n}\n\nfunction toClassification(result: {\n pdfType: string\n pageCount: number\n pagesNeedingOcr: number[]\n ocrReasonsByPage: { page: number; reasons: string[] }[]\n confidence: number\n layout: { isComplex: boolean; pagesWithTables: number[]; pagesWithColumns: number[] }\n hasEncodingIssues: boolean\n}): PdfClassification {\n const kind = KINDS[result.pdfType] ?? 'mixed'\n const needing = new Set(result.pagesNeedingOcr)\n const reasons = new Map(result.ocrReasonsByPage.map((entry) => [entry.page, entry.reasons]))\n const tables = new Set(result.layout.pagesWithTables)\n const columns = new Set(result.layout.pagesWithColumns)\n\n const pages: PdfPageClassification[] = []\n for (let pageNumber = 1; pageNumber <= result.pageCount; pageNumber++) {\n pages.push({\n pageNumber,\n index: pageNumber - 1,\n needsOcr: needing.has(pageNumber),\n ocrReasons: reasons.get(pageNumber) ?? [],\n hasTable: tables.has(pageNumber),\n hasColumns: columns.has(pageNumber),\n })\n }\n\n const pagesNeedingOcr = pages.filter((page) => page.needsOcr).map((page) => page.pageNumber)\n // `kind` alone cannot decide this: a 1-page scan and a 40-page document with\n // one scanned exhibit can both come back `Scanned`/`Mixed` depending on the\n // engine's confidence, so the page count is what separates \"no text at all\"\n // from \"text on most pages\".\n const noTextAnywhere = result.pageCount > 0 && pagesNeedingOcr.length === result.pageCount\n return {\n kind,\n pageCount: result.pageCount,\n confidence: result.confidence,\n pages,\n pagesNeedingOcr,\n needsOcr: noTextAnywhere || ((kind === 'scanned' || kind === 'image-based') && pagesNeedingOcr.length === 0),\n partiallyScanned: pagesNeedingOcr.length > 0 && !noTextAnywhere,\n complexLayout: result.layout.isComplex,\n hasEncodingIssues: result.hasEncodingIssues,\n }\n}\n\n/**\n * Build the wasm-backed engine. Instantiation is lazy — the first classify or\n * extract call initializes it — so importing this costs nothing until a PDF\n * arrives.\n */\nexport function createPdfInspectorEngine(wasm: PdfInspectorWasm): PdfEngine {\n const ready = (): DocumentOutcome<{ version: string }> => initPdfInspector(wasm)\n\n return {\n classify(bytes: Uint8Array) {\n const init = ready()\n if (!init.succeeded) return init\n try {\n return { succeeded: true, value: toClassification(detectPdf(bytes)) }\n } catch (error) {\n return fail('classification-failed', 'classify', `The PDF could not be read — ${detail(error)}.`)\n }\n },\n extract(bytes: Uint8Array, format: PdfTextFormat) {\n const init = ready()\n if (!init.succeeded) return { succeeded: false, error: { ...init.error, code: 'extraction-failed', stage: 'extract' } }\n try {\n if (format === 'text') return { succeeded: true, value: extractText(bytes) }\n const processed = processPdf(bytes, { profile: 'fidelity', includePageMarkers: true })\n return { succeeded: true, value: processed.markdown ?? '' }\n } catch (error) {\n return fail('extraction-failed', 'extract', `The PDF's text could not be extracted — ${detail(error)}.`)\n }\n },\n }\n}\n"],"mappings":";AAiCA,SAAS,WAAW,UAAU,YAAY,aAAa,eA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,OAAO,YAAY,KAAK,EAAE;AAC3E,cAAM,YAAY,WAAW,OAAO,EAAE,SAAS,YAAY,oBAAoB,KAAK,CAAC;AACrF,eAAO,EAAE,WAAW,MAAM,OAAO,UAAU,YAAY,GAAG;AAAA,MAC5D,SAAS,OAAO;AACd,eAAO,KAAK,qBAAqB,WAAW,gDAA2C,OAAO,KAAK,CAAC,GAAG;AAAA,MACzG;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -168,7 +168,7 @@ declare function createUserIntakeTable(userTable: IntakeParentTable): import("dr
|
|
|
168
168
|
generated: undefined;
|
|
169
169
|
}, {}, {}>;
|
|
170
170
|
};
|
|
171
|
-
dialect:
|
|
171
|
+
dialect: 'sqlite';
|
|
172
172
|
}>;
|
|
173
173
|
declare function createProjectIntakeTable(workspaceTable: IntakeParentTable): import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
174
174
|
name: "project_intake";
|
|
@@ -300,7 +300,7 @@ declare function createProjectIntakeTable(workspaceTable: IntakeParentTable): im
|
|
|
300
300
|
generated: undefined;
|
|
301
301
|
}, {}, {}>;
|
|
302
302
|
};
|
|
303
|
-
dialect:
|
|
303
|
+
dialect: 'sqlite';
|
|
304
304
|
}>;
|
|
305
305
|
/**
|
|
306
306
|
* Build the intake tables wired to the product's tables. Always returns
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type InteractionData, type InteractionField, type InteractionOutcome, type InteractionRequest } from '@tangle-network/agent-interface';
|
|
2
2
|
export type { InteractionData, InteractionOutcome, InteractionRequest };
|
|
3
3
|
/** Sidecar → client: the agent raised an ask; data = `{ request }`. */
|
|
4
|
-
export declare const INTERACTION_EVENT:
|
|
4
|
+
export declare const INTERACTION_EVENT: 'interaction';
|
|
5
5
|
/** Sidecar → client: the ask was withdrawn; data = `{ id, reason? }`. */
|
|
6
|
-
export declare const INTERACTION_CANCEL_EVENT:
|
|
6
|
+
export declare const INTERACTION_CANCEL_EVENT: 'interaction.cancel';
|
|
7
7
|
/** An ask was answered; data = `{ id, status }`. In the wire contract so a
|
|
8
8
|
* server broadcast and a client-local mark share one event name. */
|
|
9
|
-
export declare const INTERACTION_RESOLVED_EVENT:
|
|
9
|
+
export declare const INTERACTION_RESOLVED_EVENT: 'interaction.resolved';
|
|
10
10
|
/** Resolve if the given interaction kind is renderable within the application context */
|
|
11
11
|
export declare function isRenderableInteractionKind(kind: string): boolean;
|
|
12
12
|
/** Answer/field keys the sidecar will accept: identifier-safe and never a
|
package/dist/peer-floors/cli.js
CHANGED
package/dist/plans/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This module only projects that substrate state into chat events and
|
|
6
6
|
* persisted message parts that products can render and restore.
|
|
7
7
|
*/
|
|
8
|
-
export declare const PLAN_SUBMITTED_EVENT:
|
|
8
|
+
export declare const PLAN_SUBMITTED_EVENT: 'plan.submitted';
|
|
9
9
|
/** Sandbox plan lifecycle. `preparing` is the transient submission state and
|
|
10
10
|
* is retained in the projection even though the chat card normally starts at
|
|
11
11
|
* `pending`. */
|
|
@@ -49,55 +49,55 @@ export interface D1Like {
|
|
|
49
49
|
* without a string literal. */
|
|
50
50
|
export declare const PRESET_TABLES: {
|
|
51
51
|
readonly proposals: {
|
|
52
|
-
readonly name:
|
|
52
|
+
readonly name: 'proposals';
|
|
53
53
|
readonly columns: {
|
|
54
|
-
readonly id:
|
|
55
|
-
readonly workspaceId:
|
|
56
|
-
readonly threadId:
|
|
57
|
-
readonly type:
|
|
58
|
-
readonly title:
|
|
59
|
-
readonly description:
|
|
60
|
-
readonly status:
|
|
61
|
-
readonly createdBy:
|
|
62
|
-
readonly createdAt:
|
|
54
|
+
readonly id: 'id';
|
|
55
|
+
readonly workspaceId: 'workspace_id';
|
|
56
|
+
readonly threadId: 'thread_id';
|
|
57
|
+
readonly type: 'type';
|
|
58
|
+
readonly title: 'title';
|
|
59
|
+
readonly description: 'description';
|
|
60
|
+
readonly status: 'status';
|
|
61
|
+
readonly createdBy: 'created_by';
|
|
62
|
+
readonly createdAt: 'created_at';
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
readonly knowledge: {
|
|
66
|
-
readonly name:
|
|
66
|
+
readonly name: 'knowledge';
|
|
67
67
|
readonly columns: {
|
|
68
|
-
readonly id:
|
|
69
|
-
readonly workspaceId:
|
|
70
|
-
readonly path:
|
|
71
|
-
readonly kind:
|
|
72
|
-
readonly label:
|
|
73
|
-
readonly content:
|
|
74
|
-
readonly createdAt:
|
|
68
|
+
readonly id: 'id';
|
|
69
|
+
readonly workspaceId: 'workspace_id';
|
|
70
|
+
readonly path: 'path';
|
|
71
|
+
readonly kind: 'kind';
|
|
72
|
+
readonly label: 'label';
|
|
73
|
+
readonly content: 'content';
|
|
74
|
+
readonly createdAt: 'created_at';
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
readonly deadlines: {
|
|
78
|
-
readonly name:
|
|
78
|
+
readonly name: 'deadlines';
|
|
79
79
|
readonly columns: {
|
|
80
|
-
readonly id:
|
|
81
|
-
readonly workspaceId:
|
|
82
|
-
readonly threadId:
|
|
83
|
-
readonly title:
|
|
84
|
-
readonly dueDate:
|
|
85
|
-
readonly priority:
|
|
86
|
-
readonly status:
|
|
87
|
-
readonly createdAt:
|
|
80
|
+
readonly id: 'id';
|
|
81
|
+
readonly workspaceId: 'workspace_id';
|
|
82
|
+
readonly threadId: 'thread_id';
|
|
83
|
+
readonly title: 'title';
|
|
84
|
+
readonly dueDate: 'due_date';
|
|
85
|
+
readonly priority: 'priority';
|
|
86
|
+
readonly status: 'status';
|
|
87
|
+
readonly createdAt: 'created_at';
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
readonly workspaceKeys: {
|
|
91
|
-
readonly name:
|
|
91
|
+
readonly name: 'workspace_keys';
|
|
92
92
|
readonly columns: {
|
|
93
|
-
readonly id:
|
|
94
|
-
readonly workspaceId:
|
|
95
|
-
readonly keyId:
|
|
96
|
-
readonly keyEncrypted:
|
|
97
|
-
readonly budgetUsd:
|
|
98
|
-
readonly expiresAt:
|
|
99
|
-
readonly revokedAt:
|
|
100
|
-
readonly createdAt:
|
|
93
|
+
readonly id: 'id';
|
|
94
|
+
readonly workspaceId: 'workspace_id';
|
|
95
|
+
readonly keyId: 'key_id';
|
|
96
|
+
readonly keyEncrypted: 'key_encrypted';
|
|
97
|
+
readonly budgetUsd: 'budget_usd';
|
|
98
|
+
readonly expiresAt: 'expires_at';
|
|
99
|
+
readonly revokedAt: 'revoked_at';
|
|
100
|
+
readonly createdAt: 'created_at';
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
};
|
|
@@ -462,7 +462,7 @@ declare function buildRecordEntryTable(options: CreateRecordTableOptions): impor
|
|
|
462
462
|
generated: undefined;
|
|
463
463
|
}, {}, {}>;
|
|
464
464
|
};
|
|
465
|
-
dialect:
|
|
465
|
+
dialect: 'sqlite';
|
|
466
466
|
}>;
|
|
467
467
|
/** The table shape {@link createRecordTable} produces. */
|
|
468
468
|
export type RecordTable = ReturnType<typeof buildRecordEntryTable>;
|
package/dist/run/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { type Harness } from '../harness/index';
|
|
|
20
20
|
export type ExecutionMode = 'router' | 'sandbox';
|
|
21
21
|
/** The router pseudo-harness — the absence of a sandbox backend. Not a member
|
|
22
22
|
* of `KNOWN_HARNESSES`; callers may pass it explicitly instead of null. */
|
|
23
|
-
export declare const ROUTER_HARNESS:
|
|
23
|
+
export declare const ROUTER_HARNESS: 'router';
|
|
24
24
|
/** Provide a type alias for the ROUTER_HARNESS constant to enable consistent router harness usage */
|
|
25
25
|
export type RouterHarness = typeof ROUTER_HARNESS;
|
|
26
26
|
/** Resolve a ProfileHarness as a Harness, RouterHarness, null, or undefined value */
|
package/dist/sandbox/index.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export interface SandboxBuildContext {
|
|
|
82
82
|
userId?: string;
|
|
83
83
|
}
|
|
84
84
|
/** Hosts required when a product installs its pinned Python tooling at boot. */
|
|
85
|
-
export declare const PYPI_EGRESS_DOMAINS: readonly [
|
|
85
|
+
export declare const PYPI_EGRESS_DOMAINS: readonly ['pypi.org', 'files.pythonhosted.org', 'pypi.python.org'];
|
|
86
86
|
export declare function buildProductEgressPolicy(publicOrigin: string | URL, extraDomains?: readonly string[]): EgressPolicy;
|
|
87
87
|
export type { StorageConfig };
|
|
88
88
|
/** Define a scope containing workspace and optional user identifiers for sandbox environments */
|
|
@@ -495,7 +495,7 @@ export interface ProvisionProfileSection {
|
|
|
495
495
|
* the gate is testable without the SDK's (unexported) create-payload type. */
|
|
496
496
|
export interface ProvisionPayloadSections {
|
|
497
497
|
env?: Record<string, string>;
|
|
498
|
-
secrets?: readonly string[];
|
|
498
|
+
secrets?: readonly string[] | 'all';
|
|
499
499
|
/** `profile` may also be a named-profile string ref (the SDK's
|
|
500
500
|
* `BackendConfig` union) — a string ref is tiny and has no files channel. */
|
|
501
501
|
backend?: {
|
package/dist/sandbox/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
workspaceSandboxRecoveryMessage,
|
|
92
92
|
workspaceSandboxRecoveryRecommendedActions,
|
|
93
93
|
writeProfileFilesToBox
|
|
94
|
-
} from "../chunk-
|
|
94
|
+
} from "../chunk-RXHGOLZR.js";
|
|
95
95
|
import "../chunk-TH7L265V.js";
|
|
96
96
|
import "../chunk-LWSJK546.js";
|
|
97
97
|
import "../chunk-P5PIAQVS.js";
|