@plurnk/plurnk-meta 1.23.0 → 1.25.0
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/README.md +11 -2
- package/SPEC.md +77 -14
- package/dist/AgentPlugin.d.ts +3 -0
- package/dist/AgentPlugin.d.ts.map +1 -0
- package/dist/AgentPlugin.js +3 -0
- package/dist/AgentPlugin.js.map +1 -0
- package/dist/AgentPluginFiles.d.ts +10 -0
- package/dist/AgentPluginFiles.d.ts.map +1 -0
- package/dist/AgentPluginFiles.js +68 -0
- package/dist/AgentPluginFiles.js.map +1 -0
- package/dist/AgentPluginFormat.d.ts +10 -0
- package/dist/AgentPluginFormat.d.ts.map +1 -0
- package/dist/AgentPluginFormat.js +10 -0
- package/dist/AgentPluginFormat.js.map +1 -0
- package/dist/AgentPluginManifest.d.ts +32 -0
- package/dist/AgentPluginManifest.d.ts.map +1 -0
- package/dist/AgentPluginManifest.js +52 -0
- package/dist/AgentPluginManifest.js.map +1 -0
- package/dist/ConfigurationError.d.ts +5 -0
- package/dist/ConfigurationError.d.ts.map +1 -0
- package/dist/ConfigurationError.js +10 -0
- package/dist/ConfigurationError.js.map +1 -0
- package/dist/ErrorDetail.d.ts +1 -1
- package/dist/ErrorDetail.d.ts.map +1 -1
- package/dist/ErrorDetail.js +2 -2
- package/dist/ErrorDetail.js.map +1 -1
- package/dist/Knob.d.ts +8 -6
- package/dist/Knob.d.ts.map +1 -1
- package/dist/Knob.js +20 -19
- package/dist/Knob.js.map +1 -1
- package/dist/ResourceEnvironment.d.ts +17 -0
- package/dist/ResourceEnvironment.d.ts.map +1 -0
- package/dist/ResourceEnvironment.js +54 -0
- package/dist/ResourceEnvironment.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +69 -11
- package/dist/index.js.map +1 -1
- package/docs/worker.md +1 -3
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
What plurnk's packages share that no single package owns: plugin discovery and trust, and the teaching material the service gives models.
|
|
4
4
|
|
|
5
|
-
**Membership primitives** (`import Meta from "@plurnk/plurnk-meta"`):
|
|
5
|
+
**Membership primitives** (`import Meta from "@plurnk/plurnk-meta"`): shared family identity, trust, attribution, enumeration, and root resolution for capability scanners. [SPEC.md](./SPEC.md) owns the complete contract ({§plugin-discovery}).
|
|
6
6
|
|
|
7
7
|
- `Meta.declaresKind(manifest, kind)` — accepts one exact string family identity; arrays claim no family ({§plugin-family-kind}).
|
|
8
8
|
- `Meta.isTrusted(packageName, env?)` — the `PLURNK_PLUGINS_TRUSTED_ONLY` gate: `""`/`"0"` off; any value on, `@plurnk/*` always trusted plus a comma-separated allowlist. An unset key is answered by this package's own panel, which ships the gate on.
|
|
@@ -14,4 +14,13 @@ What plurnk's packages share that no single package owns: plugin discovery and t
|
|
|
14
14
|
|
|
15
15
|
**The teaching corpus**: authored policy, an optional Recap, the Plurnk skill entry, and built-in scheme references resolved from this installed package. Meta owns the source bytes and membership; core owns admission, resource composition, and projection. See [`CORPUS.md`](./CORPUS.md) and {§teaching-corpus}.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Capability-library packages declare one `package.json#plurnk.kind`. Standard Agent Plugin bundles
|
|
18
|
+
instead put that same native declaration under `plugin.json#extensions.ai.plurnk`.
|
|
19
|
+
The capability's loader and lifetime stay unchanged; `kind: "module"` opts into the daemon lifecycle.
|
|
20
|
+
Native families use npm installation, with user plugin-folder loading also available for modules.
|
|
21
|
+
Never declare both. Shared manifest and filesystem
|
|
22
|
+
validation is exported from `@plurnk/plurnk-meta/agent-plugin`; the portable component loader remains
|
|
23
|
+
`@plurnk/plurnk-agent-plugins`. Native imports use the same operator trust gate.
|
|
24
|
+
|
|
25
|
+
An admitted capability package may declare always-on `plurnk.attribution` tags and its loaded object
|
|
26
|
+
may return per-attempt tags from `attributions(context)` ({§plugin-attribution}). MIT.
|
package/SPEC.md
CHANGED
|
@@ -76,8 +76,8 @@ installed capabilities; they never manufacture package existence.
|
|
|
76
76
|
|
|
77
77
|
### §plugin-family-kind One package, one capability family
|
|
78
78
|
|
|
79
|
-
`
|
|
80
|
-
family. A package may declare multiple named capabilities inside its one
|
|
79
|
+
The native declaration's `kind` is one exact string, in either manifest location
|
|
80
|
+
at {§plugin-manifest-read}. Arrays and other shapes claim no family. A package may declare multiple named capabilities inside its one
|
|
81
81
|
family-owned collection.
|
|
82
82
|
|
|
83
83
|
| `plurnk.kind` | Family-owned names |
|
|
@@ -95,15 +95,48 @@ module mechanism.
|
|
|
95
95
|
|
|
96
96
|
### §env-knob One environment reader
|
|
97
97
|
|
|
98
|
-
`Knob` reads a declared key from the system environment
|
|
99
|
-
|
|
98
|
+
`Knob` reads a declared key by name from the system environment, or an explicitly
|
|
99
|
+
supplied assembled environment: `text`, `list`, `flag` (exactly `0` or `1`), `choice` (one of a
|
|
100
100
|
vocabulary), `percent` (`80%` is 0.8) and `integer(name, floor)` (a safe
|
|
101
101
|
integer of at least the floor, which bounds what the operator may say and is
|
|
102
102
|
never a value used in the operator's place). An unset key is a broken floor
|
|
103
|
-
and an
|
|
103
|
+
and remains an internal error. Invalid operator values raise a
|
|
104
|
+
`ConfigurationError` naming the key; the owning capability contains that
|
|
105
|
+
diagnostic without inventing a value ({§configuration-repair-path}).
|
|
106
|
+
The same class is available from `@plurnk/plurnk-meta/configuration-error`
|
|
107
|
+
without loading discovery or observability machinery.
|
|
104
108
|
No reader accepts a fallback: a signature that could carry one is a second
|
|
105
|
-
home for a choice.
|
|
106
|
-
|
|
109
|
+
home for a choice. A supplied environment is authoritative: missing keys do not
|
|
110
|
+
fall through to the process, and reading never mutates either environment.
|
|
111
|
+
Every package reads its knobs through it, so validation and failure wording
|
|
112
|
+
have one home for runtime and offline configuration checks.
|
|
113
|
+
|
|
114
|
+
### §resource-environment Named resource environment projection
|
|
115
|
+
|
|
116
|
+
`ResourceEnvironment` reads one family's assembled environment without loading
|
|
117
|
+
resources or changing configuration. Families declare their supported controls,
|
|
118
|
+
per-resource settings and, when required by their resource standard, an alias
|
|
119
|
+
grammar. Definition parsing and validation remain family-owned.
|
|
120
|
+
|
|
121
|
+
| Form | Meaning |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `PLURNK_<FAMILY>_<alias>=<definition>` | One complete definition. `_` represents `-` in the resource name; validate the decoded name with the family's grammar, otherwise `[a-z][a-z0-9-]*`. |
|
|
124
|
+
| `PLURNK_<FAMILY>_ENABLED=0\|1` | The family default, declared in its owning `.env.defaults`. |
|
|
125
|
+
| `PLURNK_<FAMILY>_<alias>_ENABLED=0\|1` | This resource's independent override; it does not copy or modify the definition. |
|
|
126
|
+
| Other uppercase controls/settings | Accepted only when the family declares them. Definition aliases are never case-folded into controls. |
|
|
127
|
+
|
|
128
|
+
Enabledness uses {§env-knob}. Controls may precede a definition or address resources
|
|
129
|
+
supplied by other sources; they do not manufacture definitions. An unused alias
|
|
130
|
+
is valid. Spelling, supported settings and their values are validated when the
|
|
131
|
+
environment is read, independently of whether a definition exists.
|
|
132
|
+
Definition data remains verbatim for its owning schema; this reader neither merges
|
|
133
|
+
fields nor includes those values in its diagnostics. Empty or whitespace-only
|
|
134
|
+
definitions are invalid even when disabled. Absence leaves inheritance intact;
|
|
135
|
+
`<alias>_ENABLED=0` suppresses activation without hiding the definition.
|
|
136
|
+
Names are preserved without case folding or Unicode normalization. Standard skill
|
|
137
|
+
names ({§agent-skills-name}) may lead with a digit or contain Unicode; native
|
|
138
|
+
`.env` files and `env 'NAME=value' command` carry such keys even when a shell's
|
|
139
|
+
assignment grammar cannot. Uppercase controls remain distinct from aliases.
|
|
107
140
|
|
|
108
141
|
### §error-detail-bound One diagnostic-preview bound
|
|
109
142
|
|
|
@@ -113,13 +146,43 @@ that package's `*_ERROR_DETAIL_LIMIT` knob, read through {§env-knob}:
|
|
|
113
146
|
(or a value's string form) and marks the cut with `...`. The bound is read at
|
|
114
147
|
each preview; an unset or invalid bound crashes by name at the first
|
|
115
148
|
diagnostic, never degrades into an unbounded one.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
149
|
+
`limit(environment?)` validates the same bound without rendering a diagnostic;
|
|
150
|
+
an explicitly supplied environment is complete and never falls back to the process.
|
|
151
|
+
|
|
152
|
+
### §plugin-manifest-read One native capability declaration
|
|
153
|
+
|
|
154
|
+
| Distribution | Declaration | Identity |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| Platform capability package | `package.json#plurnk` | npm package name |
|
|
157
|
+
| Agent Plugin bundle | `plugin.json#extensions.ai.plurnk` | npm package name when packaged for Node; otherwise the standard plugin name |
|
|
158
|
+
|
|
159
|
+
The bundle uses the standard manifest validation at {§agent-plugins-manifest}.
|
|
160
|
+
Its namespace contains the same `kind` and family-owned fields as a capability
|
|
161
|
+
package. Each family's loader, import convention, registry and lifetime remain
|
|
162
|
+
unchanged; bundling does not convert capabilities into daemon modules.
|
|
163
|
+
Use `kind: "module"` when the extension needs the daemon lifecycle ({§module-lifecycle}).
|
|
164
|
+
Its Plurnk-specific files, including defaults, live under `ai.plurnk/`.
|
|
165
|
+
A bundle never repeats its family declaration in `package.json`: two declarations
|
|
166
|
+
are an error, not an override. npm exports and dependencies remain Node packaging
|
|
167
|
+
metadata. The standard manifest is authoritative when present; an invalid one
|
|
168
|
+
cannot fall through to a package declaration. Other clients' extension namespaces
|
|
169
|
+
claim no native Plurnk capability.
|
|
170
|
+
|
|
171
|
+
| Native family | Installation boundary |
|
|
172
|
+
|---|---|
|
|
173
|
+
| `module` | npm or selected user plugin roots; never project roots ({§module-discovery}) |
|
|
174
|
+
| `exec`, `mimetype`, `provider`, `scheme`, `http-materializer` | Existing npm discovery and family import conventions |
|
|
175
|
+
|
|
176
|
+
`Meta.moduleFile(manifest, relative)` resolves a family-owned file entry. A standard
|
|
177
|
+
bundle's entry must be under `ai.plurnk/` and resolve inside the plugin root.
|
|
178
|
+
npm export-based families retain Node's package export resolution. Declared file
|
|
179
|
+
entry loaders use this shared containment boundary before importing.
|
|
180
|
+
|
|
181
|
+
`Meta.readManifest(dir, kind?)` is the one read of a package's family claim:
|
|
182
|
+
its declaration, parsed, with an object declaring exactly that
|
|
183
|
+
`kind` ({§plugin-family-kind}); omitting the filter inspects any native family,
|
|
184
|
+
as required by the configuration-floor collector. It answers `null` for a missing or
|
|
185
|
+
malformed ordinary package manifest, a non-object, no declaration, or another family —
|
|
123
186
|
none of those is a package of that family, and a scanner skips them without
|
|
124
187
|
evidence. The result carries the manifest path, the package name when
|
|
125
188
|
`name` is a non-empty string (otherwise `null`; what an unnamed package is
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPlugin.d.ts","sourceRoot":"","sources":["../src/AgentPlugin.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPlugin.js","sourceRoot":"","sources":["../src/AgentPlugin.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ManifestResult } from "./AgentPluginManifest.ts";
|
|
2
|
+
export default class AgentPluginFiles {
|
|
3
|
+
static inside(root: string, candidate: string): boolean;
|
|
4
|
+
static resolved(path: string): Promise<string | null>;
|
|
5
|
+
static contained(root: string, candidate: string): Promise<boolean>;
|
|
6
|
+
static manifest(directory: string, { signal }?: {
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}): Promise<ManifestResult | null>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=AgentPluginFiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPluginFiles.d.ts","sourceRoot":"","sources":["../src/AgentPluginFiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGjF,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACjC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAGtD;IAED,OAAa,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ1D;IAED,OAAa,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMxE;IAGD,OAAa,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,GAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAO,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA6BlH;CACJ"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { lstat, readFile, realpath, stat } from "node:fs/promises";
|
|
2
|
+
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
3
|
+
import { validateManifest } from "./AgentPluginManifest.js";
|
|
4
|
+
// {§agent-plugins-containment} Shared by portable components and native extension admission.
|
|
5
|
+
export default class AgentPluginFiles {
|
|
6
|
+
static inside(root, candidate) {
|
|
7
|
+
const path = relative(root, candidate);
|
|
8
|
+
return path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path);
|
|
9
|
+
}
|
|
10
|
+
static async resolved(path) {
|
|
11
|
+
try {
|
|
12
|
+
return await realpath(path);
|
|
13
|
+
}
|
|
14
|
+
catch (cause) {
|
|
15
|
+
const code = cause.code;
|
|
16
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
17
|
+
return null;
|
|
18
|
+
throw cause;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
static async contained(root, candidate) {
|
|
22
|
+
if (!AgentPluginFiles.inside(root, candidate))
|
|
23
|
+
return false;
|
|
24
|
+
const real = await AgentPluginFiles.resolved(candidate);
|
|
25
|
+
if (real !== null)
|
|
26
|
+
return AgentPluginFiles.inside(root, real);
|
|
27
|
+
// A missing leaf can still escape through an existing symlinked parent.
|
|
28
|
+
return candidate !== root && AgentPluginFiles.contained(root, dirname(candidate));
|
|
29
|
+
}
|
|
30
|
+
// null is absence, not an invalid manifest that permits another format to take its place.
|
|
31
|
+
static async manifest(directory, { signal } = {}) {
|
|
32
|
+
signal?.throwIfAborted();
|
|
33
|
+
const authored = join(directory, "plugin.json");
|
|
34
|
+
try {
|
|
35
|
+
await lstat(authored);
|
|
36
|
+
}
|
|
37
|
+
catch (cause) {
|
|
38
|
+
const code = cause.code;
|
|
39
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
40
|
+
return null;
|
|
41
|
+
throw cause;
|
|
42
|
+
}
|
|
43
|
+
const root = await AgentPluginFiles.resolved(directory);
|
|
44
|
+
if (root === null)
|
|
45
|
+
return null;
|
|
46
|
+
const location = await AgentPluginFiles.resolved(authored);
|
|
47
|
+
if (location === null) {
|
|
48
|
+
return { rejected: { section: "5.1", message: "plugin.json does not resolve to a regular file" }, ignored: [] };
|
|
49
|
+
}
|
|
50
|
+
if (!AgentPluginFiles.inside(root, location)) {
|
|
51
|
+
return { rejected: { section: "4.1", message: "plugin.json resolves outside the plugin root" }, ignored: [] };
|
|
52
|
+
}
|
|
53
|
+
if (!(await stat(location)).isFile()) {
|
|
54
|
+
return { rejected: { section: "5.1", message: "plugin.json is not a regular file" }, ignored: [] };
|
|
55
|
+
}
|
|
56
|
+
let value;
|
|
57
|
+
try {
|
|
58
|
+
value = JSON.parse(await readFile(location, { encoding: "utf8", signal }));
|
|
59
|
+
}
|
|
60
|
+
catch (cause) {
|
|
61
|
+
if (!(cause instanceof SyntaxError))
|
|
62
|
+
throw cause;
|
|
63
|
+
return { rejected: { section: "5.2", message: "plugin.json is not valid JSON" }, ignored: [] };
|
|
64
|
+
}
|
|
65
|
+
return validateManifest(value);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=AgentPluginFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPluginFiles.js","sourceRoot":"","sources":["../src/AgentPluginFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAEjF,6FAA6F;AAC7F,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACjC,MAAM,CAAC,MAAM,CAAC,IAAY,EAAE,SAAiB;QACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACvC,OAAO,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAY;QAC9B,IAAI,CAAC;YACD,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,GAAI,KAA+B,CAAC,IAAI,CAAC;YACnD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,IAAI,CAAC;YACzD,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,SAAiB;QAClD,IAAI,CAAC,gBAAgB,CAAC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H,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;YAC3C,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,8CAA8C,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAClH,CAAC;QACD,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACnC,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,mCAAmC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACvG,CAAC;QACD,IAAI,KAAc,CAAC;QACnB,IAAI,CAAC;YACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,CAAC,KAAK,YAAY,WAAW,CAAC;gBAAE,MAAM,KAAK,CAAC;YACjD,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,+BAA+B,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACnG,CAAC;QACD,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const AGENT_PLUGINS_VERSION = "1.0.0";
|
|
2
|
+
export declare const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
3
|
+
export declare const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
4
|
+
export declare const schemaVersion: (identifier: string, kind: "plugin" | "mcp") => string | null;
|
|
5
|
+
export declare const expandPlaceholders: (value: string, { root, data }: {
|
|
6
|
+
root: string;
|
|
7
|
+
data: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
10
|
+
//# sourceMappingURL=AgentPluginFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPluginFormat.d.ts","sourceRoot":"","sources":["../src/AgentPluginFormat.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAC7C,eAAO,MAAM,aAAa,+DAA+D,CAAC;AAC1F,eAAO,MAAM,UAAU,4DAA4D,CAAC;AAGpF,eAAO,MAAM,aAAa,eAAgB,MAAM,QAAQ,QAAQ,GAAG,KAAK,KAAG,MAAM,GAAG,IACsC,CAAC;AAG3H,eAAO,MAAM,kBAAkB,UAAW,MAAM,kBAAkB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAG,MAC8B,CAAC;AAElI,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// {§agent-plugins-manifest} Shared inert Agent Plugins format primitives.
|
|
2
|
+
export const AGENT_PLUGINS_VERSION = "1.0.0";
|
|
3
|
+
export const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
4
|
+
export const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
5
|
+
// A canonical identifier names its version; any other string is not an Agent Plugins identifier.
|
|
6
|
+
export const schemaVersion = (identifier, kind) => new RegExp(`^https://agent-plugins\\.org/schemas/([^/]+)/${kind}\\.schema\\.json$`, "u").exec(identifier)?.[1] ?? null;
|
|
7
|
+
// {§agent-plugins-expansion} One textual pass: text a replacement introduces is never scanned again.
|
|
8
|
+
export const expandPlaceholders = (value, { root, data }) => value.replaceAll(/\$\{(PLUGIN_ROOT|PLUGIN_DATA)\}/gu, (_placeholder, name) => (name === "PLUGIN_ROOT" ? root : data));
|
|
9
|
+
export const isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
10
|
+
//# sourceMappingURL=AgentPluginFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPluginFormat.js","sourceRoot":"","sources":["../src/AgentPluginFormat.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,4DAA4D,CAAC;AAC1F,MAAM,CAAC,MAAM,UAAU,GAAG,yDAAyD,CAAC;AAEpF,iGAAiG;AACjG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAkB,EAAE,IAAsB,EAAiB,EAAE,CACvF,IAAI,MAAM,CAAC,gDAAgD,IAAI,mBAAmB,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAE3H,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,EAAE,IAAI,EAAE,IAAI,EAAkC,EAAU,EAAE,CACxG,KAAK,CAAC,UAAU,CAAC,mCAAmC,EAAE,CAAC,YAAY,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAElI,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACzE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PLUGIN_SCHEMA } from "./AgentPluginFormat.ts";
|
|
2
|
+
export { AGENT_PLUGINS_VERSION, MCP_SCHEMA, PLUGIN_SCHEMA, expandPlaceholders, isObject, schemaVersion } from "./AgentPluginFormat.ts";
|
|
3
|
+
export interface Finding {
|
|
4
|
+
readonly section: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginAuthor {
|
|
8
|
+
readonly name?: string;
|
|
9
|
+
readonly email?: string;
|
|
10
|
+
readonly url?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PluginManifest {
|
|
13
|
+
readonly $schema: typeof PLUGIN_SCHEMA;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly version?: string;
|
|
16
|
+
readonly description?: string;
|
|
17
|
+
readonly author?: PluginAuthor;
|
|
18
|
+
readonly homepage?: string;
|
|
19
|
+
readonly repository?: string;
|
|
20
|
+
readonly license?: string;
|
|
21
|
+
readonly keywords?: readonly string[];
|
|
22
|
+
readonly extensions?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
23
|
+
}
|
|
24
|
+
export type ManifestResult = {
|
|
25
|
+
readonly manifest: PluginManifest;
|
|
26
|
+
readonly ignored: readonly Finding[];
|
|
27
|
+
} | {
|
|
28
|
+
readonly rejected: Finding;
|
|
29
|
+
readonly ignored: readonly Finding[];
|
|
30
|
+
};
|
|
31
|
+
export declare const validateManifest: (value: unknown) => ManifestResult;
|
|
32
|
+
//# sourceMappingURL=AgentPluginManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPluginManifest.d.ts","sourceRoot":"","sources":["../src/AgentPluginManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvI,MAAM,WAAW,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
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PLUGIN_SCHEMA, isObject, schemaVersion } from "./AgentPluginFormat.js";
|
|
2
|
+
export { AGENT_PLUGINS_VERSION, MCP_SCHEMA, PLUGIN_SCHEMA, expandPlaceholders, isObject, schemaVersion } from "./AgentPluginFormat.js";
|
|
3
|
+
const FIELDS = new Set(["$schema", "name", "version", "description", "author", "homepage", "repository", "license", "keywords", "extensions"]);
|
|
4
|
+
const STRINGS = ["version", "description", "homepage", "repository", "license"];
|
|
5
|
+
const AUTHOR = new Set(["name", "email", "url"]);
|
|
6
|
+
const NAME = /^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/u;
|
|
7
|
+
// {§agent-plugins-manifest} Unknown fields and a non-object `extensions` are the only non-fatal violations.
|
|
8
|
+
export const validateManifest = (value) => {
|
|
9
|
+
if (!isObject(value))
|
|
10
|
+
return { rejected: { section: "5.2", message: "plugin.json must contain a top-level JSON object" }, ignored: [] };
|
|
11
|
+
const ignored = Object.keys(value).filter((key) => !FIELDS.has(key))
|
|
12
|
+
.map((key) => ({ section: "5.2", message: `unknown top-level field ${JSON.stringify(key)} is ignored` }));
|
|
13
|
+
const reject = (section, message) => ({ rejected: { section, message }, ignored });
|
|
14
|
+
const { $schema, name, author, keywords, extensions } = value;
|
|
15
|
+
if (typeof $schema !== "string")
|
|
16
|
+
return reject("5.3", "required field $schema is missing or not a string");
|
|
17
|
+
if ($schema !== PLUGIN_SCHEMA) {
|
|
18
|
+
const version = schemaVersion($schema, "plugin");
|
|
19
|
+
return reject("5.2", version === null
|
|
20
|
+
? `$schema ${JSON.stringify($schema)} is not a canonical Agent Plugins manifest identifier`
|
|
21
|
+
: `Agent Plugins ${version} is not supported; this client implements 1.0.0`);
|
|
22
|
+
}
|
|
23
|
+
if (typeof name !== "string")
|
|
24
|
+
return reject("5.3", "required field name is missing or not a string");
|
|
25
|
+
if (name.length === 0 || name.length > 64 || !NAME.test(name))
|
|
26
|
+
return reject("5.5", `name ${JSON.stringify(name)} violates the plugin name constraints`);
|
|
27
|
+
const nonString = STRINGS.find((field) => value[field] !== undefined && typeof value[field] !== "string");
|
|
28
|
+
if (nonString !== undefined)
|
|
29
|
+
return reject("5.4", `${nonString} must be a string`);
|
|
30
|
+
if (author !== undefined) {
|
|
31
|
+
if (!isObject(author))
|
|
32
|
+
return reject("5.4", "author must be an object");
|
|
33
|
+
const invalid = Object.keys(author).find((key) => !AUTHOR.has(key) || typeof author[key] !== "string");
|
|
34
|
+
if (invalid !== undefined)
|
|
35
|
+
return reject("5.4", `author may hold only string name, email, and url; found ${JSON.stringify(invalid)}`);
|
|
36
|
+
}
|
|
37
|
+
if (keywords !== undefined && !(Array.isArray(keywords) && keywords.every((keyword) => typeof keyword === "string"))) {
|
|
38
|
+
return reject("5.4", "keywords must be an array of strings");
|
|
39
|
+
}
|
|
40
|
+
if (extensions !== undefined && !isObject(extensions)) {
|
|
41
|
+
ignored.push({ section: "8.1", message: "extensions is not an object and is ignored" });
|
|
42
|
+
}
|
|
43
|
+
else if (extensions !== undefined) {
|
|
44
|
+
const member = Object.keys(extensions).find((namespace) => !isObject(extensions[namespace]));
|
|
45
|
+
if (member !== undefined)
|
|
46
|
+
return reject("8.1", `extensions member ${JSON.stringify(member)} must be an object`);
|
|
47
|
+
}
|
|
48
|
+
const manifest = Object.fromEntries(Object.entries(value)
|
|
49
|
+
.filter(([key]) => FIELDS.has(key) && !(key === "extensions" && !isObject(extensions))));
|
|
50
|
+
return { manifest: manifest, ignored };
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=AgentPluginManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPluginManifest.js","sourceRoot":"","sources":["../src/AgentPluginManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,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AC,KAAK,CAAC;SACpD,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,YAAY,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7F,OAAO,EAAE,QAAQ,EAAE,QAAqC,EAAE,OAAO,EAAE,CAAC;AACxE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationError.d.ts","sourceRoot":"","sources":["../src/ConfigurationError.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,KAAK;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,YAAY,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAI/D;CACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// {§configuration-repair-path} — expected operator input, distinguishable from internal failures.
|
|
2
|
+
export default class ConfigurationError extends Error {
|
|
3
|
+
key;
|
|
4
|
+
constructor(key, message, options) {
|
|
5
|
+
super(message, options);
|
|
6
|
+
this.name = "ConfigurationError";
|
|
7
|
+
this.key = key;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ConfigurationError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigurationError.js","sourceRoot":"","sources":["../src/ConfigurationError.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,KAAK;IACxC,GAAG,CAAS;IAErB,YAAY,GAAW,EAAE,OAAe,EAAE,OAAsB;QAC5D,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;CACJ"}
|
package/dist/ErrorDetail.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDetail.d.ts","sourceRoot":"","sources":["../src/ErrorDetail.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,WAAW;;IAG5B,YAAY,IAAI,EAAE,MAAM,EAEvB;IAED,KAAK,
|
|
1
|
+
{"version":3,"file":"ErrorDetail.d.ts","sourceRoot":"","sources":["../src/ErrorDetail.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,WAAW;;IAG5B,YAAY,IAAI,EAAE,MAAM,EAEvB;IAED,KAAK,CAAC,OAAO,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAEtD;IAED,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAI9B;CACJ"}
|
package/dist/ErrorDetail.js
CHANGED
|
@@ -6,8 +6,8 @@ export default class ErrorDetail {
|
|
|
6
6
|
constructor(knob) {
|
|
7
7
|
this.#knob = knob;
|
|
8
8
|
}
|
|
9
|
-
limit() {
|
|
10
|
-
return Knob.integer(this.#knob, 0);
|
|
9
|
+
limit(environ = process.env) {
|
|
10
|
+
return Knob.integer(this.#knob, 0, environ);
|
|
11
11
|
}
|
|
12
12
|
preview(value) {
|
|
13
13
|
const text = value instanceof Error ? value.message : String(value);
|
package/dist/ErrorDetail.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDetail.js","sourceRoot":"","sources":["../src/ErrorDetail.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,kGAAkG;AAClG,gGAAgG;AAChG,MAAM,CAAC,OAAO,OAAO,WAAW;IACnB,KAAK,CAAS;IAEvB,YAAY,IAAY;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,KAAK;
|
|
1
|
+
{"version":3,"file":"ErrorDetail.js","sourceRoot":"","sources":["../src/ErrorDetail.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,kGAAkG;AAClG,gGAAgG;AAChG,MAAM,CAAC,OAAO,OAAO,WAAW;IACnB,KAAK,CAAS;IAEvB,YAAY,IAAY;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,OAAO,GAAsB,OAAO,CAAC,GAAG;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,CAAC,KAAc;QAClB,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,CAAC;CACJ"}
|
package/dist/Knob.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
1
2
|
export default class Knob {
|
|
2
|
-
static text(name: string): string;
|
|
3
|
-
static list(name: string): string[];
|
|
4
|
-
static flag(name: string): boolean;
|
|
5
|
-
static choice<T extends string>(name: string, options: readonly T[]): T;
|
|
6
|
-
static percent(name: string): number;
|
|
7
|
-
static integer(name: string, floor: number): number;
|
|
3
|
+
static text(name: string, environment?: Environment): string;
|
|
4
|
+
static list(name: string, environment?: Environment): string[];
|
|
5
|
+
static flag(name: string, environment?: Environment): boolean;
|
|
6
|
+
static choice<T extends string>(name: string, options: readonly T[], environment?: Environment): T;
|
|
7
|
+
static percent(name: string, environment?: Environment): number;
|
|
8
|
+
static integer(name: string, floor: number, environment?: Environment): number;
|
|
8
9
|
}
|
|
10
|
+
export {};
|
|
9
11
|
//# sourceMappingURL=Knob.d.ts.map
|
package/dist/Knob.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Knob.d.ts","sourceRoot":"","sources":["../src/Knob.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Knob.d.ts","sourceRoot":"","sources":["../src/Knob.ts"],"names":[],"mappings":"AAMA,KAAK,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,IAAI;IACrB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,WAAyB,GAAG,MAAM,CAIxE;IAGD,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,WAAyB,GAAG,MAAM,EAAE,CAE1E;IAGD,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,WAAyB,GAAG,OAAO,CAIzE;IAGD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,WAAW,GAAE,WAAyB,GAAG,CAAC,CAM9G;IAGD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,GAAE,WAAyB,GAAG,MAAM,CAO3E;IAGD,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,GAAE,WAAyB,GAAG,MAAM,CAO1F;CACJ"}
|
package/dist/Knob.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
// {§env-knob} — a knob is read from the
|
|
1
|
+
// {§env-knob} — a knob is read from the assembled environment, and its value lives on the panel and
|
|
2
2
|
// nowhere else ({§operator-config-only-home}). The floor guarantees every declared key, so an unset
|
|
3
|
-
// key is a broken deployment
|
|
4
|
-
//
|
|
3
|
+
// key is a broken deployment; an invalid one is typed operator input for the owning boundary.
|
|
4
|
+
// No reader here accepts a value, because a signature that could carry one is a second home
|
|
5
5
|
// for a choice. This is the one reader; a package that spells its own has a second home for the rule.
|
|
6
|
+
import ConfigurationError from "./ConfigurationError.js";
|
|
6
7
|
export default class Knob {
|
|
7
|
-
static text(name) {
|
|
8
|
-
const raw =
|
|
8
|
+
static text(name, environment = process.env) {
|
|
9
|
+
const raw = environment[name];
|
|
9
10
|
if (raw === undefined)
|
|
10
11
|
throw new Error(`${name} is missing from the assembled environment floor.`);
|
|
11
12
|
return raw;
|
|
12
13
|
}
|
|
13
14
|
// A comma list; empty is the empty list.
|
|
14
|
-
static list(name) {
|
|
15
|
-
return Knob.text(name).split(",").map((item) => item.trim()).filter((item) => item.length > 0);
|
|
15
|
+
static list(name, environment = process.env) {
|
|
16
|
+
return Knob.text(name, environment).split(",").map((item) => item.trim()).filter((item) => item.length > 0);
|
|
16
17
|
}
|
|
17
18
|
// The house switch: exactly 0 or 1.
|
|
18
|
-
static flag(name) {
|
|
19
|
-
const raw = Knob.text(name);
|
|
19
|
+
static flag(name, environment = process.env) {
|
|
20
|
+
const raw = Knob.text(name, environment);
|
|
20
21
|
if (raw !== "0" && raw !== "1")
|
|
21
|
-
throw new
|
|
22
|
+
throw new ConfigurationError(name, `${name} must be 0 or 1; got ${JSON.stringify(raw)}.`);
|
|
22
23
|
return raw === "1";
|
|
23
24
|
}
|
|
24
25
|
// `options` is the vocabulary the operator chooses from, never a choice made for them.
|
|
25
|
-
static choice(name, options) {
|
|
26
|
-
const raw = Knob.text(name);
|
|
26
|
+
static choice(name, options, environment = process.env) {
|
|
27
|
+
const raw = Knob.text(name, environment);
|
|
27
28
|
if (!options.includes(raw)) {
|
|
28
|
-
throw new
|
|
29
|
+
throw new ConfigurationError(name, `${name} must be one of ${options.join(", ")}; got ${JSON.stringify(raw)}.`);
|
|
29
30
|
}
|
|
30
31
|
return raw;
|
|
31
32
|
}
|
|
32
33
|
// The panel's own notation, a share strictly between nothing and everything: `80%` is 0.8.
|
|
33
|
-
static percent(name) {
|
|
34
|
-
const raw = Knob.text(name);
|
|
34
|
+
static percent(name, environment = process.env) {
|
|
35
|
+
const raw = Knob.text(name, environment);
|
|
35
36
|
const percent = Number(/^([0-9]+(?:\.[0-9]+)?)%$/u.exec(raw)?.[1]);
|
|
36
37
|
if (!Number.isFinite(percent) || percent <= 0 || percent >= 100) {
|
|
37
|
-
throw new
|
|
38
|
+
throw new ConfigurationError(name, `${name} must be a percentage in (0, 100); got ${JSON.stringify(raw)}.`);
|
|
38
39
|
}
|
|
39
40
|
return percent / 100;
|
|
40
41
|
}
|
|
41
42
|
// `floor` is a bound on what the operator may say, never a value used in the operator's place.
|
|
42
|
-
static integer(name, floor) {
|
|
43
|
-
const raw = Knob.text(name);
|
|
43
|
+
static integer(name, floor, environment = process.env) {
|
|
44
|
+
const raw = Knob.text(name, environment);
|
|
44
45
|
const value = Number(raw);
|
|
45
46
|
if (raw.trim().length === 0 || !Number.isSafeInteger(value) || value < floor) {
|
|
46
|
-
throw new
|
|
47
|
+
throw new ConfigurationError(name, `${name} must be a safe integer of at least ${floor}; got ${JSON.stringify(raw)}.`);
|
|
47
48
|
}
|
|
48
49
|
return value;
|
|
49
50
|
}
|
package/dist/Knob.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Knob.js","sourceRoot":"","sources":["../src/Knob.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Knob.js","sourceRoot":"","sources":["../src/Knob.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,oGAAoG;AACpG,8FAA8F;AAC9F,4FAA4F;AAC5F,sGAAsG;AACtG,OAAO,kBAAkB,MAAM,yBA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C3E,MAAM,IAAI,kBAAkB,CAAC,IAAI,EAAE,GAAG,IAAI,uCAAuC,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3H,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface EnvironmentValue {
|
|
2
|
+
readonly key: string;
|
|
3
|
+
readonly value: string;
|
|
4
|
+
}
|
|
5
|
+
export default class ResourceEnvironment {
|
|
6
|
+
#private;
|
|
7
|
+
readonly definitions: ReadonlyMap<string, EnvironmentValue>;
|
|
8
|
+
constructor(prefix: string, vocabulary: {
|
|
9
|
+
readonly controls: readonly string[];
|
|
10
|
+
readonly settings: readonly string[];
|
|
11
|
+
readonly aliasPattern?: RegExp;
|
|
12
|
+
}, environment?: Readonly<Record<string, string | undefined>>);
|
|
13
|
+
enabled(alias: string): boolean;
|
|
14
|
+
settings(name: string): ReadonlyMap<string, EnvironmentValue>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=ResourceEnvironment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceEnvironment.d.ts","sourceRoot":"","sources":["../src/ResourceEnvironment.ts"],"names":[],"mappings":"AAGA,UAAU,gBAAgB;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAGD,MAAM,CAAC,OAAO,OAAO,mBAAmB;;IACpC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAK5D,YACI,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,EAC1H,WAAW,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,EA+B1E;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9B;IAED,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAK5D;CACJ"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Knob from "./Knob.js";
|
|
2
|
+
import ConfigurationError from "./ConfigurationError.js";
|
|
3
|
+
// {§resource-environment}: syntax and independent controls only. Families own definition schemas.
|
|
4
|
+
export default class ResourceEnvironment {
|
|
5
|
+
definitions;
|
|
6
|
+
#settings = new Map();
|
|
7
|
+
#enabled = new Map();
|
|
8
|
+
#defaultEnabled;
|
|
9
|
+
constructor(prefix, vocabulary, environment = process.env) {
|
|
10
|
+
this.#defaultEnabled = Knob.flag(`${prefix}ENABLED`, environment);
|
|
11
|
+
const controls = new Set(["ENABLED", ...vocabulary.controls]);
|
|
12
|
+
const settings = new Set(["ENABLED", ...vocabulary.settings]);
|
|
13
|
+
const aliasPattern = vocabulary.aliasPattern ?? /^[a-z][a-z0-9-]*$/u;
|
|
14
|
+
const definitions = new Map();
|
|
15
|
+
for (const [key, value] of Object.entries(environment)) {
|
|
16
|
+
if (value === undefined || !key.startsWith(prefix))
|
|
17
|
+
continue;
|
|
18
|
+
const suffix = key.slice(prefix.length);
|
|
19
|
+
if (controls.has(suffix))
|
|
20
|
+
continue;
|
|
21
|
+
const match = /^(.+?)(?:_([A-Z][A-Z0-9_]*))?$/u.exec(suffix);
|
|
22
|
+
if (match === null || /[A-Z-]/u.test(match[1]) || !aliasPattern.test(match[1].replaceAll("_", "-"))) {
|
|
23
|
+
throw new ConfigurationError(key, `${key} is not a declared control; use a lowercase resource alias with underscores for hyphens and uppercase setting names.`);
|
|
24
|
+
}
|
|
25
|
+
const alias = match[1].replaceAll("_", "-");
|
|
26
|
+
const setting = match[2];
|
|
27
|
+
if (setting === undefined) {
|
|
28
|
+
if (value.trim().length === 0) {
|
|
29
|
+
throw new ConfigurationError(key, `${key} must contain a definition; use ${key}_ENABLED=0 to disable a defined resource.`);
|
|
30
|
+
}
|
|
31
|
+
definitions.set(alias, { key, value });
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (!settings.has(setting))
|
|
35
|
+
throw new ConfigurationError(key, `${key} names unsupported resource setting '${setting}'.`);
|
|
36
|
+
const fields = this.#settings.get(alias) ?? new Map();
|
|
37
|
+
fields.set(setting, { key, value });
|
|
38
|
+
this.#settings.set(alias, fields);
|
|
39
|
+
if (setting === "ENABLED")
|
|
40
|
+
this.#enabled.set(alias, Knob.flag(key, environment));
|
|
41
|
+
}
|
|
42
|
+
this.definitions = new Map([...definitions].toSorted(([left], [right]) => left.localeCompare(right)));
|
|
43
|
+
}
|
|
44
|
+
enabled(alias) {
|
|
45
|
+
return this.#enabled.get(alias) ?? this.#defaultEnabled;
|
|
46
|
+
}
|
|
47
|
+
settings(name) {
|
|
48
|
+
return new Map([...this.#settings].flatMap(([alias, settings]) => {
|
|
49
|
+
const field = settings.get(name);
|
|
50
|
+
return field === undefined ? [] : [[alias, field]];
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ResourceEnvironment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceEnvironment.js","sourceRoot":"","sources":["../src/ResourceEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAOzD,kGAAkG;AAClG,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAC3B,WAAW,CAAwC;IACnD,SAAS,GAAG,IAAI,GAAG,EAAyC,CAAC;IAC7D,QAAQ,GAAG,IAAI,GAAG,EAAmB,CA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C,CAAC;IAC1G,CAAC;IAED,OAAO,CAAC,KAAa;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC;IAC5D,CAAC;IAED,QAAQ,CAAC,IAAY;QACjB,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE;YAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACjC,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;CACJ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export { default as Knob } from "./Knob.ts";
|
|
2
|
+
export { default as ConfigurationError } from "./ConfigurationError.ts";
|
|
3
|
+
export { default as ResourceEnvironment } from "./ResourceEnvironment.ts";
|
|
2
4
|
export { default as ErrorDetail } from "./ErrorDetail.ts";
|
|
3
5
|
export interface PackageCandidate {
|
|
4
6
|
dir: string;
|
|
5
7
|
name: string;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
declare const PLUGIN_KINDS: readonly ["exec", "mimetype", "provider", "scheme", "http-materializer", "module"];
|
|
10
|
+
export type PluginKind = typeof PLUGIN_KINDS[number];
|
|
8
11
|
export interface PluginManifest {
|
|
9
12
|
readonly manifestPath: string;
|
|
10
13
|
readonly packageName: string | null;
|
|
@@ -36,9 +39,10 @@ export type TeachingCorpusSource = typeof TEACHING_CORPUS.policy | typeof TEACHI
|
|
|
36
39
|
export default class Meta {
|
|
37
40
|
#private;
|
|
38
41
|
static declaresKind(manifest: unknown, kind: PluginKind): boolean;
|
|
39
|
-
static readManifest(dir: string, kind
|
|
42
|
+
static readManifest(dir: string, kind?: PluginKind, { signal }?: {
|
|
40
43
|
signal?: AbortSignal;
|
|
41
44
|
}): Promise<PluginManifest | null>;
|
|
45
|
+
static moduleFile(manifest: PluginManifest, relative: string): Promise<string>;
|
|
42
46
|
static isTrusted(packageName: string, env?: Record<string, string | undefined>): boolean;
|
|
43
47
|
static normalizeAttribution(raw: unknown, packageName: string): PluginAttribution;
|
|
44
48
|
static runtimeAttribution(source: unknown, context: PluginAttributionContext, packageName: string): PluginAttribution;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,YAAY,YAAI,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,CAAU,CAAC;AACxG,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;AAGrD,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,O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CAAA;KAAO,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAmCnI;IAGD,OAAa,UAAU,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBnF;IAsCD,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,OAAO,CAMpG;IAED,MAAM,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,iBAAiB,CAiBhF;IAKD,MAAM,CAAC,kBAAkB,CACrB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,wBAAwB,EACjC,WAAW,EAAE,MAAM,GACpB,iBAAiB,CAcnB;IAED,MAAM,CAAC,mBAAmB,CAAC,GAAG,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,iBAAiB,CAIpF;IAkCD,OAAa,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAyB5E;IAED,MAAM,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASxD;CACJ"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The metaproject layer's membership slice — the mechanics every discovery
|
|
2
2
|
// surface shares ({§plugin-discovery} / {§operator-config-env-defaults}):
|
|
3
3
|
// - declaresKind: the ONE package → capability-family representation.
|
|
4
|
-
// - readManifest: the ONE
|
|
4
|
+
// - readManifest: the ONE native declaration read: a family's manifest, or null for
|
|
5
5
|
// anything that is not a package of that family. Field
|
|
6
6
|
// validation past the family claim is the caller's.
|
|
7
7
|
// - Knob: the ONE environment reader: the panel's value by name, or a
|
|
@@ -28,8 +28,13 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
28
28
|
import { parseEnv } from "node:util";
|
|
29
29
|
import path from "node:path";
|
|
30
30
|
import { fileURLToPath } from "node:url";
|
|
31
|
+
import ConfigurationError from "./ConfigurationError.js";
|
|
32
|
+
import { AgentPluginFiles, isObject } from "./AgentPlugin.js";
|
|
31
33
|
export { default as Knob } from "./Knob.js";
|
|
34
|
+
export { default as ConfigurationError } from "./ConfigurationError.js";
|
|
35
|
+
export { default as ResourceEnvironment } from "./ResourceEnvironment.js";
|
|
32
36
|
export { default as ErrorDetail } from "./ErrorDetail.js";
|
|
37
|
+
const PLUGIN_KINDS = ["exec", "mimetype", "provider", "scheme", "http-materializer", "module"];
|
|
33
38
|
const SCHEME_TEACHING = Object.freeze({
|
|
34
39
|
worker: "docs/worker.md",
|
|
35
40
|
});
|
|
@@ -56,10 +61,70 @@ export default class Meta {
|
|
|
56
61
|
// no `plurnk` object, or another family: none of those is a package of this family, and
|
|
57
62
|
// discovery skips them without a word. An abort is the caller's contract and surfaces.
|
|
58
63
|
static async readManifest(dir, kind, { signal } = {}) {
|
|
59
|
-
const
|
|
64
|
+
const pluginPath = path.join(dir, "plugin.json");
|
|
65
|
+
let plugin;
|
|
66
|
+
try {
|
|
67
|
+
plugin = await AgentPluginFiles.manifest(dir, { signal });
|
|
68
|
+
}
|
|
69
|
+
catch (cause) {
|
|
70
|
+
signal?.throwIfAborted();
|
|
71
|
+
if (cause instanceof Error && cause.name === "AbortError")
|
|
72
|
+
throw cause;
|
|
73
|
+
throw new ConfigurationError(pluginPath, `${pluginPath}: plugin.json could not be read.`, { cause });
|
|
74
|
+
}
|
|
75
|
+
const packageRecord = await Meta.#packageRecord(dir, signal);
|
|
76
|
+
if (plugin !== null) {
|
|
77
|
+
if ("rejected" in plugin) {
|
|
78
|
+
throw new ConfigurationError(pluginPath, `${pluginPath}: ${plugin.rejected.message}.`);
|
|
79
|
+
}
|
|
80
|
+
if (isObject(packageRecord?.plurnk) && packageRecord.plurnk.kind !== undefined) {
|
|
81
|
+
throw new ConfigurationError(pluginPath, `${pluginPath}: native capabilities must not also be declared in package.json#plurnk.`);
|
|
82
|
+
}
|
|
83
|
+
const native = plugin.manifest.extensions?.["ai.plurnk"];
|
|
84
|
+
if (native === undefined)
|
|
85
|
+
return null;
|
|
86
|
+
if (!PLUGIN_KINDS.some((family) => Meta.declaresKind(native, family))) {
|
|
87
|
+
throw new ConfigurationError(pluginPath, `${pluginPath}: extensions.ai.plurnk.kind must name one native capability family.`);
|
|
88
|
+
}
|
|
89
|
+
if (kind !== undefined && !Meta.declaresKind(native, kind))
|
|
90
|
+
return null;
|
|
91
|
+
const packageName = typeof packageRecord?.name === "string" && packageRecord.name.length > 0
|
|
92
|
+
? packageRecord.name : plugin.manifest.name;
|
|
93
|
+
return { manifestPath: pluginPath, packageName, plurnk: native };
|
|
94
|
+
}
|
|
95
|
+
if (packageRecord === null)
|
|
96
|
+
return null;
|
|
97
|
+
const plurnk = packageRecord.plurnk;
|
|
98
|
+
if (!isObject(plurnk) || !(kind === undefined
|
|
99
|
+
? PLUGIN_KINDS.some((family) => Meta.declaresKind(plurnk, family))
|
|
100
|
+
: Meta.declaresKind(plurnk, kind)))
|
|
101
|
+
return null;
|
|
102
|
+
const packageName = typeof packageRecord.name === "string" && packageRecord.name.length > 0 ? packageRecord.name : null;
|
|
103
|
+
return { manifestPath: path.join(dir, "package.json"), packageName, plurnk };
|
|
104
|
+
}
|
|
105
|
+
// {§plugin-manifest-read} Family loaders resolve their own file declarations through this boundary.
|
|
106
|
+
static async moduleFile(manifest, relative) {
|
|
107
|
+
const dir = path.dirname(manifest.manifestPath);
|
|
108
|
+
if (path.basename(manifest.manifestPath) !== "plugin.json")
|
|
109
|
+
return path.resolve(dir, relative);
|
|
110
|
+
const root = await AgentPluginFiles.resolved(dir);
|
|
111
|
+
if (root === null) {
|
|
112
|
+
throw new ConfigurationError(manifest.manifestPath, `${manifest.manifestPath}: plugin root is unavailable.`);
|
|
113
|
+
}
|
|
114
|
+
const location = path.resolve(root, relative);
|
|
115
|
+
if (!relative.startsWith("ai.plurnk/")
|
|
116
|
+
|| !AgentPluginFiles.inside(path.join(root, "ai.plurnk"), location)) {
|
|
117
|
+
throw new ConfigurationError(manifest.manifestPath, `${manifest.manifestPath}: native module must be beneath ai.plurnk/.`);
|
|
118
|
+
}
|
|
119
|
+
if (!await AgentPluginFiles.contained(root, location)) {
|
|
120
|
+
throw new ConfigurationError(manifest.manifestPath, `${manifest.manifestPath}: native module resolves outside the plugin root.`);
|
|
121
|
+
}
|
|
122
|
+
return location;
|
|
123
|
+
}
|
|
124
|
+
static async #packageRecord(dir, signal) {
|
|
60
125
|
let raw;
|
|
61
126
|
try {
|
|
62
|
-
raw = await readFile(
|
|
127
|
+
raw = await readFile(path.join(dir, "package.json"), { encoding: "utf8", signal });
|
|
63
128
|
}
|
|
64
129
|
catch (err) {
|
|
65
130
|
if (err instanceof Error && err.name === "AbortError")
|
|
@@ -73,14 +138,7 @@ export default class Meta {
|
|
|
73
138
|
catch {
|
|
74
139
|
return null;
|
|
75
140
|
}
|
|
76
|
-
|
|
77
|
-
return null;
|
|
78
|
-
const record = pkg;
|
|
79
|
-
const plurnk = record.plurnk;
|
|
80
|
-
if (typeof plurnk !== "object" || plurnk === null || !Meta.declaresKind(plurnk, kind))
|
|
81
|
-
return null;
|
|
82
|
-
const packageName = typeof record.name === "string" && record.name.length > 0 ? record.name : null;
|
|
83
|
-
return { manifestPath, packageName, plurnk: plurnk };
|
|
141
|
+
return isObject(pkg) ? pkg : null;
|
|
84
142
|
}
|
|
85
143
|
// {§operator-config-only-home} — the trust gate is asked while the floor is still being
|
|
86
144
|
// assembled (it decides whose panel joins it), so an unset key cannot mean "the panel said
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAC7E,sFAAsF;AACtF,+EAA+E;AAC/E,4EAA4E;AAC5E,sFAAsF;AACtF,uDAA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,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBAAE,OAAO,SAAS,CAAC;YAClE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,MAAM,KAAK,GAAG;gBAAE,OAAO,IAAI,CAAC;YAChC,GAAG,GAAG,MAAM,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
|
package/docs/worker.md
CHANGED
|
@@ -16,9 +16,7 @@ an entry rather than controlling that worker.
|
|
|
16
16
|
| `worker:///example.md` | Shared commons entry | Read and write. |
|
|
17
17
|
|
|
18
18
|
The packet's `## Worker` block, below the log, names your worker, its parent
|
|
19
|
-
(`null` at a root), the loop and turn you are producing
|
|
20
|
-
address of the program you submitted last: the log rows at that coordinate are its
|
|
21
|
-
receipts. Addresses are
|
|
19
|
+
(`null` at a root), and the loop and turn you are producing. Addresses are
|
|
22
20
|
literal and keep the same meaning when passed to another worker. Scratch
|
|
23
21
|
belongs to the workspace; a namespace does not require a namesake worker.
|
|
24
22
|
Generated references live under `worker:///_plurnk/`, and reference refreshes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-meta",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Plugin discovery and trust primitives shared by plurnk plugin families, and the teaching material the plurnk service gives models: policy, Recap, the plurnk skill and scheme references.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -33,6 +33,14 @@
|
|
|
33
33
|
"types": "./dist/index.d.ts",
|
|
34
34
|
"default": "./dist/index.js"
|
|
35
35
|
},
|
|
36
|
+
"./agent-plugin": {
|
|
37
|
+
"types": "./dist/AgentPlugin.d.ts",
|
|
38
|
+
"default": "./dist/AgentPlugin.js"
|
|
39
|
+
},
|
|
40
|
+
"./configuration-error": {
|
|
41
|
+
"types": "./dist/ConfigurationError.d.ts",
|
|
42
|
+
"default": "./dist/ConfigurationError.js"
|
|
43
|
+
},
|
|
36
44
|
"./package.json": "./package.json",
|
|
37
45
|
"./POLICY.md": "./POLICY.md",
|
|
38
46
|
"./recap.md": "./recap.md",
|