@cr8rcho/alkahest 0.1.76 → 0.1.78
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/dist/core/mapFetch.d.ts +14 -0
- package/dist/core/mapFetch.js +24 -0
- package/dist/core/mapFetch.js.map +1 -0
- package/dist/mcp/server.d.ts +15 -1
- package/dist/mcp/server.js +269 -223
- package/dist/mcp/server.js.map +1 -1
- package/package.json +8 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ProductMap } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fetch a project's PUBLISHED code map through the `map` edge function (remote MCP, ADR-095
|
|
4
|
+
* in the hosted repo): GET {api}/map/{project}[/{mapSlug}]/map.json with the alk_ token as
|
|
5
|
+
* bearer. The gate applies the same visibility rules as the viewer; a full-access token reads
|
|
6
|
+
* what its user can read. Returns null when unreadable (no project passed, private, unknown
|
|
7
|
+
* slug, network failure) — callers answer with a "pass `project`" style hint.
|
|
8
|
+
*/
|
|
9
|
+
export declare function fetchPublishedMap(opts: {
|
|
10
|
+
api?: string;
|
|
11
|
+
token: string;
|
|
12
|
+
project?: string;
|
|
13
|
+
mapSlug?: string;
|
|
14
|
+
}): Promise<ProductMap | null>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { resolveApiUrl } from "./credentials.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fetch a project's PUBLISHED code map through the `map` edge function (remote MCP, ADR-095
|
|
4
|
+
* in the hosted repo): GET {api}/map/{project}[/{mapSlug}]/map.json with the alk_ token as
|
|
5
|
+
* bearer. The gate applies the same visibility rules as the viewer; a full-access token reads
|
|
6
|
+
* what its user can read. Returns null when unreadable (no project passed, private, unknown
|
|
7
|
+
* slug, network failure) — callers answer with a "pass `project`" style hint.
|
|
8
|
+
*/
|
|
9
|
+
export async function fetchPublishedMap(opts) {
|
|
10
|
+
if (!opts.project)
|
|
11
|
+
return null;
|
|
12
|
+
const base = resolveApiUrl(opts.api, {});
|
|
13
|
+
const url = `${base}/map/${encodeURIComponent(opts.project)}${opts.mapSlug ? `/${encodeURIComponent(opts.mapSlug)}` : ""}/map.json`;
|
|
14
|
+
try {
|
|
15
|
+
const res = await fetch(url, { headers: { authorization: `Bearer ${opts.token}` } });
|
|
16
|
+
if (!res.ok)
|
|
17
|
+
return null;
|
|
18
|
+
return (await res.json());
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=mapFetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapFetch.js","sourceRoot":"","sources":["../../src/core/mapFetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAKvC;IACC,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,GAAG,IAAI,QAAQ,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC;IACpI,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAe,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
2
3
|
/**
|
|
3
4
|
* MCP server that lets agents (Claude Code/Codex/Cursor) query the product map (ALKAHEST.md §7).
|
|
4
5
|
* No LLM key required — reasoning is done by the calling agent. Tools provide only deterministic structure.
|
|
5
6
|
* Default target is the server's working directory (cwd). Each tool's `path` can point to a different project.
|
|
7
|
+
*
|
|
8
|
+
* Remote mode (hosted ADR-095): the SAME server, mounted behind the web app's /api/mcp/{token}
|
|
9
|
+
* route as a claude.ai custom connector. `remote` carries the request's alk_ token + API base
|
|
10
|
+
* into every core call (env/credential fallbacks never fire on a server), the local-only tools
|
|
11
|
+
* (scan / publish / set_summary / set_prd / comment_to_issue / check_version) are not
|
|
12
|
+
* registered, and the graph tools read the PUBLISHED map through the `map` edge function
|
|
13
|
+
* instead of the local checkout.
|
|
6
14
|
*/
|
|
7
|
-
export
|
|
15
|
+
export interface RemoteOptions {
|
|
16
|
+
/** alk_ API token every call authenticates with. */
|
|
17
|
+
token: string;
|
|
18
|
+
/** Functions base URL (default: the hosted service). */
|
|
19
|
+
api?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function buildServer(remote?: RemoteOptions): McpServer;
|