Remove mock external object provider example

This commit is contained in:
Dotta committed 2026-06-23 02:01:06 +00:00
1 parent 909379c256
commit 279df6cd5d
6 files changed
-127

No files matched your search

@@ -1,27 +0,0 @@
{
"name": "@paperclipai/plugin-mock-object-provider-example",
"version": "0.1.0",
"description": "Reference plugin that contributes a provider-neutral external object reference provider",
"type": "module",
"private": true,
"exports": {
".": "./src/index.ts"
},
"paperclipPlugin": {
"manifest": "./dist/manifest.js",
"worker": "./dist/worker.js"
},
"scripts": {
"prebuild": "node ../../../../scripts/ensure-plugin-build-deps.mjs",
"build": "tsc",
"clean": "rm -rf dist",
"typecheck": "pnpm --filter @paperclipai/plugin-sdk build && tsc --noEmit"
},
"dependencies": {
"@paperclipai/plugin-sdk": "workspace:*"
},
"devDependencies": {
"@types/node": "^24.6.0",
"typescript": "^5.7.3"
}
}
@@ -1,2 +0,0 @@
export { default as manifest } from "./manifest.js";
export { default as plugin } from "./worker.js";
@@ -1,32 +0,0 @@
import type { PaperclipPluginManifestV1 } from "@paperclipai/plugin-sdk";
const manifest: PaperclipPluginManifestV1 = {
id: "paperclipai.mock-object-provider",
apiVersion: 1,
version: "0.1.0",
displayName: "Mock Object Provider",
description: "Reference external object provider for non-GitHub URL detection and status resolution.",
author: "Paperclip",
categories: ["connector"],
capabilities: [
"external.objects.detect",
"external.objects.read",
],
entrypoints: {
worker: "./dist/worker.js",
},
objectReferences: [
{
providerKey: "mocktracker",
displayName: "Mock Tracker",
objectTypes: ["ticket"],
urlPatterns: ["https://mock.example/tickets/:id"],
refreshPolicy: {
defaultTtlSeconds: 300,
staleAfterSeconds: 1800,
},
},
],
};
export default manifest;
@@ -1,54 +0,0 @@
import { definePlugin, runWorker } from "@paperclipai/plugin-sdk";
const MOCK_TICKET_RE = /^https:\/\/mock\.example\/tickets\/([a-z0-9_-]+)$/i;
const plugin = definePlugin({
async setup(ctx) {
ctx.logger.info("Mock object provider ready");
},
async onDetectExternalObjects(params) {
return {
detections: params.urls.flatMap((url) => {
const match = MOCK_TICKET_RE.exec(url.sanitizedCanonicalUrl);
if (!match?.[1]) return [];
const id = match[1].toUpperCase();
return [{
urlIdentityHash: url.canonicalIdentityHash,
providerKey: "mocktracker",
objectType: "ticket",
externalId: `MOCK-${id}`,
displayKey: "Mock Ticket",
iconKey: "circle-dot",
displayTitle: `Mock ticket ${id}`,
confidence: "exact" as const,
}];
}),
};
},
async onResolveExternalObject(params) {
return {
ok: true as const,
snapshot: {
displayTitle: `Resolved ${params.externalId}`,
displayKey: "Mock Ticket",
iconKey: "circle-dot",
statusKey: "ready",
statusLabel: "Ready",
statusIconKey: "check-circle",
statusCategory: "succeeded" as const,
statusTone: "success" as const,
isTerminal: false,
data: {
provider: "mocktracker",
externalId: params.externalId,
},
ttlSeconds: 300,
},
};
},
});
export default plugin;
runWorker(plugin, import.meta.url);
@@ -1,9 +0,0 @@
{
"extends": "../../../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"lib": ["ES2023", "DOM"]
},
"include": ["src"]
}
-3
View File
@@ -9,9 +9,6 @@ packages:
# Keep this smoke fixture installable as a local plugin example without
# forcing PRs to commit pnpm-lock.yaml for a new workspace importer.
- "!packages/plugins/examples/plugin-orchestration-smoke-example"
# Keep this object-provider fixture installable as a local plugin example
# without forcing PRs to commit pnpm-lock.yaml for a new workspace importer.
- "!packages/plugins/examples/plugin-mock-object-provider-example"
- server
- ui
- cli