@modootoday/pmcp 0.9.1 → 0.10.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.
@@ -0,0 +1,49 @@
1
+ import { E as EncoderOptions } from './encoder-DGRy9skC.js';
2
+
3
+ /**
4
+ * `pmcp.toml`, the project's one record of where its catalog lives.
5
+ *
6
+ * Paths in it are relative to the file, so the same file works from any
7
+ * directory a host starts pmcp in. Catalog and embedding settings are checked
8
+ * here; projector sections are kept as given.
9
+ */
10
+
11
+ declare const CONFIG_FILE = "pmcp.toml";
12
+ /** What `[catalog]` may say. Each mirrors the repeatable CLI flag of the same meaning. */
13
+ interface CatalogSection {
14
+ readonly roots?: readonly string[];
15
+ readonly scopes?: readonly string[];
16
+ readonly workspaces?: readonly string[];
17
+ readonly packages?: readonly string[];
18
+ readonly marketplaces?: readonly string[];
19
+ }
20
+ interface ProjectConfig {
21
+ /** Absolute path of the file read. */
22
+ readonly path: string;
23
+ /** Its directory; every relative path in the file resolves against it. */
24
+ readonly dir: string;
25
+ /** `[catalog]` with paths already absolute. */
26
+ readonly catalog: CatalogSection;
27
+ readonly embedding?: EmbeddingSection;
28
+ /** The whole document, for sections this module does not interpret. */
29
+ readonly raw: Readonly<Record<string, unknown>>;
30
+ }
31
+ interface EmbeddingSection extends EncoderOptions {
32
+ readonly enabled?: boolean;
33
+ readonly modelId?: string;
34
+ readonly modelPath?: string;
35
+ readonly cacheDir?: string;
36
+ }
37
+ declare class ConfigError extends Error {
38
+ constructor(path: string, message: string);
39
+ }
40
+ /** The nearest pmcp.toml at or above start, or null when there is none. */
41
+ declare function findConfig(start: string): string | null;
42
+ /**
43
+ * Reads and checks one file. An unknown key under `[catalog]` is an error
44
+ * rather than ignored, for the same reason an unknown flag is: a misspelt
45
+ * `workspace = [...]` must not look like it worked.
46
+ */
47
+ declare function readConfig(path: string): ProjectConfig;
48
+
49
+ export { CONFIG_FILE as C, type EmbeddingSection as E, type ProjectConfig as P, type CatalogSection as a, ConfigError as b, findConfig as f, readConfig as r };
@@ -0,0 +1,53 @@
1
+ import { E as Embedder } from './server-CwWcRjqz.js';
2
+ import { E as EncoderOptions } from './encoder-DGRy9skC.js';
3
+
4
+ /**
5
+ * The optional encoder and the store for the vectors it produces.
6
+ *
7
+ * Neither the model nor its runtime is a dependency: a caller who wants
8
+ * semantic ranking installs the peer and runs `pmcp index`, and everything
9
+ * here degrades to null rather than throwing when that has not happened.
10
+ */
11
+
12
+ interface LoadEmbedderOptions extends EncoderOptions {
13
+ /** Where model files live; a host bakes them into its image here. */
14
+ readonly cacheDir?: string;
15
+ readonly modelPath?: string;
16
+ /** Refuse to download, so a missing model is an error rather than a fetch. */
17
+ readonly localOnly?: boolean;
18
+ /** Injected for tests. The optional peer is imported otherwise. */
19
+ readonly module?: unknown;
20
+ }
21
+ /**
22
+ * Loads the encoder, or returns null when the peer is not installed.
23
+ *
24
+ * Absence is not failure anywhere in this package: the caller reports it and
25
+ * ranking stays lexical.
26
+ */
27
+ declare function loadEmbedder(modelId?: string, options?: LoadEmbedderOptions): Promise<Embedder | null>;
28
+ /**
29
+ * One vector per entry, reusing those whose description has not changed.
30
+ * Encoded as passages, the side the intent is compared against.
31
+ */
32
+ declare function encodeEntries(embedder: Embedder, entries: readonly {
33
+ readonly name: string;
34
+ readonly description: string;
35
+ }[], previous?: ReadonlyMap<string, {
36
+ hash: string;
37
+ vector: Float32Array;
38
+ }>): Promise<Map<string, {
39
+ hash: string;
40
+ vector: Float32Array;
41
+ }>>;
42
+ interface EntryVectorStore {
43
+ read(modelId: string): Map<string, Float32Array>;
44
+ /** Names whose stored hash disagrees with the description they now have. */
45
+ stale(modelId: string, entries: ReadonlyMap<string, string>): string[];
46
+ write(modelId: string, name: string, description: string, vector: Float32Array): void;
47
+ close(): void;
48
+ }
49
+ declare function openEntryVectors(path: string, options?: {
50
+ readOnly?: boolean;
51
+ }): Promise<EntryVectorStore | null>;
52
+
53
+ export { type EntryVectorStore as E, type LoadEmbedderOptions as L, encodeEntries as e, loadEmbedder as l, openEntryVectors as o };
@@ -0,0 +1,36 @@
1
+ declare const DEFAULT_MODEL_ID = "Xenova/multilingual-e5-small";
2
+ type EncoderDtype = "q4" | "q8" | "fp32";
3
+ interface EncoderSpec {
4
+ readonly queryPrefix: string;
5
+ readonly passagePrefix: string;
6
+ readonly pooling: "mean" | "cls";
7
+ readonly projected?: boolean;
8
+ }
9
+ interface EncoderOptions {
10
+ readonly dtype?: EncoderDtype;
11
+ readonly dimensions?: number;
12
+ readonly revision?: string;
13
+ readonly encoder?: Partial<EncoderSpec>;
14
+ }
15
+ interface EmbeddingModel {
16
+ readonly name: string;
17
+ readonly modelId: string;
18
+ readonly dtype: EncoderDtype;
19
+ readonly dtypes: readonly EncoderDtype[];
20
+ readonly dimensions: readonly number[];
21
+ readonly revision: string;
22
+ readonly encoder: EncoderSpec;
23
+ }
24
+ declare function embeddingModels(): readonly EmbeddingModel[];
25
+ declare function encoderSpec(modelId: string): EncoderSpec;
26
+ interface ResolvedEncoder {
27
+ readonly modelId: string;
28
+ readonly dtype: EncoderDtype;
29
+ readonly dimensions?: number;
30
+ readonly revision: string;
31
+ readonly encoder: EncoderSpec;
32
+ readonly indexKey: string;
33
+ }
34
+ declare function resolveEncoder(model?: string, options?: EncoderOptions): ResolvedEncoder;
35
+
36
+ export { DEFAULT_MODEL_ID as D, type EncoderOptions as E, type ResolvedEncoder as R, type EmbeddingModel as a, type EncoderDtype as b, type EncoderSpec as c, encoderSpec as d, embeddingModels as e, resolveEncoder as r };
package/dist/http.d.ts CHANGED
@@ -1,42 +1,10 @@
1
- import { S as SkillEntry } from './catalog-BU5VLLyd.js';
2
- import { E as Embedder, S as SkillServerOptions } from './server-BBZDjzWZ.js';
1
+ import { S as SkillServerOptions, E as Embedder, a as SkillEntry } from './server-CwWcRjqz.js';
2
+ import { L as LoadEmbedderOptions } from './embed-BBhv3y5x.js';
3
+ export { l as loadEmbedder } from './embed-BBhv3y5x.js';
4
+ import { M as MailboxService } from './service-qpCsOXkQ.js';
5
+ export { D as DEFAULT_MODEL_ID } from './encoder-DGRy9skC.js';
3
6
  import 'zod';
