@cueai/omni-reader-mcp 1.6.0 → 1.7.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/README.md +61 -34
- package/dist/capabilities.d.ts +129 -2
- package/dist/capabilities.js +122 -19
- package/dist/cli/agent-config.js +2 -2
- package/dist/constants.d.ts +5 -1
- package/dist/constants.js +7 -3
- package/dist/cube-client.d.ts +4 -1
- package/dist/cube-client.js +286 -32
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +15 -0
- package/dist/iiis-client.d.ts +33 -2
- package/dist/iiis-client.js +368 -40
- package/dist/operation-journal.d.ts +13 -0
- package/dist/operation-journal.js +188 -13
- package/dist/operation-manager.d.ts +1 -1
- package/dist/operation-manager.js +203 -27
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.js +6 -2
- package/dist/remote-client.js +3 -13
- package/dist/result-contract.d.ts +30 -26
- package/dist/result-contract.js +3 -2
- package/dist/tools.js +4 -15
- package/package.json +1 -1
|
@@ -80,6 +80,10 @@ export type ParseResult = {
|
|
|
80
80
|
preview: string;
|
|
81
81
|
next_cursor: string;
|
|
82
82
|
};
|
|
83
|
+
billing?: {
|
|
84
|
+
credits_charged: number;
|
|
85
|
+
credits_remaining: number;
|
|
86
|
+
};
|
|
83
87
|
cleanup_deadline: string;
|
|
84
88
|
data_handling: DataHandling;
|
|
85
89
|
local_result_cache?: LocalResultCache;
|
|
@@ -146,9 +150,9 @@ export declare const stableErrorSchema: z.ZodObject<{
|
|
|
146
150
|
message: string;
|
|
147
151
|
billed: boolean;
|
|
148
152
|
retryable: boolean;
|
|
153
|
+
parser_started: boolean;
|
|
149
154
|
file_uploaded: boolean;
|
|
150
155
|
content_released: boolean;
|
|
151
|
-
parser_started: boolean;
|
|
152
156
|
ok: false;
|
|
153
157
|
operation_created: boolean;
|
|
154
158
|
failure_scope?: "source" | "local_capability" | "authentication" | "billing" | "service" | "parser" | "operation" | "cleanup" | "bridge" | undefined;
|
|
@@ -165,9 +169,9 @@ export declare const stableErrorSchema: z.ZodObject<{
|
|
|
165
169
|
message: string;
|
|
166
170
|
billed: boolean;
|
|
167
171
|
retryable: boolean;
|
|
172
|
+
parser_started: boolean;
|
|
168
173
|
file_uploaded: boolean;
|
|
169
174
|
content_released: boolean;
|
|
170
|
-
parser_started: boolean;
|
|
171
175
|
ok: false;
|
|
172
176
|
operation_created: boolean;
|
|
173
177
|
failure_scope?: "source" | "local_capability" | "authentication" | "billing" | "service" | "parser" | "operation" | "cleanup" | "bridge" | undefined;
|
|
@@ -269,8 +273,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
269
273
|
}, "strict", z.ZodTypeAny, {
|
|
270
274
|
part: "content";
|
|
271
275
|
result_bytes: number;
|
|
272
|
-
media_type: "text/markdown; charset=utf-8";
|
|
273
276
|
digest: string;
|
|
277
|
+
media_type: "text/markdown; charset=utf-8";
|
|
274
278
|
storage: {
|
|
275
279
|
text: string;
|
|
276
280
|
kind: "inline";
|
|
@@ -282,8 +286,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
282
286
|
}, {
|
|
283
287
|
part: "content";
|
|
284
288
|
result_bytes: number;
|
|
285
|
-
media_type: "text/markdown; charset=utf-8";
|
|
286
289
|
digest: string;
|
|
290
|
+
media_type: "text/markdown; charset=utf-8";
|
|
287
291
|
storage: {
|
|
288
292
|
text: string;
|
|
289
293
|
kind: "inline";
|
|
@@ -320,8 +324,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
320
324
|
}, "strict", z.ZodTypeAny, {
|
|
321
325
|
part: "grounding";
|
|
322
326
|
result_bytes: number;
|
|
323
|
-
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
324
327
|
digest: string;
|
|
328
|
+
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
325
329
|
storage: {
|
|
326
330
|
kind: "inline";
|
|
327
331
|
value?: unknown;
|
|
@@ -332,8 +336,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
332
336
|
}, {
|
|
333
337
|
part: "grounding";
|
|
334
338
|
result_bytes: number;
|
|
335
|
-
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
336
339
|
digest: string;
|
|
340
|
+
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
337
341
|
storage: {
|
|
338
342
|
kind: "inline";
|
|
339
343
|
value?: unknown;
|
|
@@ -346,8 +350,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
346
350
|
content: {
|
|
347
351
|
part: "content";
|
|
348
352
|
result_bytes: number;
|
|
349
|
-
media_type: "text/markdown; charset=utf-8";
|
|
350
353
|
digest: string;
|
|
354
|
+
media_type: "text/markdown; charset=utf-8";
|
|
351
355
|
storage: {
|
|
352
356
|
text: string;
|
|
353
357
|
kind: "inline";
|
|
@@ -360,8 +364,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
360
364
|
grounding: {
|
|
361
365
|
part: "grounding";
|
|
362
366
|
result_bytes: number;
|
|
363
|
-
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
364
367
|
digest: string;
|
|
368
|
+
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
365
369
|
storage: {
|
|
366
370
|
kind: "inline";
|
|
367
371
|
value?: unknown;
|
|
@@ -374,8 +378,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
374
378
|
content: {
|
|
375
379
|
part: "content";
|
|
376
380
|
result_bytes: number;
|
|
377
|
-
media_type: "text/markdown; charset=utf-8";
|
|
378
381
|
digest: string;
|
|
382
|
+
media_type: "text/markdown; charset=utf-8";
|
|
379
383
|
storage: {
|
|
380
384
|
text: string;
|
|
381
385
|
kind: "inline";
|
|
@@ -388,8 +392,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
388
392
|
grounding: {
|
|
389
393
|
part: "grounding";
|
|
390
394
|
result_bytes: number;
|
|
391
|
-
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
392
395
|
digest: string;
|
|
396
|
+
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
393
397
|
storage: {
|
|
394
398
|
kind: "inline";
|
|
395
399
|
value?: unknown;
|
|
@@ -411,8 +415,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
411
415
|
content: {
|
|
412
416
|
part: "content";
|
|
413
417
|
result_bytes: number;
|
|
414
|
-
media_type: "text/markdown; charset=utf-8";
|
|
415
418
|
digest: string;
|
|
419
|
+
media_type: "text/markdown; charset=utf-8";
|
|
416
420
|
storage: {
|
|
417
421
|
text: string;
|
|
418
422
|
kind: "inline";
|
|
@@ -425,8 +429,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
425
429
|
grounding: {
|
|
426
430
|
part: "grounding";
|
|
427
431
|
result_bytes: number;
|
|
428
|
-
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
429
432
|
digest: string;
|
|
433
|
+
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
430
434
|
storage: {
|
|
431
435
|
kind: "inline";
|
|
432
436
|
value?: unknown;
|
|
@@ -448,8 +452,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
448
452
|
content: {
|
|
449
453
|
part: "content";
|
|
450
454
|
result_bytes: number;
|
|
451
|
-
media_type: "text/markdown; charset=utf-8";
|
|
452
455
|
digest: string;
|
|
456
|
+
media_type: "text/markdown; charset=utf-8";
|
|
453
457
|
storage: {
|
|
454
458
|
text: string;
|
|
455
459
|
kind: "inline";
|
|
@@ -462,8 +466,8 @@ export declare const bundleDescriptorSchema: z.ZodObject<{
|
|
|
462
466
|
grounding: {
|
|
463
467
|
part: "grounding";
|
|
464
468
|
result_bytes: number;
|
|
465
|
-
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
466
469
|
digest: string;
|
|
470
|
+
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
467
471
|
storage: {
|
|
468
472
|
kind: "inline";
|
|
469
473
|
value?: unknown;
|
|
@@ -512,9 +516,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
512
516
|
offset: number;
|
|
513
517
|
part: "content";
|
|
514
518
|
expires_at: string;
|
|
519
|
+
decoded_bytes: number;
|
|
515
520
|
result_bytes: number;
|
|
516
521
|
media_type: "text/markdown; charset=utf-8";
|
|
517
|
-
decoded_bytes: number;
|
|
518
522
|
next_cursor?: string | undefined;
|
|
519
523
|
}, {
|
|
520
524
|
text: string;
|
|
@@ -522,9 +526,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
522
526
|
offset: number;
|
|
523
527
|
part: "content";
|
|
524
528
|
expires_at: string;
|
|
529
|
+
decoded_bytes: number;
|
|
525
530
|
result_bytes: number;
|
|
526
531
|
media_type: "text/markdown; charset=utf-8";
|
|
527
|
-
decoded_bytes: number;
|
|
528
532
|
next_cursor?: string | undefined;
|
|
529
533
|
}>, z.ZodObject<{
|
|
530
534
|
part: z.ZodLiteral<"grounding">;
|
|
@@ -542,9 +546,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
542
546
|
offset: number;
|
|
543
547
|
part: "grounding";
|
|
544
548
|
expires_at: string;
|
|
549
|
+
decoded_bytes: number;
|
|
545
550
|
result_bytes: number;
|
|
546
551
|
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
547
|
-
decoded_bytes: number;
|
|
548
552
|
next_cursor?: string | undefined;
|
|
549
553
|
}, {
|
|
550
554
|
text: string;
|
|
@@ -552,9 +556,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
552
556
|
offset: number;
|
|
553
557
|
part: "grounding";
|
|
554
558
|
expires_at: string;
|
|
559
|
+
decoded_bytes: number;
|
|
555
560
|
result_bytes: number;
|
|
556
561
|
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
557
|
-
decoded_bytes: number;
|
|
558
562
|
next_cursor?: string | undefined;
|
|
559
563
|
}>]>, {
|
|
560
564
|
text: string;
|
|
@@ -562,9 +566,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
562
566
|
offset: number;
|
|
563
567
|
part: "content";
|
|
564
568
|
expires_at: string;
|
|
569
|
+
decoded_bytes: number;
|
|
565
570
|
result_bytes: number;
|
|
566
571
|
media_type: "text/markdown; charset=utf-8";
|
|
567
|
-
decoded_bytes: number;
|
|
568
572
|
next_cursor?: string | undefined;
|
|
569
573
|
} | {
|
|
570
574
|
text: string;
|
|
@@ -572,9 +576,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
572
576
|
offset: number;
|
|
573
577
|
part: "grounding";
|
|
574
578
|
expires_at: string;
|
|
579
|
+
decoded_bytes: number;
|
|
575
580
|
result_bytes: number;
|
|
576
581
|
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
577
|
-
decoded_bytes: number;
|
|
578
582
|
next_cursor?: string | undefined;
|
|
579
583
|
}, {
|
|
580
584
|
text: string;
|
|
@@ -582,9 +586,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
582
586
|
offset: number;
|
|
583
587
|
part: "content";
|
|
584
588
|
expires_at: string;
|
|
589
|
+
decoded_bytes: number;
|
|
585
590
|
result_bytes: number;
|
|
586
591
|
media_type: "text/markdown; charset=utf-8";
|
|
587
|
-
decoded_bytes: number;
|
|
588
592
|
next_cursor?: string | undefined;
|
|
589
593
|
} | {
|
|
590
594
|
text: string;
|
|
@@ -592,9 +596,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
592
596
|
offset: number;
|
|
593
597
|
part: "grounding";
|
|
594
598
|
expires_at: string;
|
|
599
|
+
decoded_bytes: number;
|
|
595
600
|
result_bytes: number;
|
|
596
601
|
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
597
|
-
decoded_bytes: number;
|
|
598
602
|
next_cursor?: string | undefined;
|
|
599
603
|
}>;
|
|
600
604
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -605,9 +609,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
605
609
|
offset: number;
|
|
606
610
|
part: "content";
|
|
607
611
|
expires_at: string;
|
|
612
|
+
decoded_bytes: number;
|
|
608
613
|
result_bytes: number;
|
|
609
614
|
media_type: "text/markdown; charset=utf-8";
|
|
610
|
-
decoded_bytes: number;
|
|
611
615
|
next_cursor?: string | undefined;
|
|
612
616
|
} | {
|
|
613
617
|
text: string;
|
|
@@ -615,9 +619,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
615
619
|
offset: number;
|
|
616
620
|
part: "grounding";
|
|
617
621
|
expires_at: string;
|
|
622
|
+
decoded_bytes: number;
|
|
618
623
|
result_bytes: number;
|
|
619
624
|
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
620
|
-
decoded_bytes: number;
|
|
621
625
|
next_cursor?: string | undefined;
|
|
622
626
|
};
|
|
623
627
|
}, {
|
|
@@ -628,9 +632,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
628
632
|
offset: number;
|
|
629
633
|
part: "content";
|
|
630
634
|
expires_at: string;
|
|
635
|
+
decoded_bytes: number;
|
|
631
636
|
result_bytes: number;
|
|
632
637
|
media_type: "text/markdown; charset=utf-8";
|
|
633
|
-
decoded_bytes: number;
|
|
634
638
|
next_cursor?: string | undefined;
|
|
635
639
|
} | {
|
|
636
640
|
text: string;
|
|
@@ -638,9 +642,9 @@ export declare const bundlePartReadSchema: z.ZodObject<{
|
|
|
638
642
|
offset: number;
|
|
639
643
|
part: "grounding";
|
|
640
644
|
expires_at: string;
|
|
645
|
+
decoded_bytes: number;
|
|
641
646
|
result_bytes: number;
|
|
642
647
|
media_type: "application/vnd.cue.omni-grounding+json; version=1";
|
|
643
|
-
decoded_bytes: number;
|
|
644
648
|
next_cursor?: string | undefined;
|
|
645
649
|
};
|
|
646
650
|
}>;
|
package/dist/result-contract.js
CHANGED
|
@@ -135,8 +135,8 @@ const artifactResultSchema = z
|
|
|
135
135
|
.strict();
|
|
136
136
|
const billingSchema = z
|
|
137
137
|
.object({
|
|
138
|
-
credits_charged: z.number().nonnegative(),
|
|
139
|
-
credits_remaining: z.number().nonnegative(),
|
|
138
|
+
credits_charged: z.number().finite().nonnegative(),
|
|
139
|
+
credits_remaining: z.number().finite().nonnegative(),
|
|
140
140
|
})
|
|
141
141
|
.strict();
|
|
142
142
|
// v3 bundle descriptor (D2-D item 7): closed keyed-parts object. Top-level and
|
|
@@ -282,6 +282,7 @@ const parseResultDiscriminatedSchema = z.discriminatedUnion("status", [
|
|
|
282
282
|
artifactResultSchema,
|
|
283
283
|
bundleDescriptorSchema,
|
|
284
284
|
]).optional(),
|
|
285
|
+
billing: billingSchema.optional(),
|
|
285
286
|
cleanup_deadline: z.string().datetime({ offset: true }),
|
|
286
287
|
data_handling: dataHandlingSchema,
|
|
287
288
|
local_result_cache: localResultCacheSchema.optional(),
|
package/dist/tools.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { CallToolRequestSchema, CancelTaskRequestSchema, ErrorCode, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
3
3
|
import { selectDirectProfile, selectUrlProfile, } from "./capabilities.js";
|
|
4
4
|
import { createClientRequestId as newClientRequestId, } from "./cube-client.js";
|
|
5
|
-
import { OmniBridgeError } from "./errors.js";
|
|
5
|
+
import { OmniBridgeError, unsupportedDetailError } from "./errors.js";
|
|
6
6
|
import { hydrateInlineUrlResultSafely } from "./operation-manager.js";
|
|
7
7
|
import { openAllowedFile, } from "./path-security.js";
|
|
8
8
|
import { NOOP_PROGRESS } from "./progress.js";
|
|
@@ -129,28 +129,17 @@ async function parseLocal(args, clientRequestId, signal, progress, dependencies)
|
|
|
129
129
|
async function preflightNonTextRepresentation(detail, sourceKind, signal, dependencies) {
|
|
130
130
|
if (sourceKind === "local") {
|
|
131
131
|
const capabilities = await dependencies.cubeClient.getCapabilities(signal);
|
|
132
|
-
selectDirectProfile(capabilities, detail);
|
|
132
|
+
selectDirectProfile(capabilities, detail, "local");
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
if (dependencies.remoteClient === undefined) {
|
|
136
136
|
throw bridgeError("REMOTE_PARSE_UNAVAILABLE", "Remote URL parsing is not available in this Bridge build.", { retryable: true });
|
|
137
137
|
}
|
|
138
138
|
const capabilities = await dependencies.remoteClient.initializeCapabilities(signal);
|
|
139
|
-
selectUrlProfile(capabilities, detail);
|
|
139
|
+
selectUrlProfile(capabilities, detail, "url");
|
|
140
140
|
}
|
|
141
141
|
if (dependencies.operationManager === undefined) {
|
|
142
|
-
throw
|
|
143
|
-
code: "UNSUPPORTED_DETAIL",
|
|
144
|
-
message: "This Bridge build cannot deliver the requested output detail.",
|
|
145
|
-
failureScope: "bridge",
|
|
146
|
-
userAction: "Use plain Markdown output for this source.",
|
|
147
|
-
operationCreated: false,
|
|
148
|
-
fileUploaded: false,
|
|
149
|
-
parserStarted: false,
|
|
150
|
-
billed: false,
|
|
151
|
-
contentReleased: false,
|
|
152
|
-
retryable: false,
|
|
153
|
-
});
|
|
142
|
+
throw unsupportedDetailError(sourceKind);
|
|
154
143
|
}
|
|
155
144
|
}
|
|
156
145
|
async function preflightArtifactDelivery(args, dependencies) {
|