@pluginfinity/core 0.2.0 → 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.
- package/index.d.ts +47 -10
- package/index.js +2 -2
- package/package.json +1 -1
- package/target.js +41 -7
- package/version.js +1 -1
package/index.d.ts
CHANGED
|
@@ -494,21 +494,54 @@ export declare const HOOKS_FORMATS: readonly ["claude-hooks-json", "copilot-hook
|
|
|
494
494
|
/** @public */
|
|
495
495
|
export declare const HooksFormat: Schema.Literals<readonly ["claude-hooks-json", "copilot-hooks-v1"]>;
|
|
496
496
|
/**
|
|
497
|
-
* MCP config formats. The engine owns one encoder per format
|
|
497
|
+
* MCP config formats. The engine owns one encoder per format:
|
|
498
|
+
* `claude-mcp-servers` is the bare server map Claude Code reads under a
|
|
499
|
+
* manifest's `mcpServers` key, and `agent-plugins-mcp-1.0` is the Agent
|
|
500
|
+
* Plugins `mcp.json` envelope, `$schema` and an `mcpServers` map.
|
|
498
501
|
*
|
|
499
502
|
* @public
|
|
500
503
|
*/
|
|
501
|
-
export declare const MCP_FORMATS: readonly ["claude-mcp-
|
|
504
|
+
export declare const MCP_FORMATS: readonly ["claude-mcp-servers", "agent-plugins-mcp-1.0"];
|
|
502
505
|
/** @public */
|
|
503
|
-
export declare const McpFormat: Schema.Literals<readonly ["claude-mcp-
|
|
506
|
+
export declare const McpFormat: Schema.Literals<readonly ["claude-mcp-servers", "agent-plugins-mcp-1.0"]>;
|
|
504
507
|
/**
|
|
505
|
-
* LSP config formats. The engine owns one encoder per format
|
|
508
|
+
* LSP config formats. The engine owns one encoder per format:
|
|
509
|
+
* `claude-lsp-servers` is the bare server map Claude Code reads under a
|
|
510
|
+
* manifest's `lspServers` key, and `copilot-lsp-json` is Copilot's
|
|
511
|
+
* `{ "lspServers": … }` file.
|
|
506
512
|
*
|
|
507
513
|
* @public
|
|
508
514
|
*/
|
|
509
|
-
export declare const LSP_FORMATS: readonly ["claude-lsp-
|
|
515
|
+
export declare const LSP_FORMATS: readonly ["claude-lsp-servers", "copilot-lsp-json"];
|
|
510
516
|
/** @public */
|
|
511
|
-
export declare const LspFormat: Schema.Literals<readonly ["claude-lsp-
|
|
517
|
+
export declare const LspFormat: Schema.Literals<readonly ["claude-lsp-servers", "copilot-lsp-json"]>;
|
|
518
|
+
declare const InFile_base: Schema.Class<InFile, Schema.TaggedStruct<"file", {
|
|
519
|
+
readonly path: Schema.String;
|
|
520
|
+
}>, {}>;
|
|
521
|
+
/** Write a target's servers to a file of their own, at a plugin-relative path. @public */
|
|
522
|
+
export declare class InFile extends InFile_base {}
|
|
523
|
+
declare const InManifest_base: Schema.Class<InManifest, Schema.TaggedStruct<"manifest", {
|
|
524
|
+
readonly key: Schema.String;
|
|
525
|
+
readonly reserves: Schema.String;
|
|
526
|
+
}>, {}>;
|
|
527
|
+
/**
|
|
528
|
+
* Write a target's servers inline in its manifest, under a key the manifest's
|
|
529
|
+
* allowlist admits. `reserves` is the plugin-relative file the host also loads
|
|
530
|
+
* servers from by default, such as Claude Code's `.mcp.json`; no file may ship
|
|
531
|
+
* there, since the host would load it beside the inline servers.
|
|
532
|
+
*
|
|
533
|
+
* @public
|
|
534
|
+
*/
|
|
535
|
+
export declare class InManifest extends InManifest_base {}
|
|
536
|
+
/**
|
|
537
|
+
* Where a target writes its MCP or LSP servers: a file of their own, or inline
|
|
538
|
+
* in the manifest.
|
|
539
|
+
*
|
|
540
|
+
* @public
|
|
541
|
+
*/
|
|
542
|
+
export declare const ServerPlacement: Schema.Union<readonly [typeof InFile, typeof InManifest]>;
|
|
543
|
+
/** @public */
|
|
544
|
+
export type ServerPlacement = typeof ServerPlacement.Type;
|
|
512
545
|
declare const Keep_base: Schema.Class<Keep, Schema.TaggedStruct<"keep", {}>, {}>;
|
|
513
546
|
/** Write the field unchanged. @public */
|
|
514
547
|
export declare class Keep extends Keep_base {}
|
|
@@ -623,13 +656,13 @@ declare const Target_base: Schema.Class<Target, Schema.Struct<{
|
|
|
623
656
|
readonly ownEvents: Schema.$Array<Schema.String>;
|
|
624
657
|
}>;
|
|
625
658
|
readonly mcp: Schema.Struct<{
|
|
626
|
-
readonly
|
|
627
|
-
readonly format: Schema.Literals<readonly ["claude-mcp-
|
|
659
|
+
readonly placement: Schema.Union<readonly [typeof InFile, typeof InManifest]>;
|
|
660
|
+
readonly format: Schema.Literals<readonly ["claude-mcp-servers", "agent-plugins-mcp-1.0"]>;
|
|
628
661
|
readonly schema: Schema.optionalKey<Schema.String>;
|
|
629
662
|
}>;
|
|
630
663
|
readonly lsp: Schema.Struct<{
|
|
631
|
-
readonly
|
|
632
|
-
readonly format: Schema.Literals<readonly ["claude-lsp-
|
|
664
|
+
readonly placement: Schema.Union<readonly [typeof InFile, typeof InManifest]>;
|
|
665
|
+
readonly format: Schema.Literals<readonly ["claude-lsp-servers", "copilot-lsp-json"]>;
|
|
633
666
|
readonly fields: Schema.$Record<Schema.String, Schema.Union<readonly [typeof Keep, typeof Rename, typeof Translate, typeof Degrade, typeof Drop, typeof Unresolved]>>;
|
|
634
667
|
}>;
|
|
635
668
|
readonly references: Schema.Struct<{
|
|
@@ -675,6 +708,10 @@ declare const Target_base: Schema.Class<Target, Schema.Struct<{
|
|
|
675
708
|
*/
|
|
676
709
|
export declare class Target extends Target_base {}
|
|
677
710
|
/** @public */
|
|
711
|
+
export declare const inFile: (path: string) => InFile;
|
|
712
|
+
/** @public */
|
|
713
|
+
export declare const inManifest: (key: string, reserves: string) => InManifest;
|
|
714
|
+
/** @public */
|
|
678
715
|
export declare const keep: Keep;
|
|
679
716
|
/** @public */
|
|
680
717
|
export declare const drop: Drop;
|
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { McpServer, McpServers, RemoteMcpServer, ServerEnv, StdioMcpServer } fro
|
|
|
3
3
|
import { LSP_FIELDS, LspServer, LspServers } from "./lsp.js";
|
|
4
4
|
import { BASE_CONFIG_KEYS, BaseConfigFields, PluginName, ScriptInvoke, ShippedPath, makeTargetSetting } from "./config.js";
|
|
5
5
|
import { AGENT_FIELDS, AgentFrontmatter, ComponentName, ComponentTargets, SKILL_FIELDS, SkillFrontmatter } from "./frontmatter.js";
|
|
6
|
-
import { Absent, DEGRADE_FORMS, Degrade, Drop, EventMapping, FieldMapEntry, HOOKS_FORMATS, HooksFormat, Keep, LSP_FORMATS, LspFormat, MANIFEST_FORMATS, MCP_FORMATS, ManifestFormat, McpFormat, Rename, RootSpelling, Target, ToolMapping, Translate, TranslateTable, Unresolved, ValueMapping, absent, degrade, drop, keep, rename, translate, unresolved } from "./target.js";
|
|
6
|
+
import { Absent, DEGRADE_FORMS, Degrade, Drop, EventMapping, FieldMapEntry, HOOKS_FORMATS, HooksFormat, InFile, InManifest, Keep, LSP_FORMATS, LspFormat, MANIFEST_FORMATS, MCP_FORMATS, ManifestFormat, McpFormat, Rename, RootSpelling, ServerPlacement, Target, ToolMapping, Translate, TranslateTable, Unresolved, ValueMapping, absent, degrade, drop, inFile, inManifest, keep, rename, translate, unresolved } from "./target.js";
|
|
7
7
|
import { CORE_VERSION } from "./version.js";
|
|
8
8
|
|
|
9
|
-
export { AGENT_FIELDS, Absent, AgentFrontmatter, BASE_CONFIG_KEYS, BaseConfigFields, CLAUDE_HOOK_EVENTS, CORE_VERSION, ClaudeHookEvent, CommandHook, ComponentName, ComponentTargets, DEGRADE_FORMS, Degrade, Drop, EventMapping, FieldMapEntry, HOOKS_FORMATS, HookEntries, HookEntry, HookFallback, Hooks, HooksFormat, Keep, LSP_FIELDS, LSP_FORMATS, LspFormat, LspServer, LspServers, MANIFEST_FORMATS, MCP_FORMATS, ManifestFormat, McpFormat, McpServer, McpServers, PluginName, RemoteMcpServer, Rename, RootSpelling, SKILL_FIELDS, ScriptHook, ScriptInvoke, ServerEnv, ShippedPath, SkillFrontmatter, StdioMcpServer, Target, ToolMapping, Translate, TranslateTable, Unresolved, ValueMapping, absent, degrade, drop, keep, makeHooks, makeTargetSetting, rename, translate, unresolved };
|
|
9
|
+
export { AGENT_FIELDS, Absent, AgentFrontmatter, BASE_CONFIG_KEYS, BaseConfigFields, CLAUDE_HOOK_EVENTS, CORE_VERSION, ClaudeHookEvent, CommandHook, ComponentName, ComponentTargets, DEGRADE_FORMS, Degrade, Drop, EventMapping, FieldMapEntry, HOOKS_FORMATS, HookEntries, HookEntry, HookFallback, Hooks, HooksFormat, InFile, InManifest, Keep, LSP_FIELDS, LSP_FORMATS, LspFormat, LspServer, LspServers, MANIFEST_FORMATS, MCP_FORMATS, ManifestFormat, McpFormat, McpServer, McpServers, PluginName, RemoteMcpServer, Rename, RootSpelling, SKILL_FIELDS, ScriptHook, ScriptInvoke, ServerEnv, ServerPlacement, ShippedPath, SkillFrontmatter, StdioMcpServer, Target, ToolMapping, Translate, TranslateTable, Unresolved, ValueMapping, absent, degrade, drop, inFile, inManifest, keep, makeHooks, makeTargetSetting, rename, translate, unresolved };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluginfinity/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The pluginfinity domain model: the host-neutral plugin source, the Target capability schema and the pluginfinity config shape. Platform-free.",
|
|
6
6
|
"keywords": [
|
package/target.js
CHANGED
|
@@ -27,22 +27,49 @@ const HOOKS_FORMATS = ["claude-hooks-json", "copilot-hooks-v1"];
|
|
|
27
27
|
/** @public */
|
|
28
28
|
const HooksFormat = Schema.Literals(HOOKS_FORMATS);
|
|
29
29
|
/**
|
|
30
|
-
* MCP config formats. The engine owns one encoder per format
|
|
30
|
+
* MCP config formats. The engine owns one encoder per format:
|
|
31
|
+
* `claude-mcp-servers` is the bare server map Claude Code reads under a
|
|
32
|
+
* manifest's `mcpServers` key, and `agent-plugins-mcp-1.0` is the Agent
|
|
33
|
+
* Plugins `mcp.json` envelope, `$schema` and an `mcpServers` map.
|
|
31
34
|
*
|
|
32
35
|
* @public
|
|
33
36
|
*/
|
|
34
|
-
const MCP_FORMATS = ["claude-mcp-
|
|
37
|
+
const MCP_FORMATS = ["claude-mcp-servers", "agent-plugins-mcp-1.0"];
|
|
35
38
|
/** @public */
|
|
36
39
|
const McpFormat = Schema.Literals(MCP_FORMATS);
|
|
37
40
|
/**
|
|
38
|
-
* LSP config formats. The engine owns one encoder per format
|
|
41
|
+
* LSP config formats. The engine owns one encoder per format:
|
|
42
|
+
* `claude-lsp-servers` is the bare server map Claude Code reads under a
|
|
43
|
+
* manifest's `lspServers` key, and `copilot-lsp-json` is Copilot's
|
|
44
|
+
* `{ "lspServers": … }` file.
|
|
39
45
|
*
|
|
40
46
|
* @public
|
|
41
47
|
*/
|
|
42
|
-
const LSP_FORMATS = ["claude-lsp-
|
|
48
|
+
const LSP_FORMATS = ["claude-lsp-servers", "copilot-lsp-json"];
|
|
43
49
|
/** @public */
|
|
44
50
|
const LspFormat = Schema.Literals(LSP_FORMATS);
|
|
45
51
|
const NonEmpty = Schema.String.check(Schema.isMinLength(1));
|
|
52
|
+
/** Write a target's servers to a file of their own, at a plugin-relative path. @public */
|
|
53
|
+
var InFile = class extends Schema.TaggedClass()("file", { path: NonEmpty }) {};
|
|
54
|
+
/**
|
|
55
|
+
* Write a target's servers inline in its manifest, under a key the manifest's
|
|
56
|
+
* allowlist admits. `reserves` is the plugin-relative file the host also loads
|
|
57
|
+
* servers from by default, such as Claude Code's `.mcp.json`; no file may ship
|
|
58
|
+
* there, since the host would load it beside the inline servers.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
var InManifest = class extends Schema.TaggedClass()("manifest", {
|
|
63
|
+
key: NonEmpty,
|
|
64
|
+
reserves: NonEmpty
|
|
65
|
+
}) {};
|
|
66
|
+
/**
|
|
67
|
+
* Where a target writes its MCP or LSP servers: a file of their own, or inline
|
|
68
|
+
* in the manifest.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
const ServerPlacement = Schema.Union([InFile, InManifest]);
|
|
46
73
|
/** Write the field unchanged. @public */
|
|
47
74
|
var Keep = class extends Schema.TaggedClass()("keep", {}) {};
|
|
48
75
|
/** Write the field under another name. @public */
|
|
@@ -175,12 +202,12 @@ var Target = class extends Schema.Class("Target")({
|
|
|
175
202
|
ownEvents: Schema.Array(Schema.String)
|
|
176
203
|
}),
|
|
177
204
|
mcp: Schema.Struct({
|
|
178
|
-
|
|
205
|
+
placement: ServerPlacement,
|
|
179
206
|
format: McpFormat,
|
|
180
207
|
schema: Schema.optionalKey(Schema.String)
|
|
181
208
|
}),
|
|
182
209
|
lsp: Schema.Struct({
|
|
183
|
-
|
|
210
|
+
placement: ServerPlacement,
|
|
184
211
|
format: LspFormat,
|
|
185
212
|
fields: FieldMap
|
|
186
213
|
}),
|
|
@@ -211,6 +238,13 @@ var Target = class extends Schema.Class("Target")({
|
|
|
211
238
|
efforts: Schema.Record(Schema.String, ValueMapping)
|
|
212
239
|
}) {};
|
|
213
240
|
/** @public */
|
|
241
|
+
const inFile = (path) => InFile.make({ path });
|
|
242
|
+
/** @public */
|
|
243
|
+
const inManifest = (key, reserves) => InManifest.make({
|
|
244
|
+
key,
|
|
245
|
+
reserves
|
|
246
|
+
});
|
|
247
|
+
/** @public */
|
|
214
248
|
const keep = Keep.make({});
|
|
215
249
|
/** @public */
|
|
216
250
|
const drop = Drop.make({});
|
|
@@ -229,4 +263,4 @@ const degrade = (form) => Degrade.make({ form });
|
|
|
229
263
|
const unresolved = (note) => Unresolved.make({ note });
|
|
230
264
|
|
|
231
265
|
//#endregion
|
|
232
|
-
export { Absent, DEGRADE_FORMS, Degrade, DegradeForm, Drop, EventMapping, FieldMapEntry, HOOKS_FORMATS, HooksFormat, Keep, LSP_FORMATS, LspFormat, MANIFEST_FORMATS, MCP_FORMATS, ManifestFormat, McpFormat, Rename, RootSpelling, Target, ToolMapping, Translate, TranslateTable, Unresolved, ValueMapping, absent, degrade, drop, keep, rename, translate, unresolved };
|
|
266
|
+
export { Absent, DEGRADE_FORMS, Degrade, DegradeForm, Drop, EventMapping, FieldMapEntry, HOOKS_FORMATS, HooksFormat, InFile, InManifest, Keep, LSP_FORMATS, LspFormat, MANIFEST_FORMATS, MCP_FORMATS, ManifestFormat, McpFormat, Rename, RootSpelling, ServerPlacement, Target, ToolMapping, Translate, TranslateTable, Unresolved, ValueMapping, absent, degrade, drop, inFile, inManifest, keep, rename, translate, unresolved };
|