@microvac/plugin-sdk 0.0.0-stage → 0.1.0-rc.14

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.
Files changed (124) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1630 -2
  3. package/dist/.paperclip-build-complete +1 -0
  4. package/dist/bundlers.d.ts +57 -0
  5. package/dist/bundlers.d.ts.map +1 -0
  6. package/dist/bundlers.js +106 -0
  7. package/dist/bundlers.js.map +1 -0
  8. package/dist/define-plugin.d.ts +444 -0
  9. package/dist/define-plugin.d.ts.map +1 -0
  10. package/dist/define-plugin.js +37 -0
  11. package/dist/define-plugin.js.map +1 -0
  12. package/dist/dev-cli.d.ts +3 -0
  13. package/dist/dev-cli.d.ts.map +1 -0
  14. package/dist/dev-cli.js +49 -0
  15. package/dist/dev-cli.js.map +1 -0
  16. package/dist/dev-server.d.ts +34 -0
  17. package/dist/dev-server.d.ts.map +1 -0
  18. package/dist/dev-server.js +194 -0
  19. package/dist/dev-server.js.map +1 -0
  20. package/dist/environment-acquire-error.d.ts +19 -0
  21. package/dist/environment-acquire-error.d.ts.map +1 -0
  22. package/dist/environment-acquire-error.js +44 -0
  23. package/dist/environment-acquire-error.js.map +1 -0
  24. package/dist/environment-creation-cleanup.d.ts +45 -0
  25. package/dist/environment-creation-cleanup.d.ts.map +1 -0
  26. package/dist/environment-creation-cleanup.js +105 -0
  27. package/dist/environment-creation-cleanup.js.map +1 -0
  28. package/dist/environment-resume-error.d.ts +35 -0
  29. package/dist/environment-resume-error.d.ts.map +1 -0
  30. package/dist/environment-resume-error.js +67 -0
  31. package/dist/environment-resume-error.js.map +1 -0
  32. package/dist/environment-runner-ingress-error.d.ts +13 -0
  33. package/dist/environment-runner-ingress-error.d.ts.map +1 -0
  34. package/dist/environment-runner-ingress-error.js +39 -0
  35. package/dist/environment-runner-ingress-error.js.map +1 -0
  36. package/dist/environment-stop-error.d.ts +14 -0
  37. package/dist/environment-stop-error.d.ts.map +1 -0
  38. package/dist/environment-stop-error.js +44 -0
  39. package/dist/environment-stop-error.js.map +1 -0
  40. package/dist/environment-sync-error.d.ts +25 -0
  41. package/dist/environment-sync-error.d.ts.map +1 -0
  42. package/dist/environment-sync-error.js +125 -0
  43. package/dist/environment-sync-error.js.map +1 -0
  44. package/dist/environment-task-error.d.ts +25 -0
  45. package/dist/environment-task-error.d.ts.map +1 -0
  46. package/dist/environment-task-error.js +73 -0
  47. package/dist/environment-task-error.js.map +1 -0
  48. package/dist/environment-tasks.d.ts +565 -0
  49. package/dist/environment-tasks.d.ts.map +1 -0
  50. package/dist/environment-tasks.js +269 -0
  51. package/dist/environment-tasks.js.map +1 -0
  52. package/dist/host-client-factory.d.ts +336 -0
  53. package/dist/host-client-factory.d.ts.map +1 -0
  54. package/dist/host-client-factory.js +754 -0
  55. package/dist/host-client-factory.js.map +1 -0
  56. package/dist/idle-drain.d.ts +14 -0
  57. package/dist/idle-drain.d.ts.map +1 -0
  58. package/dist/idle-drain.js +72 -0
  59. package/dist/idle-drain.js.map +1 -0
  60. package/dist/idle-drain.test.d.ts +2 -0
  61. package/dist/idle-drain.test.d.ts.map +1 -0
  62. package/dist/idle-drain.test.js +52 -0
  63. package/dist/idle-drain.test.js.map +1 -0
  64. package/dist/index.d.ts +110 -0
  65. package/dist/index.d.ts.map +1 -0
  66. package/dist/index.js +97 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/invocation-tracer.d.ts +10 -0
  69. package/dist/invocation-tracer.d.ts.map +1 -0
  70. package/dist/invocation-tracer.js +61 -0
  71. package/dist/invocation-tracer.js.map +1 -0
  72. package/dist/protocol.d.ts +2519 -0
  73. package/dist/protocol.d.ts.map +1 -0
  74. package/dist/protocol.duplex-channel.test.d.ts +2 -0
  75. package/dist/protocol.duplex-channel.test.d.ts.map +1 -0
  76. package/dist/protocol.duplex-channel.test.js +229 -0
  77. package/dist/protocol.duplex-channel.test.js.map +1 -0
  78. package/dist/protocol.js +368 -0
  79. package/dist/protocol.js.map +1 -0
  80. package/dist/testing.d.ts +258 -0
  81. package/dist/testing.d.ts.map +1 -0
  82. package/dist/testing.js +2624 -0
  83. package/dist/testing.js.map +1 -0
  84. package/dist/types.d.ts +2028 -0
  85. package/dist/types.d.ts.map +1 -0
  86. package/dist/types.js +23 -0
  87. package/dist/types.js.map +1 -0
  88. package/dist/ui/clipboard.d.ts +8 -0
  89. package/dist/ui/clipboard.d.ts.map +1 -0
  90. package/dist/ui/clipboard.js +12 -0
  91. package/dist/ui/clipboard.js.map +1 -0
  92. package/dist/ui/components.d.ts +518 -0
  93. package/dist/ui/components.d.ts.map +1 -0
  94. package/dist/ui/components.js +135 -0
  95. package/dist/ui/components.js.map +1 -0
  96. package/dist/ui/hooks.d.ts +155 -0
  97. package/dist/ui/hooks.d.ts.map +1 -0
  98. package/dist/ui/hooks.js +195 -0
  99. package/dist/ui/hooks.js.map +1 -0
  100. package/dist/ui/index.d.ts +55 -0
  101. package/dist/ui/index.d.ts.map +1 -0
  102. package/dist/ui/index.js +52 -0
  103. package/dist/ui/index.js.map +1 -0
  104. package/dist/ui/runtime.d.ts +3 -0
  105. package/dist/ui/runtime.d.ts.map +1 -0
  106. package/dist/ui/runtime.js +30 -0
  107. package/dist/ui/runtime.js.map +1 -0
  108. package/dist/ui/types.d.ts +423 -0
  109. package/dist/ui/types.d.ts.map +1 -0
  110. package/dist/ui/types.js +17 -0
  111. package/dist/ui/types.js.map +1 -0
  112. package/dist/worker-rpc-host.d.ts +93 -0
  113. package/dist/worker-rpc-host.d.ts.map +1 -0
  114. package/dist/worker-rpc-host.js +2086 -0
  115. package/dist/worker-rpc-host.js.map +1 -0
  116. package/dist/workspace-operation-error.d.ts +46 -0
  117. package/dist/workspace-operation-error.d.ts.map +1 -0
  118. package/dist/workspace-operation-error.js +78 -0
  119. package/dist/workspace-operation-error.js.map +1 -0
  120. package/dist/workspace-provider.d.ts +395 -0
  121. package/dist/workspace-provider.d.ts.map +1 -0
  122. package/dist/workspace-provider.js +182 -0
  123. package/dist/workspace-provider.js.map +1 -0
  124. package/package.json +85 -4