4
7
 
5
- /**
6
- * The optional encoder and the store for the vectors it produces.
7
- *
8
- * Neither the model nor its runtime is a dependency: a caller who wants
9
- * semantic ranking installs the peer and runs `pmcp index`, and everything
10
- * here degrades to null rather than throwing when that has not happened.
11
- */
12
-
13
- /**
14
- * What `pmcp index` writes and what the server reads back. Multilingual, so a
15
- * Korean intent finds an English description (measured 20261005: 8/8 Korean
16
- * and 8/8 English intents in the top three over a 99-skill catalog).
17
- */
18
- declare const DEFAULT_MODEL_ID = "Xenova/multilingual-e5-small";
19
- interface LoadEmbedderOptions {
20
- /** Where model files live; a host bakes them into its image here. */
21
- readonly cacheDir?: string;
22
- /** Refuse to download, so a missing model is an error rather than a fetch. */
23
- readonly localOnly?: boolean;
24
- /**
25
- * Weight precision. q8 is a quarter of fp32's size (118 MB against 470 MB for
26
- * the default model) and ranked the same in the 20261005 measurement.
27
- */
28
- readonly dtype?: "q8" | "fp32";
29
- /** Injected for tests. The optional peer is imported otherwise. */
30
- readonly module?: unknown;
31
- }
32
- /**
33
- * Loads the encoder, or returns null when the peer is not installed.
34
- *
35
- * Absence is not failure anywhere in this package: the caller reports it and
36
- * ranking stays lexical.
37
- */
38
- declare function loadEmbedder(modelId?: string, options?: LoadEmbedderOptions): Promise<Embedder | null>;
39
-
40
8
  /**
41
9
  * Checks a hosted skills server makes before a request reaches MCP: which browser origins
42
10
  * and Host names may call it, how large a request may be, and how often one caller may call.
@@ -74,6 +42,7 @@ interface SkillCaller {
74
42
  readonly claims?: Readonly<Record<string, unknown>>;
75
43
  }
76
44
  interface SkillHttpOptions extends SkillServerOptions {
45
+ readonly mailboxFor?: (caller: SkillCaller) => MailboxService | undefined | Promise<MailboxService | undefined>;
77
46
  /** Gets the Request the host's fetch received; read headers only, the body is still unread. */
