@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,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variable declarations, from the dialects that have them, reconciled with
|
|
3
|
+
* the references the servers make.
|
|
4
|
+
*
|
|
5
|
+
* Cursor declares `variables` as a JSON Schema object with no sensitivity
|
|
6
|
+
* flag, so every Cursor variable is a secret on Stigmer (a token treated as
|
|
7
|
+
* plain text is the costly mistake; a region name treated as a secret is
|
|
8
|
+
* an inconvenience). Claude declares `userConfig` entries with `sensitive`
|
|
9
|
+
* and `required`, plus `default`, `options`, `multiple`, `min`, `max` and
|
|
10
|
+
* the `directory`, `file`, `number`, `boolean` types, none of which a
|
|
11
|
+
* Stigmer variable carries (values are strings supplied by the user, and a
|
|
12
|
+
* local path means nothing in the sandbox); each is warned once.
|
|
13
|
+
*
|
|
14
|
+
* Reconciliation is what makes an imported server start: the runner
|
|
15
|
+
* filters a stdio server's environment to its declared keys and resolves
|
|
16
|
+
* `${VAR}` in headers and arguments strictly, so a variable a server
|
|
17
|
+
* references but no manifest declares would never reach it. Such a variable
|
|
18
|
+
* is declared here as a required secret, with a warning naming the server.
|
|
19
|
+
* A declared variable no server and no hook references is warned too; it
|
|
20
|
+
* is not wrong, only useless. A name the runner fills itself
|
|
21
|
+
* (`PLATFORM_VARIABLES`) is declared as the platform's, optional and no
|
|
22
|
+
* secret, whatever a manifest says of it: no vault holds it, so a required
|
|
23
|
+
* declaration would refuse every run. A hook references a variable through
|
|
24
|
+
* Claude's `${user_config.KEY}` in an exec-form handler (`normalise/hooks.ts`).
|
|
25
|
+
*/
|
|
26
|
+
import { describeValue, fields, isJsonObject, isStringArray } from "../documents.js";
|
|
27
|
+
import { PLATFORM_VARIABLES, VARIABLE_NAME_PATTERN } from "../placeholders.js";
|
|
28
|
+
export function normaliseVariables(set, servers, hookReferences, findings) {
|
|
29
|
+
const declared = new Map();
|
|
30
|
+
const declaredIn = new Map();
|
|
31
|
+
for (const manifest of set.manifests) {
|
|
32
|
+
const declaration = manifest.variables;
|
|
33
|
+
if (declaration === undefined)
|
|
34
|
+
continue;
|
|
35
|
+
const variables = declaration.dialect === "cursor"
|
|
36
|
+
? readCursorVariables(declaration.value, declaration.manifest, findings)
|
|
37
|
+
: readClaudeVariables(declaration.value, declaration.manifest, findings);
|
|
38
|
+
for (const variable of variables) {
|
|
39
|
+
// Two manifests declaring one name: the identity manifest's wins.
|
|
40
|
+
if (declared.has(variable.name))
|
|
41
|
+
continue;
|
|
42
|
+
declared.set(variable.name, variable);
|
|
43
|
+
declaredIn.set(variable.name, declaration.manifest);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const referencedBy = new Map();
|
|
47
|
+
for (const server of servers.servers) {
|
|
48
|
+
for (const name of server.env) {
|
|
49
|
+
if (!referencedBy.has(name))
|
|
50
|
+
referencedBy.set(name, server.name);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// A refused server's references are unknown, so an "unreferenced"
|
|
54
|
+
// warning would be a consequence of the refusal, not advice.
|
|
55
|
+
if (servers.refused === 0) {
|
|
56
|
+
for (const [name, variable] of declared) {
|
|
57
|
+
if (!referencedBy.has(name) && !hookReferences.has(name)) {
|
|
58
|
+
findings.warn("variable-unreferenced", { subject: variable.name, path: declaredIn.get(name) });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const inferred = [];
|
|
63
|
+
for (const [name, server] of [...referencedBy].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))) {
|
|
64
|
+
if (declared.has(name) || PLATFORM_VARIABLES.has(name))
|
|
65
|
+
continue;
|
|
66
|
+
findings.warn("variable-inferred", { subject: name, detail: server });
|
|
67
|
+
inferred.push({ name, isSecret: true, optional: false, declaredBy: "inferred" });
|
|
68
|
+
}
|
|
69
|
+
const platform = [...PLATFORM_VARIABLES]
|
|
70
|
+
.filter((name) => referencedBy.has(name) || hookReferences.has(name) || declared.has(name))
|
|
71
|
+
.map((name) => ({
|
|
72
|
+
name,
|
|
73
|
+
description: declared.get(name)?.description ?? "Filled by Stigmer when the server is called",
|
|
74
|
+
isSecret: false,
|
|
75
|
+
optional: true,
|
|
76
|
+
declaredBy: "platform",
|
|
77
|
+
}));
|
|
78
|
+
for (const variable of platform)
|
|
79
|
+
declared.delete(variable.name);
|
|
80
|
+
return [...declared.values(), ...inferred, ...platform];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Cursor: `{ type: "object", properties: { NAME: { type, title, description } }, required: [NAME] }`.
|
|
84
|
+
*/
|
|
85
|
+
function readCursorVariables(value, manifest, findings) {
|
|
86
|
+
if (!isJsonObject(value) || value["type"] !== "object") {
|
|
87
|
+
findings.error("manifest-field-type", { path: manifest, subject: "variables", detail: "a JSON Schema object with type 'object'" });
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
const properties = value["properties"] ?? {};
|
|
91
|
+
if (!isJsonObject(properties)) {
|
|
92
|
+
findings.error("manifest-field-type", { path: manifest, subject: "variables.properties", detail: "an object" });
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const required = value["required"] ?? [];
|
|
96
|
+
if (!isStringArray(required)) {
|
|
97
|
+
findings.error("manifest-field-type", { path: manifest, subject: "variables.required", detail: "an array of strings" });
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
const variables = [];
|
|
101
|
+
for (const [name, schema] of fields(properties)) {
|
|
102
|
+
if (!VARIABLE_NAME_PATTERN.test(name)) {
|
|
103
|
+
findings.error("variable-name-invalid", { subject: name, path: manifest });
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const property = isJsonObject(schema) ? schema : {};
|
|
107
|
+
const type = property["type"];
|
|
108
|
+
if (type !== undefined && type !== "string") {
|
|
109
|
+
findings.warn("variable-type-narrowed", { subject: name, path: manifest, detail: describeValue(type) });
|
|
110
|
+
}
|
|
111
|
+
if (property["default"] !== undefined)
|
|
112
|
+
findings.warn("variable-default-dropped", { subject: name, path: manifest });
|
|
113
|
+
if (property["enum"] !== undefined)
|
|
114
|
+
findings.warn("variable-option-dropped", { subject: name, path: manifest, detail: "enum" });
|
|
115
|
+
const description = describe(property);
|
|
116
|
+
variables.push({
|
|
117
|
+
name,
|
|
118
|
+
...(description !== undefined && { description }),
|
|
119
|
+
isSecret: true,
|
|
120
|
+
optional: !required.includes(name),
|
|
121
|
+
declaredBy: "cursor",
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return variables;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Claude: `{ KEY: { type, title, description, sensitive, required, default, options, multiple, min, max } }`.
|
|
128
|
+
*/
|
|
129
|
+
function readClaudeVariables(value, manifest, findings) {
|
|
130
|
+
if (!isJsonObject(value)) {
|
|
131
|
+
findings.error("manifest-field-type", { path: manifest, subject: "userConfig", detail: "an object" });
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
const variables = [];
|
|
135
|
+
for (const [name, entry] of fields(value)) {
|
|
136
|
+
if (!VARIABLE_NAME_PATTERN.test(name)) {
|
|
137
|
+
findings.error("variable-name-invalid", { subject: name, path: manifest });
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (!isJsonObject(entry)) {
|
|
141
|
+
findings.error("manifest-field-type", { path: manifest, subject: `userConfig.${name}`, detail: "an object" });
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
const type = entry["type"];
|
|
145
|
+
if (type !== undefined && type !== "string") {
|
|
146
|
+
findings.warn("variable-type-narrowed", { subject: name, path: manifest, detail: describeValue(type) });
|
|
147
|
+
}
|
|
148
|
+
if (entry["default"] !== undefined)
|
|
149
|
+
findings.warn("variable-default-dropped", { subject: name, path: manifest });
|
|
150
|
+
for (const option of ["options", "multiple", "min", "max"]) {
|
|
151
|
+
if (entry[option] !== undefined)
|
|
152
|
+
findings.warn("variable-option-dropped", { subject: name, path: manifest, detail: option });
|
|
153
|
+
}
|
|
154
|
+
const description = describe(entry);
|
|
155
|
+
variables.push({
|
|
156
|
+
name,
|
|
157
|
+
...(description !== undefined && { description }),
|
|
158
|
+
isSecret: entry["sensitive"] === true,
|
|
159
|
+
optional: entry["required"] !== true,
|
|
160
|
+
declaredBy: "claude",
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return variables;
|
|
164
|
+
}
|
|
165
|
+
/** `title` and `description` joined, whichever are present. */
|
|
166
|
+
function describe(entry) {
|
|
167
|
+
const parts = [entry["title"], entry["description"]].filter((part) => typeof part === "string" && part !== "");
|
|
168
|
+
return parts.length === 0 ? undefined : parts.join(": ");
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variables.js","sourceRoot":"","sources":["../src/normalise/variables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAmB,MAAM,iBAAiB,CAAC;AAEtG,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI/E,MAAM,UAAU,kBAAkB,CAChC,GAAgB,EAChB,OAAyB,EACzB,cAAmC,EACnC,QAAkB;IAElB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IACnD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC7C,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC;QACvC,IAAI,WAAW,KAAK,SAAS;YAAE,SAAS;QACx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AAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC"}
|
package/outcome.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The outcome of reading a package and the closed vocabulary of findings.
|
|
3
|
+
*
|
|
4
|
+
* The shape is the server's `ConnectRunOutcome`: a discriminated union on
|
|
5
|
+
* `ok`, with a closed `kind` union behind the failure arm, so a consumer
|
|
6
|
+
* switches on kinds and the compiler closes the switch. An error refuses the
|
|
7
|
+
* package; a warning never does. Both are `PluginFinding`s with the same
|
|
8
|
+
* fields, so one renderer prints both.
|
|
9
|
+
*
|
|
10
|
+
* Two error postures meet here and the header of each module states which
|
|
11
|
+
* applies. Where the open format tells a client to skip a broken component
|
|
12
|
+
* and keep loading, Stigmer refuses the package: an installed agent that
|
|
13
|
+
* quietly lacks a server or a sub-agent is worse than a refused install.
|
|
14
|
+
* But the reader keeps scanning past a fatal finding so one run reports
|
|
15
|
+
* every problem and an author fixes them in one pass.
|
|
16
|
+
*
|
|
17
|
+
* Every kind has exactly one sentence, in `messages.ts`, and the adversarial
|
|
18
|
+
* suite has exactly one fixture per kind. Adding a kind means adding both.
|
|
19
|
+
*/
|
|
20
|
+
import type { PluginPackage } from "./types.js";
|
|
21
|
+
export type PluginErrorKind = "no-manifest" | "manifest-unreadable" | "manifest-schema-missing" | "manifest-schema-unsupported" | "manifest-name-missing" | "manifest-name-invalid" | "manifest-name-conflict" | "manifest-field-type" | "path-not-relative" | "path-escapes-root" | "path-glob-unsupported" | "path-uncontained" | "document-too-large" | "skill-frontmatter-missing" | "skill-frontmatter-unclosed" | "skill-frontmatter-unreadable" | "skill-name-invalid" | "skill-name-duplicate" | "mcp-config-unreadable" | "mcp-config-shape" | "mcp-config-schema-missing" | "mcp-config-schema-unsupported" | "mcp-config-field-unknown" | "mcp-server-shape" | "mcp-server-type-missing" | "mcp-server-transport-unknown" | "mcp-server-type-ambiguous" | "mcp-server-type-unknown" | "mcp-server-field-unknown" | "mcp-server-field-type" | "mcp-server-url-missing" | "mcp-server-url-invalid" | "mcp-server-url-variable" | "mcp-server-command-missing" | "mcp-server-command-invalid" | "mcp-server-command-relative" | "mcp-server-plugin-root-reference" | "mcp-server-cwd-unsupported" | "mcp-server-env-literal" | "mcp-server-env-rename" | "mcp-server-name-duplicate" | "mcp-server-header-duplicate" | "mcp-server-header-invalid" | "sub-agent-frontmatter-unreadable" | "sub-agent-instructions-short" | "sub-agent-name-duplicate" | "sub-agent-tool-list-invalid" | "hooks-unreadable" | "hooks-shape" | "hook-command-missing" | "hook-matcher-invalid" | "hook-condition-invalid" | "settings-unreadable" | "variable-name-invalid";
|
|
22
|
+
export type PluginWarningKind = "manifest-field-unknown" | "manifest-extensions-invalid" | "path-missing" | "skill-name-defaulted" | "skill-name-differs-from-directory" | "skill-description-missing" | "mcp-config-field-ignored" | "mcp-server-sse-mapped" | "mcp-server-field-ignored" | "mcp-server-auth-ignored" | "variable-inferred" | "variable-unreferenced" | "variable-default-dropped" | "variable-type-narrowed" | "variable-option-dropped" | "sub-agent-name-defaulted" | "sub-agent-skill-unknown" | "sub-agent-model-unknown" | "sub-agent-field-ignored" | "hook-event-not-run" | "hook-handler-not-run" | "hook-field-ignored" | "hooks-format-not-run" | "skill-hooks-not-run" | "hooks-not-read" | "settings-agent-unknown" | "settings-key-ignored" | "stigmer-folder-ignored";
|
|
23
|
+
/**
|
|
24
|
+
* The warnings that name hooks Stigmer does not run, so a surface can list
|
|
25
|
+
* them beside the hooks that do run rather than among every other finding.
|
|
26
|
+
* `hook-field-ignored` is not one: its hook runs, with one field unread.
|
|
27
|
+
*/
|
|
28
|
+
export declare const HOOK_WARNING_KINDS: ReadonlySet<PluginWarningKind>;
|
|
29
|
+
export type PluginFindingKind = PluginErrorKind | PluginWarningKind;
|
|
30
|
+
/**
|
|
31
|
+
* One finding over any closed kind vocabulary. The plugin reader and the
|
|
32
|
+
* marketplace reader (`marketplace/`) each own a vocabulary and a sentence
|
|
33
|
+
* table; the shape of a finding, and the renderer that prints one, are
|
|
34
|
+
* shared through this type.
|
|
35
|
+
*/
|
|
36
|
+
export interface Finding<K extends string> {
|
|
37
|
+
readonly kind: K;
|
|
38
|
+
/** The file, or the declared path, the finding is about. */
|
|
39
|
+
readonly path?: string;
|
|
40
|
+
/** The skill, server, sub-agent, variable, entry or field the finding names. */
|
|
41
|
+
readonly subject?: string;
|
|
42
|
+
/** A second identifier the sentence needs (a field name, a parser's own message). */
|
|
43
|
+
readonly detail?: string;
|
|
44
|
+
/** The one sentence for this kind, from the vocabulary's `messages.ts`. */
|
|
45
|
+
readonly message: string;
|
|
46
|
+
}
|
|
47
|
+
export type PluginFinding = Finding<PluginFindingKind>;
|
|
48
|
+
/** What a reader needs to compose a finding: everything but the sentence. */
|
|
49
|
+
export type FindingContext = Pick<Finding<string>, "path" | "subject" | "detail">;
|
|
50
|
+
export type PluginReadOutcome = {
|
|
51
|
+
readonly ok: true;
|
|
52
|
+
readonly plugin: PluginPackage;
|
|
53
|
+
readonly warnings: readonly PluginFinding[];
|
|
54
|
+
} | {
|
|
55
|
+
readonly ok: false;
|
|
56
|
+
readonly errors: readonly PluginFinding[];
|
|
57
|
+
readonly warnings: readonly PluginFinding[];
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=outcome.d.ts.map
|
package/outcome.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["src/outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,MAAM,eAAe,GAEvB,aAAa,GACb,qBAAqB,GACrB,yBAAyB,GACzB,6BAA6B,GAC7B,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,GAErB,mBAAmB,GACnB,mBAAmB,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BAAiB,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM;IACvC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEvD,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,CAAC;AAElF,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,GAClG;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,CAAC"}
|
package/outcome.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The outcome of reading a package and the closed vocabulary of findings.
|
|
3
|
+
*
|
|
4
|
+
* The shape is the server's `ConnectRunOutcome`: a discriminated union on
|
|
5
|
+
* `ok`, with a closed `kind` union behind the failure arm, so a consumer
|
|
6
|
+
* switches on kinds and the compiler closes the switch. An error refuses the
|
|
7
|
+
* package; a warning never does. Both are `PluginFinding`s with the same
|
|
8
|
+
* fields, so one renderer prints both.
|
|
9
|
+
*
|
|
10
|
+
* Two error postures meet here and the header of each module states which
|
|
11
|
+
* applies. Where the open format tells a client to skip a broken component
|
|
12
|
+
* and keep loading, Stigmer refuses the package: an installed agent that
|
|
13
|
+
* quietly lacks a server or a sub-agent is worse than a refused install.
|
|
14
|
+
* But the reader keeps scanning past a fatal finding so one run reports
|
|
15
|
+
* every problem and an author fixes them in one pass.
|
|
16
|
+
*
|
|
17
|
+
* Every kind has exactly one sentence, in `messages.ts`, and the adversarial
|
|
18
|
+
* suite has exactly one fixture per kind. Adding a kind means adding both.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The warnings that name hooks Stigmer does not run, so a surface can list
|
|
22
|
+
* them beside the hooks that do run rather than among every other finding.
|
|
23
|
+
* `hook-field-ignored` is not one: its hook runs, with one field unread.
|
|
24
|
+
*/
|
|
25
|
+
export const HOOK_WARNING_KINDS = new Set([
|
|
26
|
+
"hook-event-not-run",
|
|
27
|
+
"hook-handler-not-run",
|
|
28
|
+
"hooks-format-not-run",
|
|
29
|
+
"skill-hooks-not-run",
|
|
30
|
+
"hooks-not-read",
|
|
31
|
+
]);
|
|
32
|
+
//# sourceMappingURL=outcome.js.map
|
package/outcome.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.js","sourceRoot":"","sources":["src/outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAmC,IAAI,GAAG,CAAoB;IAC3F,oBAAoB;IACpB,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,gBAAgB;CACjB,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stigmer/plugin-package",
|
|
3
|
+
"version": "0.1.0-dev.20261017020314.g644422724c27",
|
|
4
|
+
"description": "Reads an Agent Plugins package — the open 1.0.0 format and the Cursor, Claude Code and Codex dialects — into one normalised description of what Stigmer would install, refusing with one sentence per problem what Stigmer cannot carry; pure over an in-memory file reader, shared by the CLI's offline validation and the server's install. The ./client entry is what every installing client does identically: file selection, the deterministic archive and its digest, the marketplace grammars",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/stigmer/stigmer.git",
|
|
11
|
+
"directory": "backend/libs/ts/plugin-package"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": "^22.13.0 || >=23.4.0"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"stigmer",
|
|
18
|
+
"agent-plugins",
|
|
19
|
+
"plugin",
|
|
20
|
+
"skills",
|
|
21
|
+
"mcp"
|
|
22
|
+
],
|
|
23
|
+
"main": "./index.js",
|
|
24
|
+
"types": "./index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
|
+
"import": "./index.js",
|
|
29
|
+
"default": "./index.js"
|
|
30
|
+
},
|
|
31
|
+
"./client": {
|
|
32
|
+
"types": "./client.d.ts",
|
|
33
|
+
"import": "./client.js",
|
|
34
|
+
"default": "./client.js"
|
|
35
|
+
},
|
|
36
|
+
"./testing": {
|
|
37
|
+
"types": "./testing.d.ts",
|
|
38
|
+
"import": "./testing.js",
|
|
39
|
+
"default": "./testing.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@stigmer/eval-runtime": "0.1.0-dev.20261017020314.g644422724c27",
|
|
44
|
+
"fflate": "^0.8.3",
|
|
45
|
+
"yaml": "^2.8.2"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `${VAR}` vocabulary: what counts as a variable reference, what counts
|
|
3
|
+
* as a reference to the plugin's own files, and the Claude rewrite.
|
|
4
|
+
*
|
|
5
|
+
* `PLACEHOLDER_PATTERN` is the runner's own scanner, verbatim: the runner
|
|
6
|
+
* resolves `${VAR}` strictly in a server's headers and arguments and refuses
|
|
7
|
+
* to start a server with an unresolved one, so this is the definition of "a
|
|
8
|
+
* reference" in every dialect, including the open format whose text forbids
|
|
9
|
+
* expansion in headers. A plugin's `${API_KEY}` in a header means "the
|
|
10
|
+
* caller's API_KEY" on Stigmer whichever tool wrote it.
|
|
11
|
+
*
|
|
12
|
+
* Claude's `${user_config.KEY}` carries a dot the runner's scanner would
|
|
13
|
+
* never match, so it is rewritten to `${KEY}` before anything reads it; the
|
|
14
|
+
* rewrite is what makes a Claude plugin's server start, not a courtesy.
|
|
15
|
+
*
|
|
16
|
+
* The plugin-root placeholders are the one class the library refuses: the
|
|
17
|
+
* runner mounts nothing from a plugin, so a server that reaches for
|
|
18
|
+
* `${PLUGIN_ROOT}` (any dialect's spelling) can never find what it points
|
|
19
|
+
* at. The set is checked before the generic scan because `${PLUGIN_ROOT}`
|
|
20
|
+
* also matches the generic pattern.
|
|
21
|
+
*/
|
|
22
|
+
/** The runner's `${VAR_NAME}` scanner (`shared/placeholder-resolver.ts`). */
|
|
23
|
+
export declare const PLACEHOLDER_PATTERN: RegExp;
|
|
24
|
+
/** A variable name the runner's scanner can reference. */
|
|
25
|
+
export declare const VARIABLE_NAME_PATTERN: RegExp;
|
|
26
|
+
/**
|
|
27
|
+
* The names the runner fills itself for a server that references them: who
|
|
28
|
+
* is calling (a kind and a value), the conversation it calls from, and the
|
|
29
|
+
* Stigmer server's address. A plugin references them in a header or an
|
|
30
|
+
* argument; it never declares them, so each is declared here as an
|
|
31
|
+
* optional, non-secret variable the platform supplies. The address alone
|
|
32
|
+
* may also be saved by a person, and a saved one wins over the fill.
|
|
33
|
+
* The runner keeps the same names (`shared/platform-variables.ts`), and a
|
|
34
|
+
* runner test holds the two lists equal.
|
|
35
|
+
*/
|
|
36
|
+
export declare const PLATFORM_VARIABLES: ReadonlySet<string>;
|
|
37
|
+
/**
|
|
38
|
+
* The platform variables the runner always fills, over anything a run
|
|
39
|
+
* planned: who is calling and the conversation. They are no requirement,
|
|
40
|
+
* so no vault value is read for them and no person is asked for them. The
|
|
41
|
+
* Stigmer server's address is the one platform variable a person may set:
|
|
42
|
+
* a value saved for it wins, and the runner fills it only when nothing is
|
|
43
|
+
* (stigmer/stigmer#1446), so it stays the optional key it is declared.
|
|
44
|
+
* The server's run planning and the console's reading of what a run needs
|
|
45
|
+
* both skip these names, from this one set.
|
|
46
|
+
*/
|
|
47
|
+
export declare const RUNNER_FILLED_VARIABLES: ReadonlySet<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Every spelling of "the plugin's own directory" across the dialects:
|
|
50
|
+
* the open format's, Claude Code's (plus its project directory), Cursor's.
|
|
51
|
+
*/
|
|
52
|
+
export declare const PLUGIN_ROOT_PLACEHOLDERS: ReadonlySet<string>;
|
|
53
|
+
/** The reserved environment names the open format forbids a server's `env` to set. */
|
|
54
|
+
export declare const PLUGIN_ROOT_ENV_NAMES: ReadonlySet<string>;
|
|
55
|
+
/** `${user_config.KEY}` -> `${KEY}`. */
|
|
56
|
+
export declare function rewriteUserConfig(value: string): string;
|
|
57
|
+
/** The `KEY`s of every `${user_config.KEY}` in `value`, in order of appearance. */
|
|
58
|
+
export declare function userConfigReferences(value: string): readonly string[];
|
|
59
|
+
/** The first plugin-root placeholder in `value`, or `undefined`. */
|
|
60
|
+
export declare function findPluginRootPlaceholder(value: string): string | undefined;
|
|
61
|
+
/** The variable names referenced in `value`, in order of appearance, deduplicated. */
|
|
62
|
+
export declare function referencedVariables(value: string): readonly string[];
|
|
63
|
+
/** The variable name when `value` is exactly one placeholder and nothing else; otherwise `undefined`. */
|
|
64
|
+
export declare function singlePlaceholderName(value: string): string | undefined;
|
|
65
|
+
//# sourceMappingURL=placeholders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholders.d.ts","sourceRoot":"","sources":["src/placeholders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,QAAoC,CAAC;AAErE,0DAA0D;AAC1D,eAAO,MAAM,qBAAqB,QAA6B,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAKjD,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAEvD,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,MAAM,CAOvD,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAA2C,CAAC;AAElG,wCAAwC;AACxC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAErE;AAED,oEAAoE;AACpE,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3E;AAED,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAOpE;AAED,yGAAyG;AACzG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE"}
|
package/placeholders.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `${VAR}` vocabulary: what counts as a variable reference, what counts
|
|
3
|
+
* as a reference to the plugin's own files, and the Claude rewrite.
|
|
4
|
+
*
|
|
5
|
+
* `PLACEHOLDER_PATTERN` is the runner's own scanner, verbatim: the runner
|
|
6
|
+
* resolves `${VAR}` strictly in a server's headers and arguments and refuses
|
|
7
|
+
* to start a server with an unresolved one, so this is the definition of "a
|
|
8
|
+
* reference" in every dialect, including the open format whose text forbids
|
|
9
|
+
* expansion in headers. A plugin's `${API_KEY}` in a header means "the
|
|
10
|
+
* caller's API_KEY" on Stigmer whichever tool wrote it.
|
|
11
|
+
*
|
|
12
|
+
* Claude's `${user_config.KEY}` carries a dot the runner's scanner would
|
|
13
|
+
* never match, so it is rewritten to `${KEY}` before anything reads it; the
|
|
14
|
+
* rewrite is what makes a Claude plugin's server start, not a courtesy.
|
|
15
|
+
*
|
|
16
|
+
* The plugin-root placeholders are the one class the library refuses: the
|
|
17
|
+
* runner mounts nothing from a plugin, so a server that reaches for
|
|
18
|
+
* `${PLUGIN_ROOT}` (any dialect's spelling) can never find what it points
|
|
19
|
+
* at. The set is checked before the generic scan because `${PLUGIN_ROOT}`
|
|
20
|
+
* also matches the generic pattern.
|
|
21
|
+
*/
|
|
22
|
+
/** The runner's `${VAR_NAME}` scanner (`shared/placeholder-resolver.ts`). */
|
|
23
|
+
export const PLACEHOLDER_PATTERN = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
24
|
+
/** A variable name the runner's scanner can reference. */
|
|
25
|
+
export const VARIABLE_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
26
|
+
/**
|
|
27
|
+
* The names the runner fills itself for a server that references them: who
|
|
28
|
+
* is calling (a kind and a value), the conversation it calls from, and the
|
|
29
|
+
* Stigmer server's address. A plugin references them in a header or an
|
|
30
|
+
* argument; it never declares them, so each is declared here as an
|
|
31
|
+
* optional, non-secret variable the platform supplies. The address alone
|
|
32
|
+
* may also be saved by a person, and a saved one wins over the fill.
|
|
33
|
+
* The runner keeps the same names (`shared/platform-variables.ts`), and a
|
|
34
|
+
* runner test holds the two lists equal.
|
|
35
|
+
*/
|
|
36
|
+
export const PLATFORM_VARIABLES = new Set([
|
|
37
|
+
"STIGMER_CALLER_IDENTITY_KIND",
|
|
38
|
+
"STIGMER_CALLER_IDENTITY_VALUE",
|
|
39
|
+
"STIGMER_SESSION_ID",
|
|
40
|
+
"STIGMER_SERVER_ADDRESS",
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* The platform variables the runner always fills, over anything a run
|
|
44
|
+
* planned: who is calling and the conversation. They are no requirement,
|
|
45
|
+
* so no vault value is read for them and no person is asked for them. The
|
|
46
|
+
* Stigmer server's address is the one platform variable a person may set:
|
|
47
|
+
* a value saved for it wins, and the runner fills it only when nothing is
|
|
48
|
+
* (stigmer/stigmer#1446), so it stays the optional key it is declared.
|
|
49
|
+
* The server's run planning and the console's reading of what a run needs
|
|
50
|
+
* both skip these names, from this one set.
|
|
51
|
+
*/
|
|
52
|
+
export const RUNNER_FILLED_VARIABLES = new Set([...PLATFORM_VARIABLES].filter((name) => name !== "STIGMER_SERVER_ADDRESS"));
|
|
53
|
+
const USER_CONFIG_PATTERN = /\$\{user_config\.([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
54
|
+
/**
|
|
55
|
+
* Every spelling of "the plugin's own directory" across the dialects:
|
|
56
|
+
* the open format's, Claude Code's (plus its project directory), Cursor's.
|
|
57
|
+
*/
|
|
58
|
+
export const PLUGIN_ROOT_PLACEHOLDERS = new Set([
|
|
59
|
+
"${PLUGIN_ROOT}",
|
|
60
|
+
"${PLUGIN_DATA}",
|
|
61
|
+
"${CLAUDE_PLUGIN_ROOT}",
|
|
62
|
+
"${CLAUDE_PLUGIN_DATA}",
|
|
63
|
+
"${CLAUDE_PROJECT_DIR}",
|
|
64
|
+
"${CURSOR_PLUGIN_ROOT}",
|
|
65
|
+
]);
|
|
66
|
+
/** The reserved environment names the open format forbids a server's `env` to set. */
|
|
67
|
+
export const PLUGIN_ROOT_ENV_NAMES = new Set(["PLUGIN_ROOT", "PLUGIN_DATA"]);
|
|
68
|
+
/** `${user_config.KEY}` -> `${KEY}`. */
|
|
69
|
+
export function rewriteUserConfig(value) {
|
|
70
|
+
return value.replace(USER_CONFIG_PATTERN, (_match, key) => `\${${key}}`);
|
|
71
|
+
}
|
|
72
|
+
/** The `KEY`s of every `${user_config.KEY}` in `value`, in order of appearance. */
|
|
73
|
+
export function userConfigReferences(value) {
|
|
74
|
+
return [...value.matchAll(USER_CONFIG_PATTERN)].map((match) => match[1]).filter((name) => name !== undefined);
|
|
75
|
+
}
|
|
76
|
+
/** The first plugin-root placeholder in `value`, or `undefined`. */
|
|
77
|
+
export function findPluginRootPlaceholder(value) {
|
|
78
|
+
for (const placeholder of PLUGIN_ROOT_PLACEHOLDERS) {
|
|
79
|
+
if (value.includes(placeholder))
|
|
80
|
+
return placeholder;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
/** The variable names referenced in `value`, in order of appearance, deduplicated. */
|
|
85
|
+
export function referencedVariables(value) {
|
|
86
|
+
const names = [];
|
|
87
|
+
for (const match of value.matchAll(PLACEHOLDER_PATTERN)) {
|
|
88
|
+
const name = match[1];
|
|
89
|
+
if (name !== undefined && !names.includes(name))
|
|
90
|
+
names.push(name);
|
|
91
|
+
}
|
|
92
|
+
return names;
|
|
93
|
+
}
|
|
94
|
+
/** The variable name when `value` is exactly one placeholder and nothing else; otherwise `undefined`. */
|
|
95
|
+
export function singlePlaceholderName(value) {
|
|
96
|
+
const match = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(value);
|
|
97
|
+
return match?.[1];
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=placeholders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholders.js","sourceRoot":"","sources":["src/placeholders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,iCAAiC,CAAC;AAErE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,qBAAqB,GAA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rD,KAAK,MAAM,WAAW,IAAI,wBAAwB,EAAE,CAAC;QACnD,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,WAAW,CAAC;IACtD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7D,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a storefront shows for a plugin before anyone installs it: a display
|
|
3
|
+
* name, a logo, an author, a version, a description, a category.
|
|
4
|
+
*
|
|
5
|
+
* This is a read apart from `readPluginPackage` on purpose. The full read
|
|
6
|
+
* decides what Stigmer INSTALLS and refuses what it cannot; a card must
|
|
7
|
+
* render for every entry a catalogue lists, refused or not, and must cost
|
|
8
|
+
* one manifest, not the plugin's whole tree. So this reader opens only the
|
|
9
|
+
* manifests present, takes what they say about appearance, and never
|
|
10
|
+
* reports a finding: an unreadable manifest contributes nothing, a wrong
|
|
11
|
+
* type is treated as absent, and the caller draws a fallback face.
|
|
12
|
+
*
|
|
13
|
+
* Which manifest speaks is the full reader's rule (`MANIFEST_PRECEDENCE`:
|
|
14
|
+
* the root manifest, then Claude, Cursor, Codex), so a plugin shipping two
|
|
15
|
+
* dialects is named the same way on a card and in an install. Identity
|
|
16
|
+
* fields (`name`, `version`, `description`, `author`) come from the first
|
|
17
|
+
* manifest that carries each; the presentation fields come from the
|
|
18
|
+
* dialects that define them: Cursor's top-level `displayName`, `logo` and
|
|
19
|
+
* `category`; the legacy Codex manifest's `interface.displayName`,
|
|
20
|
+
* `interface.logo` and `interface.category`; the open format's
|
|
21
|
+
* `extensions["ai.stigmer"]` with the same three names, the one place that
|
|
22
|
+
* format leaves a client for them (Stigmer's authored catalogue plugins are
|
|
23
|
+
* its first users). Claude Code's manifest defines none.
|
|
24
|
+
*
|
|
25
|
+
* A logo is a path inside the plugin, and the card that shows it fetches it
|
|
26
|
+
* by URL from wherever the tree lives. So the path is kept only when it is
|
|
27
|
+
* contained, names an image by extension, is LISTED in the tree, and its
|
|
28
|
+
* declared size is under `PLUGIN_DOCUMENT_LIMITS.logo`; the library's rule
|
|
29
|
+
* that a cap is checked from declared sizes before a byte moves holds here
|
|
30
|
+
* too. Both spellings the vendors use (`assets/logo.png`, `./assets/logo.png`)
|
|
31
|
+
* are accepted, as the marketplace reader accepts both for a source.
|
|
32
|
+
*
|
|
33
|
+
* `logo` stays an ignored component in the full read: nothing in an
|
|
34
|
+
* Organization carries the image after an install, and the preview's "Not
|
|
35
|
+
* installed" line is true until the stored plugin does.
|
|
36
|
+
*/
|
|
37
|
+
import { type PluginFiles } from "./files.js";
|
|
38
|
+
import type { PluginAuthor } from "./types.js";
|
|
39
|
+
/** What a card shows for a plugin; every field optional, because every dialect may omit it. */
|
|
40
|
+
export interface PluginPresentation {
|
|
41
|
+
/** The name for people (`Thermos`); the install name stays `name`. */
|
|
42
|
+
readonly displayName?: string;
|
|
43
|
+
/** A plugin-relative path to an image the tree lists, verified as described in the module header. */
|
|
44
|
+
readonly logo?: string;
|
|
45
|
+
readonly author?: PluginAuthor;
|
|
46
|
+
readonly version?: string;
|
|
47
|
+
readonly description?: string;
|
|
48
|
+
/** The catalogue's own grouping word (`developer-tools`, `Productivity`), as written. */
|
|
49
|
+
readonly category?: string;
|
|
50
|
+
}
|
|
51
|
+
/** The appearance fields of every manifest present, merged in precedence order. */
|
|
52
|
+
export declare function readPluginPresentation(files: PluginFiles): PluginPresentation;
|
|
53
|
+
//# sourceMappingURL=presentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["src/presentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,OAAO,EAAwE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAGpH,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAE9D,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,qGAAqG;IACrG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAKD,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB,CAc7E"}
|