mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-30 05:16:50 +01:00
Merge current master and regenerate the delegated token migration
Preserve the upstream environment-skill runtime migration and regenerate the gateway responsible-user column as migration 0379. Keep the additive column idempotent. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
commit
db3190fe13
247 files changed
+14906
-803
No files matched your search
@@ -33,6 +33,17 @@ describe("plugin capability constants", () => {
|
||||
});
|
||||
|
||||
describe("plugin manifest validators", () => {
|
||||
it("limits environment skills to unique declarations owned by the plugin", () => {
|
||||
const manifest = { ...buildSandboxProviderManifest({ skillKeys: ["desktop"] }),
|
||||
capabilities: ["environment.drivers.register", "skills.managed"],
|
||||
skills: [{ skillKey: "desktop", displayName: "Desktop" }] };
|
||||
expect(pluginManifestV1Schema.parse(manifest).environmentDrivers![0].skillKeys).toEqual(["desktop"]);
|
||||
for (const keys of [["missing"], ["desktop", "desktop"]]) {
|
||||
expect(pluginManifestV1Schema.safeParse({ ...manifest,
|
||||
environmentDrivers: [{ ...manifest.environmentDrivers[0], skillKeys: keys }] }).success).toBe(false);
|
||||
}
|
||||
expect(pluginManifestV1Schema.safeParse({ ...manifest, capabilities: ["environment.drivers.register"] }).success).toBe(false);
|
||||
});
|
||||
it("requires authority for required agent lifecycle participants", () => {
|
||||
const manifest = { id: "example.lifecycle", apiVersion: 1, version: "0.1.0", displayName: "Lifecycle", description: "Lifecycle tests", author: "Tests", categories: ["automation"], entrypoints: { worker: "worker.js" }, agentLifecycle: true };
|
||||
expect(pluginManifestV1Schema.safeParse({ ...manifest, capabilities: ["agents.read"] }).success).toBe(false);
|
||||
|
||||
@@ -177,6 +177,7 @@ export type SandboxProviderCapabilitiesInput = z.infer<typeof sandboxProviderCap
|
||||
// validation error, not a silently dropped field. A misspelled capability name
|
||||
// (for example `supportsLoginPTY`) fails validation instead of dropping.
|
||||
export const pluginEnvironmentDriverDeclarationSchema = z.object({
|
||||
skillKeys: z.array(z.string().min(1).max(100)).max(100).optional(),
|
||||
supportsTasks: z.boolean().optional(),
|
||||
freshWorkspaceVersion: z.literal(1).optional(),
|
||||
warmTaskVersion: z.literal(1).optional(),
|
||||
@@ -898,6 +899,13 @@ export const pluginManifestV1Schema = z.object({
|
||||
}
|
||||
}
|
||||
|
||||
for (const [index, driver] of (manifest.environmentDrivers ?? []).entries()) {
|
||||
const keys = driver.skillKeys ?? [];
|
||||
if (new Set(keys).size !== keys.length || keys.some(key => !manifest.skills?.some(skill => skill.skillKey === key))) {
|
||||
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "Environment skill keys must be unique references to this plugin's managed skills", path: ["environmentDrivers", index, "skillKeys"] });
|
||||
}
|
||||
}
|
||||
|
||||
if (manifest.agents && manifest.agents.length > 0) {
|
||||
if (!manifest.capabilities.includes("agents.managed")) {
|
||||
ctx.addIssue({
|
||||
|
||||
Reference in new issue
Block a user