@frontmcp/plugin-skilled-openapi 0.0.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.
- package/LICENSE +201 -0
- package/README.md +40 -0
- package/esm/index.mjs +1536 -0
- package/esm/package.json +60 -0
- package/executor/credential-resolver.d.ts +49 -0
- package/executor/credential-resolver.d.ts.map +1 -0
- package/executor/openapi-runtime.d.ts +33 -0
- package/executor/openapi-runtime.d.ts.map +1 -0
- package/executor/schema-cache.d.ts +30 -0
- package/executor/schema-cache.d.ts.map +1 -0
- package/executor/ssrf-guard.d.ts +16 -0
- package/executor/ssrf-guard.d.ts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +1524 -0
- package/package.json +60 -0
- package/registry/hidden-op.registry.d.ts +52 -0
- package/registry/hidden-op.registry.d.ts.map +1 -0
- package/security/authority-guard.d.ts +34 -0
- package/security/authority-guard.d.ts.map +1 -0
- package/skilled-openapi.plugin.d.ts +24 -0
- package/skilled-openapi.plugin.d.ts.map +1 -0
- package/skilled-openapi.symbols.d.ts +25 -0
- package/skilled-openapi.symbols.d.ts.map +1 -0
- package/skilled-openapi.types.d.ts +189 -0
- package/skilled-openapi.types.d.ts.map +1 -0
- package/sync/bundle-sync.service.d.ts +87 -0
- package/sync/bundle-sync.service.d.ts.map +1 -0
- package/tools/execute-action.schema.d.ts +26 -0
- package/tools/execute-action.schema.d.ts.map +1 -0
- package/tools/execute-action.tool.d.ts +6 -0
- package/tools/execute-action.tool.d.ts.map +1 -0
- package/tools/load-skill.schema.d.ts +46 -0
- package/tools/load-skill.schema.d.ts.map +1 -0
- package/tools/load-skill.tool.d.ts +6 -0
- package/tools/load-skill.tool.d.ts.map +1 -0
- package/tools/operation-tool.factory.d.ts +60 -0
- package/tools/operation-tool.factory.d.ts.map +1 -0
- package/tools/search-skill.schema.d.ts +30 -0
- package/tools/search-skill.schema.d.ts.map +1 -0
- package/tools/search-skill.tool.d.ts +6 -0
- package/tools/search-skill.tool.d.ts.map +1 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type FrontMcpLogger, type ProviderRegistry, type ToolRegistry } from '@frontmcp/sdk';
|
|
2
|
+
import { type HiddenOpEntry } from '../registry/hidden-op.registry';
|
|
3
|
+
/**
|
|
4
|
+
* Compute the registered tool name for an OpenAPI operation.
|
|
5
|
+
* Format: `<bundleId>.<operationId>` — bundle-namespaced so multiple bundles
|
|
6
|
+
* can register operations with overlapping operationIds without collision.
|
|
7
|
+
*/
|
|
8
|
+
export declare function operationToolName(bundleId: string, operationId: string): string;
|
|
9
|
+
export interface OperationToolFactoryDeps {
|
|
10
|
+
/** Tool registry to register/unregister synthetic operation tools. */
|
|
11
|
+
toolRegistry: ToolRegistry;
|
|
12
|
+
/** Provider registry to bind synthesized ToolInstances to. */
|
|
13
|
+
providers: ProviderRegistry;
|
|
14
|
+
/** Logger for diagnostics. */
|
|
15
|
+
logger: FrontMcpLogger;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Stable result envelope produced by every operation executor. Mirrors the
|
|
19
|
+
* shape returned by `execute_action.tool.ts` so call-site code (via
|
|
20
|
+
* `callTool`) can branch on `ok` uniformly regardless of which surface the
|
|
21
|
+
* operation was reached through.
|
|
22
|
+
*/
|
|
23
|
+
export interface OperationToolResult {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
status: number;
|
|
26
|
+
data?: unknown;
|
|
27
|
+
contentType?: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Manages the lifecycle of synthetic per-operation internal tools for one
|
|
32
|
+
* Skilled OpenAPI plugin instance.
|
|
33
|
+
*/
|
|
34
|
+
export declare class OperationToolFactory {
|
|
35
|
+
private readonly deps;
|
|
36
|
+
/** Map (bundleId|opId) → the executor function that doubles as registry token. */
|
|
37
|
+
private registered;
|
|
38
|
+
constructor(deps: OperationToolFactoryDeps);
|
|
39
|
+
/**
|
|
40
|
+
* Register one operation as an internal tool. Idempotent — calling twice
|
|
41
|
+
* with the same `(bundleId, operationId)` is a no-op (the existing
|
|
42
|
+
* registration is left in place).
|
|
43
|
+
*/
|
|
44
|
+
register(entry: HiddenOpEntry): void;
|
|
45
|
+
/**
|
|
46
|
+
* Unregister every tool this factory has registered. Used on bundle swap
|
|
47
|
+
* before re-registering the new bundle's operations.
|
|
48
|
+
*/
|
|
49
|
+
unregisterAll(): void;
|
|
50
|
+
/** Number of currently-registered internal operation tools (test/audit hook). */
|
|
51
|
+
get size(): number;
|
|
52
|
+
/**
|
|
53
|
+
* Build the actual function executor for one op. Mirrors `ExecuteActionTool.execute`:
|
|
54
|
+
* authority check + input validation + `executeOperation` — so callers
|
|
55
|
+
* reaching the op via `callTool` get the same security gates as callers
|
|
56
|
+
* going through `execute_action`.
|
|
57
|
+
*/
|
|
58
|
+
private makeExecutor;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=operation-tool.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-tool.factory.d.ts","sourceRoot":"","sources":["../../src/tools/operation-tool.factory.ts"],"names":[],"mappings":"AAcA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAWpE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAS/E;AA2BD,MAAM,WAAW,wBAAwB;IACvC,sEAAsE;IACtE,YAAY,EAAE,YAAY,CAAC;IAC3B,8DAA8D;IAC9D,SAAS,EAAE,gBAAgB,CAAC;IAC5B,8BAA8B;IAC9B,MAAM,EAAE,cAAc,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAUD;;;GAGG;AACH,qBAAa,oBAAoB;IAInB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHjC,kFAAkF;IAClF,OAAO,CAAC,UAAU,CAAwC;gBAE7B,IAAI,EAAE,wBAAwB;IAE3D;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAiBpC;;;OAGG;IACH,aAAa,IAAI,IAAI;IAYrB,iFAAiF;IACjF,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;OAKG;IACH,OAAO,CAAC,YAAY;CA4ErB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const searchSkillDescription = "Search the available skills by free-form query.\n\nA \"skill\" is a curated bundle of REST operations exposed to you behind a single\nnamed capability \u2014 instead of seeing each individual API endpoint, you see one\nskill that knows how to do something useful (e.g. \"billing\", \"customers\"). Use\nthis tool first to discover what skills exist for the user's request, then call\n`load_skill` to read its instructions + the actions it offers, and `execute_action`\nto actually invoke one.\n\nINPUT:\n- query: short natural-language description of what you want to do\n- limit?: max results (default 20, max 50)\n- tags?: filter to skills carrying these tags\n\nOUTPUT: { skills: Array<{ skillId, name, description, score }> }";
|
|
2
|
+
export declare const searchSkillInputSchema: {
|
|
3
|
+
query: import("@frontmcp/lazy-zod").ZodString;
|
|
4
|
+
limit: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
5
|
+
tags: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const searchSkillOutputSchema: {
|
|
8
|
+
skills: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
9
|
+
skillId: import("@frontmcp/lazy-zod").ZodString;
|
|
10
|
+
name: import("@frontmcp/lazy-zod").ZodString;
|
|
11
|
+
description: import("@frontmcp/lazy-zod").ZodString;
|
|
12
|
+
score: import("@frontmcp/lazy-zod").ZodNumber;
|
|
13
|
+
bundleVersion: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
14
|
+
}, import("zod/v4/core").$strip>>;
|
|
15
|
+
};
|
|
16
|
+
export type SearchSkillInput = {
|
|
17
|
+
query: string;
|
|
18
|
+
limit?: number;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
};
|
|
21
|
+
export type SearchSkillOutput = {
|
|
22
|
+
skills: Array<{
|
|
23
|
+
skillId: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
score: number;
|
|
27
|
+
bundleVersion?: string;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=search-skill.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-skill.schema.d.ts","sourceRoot":"","sources":["../../src/tools/search-skill.schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,8tBAc8B,CAAC;AAElE,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;CAUnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,KAAK,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ToolContext } from '@frontmcp/sdk';
|
|
2
|
+
import { type SearchSkillInput, type SearchSkillOutput } from './search-skill.schema';
|
|
3
|
+
export default class SearchSkillTool extends ToolContext {
|
|
4
|
+
execute(input: SearchSkillInput): Promise<SearchSkillOutput>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=search-skill.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-skill.tool.d.ts","sourceRoot":"","sources":["../../src/tools/search-skill.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAY/B,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IAChD,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA6BnE"}
|