@cueai/omni-reader-mcp 1.4.1 → 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 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.4.1 setup
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.4.1 setup --client hermes --allowed-root /absolute/minimum/root --yes --json
76
- npx -y @cueai/omni-reader-mcp@1.4.1 setup --client cursor --add-root /absolute/minimum/root --yes --json
77
- npx -y @cueai/omni-reader-mcp@1.4.1 setup --client claude-desktop --allowed-root /absolute/minimum/root --yes --json
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.4.1 setup --client cursor --allowed-root /absolute/minimum/root --headless --json
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
@@ -221,16 +221,16 @@ satisfies the constraints.
221
221
  ## Commands
222
222
 
223
223
  ```sh
224
- npx -y @cueai/omni-reader-mcp@1.4.1 doctor
225
- npx -y @cueai/omni-reader-mcp@1.4.1 doctor --json
226
- npx -y @cueai/omni-reader-mcp@1.4.1 clean
227
- npx -y @cueai/omni-reader-mcp@1.4.1 uninstall --yes --json
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
228
228
  ```
229
229
 
230
230
  Running the pinned version without a command starts the stdio MCP server:
231
231
 
232
232
  ```sh
233
- npx -y @cueai/omni-reader-mcp@1.4.1
233
+ npx -y @cueai/omni-reader-mcp@1.5.0
234
234
  ```
235
235
 
236
236
  `doctor --json` returns package/npm/client adapter, Key present/absent, allowed-root
@@ -239,12 +239,12 @@ status; it never prints the Key, private source paths, or content.
239
239
 
240
240
  ## Uninstall and rollback
241
241
 
242
- `uninstall --yes --json` removes only a trusted 1.4.0 or 1.4.1 Bridge entry; when a
242
+ `uninstall --yes --json` removes only a trusted 1.4.1 or 1.5.0 Bridge entry; when a
243
243
  matching trusted backup exists, it restores the original URL-only `omni-reader` entry.
244
244
  Uninstall never deletes user source files and never silently removes unexpired local
245
245
  results.
246
246
 
247
- To roll back from 1.4.1:
247
+ To roll back from 1.5.0:
248
248
 
249
249
  1. stop recommending or installing that version;
250
250
  2. run `uninstall --yes --json` to restore the trusted URL-only entry;
@@ -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.4.0";
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]);
@@ -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.4.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.4.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;
@@ -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 parseSchema: z.ZodObject<{
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: string;
24
+ source?: string | undefined;
25
+ url?: string | undefined;
19
26
  detail?: "grounded" | "layout" | "text" | undefined;
20
27
  }, {
21
- source: string;
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
- export const parseSchema = z
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, args.source, extra.taskStore)
469
+ void taskRuntime.start(task.taskId, normalized.source, extra.taskStore)
469
470
  .catch(() => undefined);
470
471
  return { task };
471
472
  };
472
- const parseInputShape = parseSchema.shape;
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cueai/omni-reader-mcp",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "Local stdio MCP bridge for direct Omni document parsing",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",