@cueai/omni-reader-mcp 1.4.0 → 1.5.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 +23 -14
- package/dist/cli/agent-config.js +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/protocol.d.ts +25 -4
- package/dist/protocol.js +25 -2
- package/dist/tools.js +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ differ from the numbers above, report the live values.
|
|
|
64
64
|
Always use an audited exact version, never an implicit `latest`:
|
|
65
65
|
|
|
66
66
|
```sh
|
|
67
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
67
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 setup
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
The interactive setup supports Hermes, Cursor, Claude Desktop, and generic stdio
|
|
@@ -72,9 +72,9 @@ configuration. Non-interactive installation uses the same argument parsing and w
|
|
|
72
72
|
logic:
|
|
73
73
|
|
|
74
74
|
```sh
|
|
75
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
76
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
77
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
75
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 setup --client hermes --allowed-root /absolute/minimum/root --yes --json
|
|
76
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 setup --client cursor --add-root /absolute/minimum/root --yes --json
|
|
77
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 setup --client claude-desktop --allowed-root /absolute/minimum/root --yes --json
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
When an agent or script runs under a pty (stdin is still a TTY), declare non-interactive
|
|
@@ -82,7 +82,7 @@ mode explicitly with `--headless` (alias `--non-interactive`): no `--yes` is req
|
|
|
82
82
|
stdin is never read:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
85
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 setup --client cursor --allowed-root /absolute/minimum/root --headless --json
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
## Cache and journal isolation
|
|
@@ -133,6 +133,7 @@ The public tools are fixed:
|
|
|
133
133
|
- `read_result`
|
|
134
134
|
- `read_outline`
|
|
135
135
|
- `discard_result`
|
|
136
|
+
- `save_result`
|
|
136
137
|
|
|
137
138
|
Every tool returns `structuredContent` with a strict `outputSchema`, plus an equivalent
|
|
138
139
|
fallback for clients that only read legacy MCP `content[].text`:
|
|
@@ -150,7 +151,11 @@ fallback for clients that only read legacy MCP `content[].text`:
|
|
|
150
151
|
advancing sequentially through `next_cursor`. An empty or absent outline is reported
|
|
151
152
|
explicitly, never silently — it never blocks reading the result itself with `read_result`;
|
|
152
153
|
- the `discard_result` text JSON explicitly returns `discarded`; never claim deletion on
|
|
153
|
-
call success alone
|
|
154
|
+
call success alone;
|
|
155
|
+
- the `save_result` text JSON contains the written file `path` and `bytes` count; there is
|
|
156
|
+
no path argument — the file is always named from `result_id` inside the Bridge cache's
|
|
157
|
+
export directory, so it cannot be pointed at an arbitrary location; calling it again for
|
|
158
|
+
the same result overwrites the same file.
|
|
154
159
|
|
|
155
160
|
This gives clients that do not render `structuredContent` the operation/result handles
|
|
156
161
|
and the full body without changing the contract for structured-capable clients.
|
|
@@ -188,7 +193,11 @@ Both URL and local files use mandatory no-store semantics and enter the
|
|
|
188
193
|
**24 hours**; this is a different class of data from the remote 10-minute delivery
|
|
189
194
|
window;
|
|
190
195
|
- `read_result` reads local results in chunks; `discard_result` deletes a specific result
|
|
191
|
-
immediately; `clean` removes Bridge-created local artifacts and expired records
|
|
196
|
+
immediately; `clean` removes Bridge-created local artifacts and expired records;
|
|
197
|
+
- `save_result` writes a result's complete content to a stable file under the Bridge cache's
|
|
198
|
+
export directory and returns its path; exports are independent of the 24-hour cache sweep,
|
|
199
|
+
so discarding the cached artifact or letting retention expire does not remove an export the
|
|
200
|
+
user asked to keep.
|
|
192
201
|
|
|
193
202
|
Status queries, result reads, and discards never create a new parse or usage event.
|
|
194
203
|
`cancel_parse` reports only the real settlement state confirmed by the server and never
|
|
@@ -212,16 +221,16 @@ satisfies the constraints.
|
|
|
212
221
|
## Commands
|
|
213
222
|
|
|
214
223
|
```sh
|
|
215
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
216
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
217
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
218
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
224
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 doctor
|
|
225
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 doctor --json
|
|
226
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 clean
|
|
227
|
+
npx -y @cueai/omni-reader-mcp@1.5.0 uninstall --yes --json
|
|
219
228
|
```
|
|
220
229
|
|
|
221
230
|
Running the pinned version without a command starts the stdio MCP server:
|
|
222
231
|
|
|
223
232
|
```sh
|
|
224
|
-
npx -y @cueai/omni-reader-mcp@1.
|
|
233
|
+
npx -y @cueai/omni-reader-mcp@1.5.0
|
|
225
234
|
```
|
|
226
235
|
|
|
227
236
|
`doctor --json` returns package/npm/client adapter, Key present/absent, allowed-root
|
|
@@ -230,12 +239,12 @@ status; it never prints the Key, private source paths, or content.
|
|
|
230
239
|
|
|
231
240
|
## Uninstall and rollback
|
|
232
241
|
|
|
233
|
-
`uninstall --yes --json` removes only a trusted 1.
|
|
242
|
+
`uninstall --yes --json` removes only a trusted 1.4.1 or 1.5.0 Bridge entry; when a
|
|
234
243
|
matching trusted backup exists, it restores the original URL-only `omni-reader` entry.
|
|
235
244
|
Uninstall never deletes user source files and never silently removes unexpired local
|
|
236
245
|
results.
|
|
237
246
|
|
|
238
|
-
To roll back from 1.
|
|
247
|
+
To roll back from 1.5.0:
|
|
239
248
|
|
|
240
249
|
1. stop recommending or installing that version;
|
|
241
250
|
2. run `uninstall --yes --json` to restore the trusted URL-only entry;
|
package/dist/cli/agent-config.js
CHANGED
|
@@ -7,7 +7,7 @@ const PACKAGE_SPEC = `@cueai/omni-reader-mcp@${BRIDGE_RELEASE_VERSION}`;
|
|
|
7
7
|
// The release that the current version is a trusted upgrade from: uninstall and
|
|
8
8
|
// rollback recognize exactly {previous, current} and nothing else. Bump this to
|
|
9
9
|
// the version we just published when BRIDGE_RELEASE_VERSION advances.
|
|
10
|
-
const PREVIOUS_RELEASE_VERSION = "1.
|
|
10
|
+
const PREVIOUS_RELEASE_VERSION = "1.4.1";
|
|
11
11
|
const PREVIOUS_PACKAGE_SPEC = `@cueai/omni-reader-mcp@${PREVIOUS_RELEASE_VERSION}`;
|
|
12
12
|
const LEGACY_PACKAGE_SPEC = "@cueai/omni-reader-mcp";
|
|
13
13
|
const TRUSTED_EXACT_PACKAGE_SPECS = new Set([PREVIOUS_PACKAGE_SPEC, PACKAGE_SPEC]);
|
package/dist/constants.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const CUBE_GRANT_PROTOCOL_VERSION = "omni.parse_grant.v1";
|
|
|
6
6
|
export declare const GRANTED_STREAM_PROTOCOL_VERSION = "omni.granted_parse_stream.v1";
|
|
7
7
|
export declare const DEFAULT_CUBE_BASE_URL = "https://mcp.cuecue.cn";
|
|
8
8
|
export declare const DEFAULT_IIIS_GRANTED_BASE_URL = "https://cubefile.ai.iiis.co:9443/omni/granted/";
|
|
9
|
-
export declare const BRIDGE_RELEASE_VERSION = "1.
|
|
9
|
+
export declare const BRIDGE_RELEASE_VERSION = "1.5.0";
|
|
10
10
|
export declare const REMOTE_OMNI_MCP_URL = "https://mcp.cuecue.cn/api/omni-reader/mcp/";
|
|
11
11
|
export declare const FOREGROUND_BUDGET_MS = 15000;
|
|
12
12
|
export declare const STATUS_LONG_POLL_MAX_MS = 20000;
|
package/dist/constants.js
CHANGED
|
@@ -6,7 +6,7 @@ export const CUBE_GRANT_PROTOCOL_VERSION = "omni.parse_grant.v1";
|
|
|
6
6
|
export const GRANTED_STREAM_PROTOCOL_VERSION = "omni.granted_parse_stream.v1";
|
|
7
7
|
export const DEFAULT_CUBE_BASE_URL = "https://mcp.cuecue.cn";
|
|
8
8
|
export const DEFAULT_IIIS_GRANTED_BASE_URL = "https://cubefile.ai.iiis.co:9443/omni/granted/";
|
|
9
|
-
export const BRIDGE_RELEASE_VERSION = "1.
|
|
9
|
+
export const BRIDGE_RELEASE_VERSION = "1.5.0";
|
|
10
10
|
export const REMOTE_OMNI_MCP_URL = "https://mcp.cuecue.cn/api/omni-reader/mcp/";
|
|
11
11
|
export const FOREGROUND_BUDGET_MS = 15_000;
|
|
12
12
|
export const STATUS_LONG_POLL_MAX_MS = 20_000;
|
package/dist/protocol.d.ts
CHANGED
|
@@ -11,16 +11,37 @@ export interface RepresentationIntent {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function normalizeRepresentation(detail?: "text" | "grounded" | "layout"): RepresentationIntent;
|
|
13
13
|
export declare const MACHINE_INSTRUCTIONS: string;
|
|
14
|
-
export declare const
|
|
15
|
-
source: z.ZodEffects<z.ZodString, string, string
|
|
14
|
+
export declare const parseSchemaShape: {
|
|
15
|
+
source: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
16
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
17
|
+
detail: z.ZodOptional<z.ZodEnum<["text", "grounded", "layout"]>>;
|
|
18
|
+
};
|
|
19
|
+
export declare const parseSchema: z.ZodEffects<z.ZodObject<{
|
|
20
|
+
source: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
16
22
|
detail: z.ZodOptional<z.ZodEnum<["text", "grounded", "layout"]>>;
|
|
17
23
|
}, "strict", z.ZodTypeAny, {
|
|
18
|
-
source
|
|
24
|
+
source?: string | undefined;
|
|
25
|
+
url?: string | undefined;
|
|
19
26
|
detail?: "grounded" | "layout" | "text" | undefined;
|
|
20
27
|
}, {
|
|
21
|
-
source
|
|
28
|
+
source?: string | undefined;
|
|
29
|
+
url?: string | undefined;
|
|
30
|
+
detail?: "grounded" | "layout" | "text" | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
source?: string | undefined;
|
|
33
|
+
url?: string | undefined;
|
|
34
|
+
detail?: "grounded" | "layout" | "text" | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
source?: string | undefined;
|
|
37
|
+
url?: string | undefined;
|
|
22
38
|
detail?: "grounded" | "layout" | "text" | undefined;
|
|
23
39
|
}>;
|
|
40
|
+
export interface NormalizedParseArguments {
|
|
41
|
+
readonly source: string;
|
|
42
|
+
readonly detail?: "text" | "grounded" | "layout";
|
|
43
|
+
}
|
|
44
|
+
export declare function normalizeParseArguments(args: ParseArguments): NormalizedParseArguments;
|
|
24
45
|
export declare const getParseStatusSchema: z.ZodObject<{
|
|
25
46
|
operation_id: z.ZodString;
|
|
26
47
|
wait_ms: z.ZodOptional<z.ZodNumber>;
|
package/dist/protocol.js
CHANGED
|
@@ -40,16 +40,39 @@ export const MACHINE_INSTRUCTIONS = [
|
|
|
40
40
|
].join("\n");
|
|
41
41
|
const operationIdSchema = z.string().regex(/^op_[A-Za-z0-9_-]{16,64}$/u);
|
|
42
42
|
const resultIdSchema = z.string().regex(/^result_[A-Za-z0-9_-]{16,64}$/u);
|
|
43
|
-
|
|
43
|
+
// I1 parameter unification: the remote omni-reader MCP surface accepts the
|
|
44
|
+
// legacy `url` alias (plus `output`/`wait`), and agents hold that schema. The
|
|
45
|
+
// Bridge accepts exactly one of `source` or `url` with identical constraints,
|
|
46
|
+
// so either surface's parse call passes validation here; `url` is normalized
|
|
47
|
+
// to `source` before any handler runs (see normalizeParseArguments).
|
|
48
|
+
const parseSchemaObject = z
|
|
44
49
|
.object({
|
|
45
50
|
source: z
|
|
46
51
|
.string()
|
|
47
52
|
.min(1)
|
|
48
53
|
.max(8192)
|
|
49
|
-
.refine((value) => !value.includes("\0"))
|
|
54
|
+
.refine((value) => !value.includes("\0"))
|
|
55
|
+
.optional(),
|
|
56
|
+
url: z
|
|
57
|
+
.string()
|
|
58
|
+
.min(1)
|
|
59
|
+
.max(8192)
|
|
60
|
+
.refine((value) => !value.includes("\0"))
|
|
61
|
+
.optional(),
|
|
50
62
|
detail: z.enum(["text", "grounded", "layout"]).optional(),
|
|
51
63
|
})
|
|
52
64
|
.strict();
|
|
65
|
+
export const parseSchemaShape = parseSchemaObject.shape;
|
|
66
|
+
export const parseSchema = parseSchemaObject.refine((value) => (value.source === undefined) !== (value.url === undefined), { message: "provide exactly one of source or url" });
|
|
67
|
+
export function normalizeParseArguments(args) {
|
|
68
|
+
const source = args.source ?? args.url;
|
|
69
|
+
if (source === undefined) {
|
|
70
|
+
// The schema refine enforces exactly-one; this branch is unreachable for
|
|
71
|
+
// schema-validated input and guards misuse of the exported helper.
|
|
72
|
+
throw new Error("parse arguments require exactly one of source or url");
|
|
73
|
+
}
|
|
74
|
+
return { source, detail: args.detail };
|
|
75
|
+
}
|
|
53
76
|
export const getParseStatusSchema = z
|
|
54
77
|
.object({
|
|
55
78
|
operation_id: operationIdSchema,
|
package/dist/tools.js
CHANGED
|
@@ -6,7 +6,7 @@ import { OmniBridgeError } 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";
|
|
9
|
-
import { MACHINE_INSTRUCTIONS, cancelParseSchema, discardResultSchema, getParseStatusSchema, normalizeRepresentation, parseSchema, readOutlineSchema, readResultSchema, saveResultSchema, } from "./protocol.js";
|
|
9
|
+
import { MACHINE_INSTRUCTIONS, cancelParseSchema, discardResultSchema, getParseStatusSchema, normalizeParseArguments, normalizeRepresentation, parseSchema, parseSchemaShape, readOutlineSchema, readResultSchema, saveResultSchema, } from "./protocol.js";
|
|
10
10
|
import { discardResultOutputSchema, discardResultToolOutputSchema, localResultToResultField, parseResultSchema, parseToolOutputSchema, readOutlineOutputSchema, readOutlineToolOutputSchema, readResultOutputSchema, readResultToolOutputSchema, saveResultOutputSchema, saveResultToolOutputSchema, structuredResult, } from "./result-contract.js";
|
|
11
11
|
import { classifySource } from "./source.js";
|
|
12
12
|
import { TaskRuntime } from "./task-runtime.js";
|
|
@@ -412,7 +412,7 @@ async function dispatchTool(name, rawArguments, extra, dependencies) {
|
|
|
412
412
|
if (name === "parse") {
|
|
413
413
|
const parsed = parseSchema.safeParse(rawArguments ?? {});
|
|
414
414
|
return parsed.success
|
|
415
|
-
? callParse(parsed.data, extra, dependencies)
|
|
415
|
+
? callParse(normalizeParseArguments(parsed.data), extra, dependencies)
|
|
416
416
|
: invalidArgumentsResult(name);
|
|
417
417
|
}
|
|
418
418
|
if (name === "get_parse_status") {
|
|
@@ -460,16 +460,17 @@ export function registerOmniTools(server, dependencies, taskStore) {
|
|
|
460
460
|
cancel: (operationId, signal) => cancelValue(operationId, signal, dependencies),
|
|
461
461
|
});
|
|
462
462
|
const createParseTask = async (args, extra) => {
|
|
463
|
+
const normalized = normalizeParseArguments(args);
|
|
463
464
|
const requestedTtl = extra.taskRequestedTtl ?? 600_000;
|
|
464
465
|
const task = await extra.taskStore.createTask({
|
|
465
466
|
ttl: Math.min(600_000, Math.max(1_000, requestedTtl)),
|
|
466
467
|
pollInterval: 1_000,
|
|
467
468
|
});
|
|
468
|
-
void taskRuntime.start(task.taskId,
|
|
469
|
+
void taskRuntime.start(task.taskId, normalized.source, extra.taskStore)
|
|
469
470
|
.catch(() => undefined);
|
|
470
471
|
return { task };
|
|
471
472
|
};
|
|
472
|
-
const parseInputShape =
|
|
473
|
+
const parseInputShape = parseSchemaShape;
|
|
473
474
|
const parseTaskHandler = {
|
|
474
475
|
createTask: createParseTask,
|
|
475
476
|
getTask: async (_args, extra) => extra.taskStore.getTask(extra.taskId),
|
|
@@ -510,7 +511,7 @@ export function registerOmniTools(server, dependencies, taskStore) {
|
|
|
510
511
|
},
|
|
511
512
|
}, (args, extra) => callCancel(args.operation_id, extra, dependencies));
|
|
512
513
|
server.registerTool("read_result", {
|
|
513
|
-
description: "Read one UTF-8 chunk from a Bridge-created local result artifact. Pass each returned next_cursor as cursor in the next call until it is absent.",
|
|
514
|
+
description: "Read one UTF-8 chunk from a Bridge-created local result artifact. Pass each returned next_cursor as cursor in the next call until it is absent. Bridge-local artifact capability: the remote omni-reader MCP surface does not expose this tool.",
|
|
514
515
|
inputSchema: readResultSchema,
|
|
515
516
|
outputSchema: readResultToolOutputSchema,
|
|
516
517
|
annotations: {
|
|
@@ -521,7 +522,7 @@ export function registerOmniTools(server, dependencies, taskStore) {
|
|
|
521
522
|
},
|
|
522
523
|
}, (args) => callReadResult(args.result_id, args.cursor, args.max_bytes, dependencies));
|
|
523
524
|
server.registerTool("discard_result", {
|
|
524
|
-
description: "Immediately delete one Bridge-created local result artifact.",
|
|
525
|
+
description: "Immediately delete one Bridge-created local result artifact. Bridge-local artifact capability: the remote omni-reader MCP surface does not expose this tool.",
|
|
525
526
|
inputSchema: discardResultSchema,
|
|
526
527
|
outputSchema: discardResultToolOutputSchema,
|
|
527
528
|
annotations: {
|
|
@@ -532,7 +533,7 @@ export function registerOmniTools(server, dependencies, taskStore) {
|
|
|
532
533
|
},
|
|
533
534
|
}, (args) => callDiscardResult(args.result_id, dependencies));
|
|
534
535
|
server.registerTool("read_outline", {
|
|
535
|
-
description: "Return a local result's heading outline. Pass node_id from a returned node's id to mint a read_result-compatible cursor that jumps straight to that section, instead of reading sequentially from the start.",
|
|
536
|
+
description: "Return a local result's heading outline. Pass node_id from a returned node's id to mint a read_result-compatible cursor that jumps straight to that section, instead of reading sequentially from the start. Bridge-local artifact capability: the remote omni-reader MCP surface does not expose this tool.",
|
|
536
537
|
inputSchema: readOutlineSchema,
|
|
537
538
|
outputSchema: readOutlineToolOutputSchema,
|
|
538
539
|
annotations: {
|
|
@@ -543,7 +544,7 @@ export function registerOmniTools(server, dependencies, taskStore) {
|
|
|
543
544
|
},
|
|
544
545
|
}, (args) => callReadOutline(args.result_id, args.node_id, dependencies));
|
|
545
546
|
server.registerTool("save_result", {
|
|
546
|
-
description: "Write a local result's complete content to a stable file on disk and return its path. There is no path argument: the file is always named from result_id inside the Bridge cache directory, so this cannot be pointed at an arbitrary location. Calling it again for the same result overwrites the same file.",
|
|
547
|
+
description: "Write a local result's complete content to a stable file on disk and return its path. There is no path argument: the file is always named from result_id inside the Bridge cache directory, so this cannot be pointed at an arbitrary location. Calling it again for the same result overwrites the same file. Bridge-local artifact capability: the remote omni-reader MCP surface does not expose this tool.",
|
|
547
548
|
inputSchema: saveResultSchema,
|
|
548
549
|
outputSchema: saveResultToolOutputSchema,
|
|
549
550
|
annotations: {
|