@modootoday/pmcp 0.9.2 → 0.11.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/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
- import { I as IntentCache, S as SkillServerOptions, a as SkillTools } from './server-C9eO6LMI.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-C9eO6LMI.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';
8
+ import { S as ShellHookSpec } from './hook-spec-PRSnYGLV.js';
5
9
  import { McpServer } from '@modelcontextprotocol/server';
10
+ import { M as MailboxService } from './service-qpCsOXkQ.js';
6
11
  import 'zod';
7
12
 
8
13
  /**
@@ -37,6 +42,19 @@ declare const DEFAULT_INTENT_CACHE_LIMIT = 4096;
37
42
  */
38
43
  declare function openIntentCache(options: IntentCacheOptions): Promise<IntentCache | null>;
39
44
 
45
+ interface SearchOptions extends LoadEmbedderOptions {
46
+ readonly indexPath: string;
47
+ readonly modelId?: string;
48
+ readonly embedder?: Embedder;
49
+ readonly loadCatalog?: (options: CatalogOptions) => SkillEntry[];
50
+ }
51
+ interface PreparedSearch {
52
+ readonly ranking: Ranking;
53
+ readonly reason?: "index_missing" | "index_unavailable" | "index_stale" | "encoder_unavailable" | "vector_mismatch";
54
+ readonly options: Pick<SkillServerOptions, "embedder" | "vectors" | "loadCatalog">;
55
+ }
56
+ declare function prepareSearch(catalog: CatalogOptions, options: SearchOptions): Promise<PreparedSearch>;
57
+
40
58
  /**
41
59
  * Assets laid out as an agent plugin marketplace: a directory holding
42
60
  * `.claude-plugin/marketplace.json`, whose plugins keep skills, commands,
@@ -58,44 +76,6 @@ declare function readMarketplace(dir: string, onReject?: (rejection: Rejection)
58
76
  /** The directory or single file an entry's describe and read may open. */
59
77
  declare const assetRoot: (entry: Pick<SkillEntry, "root" | "path">) => string;
60
78
 
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
79
  /** What the projector writes. A path is unique across a plan and is the lock key. */
100
80
  type Output = {
101
81
  readonly kind: "link";
@@ -113,6 +93,7 @@ type Output = {
113
93
  readonly file: string;
114
94
  readonly key: readonly string[];
115
95
  readonly value: unknown;
96
+ readonly managed?: readonly unknown[];
116
97
  }
117
98
  /** A marked block inside a text file other content shares. path = file#pmcp */
118
99
  | {
@@ -139,13 +120,27 @@ interface PackageRulesSpec {
139
120
  readonly strip: readonly string[];
140
121
  }
141
122
  interface McpServerSpec {
142
- readonly command: string;
123
+ readonly mailbox?: boolean;
124
+ readonly command?: string;
125
+ readonly url?: string;
143
126
  readonly args: readonly string[];
144
127
  readonly env: Readonly<Record<string, string>>;
128
+ readonly envVars?: readonly string[];
129
+ readonly envFrom?: Readonly<Record<string, {
130
+ readonly file: string;
131
+ readonly pointer: string;
132
+ }>>;
133
+ readonly cwd?: string;
134
+ readonly headers?: Readonly<Record<string, string>>;
135
+ readonly headerEnv?: Readonly<Record<string, string>>;
136
+ readonly bearerTokenEnvVar?: string;
137
+ readonly native?: Partial<Record<Tool, Readonly<Record<string, number>>>>;
138
+ readonly targets?: readonly Tool[];
145
139
  /** Tools the server should expose where a host can narrow them. */
146
140
  readonly tools?: readonly string[];
147
141
  }
148
142
  interface ProjectSpec {
143
+ readonly hooks?: readonly ShellHookSpec[];
149
144
  readonly root: string;
150
145
  readonly tools: ReadonlySet<Tool>;
151
146
  readonly skills: Readonly<Record<string, {
@@ -172,6 +167,7 @@ declare function plan(spec: ProjectSpec, owned?: ReadonlyMap<string, string>): O
172
167
 
173
168
  declare const LOCK_FILE = "pmcp.lock";
174
169
  interface ProjectResult {
170
+ readonly backup?: string;
175
171
  /** 0 done or clean, 2 check found problems, 3 refused to overwrite. */
176
172
  readonly code: 0 | 2 | 3;
177
173
  readonly problems: readonly string[];
@@ -195,7 +191,7 @@ interface RunResult {
195
191
  readonly status: number | null;
196
192
  readonly stdout: string;
197
193
  }
198
- type Runner = (command: string, args: readonly string[], cwd: string) => RunResult;
194
+ type Runner = (command: string, args: readonly string[], cwd: string, env?: Readonly<Record<string, string | undefined>>) => RunResult;
199
195
  type Status = "ok" | "fail" | "skip";
200
196
  interface Finding$1 {
201
197
  readonly tool: Tool | "project";
@@ -204,6 +200,7 @@ interface Finding$1 {
204
200
  readonly detail?: string;
205
201
  }
206
202
  interface DoctorOptions {
203
+ readonly env?: Readonly<Record<string, string | undefined>>;
207
204
  readonly run: Runner;
208
205
  readonly home: string;
209
206
  readonly only?: ReadonlySet<Tool>;
@@ -285,7 +282,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
285
282
 
286
283
  /** Reported to the host on connect. */
287
284
  declare const SERVER_NAME = "pmcp";
288
- declare const SERVER_VERSION = "0.9.2";
285
+ declare const SERVER_VERSION = "0.11.0";
289
286
  /**
290
287
  * Registers the skill_* tools on a server.
291
288
  *
@@ -294,6 +291,7 @@ declare const SERVER_VERSION = "0.9.2";
294
291
  */
295
292
  declare function registerSkillTools(server: McpServer, tools: SkillTools): McpServer;
296
293
  interface SkillMcpOptions extends SkillServerOptions {
294
+ readonly mailbox?: MailboxService;
297
295
  /** One prompt per skill, for hosts that offer prompts as commands. Off by default. */
298
296
  readonly prompts?: boolean;
299
297
  readonly skillsExtension?: SkillsExtensionOptions;
@@ -337,4 +335,4 @@ declare function registerSkillResources(server: McpServer, skills: () => readonl
337
335
  declare const promptName: (entry: Pick<SkillEntry, "name">) => string;
338
336
  declare function registerSkillPrompts(server: McpServer, tools: SkillTools): void;
339
337
 
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 };
338
+ 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 };