@plurnk/plurnk-execs 0.4.13 → 0.4.14
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/SPEC.md +1 -1
- package/dist/discover.d.ts.map +1 -1
- package/dist/discover.js +18 -2
- package/dist/discover.js.map +1 -1
- package/package.json +1 -1
package/SPEC.md
CHANGED
|
@@ -114,7 +114,7 @@ A package may claim multiple tags backed by one handler. Tags form a **flat glob
|
|
|
114
114
|
|
|
115
115
|
Each entry's optional **`example`** is a one-line, self-documenting usage example (`EXEC[tag]:body:EXEC`), surfaced verbatim by the consumer in its `# Plurnk System Tools` capability sheet so the model learns the tag's syntax + purpose in one line instead of a separate prose description (plurnk-execs#7). Defaults to `""` when omitted. Kept to a single line on purpose — the sheet is hot-path and token-sensitive; the generic `(target)` slot is documented once at the op level, not repeated per tag.
|
|
116
116
|
|
|
117
|
-
Each entry's optional **`documentation`** is full markdown — the flags, modes, and gotchas the one-liner can't carry. It is the depth a consumer can serve on demand, separate from the always-on `example` (progressive disclosure). Defaults to `""`. The execs contract is the two fields; **how** the consumer surfaces them to the model — an in-context one-liner, the full doc fetched when the model wants it — is the consumer's (plurnk-service's) concern, not specified here.
|
|
117
|
+
Each entry's optional **`documentation`** is full markdown — the flags, modes, and gotchas the one-liner can't carry. It is the depth a consumer can serve on demand, separate from the always-on `example` (progressive disclosure). The **source of truth is a `docs/<tag>.md` file** in the package (the docs convention; ship it via `files`), which `discover()` reads into `documentation`; the inline `documentation` manifest field is the fallback when no file ships. Defaults to `""`. The execs contract is the two fields; **how** the consumer surfaces them to the model — an in-context one-liner, the full doc fetched when the model wants it — is the consumer's (plurnk-service's) concern, not specified here.
|
|
118
118
|
|
|
119
119
|
**Trust gate.** `discover()` honors the host's **`PLURNK_PLUGINS_TRUSTED_ONLY`** env var (plurnk-service#229) — the one posture decided once and enforced across every scope-agnostic discovery surface (schemes/mimetypes/providers/execs). Unset/`""`/`0` → off: every installed package registers (no regression). Any value → on: `@plurnk/*` is always trusted, plus a comma-separated allowlist of additionally-trusted package names (`1` = on with zero third-party). An untrusted package is **discovered but not registered** — never a crash — and returned in **`Discovery.skipped`** (package names) so the consumer can emit a telemetry note (`discover()` has no sink of its own). The policy mirrors plurnk-service's `PluginTrust.isTrusted`; it's duplicated, not shared, since it can't cross the package boundary.
|
|
120
120
|
|
package/dist/discover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAY,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAY,MAAM,YAAY,CAAC;AA8BvE,wBAAsB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,SAAS,CAAC,CA0BhF"}
|
package/dist/discover.js
CHANGED
|
@@ -20,7 +20,9 @@ import path from "node:path";
|
|
|
20
20
|
// backed by the same handler (e.g. the search sibling claims `search`, `news`,
|
|
21
21
|
// `images`, …). `example` is a one-line self-documenting usage example
|
|
22
22
|
// (plurnk-execs#7); `documentation` is the fuller markdown a consumer can serve
|
|
23
|
-
// on demand
|
|
23
|
+
// on demand — sourced from a `docs/<tag>.md` file in the package (the docs
|
|
24
|
+
// convention), falling back to the inline `documentation` manifest field.
|
|
25
|
+
// execs carries both; how they reach the model is the consumer's.
|
|
24
26
|
//
|
|
25
27
|
// Tags are a flat global namespace. Unlike plurnk-mimetypes (last-loaded
|
|
26
28
|
// wins), a tag collision here is a FAIL-HARD install error: two packages
|
|
@@ -137,14 +139,28 @@ async function readExecInfos(dir) {
|
|
|
137
139
|
const e = entry;
|
|
138
140
|
if (typeof e.name !== "string" || e.name === "")
|
|
139
141
|
continue;
|
|
142
|
+
// `docs/<tag>.md` is the documentation source of truth (the docs
|
|
143
|
+
// convention); the inline `documentation` field is the fallback.
|
|
144
|
+
const inlineDoc = typeof e.documentation === "string" ? e.documentation : "";
|
|
145
|
+
const documentation = await readDocFile(dir, e.name) ?? inlineDoc;
|
|
140
146
|
infos.push({
|
|
141
147
|
runtime: e.name,
|
|
142
148
|
glyph: typeof e.glyph === "string" ? e.glyph : "",
|
|
143
149
|
example: typeof e.example === "string" ? e.example : "",
|
|
144
|
-
documentation
|
|
150
|
+
documentation,
|
|
145
151
|
packageName,
|
|
146
152
|
});
|
|
147
153
|
}
|
|
148
154
|
return infos;
|
|
149
155
|
}
|
|
156
|
+
// A tag's documentation file under the package's `docs/` folder — the docs
|
|
157
|
+
// convention's source of truth. Returns null when the package ships none.
|
|
158
|
+
async function readDocFile(dir, tag) {
|
|
159
|
+
try {
|
|
160
|
+
return await fs.readFile(path.join(dir, "docs", `${tag}.md`), "utf-8");
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
150
166
|
//# sourceMappingURL=discover.js.map
|
package/dist/discover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,+BAA+B;AAC/B,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,yEAAyE;AACzE,oDAAoD;AACpD,EAAE;AACF,0EAA0E;AAC1E,oEAAoE;AACpE,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,uEAAuE;AACvE,gFAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../src/discover.ts"],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