@posty5/mcp 1.1.0 → 2.0.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 +47 -12
- package/dist/bin/stdio.js +255 -1900
- package/dist/bin/stdio.js.map +1 -1
- package/dist/bin/stdio.mjs +256 -1901
- package/dist/bin/stdio.mjs.map +1 -1
- package/dist/index.d.mts +16 -9
- package/dist/index.d.ts +16 -9
- package/dist/index.js +311 -1949
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +313 -1951
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -15
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,6 @@ import { QRCodeClient, QRCodeTemplateClient } from '@posty5/qr-code';
|
|
|
8
8
|
import { ShortLinkClient, LinkCampaignClient } from '@posty5/short-link';
|
|
9
9
|
import { SocialPublisherPostClient } from '@posty5/social-publisher-post';
|
|
10
10
|
import { SocialPublisherWorkspaceClient, SocialPublisherAccountClient } from '@posty5/social-publisher-workspace';
|
|
11
|
-
import { StoreClient } from '@posty5/store';
|
|
12
11
|
import * as node_http from 'node:http';
|
|
13
12
|
import { IncomingMessage } from 'node:http';
|
|
14
13
|
|
|
@@ -28,9 +27,9 @@ declare const DEFAULT_ACCESS: AccessLevel;
|
|
|
28
27
|
* constants/mcp.const.ts` keeps the same list) and users put them in URLs.
|
|
29
28
|
* Order here is catalogue order — `tools/list` answers in it.
|
|
30
29
|
*/
|
|
31
|
-
declare const TOOLSET_NAMES: readonly ["account", "short-links", "qr-codes", "html-hosting", "social-publisher"
|
|
30
|
+
declare const TOOLSET_NAMES: readonly ["account", "short-links", "qr-codes", "html-hosting", "social-publisher"];
|
|
32
31
|
type ToolsetName = (typeof TOOLSET_NAMES)[number];
|
|
33
|
-
/** What a new connection gets when it names no toolsets.
|
|
32
|
+
/** What a new connection gets when it names no toolsets. */
|
|
34
33
|
declare const DEFAULT_TOOLSETS: ToolsetName[];
|
|
35
34
|
/** Display label and one-line description per toolset, for `listToolsets()` and the dashboard picker. */
|
|
36
35
|
declare const TOOLSET_INFO: Record<ToolsetName, {
|
|
@@ -73,7 +72,6 @@ interface IPosty5Clients {
|
|
|
73
72
|
workspaces: SocialPublisherWorkspaceClient;
|
|
74
73
|
socialAccounts: SocialPublisherAccountClient;
|
|
75
74
|
posts: SocialPublisherPostClient;
|
|
76
|
-
store: StoreClient;
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
/** Where the model name of a call came from (mcp-server feature, decision 8). */
|
|
@@ -196,7 +194,9 @@ interface IStoredToolResult {
|
|
|
196
194
|
}
|
|
197
195
|
/**
|
|
198
196
|
* Where write results are remembered by idempotency key. The package ships an
|
|
199
|
-
* in-process store; the hosted server plugs in Redis.
|
|
197
|
+
* in-process store; the hosted server plugs in Redis. Keys arrive as
|
|
198
|
+
* `<scope>:<tool>:<idempotencyKey>`, the scope a hash of the connection's API
|
|
199
|
+
* key, so one store may be shared by several connections.
|
|
200
200
|
*/
|
|
201
201
|
interface IIdempotencyStore {
|
|
202
202
|
get(key: string): Promise<IStoredToolResult | undefined>;
|
|
@@ -281,6 +281,14 @@ interface IPosty5McpHttpOptions {
|
|
|
281
281
|
* attributed to its User-Agent at best.
|
|
282
282
|
*/
|
|
283
283
|
sessionSecret: string;
|
|
284
|
+
/**
|
|
285
|
+
* Browser origins allowed to call (e.g. `["https://app.example.com"]`). When
|
|
286
|
+
* set, a request whose `Origin` header is not listed is refused with 403
|
|
287
|
+
* before `resolve` runs; requests without `Origin` (desktop and server
|
|
288
|
+
* clients) are unaffected. Set it whenever the server listens where a web
|
|
289
|
+
* page could reach it (localhost, a LAN): it stops DNS rebinding.
|
|
290
|
+
*/
|
|
291
|
+
allowedOrigins?: string[];
|
|
284
292
|
/** Default `HTTP_MAX_REQUEST_BYTES`. */
|
|
285
293
|
maxRequestBodySize?: number;
|
|
286
294
|
/** Out-of-band errors (reporting only). Never given request bodies or tokens. */
|
|
@@ -344,9 +352,8 @@ declare function resolveModel(argument: unknown, connectionModel: unknown): {
|
|
|
344
352
|
declare function encodeAgentHeader(call: IToolCallContext, nowSeconds?: number): string;
|
|
345
353
|
|
|
346
354
|
/**
|
|
347
|
-
* The toolsets a connection gets: the requested ones (or the defaults)
|
|
348
|
-
* `account` always
|
|
349
|
-
* order, unknown names dropped.
|
|
355
|
+
* The toolsets a connection gets: the requested ones (or the defaults) and
|
|
356
|
+
* `account` always — in catalogue order, unknown names dropped.
|
|
350
357
|
*/
|
|
351
358
|
declare function resolveToolsets(requested?: readonly string[]): ToolsetName[];
|
|
352
359
|
|
|
@@ -364,7 +371,7 @@ declare const CLIENT_HEADER = "X-Posty5-Client";
|
|
|
364
371
|
declare const MCP_CREATED_FROM = "mcp";
|
|
365
372
|
|
|
366
373
|
/** This package's version — kept in step with package.json (a test pins them). */
|
|
367
|
-
declare const PACKAGE_VERSION = "
|
|
374
|
+
declare const PACKAGE_VERSION = "2.0.0";
|
|
368
375
|
/**
|
|
369
376
|
* What every assistant is told when it connects (MCP server `instructions`).
|
|
370
377
|
* Short on purpose: it is in the model's context for the whole session.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { QRCodeClient, QRCodeTemplateClient } from '@posty5/qr-code';
|
|
|
8
8
|
import { ShortLinkClient, LinkCampaignClient } from '@posty5/short-link';
|
|
9
9
|
import { SocialPublisherPostClient } from '@posty5/social-publisher-post';
|
|
10
10
|
import { SocialPublisherWorkspaceClient, SocialPublisherAccountClient } from '@posty5/social-publisher-workspace';
|
|
11
|
-
import { StoreClient } from '@posty5/store';
|
|
12
11
|
import * as node_http from 'node:http';
|
|
13
12
|
import { IncomingMessage } from 'node:http';
|
|
14
13
|
|
|
@@ -28,9 +27,9 @@ declare const DEFAULT_ACCESS: AccessLevel;
|
|
|
28
27
|
* constants/mcp.const.ts` keeps the same list) and users put them in URLs.
|
|
29
28
|
* Order here is catalogue order — `tools/list` answers in it.
|
|
30
29
|
*/
|
|
31
|
-
declare const TOOLSET_NAMES: readonly ["account", "short-links", "qr-codes", "html-hosting", "social-publisher"
|
|
30
|
+
declare const TOOLSET_NAMES: readonly ["account", "short-links", "qr-codes", "html-hosting", "social-publisher"];
|
|
32
31
|
type ToolsetName = (typeof TOOLSET_NAMES)[number];
|
|
33
|
-
/** What a new connection gets when it names no toolsets.
|
|
32
|
+
/** What a new connection gets when it names no toolsets. */
|
|
34
33
|
declare const DEFAULT_TOOLSETS: ToolsetName[];
|
|
35
34
|
/** Display label and one-line description per toolset, for `listToolsets()` and the dashboard picker. */
|
|
36
35
|
declare const TOOLSET_INFO: Record<ToolsetName, {
|
|
@@ -73,7 +72,6 @@ interface IPosty5Clients {
|
|
|
73
72
|
workspaces: SocialPublisherWorkspaceClient;
|
|
74
73
|
socialAccounts: SocialPublisherAccountClient;
|
|
75
74
|
posts: SocialPublisherPostClient;
|
|
76
|
-
store: StoreClient;
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
/** Where the model name of a call came from (mcp-server feature, decision 8). */
|
|
@@ -196,7 +194,9 @@ interface IStoredToolResult {
|
|
|
196
194
|
}
|
|
197
195
|
/**
|
|
198
196
|
* Where write results are remembered by idempotency key. The package ships an
|
|
199
|
-
* in-process store; the hosted server plugs in Redis.
|
|
197
|
+
* in-process store; the hosted server plugs in Redis. Keys arrive as
|
|
198
|
+
* `<scope>:<tool>:<idempotencyKey>`, the scope a hash of the connection's API
|
|
199
|
+
* key, so one store may be shared by several connections.
|
|
200
200
|
*/
|
|
201
201
|
interface IIdempotencyStore {
|
|
202
202
|
get(key: string): Promise<IStoredToolResult | undefined>;
|
|
@@ -281,6 +281,14 @@ interface IPosty5McpHttpOptions {
|
|
|
281
281
|
* attributed to its User-Agent at best.
|
|
282
282
|
*/
|
|
283
283
|
sessionSecret: string;
|
|
284
|
+
/**
|
|
285
|
+
* Browser origins allowed to call (e.g. `["https://app.example.com"]`). When
|
|
286
|
+
* set, a request whose `Origin` header is not listed is refused with 403
|
|
287
|
+
* before `resolve` runs; requests without `Origin` (desktop and server
|
|
288
|
+
* clients) are unaffected. Set it whenever the server listens where a web
|
|
289
|
+
* page could reach it (localhost, a LAN): it stops DNS rebinding.
|
|
290
|
+
*/
|
|
291
|
+
allowedOrigins?: string[];
|
|
284
292
|
/** Default `HTTP_MAX_REQUEST_BYTES`. */
|
|
285
293
|
maxRequestBodySize?: number;
|
|
286
294
|
/** Out-of-band errors (reporting only). Never given request bodies or tokens. */
|
|
@@ -344,9 +352,8 @@ declare function resolveModel(argument: unknown, connectionModel: unknown): {
|
|
|
344
352
|
declare function encodeAgentHeader(call: IToolCallContext, nowSeconds?: number): string;
|
|
345
353
|
|
|
346
354
|
/**
|
|
347
|
-
* The toolsets a connection gets: the requested ones (or the defaults)
|
|
348
|
-
* `account` always
|
|
349
|
-
* order, unknown names dropped.
|
|
355
|
+
* The toolsets a connection gets: the requested ones (or the defaults) and
|
|
356
|
+
* `account` always — in catalogue order, unknown names dropped.
|
|
350
357
|
*/
|
|
351
358
|
declare function resolveToolsets(requested?: readonly string[]): ToolsetName[];
|
|
352
359
|
|
|
@@ -364,7 +371,7 @@ declare const CLIENT_HEADER = "X-Posty5-Client";
|
|
|
364
371
|
declare const MCP_CREATED_FROM = "mcp";
|
|
365
372
|
|
|
366
373
|
/** This package's version — kept in step with package.json (a test pins them). */
|
|
367
|
-
declare const PACKAGE_VERSION = "
|
|
374
|
+
declare const PACKAGE_VERSION = "2.0.0";
|
|
368
375
|
/**
|
|
369
376
|
* What every assistant is told when it connects (MCP server `instructions`).
|
|
370
377
|
* Short on purpose: it is in the model's context for the whole session.
|