@jini-ai/agent-plugins 0.4.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/CHANGELOG.md +57 -0
- package/LICENSE +201 -0
- package/README.md +261 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/lifecycle/activation.d.ts +177 -0
- package/dist/lifecycle/activation.js +874 -0
- package/dist/lifecycle/bundled-digests.d.ts +27 -0
- package/dist/lifecycle/bundled-digests.js +149 -0
- package/dist/lifecycle/bundled-source-archive.d.ts +13 -0
- package/dist/lifecycle/bundled-source-archive.js +96 -0
- package/dist/lifecycle/capability-projection.d.ts +11 -0
- package/dist/lifecycle/capability-projection.js +60 -0
- package/dist/lifecycle/fetch-archive.d.ts +88 -0
- package/dist/lifecycle/fetch-archive.js +215 -0
- package/dist/lifecycle/index.d.ts +174 -0
- package/dist/lifecycle/index.js +94 -0
- package/dist/lifecycle/install-from-url.d.ts +78 -0
- package/dist/lifecycle/install-from-url.js +73 -0
- package/dist/lifecycle/install.d.ts +52 -0
- package/dist/lifecycle/install.js +286 -0
- package/dist/lifecycle/layout.d.ts +20 -0
- package/dist/lifecycle/layout.js +30 -0
- package/dist/lifecycle/manifest.d.ts +214 -0
- package/dist/lifecycle/manifest.js +409 -0
- package/dist/lifecycle/mcp-provisioning.d.ts +20 -0
- package/dist/lifecycle/mcp-provisioning.js +14 -0
- package/dist/lifecycle/node.d.ts +11 -0
- package/dist/lifecycle/node.js +34 -0
- package/dist/lifecycle/package-paths.d.ts +12 -0
- package/dist/lifecycle/package-paths.js +74 -0
- package/dist/lifecycle/ports.d.ts +81 -0
- package/dist/lifecycle/ports.js +2 -0
- package/dist/lifecycle/resolve-agent-plugin-refs.d.ts +18 -0
- package/dist/lifecycle/resolve-agent-plugin-refs.js +143 -0
- package/dist/lifecycle/retire-bundled.d.ts +36 -0
- package/dist/lifecycle/retire-bundled.js +69 -0
- package/dist/lifecycle/search.d.ts +23 -0
- package/dist/lifecycle/search.js +50 -0
- package/dist/lifecycle/seed-bundled.d.ts +29 -0
- package/dist/lifecycle/seed-bundled.js +118 -0
- package/dist/lifecycle/set-enabled.d.ts +21 -0
- package/dist/lifecycle/set-enabled.js +39 -0
- package/dist/lifecycle/trusted-plugin-files.d.ts +29 -0
- package/dist/lifecycle/trusted-plugin-files.js +82 -0
- package/dist/lifecycle/types.d.ts +20 -0
- package/dist/lifecycle/types.js +2 -0
- package/dist/lifecycle/uninstall.d.ts +41 -0
- package/dist/lifecycle/uninstall.js +148 -0
- package/dist/lifecycle/yauzl-archive-reader.d.ts +62 -0
- package/dist/lifecycle/yauzl-archive-reader.js +73 -0
- package/dist/manifest.d.ts +68 -0
- package/dist/manifest.js +38 -0
- package/package.json +92 -0
- package/ui-ux-design/com.anthropic.claude-code/hooks/hooks.json +4 -0
- package/ui-ux-design/mcp.json +4 -0
- package/ui-ux-design/plugin.json +5 -0
- package/ui-ux-design/skills/frontend-accessibility/SKILL.md +60 -0
- package/ui-ux-design/skills/gstack-design/SKILL.md +53 -0
- package/ui-ux-design/skills/gstack-design/references/consultation.md +30 -0
- package/ui-ux-design/skills/gstack-design/references/html.md +29 -0
- package/ui-ux-design/skills/gstack-design/references/review.md +28 -0
- package/ui-ux-design/skills/gstack-design/references/shotgun.md +33 -0
- package/ui-ux-design/skills/gstack-design/references/upstream-notes.md +23 -0
- package/ui-ux-design/skills/interface-design/ORIGINAL.md +16 -0
- package/ui-ux-design/skills/interface-design/SKILL.md +41 -0
- package/ui-ux-design/skills/interface-design/references/commands/audit.md +40 -0
- package/ui-ux-design/skills/interface-design/references/commands/critique.md +21 -0
- package/ui-ux-design/skills/interface-design/references/commands/extract.md +34 -0
- package/ui-ux-design/skills/interface-design/references/commands/init.md +31 -0
- package/ui-ux-design/skills/interface-design/references/commands/status.md +22 -0
- package/ui-ux-design/skills/interface-design/references/examples/system-precision.md +29 -0
- package/ui-ux-design/skills/interface-design/references/examples/system-warmth.md +29 -0
- package/ui-ux-design/skills/interface-design/references/system-template.md +57 -0
- package/ui-ux-design/skills/shadcn-ui/README.md +244 -0
- package/ui-ux-design/skills/shadcn-ui/SKILL.md +326 -0
- package/ui-ux-design/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/ui-ux-design/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/ui-ux-design/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/ui-ux-design/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/ui-ux-design/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/ui-ux-design/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/ui-ux-design/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/ui-ux-design/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/ui-ux-design/skills/ui-ux-design/SKILL.md +77 -0
- package/ui-ux-design/skills/ui-ux-design/references/brand-and-voice.md +72 -0
- package/ui-ux-design/skills/ui-ux-design/references/components-and-states.md +107 -0
- package/ui-ux-design/skills/ui-ux-design/references/delight-and-motion.md +65 -0
- package/ui-ux-design/skills/ui-ux-design/references/foundations.md +144 -0
- package/ui-ux-design/skills/ui-ux-design/references/inclusive-ai-imagery.md +57 -0
- package/ui-ux-design/skills/ui-ux-design/references/kole-jain-uiux-concepts.md +102 -0
- package/ui-ux-design/skills/ui-ux-design/references/openai-frontend-skill.md +139 -0
- package/ui-ux-design/skills/ui-ux-design/references/premium-ui.md +63 -0
- package/ui-ux-design/skills/ui-ux-design/references/research-and-validation.md +78 -0
- package/ui-ux-design/skills/ui-ux-design/references/sam-crawford-premium-websites.md +93 -0
- package/ui-ux-design/skills/ui-ux-design/references/self-made-web-designer-core-skills.md +123 -0
- package/ui-ux-design/skills/ui-ux-design/references/visual-storytelling.md +57 -0
- package/ui-ux-design/skills/vercel-web-design-guidelines/SKILL.md +39 -0
- package/ui-ux-design/skills/web-compliance/SKILL.md +129 -0
- package/ui-ux-design/skills/web-compliance/references/audit-evidence.md +59 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { maxAgentPluginArchiveBytes } from './fetch-archive.js';
|
|
2
|
+
import type { FetchAgentPluginArchiveOptional } from './fetch-archive.js';
|
|
3
|
+
import type { AgentPluginLifecycleRequired, AgentPluginLifecycleOptional } from './ports.js';
|
|
4
|
+
import type { AgentPluginDeliveryMode } from './resolve-agent-plugin-refs.js';
|
|
5
|
+
import type { InstalledDigestIdentity } from './bundled-digests.js';
|
|
6
|
+
export type { SeededAgentPluginOutcome, SeedBundledAgentPluginsRequired, SeedBundledAgentPluginsResult } from './seed-bundled.js';
|
|
7
|
+
export type { RetireBundledAgentPluginsRequired, RetireBundledAgentPluginsOptional, RetiredAgentPluginOutcome } from './retire-bundled.js';
|
|
8
|
+
export * from './ports.js';
|
|
9
|
+
export * from './layout.js';
|
|
10
|
+
export * from './manifest.js';
|
|
11
|
+
export * from './fetch-archive.js';
|
|
12
|
+
export * from './mcp-provisioning.js';
|
|
13
|
+
export { createAgentPluginActivations, ACTIVATIONS_FILENAME, ACTIVATIONS_LOCK_FILENAME, AgentPluginActivationsBusyError, AgentPluginActivationsUnreadableError } from './activation.js';
|
|
14
|
+
export { BUNDLED_DIGESTS_FILENAME } from './bundled-digests.js';
|
|
15
|
+
export { AgentPluginInstallError } from './install.js';
|
|
16
|
+
export { PackagePathViolation } from './package-paths.js';
|
|
17
|
+
export { AgentPluginNotInstalledError } from './set-enabled.js';
|
|
18
|
+
export { AgentPluginNotFoundError, AgentPluginNotUninstallableError, AgentPluginChangedSincePreviewError } from './uninstall.js';
|
|
19
|
+
export type { AgentPluginOrigin, AgentPluginActivationRecord, AgentPluginActivations, AgentPluginActivationVerdict, SetAgentPluginActivationRequired, SetAgentPluginActivationOptional, BundledAgentPluginEnableOutcome, DeleteAgentPluginActivationRequired } from './activation.js';
|
|
20
|
+
export type { BundledAgentPluginDigests, SeededBundledAgentPluginDigest, InstalledDigestIdentity } from './bundled-digests.js';
|
|
21
|
+
export type { PackedAgentPluginArchive } from './bundled-source-archive.js';
|
|
22
|
+
export type { AgentPluginArchiveEntry, AgentPluginArchiveReaderPort, AgentPluginArchiveReaderPort as ArchiveReaderPort, AgentPluginInstallErrorCode, InstalledAgentPluginSkill, InstalledAgentPlugin, InstallAgentPluginRequired, InstallAgentPluginOptional } from './install.js';
|
|
23
|
+
export type { AgentPluginIntegrity, InstallAgentPluginFromUrlRequired, InstallAgentPluginFromUrlOptional, InstalledAgentPluginFromUrl } from './install-from-url.js';
|
|
24
|
+
export type { AgentPluginDeliveryMode, ResolveAgentPluginRefsResult } from './resolve-agent-plugin-refs.js';
|
|
25
|
+
export type { SetAgentPluginEnabledInput, SetAgentPluginEnabledResult } from './set-enabled.js';
|
|
26
|
+
export type { UninstallAgentPluginRequired, UninstallAgentPluginOptional, UninstallAgentPluginResult, AgentPluginUninstallPreview } from './uninstall.js';
|
|
27
|
+
export type { TrustedPluginPackage, TrustedPluginPackagesQuery, TrustedPluginVerdict } from './trusted-plugin-files.js';
|
|
28
|
+
export type { AgentPluginSearchSkill, AgentPluginSearchCandidate, AgentPluginSearchMatch } from './search.js';
|
|
29
|
+
/** One host context owns queues and effects. Keep this object and its ports stable for its lifetime.
|
|
30
|
+
* Installation/activation and MCP provisioning are separate operations: the host explicitly wires
|
|
31
|
+
* provisioning using the exported helpers, with its own retry/recovery policy. */
|
|
32
|
+
export declare function createAgentPluginLifecycle(required: AgentPluginLifecycleRequired, optional?: AgentPluginLifecycleOptional): {
|
|
33
|
+
fetchAgentPluginArchive: (input: {
|
|
34
|
+
readonly url: string;
|
|
35
|
+
}, optional?: FetchAgentPluginArchiveOptional) => Promise<import("./fetch-archive.js").FetchedAgentPluginArchive>;
|
|
36
|
+
maxAgentPluginArchiveBytes: typeof maxAgentPluginArchiveBytes;
|
|
37
|
+
seedBundledAgentPlugins: (required: import("./seed-bundled.js").SeedBundledAgentPluginsRequired) => Promise<import("./seed-bundled.js").SeedBundledAgentPluginsResult>;
|
|
38
|
+
retireBundledAgentPlugins: (required: import("./retire-bundled.js").RetireBundledAgentPluginsRequired, optional?: import("./retire-bundled.js").RetireBundledAgentPluginsOptional) => Promise<readonly import("./retire-bundled.js").RetiredAgentPluginOutcome[]>;
|
|
39
|
+
setAgentPluginActivation: (required: import("./activation.js").SetAgentPluginActivationRequired, optional?: import("./activation.js").SetAgentPluginActivationOptional) => Promise<import("./activation.js").AgentPluginActivations>;
|
|
40
|
+
recordBundledAgentPluginIfAbsent: (required: {
|
|
41
|
+
readonly workspaceRoot: string;
|
|
42
|
+
readonly pluginId: string;
|
|
43
|
+
}, optional?: {
|
|
44
|
+
readonly now?: ((required: Record<string, never>) => Date) | undefined;
|
|
45
|
+
readonly enabled?: boolean;
|
|
46
|
+
}) => Promise<{
|
|
47
|
+
readonly recorded: boolean;
|
|
48
|
+
}>;
|
|
49
|
+
enableBundledAgentPluginUnlessOperatorDisabled: (required: {
|
|
50
|
+
readonly workspaceRoot: string;
|
|
51
|
+
readonly pluginId: string;
|
|
52
|
+
readonly actor: string;
|
|
53
|
+
readonly now?: ((required: Record<string, never>) => Date) | undefined;
|
|
54
|
+
}) => Promise<import("./activation.js").BundledAgentPluginEnableOutcome>;
|
|
55
|
+
deleteAgentPluginActivation: (required: import("./activation.js").DeleteAgentPluginActivationRequired) => Promise<void>;
|
|
56
|
+
recordBundledAgentPluginDigests: (input: {
|
|
57
|
+
readonly workspaceRoot: string;
|
|
58
|
+
readonly seeded: Parameters<(required: {
|
|
59
|
+
readonly workspaceRoot: string;
|
|
60
|
+
readonly seeded: readonly import("./bundled-digests.js").SeededBundledAgentPluginDigest[];
|
|
61
|
+
readonly now?: ((required: Record<string, never>) => Date) | undefined;
|
|
62
|
+
}) => Promise<void>>[0]["seeded"];
|
|
63
|
+
}, optional?: {
|
|
64
|
+
readonly now?: (required: Record<string, never>) => Date;
|
|
65
|
+
}) => Promise<void>;
|
|
66
|
+
removeBundledAgentPluginDigest: (required: {
|
|
67
|
+
readonly workspaceRoot: string;
|
|
68
|
+
readonly pluginId: string;
|
|
69
|
+
}) => Promise<boolean>;
|
|
70
|
+
installAgentPlugin: (required: import("./install.js").InstallAgentPluginRequired, _optional?: import("./install.js").InstallAgentPluginOptional) => Promise<import("./types.js").InstalledAgentPlugin>;
|
|
71
|
+
installAgentPluginFromUrl: (required: import("./install-from-url.js").InstallAgentPluginFromUrlRequired, optional?: import("./install-from-url.js").InstallAgentPluginFromUrlOptional) => Promise<import("./install-from-url.js").InstalledAgentPluginFromUrl>;
|
|
72
|
+
setAgentPluginEnabled: (input: import("./set-enabled.js").SetAgentPluginEnabledInput) => Promise<import("./set-enabled.js").SetAgentPluginEnabledResult>;
|
|
73
|
+
findTrustedPluginPackages: (input: Omit<Parameters<(query: import("./trusted-plugin-files.js").TrustedPluginPackagesQuery) => Promise<readonly import("./trusted-plugin-files.js").TrustedPluginVerdict[]>>[0], "orderByPluginId" | "onInactive">, optional?: Pick<Parameters<(query: import("./trusted-plugin-files.js").TrustedPluginPackagesQuery) => Promise<readonly import("./trusted-plugin-files.js").TrustedPluginVerdict[]>>[0], "orderByPluginId" | "onInactive">) => Promise<readonly import("./trusted-plugin-files.js").TrustedPluginVerdict[]>;
|
|
74
|
+
previewAgentPluginUninstall: (required: import("./uninstall.js").UninstallAgentPluginRequired) => Promise<import("./uninstall.js").AgentPluginUninstallPreview>;
|
|
75
|
+
uninstallAgentPlugin: (required: import("./uninstall.js").UninstallAgentPluginRequired, optional?: import("./uninstall.js").UninstallAgentPluginOptional) => Promise<import("./uninstall.js").UninstallAgentPluginResult>;
|
|
76
|
+
isAgentPluginActive: (input: {
|
|
77
|
+
readonly activations: Parameters<(activations: import("./activation.js").AgentPluginActivations, pluginId: string) => boolean>[0];
|
|
78
|
+
readonly pluginId: string;
|
|
79
|
+
}) => boolean;
|
|
80
|
+
filterActiveAgentPlugins: <T>(input: {
|
|
81
|
+
readonly activations: Parameters<(activations: import("./activation.js").AgentPluginActivations, pluginId: string) => boolean>[0];
|
|
82
|
+
readonly items: readonly T[];
|
|
83
|
+
readonly pluginIdOf: (required: {
|
|
84
|
+
readonly item: T;
|
|
85
|
+
}) => string;
|
|
86
|
+
}) => readonly T[];
|
|
87
|
+
readAgentPluginActivations: (input: {
|
|
88
|
+
readonly workspaceRoot: string;
|
|
89
|
+
}) => Promise<import("./activation.js").AgentPluginActivations>;
|
|
90
|
+
assertAgentPluginActivationsWritable: (input: {
|
|
91
|
+
readonly workspaceRoot: string;
|
|
92
|
+
}) => Promise<void>;
|
|
93
|
+
isAgentPluginRecordedAsBundled: (input: {
|
|
94
|
+
readonly workspaceRoot: string;
|
|
95
|
+
readonly pluginId: string;
|
|
96
|
+
}) => Promise<boolean>;
|
|
97
|
+
resolveAgentPluginActivation: (input: {
|
|
98
|
+
readonly workspaceRoot: string;
|
|
99
|
+
readonly pluginId: string;
|
|
100
|
+
}) => Promise<import("./activation.js").AgentPluginActivationVerdict>;
|
|
101
|
+
normalizeActivations: (input: {
|
|
102
|
+
readonly value: unknown;
|
|
103
|
+
}) => import("./activation.js").AgentPluginActivations;
|
|
104
|
+
readBundledAgentPluginDigests: (input: {
|
|
105
|
+
readonly workspaceRoot: string;
|
|
106
|
+
}) => Promise<import("./bundled-digests.js").BundledAgentPluginDigests>;
|
|
107
|
+
normalizeBundledDigests: (input: {
|
|
108
|
+
readonly value: unknown;
|
|
109
|
+
}) => import("./bundled-digests.js").BundledAgentPluginDigests;
|
|
110
|
+
preferBundledAgentPluginDigests: <T extends InstalledDigestIdentity>(input: {
|
|
111
|
+
readonly installed: readonly T[];
|
|
112
|
+
readonly bundled: Parameters<(<T_1 extends InstalledDigestIdentity>(installed: readonly T_1[], bundled: import("./bundled-digests.js").BundledAgentPluginDigests) => readonly T_1[])>[1];
|
|
113
|
+
}) => readonly T[];
|
|
114
|
+
normalizePackageEntryPath: (input: {
|
|
115
|
+
readonly rawEntryPath: string;
|
|
116
|
+
}) => string;
|
|
117
|
+
assertContainedOnDisk: (input: {
|
|
118
|
+
readonly packageRoot: string;
|
|
119
|
+
readonly entryPath: string;
|
|
120
|
+
}) => Promise<string>;
|
|
121
|
+
classifyAgentPluginMcpServerTrust: (input: {
|
|
122
|
+
readonly server: Parameters<(server: Pick<import("./manifest.js").McpServerConfig, "type">) => "auto-admit" | "requires-confirmation">[0];
|
|
123
|
+
}) => "auto-admit" | "requires-confirmation";
|
|
124
|
+
readInstalledSkillMarkdown: (input: {
|
|
125
|
+
readonly packageRoot: string;
|
|
126
|
+
readonly skillPath: string;
|
|
127
|
+
}) => Promise<string>;
|
|
128
|
+
readInstalledMcpServerIds: (input: {
|
|
129
|
+
readonly packageRoot: string;
|
|
130
|
+
}) => Promise<readonly string[]>;
|
|
131
|
+
readInstalledMcpServers: (input: {
|
|
132
|
+
readonly packageRoot: string;
|
|
133
|
+
}) => Promise<Readonly<Record<string, import("./manifest.js").McpServerConfig>>>;
|
|
134
|
+
resolveAgentPluginRefs: (input: {
|
|
135
|
+
readonly pluginRefIds: readonly string[];
|
|
136
|
+
readonly workspaceLayout: Parameters<(pluginRefIds: readonly string[], workspaceLayout: Pick<import("./layout.js").AgentPluginWorkspaceLayout, "packages" | "root">, deliveryMode?: AgentPluginDeliveryMode) => Promise<import("./resolve-agent-plugin-refs.js").ResolveAgentPluginRefsResult>>[1];
|
|
137
|
+
}, optional?: {
|
|
138
|
+
readonly deliveryMode?: AgentPluginDeliveryMode;
|
|
139
|
+
}) => Promise<import("./resolve-agent-plugin-refs.js").ResolveAgentPluginRefsResult>;
|
|
140
|
+
listInstalledPlugins: (input: {
|
|
141
|
+
readonly packagesDir: string;
|
|
142
|
+
}) => Promise<readonly import("./types.js").InstalledAgentPlugin[]>;
|
|
143
|
+
isInstalledDigestPresent: (input: {
|
|
144
|
+
readonly packagesDir: string;
|
|
145
|
+
readonly archiveDigest: string;
|
|
146
|
+
}) => Promise<boolean>;
|
|
147
|
+
rankInstalledAgentPlugins: (input: {
|
|
148
|
+
readonly query: string;
|
|
149
|
+
readonly candidates: Parameters<(query: string, candidates: readonly import("./search.js").AgentPluginSearchCandidate[], limit: number) => readonly import("./search.js").AgentPluginSearchMatch[]>[1];
|
|
150
|
+
readonly limit: number;
|
|
151
|
+
}) => readonly import("./search.js").AgentPluginSearchMatch[];
|
|
152
|
+
readTrustedPluginFile: (input: {
|
|
153
|
+
readonly plugin: Parameters<(plugin: import("./trusted-plugin-files.js").TrustedPluginPackage, filename: string) => Promise<string>>[0];
|
|
154
|
+
readonly filename: string;
|
|
155
|
+
}) => Promise<string>;
|
|
156
|
+
importContainedModule: (input: {
|
|
157
|
+
readonly plugin: Parameters<(plugin: import("./trusted-plugin-files.js").TrustedPluginPackage, modulePath: string) => Promise<{
|
|
158
|
+
readonly exported: unknown;
|
|
159
|
+
} | string>>[0];
|
|
160
|
+
readonly modulePath: string;
|
|
161
|
+
}) => Promise<string | {
|
|
162
|
+
readonly exported: unknown;
|
|
163
|
+
}>;
|
|
164
|
+
maxAgentPluginInstallArchiveBytes: (_input: Record<string, never>) => number;
|
|
165
|
+
indexInstalledRoot: (input: {
|
|
166
|
+
readonly packageRoot: string;
|
|
167
|
+
readonly archiveDigest: string;
|
|
168
|
+
}) => Promise<import("./types.js").InstalledAgentPlugin>;
|
|
169
|
+
packAgentPluginDirectory: (input: {
|
|
170
|
+
readonly sourceDir: string;
|
|
171
|
+
}) => Promise<import("./bundled-source-archive.js").PackedAgentPluginArchive>;
|
|
172
|
+
createBundledSourceArchiveReader: (_input: Record<string, never>) => import("./install.js").AgentPluginArchiveReaderPort;
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { fetchAgentPluginArchive, maxAgentPluginArchiveBytes } from './fetch-archive.js';
|
|
2
|
+
import { createSeedBundledModule } from './seed-bundled.js';
|
|
3
|
+
import { createRetireBundledModule } from './retire-bundled.js';
|
|
4
|
+
import { createActivationModule } from './activation.js';
|
|
5
|
+
import { createBundledDigestsModule } from './bundled-digests.js';
|
|
6
|
+
import { createBundledSourceArchiveModule } from './bundled-source-archive.js';
|
|
7
|
+
import { createCapabilityProjectionModule } from './capability-projection.js';
|
|
8
|
+
import { createInstallModule } from './install.js';
|
|
9
|
+
import { createInstallFromUrlModule } from './install-from-url.js';
|
|
10
|
+
import { createPackagePathsModule } from './package-paths.js';
|
|
11
|
+
import { createResolveAgentPluginRefsModule } from './resolve-agent-plugin-refs.js';
|
|
12
|
+
import { createSearchModule } from './search.js';
|
|
13
|
+
import { createSetEnabledModule } from './set-enabled.js';
|
|
14
|
+
import { createTrustedPluginFilesModule } from './trusted-plugin-files.js';
|
|
15
|
+
import { createUninstallModule } from './uninstall.js';
|
|
16
|
+
export * from './ports.js';
|
|
17
|
+
export * from './layout.js';
|
|
18
|
+
export * from './manifest.js';
|
|
19
|
+
export * from './fetch-archive.js';
|
|
20
|
+
export * from './mcp-provisioning.js';
|
|
21
|
+
export { createAgentPluginActivations, ACTIVATIONS_FILENAME, ACTIVATIONS_LOCK_FILENAME, AgentPluginActivationsBusyError, AgentPluginActivationsUnreadableError } from './activation.js';
|
|
22
|
+
export { BUNDLED_DIGESTS_FILENAME } from './bundled-digests.js';
|
|
23
|
+
export { AgentPluginInstallError } from './install.js';
|
|
24
|
+
export { PackagePathViolation } from './package-paths.js';
|
|
25
|
+
export { AgentPluginNotInstalledError } from './set-enabled.js';
|
|
26
|
+
export { AgentPluginNotFoundError, AgentPluginNotUninstallableError, AgentPluginChangedSincePreviewError } from './uninstall.js';
|
|
27
|
+
/** One host context owns queues and effects. Keep this object and its ports stable for its lifetime.
|
|
28
|
+
* Installation/activation and MCP provisioning are separate operations: the host explicitly wires
|
|
29
|
+
* provisioning using the exported helpers, with its own retry/recovery policy. */
|
|
30
|
+
export function createAgentPluginLifecycle(required, optional = {}) {
|
|
31
|
+
const context = Object.keys(optional).length ? { ...required, ...optional } : required;
|
|
32
|
+
if (!context.productName.trim() || !context.extensionNamespace.trim() || !context.bundledArchiveMagic) {
|
|
33
|
+
throw new Error('productName, extensionNamespace and bundledArchiveMagic are required');
|
|
34
|
+
}
|
|
35
|
+
if (context.deliveryMode !== 'inject' && context.deliveryMode !== 'pointer')
|
|
36
|
+
throw new Error('Invalid deliveryMode');
|
|
37
|
+
const activation = createActivationModule(context);
|
|
38
|
+
const digests = createBundledDigestsModule(context);
|
|
39
|
+
const archive = createBundledSourceArchiveModule(context);
|
|
40
|
+
const capabilities = createCapabilityProjectionModule(context);
|
|
41
|
+
const install = createInstallModule(context);
|
|
42
|
+
const fromUrl = createInstallFromUrlModule(context);
|
|
43
|
+
const paths = createPackagePathsModule(context);
|
|
44
|
+
const refs = createResolveAgentPluginRefsModule(context);
|
|
45
|
+
const search = createSearchModule(context);
|
|
46
|
+
const enabled = createSetEnabledModule(context);
|
|
47
|
+
const trusted = createTrustedPluginFilesModule(context);
|
|
48
|
+
const uninstall = createUninstallModule(context);
|
|
49
|
+
return {
|
|
50
|
+
fetchAgentPluginArchive: (input, optional = {}) => fetchAgentPluginArchive({ ...input, fetch: context.fetch, outboundGuard: context.outboundGuard }, optional),
|
|
51
|
+
maxAgentPluginArchiveBytes,
|
|
52
|
+
seedBundledAgentPlugins: createSeedBundledModule(context).seedBundledAgentPlugins,
|
|
53
|
+
retireBundledAgentPlugins: createRetireBundledModule(context).retireBundledAgentPlugins,
|
|
54
|
+
setAgentPluginActivation: activation.setAgentPluginActivation,
|
|
55
|
+
recordBundledAgentPluginIfAbsent: activation.recordBundledAgentPluginIfAbsent,
|
|
56
|
+
enableBundledAgentPluginUnlessOperatorDisabled: activation.enableBundledAgentPluginUnlessOperatorDisabled,
|
|
57
|
+
deleteAgentPluginActivation: activation.deleteAgentPluginActivation,
|
|
58
|
+
recordBundledAgentPluginDigests: (input, optional = {}) => digests.recordBundledAgentPluginDigests({ ...input, ...optional }),
|
|
59
|
+
removeBundledAgentPluginDigest: digests.removeBundledAgentPluginDigest,
|
|
60
|
+
installAgentPlugin: install.installAgentPlugin,
|
|
61
|
+
installAgentPluginFromUrl: fromUrl.installAgentPluginFromUrl,
|
|
62
|
+
setAgentPluginEnabled: enabled.setAgentPluginEnabled,
|
|
63
|
+
findTrustedPluginPackages: (input, optional = {}) => trusted.findTrustedPluginPackages({ ...input, ...optional }),
|
|
64
|
+
previewAgentPluginUninstall: uninstall.previewAgentPluginUninstall,
|
|
65
|
+
uninstallAgentPlugin: uninstall.uninstallAgentPlugin,
|
|
66
|
+
isAgentPluginActive: (input) => activation.isAgentPluginActive(input.activations, input.pluginId),
|
|
67
|
+
filterActiveAgentPlugins: (input) => activation.filterActiveAgentPlugins(input.activations, input.items, item => input.pluginIdOf({ item })),
|
|
68
|
+
readAgentPluginActivations: (input) => activation.readAgentPluginActivations(input.workspaceRoot),
|
|
69
|
+
assertAgentPluginActivationsWritable: (input) => activation.assertAgentPluginActivationsWritable(input.workspaceRoot),
|
|
70
|
+
isAgentPluginRecordedAsBundled: (input) => activation.isAgentPluginRecordedAsBundled(input.workspaceRoot, input.pluginId),
|
|
71
|
+
resolveAgentPluginActivation: (input) => activation.resolveAgentPluginActivation(input.workspaceRoot, input.pluginId),
|
|
72
|
+
normalizeActivations: (input) => activation.normalizeActivations(input.value),
|
|
73
|
+
readBundledAgentPluginDigests: (input) => digests.readBundledAgentPluginDigests(input.workspaceRoot),
|
|
74
|
+
normalizeBundledDigests: (input) => digests.normalizeBundledDigests(input.value),
|
|
75
|
+
preferBundledAgentPluginDigests: (input) => digests.preferBundledAgentPluginDigests(input.installed, input.bundled),
|
|
76
|
+
normalizePackageEntryPath: (input) => paths.normalizePackageEntryPath(input.rawEntryPath),
|
|
77
|
+
assertContainedOnDisk: (input) => paths.assertContainedOnDisk(input.packageRoot, input.entryPath),
|
|
78
|
+
classifyAgentPluginMcpServerTrust: (input) => capabilities.classifyAgentPluginMcpServerTrust(input.server),
|
|
79
|
+
readInstalledSkillMarkdown: (input) => capabilities.readInstalledSkillMarkdown(input.packageRoot, input.skillPath),
|
|
80
|
+
readInstalledMcpServerIds: (input) => capabilities.readInstalledMcpServerIds(input.packageRoot),
|
|
81
|
+
readInstalledMcpServers: (input) => capabilities.readInstalledMcpServers(input.packageRoot),
|
|
82
|
+
resolveAgentPluginRefs: (input, optional = {}) => refs.resolveAgentPluginRefs(input.pluginRefIds, input.workspaceLayout, optional.deliveryMode ?? context.deliveryMode),
|
|
83
|
+
listInstalledPlugins: (input) => refs.listInstalledPlugins(input.packagesDir),
|
|
84
|
+
isInstalledDigestPresent: (input) => refs.isInstalledDigestPresent(input.packagesDir, input.archiveDigest),
|
|
85
|
+
rankInstalledAgentPlugins: (input) => search.rankInstalledAgentPlugins(input.query, input.candidates, input.limit),
|
|
86
|
+
readTrustedPluginFile: (input) => trusted.readTrustedPluginFile(input.plugin, input.filename),
|
|
87
|
+
importContainedModule: (input) => trusted.importContainedModule(input.plugin, input.modulePath),
|
|
88
|
+
maxAgentPluginInstallArchiveBytes: (_input) => install.maxAgentPluginInstallArchiveBytes(),
|
|
89
|
+
indexInstalledRoot: (input) => install.indexInstalledRoot(input.packageRoot, input.archiveDigest),
|
|
90
|
+
packAgentPluginDirectory: (input) => archive.packAgentPluginDirectory(input.sourceDir),
|
|
91
|
+
createBundledSourceArchiveReader: (_input) => archive.createBundledSourceArchiveReader(),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Historical lifecycle rationale, carried with the implementation during consumer adoption.
|
|
3
|
+
*
|
|
4
|
+
* Host command-line rationale retained when the unused URL-install CLI was removed:
|
|
5
|
+
* - A digest-only preview downloads and reports SHA-256 without installing. Hashing those bytes
|
|
6
|
+
* does not establish provenance; the host must make that distinction visible to the operator.
|
|
7
|
+
* - A real install requires exactly one explicit integrity decision: an independent pinned digest
|
|
8
|
+
* or trust-on-first-use. Missing or conflicting choices must be refused before execution, with
|
|
9
|
+
* diagnostics naming the choice the operator needs to supply.
|
|
10
|
+
* - Keep pure token classification separate from argument validation and exit/reporting effects,
|
|
11
|
+
* so both parsing and legal combinations are directly testable without a network or process exit.
|
|
12
|
+
* - The CLI composes shared download/extraction operations; digest verification, expansion bounds,
|
|
13
|
+
* path containment and tenant isolation belong in those operations rather than a CLI-only guard.
|
|
14
|
+
* @file The one composition step that turns "here is an address" into "the plugin is on this
|
|
15
|
+
* machine": {@link fetchAgentPluginArchive} -> `installAgentPlugin`.
|
|
16
|
+
*
|
|
17
|
+
* This is the caller `install.ts` was written for and never had. It adds no extraction, path, or
|
|
18
|
+
* manifest logic of its own — every one of those guarantees still comes from `install.ts`, reached
|
|
19
|
+
* with bytes instead of a URL.
|
|
20
|
+
*
|
|
21
|
+
* ---------------------------------------------------------------------------
|
|
22
|
+
* Why integrity is a tagged union and not an optional string
|
|
23
|
+
* ---------------------------------------------------------------------------
|
|
24
|
+
* `installAgentPlugin` requires `expectedSha256` and refuses to extract unverified bytes. That is
|
|
25
|
+
* its central security property. A download flow has an obvious temptation: hash whatever arrived
|
|
26
|
+
* and pass that in — which type-checks, always "passes", and silently converts digest verification
|
|
27
|
+
* into a no-op.
|
|
28
|
+
*
|
|
29
|
+
* So the choice is made explicit and greppable instead of implied by an absent argument:
|
|
30
|
+
* `{ kind: "pinned", sha256 }` verifies against a digest the caller obtained out-of-band (a
|
|
31
|
+
* registry's own metadata, a release note, a prior `--print-digest` run), and
|
|
32
|
+
* `{ kind: "trust-on-first-use" }` states in the call site itself that this install trusts the
|
|
33
|
+
* transport and the host, nothing more. Both reach the identical `installAgentPlugin` call; the
|
|
34
|
+
* difference is entirely in whether the digest came from somewhere other than the bytes.
|
|
35
|
+
*/
|
|
36
|
+
import { type FetchAgentPluginArchiveOptional } from "./fetch-archive.js";
|
|
37
|
+
import { type AgentPluginArchiveReaderPort, type InstalledAgentPlugin } from "./install.js";
|
|
38
|
+
import type { AgentPluginLifecyclePorts } from "./ports.js";
|
|
39
|
+
import type { AgentPluginLayout } from "./layout.js";
|
|
40
|
+
/**
|
|
41
|
+
* See this module's header for why this is a union rather than an optional `expectedSha256`.
|
|
42
|
+
*/
|
|
43
|
+
export type AgentPluginIntegrity = {
|
|
44
|
+
readonly kind: "pinned";
|
|
45
|
+
readonly sha256: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "trust-on-first-use";
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Lowercase hex SHA-256 obtained OUT-OF-BAND — never computed from the downloaded bytes.
|
|
51
|
+
*/
|
|
52
|
+
export interface InstallAgentPluginFromUrlRequired {
|
|
53
|
+
readonly url: string;
|
|
54
|
+
readonly integrity: AgentPluginIntegrity;
|
|
55
|
+
readonly layout: AgentPluginLayout;
|
|
56
|
+
readonly workspaceId: string;
|
|
57
|
+
readonly archiveReader: AgentPluginArchiveReaderPort;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The instance-level layout. Passed straight through to `installAgentPlugin`, which is the only
|
|
61
|
+
* thing that may call `forWorkspace` — see its own SECURITY note.
|
|
62
|
+
*/
|
|
63
|
+
export interface InstallAgentPluginFromUrlOptional {
|
|
64
|
+
readonly fetch?: (FetchAgentPluginArchiveOptional) | undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Defaults to {@link yauzlAgentPluginArchiveReader} — the only real reader in the tree.
|
|
68
|
+
*/
|
|
69
|
+
export interface InstalledAgentPluginFromUrl {
|
|
70
|
+
readonly installed: InstalledAgentPlugin;
|
|
71
|
+
readonly resolvedUrl: string;
|
|
72
|
+
readonly sha256: string;
|
|
73
|
+
readonly digestWasPinned: boolean;
|
|
74
|
+
}
|
|
75
|
+
export declare function createInstallFromUrlModule(ports: AgentPluginLifecyclePorts): {
|
|
76
|
+
installAgentPluginFromUrl: (required: InstallAgentPluginFromUrlRequired, optional?: InstallAgentPluginFromUrlOptional) => Promise<InstalledAgentPluginFromUrl>;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=install-from-url.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Historical lifecycle rationale, carried with the implementation during consumer adoption.
|
|
3
|
+
*
|
|
4
|
+
* Host command-line rationale retained when the unused URL-install CLI was removed:
|
|
5
|
+
* - A digest-only preview downloads and reports SHA-256 without installing. Hashing those bytes
|
|
6
|
+
* does not establish provenance; the host must make that distinction visible to the operator.
|
|
7
|
+
* - A real install requires exactly one explicit integrity decision: an independent pinned digest
|
|
8
|
+
* or trust-on-first-use. Missing or conflicting choices must be refused before execution, with
|
|
9
|
+
* diagnostics naming the choice the operator needs to supply.
|
|
10
|
+
* - Keep pure token classification separate from argument validation and exit/reporting effects,
|
|
11
|
+
* so both parsing and legal combinations are directly testable without a network or process exit.
|
|
12
|
+
* - The CLI composes shared download/extraction operations; digest verification, expansion bounds,
|
|
13
|
+
* path containment and tenant isolation belong in those operations rather than a CLI-only guard.
|
|
14
|
+
* @file The one composition step that turns "here is an address" into "the plugin is on this
|
|
15
|
+
* machine": {@link fetchAgentPluginArchive} -> `installAgentPlugin`.
|
|
16
|
+
*
|
|
17
|
+
* This is the caller `install.ts` was written for and never had. It adds no extraction, path, or
|
|
18
|
+
* manifest logic of its own — every one of those guarantees still comes from `install.ts`, reached
|
|
19
|
+
* with bytes instead of a URL.
|
|
20
|
+
*
|
|
21
|
+
* ---------------------------------------------------------------------------
|
|
22
|
+
* Why integrity is a tagged union and not an optional string
|
|
23
|
+
* ---------------------------------------------------------------------------
|
|
24
|
+
* `installAgentPlugin` requires `expectedSha256` and refuses to extract unverified bytes. That is
|
|
25
|
+
* its central security property. A download flow has an obvious temptation: hash whatever arrived
|
|
26
|
+
* and pass that in — which type-checks, always "passes", and silently converts digest verification
|
|
27
|
+
* into a no-op.
|
|
28
|
+
*
|
|
29
|
+
* So the choice is made explicit and greppable instead of implied by an absent argument:
|
|
30
|
+
* `{ kind: "pinned", sha256 }` verifies against a digest the caller obtained out-of-band (a
|
|
31
|
+
* registry's own metadata, a release note, a prior `--print-digest` run), and
|
|
32
|
+
* `{ kind: "trust-on-first-use" }` states in the call site itself that this install trusts the
|
|
33
|
+
* transport and the host, nothing more. Both reach the identical `installAgentPlugin` call; the
|
|
34
|
+
* difference is entirely in whether the digest came from somewhere other than the bytes.
|
|
35
|
+
*/
|
|
36
|
+
import { fetchAgentPluginArchive } from "./fetch-archive.js";
|
|
37
|
+
import { createInstallModule } from "./install.js";
|
|
38
|
+
export function createInstallFromUrlModule(ports) {
|
|
39
|
+
const { installAgentPlugin } = createInstallModule(ports);
|
|
40
|
+
/**
|
|
41
|
+
* The URL the bytes actually came from, after redirects.
|
|
42
|
+
*
|
|
43
|
+
* Echoed so a `trust-on-first-use` caller can print the digest to pin on the next install.
|
|
44
|
+
*
|
|
45
|
+
* True when the digest was supplied out-of-band and verified, false for trust-on-first-use.
|
|
46
|
+
* Callers surface this so an unpinned install is never mistaken for a verified one.
|
|
47
|
+
*
|
|
48
|
+
* Downloads a plugin archive and installs it into this workspace's own on-disk package store.
|
|
49
|
+
*
|
|
50
|
+
* @throws {AgentPluginFetchError} For a download failure — bad URL, HTTP error, oversized body.
|
|
51
|
+
* @throws {AgentPluginInstallError} For everything after the bytes arrive — digest mismatch,
|
|
52
|
+
* hostile archive, invalid manifest. Both are thrown unchanged, so a caller can branch on `code`.
|
|
53
|
+
* @complexity O(b) in archive bytes; extraction cost is bounded by `install.ts`'s own `LIMITS`.
|
|
54
|
+
*
|
|
55
|
+
* For "pinned", this is the caller's out-of-band digest and `installAgentPlugin` genuinely
|
|
56
|
+
* verifies it. For "trust-on-first-use", it is the digest of the download itself, so that check
|
|
57
|
+
* is a tautology — which is exactly what the union's name says out loud at the call site.
|
|
58
|
+
*/
|
|
59
|
+
async function installAgentPluginFromUrl(required, optional = {}) {
|
|
60
|
+
const { archive, sha256, resolvedUrl } = await fetchAgentPluginArchive({ url: required.url, fetch: ports.fetch, outboundGuard: ports.outboundGuard }, optional.fetch);
|
|
61
|
+
const expectedSha256 = required.integrity.kind === "pinned" ? required.integrity.sha256 : sha256;
|
|
62
|
+
const installed = await installAgentPlugin({
|
|
63
|
+
archive,
|
|
64
|
+
expectedSha256,
|
|
65
|
+
archiveReader: required.archiveReader,
|
|
66
|
+
layout: required.layout,
|
|
67
|
+
workspaceId: required.workspaceId,
|
|
68
|
+
});
|
|
69
|
+
return { installed, resolvedUrl, sha256, digestWasPinned: required.integrity.kind === "pinned" };
|
|
70
|
+
}
|
|
71
|
+
return { installAgentPluginFromUrl };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=install-from-url.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AgentPluginLayout } from "./layout.js";
|
|
2
|
+
import type { AgentPluginLifecyclePorts } from "./ports.js";
|
|
3
|
+
import type { InstalledAgentPlugin } from "./types.js";
|
|
4
|
+
export type { InstalledAgentPlugin, InstalledAgentPluginSkill } from "./types.js";
|
|
5
|
+
export type AgentPluginInstallErrorCode = "ARCHIVE_TOO_LARGE" | "DIGEST_MISMATCH" | "TOO_MANY_ENTRIES" | "UNSAFE_ENTRY_PATH" | "SYMLINK_ENTRY_REJECTED" | "UNSUPPORTED_ENTRY_KIND" | "DUPLICATE_ENTRY" | "FILE_TOO_LARGE" | "DECOMPRESSION_BOMB" | "TOTAL_SIZE_EXCEEDED" | "MANIFEST_MISSING" | "MANIFEST_INVALID" | "PUBLISH_FAILED";
|
|
6
|
+
export declare class AgentPluginInstallError extends Error {
|
|
7
|
+
readonly code: AgentPluginInstallErrorCode;
|
|
8
|
+
constructor({ code, message }: {
|
|
9
|
+
readonly code: AgentPluginInstallErrorCode;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
}, options?: {
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export type AgentPluginArchiveEntry = {
|
|
16
|
+
readonly kind: "file";
|
|
17
|
+
readonly entryPath: string;
|
|
18
|
+
readonly declaredSize?: (number) | undefined;
|
|
19
|
+
readonly executable?: (boolean) | undefined;
|
|
20
|
+
readonly openReadStream: (required: Record<string, never>) => AsyncIterable<Uint8Array>;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: "directory";
|
|
23
|
+
readonly entryPath: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: "symlink" | "hardlink" | "device" | "fifo";
|
|
26
|
+
readonly entryPath: string;
|
|
27
|
+
readonly linkTarget?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* `entries` must be a pure function of the archive bytes: an install iterates it twice, once to
|
|
31
|
+
* check entry-count limits from metadata alone and once to extract.
|
|
32
|
+
*/
|
|
33
|
+
export interface AgentPluginArchiveReaderPort {
|
|
34
|
+
entries(required: {
|
|
35
|
+
readonly archive: Uint8Array;
|
|
36
|
+
}): AsyncIterable<AgentPluginArchiveEntry>;
|
|
37
|
+
}
|
|
38
|
+
export interface InstallAgentPluginRequired {
|
|
39
|
+
readonly archive: Uint8Array;
|
|
40
|
+
readonly expectedSha256: string;
|
|
41
|
+
readonly archiveReader: AgentPluginArchiveReaderPort;
|
|
42
|
+
readonly layout: AgentPluginLayout;
|
|
43
|
+
readonly workspaceId: string;
|
|
44
|
+
}
|
|
45
|
+
export type InstallAgentPluginOptional = {};
|
|
46
|
+
/** Internal composition; one state/queue instance per injected host context. */
|
|
47
|
+
export declare function createInstallModule(ports: AgentPluginLifecyclePorts): {
|
|
48
|
+
maxAgentPluginInstallArchiveBytes: () => number;
|
|
49
|
+
installAgentPlugin: (required: InstallAgentPluginRequired, _optional?: InstallAgentPluginOptional) => Promise<InstalledAgentPlugin>;
|
|
50
|
+
indexInstalledRoot: (packageRoot: string, archiveDigest: string) => Promise<InstalledAgentPlugin>;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=install.d.ts.map
|