@stigmer/plugin-package 0.1.0-dev.20261017020314.g644422724c27
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 +194 -0
- package/README.md +72 -0
- package/client/archive.d.ts +27 -0
- package/client/archive.d.ts.map +1 -0
- package/client/archive.js +38 -0
- package/client/archive.js.map +1 -0
- package/client/builtin.d.ts +37 -0
- package/client/builtin.d.ts.map +1 -0
- package/client/builtin.js +49 -0
- package/client/builtin.js.map +1 -0
- package/client/ignore/defaults.d.ts +2 -0
- package/client/ignore/defaults.d.ts.map +1 -0
- package/client/ignore/defaults.js +140 -0
- package/client/ignore/defaults.js.map +1 -0
- package/client/ignore/match.d.ts +3 -0
- package/client/ignore/match.d.ts.map +1 -0
- package/client/ignore/match.js +166 -0
- package/client/ignore/match.js.map +1 -0
- package/client/ignore/matcher.d.ts +50 -0
- package/client/ignore/matcher.d.ts.map +1 -0
- package/client/ignore/matcher.js +116 -0
- package/client/ignore/matcher.js.map +1 -0
- package/client/ignore/pattern.d.ts +13 -0
- package/client/ignore/pattern.d.ts.map +1 -0
- package/client/ignore/pattern.js +119 -0
- package/client/ignore/pattern.js.map +1 -0
- package/client/prepare-eval.d.ts +62 -0
- package/client/prepare-eval.d.ts.map +1 -0
- package/client/prepare-eval.js +60 -0
- package/client/prepare-eval.js.map +1 -0
- package/client/prepare.d.ts +99 -0
- package/client/prepare.d.ts.map +1 -0
- package/client/prepare.js +89 -0
- package/client/prepare.js.map +1 -0
- package/client/presentation.d.ts +19 -0
- package/client/presentation.d.ts.map +1 -0
- package/client/presentation.js +44 -0
- package/client/presentation.js.map +1 -0
- package/client/refs.d.ts +76 -0
- package/client/refs.d.ts.map +1 -0
- package/client/refs.js +123 -0
- package/client/refs.js.map +1 -0
- package/client/release.d.ts +20 -0
- package/client/release.d.ts.map +1 -0
- package/client/release.js +28 -0
- package/client/release.js.map +1 -0
- package/client/reroot.d.ts +21 -0
- package/client/reroot.d.ts.map +1 -0
- package/client/reroot.js +37 -0
- package/client/reroot.js.map +1 -0
- package/client/select.d.ts +74 -0
- package/client/select.d.ts.map +1 -0
- package/client/select.js +121 -0
- package/client/select.js.map +1 -0
- package/client/vocabulary.d.ts +13 -0
- package/client/vocabulary.d.ts.map +1 -0
- package/client/vocabulary.js +17 -0
- package/client/vocabulary.js.map +1 -0
- package/client.d.ts +51 -0
- package/client.d.ts.map +1 -0
- package/client.js +51 -0
- package/client.js.map +1 -0
- package/detect.d.ts +83 -0
- package/detect.d.ts.map +1 -0
- package/detect.js +210 -0
- package/detect.js.map +1 -0
- package/dialects/claude.d.ts +34 -0
- package/dialects/claude.d.ts.map +1 -0
- package/dialects/claude.js +84 -0
- package/dialects/claude.js.map +1 -0
- package/dialects/codex.d.ts +20 -0
- package/dialects/codex.d.ts.map +1 -0
- package/dialects/codex.js +21 -0
- package/dialects/codex.js.map +1 -0
- package/dialects/cursor.d.ts +25 -0
- package/dialects/cursor.d.ts.map +1 -0
- package/dialects/cursor.js +66 -0
- package/dialects/cursor.js.map +1 -0
- package/dialects/manifest.d.ts +164 -0
- package/dialects/manifest.d.ts.map +1 -0
- package/dialects/manifest.js +256 -0
- package/dialects/manifest.js.map +1 -0
- package/dialects/open.d.ts +19 -0
- package/dialects/open.d.ts.map +1 -0
- package/dialects/open.js +49 -0
- package/dialects/open.js.map +1 -0
- package/documents.d.ts +58 -0
- package/documents.d.ts.map +1 -0
- package/documents.js +121 -0
- package/documents.js.map +1 -0
- package/evals/eval-dir.d.ts +59 -0
- package/evals/eval-dir.d.ts.map +1 -0
- package/evals/eval-dir.js +84 -0
- package/evals/eval-dir.js.map +1 -0
- package/evals/fields.d.ts +78 -0
- package/evals/fields.d.ts.map +1 -0
- package/evals/fields.js +156 -0
- package/evals/fields.js.map +1 -0
- package/evals/glob.d.ts +40 -0
- package/evals/glob.d.ts.map +1 -0
- package/evals/glob.js +146 -0
- package/evals/glob.js.map +1 -0
- package/evals/graders.d.ts +52 -0
- package/evals/graders.d.ts.map +1 -0
- package/evals/graders.js +279 -0
- package/evals/graders.js.map +1 -0
- package/evals/markdown.d.ts +24 -0
- package/evals/markdown.d.ts.map +1 -0
- package/evals/markdown.js +48 -0
- package/evals/markdown.js.map +1 -0
- package/evals/mocks.d.ts +50 -0
- package/evals/mocks.d.ts.map +1 -0
- package/evals/mocks.js +182 -0
- package/evals/mocks.js.map +1 -0
- package/evals/read-eval-suite.d.ts +110 -0
- package/evals/read-eval-suite.d.ts.map +1 -0
- package/evals/read-eval-suite.js +603 -0
- package/evals/read-eval-suite.js.map +1 -0
- package/evals/summary.d.ts +61 -0
- package/evals/summary.d.ts.map +1 -0
- package/evals/summary.js +69 -0
- package/evals/summary.js.map +1 -0
- package/evals/types.d.ts +203 -0
- package/evals/types.d.ts.map +1 -0
- package/evals/types.js +21 -0
- package/evals/types.js.map +1 -0
- package/files.d.ts +135 -0
- package/files.d.ts.map +1 -0
- package/files.js +209 -0
- package/files.js.map +1 -0
- package/frontmatter.d.ts +51 -0
- package/frontmatter.d.ts.map +1 -0
- package/frontmatter.js +61 -0
- package/frontmatter.js.map +1 -0
- package/index.d.ts +37 -0
- package/index.d.ts.map +1 -0
- package/index.js +33 -0
- package/index.js.map +1 -0
- package/marketplace/messages.d.ts +20 -0
- package/marketplace/messages.d.ts.map +1 -0
- package/marketplace/messages.js +49 -0
- package/marketplace/messages.js.map +1 -0
- package/marketplace/outcome.d.ts +70 -0
- package/marketplace/outcome.d.ts.map +1 -0
- package/marketplace/outcome.js +29 -0
- package/marketplace/outcome.js.map +1 -0
- package/marketplace/read-marketplace.d.ts +52 -0
- package/marketplace/read-marketplace.d.ts.map +1 -0
- package/marketplace/read-marketplace.js +351 -0
- package/marketplace/read-marketplace.js.map +1 -0
- package/messages.d.ts +55 -0
- package/messages.d.ts.map +1 -0
- package/messages.js +167 -0
- package/messages.js.map +1 -0
- package/normalise/hooks.d.ts +91 -0
- package/normalise/hooks.d.ts.map +1 -0
- package/normalise/hooks.js +437 -0
- package/normalise/hooks.js.map +1 -0
- package/normalise/ignored.d.ts +34 -0
- package/normalise/ignored.d.ts.map +1 -0
- package/normalise/ignored.js +78 -0
- package/normalise/ignored.js.map +1 -0
- package/normalise/mcp-servers.d.ts +50 -0
- package/normalise/mcp-servers.d.ts.map +1 -0
- package/normalise/mcp-servers.js +398 -0
- package/normalise/mcp-servers.js.map +1 -0
- package/normalise/settings.d.ts +32 -0
- package/normalise/settings.d.ts.map +1 -0
- package/normalise/settings.js +72 -0
- package/normalise/settings.js.map +1 -0
- package/normalise/skills.d.ts +39 -0
- package/normalise/skills.d.ts.map +1 -0
- package/normalise/skills.js +135 -0
- package/normalise/skills.js.map +1 -0
- package/normalise/stigmer-folder.d.ts +17 -0
- package/normalise/stigmer-folder.d.ts.map +1 -0
- package/normalise/stigmer-folder.js +19 -0
- package/normalise/stigmer-folder.js.map +1 -0
- package/normalise/sub-agents.d.ts +54 -0
- package/normalise/sub-agents.d.ts.map +1 -0
- package/normalise/sub-agents.js +219 -0
- package/normalise/sub-agents.js.map +1 -0
- package/normalise/variables.d.ts +31 -0
- package/normalise/variables.d.ts.map +1 -0
- package/normalise/variables.js +170 -0
- package/normalise/variables.js.map +1 -0
- package/outcome.d.ts +59 -0
- package/outcome.d.ts.map +1 -0
- package/outcome.js +32 -0
- package/outcome.js.map +1 -0
- package/package.json +47 -0
- package/placeholders.d.ts +65 -0
- package/placeholders.d.ts.map +1 -0
- package/placeholders.js +99 -0
- package/placeholders.js.map +1 -0
- package/presentation.d.ts +53 -0
- package/presentation.d.ts.map +1 -0
- package/presentation.js +156 -0
- package/presentation.js.map +1 -0
- package/read-plugin-package.d.ts +20 -0
- package/read-plugin-package.d.ts.map +1 -0
- package/read-plugin-package.js +73 -0
- package/read-plugin-package.js.map +1 -0
- package/src/client/archive.ts +44 -0
- package/src/client/builtin.ts +60 -0
- package/src/client/ignore/defaults.ts +155 -0
- package/src/client/ignore/match.ts +158 -0
- package/src/client/ignore/matcher.ts +156 -0
- package/src/client/ignore/pattern.ts +132 -0
- package/src/client/prepare-eval.ts +92 -0
- package/src/client/prepare.ts +160 -0
- package/src/client/presentation.ts +47 -0
- package/src/client/refs.ts +170 -0
- package/src/client/release.ts +29 -0
- package/src/client/reroot.ts +35 -0
- package/src/client/select.ts +161 -0
- package/src/client/vocabulary.ts +19 -0
- package/src/client.ts +102 -0
- package/src/detect.ts +245 -0
- package/src/dialects/claude.ts +102 -0
- package/src/dialects/codex.ts +26 -0
- package/src/dialects/cursor.ts +77 -0
- package/src/dialects/manifest.ts +316 -0
- package/src/dialects/open.ts +50 -0
- package/src/documents.ts +158 -0
- package/src/evals/eval-dir.ts +101 -0
- package/src/evals/fields.ts +184 -0
- package/src/evals/glob.ts +141 -0
- package/src/evals/graders.ts +293 -0
- package/src/evals/markdown.ts +56 -0
- package/src/evals/mocks.ts +202 -0
- package/src/evals/read-eval-suite.ts +713 -0
- package/src/evals/summary.ts +100 -0
- package/src/evals/types.ts +217 -0
- package/src/files.ts +235 -0
- package/src/frontmatter.ts +70 -0
- package/src/index.ts +129 -0
- package/src/marketplace/messages.ts +61 -0
- package/src/marketplace/outcome.ts +91 -0
- package/src/marketplace/read-marketplace.ts +388 -0
- package/src/messages.ts +248 -0
- package/src/normalise/hooks.ts +469 -0
- package/src/normalise/ignored.ts +79 -0
- package/src/normalise/mcp-servers.ts +423 -0
- package/src/normalise/settings.ts +81 -0
- package/src/normalise/skills.ts +145 -0
- package/src/normalise/stigmer-folder.ts +23 -0
- package/src/normalise/sub-agents.ts +231 -0
- package/src/normalise/variables.ts +181 -0
- package/src/outcome.ts +158 -0
- package/src/placeholders.ts +110 -0
- package/src/presentation.ts +170 -0
- package/src/read-plugin-package.ts +80 -0
- package/src/testing.ts +347 -0
- package/src/tool-names.ts +30 -0
- package/src/trim.ts +10 -0
- package/src/types.ts +214 -0
- package/testing.d.ts +127 -0
- package/testing.d.ts.map +1 -0
- package/testing.js +266 -0
- package/testing.js.map +1 -0
- package/tool-names.d.ts +21 -0
- package/tool-names.d.ts.map +1 -0
- package/tool-names.js +28 -0
- package/tool-names.js.map +1 -0
- package/trim.d.ts +7 -0
- package/trim.d.ts.map +1 -0
- package/trim.js +12 -0
- package/trim.js.map +1 -0
- package/types.d.ts +179 -0
- package/types.d.ts.map +1 -0
- package/types.js +19 -0
- package/types.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-names.d.ts","sourceRoot":"","sources":["src/tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
package/tool-names.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The name a plugin's MCP server gives its tools, as Claude Code builds it:
|
|
3
|
+
* `mcp__plugin_<plugin>_<server>__<tool>`, with every character outside
|
|
4
|
+
* `A-Za-z0-9_-` in either name written as `_`. The server segment is built
|
|
5
|
+
* from the two names, never parsed back, because either name may hold `_`.
|
|
6
|
+
* The installer refuses a plugin whose segment would hold `__` or end in
|
|
7
|
+
* `_`, and the runner names each plugin server by this segment (its own
|
|
8
|
+
* copy, `shared/plugin-servers.ts`, held equal by a runner test), so an
|
|
9
|
+
* agent's tool list written for Claude Code scopes the same tools here.
|
|
10
|
+
*/
|
|
11
|
+
function claudeNamePart(name) {
|
|
12
|
+
return name.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
13
|
+
}
|
|
14
|
+
/** `plugin_<plugin>_<server>`: the server part of a plugin tool's name. */
|
|
15
|
+
export function toolServerSegment(pluginName, serverName) {
|
|
16
|
+
return `plugin_${claudeNamePart(pluginName)}_${claudeNamePart(serverName)}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whether `name` can stand as a server segment of a tool name as it is:
|
|
20
|
+
* only `A-Za-z0-9_-`, with no `__` (the separator between a tool name's
|
|
21
|
+
* parts) and no trailing `_` (which would run into it). A pushed eval's
|
|
22
|
+
* mock directory names an agent's MCP server this way, so a name that
|
|
23
|
+
* fails could never match one.
|
|
24
|
+
*/
|
|
25
|
+
export function isToolNameSegment(name) {
|
|
26
|
+
return /^[A-Za-z0-9_-]+$/.test(name) && !name.includes("__") && !name.endsWith("_");
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=tool-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-names.js","sourceRoot":"","sources":["src/tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,iBAAiB,CAAC,UAAkB,EAAE,UAAkB;IACtE,OAAO,UAAU,cAAc,CAAC,UAAU,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACtF,CAAC"}
|
package/trim.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `value` without its trailing run of `char`. A `/x+$/` regex rescans the run
|
|
3
|
+
* from every starting position, so a long run costs quadratic time; this walks
|
|
4
|
+
* it once.
|
|
5
|
+
*/
|
|
6
|
+
export declare function trimTrailing(value: string, char: string): string;
|
|
7
|
+
//# sourceMappingURL=trim.d.ts.map
|
package/trim.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["src/trim.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAIhE"}
|
package/trim.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `value` without its trailing run of `char`. A `/x+$/` regex rescans the run
|
|
3
|
+
* from every starting position, so a long run costs quadratic time; this walks
|
|
4
|
+
* it once.
|
|
5
|
+
*/
|
|
6
|
+
export function trimTrailing(value, char) {
|
|
7
|
+
let end = value.length;
|
|
8
|
+
while (end > 0 && value[end - 1] === char)
|
|
9
|
+
end -= 1;
|
|
10
|
+
return end === value.length ? value : value.slice(0, end);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=trim.js.map
|
package/trim.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.js","sourceRoot":"","sources":["src/trim.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,IAAY;IACtD,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,OAAO,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;QAAE,GAAG,IAAI,CAAC,CAAC;IACpD,OAAO,GAAG,KAAK,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC"}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The normalised description of a plugin: what Stigmer would install from a
|
|
3
|
+
* package, whatever dialect the package was written in.
|
|
4
|
+
*
|
|
5
|
+
* These are the library's own plain types, deliberately not the protos. The
|
|
6
|
+
* library describes the plugin FORMAT; the server maps this description onto
|
|
7
|
+
* the plugin's status when it installs, and the CLI validates offline
|
|
8
|
+
* without pulling the resource schemas in for a parse. Field names still
|
|
9
|
+
* mirror the protos (`PluginAgent.name/description/instructions`,
|
|
10
|
+
* `EnvVarDeclaration.is_secret/description/optional`, the
|
|
11
|
+
* `McpServerEntry` `stdio`/`http` variants) so the server's mapping is one
|
|
12
|
+
* function per part and a proto rename is a visible edit here.
|
|
13
|
+
*
|
|
14
|
+
* Every path in this description is plugin-relative, POSIX, with no leading
|
|
15
|
+
* `./`: one path vocabulary for the whole package, whichever reader produced
|
|
16
|
+
* the files.
|
|
17
|
+
*/
|
|
18
|
+
/** The manifest that gave the plugin its identity. */
|
|
19
|
+
export type PluginDialect = "agent-plugins" | "claude" | "cursor" | "codex";
|
|
20
|
+
export interface PluginAuthor {
|
|
21
|
+
readonly name?: string;
|
|
22
|
+
readonly email?: string;
|
|
23
|
+
readonly url?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One skill: a directory holding `SKILL.md`. `files` lists every file under
|
|
27
|
+
* `dir` (plugin-relative), so a reader can find the skill's files
|
|
28
|
+
* without walking the package again; `SKILL.md` is among them. For a plugin
|
|
29
|
+
* that IS a single skill (a root `SKILL.md`, the Claude Code layout) `dir` is
|
|
30
|
+
* the empty string and `files` is the whole package.
|
|
31
|
+
*/
|
|
32
|
+
export interface PluginSkill {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
readonly dir: string;
|
|
36
|
+
readonly files: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* One MCP server in the shape `McpServerEntry` takes. `env` is the list of
|
|
40
|
+
* variable NAMES the server references (in headers, arguments or its stdio
|
|
41
|
+
* environment), which is what `McpServerEntry.env` names; values never
|
|
42
|
+
* appear anywhere in this library.
|
|
43
|
+
*/
|
|
44
|
+
export type PluginMcpServer = {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly transport: "http";
|
|
47
|
+
readonly url: string;
|
|
48
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
49
|
+
readonly env: readonly string[];
|
|
50
|
+
} | {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
readonly transport: "stdio";
|
|
53
|
+
readonly command: string;
|
|
54
|
+
readonly args: readonly string[];
|
|
55
|
+
readonly env: readonly string[];
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* A dialect's `model` value, kept as written (`raw`) and classified into an
|
|
59
|
+
* alias. The library never names a Stigmer model id: whether `raw` is a
|
|
60
|
+
* model the conversation's engine lists is the turn's question, so the
|
|
61
|
+
* server stores `raw` as written and the alias decides only the warnings.
|
|
62
|
+
* `inherit` and an absent `model` both mean "no override"; `unknown`
|
|
63
|
+
* carries the raw text for the library's warning.
|
|
64
|
+
*/
|
|
65
|
+
export type ModelAlias = "fast" | "sonnet" | "opus" | "haiku" | "inherit" | "unknown";
|
|
66
|
+
export interface ModelHint {
|
|
67
|
+
readonly raw: string;
|
|
68
|
+
readonly alias: ModelAlias;
|
|
69
|
+
}
|
|
70
|
+
/** One agent file (`agents/*.md`) in the shape `PluginAgent` takes. */
|
|
71
|
+
export interface PluginSubAgent {
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly description?: string;
|
|
74
|
+
readonly instructions: string;
|
|
75
|
+
/** Plugin skill names this agent asked for (Claude `skills:`), checked against the plugin's skills by the installer. */
|
|
76
|
+
readonly skillNames: readonly string[];
|
|
77
|
+
readonly modelHint?: ModelHint;
|
|
78
|
+
/**
|
|
79
|
+
* Claude's "only these tools" list (`tools:`), entries as written. Absent
|
|
80
|
+
* means no list; an empty list is kept apart from absence so the installer
|
|
81
|
+
* can tell "no list" from a list it emptied.
|
|
82
|
+
*/
|
|
83
|
+
readonly tools?: readonly string[];
|
|
84
|
+
/** Claude's "never these tools" list (`disallowedTools:`), entries as written. */
|
|
85
|
+
readonly disallowedTools?: readonly string[];
|
|
86
|
+
/** The agent file, for messages that point at it. */
|
|
87
|
+
readonly path: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The hook format a plugin's hooks are written in, which decides the JSON a
|
|
91
|
+
* hook reads and how its answer is parsed (`HookFormat`). Codex plugin hooks
|
|
92
|
+
* are written in Claude Code's format.
|
|
93
|
+
*/
|
|
94
|
+
export type HookFormat = "claude-code" | "cursor";
|
|
95
|
+
/** One command a hook runs, in the shape `HookHandler` takes. */
|
|
96
|
+
export interface PluginHookHandler {
|
|
97
|
+
/** As written; placeholders such as `${CLAUDE_PLUGIN_ROOT}` are kept verbatim. */
|
|
98
|
+
readonly command: string;
|
|
99
|
+
/** Claude's exec form; when non-empty the command runs without a shell. */
|
|
100
|
+
readonly args: readonly string[];
|
|
101
|
+
/** Seconds, rounded up; absent means the format's default. */
|
|
102
|
+
readonly timeoutSeconds?: number;
|
|
103
|
+
/** Claude's `if`, a permission rule such as `Bash(git push *)`. */
|
|
104
|
+
readonly condition?: string;
|
|
105
|
+
/** Cursor's `failClosed`. */
|
|
106
|
+
readonly failClosed: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** One event, its matcher as written, and the handlers that run, in the shape `HookGroup` takes. */
|
|
109
|
+
export interface PluginHookGroup {
|
|
110
|
+
/** Spelled as the format spells it (`PreToolUse`, `beforeShellExecution`). */
|
|
111
|
+
readonly event: string;
|
|
112
|
+
/** As written; empty or `*` matches every call. */
|
|
113
|
+
readonly matcher: string;
|
|
114
|
+
readonly handlers: readonly PluginHookHandler[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The plugin's tool-call hooks Stigmer reads, in the shape `HookConfig` takes.
|
|
118
|
+
* Only events and handlers Stigmer runs are here; everything else the
|
|
119
|
+
* plugin's hooks files carry is named in the read's warnings.
|
|
120
|
+
*/
|
|
121
|
+
export interface PluginHooks {
|
|
122
|
+
readonly format: HookFormat;
|
|
123
|
+
readonly groups: readonly PluginHookGroup[];
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* One variable in the shape `EnvVarDeclaration` takes. `declaredBy` says
|
|
127
|
+
* where the declaration came from: a Cursor `variables` schema, a Claude
|
|
128
|
+
* `userConfig` entry, inference from an undeclared `${VAR}` reference,
|
|
129
|
+
* which the library declares as a required secret because the runner hands a
|
|
130
|
+
* server only the variables its spec declares, or the platform, for a name
|
|
131
|
+
* the runner fills itself (`PLATFORM_VARIABLES`).
|
|
132
|
+
*/
|
|
133
|
+
export interface PluginVariable {
|
|
134
|
+
readonly name: string;
|
|
135
|
+
readonly description?: string;
|
|
136
|
+
readonly isSecret: boolean;
|
|
137
|
+
readonly optional: boolean;
|
|
138
|
+
readonly declaredBy: "cursor" | "claude" | "inferred" | "platform";
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The component kinds Stigmer reads past without carrying. Recorded once per
|
|
142
|
+
* component (a directory, a file or a manifest field), never per file, so
|
|
143
|
+
* an author sees "hooks/ is not installed" once.
|
|
144
|
+
*/
|
|
145
|
+
export type IgnoredComponentKind = "agents" | "apps" | "assets" | "bin" | "canvases" | "channels" | "commands" | "default-enabled" | "dependencies" | "extension" | "logo" | "lsp-servers" | "min-client-versions" | "monitors" | "output-styles" | "rules" | "settings" | "themes" | "workflows";
|
|
146
|
+
export interface IgnoredComponent {
|
|
147
|
+
readonly kind: IgnoredComponentKind;
|
|
148
|
+
/** The directory, file, or `<manifest path>#<field>` the component came from. */
|
|
149
|
+
readonly path: string;
|
|
150
|
+
}
|
|
151
|
+
/** What Stigmer would install from the package. */
|
|
152
|
+
export interface PluginPackage {
|
|
153
|
+
readonly name: string;
|
|
154
|
+
/** As written; Semantic Versioning is recommended by the format, not enforced. */
|
|
155
|
+
readonly version?: string;
|
|
156
|
+
readonly description?: string;
|
|
157
|
+
readonly author?: PluginAuthor;
|
|
158
|
+
readonly homepage?: string;
|
|
159
|
+
readonly repository?: string;
|
|
160
|
+
readonly license?: string;
|
|
161
|
+
readonly keywords: readonly string[];
|
|
162
|
+
readonly dialect: PluginDialect;
|
|
163
|
+
/** Every manifest the reader consulted, identity first. */
|
|
164
|
+
readonly manifestsFound: readonly string[];
|
|
165
|
+
readonly skills: readonly PluginSkill[];
|
|
166
|
+
readonly mcpServers: readonly PluginMcpServer[];
|
|
167
|
+
readonly subAgents: readonly PluginSubAgent[];
|
|
168
|
+
readonly variables: readonly PluginVariable[];
|
|
169
|
+
/** The tool-call hooks Stigmer reads; absent when the plugin carries none. */
|
|
170
|
+
readonly hooks?: PluginHooks;
|
|
171
|
+
/**
|
|
172
|
+
* The sub-agent a Claude plugin's settings (`settings.json` or the
|
|
173
|
+
* manifest's `settings`) name as the session's main agent, by its name in
|
|
174
|
+
* `subAgents`; absent when none is named.
|
|
175
|
+
*/
|
|
176
|
+
readonly mainAgent?: string;
|
|
177
|
+
readonly ignored: readonly IgnoredComponent[];
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=types.d.ts.map
|
package/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,sDAAsD;AACtD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KA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C9C,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C"}
|
package/types.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The normalised description of a plugin: what Stigmer would install from a
|
|
3
|
+
* package, whatever dialect the package was written in.
|
|
4
|
+
*
|
|
5
|
+
* These are the library's own plain types, deliberately not the protos. The
|
|
6
|
+
* library describes the plugin FORMAT; the server maps this description onto
|
|
7
|
+
* the plugin's status when it installs, and the CLI validates offline
|
|
8
|
+
* without pulling the resource schemas in for a parse. Field names still
|
|
9
|
+
* mirror the protos (`PluginAgent.name/description/instructions`,
|
|
10
|
+
* `EnvVarDeclaration.is_secret/description/optional`, the
|
|
11
|
+
* `McpServerEntry` `stdio`/`http` variants) so the server's mapping is one
|
|
12
|
+
* function per part and a proto rename is a visible edit here.
|
|
13
|
+
*
|
|
14
|
+
* Every path in this description is plugin-relative, POSIX, with no leading
|
|
15
|
+
* `./`: one path vocabulary for the whole package, whichever reader produced
|
|
16
|
+
* the files.
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=types.js.map
|
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|