readlint.com 0.4.0 → 0.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
@@ -1,35 +1,17 @@
1
1
  # readlint.com
2
2
 
3
- TypeScript SDK, CLI and stdio MCP server for Node.js 22 and later.
3
+ TypeScript SDK, CLI and local MCP server for readlint.com. Requires Node.js 22+.
4
4
 
5
5
  ```sh
6
- npx readlint.com check article.md --json
7
- npx readlint.com mcp
6
+ npm install readlint.com
7
+ npx readlint.com login
8
+ npx readlint.com list --limit 25 --offset 0 --json
8
9
  ```
9
10
 
10
- After the first npm publication, install with `npm install readlint.com`.
11
- Until then, run the CLI with `npx --yes --package=<archive-URL> readlint`
12
- or install the public archive below. Python users can use `uvx readlint`
13
- after PyPI publication, or the versioned wheel in the CLI guide.
14
-
15
- ```sh
16
- npm install https://github.com/writeitai/readlint-clients/releases/download/v0.3.0/readlint.com-0.3.0.tgz
17
- ```
18
-
19
- ```ts
20
- import { Readlint } from "readlint.com";
21
-
22
- const client = new Readlint(); // Set READLINT_API_KEY on your server.
23
- const result = await client.evaluate("# Article\n\nUseful text.", {
24
- idempotencyKey: "article-v1", // Retain this key and identical input for retries.
25
- });
26
- console.log(result.id, result.report);
27
- ```
28
-
29
- See the [SDK guide](https://github.com/writeitai/readlint-clients/blob/main/docs/typescript.md)
30
- for authentication, pagination, errors, retries and device login, and the
31
- [development guide](https://github.com/writeitai/readlint-clients/blob/main/docs/development.md)
32
- for source builds and contract checks.
11
+ Follow the maintained [TypeScript SDK](https://readlint.com/docs/typescript),
12
+ [CLI](https://readlint.com/docs/cli) and [MCP](https://readlint.com/docs/mcp)
13
+ guides for authentication, examples, expected results and recovery.
14
+ Python users can install `readlint` from PyPI or use `uvx readlint`.
33
15
 
34
16
  Licensed under Apache-2.0. Transport adapted from `writeitai/mountable`
35
17
  `d936589b1e200e347f03dfc32609c5d368668ae2`.
package/dist/cli.js CHANGED
@@ -14,6 +14,7 @@ Commands:
14
14
  check FILE, evaluate FILE Submit Markdown/MDX (- reads stdin)
15
15
  list List evaluations (--limit N --offset N)
16
16
  get UUID, delete UUID Read or delete an evaluation
17
+ agent-permissions get Read the owner’s agent billing policy
17
18
  login, logout Approve device login or remove local credentials
18
19
  mcp Serve four MCP tools over stdio
19
20
  version Print the installed version
@@ -49,10 +50,12 @@ export async function main(argv = process.argv.slice(2)) {
49
50
  return 0;
50
51
  }
51
52
  const [command, argument] = positionals;
52
- const takesArgument = ["check", "evaluate", "get", "delete"].includes(command);
53
- if (!command || !["check", "evaluate", "list", "get", "delete", "login", "logout", "version", "mcp"].includes(command) ||
53
+ const takesArgument = ["check", "evaluate", "get", "delete", "agent-permissions"].includes(command);
54
+ if (!command || !["check", "evaluate", "list", "get", "delete", "login", "logout", "version", "mcp", "agent-permissions"].includes(command) ||
54
55
  positionals.length !== (takesArgument ? 2 : 1))
55
56
  throw new TypeError();
57
+ if (command === "agent-permissions" && argument !== "get")
58
+ throw new TypeError();
56
59
  for (const flag of ["title", "description", "idempotency-key", "limit", "offset"]) {
57
60
  if (values[flag] !== undefined && !(["check", "evaluate"].includes(command) ? ["title", "description", "idempotency-key"] : command === "list" ? ["limit", "offset"] : []).includes(flag))
58
61
  throw new TypeError();
@@ -93,6 +96,8 @@ export async function main(argv = process.argv.slice(2)) {
93
96
  throw new TypeError();
94
97
  result = await client.listEvaluations({ limit: values.limit === undefined ? undefined : Number(values.limit), offset: values.offset === undefined ? 0 : Number(values.offset) });
95
98
  }
99
+ else if (command === "agent-permissions")
100
+ result = await client.getAgentPermissions();
96
101
  else if (command === "get")
97
102
  result = await client.getEvaluation(argument);
98
103
  else {
@@ -1 +1 @@
1
- export type { BodyCreateDeviceCode, BodyCreateDeviceToken, CheckResult, ClientOptions, CreateDeviceCodeData, CreateDeviceCodeError, CreateDeviceCodeErrors, CreateDeviceCodeResponse, CreateDeviceCodeResponses, CreateDeviceTokenData, CreateDeviceTokenError, CreateDeviceTokenErrors, CreateDeviceTokenResponse, CreateDeviceTokenResponses, CreateEvaluationV1EvaluationsPostData, CreateEvaluationV1EvaluationsPostError, CreateEvaluationV1EvaluationsPostErrors, CreateEvaluationV1EvaluationsPostResponse, CreateEvaluationV1EvaluationsPostResponses, DeviceCodeResponse, DeviceTokenResponse, ErrorDetail, ErrorResponse, EvaluationPage, EvaluationReport, EvaluationRequest, EvaluationResult, EvaluationSummary, GetEvaluationV1EvaluationsEvaluationIdGetData, GetEvaluationV1EvaluationsEvaluationIdGetError, GetEvaluationV1EvaluationsEvaluationIdGetErrors, GetEvaluationV1EvaluationsEvaluationIdGetResponse, GetEvaluationV1EvaluationsEvaluationIdGetResponses, HttpValidationError, InvalidField, ListEvaluationsV1EvaluationsGetData, ListEvaluationsV1EvaluationsGetError, ListEvaluationsV1EvaluationsGetErrors, ListEvaluationsV1EvaluationsGetResponse, ListEvaluationsV1EvaluationsGetResponses, OAuthError, PhraseResult, ProseResult, RemoveEvaluationV1EvaluationsEvaluationIdDeleteData, RemoveEvaluationV1EvaluationsEvaluationIdDeleteError, RemoveEvaluationV1EvaluationsEvaluationIdDeleteErrors, RemoveEvaluationV1EvaluationsEvaluationIdDeleteResponse, RemoveEvaluationV1EvaluationsEvaluationIdDeleteResponses, ValidationDetail, ValidationError, ValidationResponse } from './types.gen.js';
1
+ export type { AgentPermissions, BodyCreateDeviceCode, BodyCreateDeviceToken, CheckResult, ClientOptions, CreateDeviceCodeData, CreateDeviceCodeError, CreateDeviceCodeErrors, CreateDeviceCodeResponse, CreateDeviceCodeResponses, CreateDeviceTokenData, CreateDeviceTokenError, CreateDeviceTokenErrors, CreateDeviceTokenResponse, CreateDeviceTokenResponses, CreateEvaluationV1EvaluationsPostData, CreateEvaluationV1EvaluationsPostError, CreateEvaluationV1EvaluationsPostErrors, CreateEvaluationV1EvaluationsPostResponse, CreateEvaluationV1EvaluationsPostResponses, DeviceCodeResponse, DeviceTokenResponse, ErrorDetail, ErrorResponse, EvaluationPage, EvaluationReport, EvaluationRequest, EvaluationResult, EvaluationSummary, GetAgentPermissionsData, GetAgentPermissionsError, GetAgentPermissionsErrors, GetAgentPermissionsResponse, GetAgentPermissionsResponses, GetEvaluationV1EvaluationsEvaluationIdGetData, GetEvaluationV1EvaluationsEvaluationIdGetError, GetEvaluationV1EvaluationsEvaluationIdGetErrors, GetEvaluationV1EvaluationsEvaluationIdGetResponse, GetEvaluationV1EvaluationsEvaluationIdGetResponses, HttpValidationError, InvalidField, ListEvaluationsV1EvaluationsGetData, ListEvaluationsV1EvaluationsGetError, ListEvaluationsV1EvaluationsGetErrors, ListEvaluationsV1EvaluationsGetResponse, ListEvaluationsV1EvaluationsGetResponses, OAuthError, PhraseResult, ProseResult, RemoveEvaluationV1EvaluationsEvaluationIdDeleteData, RemoveEvaluationV1EvaluationsEvaluationIdDeleteError, RemoveEvaluationV1EvaluationsEvaluationIdDeleteErrors, RemoveEvaluationV1EvaluationsEvaluationIdDeleteResponse, RemoveEvaluationV1EvaluationsEvaluationIdDeleteResponses, ValidationDetail, ValidationError, ValidationResponse } from './types.gen.js';
@@ -1,6 +1,23 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: `${string}://${string}` | (string & {});
3
3
  };
4
+ /**
5
+ * AgentPermissions
6
+ */
7
+ export type AgentPermissions = {
8
+ /**
9
+ * Agents Can Cancel Plans
10
+ */
11
+ agents_can_cancel_plans: boolean;
12
+ /**
13
+ * Agents Can Confirm Paid Orders
14
+ */
15
+ agents_can_confirm_paid_orders: boolean;
16
+ /**
17
+ * Agents Can Start Trials
18
+ */
19
+ agents_can_start_trials: boolean;
20
+ };
4
21
  /**
5
22
  * Body_createDeviceCode
6
23
  */
@@ -416,6 +433,30 @@ export type CreateDeviceTokenResponses = {
416
433
  200: DeviceTokenResponse;
417
434
  };
418
435
  export type CreateDeviceTokenResponse = CreateDeviceTokenResponses[keyof CreateDeviceTokenResponses];
436
+ export type GetAgentPermissionsData = {
437
+ body?: never;
438
+ path?: never;
439
+ query?: never;
440
+ url: '/v1/agent-permissions';
441
+ };
442
+ export type GetAgentPermissionsErrors = {
443
+ /**
444
+ * Unauthorized
445
+ */
446
+ 401: ErrorResponse;
447
+ /**
448
+ * Service Unavailable
449
+ */
450
+ 503: ErrorResponse;
451
+ };
452
+ export type GetAgentPermissionsError = GetAgentPermissionsErrors[keyof GetAgentPermissionsErrors];
453
+ export type GetAgentPermissionsResponses = {
454
+ /**
455
+ * Successful Response
456
+ */
457
+ 200: AgentPermissions;
458
+ };
459
+ export type GetAgentPermissionsResponse = GetAgentPermissionsResponses[keyof GetAgentPermissionsResponses];
419
460
  export type ListEvaluationsV1EvaluationsGetData = {
420
461
  body?: never;
421
462
  path?: never;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { EvaluationResult, EvaluationPage, DeviceCodeResponse, DeviceTokenResponse } from "./gen/types.gen.js";
2
- export type { EvaluationResult as Evaluation, EvaluationPage, EvaluationReport, EvaluationSummary, CheckResult, ProseResult, PhraseResult, DeviceCodeResponse, DeviceTokenResponse, } from "./gen/types.gen.js";
1
+ import type { EvaluationResult, EvaluationPage, DeviceCodeResponse, DeviceTokenResponse, AgentPermissions } from "./gen/types.gen.js";
2
+ export type { EvaluationResult as Evaluation, EvaluationPage, EvaluationReport, EvaluationSummary, CheckResult, ProseResult, PhraseResult, DeviceCodeResponse, DeviceTokenResponse, AgentPermissions, } from "./gen/types.gen.js";
3
3
  /** Sanitized failure. status is null when no reliable HTTP answer arrived. */
4
4
  export declare class ReadlintError extends Error {
5
5
  readonly code: string;
@@ -29,6 +29,8 @@ export declare class Readlint {
29
29
  #private;
30
30
  readonly baseUrl: string;
31
31
  constructor(options?: ReadlintOptions);
32
+ /** Read account-wide policy. Changes require the owner's browser session. */
33
+ getAgentPermissions(): Promise<AgentPermissions>;
32
34
  evaluate(article: string, options: EvaluateOptions): Promise<EvaluationResult>;
33
35
  listEvaluations(options?: {
34
36
  limit?: number;
package/dist/index.js CHANGED
@@ -93,6 +93,10 @@ export class Readlint {
93
93
  }
94
94
  this.#fetch = options.fetch ?? globalThis.fetch;
95
95
  }
96
+ /** Read account-wide policy. Changes require the owner's browser session. */
97
+ getAgentPermissions() {
98
+ return this.#request("GET", "/v1/agent-permissions", true);
99
+ }
96
100
  evaluate(article, options) {
97
101
  if (typeof options?.idempotencyKey !== "string" || !/^[!-~]{1,255}$(?![\s\S])/.test(options.idempotencyKey)) {
98
102
  throw new TypeError("idempotencyKey must be 1–255 printable ASCII characters without spaces.");
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.4.0";
1
+ export declare const VERSION = "0.5.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.4.0";
1
+ export const VERSION = "0.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "readlint.com",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "TypeScript SDK, CLI and MCP server for readlint.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",