78
47
  readonly authorize: (request: Request) => SkillCaller | undefined | Promise<SkillCaller | undefined>;
79
48
  /** Tiers a caller may list and load. Package skills without a tier count as open. */
@@ -111,4 +80,4 @@ interface SkillHttpHandler {
111
80
  }
112
81
  declare function createSkillHttpHandler(options: SkillHttpOptions): SkillHttpHandler;
113
82
 
114
- export { DEFAULT_MAX_REQUEST_BYTES, DEFAULT_MODEL_ID, DEFAULT_TIERS, Embedder, type RateLimitOptions, type SkillCaller, type SkillHttpHandler, type SkillHttpOptions, type SkillHttpSemanticOptions, createSkillHttpHandler, loadEmbedder, visibleTo };
83
+ export { DEFAULT_MAX_REQUEST_BYTES, DEFAULT_TIERS, Embedder, type RateLimitOptions, type SkillCaller, type SkillHttpHandler, type SkillHttpOptions, type SkillHttpSemanticOptions, createSkillHttpHandler, visibleTo };
package/dist/http.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import {
2
- DEFAULT_MODEL_ID,
3
2
  encodeEntries,
4
3
  loadEmbedder
5
- } from "./chunk-7DD2ADL2.js";
6
- import "./chunk-R2QPKEI4.js";
4
+ } from "./chunk-XEH4ZGGJ.js";
7
5
  import {
8
6
  createSkillServer,
9
7
  readCatalog
10
- } from "./chunk-VQHNG3KM.js";
8
+ } from "./chunk-VRZFM2M5.js";
9
+ import {
10
+ DEFAULT_MODEL_ID
11
+ } from "./chunk-XOH2CW6P.js";
11
12
 
12
13
  // src/http.ts
13
14
  import {
@@ -149,13 +150,22 @@ function createSkillHttpHandler(options) {
149
150
  }
150
151
  };
151
152
  let ready = encode();
