@hasna/shortlinks 0.1.24 → 0.2.1

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.
@@ -1,14 +1,29 @@
1
1
  import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ /**
3
+ * open-shortlinks MCP transport/port boilerplate — self-contained, with NO
4
+ * external harness dependency. The prior version depended on the unpublished
5
+ * `@hasna/mcp-harness` (a `file:` link), which made `shortlinks-mcp`
6
+ * unstartable on a fresh `npm i` / `bun add -g`. This version inlines the tiny
7
+ * amount of transport glue using only the published `@modelcontextprotocol/sdk`
8
+ * and Bun's built-in HTTP server, matching the pattern used by the reference
9
+ * apps (open-conversations, open-mementos).
10
+ *
11
+ * shortlinks builds its MCP server with the low-level `Server`; the WebStandard
12
+ * transport's `.connect()` works identically on `Server` and the high-level
13
+ * `McpServer`.
14
+ */
2
15
  export declare const MCP_HTTP_SERVICE_NAME = "shortlinks";
16
+ export declare const MCP_HTTP_HOST = "127.0.0.1";
3
17
  export declare const DEFAULT_MCP_HTTP_PORT = 8851;
18
+ export interface McpHttpServerHandle {
19
+ port: number;
20
+ host: string;
21
+ url: string;
22
+ close(): Promise<void>;
23
+ }
4
24
  export declare function isHttpMode(argv?: string[], env?: NodeJS.ProcessEnv): boolean;
5
25
  export declare function isStdioMode(argv?: string[], env?: NodeJS.ProcessEnv): boolean;
6
26
  export declare function resolveMcpHttpPort(argv?: string[], env?: NodeJS.ProcessEnv): number;
7
- export type McpHttpServerHandle = {
8
- port: number;
9
- host: string;
10
- close: () => Promise<void>;
11
- };
12
27
  export declare function startMcpHttpServer(buildServer: () => Server, options?: {
13
28
  port?: number;
14
29
  host?: string;
@@ -7,8 +7,9 @@
7
7
  * shortlinks-mcp stdio (default; for editor/agent clients)
8
8
  * shortlinks-mcp --http Streamable HTTP on 127.0.0.1:8851 (shared service)
9
9
  *
10
- * Store mode follows HASNA_SHORTLINKS_STORE (local SQLite | postgres). In
11
- * postgres mode it reads/writes RDS directly (Amendment A1).
10
+ * Every tool routes through the shared client {@link Store}: the cloud ApiStore
11
+ * (HTTPS `/v1` + bearer key) when the client flip is on, otherwise the on-box
12
+ * LocalStore SQLite. No DSN, no direct sqlite/fetch — same seam the CLI uses.
12
13
  */
13
14
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
14
15
  export declare function buildServer(): Server;