@adea-ai/plugins 1.0.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/LICENSE +201 -0
- package/README.md +74 -0
- package/dist/agent-plugins-catalog.d.ts +26 -0
- package/dist/agent-plugins-catalog.js +699 -0
- package/dist/agent-plugins-catalog.js.map +1 -0
- package/dist/agent-plugins-harness.d.ts +54 -0
- package/dist/agent-plugins-harness.js +212 -0
- package/dist/agent-plugins-harness.js.map +1 -0
- package/dist/agent-plugins-schema.d.ts +402 -0
- package/dist/agent-plugins-schema.js +200 -0
- package/dist/agent-plugins-schema.js.map +1 -0
- package/dist/consumer-index.d.ts +217 -0
- package/dist/consumer-index.js +358 -0
- package/dist/consumer-index.js.map +1 -0
- package/dist/display-name.d.ts +8 -0
- package/dist/display-name.js +160 -0
- package/dist/display-name.js.map +1 -0
- package/dist/harness.d.ts +13 -0
- package/dist/harness.js +169 -0
- package/dist/harness.js.map +1 -0
- package/dist/icon-mirror.d.ts +69 -0
- package/dist/icon-mirror.js +147 -0
- package/dist/icon-mirror.js.map +1 -0
- package/dist/icons.d.ts +65 -0
- package/dist/icons.js +268 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +304 -0
- package/dist/index.js +1877 -0
- package/dist/index.js.map +1 -0
- package/dist/portable-catalog.d.ts +9 -0
- package/dist/portable-catalog.js +175 -0
- package/dist/portable-catalog.js.map +1 -0
- package/dist/publication.d.ts +98 -0
- package/dist/publication.js +121 -0
- package/dist/publication.js.map +1 -0
- package/dist/schema.d.ts +705 -0
- package/dist/schema.js +267 -0
- package/dist/schema.js.map +1 -0
- package/dist/site-icons.d.ts +55 -0
- package/dist/site-icons.js +155 -0
- package/dist/site-icons.js.map +1 -0
- package/dist/sources.d.ts +54 -0
- package/dist/sources.js +306 -0
- package/dist/sources.js.map +1 -0
- package/package.json +102 -0
- package/schemas/agent-package.v1.json +387 -0
- package/schemas/catalog.v1.schema.json +407 -0
- package/schemas/compatibility.v1.schema.json +23 -0
- package/schemas/harness-profile.v1.json +75 -0
- package/schemas/installation-plan.v2.json +695 -0
- package/schemas/sources-lock.v1.schema.json +61 -0
- package/src/agent-plugins-catalog.test.ts +402 -0
- package/src/agent-plugins-catalog.ts +800 -0
- package/src/agent-plugins-harness.test.ts +272 -0
- package/src/agent-plugins-harness.ts +281 -0
- package/src/agent-plugins-schema.test.ts +27 -0
- package/src/agent-plugins-schema.ts +219 -0
- package/src/artifacts.test.ts +545 -0
- package/src/catalog-installation.test.ts +42 -0
- package/src/consumer-index.test.ts +465 -0
- package/src/consumer-index.ts +592 -0
- package/src/display-name.test.ts +56 -0
- package/src/display-name.ts +157 -0
- package/src/harness.ts +202 -0
- package/src/icon-mirror.ts +196 -0
- package/src/icons.test.ts +185 -0
- package/src/icons.ts +297 -0
- package/src/index.test.ts +888 -0
- package/src/index.ts +2538 -0
- package/src/portable-catalog.test.ts +186 -0
- package/src/portable-catalog.ts +203 -0
- package/src/publication.test.ts +117 -0
- package/src/publication.ts +171 -0
- package/src/schema.ts +309 -0
- package/src/site-icon-fallback.test.ts +267 -0
- package/src/site-icons.test.ts +171 -0
- package/src/site-icons.ts +161 -0
- package/src/sources.ts +360 -0
- package/src/upstream-headers.test.ts +148 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
// Locally pinned contracts. Never fetch a schema while inspecting a plugin.
|
|
4
|
+
export const AGENT_PLUGINS_VERSION = '1.0.0' as const
|
|
5
|
+
export const PLUGIN_SCHEMA_ID = 'https://agent-plugins.org/schemas/1.0.0/plugin.schema.json'
|
|
6
|
+
export const MCP_SCHEMA_ID = 'https://agent-plugins.org/schemas/1.0.0/mcp.schema.json'
|
|
7
|
+
export const NORMALIZER_VERSION = 'adea-agent-plugins/1' as const
|
|
8
|
+
export const PluginNameSchema = z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.max(64)
|
|
12
|
+
.regex(/^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/)
|
|
13
|
+
const Strings = z.record(z.string(), z.string())
|
|
14
|
+
const Digest = z.string().regex(/^sha256:[a-f0-9]{64}$/)
|
|
15
|
+
const Path = z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.max(1024)
|
|
19
|
+
.regex(
|
|
20
|
+
// eslint-disable-next-line no-control-regex
|
|
21
|
+
/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[^\\:\u0000-\u001f\u007f/]+(?:\/[^\\:\u0000-\u001f\u007f/]+)*$/
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export const AgentManifestSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
$schema: z.literal(PLUGIN_SCHEMA_ID),
|
|
27
|
+
name: PluginNameSchema,
|
|
28
|
+
version: z.string().optional(),
|
|
29
|
+
description: z.string().optional(),
|
|
30
|
+
author: z
|
|
31
|
+
.object({
|
|
32
|
+
name: z.string().optional(),
|
|
33
|
+
email: z.string().optional(),
|
|
34
|
+
url: z.string().optional(),
|
|
35
|
+
})
|
|
36
|
+
.strict()
|
|
37
|
+
.optional(),
|
|
38
|
+
homepage: z.string().optional(),
|
|
39
|
+
repository: z.string().optional(),
|
|
40
|
+
license: z.string().optional(),
|
|
41
|
+
keywords: z.array(z.string()).optional(),
|
|
42
|
+
extensions: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
|
43
|
+
})
|
|
44
|
+
.strict()
|
|
45
|
+
|
|
46
|
+
export const McpServerSchema = z.discriminatedUnion('type', [
|
|
47
|
+
z
|
|
48
|
+
.object({
|
|
49
|
+
type: z.literal('stdio'),
|
|
50
|
+
command: z.string().min(1),
|
|
51
|
+
args: z.array(z.string()).optional(),
|
|
52
|
+
env: Strings.optional(),
|
|
53
|
+
cwd: z.string().optional(),
|
|
54
|
+
})
|
|
55
|
+
.strict(),
|
|
56
|
+
z
|
|
57
|
+
.object({
|
|
58
|
+
type: z.literal('streamable-http'),
|
|
59
|
+
url: z.string().min(1),
|
|
60
|
+
headers: Strings.optional(),
|
|
61
|
+
})
|
|
62
|
+
.strict(),
|
|
63
|
+
z
|
|
64
|
+
.object({ type: z.literal('sse'), url: z.string().min(1), headers: Strings.optional() })
|
|
65
|
+
.strict(),
|
|
66
|
+
])
|
|
67
|
+
export const AgentMcpSchema = z
|
|
68
|
+
.object({ $schema: z.literal(MCP_SCHEMA_ID), mcpServers: z.record(z.string(), McpServerSchema) })
|
|
69
|
+
.strict()
|
|
70
|
+
|
|
71
|
+
export const SkillFrontmatterSchema = z
|
|
72
|
+
.object({
|
|
73
|
+
name: z
|
|
74
|
+
.string()
|
|
75
|
+
.min(1)
|
|
76
|
+
.max(64)
|
|
77
|
+
.regex(/^(?!.*--)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/),
|
|
78
|
+
description: z.string().min(1).max(1024),
|
|
79
|
+
license: z.string().optional(),
|
|
80
|
+
compatibility: z.string().min(1).max(500).optional(),
|
|
81
|
+
metadata: Strings.optional(),
|
|
82
|
+
'allowed-tools': z.string().optional(),
|
|
83
|
+
})
|
|
84
|
+
.strict()
|
|
85
|
+
|
|
86
|
+
export const DiagnosticSchema = z
|
|
87
|
+
.object({
|
|
88
|
+
code: z.string().min(1),
|
|
89
|
+
scope: z.enum(['plugin', 'skills', 'skill', 'mcp', 'server', 'extension', 'translation']),
|
|
90
|
+
path: z.string(),
|
|
91
|
+
severity: z.enum(['warning', 'error']),
|
|
92
|
+
message: z.string().min(1),
|
|
93
|
+
})
|
|
94
|
+
.strict()
|
|
95
|
+
export const PackageFileSchema = z.discriminatedUnion('action', [
|
|
96
|
+
z
|
|
97
|
+
.object({
|
|
98
|
+
action: z.literal('copy'),
|
|
99
|
+
sourcePath: Path,
|
|
100
|
+
targetPath: Path,
|
|
101
|
+
digest: Digest,
|
|
102
|
+
preserveMode: z.literal(true),
|
|
103
|
+
})
|
|
104
|
+
.strict(),
|
|
105
|
+
z
|
|
106
|
+
.object({
|
|
107
|
+
action: z.literal('write'),
|
|
108
|
+
targetPath: Path,
|
|
109
|
+
digest: Digest,
|
|
110
|
+
content: z.string(),
|
|
111
|
+
mode: z.literal('0644'),
|
|
112
|
+
})
|
|
113
|
+
.strict(),
|
|
114
|
+
])
|
|
115
|
+
export const AgentPackageSchema = z
|
|
116
|
+
.object({
|
|
117
|
+
contractVersion: z.literal(1),
|
|
118
|
+
normalizerVersion: z.literal(NORMALIZER_VERSION),
|
|
119
|
+
format: z.literal('agent-plugins'),
|
|
120
|
+
specVersion: z.literal(AGENT_PLUGINS_VERSION),
|
|
121
|
+
originFormat: z.enum(['agent-plugins', 'legacy']),
|
|
122
|
+
sourceDigest: Digest,
|
|
123
|
+
status: z.enum(['portable', 'partial', 'unavailable']),
|
|
124
|
+
manifest: AgentManifestSchema.optional(),
|
|
125
|
+
packageDigest: Digest.optional(),
|
|
126
|
+
files: z.array(PackageFileSchema).max(8192),
|
|
127
|
+
skills: z.array(
|
|
128
|
+
z
|
|
129
|
+
.object({
|
|
130
|
+
name: z.string(),
|
|
131
|
+
path: Path,
|
|
132
|
+
description: z.string(),
|
|
133
|
+
compatibility: z.string().optional(),
|
|
134
|
+
allowedTools: z.string().optional(),
|
|
135
|
+
})
|
|
136
|
+
.strict()
|
|
137
|
+
),
|
|
138
|
+
mcpServers: z.record(z.string(), McpServerSchema),
|
|
139
|
+
nonPortable: z.array(
|
|
140
|
+
z.object({ kind: z.string(), paths: z.array(Path), reason: z.string() }).strict()
|
|
141
|
+
),
|
|
142
|
+
diagnostics: z.array(DiagnosticSchema),
|
|
143
|
+
requirements: z
|
|
144
|
+
.object({
|
|
145
|
+
skills: z.boolean(),
|
|
146
|
+
mcpTransports: z.array(z.enum(['stdio', 'streamable-http', 'sse'])),
|
|
147
|
+
executables: z.array(z.string()),
|
|
148
|
+
environmentReview: z.boolean(),
|
|
149
|
+
})
|
|
150
|
+
.strict(),
|
|
151
|
+
})
|
|
152
|
+
.strict()
|
|
153
|
+
|
|
154
|
+
/** Reported by the actual Control Plane harness adapter, not inferred from a brand name. */
|
|
155
|
+
export const HarnessProfileSchema = z
|
|
156
|
+
.object({
|
|
157
|
+
profileVersion: z.literal(1),
|
|
158
|
+
harness: z.string().min(1).max(128),
|
|
159
|
+
runtimeVersion: z.string().min(1).max(128),
|
|
160
|
+
adapterVersion: z.string().min(1).max(128),
|
|
161
|
+
agentPlugins: z
|
|
162
|
+
.object({
|
|
163
|
+
versions: z.array(z.string()),
|
|
164
|
+
skills: z.boolean(),
|
|
165
|
+
mcpTransports: z.array(z.enum(['stdio', 'streamable-http', 'sse'])),
|
|
166
|
+
})
|
|
167
|
+
.strict(),
|
|
168
|
+
components: z
|
|
169
|
+
.object({
|
|
170
|
+
skillDirectories: z.boolean(),
|
|
171
|
+
mcpTransports: z.array(z.enum(['stdio', 'streamable-http', 'sse'])),
|
|
172
|
+
})
|
|
173
|
+
.strict(),
|
|
174
|
+
})
|
|
175
|
+
.strict()
|
|
176
|
+
|
|
177
|
+
export const InstallationPlanSchema = z
|
|
178
|
+
.object({
|
|
179
|
+
planVersion: z.literal(2),
|
|
180
|
+
pluginId: z.string().min(1),
|
|
181
|
+
releaseId: z.string().min(1),
|
|
182
|
+
instanceId: z.string().min(1).max(256),
|
|
183
|
+
profile: HarnessProfileSchema,
|
|
184
|
+
source: z
|
|
185
|
+
.object({
|
|
186
|
+
repositoryUrl: z.string().url(),
|
|
187
|
+
commitSha: z.string().regex(/^[a-f0-9]{40}$/),
|
|
188
|
+
pluginSubdirectory: z.string().min(1).max(1024),
|
|
189
|
+
contentDigest: Digest,
|
|
190
|
+
})
|
|
191
|
+
.strict(),
|
|
192
|
+
package: AgentPackageSchema,
|
|
193
|
+
packageKey: z.string(),
|
|
194
|
+
dataKey: z.string(),
|
|
195
|
+
preserveDataAcrossUpdates: z.literal(true),
|
|
196
|
+
strategy: z.enum(['native-agent-plugin', 'component-adapter', 'unavailable']),
|
|
197
|
+
compatibility: z.enum(['full', 'partial', 'unsupported']),
|
|
198
|
+
allowedToActivate: z.literal(false),
|
|
199
|
+
approvalRequired: z.literal(true),
|
|
200
|
+
selection: z
|
|
201
|
+
.object({
|
|
202
|
+
skillDirectories: z.array(Path),
|
|
203
|
+
mcpServers: z.record(z.string(), McpServerSchema),
|
|
204
|
+
})
|
|
205
|
+
.strict(),
|
|
206
|
+
disabled: z.array(z.object({ component: z.string(), reason: z.string() }).strict()),
|
|
207
|
+
requiredConnectors: z.array(z.string()),
|
|
208
|
+
requiredCredentials: z.array(z.string()),
|
|
209
|
+
preconditions: z.array(z.string()),
|
|
210
|
+
})
|
|
211
|
+
.strict()
|
|
212
|
+
|
|
213
|
+
export type AgentManifest = z.infer<typeof AgentManifestSchema>
|
|
214
|
+
export type McpServer = z.infer<typeof McpServerSchema>
|
|
215
|
+
export type AgentPackage = z.infer<typeof AgentPackageSchema>
|
|
216
|
+
export type PackageFile = z.infer<typeof PackageFileSchema>
|
|
217
|
+
export type Diagnostic = z.infer<typeof DiagnosticSchema>
|
|
218
|
+
export type HarnessProfile = z.infer<typeof HarnessProfileSchema>
|
|
219
|
+
export type InstallationPlan = z.infer<typeof InstallationPlanSchema>
|