152
- const handlerFor = (tiers) => {
153
- const key = [...tiers].sort().join(",");
153
+ const handlerFor = (tiers, mailbox) => {
154
+ const key = JSON.stringify({
155
+ tiers: [...tiers].sort(),
156
+ mailbox: mailbox ? [
157
+ mailbox.binding.projectId,
158
+ mailbox.binding.actorId,
159
+ mailbox.binding.sessionId,
160
+ mailbox.binding.generation
161
+ ] : null
162
+ });
154
163
  const cached = handlers.get(key);
155
164
  if (cached) return cached;
156
165
  const handler = createMcpHandler(
157
166
  () => createSkillServer({
158
167
  ...options,
168
+ ...mailbox ? { mailbox } : {},
159
169
  ...embedder && vectors ? { embedder, vectors } : {},
160
170
  loadCatalog: () => visibleTo(all, tiers),
161
171
  skillsExtension: { cacheScope: options.cacheScope ?? "private" }
@@ -183,7 +193,8 @@ function createSkillHttpHandler(options) {
183
193
  options.maxRequestBytes ?? DEFAULT_MAX_REQUEST_BYTES
184
194
  );
185
195
  if (capped instanceof Response) return capped;
186
- return handlerFor(tiersFor(caller)).fetch(capped, {
196
+ const mailbox = await options.mailboxFor?.(caller);
197
+ return handlerFor(tiersFor(caller), mailbox).fetch(capped, {
187
198
  authInfo: {
188
199
  token: "",
189
200
  clientId: caller.id,
package/dist/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
- import { I as IntentCache, S as SkillServerOptions, a as SkillTools } from './server-BBZDjzWZ.js';
2
- export { B as BundleFile, C as CATALOG_PAGE_MAX, b as CATALOG_PAGE_SIZE, c as CallResponse, d as CatalogItem, e as CatalogResponse, f as Classified, D as DEFAULT_FIND_LIMIT, g as DESCRIBE_FILE_LIMIT, E as Embedder, F as FileKind, h as FindOptions, i as FindResult, j as IntentCacheStats, K as KindFilter, M as Match, R as READ_BUDGET_BYTES, k as RUNTIMES, l as Ranking, m as ReadResult, n as Runtime, o as SkillBundle, p as SkillFile, q as SkillFileContent, r as SkillFileListing, s as SkillFilters, t as bundleResponseSchema, u as bundleSkill, v as catalogResponseSchema, w as classify, x as cosine, y as createSkillTools, z as describeResponseSchema, A as detectRuntime, G as find, H as findResultSchema, J as isUtf8Text, L as lexicalScore, N as listSkillFiles, O as mimeOf, P as normaliseIntent, Q as readSkillFile, T as runtimeOfClient, U as verifiedRuntimesOf } from './server-BBZDjzWZ.js';
3
- import { S as SkillEntry, M as MetadataValue, C as CatalogOptions } from './catalog-BU5VLLyd.js';
4
- export { a as ASSET_KINDS, A as AssetKind, b as COMPATIBILITY_MAX, D as DESCRIPTION_MAX, c as MAX_SKILL_DEPTH, d as MetadataLeaf, N as NAME_MAX, e as SKIPPED_DIRS, f as displayPath, k as kindOf, g as parseSkillFrontmatter, r as readBody, h as readCatalog, i as readFrontmatter, s as specProblems, w as withoutBody } from './catalog-BU5VLLyd.js';
1
+ import { I as IntentCache, R as Ranking, S as SkillServerOptions, E as Embedder, C as CatalogOptions, a as SkillEntry, M as MetadataValue, b as SkillTools } from './server-CwWcRjqz.js';
2
+ export { A as ASSET_KINDS, c as AssetKind, B as BundleFile, d as CATALOG_PAGE_MAX, e as CATALOG_PAGE_SIZE, f as COMPATIBILITY_MAX, g as CallResponse, h as CatalogItem, i as CatalogResponse, j as Classified, D as DEFAULT_FIND_LIMIT, k as DESCRIBE_FILE_LIMIT, l as DESCRIPTION_MAX, F as FileKind, m as FindOptions, n as FindResult, o as IntentCacheStats, K as KindFilter, p as MAX_SKILL_DEPTH, q as Match, r as MetadataLeaf, N as NAME_MAX, s as READ_BUDGET_BYTES, t as RUNTIMES, u as ReadResult, v as Runtime, w as SKIPPED_DIRS, x as SkillBundle, y as SkillFile, z as SkillFileContent, G as SkillFileListing, H as SkillFilters, J as bundleResponseSchema, L as bundleSkill, O as catalogResponseSchema, P as classify, Q as cosine, T as createSkillTools, U as describeResponseSchema, V as detectRuntime, W as displayPath, X as find, Y as findResultSchema, Z as isUtf8Text, _ as kindOf, $ as lexicalScore, a0 as listSkillFiles, a1 as mimeOf, a2 as normaliseIntent, a3 as parseSkillFrontmatter, a4 as readBody, a5 as readCatalog, a6 as readFrontmatter, a7 as readSkillFile, a8 as runtimeOfClient, a9 as specProblems, aa as verifiedRuntimesOf, ab as withoutBody } from './server-CwWcRjqz.js';
3
+ import { L as LoadEmbedderOptions } from './embed-BBhv3y5x.js';
4
+ export { E as EntryVectorStore, e as encodeEntries, l as loadEmbedder, o as openEntryVectors } from './embed-BBhv3y5x.js';
5
+ export { D as DEFAULT_MODEL_ID, a as EmbeddingModel, b as EncoderDtype, E as EncoderOptions, c as EncoderSpec, R as ResolvedEncoder, e as embeddingModels, d as encoderSpec, r as resolveEncoder } from './encoder-DGRy9skC.js';
6
+ import { P as ProjectConfig } from './config-CJ43_oBS.js';
7
+ export { C as CONFIG_FILE, a as CatalogSection, b as ConfigError, E as EmbeddingSection, f as findConfig, r as readConfig } from './config-CJ43_oBS.js';
5
8
  import { McpServer } from '@modelcontextprotocol/server';
9
+ import { M as MailboxService } from './service-qpCsOXkQ.js';
6
10
  import 'zod';
7
11
 
8
12
  /**
@@ -37,6 +41,19 @@ declare const DEFAULT_INTENT_CACHE_LIMIT = 4096;
37
41
  */
38
42
  declare function openIntentCache(options: IntentCacheOptions): Promise<IntentCache | null>;
39
43
 
44
+ interface SearchOptions extends LoadEmbedderOptions {
45
+ readonly indexPath: string;
46
+ readonly modelId?: string;
47
+ readonly embedder?: Embedder;
48
+ readonly loadCatalog?: (options: CatalogOptions) => SkillEntry[];
49
+ }
50
+ interface PreparedSearch {
51
+ readonly ranking: Ranking;
52
+ readonly reason?: "index_missing" | "index_unavailable" | "index_stale" | "encoder_unavailable" | "vector_mismatch";
53
+ readonly options: Pick<SkillServerOptions, "embedder" | "vectors" | "loadCatalog">;
54
+ }
55
+ declare function prepareSearch(catalog: CatalogOptions, options: SearchOptions): Promise<PreparedSearch>;
56
+
40
57
  /**
41
58
  * Assets laid out as an agent plugin marketplace: a directory holding
42
59
  * `.claude-plugin/marketplace.json`, whose plugins keep skills, commands,
@@ -58,44 +75,6 @@ declare function readMarketplace(dir: string, onReject?: (rejection: Rejection)
58
75
  /** The directory or single file an entry's describe and read may open. */
59
76
  declare const assetRoot: (entry: Pick<SkillEntry, "root" | "path">) => string;
60
77
 
61
- /**
62
- * `pmcp.toml`, the project's one record of where its catalog lives.
63
- *
64
- * Paths in it are relative to the file, so the same file works from any
65
- * directory a host starts pmcp in. Only `[catalog]` is read here; the other
66
- * sections belong to the projector and are kept as given.
67
- */
68
- declare const CONFIG_FILE = "pmcp.toml";
69
- /** What `[catalog]` may say. Each mirrors the repeatable CLI flag of the same meaning. */
70
- interface CatalogSection {
71
- readonly roots?: readonly string[];
72
- readonly scopes?: readonly string[];
73
- readonly workspaces?: readonly string[];
74
- readonly packages?: readonly string[];
75
- readonly marketplaces?: readonly string[];
76
- }
77
- interface ProjectConfig {
78
- /** Absolute path of the file read. */
79
- readonly path: string;
80
- /** Its directory; every relative path in the file resolves against it. */
81
- readonly dir: string;
82
- /** `[catalog]` with paths already absolute. */
83
- readonly catalog: CatalogSection;
84
- /** The whole document, for sections this module does not interpret. */
85
- readonly raw: Readonly<Record<string, unknown>>;
86
- }
87
- declare class ConfigError extends Error {
88
- constructor(path: string, message: string);
89
- }
90
- /** The nearest pmcp.toml at or above start, or null when there is none. */
91
- declare function findConfig(start: string): string | null;
92
- /**
93
- * Reads and checks one file. An unknown key under `[catalog]` is an error
94
- * rather than ignored, for the same reason an unknown flag is: a misspelt
95
- * `workspace = [...]` must not look like it worked.
96
- */
97
- declare function readConfig(path: string): ProjectConfig;
98
-
99
78
  /** What the projector writes. A path is unique across a plan and is the lock key. */
100
79
  type Output = {
101
80
  readonly kind: "link";
@@ -139,6 +118,7 @@ interface PackageRulesSpec {
139
118
  readonly strip: readonly string[];
140
119
  }
141
120
  interface McpServerSpec {
121
+ readonly mailbox?: boolean;
142
122
  readonly command: string;
143
123
  readonly args: readonly string[];
144
124
  readonly env: Readonly<Record<string, string>>;
@@ -285,7 +265,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
285
265
 
286
266
  /** Reported to the host on connect. */
287
267
  declare const SERVER_NAME = "pmcp";
288
- declare const SERVER_VERSION = "0.9.1";
268
+ declare const SERVER_VERSION = "0.10.0";
289
269
  /**
290
270
  * Registers the skill_* tools on a server.
291
271
  *
@@ -294,6 +274,7 @@ declare const SERVER_VERSION = "0.9.1";
294
274
  */
295
275
  declare function registerSkillTools(server: McpServer, tools: SkillTools): McpServer;
296
276
  interface SkillMcpOptions extends SkillServerOptions {
277
+ readonly mailbox?: MailboxService;
297
278
  /** One prompt per skill, for hosts that offer prompts as commands. Off by default. */
298
279
  readonly prompts?: boolean;
299
280
  readonly skillsExtension?: SkillsExtensionOptions;
@@ -337,4 +318,4 @@ declare function registerSkillResources(server: McpServer, skills: () => readonl
337
318
  declare const promptName: (entry: Pick<SkillEntry, "name">) => string;
338
319
  declare function registerSkillPrompts(server: McpServer, tools: SkillTools): void;
339
320
 
340
- export { CONFIG_FILE, CatalogOptions, type CatalogSection, ConfigError, DEFAULT_INTENT_CACHE_LIMIT, type Finding$1 as Finding, IntentCache, type IntentCacheOptions, LOCK_FILE, type McpServerSpec, MetadataValue, type Output, type PackageRulesSpec, type ProjectConfig, ProjectError, type ProjectResult, type ProjectSpec, type Rejection, type Runner, SERVER_NAME, SERVER_VERSION, SKILLS_EXTENSION, SkillEntry, type SkillExtensionEntry, type SkillMcpOptions, type SkillResource, SkillServerOptions, SkillTools, TOOLS, type Tool, type Finding as ValidationFinding, assetRoot, createSkillServer, deadGlobs, deriveName, doctor, extensionEntry, findConfig, openIntentCache, plan, project, promptName, readConfig, readFrontmatterText, readMarketplace, readMetadata, readSpec, registerSkillPrompts, registerSkillResources, registerSkillTools, registerSkillsExtension, resolveSkillFileUri, skillFileUri, skillFileUri as skillUri, validateCatalog, validateSkillDir };
321
+ export { CatalogOptions, DEFAULT_INTENT_CACHE_LIMIT, Embedder, type Finding$1 as Finding, IntentCache, type IntentCacheOptions, LOCK_FILE, LoadEmbedderOptions, type McpServerSpec, MetadataValue, type Output, type PackageRulesSpec, type PreparedSearch, ProjectConfig, ProjectError, type ProjectResult, type ProjectSpec, Ranking, type Rejection, type Runner, SERVER_NAME, SERVER_VERSION, SKILLS_EXTENSION, type SearchOptions, SkillEntry, type SkillExtensionEntry, type SkillMcpOptions, type SkillResource, SkillServerOptions, SkillTools, TOOLS, type Tool, type Finding as ValidationFinding, assetRoot, createSkillServer, deadGlobs, deriveName, doctor, extensionEntry, openIntentCache, plan, prepareSearch, project, promptName, readFrontmatterText, readMarketplace, readMetadata, readSpec, registerSkillPrompts, registerSkillResources, registerSkillTools, registerSkillsExtension, resolveSkillFileUri, skillFileUri, skillFileUri as skillUri, validateCatalog, validateSkillDir };
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import {
2
- CONFIG_FILE,
3
- ConfigError,
4
2
  LOCK_FILE,
5
3
  ProjectError,
6
4
  TOOLS,
7
5
  deadGlobs,
8
6
  deriveName,
9
7
  doctor,
10
- findConfig,
11
8
  plan,
9
+ prepareSearch,
12
10
  project,
13
- readConfig,
14
11
  readSpec,
15
12
  validateCatalog,
16
13
  validateSkillDir
17
- } from "./chunk-QCOJ3WCM.js";
14
+ } from "./chunk-ZUFFVIHQ.js";
18
15
  import {
19
16
  DEFAULT_INTENT_CACHE_LIMIT,
17
+ encodeEntries,
18
+ loadEmbedder,
19
+ openEntryVectors,
20
20
  openIntentCache
21
- } from "./chunk-R2QPKEI4.js";
21
+ } from "./chunk-XEH4ZGGJ.js";
22
22
  import {
23
23
  ASSET_KINDS,
24
24
  CATALOG_PAGE_MAX,
@@ -30,7 +30,6 @@ import {
30
30
  MAX_SKILL_DEPTH,
31
31
  NAME_MAX,
32
32
  READ_BUDGET_BYTES,
33
- RUNTIMES,
34
33
  SERVER_NAME,
35
34
  SERVER_VERSION,
36
35
  SKILLS_EXTENSION,
@@ -44,7 +43,6 @@ import {
44
43
  createSkillServer,
45
44
  createSkillTools,
46
45
  describeResponseSchema,
47
- detectRuntime,
48
46
  displayPath,
49
47
  extensionEntry,
50
48
  find,
@@ -69,12 +67,26 @@ import {
69
67
  registerSkillTools,
70
68
  registerSkillsExtension,
71
69
  resolveSkillFileUri,
72
- runtimeOfClient,
73
70
  skillFileUri,
74
71
  specProblems,
75
- verifiedRuntimesOf,
76
72
  withoutBody
77
- } from "./chunk-VQHNG3KM.js";
73
+ } from "./chunk-VRZFM2M5.js";
74
+ import {
75
+ CONFIG_FILE,
76
+ ConfigError,
77
+ findConfig,
78
+ readConfig
79
+ } from "./chunk-MSTKY33C.js";
80
+ import {
81
+ DEFAULT_MODEL_ID,
82
+ RUNTIMES,
83
+ detectRuntime,
84
+ embeddingModels,
85
+ encoderSpec,
86
+ resolveEncoder,
87
+ runtimeOfClient,
88
+ verifiedRuntimesOf
89
+ } from "./chunk-XOH2CW6P.js";
78
90
  export {
79
91
  ASSET_KINDS,
80
92
  CATALOG_PAGE_MAX,
@@ -84,6 +96,7 @@ export {
84
96
  ConfigError,
85
97
  DEFAULT_FIND_LIMIT,
86
98
  DEFAULT_INTENT_CACHE_LIMIT,
99
+ DEFAULT_MODEL_ID,
87
100
  DESCRIBE_FILE_LIMIT,
88
101
  DESCRIPTION_MAX,
89
102
  LOCK_FILE,
@@ -111,6 +124,9 @@ export {
111
124
  detectRuntime,
112
125
  displayPath,
113
126
  doctor,
127
+ embeddingModels,
128
+ encodeEntries,
129
+ encoderSpec,
114
130
  extensionEntry,
115
131
  find,
116
132
  findConfig,
@@ -119,11 +135,14 @@ export {
119
135
  kindOf,
120
136
  lexicalScore,
121
137
  listSkillFiles,
138
+ loadEmbedder,
122
139
  mimeOf,
123
140
  normaliseIntent,
141
+ openEntryVectors,
124
142
  openIntentCache,
125
143
  frontmatterObject as parseSkillFrontmatter,
126
144
  plan,
145
+ prepareSearch,
127
146
  project,
128
147
  promptName,
129
148
  readBody,
@@ -139,6 +158,7 @@ export {
139
158
  registerSkillResources,
140
159
  registerSkillTools,
141
160
  registerSkillsExtension,
161
+ resolveEncoder,
142
162
  resolveSkillFileUri,
143
163
  runtimeOfClient,
144
164
  skillFileUri,
@@ -0,0 +1,44 @@
1
+ import { b as MailboxStore, B as Binding, R as Row, A as ActorCredential, a as MailboxConfig, M as MailboxService } from '../service-qpCsOXkQ.js';
2
+ export { H as HEARTBEAT_INTERVAL_MS, c as MailboxError, d as MailboxOperation, P as PRESENCE_TTL_MS, e as Result, f as failure, i as inboxSchema, m as messageSchema, o as operationSchema, r as restoreBackup, s as sendSchema, g as sessionsSchema } from '../service-qpCsOXkQ.js';
3
+ import { McpServer } from '@modelcontextprotocol/server';
4
+ export { M as MailboxAttachmentOptions, a as attachMailbox } from '../attachment-tU5FZrgZ.js';
5
+ import { P as ProjectConfig } from '../config-CJ43_oBS.js';
6
+ import 'zod';
7
+ import '../encoder-DGRy9skC.js';
8
+
9
+ declare class NotificationOutbox {
10
+ readonly store: MailboxStore;
11
+ constructor(store: MailboxStore);
12
+ discover(binding: Binding, nativeTarget: string): Promise<void>;
13
+ retryUnsent(binding: Binding, claim: Row): Promise<void>;
14
+ reconcile(binding: Binding, messageId: string, delivered: boolean): Promise<void>;
15
+ enqueue(messageId: string, binding: Binding, nativeTarget: string): Promise<void>;
16
+ claim(binding: Binding): Promise<Row | undefined>;
17
+ renew(binding: Binding, claim: Row): Promise<void>;
18
+ private assertLease;
19
+ complete(binding: Binding, claim: Row, outcome: "accepted" | "uncertain" | "failed"): Promise<void>;
20
+ }
21
+
22
+ declare function createRecoveryBundle(store: MailboxStore, credentials: readonly ActorCredential[], destination: string, key: Buffer): Promise<void>;
23
+ declare function restoreRecoveryBundle(source: string, config: MailboxConfig, key: Buffer): Promise<ActorCredential[]>;
24
+
25
+ declare function registerMailboxTools(server: McpServer, service: MailboxService): McpServer;
26
+
27
+ declare function mailboxConfigFrom(project: ProjectConfig, env?: Readonly<Record<string, string | undefined>>): MailboxConfig | undefined;
28
+ declare function initializeMailboxConfig(file: string, stateDirectory?: string): MailboxConfig;
29
+ declare function readCredential(file: string): {
30
+ projectId: string;
31
+ actorId: string;
32
+ secret: string;
33
+ };
34
+ declare function readBinding(file: string): {
35
+ projectId: string;
36
+ actorId: string;
37
+ sessionId: string;
38
+ generation: number;
39
+ secret: string;
40
+ };
41
+ declare function writePrivateJson(file: string, value: object): void;
42
+ declare function writeBindingFile(file: string, binding: Binding): void;
43
+
44
+ export { ActorCredential, Binding, MailboxConfig, MailboxService, MailboxStore, NotificationOutbox, createRecoveryBundle, initializeMailboxConfig, mailboxConfigFrom, readBinding, readCredential, registerMailboxTools, restoreRecoveryBundle, writeBindingFile, writePrivateJson };