@@ -0,0 +1 @@
1
+ {"sources":"6b3ef9a2d0d129657fca0b4b6dc9f5287eb62d6b19107ed6a64aa6b0d38fb3e9","outputs":"a22f9b16a7f14b0f7ce720abe0020ce2557e14a2baff43c4ba20f9a050f72601"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Bundling presets for Paperclip plugins.
3
+ *
4
+ * These helpers return plain config objects so plugin authors can use them
5
+ * with esbuild or rollup without re-implementing host contract defaults.
6
+ */
7
+ export interface PluginBundlerPresetInput {
8
+ pluginRoot?: string;
9
+ manifestEntry?: string;
10
+ workerEntry?: string;
11
+ uiEntry?: string;
12
+ outdir?: string;
13
+ sourcemap?: boolean;
14
+ minify?: boolean;
15
+ }
16
+ export interface EsbuildLikeOptions {
17
+ entryPoints: string[];
18
+ outdir: string;
19
+ bundle: boolean;
20
+ format: "esm";
21
+ platform: "node" | "browser";
22
+ target: string;
23
+ sourcemap?: boolean;
24
+ minify?: boolean;
25
+ external?: string[];
26
+ }
27
+ export interface RollupLikeConfig {
28
+ input: string;
29
+ output: {
30
+ dir: string;
31
+ format: "es";
32
+ sourcemap?: boolean;
33
+ entryFileNames?: string;
34
+ };
35
+ external?: string[];
36
+ plugins?: unknown[];
37
+ }
38
+ export interface PluginBundlerPresets {
39
+ esbuild: {
40
+ worker: EsbuildLikeOptions;
41
+ ui?: EsbuildLikeOptions;
42
+ manifest: EsbuildLikeOptions;
43
+ };
44
+ rollup: {
45
+ worker: RollupLikeConfig;
46
+ ui?: RollupLikeConfig;
47
+ manifest: RollupLikeConfig;
48
+ };
49
+ }
50
+ /**
51
+ * Build esbuild/rollup baseline configs for plugin worker, manifest, and UI bundles.
52
+ *
53
+ * The presets intentionally externalize host/runtime deps (`react`, SDK packages)
54
+ * to match the Paperclip plugin loader contract.
55
+ */
56
+ export declare function createPluginBundlerPresets(input?: PluginBundlerPresetInput): PluginBundlerPresets;
57
+ //# sourceMappingURL=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;QACN,MAAM,EAAE,gBAAgB,CAAC;QACzB,EAAE,CAAC,EAAE,gBAAgB,CAAC;QACtB,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,wBAA6B,GAAG,oBAAoB,CAoGrG"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Bundling presets for Paperclip plugins.
3
+ *
4
+ * These helpers return plain config objects so plugin authors can use them
5
+ * with esbuild or rollup without re-implementing host contract defaults.
6
+ */
7
+ /**
8
+ * Build esbuild/rollup baseline configs for plugin worker, manifest, and UI bundles.
9
+ *
10
+ * The presets intentionally externalize host/runtime deps (`react`, SDK packages)
11
+ * to match the Paperclip plugin loader contract.
12
+ */
13
+ export function createPluginBundlerPresets(input = {}) {
14
+ const uiExternal = [
15
+ "@paperclipai/plugin-sdk/ui",
16
+ "@paperclipai/plugin-sdk/ui/hooks",
17
+ "react",
18
+ "react-dom",
19
+ "react/jsx-runtime",
20
+ ];
21
+ const outdir = input.outdir ?? "dist";
22
+ const workerEntry = input.workerEntry ?? "src/worker.ts";
23
+ const manifestEntry = input.manifestEntry ?? "src/manifest.ts";
24
+ const uiEntry = input.uiEntry;
25
+ const sourcemap = input.sourcemap ?? true;
26
+ const minify = input.minify ?? false;
27
+ const esbuildWorker = {
28
+ entryPoints: [workerEntry],
29
+ outdir,
30
+ bundle: true,
31
+ format: "esm",
32
+ platform: "node",
33
+ target: "node24",
34
+ sourcemap,
35
+ minify,
36
+ external: ["react", "react-dom"],
37
+ };
38
+ const esbuildManifest = {
39
+ entryPoints: [manifestEntry],
40
+ outdir,
41
+ bundle: true,
42
+ format: "esm",
43
+ platform: "node",
44
+ target: "node24",
45
+ sourcemap,
46
+ external: ["@paperclipai/plugin-sdk"],
47
+ };
48
+ const esbuildUi = uiEntry
49
+ ? {
50
+ entryPoints: [uiEntry],
51
+ outdir: `${outdir}/ui`,
52
+ bundle: true,
53
+ format: "esm",
54
+ platform: "browser",
55
+ target: "es2022",
56
+ sourcemap,
57
+ minify,
58
+ external: uiExternal,
59
+ }
60
+ : undefined;
61
+ const rollupWorker = {
62
+ input: workerEntry,
63
+ output: {
64
+ dir: outdir,
65
+ format: "es",
66
+ sourcemap,
67
+ entryFileNames: "worker.js",
68
+ },
69
+ external: ["react", "react-dom"],
70
+ };
71
+ const rollupManifest = {
72
+ input: manifestEntry,
73
+ output: {
74
+ dir: outdir,
75
+ format: "es",
76
+ sourcemap,
77
+ entryFileNames: "manifest.js",
78
+ },
79
+ external: ["@paperclipai/plugin-sdk"],
80
+ };
81
+ const rollupUi = uiEntry
82
+ ? {
83
+ input: uiEntry,
84
+ output: {
85
+ dir: `${outdir}/ui`,
86
+ format: "es",
87
+ sourcemap,
88
+ entryFileNames: "index.js",
89
+ },
90
+ external: uiExternal,
91
+ }
92
+ : undefined;
93
+ return {
94
+ esbuild: {
95
+ worker: esbuildWorker,
96
+ manifest: esbuildManifest,
97
+ ...(esbuildUi ? { ui: esbuildUi } : {}),
98
+ },
99
+ rollup: {
100
+ worker: rollupWorker,
101
+ manifest: rollupManifest,
102
+ ...(rollupUi ? { ui: rollupUi } : {}),
103
+ },
104
+ };
105
+ }
106
+ //# sourceMappingURL=bundlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundlers.js","sourceRoot":"","sources":["../src/bundlers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiDH;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAK,GAA6B,EAAE;IAC7E,MAAM,UAAU,GAAG;QACjB,4BAA4B;QAC5B,kCAAkC;QAClC,OAAO;QACP,WAAW;QACX,mBAAmB;KACpB,CAAC;IAEF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,eAAe,CAAC;IACzD,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,IAAI,iBAA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AAa;QACpB,MAAM,EAAE;YACN,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,IAAI;YACZ,SAAS;YACT,cAAc,EAAE,aAAa;SAC9B;QACD,QAAQ,EAAE,CAAC,yBAAyB,CAAC;KACtC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO;QACtB,CAAC,CAAC;YACA,KAAK,EAAE,OAAO;YACd,MAAM,EAAE;gBACN,GAAG,EAAE,GAAG,MAAM,KAAK;gBACnB,MAAM,EAAE,IAAa;gBACrB,SAAS;gBACT,cAAc,EAAE,UAAU;aAC3B;YACD,QAAQ,EAAE,UAAU;SACrB;QACD,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO;QACL,OAAO,EAAE;YACP,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,eAAe;YACzB,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxC;QACD,MAAM,EAAE;YACN,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,cAAc;YACxB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,444 @@
1
+ import type { PluginWorkspaceParams, PluginWorkspacePrepareParams, PluginWorkspacePrepareResult, PluginWorkspaceResult } from "./workspace-provider.js";
2
+ import type { PluginEnvironmentTaskParams, PluginEnvironmentTaskResult } from "./environment-tasks.js";
3
+ import type { AgentLifecycleRequest, AgentLifecycleResult } from "@paperclipai/shared";
4
+ import type { AiConnectionRouterRequest, AiConnectionRouterResult } from "@paperclipai/shared";
5
+ /**
6
+ * `definePlugin` — the top-level helper for authoring a Paperclip plugin.
7
+ *
8
+ * Plugin authors call `definePlugin()` and export the result as the default
9
+ * export from their worker entrypoint. The host imports the worker module,
10
+ * calls `setup()` with a `PluginContext`, and from that point the plugin
11
+ * responds to events, jobs, webhooks, and UI requests through the context.
12
+ *
13
+ * @see PLUGIN_SPEC.md §14.1 — Example SDK Shape
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // dist/worker.ts
18
+ * import { definePlugin } from "@paperclipai/plugin-sdk";
19
+ *
20
+ * export default definePlugin({
21
+ * async setup(ctx) {
22
+ * ctx.logger.info("Linear sync plugin starting");
23
+ *
24
+ * // Subscribe to events
25
+ * ctx.events.on("issue.created", async (event) => {
26
+ * const companyId = event.companyId;
27
+ * const config = await ctx.config.get(companyId);
28
+ * const apiKey = await ctx.secrets.resolve(config.apiKeyRef, { companyId, configPath: "apiKeyRef" });
29
+ * await ctx.http.fetch(`https://api.linear.app/...`, {
30
+ * method: "POST",
31
+ * headers: { Authorization: `Bearer ${apiKey}` },
32
+ * body: JSON.stringify({ title: event.payload.title }),
33
+ * });
34
+ * });
35
+ *
36
+ * // Register a job handler
37
+ * ctx.jobs.register("full-sync", async (job) => {
38
+ * ctx.logger.info("Running full-sync job", { runId: job.runId });
39
+ * // ... sync logic
40
+ * });
41
+ *
42
+ * // Register data for the UI
43
+ * ctx.data.register("sync-health", async ({ companyId }) => {
44
+ * const state = await ctx.state.get({
45
+ * scopeKind: "company",
46
+ * scopeId: String(companyId),
47
+ * stateKey: "last-sync",
48
+ * });
49
+ * return { lastSync: state };
50
+ * });
51
+ * },
52
+ * });
53
+ * ```
54
+ */
55
+ import type { PluginContext, ResourceLifecycleEvent, ResourceLifecycleResult } from "./types.js";
56
+ import type { PluginEnvironmentAcquireLeaseParams, PluginEnvironmentDestroyLeaseParams, PluginEnvironmentInspectLeaseParams, PluginEnvironmentLeaseObservation, PluginEnvironmentExecuteParams, PluginEnvironmentExecuteResult, PluginEnvironmentRunnerIngressEndpointParams, PluginEnvironmentRunnerIngressEndpoint, PluginEnvironmentSyncInParams, PluginEnvironmentSyncOutParams, PluginEnvironmentSyncResult, PluginEnvironmentStartInteractiveSetupParams, PluginEnvironmentInteractiveSetupSession, PluginEnvironmentGetInteractiveSetupParams, PluginEnvironmentCaptureTemplateParams, PluginEnvironmentCaptureTemplateResult, PluginEnvironmentCancelInteractiveSetupParams, PluginEnvironmentCancelInteractiveSetupResult, PluginEnvironmentDeleteTemplateParams, PluginEnvironmentDeleteTemplateResult, PluginEnvironmentLease, PluginEnvironmentProbeParams, PluginEnvironmentProbeResult, PluginEnvironmentRealizeWorkspaceParams, PluginEnvironmentRealizeWorkspaceResult, PluginEnvironmentReleaseLeaseParams, PluginEnvironmentTerminationReceipt, PluginEnvironmentResumeLeaseParams, PluginEnvironmentValidateConfigParams, PluginEnvironmentValidationResult, DetectExternalObjectsParams, DetectExternalObjectsResult, ResolveExternalObjectParams, PluginExternalObjectResolveResult, RefreshExternalObjectsParams, RefreshExternalObjectsResult, PluginLoginPtyOpenParams, PluginLoginPtyOpenResult, PluginLoginPtyInputParams, PluginLoginPtyReadCredentialParams, PluginLoginPtyReadCredentialResult, PluginLoginPtyStopParams, PluginLoginPtyCloseParams, PluginLoginPtyCloseResult, PluginDuplexChannelOpenParams, PluginDuplexChannelOpenResult, PluginDuplexChannelWriteParams, PluginDuplexChannelStopParams, PluginDuplexChannelCloseParams, PluginDuplexChannelCloseResult } from "./protocol.js";
57
+ /**
58
+ * Optional plugin-reported diagnostics returned from the `health()` RPC method.
59
+ *
60
+ * @see PLUGIN_SPEC.md §13.2 — `health`
61
+ */
62
+ export interface PluginHealthDiagnostics {
63
+ /** Machine-readable status: `"ok"` | `"degraded"` | `"error"`. */
64
+ status: "ok" | "degraded" | "error";
65
+ /** Human-readable description of the current health state. */
66
+ message?: string;
67
+ /** Plugin-reported key-value diagnostics (e.g. connection status, queue depth). */
68
+ details?: Record<string, unknown>;
69
+ }
70
+ /**
71
+ * Result returned from the `validateConfig()` RPC method.
72
+ *
73
+ * @see PLUGIN_SPEC.md §13.3 — `validateConfig`
74
+ */
75
+ export interface PluginConfigValidationResult {
76
+ /** Whether the config is valid. */
77
+ ok: boolean;
78
+ /** Non-fatal warnings about the config. */
79
+ warnings?: string[];
80
+ /** Validation errors (populated when `ok` is `false`). */
81
+ errors?: string[];
82
+ }
83
+ /**
84
+ * Input received by the plugin worker's `handleWebhook` handler.
85
+ *
86
+ * @see PLUGIN_SPEC.md §13.7 — `handleWebhook`
87
+ */
88
+ export interface PluginWebhookInput {
89
+ /** Endpoint key matching the manifest declaration. */
90
+ endpointKey: string;
91
+ /** Inbound request headers. */
92
+ headers: Record<string, string | string[]>;
93
+ /** Raw request body as a UTF-8 string. */
94
+ rawBody: string;
95
+ /** Parsed JSON body (if applicable and parseable). */
96
+ parsedBody?: unknown;
97
+ /** Unique request identifier for idempotency checks. */
98
+ requestId: string;
99
+ }
100
+ export interface PluginApiRequestInput {
101
+ routeKey: string;
102
+ method: string;
103
+ path: string;
104
+ params: Record<string, string>;
105
+ query: Record<string, string | string[]>;
106
+ body: unknown;
107
+ actor: {
108
+ actorType: "user" | "agent";
109
+ actorId: string;
110
+ agentId?: string | null;
111
+ userId?: string | null;
112
+ runId?: string | null;
113
+ };
114
+ companyId: string;
115
+ headers: Record<string, string>;
116
+ }
117
+ export interface PluginApiResponse {
118
+ /** Server-only upstream for a declared WebSocket route. Never returned as JSON. */
119
+ websocket?: {
120
+ url: string;
121
+ headers?: Record<string, string>;
122
+ };
123
+ status?: number;
124
+ headers?: Record<string, string>;
125
+ body?: unknown;
126
+ }
127
+ /**
128
+ * Scope metadata delivered alongside a `configChanged` RPC so the worker knows
129
+ * *which company's* configuration changed.
130
+ *
131
+ * The host→worker `configChanged` message has always carried the company scope,
132
+ * but the SDK historically dropped it before invoking `onConfigChanged`, leaving
133
+ * proactive plugins to keep a single worker-global config. That is safe for a
134
+ * single-tenant plugin but silently collapses a multi-company plugin onto
135
+ * whichever company's config was delivered last. Threading the scope through
136
+ * lets a `multiCompanyConfig` plugin maintain per-company state.
137
+ *
138
+ * @see PLUGIN_SPEC.md §13.4 — `configChanged`
139
+ */
140
+ export interface PluginConfigChangeContext {
141
+ /**
142
+ * The company whose configuration changed, or `null` for an instance/global
143
+ * save that is not bound to a specific company.
144
+ */
145
+ companyId: string | null;
146
+ }
147
+ /**
148
+ * The plugin definition shape passed to `definePlugin()`.
149
+ *
150
+ * The only required field is `setup`, which receives the `PluginContext` and
151
+ * is where the plugin registers its handlers (events, jobs, data, actions,
152
+ * tools, etc.).
153
+ *
154
+ * All other lifecycle hooks are optional. If a hook is not implemented the
155
+ * host applies default behaviour (e.g. restarting the worker on config change
156
+ * instead of calling `onConfigChanged`).
157
+ *
158
+ * @see PLUGIN_SPEC.md §13 — Host-Worker Protocol
159
+ */
160
+ export interface PluginDefinition {
161
+ /**
162
+ * Called once when the plugin worker starts up, after `initialize` completes.
163
+ *
164
+ * This is where the plugin registers all its handlers: event subscriptions,
165
+ * job handlers, data/action handlers, and tool registrations. Registration
166
+ * must be synchronous after `setup` resolves — do not register handlers
167
+ * inside async callbacks that may resolve after `setup` returns.
168
+ *
169
+ * @param ctx - The full plugin context provided by the host
170
+ */
171
+ setup(ctx: PluginContext): Promise<void>;
172
+ /**
173
+ * Called when the host wants to know if the plugin is healthy.
174
+ *
175
+ * The host polls this on a regular interval and surfaces the result in the
176
+ * plugin health dashboard. If not implemented, the host infers health from
177
+ * worker process liveness.
178
+ *
179
+ * @see PLUGIN_SPEC.md §13.2 — `health`
180
+ */
181
+ onHealth?(): Promise<PluginHealthDiagnostics>;
182
+ /**
183
+ * When true, this plugin's worker correctly serves configuration from more
184
+ * than one company inside a single worker process — for example by keying its
185
+ * state on `context.companyId` in `onConfigChanged` and running one connection
186
+ * / subscription set per company.
187
+ *
188
+ * When false or omitted (the default), the plugin is treated as single-tenant.
189
+ * The host then **fails closed** if `configChanged` would ever deliver a
190
+ * second, distinct company's configuration to the same worker: instead of
191
+ * silently collapsing the worker onto whichever company arrived last (a
192
+ * cross-tenant identity/secret confusion bug), the delivery is rejected with
193
+ * `PLUGIN_RPC_ERROR_CODES.CROSS_TENANT_CONFIG`. Re-delivering an unchanged
194
+ * config for a different company (idempotent replay) is still allowed.
195
+ */
196
+ multiCompanyConfig?: boolean;
197
+ /**
198
+ * Called when the operator updates this plugin's company-scoped configuration
199
+ * at runtime, without restarting the worker.
200
+ *
201
+ * If not implemented, the host restarts the worker to apply the new config.
202
+ *
203
+ * @param newConfig - The newly resolved configuration
204
+ * @param context - Scope of the change. `context.companyId` identifies the
205
+ * company whose config changed (null for an instance/global save). A
206
+ * multi-company plugin (`multiCompanyConfig: true`) MUST key its per-company
207
+ * state on this value rather than assuming a single global config.
208
+ * @see PLUGIN_SPEC.md §13.4 — `configChanged`
209
+ */
210
+ onConfigChanged?(newConfig: Record<string, unknown>, context?: PluginConfigChangeContext): Promise<void>;
211
+ /**
212
+ * Called when the host is about to shut down the plugin worker.
213
+ *
214
+ * The worker has at most 10 seconds (configurable via plugin config) to
215
+ * finish in-flight work and resolve this promise. After the deadline the
216
+ * host sends SIGTERM, then SIGKILL.
217
+ *
218
+ * @see PLUGIN_SPEC.md §12.5 — Graceful Shutdown Policy
219
+ */
220
+ onShutdown?(): Promise<void>;
221
+ /** Prove plugin-owned background work is quiescent for idle sleep.
222
+ * The SDK first closes admission and checks accepted RPCs and notifications.
223
+ * Return `none` only when timers, sockets, detached operations and cleanup
224
+ * are settled and cannot start work until signal aborts. Do not cancel useful
225
+ * work to satisfy this check. Missing hooks, failures and uncertainty block
226
+ * sleep. The signal aborts on exact-owner release or bounded hold expiry.
227
+ * Plugins with autonomous work must keep returning `present` unless they
228
+ * can safely suspend and resume that work under this contract.
229
+ */
230
+ onIdleDrain?(signal: AbortSignal): Promise<"none" | "present" | "unknown">;
231
+ /**
232
+ * Called to validate the current plugin configuration.
233
+ *
234
+ * The host calls this:
235
+ * - after the plugin starts (to surface config errors immediately)
236
+ * - after the operator saves a new config (to validate before persisting)
237
+ * - via the "Test Connection" button in the settings UI
238
+ *
239
+ * @param config - The configuration to validate
240
+ * @see PLUGIN_SPEC.md §13.3 — `validateConfig`
241
+ */
242
+ onValidateConfig?(config: Record<string, unknown>): Promise<PluginConfigValidationResult>;
243
+ /**
244
+ * Called to handle an inbound webhook delivery.
245
+ *
246
+ * The host routes `POST /api/plugins/:pluginId/webhooks/:endpointKey` to
247
+ * this handler. The plugin is responsible for signature verification using
248
+ * a resolved secret ref.
249
+ *
250
+ * If not implemented but webhooks are declared in the manifest, the host
251
+ * returns HTTP 501 for webhook deliveries.
252
+ *
253
+ * @param input - Webhook delivery metadata and payload
254
+ * @see PLUGIN_SPEC.md §13.7 — `handleWebhook`
255
+ */
256
+ onWebhook?(input: PluginWebhookInput): Promise<void>;
257
+ /**
258
+ * Called for manifest-declared scoped JSON API routes under
259
+ * `/api/plugins/:pluginId/api/*` after the host has enforced auth, company
260
+ * access, capabilities, and checkout policy.
261
+ */
262
+ onApiRequest?(input: PluginApiRequestInput): Promise<PluginApiResponse>;
263
+ /**
264
+ * Called when Paperclip scans issue/comment/document content and asks this
265
+ * plugin whether any sanitized URL candidates belong to its external object
266
+ * providers. The host has already stripped URL userinfo, query strings, and
267
+ * fragments unless provider-safe identity components were explicitly hashed.
268
+ *
269
+ * Requires `external.objects.detect`.
270
+ */
271
+ onDetectExternalObjects?(params: DetectExternalObjectsParams): Promise<DetectExternalObjectsResult>;
272
+ /**
273
+ * Complete required work for the committed agent lifecycle phase.
274
+ * Requires manifest `agentLifecycle: true` and `agents.lifecycle.manage`.
275
+ * Echo operationId/version; return pending until the effect finishes.
276
+ * Calls can repeat. Fence older versions and make external effects idempotent.
277
+ */
278
+ onAgentLifecycle?(params: AgentLifecycleRequest): Promise<AgentLifecycleResult>;
279
+ /**
280
+ * Reconcile a committed resource event. Requires manifest resourceLifecycle and events.subscribe.
281
+ * The host acknowledges successful results and replays interrupted/unfinished work.
282
+ * Calls are at least once, in order per resource. Re-read current state and use
283
+ * idempotent external operations; deletion events remain available after the row is gone.
284
+ */
285
+ onResourceLifecycle?(event: ResourceLifecycleEvent): Promise<ResourceLifecycleResult>;
286
+ /** Propose a member from host-authorized candidates. Requires ai.connections.route. */
287
+ onRouteAiConnection?(params: AiConnectionRouterRequest): Promise<AiConnectionRouterResult>;
288
+ /**
289
+ * Called when Paperclip needs the current normalized status for one external
290
+ * object owned by a manifest-declared provider.
291
+ *
292
+ * Requires `external.objects.read`.
293
+ */
294
+ onResolveExternalObject?(params: ResolveExternalObjectParams): Promise<PluginExternalObjectResolveResult>;
295
+ /**
296
+ * Optional batch resolver used by providers that can refresh many objects
297
+ * more efficiently than individual `onResolveExternalObject` calls.
298
+ *
299
+ * Requires `external.objects.refresh`.
300
+ */
301
+ onRefreshExternalObjects?(params: RefreshExternalObjectsParams): Promise<RefreshExternalObjectsResult>;
302
+ /**
303
+ * Called to validate provider-specific configuration for a plugin-hosted
304
+ * environment driver.
305
+ */
306
+ onEnvironmentValidateConfig?(params: PluginEnvironmentValidateConfigParams): Promise<PluginEnvironmentValidationResult>;
307
+ /** Required with manifest.workspaceProvider, together with project resource lifecycle. */
308
+ onWorkspacePrepare?(params: PluginWorkspacePrepareParams): Promise<PluginWorkspacePrepareResult>;
309
+ onWorkspaceOperation?(params: PluginWorkspaceParams): Promise<PluginWorkspaceResult>;
310
+ /** Provide Runner execution: prepare resources, start Runner, connect via PRP, and manage task lifecycle. */
311
+ onEnvironmentTask?(params: PluginEnvironmentTaskParams): Promise<PluginEnvironmentTaskResult>;
312
+ /** Called to test reachability or readiness of a plugin-hosted environment. */
313
+ onEnvironmentProbe?(params: PluginEnvironmentProbeParams): Promise<PluginEnvironmentProbeResult>;
314
+ /** Called before a run starts to acquire a provider lease. */
315
+ onEnvironmentAcquireLease?(params: PluginEnvironmentAcquireLeaseParams): Promise<PluginEnvironmentLease>;
316
+ /** Called to reconnect to a previously acquired provider lease. */
317
+ onEnvironmentResumeLease?(params: PluginEnvironmentResumeLeaseParams): Promise<PluginEnvironmentLease>;
318
+ /** Called when a run finishes and the provider lease can be released. */
319
+ onEnvironmentReleaseLease?(params: PluginEnvironmentReleaseLeaseParams): Promise<PluginEnvironmentTerminationReceipt | void>;
320
+ /** Stop this exact allocation and retain all files, regardless of release
321
+ * policy. Throw if stop cannot be confirmed; never destroy as a fallback.
322
+ * Separate worker discovery lets the host safely defer older providers. */
323
+ onEnvironmentStopLease?(params: PluginEnvironmentReleaseLeaseParams): Promise<PluginEnvironmentTerminationReceipt>;
324
+ /** Called when the host needs to force-destroy provider state. */
325
+ onEnvironmentDestroyLease?(params: PluginEnvironmentDestroyLeaseParams): Promise<PluginEnvironmentTerminationReceipt | void>;
326
+ /** Read provider state only. This must not start or reconnect a sandbox. */
327
+ onEnvironmentInspectLease?(params: PluginEnvironmentInspectLeaseParams): Promise<PluginEnvironmentLeaseObservation>;
328
+ /** Called to materialize the run workspace inside the provider lease. */
329
+ onEnvironmentRealizeWorkspace?(params: PluginEnvironmentRealizeWorkspaceParams): Promise<PluginEnvironmentRealizeWorkspaceResult>;
330
+ /** Called to execute a command inside the provider lease. */
331
+ onEnvironmentExecute?(params: PluginEnvironmentExecuteParams): Promise<PluginEnvironmentExecuteResult>;
332
+ /** Return an authenticated private WebSocket ingress for runnerd. */
333
+ onEnvironmentRunnerIngressEndpoint?(params: PluginEnvironmentRunnerIngressEndpointParams): Promise<PluginEnvironmentRunnerIngressEndpoint>;
334
+ /**
335
+ * Optional, opt-in: called before execution to place host files/directories at
336
+ * target sandbox paths using a provider-native transport instead of the default
337
+ * base64-over-exec fallback. Defining this hook (together with
338
+ * `onEnvironmentSyncOut`) advertises `environmentSyncIn`; leaving it undefined
339
+ * keeps the byte-identical fallback. See `doc/plugins/SANDBOX_FILE_SYNC_HOOKS.md`.
340
+ */
341
+ onEnvironmentSyncIn?(params: PluginEnvironmentSyncInParams): Promise<PluginEnvironmentSyncResult>;
342
+ /**
343
+ * Optional, opt-in: called after execution to copy sandbox files/directories
344
+ * back to target host paths using a provider-native transport. Defining this
345
+ * hook (together with `onEnvironmentSyncIn`) advertises `environmentSyncOut`.
346
+ * See `doc/plugins/SANDBOX_FILE_SYNC_HOOKS.md`.
347
+ */
348
+ onEnvironmentSyncOut?(params: PluginEnvironmentSyncOutParams): Promise<PluginEnvironmentSyncResult>;
349
+ /** Called to start an interactive setup sandbox and return redacted connection metadata. */
350
+ onEnvironmentStartInteractiveSetup?(params: PluginEnvironmentStartInteractiveSetupParams): Promise<PluginEnvironmentInteractiveSetupSession>;
351
+ /** Called to read setup status and, when authorized, a one-time connection payload. */
352
+ onEnvironmentGetInteractiveSetup?(params: PluginEnvironmentGetInteractiveSetupParams): Promise<PluginEnvironmentInteractiveSetupSession>;
353
+ /** Called to capture a reusable provider template from a live setup sandbox. */
354
+ onEnvironmentCaptureTemplate?(params: PluginEnvironmentCaptureTemplateParams): Promise<PluginEnvironmentCaptureTemplateResult>;
355
+ /** Called to cancel and clean up a setup sandbox without promoting a template. */
356
+ onEnvironmentCancelInteractiveSetup?(params: PluginEnvironmentCancelInteractiveSetupParams): Promise<PluginEnvironmentCancelInteractiveSetupResult>;
357
+ /** Called for optional best-effort cleanup of a captured provider template. */
358
+ onEnvironmentDeleteTemplate?(params: PluginEnvironmentDeleteTemplateParams): Promise<PluginEnvironmentDeleteTemplateResult>;
359
+ /**
360
+ * Called to open one live Claude `setup-token` login pseudo-terminal.
361
+ * The worker registers the terminal under the host route identifier and returns a
362
+ * worker session identifier for the output notification binding only. The worker
363
+ * streams output and the exit through `ctx.loginPty`, never as a reply.
364
+ * Defining the four `onLoginPty*` hooks advertises the four methods.
365
+ */
366
+ onLoginPtyOpen?(params: PluginLoginPtyOpenParams): Promise<PluginLoginPtyOpenResult>;
367
+ /** Called to write delayed input to an open login pseudo-terminal, keyed by the worker session identifier. */
368
+ onLoginPtyInput?(params: PluginLoginPtyInputParams): Promise<void>;
369
+ /** Optional fixed credential read, advertised through supported-method discovery. */
370
+ onLoginPtyReadCredential?(params: PluginLoginPtyReadCredentialParams): Promise<PluginLoginPtyReadCredentialResult>;
371
+ /** Called to stop an open login pseudo-terminal child, keyed by the worker session identifier. */
372
+ onLoginPtyStop?(params: PluginLoginPtyStopParams): Promise<void>;
373
+ /**
374
+ * Called to close an open login pseudo-terminal by the host route identifier. The
375
+ * worker closes the exact terminal registered under that identifier and returns a
376
+ * close acknowledgement that carries the same identifier.
377
+ */
378
+ onLoginPtyClose?(params: PluginLoginPtyCloseParams): Promise<PluginLoginPtyCloseResult>;
379
+ /**
380
+ * Called to open one persistent duplex channel. The worker registers the
381
+ * channel under the host route identifier and returns a worker session
382
+ * identifier for the data notification binding only. The worker streams data
383
+ * and the exit through worker→host notifications, never as a reply. Defining
384
+ * the four `onDuplexChannel*` hooks advertises the four methods. The host reads
385
+ * the open verb to gate the `duplexCommandStream` capability.
386
+ *
387
+ * HTTP/2 is the preferred transport. `queue_v1` is the soft-deprecated fallback.
388
+ */
389
+ onDuplexChannelOpen?(params: PluginDuplexChannelOpenParams): Promise<PluginDuplexChannelOpenResult>;
390
+ /** Called to write raw input to an open duplex channel, keyed by the worker session identifier. */
391
+ onDuplexChannelWrite?(params: PluginDuplexChannelWriteParams): Promise<void>;
392
+ /** Called to stop an open duplex channel child, keyed by the worker session identifier. */
393
+ onDuplexChannelStop?(params: PluginDuplexChannelStopParams): Promise<void>;
394
+ /**
395
+ * Called to close an open duplex channel by the host route identifier. The
396
+ * worker closes the exact channel registered under that identifier and returns
397
+ * a close acknowledgement that carries the same identifier.
398
+ */
399
+ onDuplexChannelClose?(params: PluginDuplexChannelCloseParams): Promise<PluginDuplexChannelCloseResult>;
400
+ }
401
+ /**
402
+ * The sealed plugin object returned by `definePlugin()`.
403
+ *
404
+ * Plugin authors export this as the default export from their worker
405
+ * entrypoint. The host imports it and calls the lifecycle methods.
406
+ *
407
+ * @see PLUGIN_SPEC.md §14 — SDK Surface
408
+ */
409
+ export interface PaperclipPlugin {
410
+ /** The original plugin definition passed to `definePlugin()`. */
411
+ readonly definition: PluginDefinition;
412
+ }
413
+ /**
414
+ * Define a Paperclip plugin.
415
+ *
416
+ * Call this function in your worker entrypoint and export the result as the
417
+ * default export. The host will import the module and call lifecycle methods
418
+ * on the returned object.
419
+ *
420
+ * @param definition - Plugin lifecycle handlers
421
+ * @returns A sealed `PaperclipPlugin` object for the host to consume
422
+ *
423
+ * @example
424
+ * ```ts
425
+ * import { definePlugin } from "@paperclipai/plugin-sdk";
426
+ *
427
+ * export default definePlugin({
428
+ * async setup(ctx) {
429
+ * ctx.logger.info("Plugin started");
430
+ * ctx.events.on("issue.created", async (event) => {
431
+ * // handle event
432
+ * });
433
+ * },
434
+ *
435
+ * async onHealth() {
436
+ * return { status: "ok" };
437
+ * },
438
+ * });
439
+ * ```
440
+ *
441
+ * @see PLUGIN_SPEC.md §14.1 — Example SDK Shape
442
+ */
443
+ export declare function definePlugin(definition: PluginDefinition): PaperclipPlugin;
444
+ //# sourceMappingURL=define-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-plugin.d.ts","sourceRoot":"","sources":["../src/define-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACxJ,OAAO,KAAK,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,KAAK,EACV,mCAAmC,EACnC,mCAAmC,EACnC,mCAAmC,EACnC,iCAAiC,EACjC,8BAA8B,EAC9B,8BAA8B,EAC9B,4CAA4C,EAC5C,sCAAsC,EACtC,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,4CAA4C,EAC5C,wCA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