@adea-ai/plugins 3.0.10 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -11
- package/dist/agent-plugins-catalog.d.ts +2 -3
- package/dist/agent-plugins-catalog.js +2 -10
- package/dist/agent-plugins-catalog.js.map +1 -1
- package/dist/catalog-store.d.ts +81 -0
- package/dist/catalog-store.js +487 -0
- package/dist/catalog-store.js.map +1 -0
- package/dist/consumer-index.d.ts +1 -1
- package/dist/consumer-index.js +17 -7
- package/dist/consumer-index.js.map +1 -1
- package/dist/display-name.js +3 -2
- package/dist/display-name.js.map +1 -1
- package/dist/harness.d.ts +50 -9
- package/dist/harness.js +190 -147
- package/dist/harness.js.map +1 -1
- package/dist/icon-mirror.d.ts +2 -2
- package/dist/icon-mirror.js +38 -25
- package/dist/icon-mirror.js.map +1 -1
- package/dist/icons.js +5 -27
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +103 -88
- package/dist/index.js.map +1 -1
- package/dist/publication.d.ts +8 -11
- package/dist/publication.js +8 -11
- package/dist/publication.js.map +1 -1
- package/dist/schema.d.ts +0 -40
- package/dist/schema.js +0 -36
- package/dist/schema.js.map +1 -1
- package/dist/site-icons.d.ts +2 -0
- package/dist/site-icons.js +46 -9
- package/dist/site-icons.js.map +1 -1
- package/dist/source-digest.d.ts +2 -0
- package/dist/source-digest.js +12 -0
- package/dist/source-digest.js.map +1 -0
- package/dist/sources.js +3 -3
- package/dist/sources.js.map +1 -1
- package/native/build-provenance.txt +5 -5
- package/native/staged-reader-win32-arm64.node +0 -0
- package/native/staged-reader-win32-x64.node +0 -0
- package/package.json +4 -9
- package/src/agent-plugins-catalog.ts +3 -10
- package/src/artifacts.test.ts +80 -0
- package/src/catalog-installation.test.ts +1 -1
- package/src/catalog-store.ts +546 -0
- package/src/consumer-index.test.ts +125 -0
- package/src/consumer-index.ts +23 -8
- package/src/default-head.test.ts +143 -0
- package/src/display-name.test.ts +8 -0
- package/src/display-name.ts +3 -2
- package/src/{agent-plugins-harness.test.ts → harness.test.ts} +1 -1
- package/src/harness.ts +249 -170
- package/src/icon-mirror.ts +36 -23
- package/src/icons.test.ts +5 -0
- package/src/icons.ts +6 -29
- package/src/index.test.ts +272 -40
- package/src/index.ts +131 -94
- package/src/manifest-retry.test.ts +49 -0
- package/src/portable-catalog.test.ts +8 -5
- package/src/publication.ts +8 -11
- package/src/schema.ts +0 -40
- package/src/site-icon-fallback.test.ts +36 -19
- package/src/site-icons.test.ts +104 -0
- package/src/site-icons.ts +47 -9
- package/src/source-config-sync.test.ts +84 -0
- package/src/source-digest.test.ts +101 -0
- package/src/source-digest.ts +14 -0
- package/src/sources-json.test.ts +53 -0
- package/src/sources.ts +3 -3
- package/src/upstream-headers.test.ts +31 -7
- package/src/write-artifacts.test.ts +375 -0
- package/dist/agent-plugins-harness.d.ts +0 -54
- package/dist/agent-plugins-harness.js +0 -212
- package/dist/agent-plugins-harness.js.map +0 -1
- package/src/agent-plugins-harness.ts +0 -281
package/dist/display-name.js
CHANGED
|
@@ -136,7 +136,8 @@ const FULL_NAMES = {
|
|
|
136
136
|
*/
|
|
137
137
|
export function normalizeDisplayName(value) {
|
|
138
138
|
const trimmed = value.trim();
|
|
139
|
-
const
|
|
139
|
+
const fullNameKey = trimmed.toLowerCase();
|
|
140
|
+
const known = Object.hasOwn(FULL_NAMES, fullNameKey) ? FULL_NAMES[fullNameKey] : undefined;
|
|
140
141
|
if (known !== undefined)
|
|
141
142
|
return known;
|
|
142
143
|
const tokens = trimmed.split(/[-_\s]+/u).filter(Boolean);
|
|
@@ -145,7 +146,7 @@ export function normalizeDisplayName(value) {
|
|
|
145
146
|
return tokens
|
|
146
147
|
.map((token, index) => {
|
|
147
148
|
const key = token.toLowerCase();
|
|
148
|
-
const brand = BRAND_TOKENS[key];
|
|
149
|
+
const brand = Object.hasOwn(BRAND_TOKENS, key) ? BRAND_TOKENS[key] : undefined;
|
|
149
150
|
if (brand !== undefined)
|
|
150
151
|
return brand;
|
|
151
152
|
// Any uppercase means the vendor already chose a casing.
|
package/dist/display-name.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-name.js","sourceRoot":"","sources":["../src/display-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,YAAY,GAAqC;IACrD,UAAU,EAAE,UAAU;IACtB,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,IAAI;IACR,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,aAAa;IACzB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IACV,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,iBAAiB;IAChC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,cAAc;IAC3B,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,YAAY;IACjB,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE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AAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAA;QACjD,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9D,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC"}
|
package/dist/harness.d.ts
CHANGED
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly
|
|
5
|
-
|
|
1
|
+
import { type HarnessProfile, type McpServer, type InstallationPlan } from './agent-plugins-schema.js';
|
|
2
|
+
import type { Catalog } from './schema.js';
|
|
3
|
+
export interface InstallationInput {
|
|
4
|
+
readonly pluginId: string;
|
|
5
|
+
readonly releaseId: string;
|
|
6
|
+
readonly instanceId: string;
|
|
7
|
+
readonly source: InstallationPlan['source'];
|
|
8
|
+
readonly package: unknown;
|
|
9
|
+
readonly profile: HarnessProfile;
|
|
10
|
+
readonly requiredCredentials?: readonly string[];
|
|
11
|
+
readonly requiredConnectors?: readonly string[];
|
|
12
|
+
readonly allowPartial?: boolean;
|
|
6
13
|
}
|
|
7
|
-
export
|
|
14
|
+
export interface CatalogInstallationInput {
|
|
8
15
|
readonly catalog: Catalog;
|
|
9
16
|
readonly pluginId: string;
|
|
10
|
-
readonly harness: Harness;
|
|
11
17
|
readonly releaseId?: string;
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
readonly instanceId: string;
|
|
19
|
+
readonly profile: HarnessProfile;
|
|
20
|
+
readonly allowPartial?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Resolve the exact catalog release before planning. The caller must also authenticate
|
|
23
|
+
* the catalog publisher and verify its artifact integrity before invoking this API.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createCatalogInstallationPlan(input: CatalogInstallationInput): InstallationPlan;
|
|
26
|
+
/** A declarative proposal, never an execution grant. No brand-based support assumptions. */
|
|
27
|
+
export declare function createInstallationPlan(input: InstallationInput): InstallationPlan;
|
|
28
|
+
export interface RuntimeRoots {
|
|
29
|
+
readonly pluginRoot: string;
|
|
30
|
+
readonly pluginData: string;
|
|
31
|
+
}
|
|
32
|
+
/** Exact, single-pass expansion. Replacement text is never scanned recursively. */
|
|
33
|
+
export declare function expandPluginPaths(value: string, roots: RuntimeRoots): string;
|
|
34
|
+
export type McpBinding = {
|
|
35
|
+
type: 'stdio';
|
|
36
|
+
command: string;
|
|
37
|
+
args: string[];
|
|
38
|
+
cwd: string;
|
|
39
|
+
env: Record<string, string>;
|
|
40
|
+
shell: false;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'streamable-http' | 'sse';
|
|
43
|
+
url: string;
|
|
44
|
+
headers: Record<string, string>;
|
|
45
|
+
redirectPolicy: 'same-origin';
|
|
46
|
+
authorization: 'control-plane';
|
|
47
|
+
};
|
|
48
|
+
/** Produce concrete Control Plane launch/connect descriptors, without launching or connecting. */
|
|
49
|
+
export declare function resolveMcpBinding(input: McpServer, roots: RuntimeRoots, baseEnv?: Readonly<Record<string, string>>, platform?: 'posix' | 'win32'): McpBinding;
|
|
50
|
+
/** Mandatory filesystem preflight for Control Plane callers after safe materialization.
|
|
51
|
+
* Call immediately before activation inside the same protected installation boundary;
|
|
52
|
+
* a separate preflight is not a substitute for preventing concurrent filesystem mutation.
|
|
53
|
+
*/
|
|
54
|
+
export declare function verifyBindingPaths(input: McpServer, roots: RuntimeRoots): Promise<void>;
|
package/dist/harness.js
CHANGED
|
@@ -1,169 +1,212 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const plugin = input.catalog.plugins.find((candidate) => candidate.pluginId === input.pluginId);
|
|
1
|
+
import { isAbsolute, resolve, relative, sep } from 'node:path';
|
|
2
|
+
import { realpath } from 'node:fs/promises';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { HarnessProfileSchema, InstallationPlanSchema, } from './agent-plugins-schema.js';
|
|
5
|
+
import { verifyPortableCatalog, PACKAGE_METADATA_KEY } from './portable-catalog.js';
|
|
6
|
+
import { verifyAgentPackage, validateServer } from './agent-plugins-catalog.js';
|
|
7
|
+
/** Resolve the exact catalog release before planning. The caller must also authenticate
|
|
8
|
+
* the catalog publisher and verify its artifact integrity before invoking this API.
|
|
9
|
+
*/
|
|
10
|
+
export function createCatalogInstallationPlan(input) {
|
|
11
|
+
verifyPortableCatalog(input.catalog);
|
|
12
|
+
const plugin = input.catalog.plugins.find((entry) => entry.pluginId === input.pluginId);
|
|
14
13
|
if (!plugin)
|
|
15
|
-
throw new
|
|
16
|
-
const release = plugin.availableReleases.find((
|
|
14
|
+
throw new Error(`PLUGIN_NOT_FOUND: ${input.pluginId}`);
|
|
15
|
+
const release = plugin.availableReleases.find((entry) => entry.releaseId === (input.releaseId ?? plugin.currentReleaseId));
|
|
17
16
|
if (!release)
|
|
18
|
-
throw new
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
throw new
|
|
24
|
-
return
|
|
25
|
-
planVersion: 1,
|
|
17
|
+
throw new Error('RELEASE_NOT_FOUND');
|
|
18
|
+
if (release.contentResolution !== 'complete')
|
|
19
|
+
throw new Error('COMPLETE_SOURCE_REQUIRED');
|
|
20
|
+
const pkg = release.releaseMetadata[PACKAGE_METADATA_KEY];
|
|
21
|
+
if (pkg === undefined)
|
|
22
|
+
throw new Error('PORTABLE_RESYNC_REQUIRED: run a full catalog sync before planning portable installation');
|
|
23
|
+
return createInstallationPlan({
|
|
26
24
|
pluginId: plugin.pluginId,
|
|
27
25
|
releaseId: release.releaseId,
|
|
28
|
-
|
|
26
|
+
instanceId: input.instanceId,
|
|
27
|
+
profile: input.profile,
|
|
28
|
+
package: pkg,
|
|
29
|
+
allowPartial: input.allowPartial === true,
|
|
29
30
|
source: {
|
|
30
31
|
repositoryUrl: release.resolvedRepositoryUrl,
|
|
31
32
|
commitSha: release.resolvedCommitSha,
|
|
32
33
|
pluginSubdirectory: release.pluginSubdirectory,
|
|
33
34
|
contentDigest: release.canonicalContentDigest,
|
|
34
35
|
},
|
|
35
|
-
targetLayout: targetLayout(input.harness),
|
|
36
|
-
files: release.fileIndex
|
|
37
|
-
.map((sourcePath) => filePlan(release, sourcePath, input.harness, compatibility.status))
|
|
38
|
-
.toSorted((left, right) => left.targetPath.localeCompare(right.targetPath) ||
|
|
39
|
-
left.sourcePath.localeCompare(right.sourcePath)),
|
|
40
|
-
configuration: {
|
|
41
|
-
compatibilityStatus: compatibility.status,
|
|
42
|
-
sourceDialect: release.releaseMetadata.sourceDialect ?? 'unknown',
|
|
43
|
-
executeInstallation: false,
|
|
44
|
-
},
|
|
45
|
-
requiredConnectors: release.requiredConnectors,
|
|
46
36
|
requiredCredentials: release.requiredCredentials,
|
|
47
|
-
|
|
48
|
-
'This plan describes files and translation only; it does not install or execute upstream code.',
|
|
49
|
-
...release.permissionSensitiveChanges.map((type) => `Control Plane must authorize ${type} capability explicitly.`),
|
|
50
|
-
],
|
|
37
|
+
requiredConnectors: release.requiredConnectors,
|
|
51
38
|
});
|
|
52
39
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
case 'codex':
|
|
56
|
-
return {
|
|
57
|
-
root: '.agents',
|
|
58
|
-
notes: [
|
|
59
|
-
'Skills and instructions map to the Codex .agents layout.',
|
|
60
|
-
'MCP and executable capabilities require Control Plane policy.',
|
|
61
|
-
],
|
|
62
|
-
};
|
|
63
|
-
case 'claude-code':
|
|
64
|
-
return {
|
|
65
|
-
root: '.claude',
|
|
66
|
-
notes: [
|
|
67
|
-
'Claude Code-native files can be copied when the source dialect is Claude.',
|
|
68
|
-
'Hooks and MCP configuration still require explicit runtime authorization.',
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
case 'cursor':
|
|
72
|
-
return {
|
|
73
|
-
root: '.cursor',
|
|
74
|
-
notes: [
|
|
75
|
-
'Cursor rules and skills map to the .cursor layout.',
|
|
76
|
-
'MCP configuration is declarative and is not executed by this plan.',
|
|
77
|
-
],
|
|
78
|
-
};
|
|
79
|
-
case 'pi':
|
|
80
|
-
return {
|
|
81
|
-
root: '.pi',
|
|
82
|
-
notes: [
|
|
83
|
-
'Pi receives portable SKILL.md and MCP metadata only.',
|
|
84
|
-
'No Pi process or package lifecycle is invoked.',
|
|
85
|
-
],
|
|
86
|
-
};
|
|
87
|
-
case 'hermes':
|
|
88
|
-
return {
|
|
89
|
-
root: '.hermes',
|
|
90
|
-
notes: [
|
|
91
|
-
'Hermes receives portable skill and MCP metadata only.',
|
|
92
|
-
'Harness-specific translation remains explicit in each file action.',
|
|
93
|
-
],
|
|
94
|
-
};
|
|
95
|
-
case 'opencode':
|
|
96
|
-
return {
|
|
97
|
-
root: '.opencode',
|
|
98
|
-
notes: [
|
|
99
|
-
'OpenCode receives portable instruction and MCP metadata only.',
|
|
100
|
-
'Executable capabilities are excluded.',
|
|
101
|
-
],
|
|
102
|
-
};
|
|
103
|
-
case 'generic-skill-mcp':
|
|
104
|
-
return {
|
|
105
|
-
root: '.agent',
|
|
106
|
-
notes: ['Generic SKILL.md and MCP-compatible files are copied when recognized.'],
|
|
107
|
-
};
|
|
108
|
-
}
|
|
40
|
+
function identity(...parts) {
|
|
41
|
+
return createHash('sha256').update(JSON.stringify(parts)).digest('hex');
|
|
109
42
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
43
|
+
/** A declarative proposal, never an execution grant. No brand-based support assumptions. */
|
|
44
|
+
export function createInstallationPlan(input) {
|
|
45
|
+
const profile = HarnessProfileSchema.parse(input.profile);
|
|
46
|
+
const pkg = verifyAgentPackage(input.package);
|
|
47
|
+
if (pkg.sourceDigest !== input.source.contentDigest)
|
|
48
|
+
throw new Error('Package recipe does not match the selected immutable release.');
|
|
49
|
+
if (!input.instanceId || input.instanceId.length > 256)
|
|
50
|
+
throw new Error('A stable installation instanceId is required.');
|
|
51
|
+
const disabled = [];
|
|
52
|
+
for (const item of pkg.nonPortable)
|
|
53
|
+
disabled.push({ component: item.kind, reason: item.reason });
|
|
54
|
+
for (const item of pkg.diagnostics.filter((entry) => entry.severity === 'error'))
|
|
55
|
+
disabled.push({ component: item.path, reason: item.message });
|
|
56
|
+
const nativeEligible = profile.agentPlugins.versions.includes(pkg.specVersion) &&
|
|
57
|
+
pkg.nonPortable.length === 0 &&
|
|
58
|
+
!Object.keys(pkg.manifest?.extensions ?? {}).length;
|
|
59
|
+
const nativeCoverage = (profile.agentPlugins.skills ? pkg.skills.length : 0) +
|
|
60
|
+
Object.values(pkg.mcpServers).filter((server) => profile.agentPlugins.mcpTransports.includes(server.type)).length;
|
|
61
|
+
const adapterCoverage = (profile.components.skillDirectories ? pkg.skills.length : 0) +
|
|
62
|
+
Object.values(pkg.mcpServers).filter((server) => profile.components.mcpTransports.includes(server.type)).length;
|
|
63
|
+
const native = nativeEligible && nativeCoverage > 0 && nativeCoverage >= adapterCoverage;
|
|
64
|
+
const strategy = pkg.status === 'unavailable'
|
|
65
|
+
? 'unavailable'
|
|
66
|
+
: native
|
|
67
|
+
? 'native-agent-plugin'
|
|
68
|
+
: 'component-adapter';
|
|
69
|
+
let skillDirectories = [];
|
|
70
|
+
const servers = new Map();
|
|
71
|
+
if (strategy !== 'unavailable') {
|
|
72
|
+
if (native ? profile.agentPlugins.skills : profile.components.skillDirectories)
|
|
73
|
+
skillDirectories = pkg.skills.map((skill) => skill.path);
|
|
74
|
+
else
|
|
75
|
+
for (const skill of pkg.skills)
|
|
76
|
+
disabled.push({
|
|
77
|
+
component: `skill:${skill.name}`,
|
|
78
|
+
reason: 'The selected adapter cannot expose skill directories.',
|
|
79
|
+
});
|
|
80
|
+
for (const [name, server] of Object.entries(pkg.mcpServers)) {
|
|
81
|
+
if ((native ? profile.agentPlugins.mcpTransports : profile.components.mcpTransports).includes(server.type))
|
|
82
|
+
servers.set(name, server);
|
|
83
|
+
else
|
|
84
|
+
disabled.push({
|
|
85
|
+
component: `mcp:${name}`,
|
|
86
|
+
reason: `No ${server.type} MCP binding on this harness adapter.`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
120
89
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
90
|
+
const hasContent = skillDirectories.length > 0 || servers.size > 0;
|
|
91
|
+
const compatibility = !hasContent ? 'unsupported' : disabled.length > 0 ? 'partial' : 'full';
|
|
92
|
+
const selectedStrategy = !hasContent || (compatibility === 'partial' && !input.allowPartial) ? 'unavailable' : strategy;
|
|
93
|
+
return InstallationPlanSchema.parse({
|
|
94
|
+
planVersion: 2,
|
|
95
|
+
pluginId: input.pluginId,
|
|
96
|
+
releaseId: input.releaseId,
|
|
97
|
+
instanceId: input.instanceId,
|
|
98
|
+
profile,
|
|
99
|
+
source: input.source,
|
|
100
|
+
package: pkg,
|
|
101
|
+
// Git source identity also pins executable modes, which the v1 byte snapshot omits.
|
|
102
|
+
packageKey: pkg.packageDigest
|
|
103
|
+
? `packages/${identity(input.source.repositoryUrl, input.source.commitSha, input.source.pluginSubdirectory, pkg.packageDigest)}`
|
|
104
|
+
: '',
|
|
105
|
+
// Deliberately excludes release, package digest and harness. Switching harnesses or updating
|
|
106
|
+
// the same approved instance preserves data; distinct scopes use distinct instance IDs.
|
|
107
|
+
dataKey: `instances/${identity(input.pluginId, input.instanceId)}`,
|
|
108
|
+
preserveDataAcrossUpdates: true,
|
|
109
|
+
strategy: selectedStrategy,
|
|
110
|
+
compatibility,
|
|
111
|
+
allowedToActivate: false,
|
|
112
|
+
approvalRequired: true,
|
|
113
|
+
selection: selectedStrategy === 'unavailable'
|
|
114
|
+
? { skillDirectories: [], mcpServers: {} }
|
|
115
|
+
: { skillDirectories, mcpServers: Object.fromEntries(servers) },
|
|
116
|
+
disabled,
|
|
117
|
+
requiredCredentials: [...(input.requiredCredentials ?? [])],
|
|
118
|
+
requiredConnectors: [...(input.requiredConnectors ?? [])],
|
|
119
|
+
preconditions: [
|
|
120
|
+
'Verify catalog integrity/provenance and exact source digest before applying the package recipe.',
|
|
121
|
+
'Use an immutable package root; preserve source file modes and complete skill directories/resources.',
|
|
122
|
+
'Create a writable data directory for this instance; never key it by release or copy credentials between instances.',
|
|
123
|
+
'Control Plane must authorize activation, filesystem/network access, executables and credential bindings.',
|
|
124
|
+
'Recheck the actual harness/runtime/adapter profile and realpath containment immediately before activation.',
|
|
125
|
+
'Native mode registers exactly one package root. Component mode registers only the selected skill directories and MCP bindings, never legacy hooks/config files.',
|
|
126
|
+
'Do not install dependencies or run lifecycle scripts implicitly; review required executables and skill compatibility requirements.',
|
|
127
|
+
'Skill allowed-tools metadata is advisory and never grants permission.',
|
|
128
|
+
'Namespace registrations by installation identity; detect skill/server name collisions instead of overwriting existing harness configuration.',
|
|
129
|
+
'Remote authorization is client-managed. Do not expand remote URLs/headers or forward configured headers to another origin without authorization.',
|
|
130
|
+
],
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/** Exact, single-pass expansion. Replacement text is never scanned recursively. */
|
|
134
|
+
export function expandPluginPaths(value, roots) {
|
|
135
|
+
return value.replace(/\$\{(PLUGIN_ROOT|PLUGIN_DATA)\}/g, (_match, name) => name === 'PLUGIN_ROOT' ? roots.pluginRoot : roots.pluginData);
|
|
136
|
+
}
|
|
137
|
+
function within(path, root) {
|
|
138
|
+
const suffix = relative(root, path);
|
|
139
|
+
return suffix === '' || (suffix !== '..' && !suffix.startsWith(`..${sep}`) && !isAbsolute(suffix));
|
|
140
|
+
}
|
|
141
|
+
/** Produce concrete Control Plane launch/connect descriptors, without launching or connecting. */
|
|
142
|
+
export function resolveMcpBinding(input, roots, baseEnv = {}, platform = process.platform === 'win32' ? 'win32' : 'posix') {
|
|
143
|
+
const server = validateServer(input);
|
|
144
|
+
if (!isAbsolute(roots.pluginRoot) || !isAbsolute(roots.pluginData))
|
|
145
|
+
throw new Error('Runtime plugin roots must be absolute paths.');
|
|
146
|
+
if (server.type !== 'stdio')
|
|
125
147
|
return {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
type: server.type,
|
|
149
|
+
url: server.url,
|
|
150
|
+
headers: { ...server.headers },
|
|
151
|
+
redirectPolicy: 'same-origin',
|
|
152
|
+
authorization: 'control-plane',
|
|
130
153
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
const command = server.command.startsWith('./')
|
|
155
|
+
? resolve(roots.pluginRoot, server.command)
|
|
156
|
+
: server.command;
|
|
157
|
+
if (server.command.startsWith('./') && !within(command, roots.pluginRoot))
|
|
158
|
+
throw new Error('Executable escapes the plugin root.');
|
|
159
|
+
const cwdInput = server.cwd ?? '${PLUGIN_ROOT}';
|
|
160
|
+
const cwdRoot = cwdInput.startsWith('${PLUGIN_DATA}') ? roots.pluginData : roots.pluginRoot;
|
|
161
|
+
const expanded = expandPluginPaths(cwdInput, roots);
|
|
162
|
+
const cwd = resolve(roots.pluginRoot, expanded);
|
|
163
|
+
if (!within(cwd, cwdRoot))
|
|
164
|
+
throw new Error('Working directory escapes its declared root.');
|
|
165
|
+
const env = {};
|
|
166
|
+
const overlay = (name, value) => {
|
|
167
|
+
if (platform === 'win32')
|
|
168
|
+
for (const existing of Object.keys(env))
|
|
169
|
+
if (existing.toUpperCase() === name.toUpperCase())
|
|
170
|
+
delete env[existing];
|
|
171
|
+
Object.defineProperty(env, name, {
|
|
172
|
+
value,
|
|
173
|
+
enumerable: true,
|
|
174
|
+
configurable: true,
|
|
175
|
+
writable: true,
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
for (const [key, value] of Object.entries(baseEnv))
|
|
179
|
+
overlay(key, value);
|
|
180
|
+
for (const [key, value] of Object.entries(server.env ?? {}))
|
|
181
|
+
overlay(key, expandPluginPaths(value, roots));
|
|
182
|
+
overlay('PLUGIN_ROOT', roots.pluginRoot);
|
|
183
|
+
overlay('PLUGIN_DATA', roots.pluginData);
|
|
136
184
|
return {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
185
|
+
type: 'stdio',
|
|
186
|
+
command,
|
|
187
|
+
args: (server.args ?? []).map((arg) => expandPluginPaths(arg, roots)),
|
|
188
|
+
cwd,
|
|
189
|
+
env,
|
|
190
|
+
shell: false,
|
|
143
191
|
};
|
|
144
192
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const basename = path.split('/').at(-1) ?? path;
|
|
164
|
-
return basename.replace(/\.[^.]+$/, '');
|
|
165
|
-
}
|
|
166
|
-
export function supportedHarnesses() {
|
|
167
|
-
return HarnessSchema.options;
|
|
193
|
+
/** Mandatory filesystem preflight for Control Plane callers after safe materialization.
|
|
194
|
+
* Call immediately before activation inside the same protected installation boundary;
|
|
195
|
+
* a separate preflight is not a substitute for preventing concurrent filesystem mutation.
|
|
196
|
+
*/
|
|
197
|
+
export async function verifyBindingPaths(input, roots) {
|
|
198
|
+
const binding = resolveMcpBinding(input, roots);
|
|
199
|
+
if (binding.type !== 'stdio' || input.type !== 'stdio')
|
|
200
|
+
return;
|
|
201
|
+
const root = await realpath(roots.pluginRoot);
|
|
202
|
+
const data = await realpath(roots.pluginData);
|
|
203
|
+
if (root !== roots.pluginRoot || data !== roots.pluginData)
|
|
204
|
+
throw new Error('Supply canonical filesystem-resolved runtime roots.');
|
|
205
|
+
const cwd = await realpath(binding.cwd);
|
|
206
|
+
const expected = input.cwd?.startsWith('${PLUGIN_DATA}') ? data : root;
|
|
207
|
+
if (!within(cwd, expected))
|
|
208
|
+
throw new Error('Working directory resolves outside its declared root.');
|
|
209
|
+
if (input.command.startsWith('./') && !within(await realpath(binding.command), root))
|
|
210
|
+
throw new Error('Executable resolves outside the package root.');
|
|
168
211
|
}
|
|
169
212
|
//# sourceMappingURL=harness.js.map
|
package/dist/harness.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../src/harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GAIvB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAsB/E;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAA+B;IAC3E,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACpC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAA;IACvF,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,CAAC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AK,CAAC,UAAU;QACxD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAA;IACxE,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IACtE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;QAClF,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;AACpE,CAAC"}
|
package/dist/icon-mirror.d.ts
CHANGED
|
@@ -40,8 +40,8 @@ export interface IconMirrorResult {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Maps every mirrored icon back to the exact commit it was resolved from, by
|
|
43
|
-
* matching the digest the product advertises.
|
|
44
|
-
*
|
|
43
|
+
* matching the digest the product advertises. Retain each distinct pinned
|
|
44
|
+
* origin so the mirror can try another source if one is unavailable.
|
|
45
45
|
*/
|
|
46
46
|
export declare function resolveIconSources(catalog: Pick<Catalog, 'plugins'>, index: ConsumerIndex): readonly IconSource[];
|
|
47
47
|
/**
|