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

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,368 @@
1
+ // ---------------------------------------------------------------------------
2
+ // JSON-RPC 2.0 — Core Protocol Types
3
+ // ---------------------------------------------------------------------------
4
+ /** The JSON-RPC protocol version. Always `"2.0"`. */
5
+ export const JSONRPC_VERSION = "2.0";
6
+ // ---------------------------------------------------------------------------
7
+ // Error Codes
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * Standard JSON-RPC 2.0 error codes.
11
+ *
12
+ * @see https://www.jsonrpc.org/specification#error_object
13
+ */
14
+ export const JSONRPC_ERROR_CODES = {
15
+ /** Invalid JSON was received by the server. */
16
+ PARSE_ERROR: -32700,
17
+ /** The JSON sent is not a valid Request object. */
18
+ INVALID_REQUEST: -32600,
19
+ /** The method does not exist or is not available. */
20
+ METHOD_NOT_FOUND: -32601,
21
+ /** Invalid method parameter(s). */
22
+ INVALID_PARAMS: -32602,
23
+ /** Internal JSON-RPC error. */
24
+ INTERNAL_ERROR: -32603,
25
+ };
26
+ /**
27
+ * Paperclip plugin-specific error codes.
28
+ *
29
+ * These live in the JSON-RPC "server error" reserved range (-32000 to -32099)
30
+ * as specified by JSON-RPC 2.0 for implementation-defined server errors.
31
+ *
32
+ * @see PLUGIN_SPEC.md §19.7 — Error Propagation Through The Bridge
33
+ */
34
+ export const PLUGIN_RPC_ERROR_CODES = {
35
+ /** The worker process is not running or not reachable. */
36
+ WORKER_UNAVAILABLE: -32000,
37
+ /** The plugin does not have the required capability for this operation. */
38
+ CAPABILITY_DENIED: -32001,
39
+ /** The worker reported an unhandled error during method execution. */
40
+ WORKER_ERROR: -32002,
41
+ /** The method call timed out waiting for the worker response. */
42
+ TIMEOUT: -32003,
43
+ /** The worker does not implement the requested optional method. */
44
+ METHOD_NOT_IMPLEMENTED: -32004,
45
+ /** The worker→host call attempted to escape the current invocation company scope. */
46
+ INVOCATION_SCOPE_DENIED: -32005,
47
+ /**
48
+ * A `configChanged` delivery would have collapsed a single-tenant worker onto
49
+ * a second, distinct company's configuration. The worker fails closed instead
50
+ * of silently overwriting the already-applied tenant's config. A plugin that
51
+ * genuinely serves multiple companies from one worker must opt in via
52
+ * `multiCompanyConfig: true` on its definition.
53
+ */
54
+ CROSS_TENANT_CONFIG: -32006,
55
+ /** A catch-all for errors that do not fit other categories. */
56
+ UNKNOWN: -32099,
57
+ };
58
+ export function validateProjectSnapshotRequest(projectIds, entityType) {
59
+ if (!Array.isArray(projectIds) || !projectIds.length || projectIds.length > 64 ||
60
+ new Set(projectIds).size !== projectIds.length ||
61
+ projectIds.some(id => typeof id !== "string" || !/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(id)) ||
62
+ typeof entityType !== "string" || !/^[a-zA-Z0-9._-]{1,128}$/.test(entityType)) {
63
+ throw new Error("Invalid project snapshot scope");
64
+ }
65
+ }
66
+ /** The worker→host notification method for one pseudo-terminal output chunk. */
67
+ export const LOGIN_PTY_OUTPUT_NOTIFICATION = "loginPty.output";
68
+ /** The worker→host notification method for one pseudo-terminal exit. */
69
+ export const LOGIN_PTY_EXIT_NOTIFICATION = "loginPty.exit";
70
+ /** Encodes raw channel bytes into the wire-safe JSON-RPC representation. */
71
+ export function encodeChannelBytes(bytes) {
72
+ return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64");
73
+ }
74
+ /**
75
+ * Decodes the wire-safe JSON-RPC representation back to raw channel bytes.
76
+ * Returns `null` for a value that is not a well-formed base64 string, so a
77
+ * caller on the trust boundary treats a malformed frame as a protocol error
78
+ * instead of silently substituting the empty byte array.
79
+ */
80
+ export function decodeChannelBytes(value) {
81
+ if (typeof value !== "string" || value.length === 0)
82
+ return null;
83
+ // `Buffer.from(str, "base64")` silently drops an invalid character instead
84
+ // of throwing, so re-encode the decoded bytes and compare. A well-formed
85
+ // base64 string round-trips to itself; a malformed one does not.
86
+ const decoded = Buffer.from(value, "base64");
87
+ if (decoded.toString("base64") !== value)
88
+ return null;
89
+ return new Uint8Array(decoded.buffer, decoded.byteOffset, decoded.byteLength);
90
+ }
91
+ /** The worker→host notification method for one duplex channel data chunk. */
92
+ export const DUPLEX_CHANNEL_DATA_NOTIFICATION = "duplexChannel.data";
93
+ /** The worker→host notification method for one duplex channel exit. */
94
+ export const DUPLEX_CHANNEL_EXIT_NOTIFICATION = "duplexChannel.exit";
95
+ /** Required methods the worker MUST implement. */
96
+ export const HOST_TO_WORKER_REQUIRED_METHODS = [
97
+ "initialize",
98
+ "health",
99
+ "shutdown",
100
+ ];
101
+ /** Optional methods the worker MAY implement. */
102
+ export const HOST_TO_WORKER_OPTIONAL_METHODS = [
103
+ "prepareIdleSleep",
104
+ "releaseIdleSleep",
105
+ "validateConfig",
106
+ "configChanged",
107
+ "onEvent",
108
+ "runJob",
109
+ "handleWebhook",
110
+ "handleApiRequest",
111
+ "agentLifecycle",
112
+ "resourceLifecycle",
113
+ "workspacePrepare",
114
+ "workspaceOperation",
115
+ "getData",
116
+ "performAction",
117
+ "executeTool",
118
+ "listConnectorTools",
119
+ "detectExternalObjects",
120
+ "routeAiConnection",
121
+ "resolveExternalObject",
122
+ "refreshExternalObjects",
123
+ "environmentValidateConfig",
124
+ "environmentTask",
125
+ "environmentProbe",
126
+ "environmentAcquireLease",
127
+ "environmentResumeLease",
128
+ "environmentReleaseLease",
129
+ "environmentStopLease",
130
+ "environmentDestroyLease",
131
+ "environmentInspectLease",
132
+ "environmentRealizeWorkspace",
133
+ "environmentExecute",
134
+ "environmentRunnerIngressEndpoint",
135
+ "environmentSyncIn",
136
+ "environmentSyncOut",
137
+ "environmentStartInteractiveSetup",
138
+ "environmentGetInteractiveSetup",
139
+ "environmentCaptureTemplate",
140
+ "environmentCancelInteractiveSetup",
141
+ "environmentDeleteTemplate",
142
+ "loginPtyOpen",
143
+ "loginPtyInput",
144
+ "loginPtyReadCredential",
145
+ "loginPtyStop",
146
+ "loginPtyClose",
147
+ "duplexChannelOpen",
148
+ "duplexChannelWrite",
149
+ "duplexChannelStop",
150
+ "duplexChannelClose",
151
+ ];
152
+ // ---------------------------------------------------------------------------
153
+ // Message Factory Functions
154
+ // ---------------------------------------------------------------------------
155
+ /** Counter for generating unique request IDs when no explicit ID is provided. */
156
+ let _nextId = 1;
157
+ /** Wrap around before reaching Number.MAX_SAFE_INTEGER to prevent precision loss. */
158
+ const MAX_SAFE_RPC_ID = Number.MAX_SAFE_INTEGER - 1;
159
+ /**
160
+ * Create a JSON-RPC 2.0 request message.
161
+ *
162
+ * @param method - The RPC method name
163
+ * @param params - Structured parameters
164
+ * @param id - Optional explicit request ID (auto-generated if omitted)
165
+ */
166
+ export function createRequest(method, params, id) {
167
+ if (_nextId >= MAX_SAFE_RPC_ID) {
168
+ _nextId = 1;
169
+ }
170
+ return {
171
+ jsonrpc: JSONRPC_VERSION,
172
+ id: id ?? _nextId++,
173
+ method,
174
+ params,
175
+ };
176
+ }
177
+ /**
178
+ * Create a JSON-RPC 2.0 success response.
179
+ *
180
+ * @param id - The request ID being responded to
181
+ * @param result - The result value
182
+ */
183
+ export function createSuccessResponse(id, result) {
184
+ return {
185
+ jsonrpc: JSONRPC_VERSION,
186
+ id,
187
+ result,
188
+ };
189
+ }
190
+ /**
191
+ * Create a JSON-RPC 2.0 error response.
192
+ *
193
+ * @param id - The request ID being responded to (null if the request ID could not be determined)
194
+ * @param code - Machine-readable error code
195
+ * @param message - Human-readable error message
196
+ * @param data - Optional structured error data
197
+ */
198
+ export function createErrorResponse(id, code, message, data) {
199
+ const response = {
200
+ jsonrpc: JSONRPC_VERSION,
201
+ id,
202
+ error: data !== undefined
203
+ ? { code, message, data }
204
+ : { code, message },
205
+ };
206
+ return response;
207
+ }
208
+ /**
209
+ * Create a JSON-RPC 2.0 notification (fire-and-forget, no response expected).
210
+ *
211
+ * @param method - The notification method name
212
+ * @param params - Structured parameters
213
+ */
214
+ export function createNotification(method, params) {
215
+ return {
216
+ jsonrpc: JSONRPC_VERSION,
217
+ method,
218
+ params,
219
+ };
220
+ }
221
+ // ---------------------------------------------------------------------------
222
+ // Type Guards
223
+ // ---------------------------------------------------------------------------
224
+ /**
225
+ * Check whether a value is a well-formed JSON-RPC 2.0 request.
226
+ *
227
+ * A request has `jsonrpc: "2.0"`, a string `method`, and an `id`.
228
+ */
229
+ export function isJsonRpcRequest(value) {
230
+ if (typeof value !== "object" || value === null)
231
+ return false;
232
+ const obj = value;
233
+ return (obj.jsonrpc === JSONRPC_VERSION &&
234
+ typeof obj.method === "string" &&
235
+ "id" in obj &&
236
+ obj.id !== undefined &&
237
+ obj.id !== null);
238
+ }
239
+ /**
240
+ * Check whether a value is a well-formed JSON-RPC 2.0 notification.
241
+ *
242
+ * A notification has `jsonrpc: "2.0"`, a string `method`, but no `id`.
243
+ */
244
+ export function isJsonRpcNotification(value) {
245
+ if (typeof value !== "object" || value === null)
246
+ return false;
247
+ const obj = value;
248
+ return (obj.jsonrpc === JSONRPC_VERSION &&
249
+ typeof obj.method === "string" &&
250
+ !("id" in obj));
251
+ }
252
+ /**
253
+ * Check whether a value is a well-formed JSON-RPC 2.0 response (success or error).
254
+ */
255
+ export function isJsonRpcResponse(value) {
256
+ if (typeof value !== "object" || value === null)
257
+ return false;
258
+ const obj = value;
259
+ return (obj.jsonrpc === JSONRPC_VERSION &&
260
+ "id" in obj &&
261
+ ("result" in obj || "error" in obj));
262
+ }
263
+ /**
264
+ * Check whether a JSON-RPC response is a success response.
265
+ */
266
+ export function isJsonRpcSuccessResponse(response) {
267
+ return "result" in response && !("error" in response && response.error !== undefined);
268
+ }
269
+ /**
270
+ * Check whether a JSON-RPC response is an error response.
271
+ */
272
+ export function isJsonRpcErrorResponse(response) {
273
+ return "error" in response && response.error !== undefined;
274
+ }
275
+ // ---------------------------------------------------------------------------
276
+ // Serialization Helpers
277
+ // ---------------------------------------------------------------------------
278
+ /**
279
+ * Line delimiter for JSON-RPC messages over stdio.
280
+ *
281
+ * Each message is a single line of JSON terminated by a newline character.
282
+ * This follows the newline-delimited JSON (NDJSON) convention.
283
+ */
284
+ export const MESSAGE_DELIMITER = "\n";
285
+ /**
286
+ * Serialize a JSON-RPC message to a newline-delimited string for transmission
287
+ * over stdio.
288
+ *
289
+ * @param message - Any JSON-RPC message (request, response, or notification)
290
+ * @returns The JSON string terminated with a newline
291
+ */
292
+ export function serializeMessage(message) {
293
+ return JSON.stringify(message) + MESSAGE_DELIMITER;
294
+ }
295
+ /**
296
+ * Parse a JSON string into a JSON-RPC message.
297
+ *
298
+ * Returns the parsed message or throws a `JsonRpcParseError` if the input
299
+ * is not valid JSON or does not conform to the JSON-RPC 2.0 structure.
300
+ *
301
+ * @param line - A single line of JSON text (with or without trailing newline)
302
+ * @returns The parsed JSON-RPC message
303
+ * @throws {JsonRpcParseError} If parsing fails
304
+ */
305
+ export function parseMessage(line) {
306
+ const trimmed = line.trim();
307
+ if (trimmed.length === 0) {
308
+ throw new JsonRpcParseError("Empty message");
309
+ }
310
+ let parsed;
311
+ try {
312
+ parsed = JSON.parse(trimmed);
313
+ }
314
+ catch {
315
+ throw new JsonRpcParseError(`Invalid JSON: ${trimmed.slice(0, 200)}`);
316
+ }
317
+ if (typeof parsed !== "object" || parsed === null) {
318
+ throw new JsonRpcParseError("Message must be a JSON object");
319
+ }
320
+ const obj = parsed;
321
+ if (obj.jsonrpc !== JSONRPC_VERSION) {
322
+ throw new JsonRpcParseError(`Invalid or missing jsonrpc version (expected "${JSONRPC_VERSION}", got ${JSON.stringify(obj.jsonrpc)})`);
323
+ }
324
+ // It's a valid JSON-RPC 2.0 envelope — return as-is and let the caller
325
+ // use the type guards for more specific classification.
326
+ return parsed;
327
+ }
328
+ // ---------------------------------------------------------------------------
329
+ // Error Classes
330
+ // ---------------------------------------------------------------------------
331
+ /**
332
+ * Error thrown when a JSON-RPC message cannot be parsed.
333
+ */
334
+ export class JsonRpcParseError extends Error {
335
+ name = "JsonRpcParseError";
336
+ constructor(message) {
337
+ super(message);
338
+ }
339
+ }
340
+ /**
341
+ * Error thrown when a JSON-RPC call fails with a structured error response.
342
+ *
343
+ * Captures the full `JsonRpcError` so callers can inspect the code and data.
344
+ */
345
+ export class JsonRpcCallError extends Error {
346
+ name = "JsonRpcCallError";
347
+ /** The JSON-RPC error code. */
348
+ code;
349
+ /** Optional structured error data from the response. */
350
+ data;
351
+ constructor(error) {
352
+ super(error.message);
353
+ this.code = error.code;
354
+ this.data = error.data;
355
+ }
356
+ }
357
+ // ---------------------------------------------------------------------------
358
+ // Reset helper (testing only)
359
+ // ---------------------------------------------------------------------------
360
+ /**
361
+ * Reset the internal request ID counter. **For testing only.**
362
+ *
363
+ * @internal
364
+ */
365
+ export function _resetIdCounter() {
366
+ _nextId = 1;
367
+ }
368
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AA8FA,8EAA8E;AAC9E,qCAAqC;AACrC,8EAA8E;AAE9E,qDAAqD;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAc,CAAC;AA2H9C,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,+CAA+C;IAC/C,WAAW,EAAE,CAAC,KAAK;IACnB,mDAAmD;IACnD,eAAe,EAAE,CAAC,KAAK;IACvB,qDAAqD;IACrD,gBAAgB,EAAE,CAAC,KAAK;IACxB,mCAAmC;IACnC,cAAc,EAAE,CAAC,KAAK;IACtB,+BAA+B;IAC/B,cAAc,EAAE,CAAC,KAAK;CACd,CAAC;AAKX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,0DAA0D;IAC1D,kBAAkB,EAAE,CAAC,KAAK;IAC1B,2EAA2E;IAC3E,iBAAiB,EAAE,CAAC,KAAK;IACzB,sEAAsE;IACtE,YAAY,EAAE,CAAC,KAAK;IACpB,iEAAiE;IACjE,OAAO,EAAE,CAAC,KAAK;IACf,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IAED,uEAAuE;IACvE,wDAAwD;IACxD,OAAO,MAAwB,CAAC;AAClC,CAAC;AAED,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxB,IAAI,GAAG,mBAAmB,CAAC;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACvB,IAAI,GAAG,kBAAkB,CAAC;IAC5C,+BAA+B;IACtB,IAAI,CAAS;IACtB,wDAAwD;IAC/C,IAAI,CAAU;IAEvB,YAAY,KAAmB;QAC7B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAED,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,GAAG,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,258 @@
1
+ import type { RunStartupStage, PaperclipPluginManifestV1, PluginCapability, PluginEventType, Company, Project, Issue, IssueComment, IssueThreadInteraction, IssueAttachment, Agent, Goal, Approval } from "@paperclipai/shared";
2
+ import type { PluginContext, PluginJobContext, PluginEvent, ResourceLifecycleEvent, ScopeKey, ToolResult, ToolRunContext, ToolRunConnection, ConnectorToolListConnection, ConnectorToolDescriptor, PluginWorkspace, PluginExecutionWorkspaceMetadata, AgentSessionEvent, PluginAccessMember, PrincipalPermissionGrant } from "./types.js";
3
+ import type { PluginEnvironmentValidateConfigParams, PluginEnvironmentValidationResult, PluginEnvironmentProbeParams, PluginEnvironmentProbeResult, PluginEnvironmentLease, PluginEnvironmentInspectLeaseParams, PluginEnvironmentLeaseObservation, PluginEnvironmentAcquireLeaseParams, PluginEnvironmentResumeLeaseParams, PluginEnvironmentReleaseLeaseParams, PluginEnvironmentTerminationReceipt, PluginEnvironmentDestroyLeaseParams, PluginEnvironmentRealizeWorkspaceParams, PluginEnvironmentRealizeWorkspaceResult, PluginEnvironmentExecuteParams, PluginEnvironmentExecuteResult, PluginEnvironmentStartInteractiveSetupParams, PluginEnvironmentInteractiveSetupSession, PluginEnvironmentGetInteractiveSetupParams, PluginEnvironmentCaptureTemplateParams, PluginEnvironmentCaptureTemplateResult, PluginEnvironmentCancelInteractiveSetupParams, PluginEnvironmentCancelInteractiveSetupResult, PluginEnvironmentDeleteTemplateParams, PluginEnvironmentDeleteTemplateResult, PluginPerformActionActorContext } from "./protocol.js";
4
+ export interface TestHarnessOptions {
5
+ /** Plugin manifest used to seed capability checks and metadata. */
6
+ manifest: PaperclipPluginManifestV1;
7
+ /** Optional capability override. Defaults to `manifest.capabilities`. */
8
+ capabilities?: PluginCapability[];
9
+ /** Initial config returned by `ctx.config.get(companyId)`. */
10
+ config?: Record<string, unknown>;
11
+ }
12
+ export interface TestHarnessLogEntry {
13
+ level: "info" | "warn" | "error" | "debug";
14
+ message: string;
15
+ meta?: Record<string, unknown>;
16
+ }
17
+ export interface TestHarnessPerformActionOptions {
18
+ /**
19
+ * Authenticated actor context to expose to the action handler. Omitted fields
20
+ * default to null, and `type` defaults to `system`.
21
+ */
22
+ actor?: Partial<PluginPerformActionActorContext> | null;
23
+ /**
24
+ * Host-authorized company scope. When provided, this is injected into
25
+ * `params.companyId` so tests match the production bridge's anti-spoofing
26
+ * behavior.
27
+ */
28
+ companyId?: string | null;
29
+ }
30
+ export interface TestHarness {
31
+ /** Fully-typed in-memory plugin context passed to `plugin.setup(ctx)`. */
32
+ ctx: PluginContext;
33
+ /** Seed host entities for `ctx.companies/projects/issues/agents/goals/access/authorization` reads. */
34
+ seed(input: {
35
+ companies?: Company[];
36
+ lifecycleEvents?: ResourceLifecycleEvent[];
37
+ projectInstanceSecrets?: Array<{
38
+ companyId: string;
39
+ projectId: string;
40
+ values: Record<string, string>;
41
+ }>;
42
+ projects?: Project[];
43
+ issues?: Issue[];
44
+ issueComments?: IssueComment[];
45
+ issueInteractions?: IssueThreadInteraction[];
46
+ issueAttachments?: Array<IssueAttachment & {
47
+ contentBase64?: string;
48
+ }>;
49
+ approvals?: Approval[];
50
+ agents?: Agent[];
51
+ goals?: Goal[];
52
+ projectWorkspaces?: PluginWorkspace[];
53
+ executionWorkspaces?: PluginExecutionWorkspaceMetadata[];
54
+ accessMembers?: PluginAccessMember[];
55
+ principalGrants?: PrincipalPermissionGrant[];
56
+ }): void;
57
+ setConfig(config: Record<string, unknown>): void;
58
+ /** Dispatch a host or plugin event to registered handlers. */
59
+ emit(eventType: PluginEventType | `plugin.${string}`, payload: unknown, base?: Partial<PluginEvent>): Promise<void>;
60
+ /** Execute a previously-registered scheduled job handler. */
61
+ runJob(jobKey: string, partial?: Partial<PluginJobContext>): Promise<void>;
62
+ /** Invoke a `ctx.data.register(...)` handler by key. */
63
+ getData<T = unknown>(key: string, params?: Record<string, unknown>): Promise<T>;
64
+ /** Invoke a `ctx.actions.register(...)` handler by key. */
65
+ performAction<T = unknown>(key: string, params?: Record<string, unknown>, options?: TestHarnessPerformActionOptions): Promise<T>;
66
+ /** Execute a registered tool handler via `ctx.tools.execute(...)`. */
67
+ executeTool<T = ToolResult>(name: string, params: unknown, runCtx?: Partial<ToolRunContext>): Promise<T>;
68
+ /** Execute a `ctx.connectors.register(...)` handler on a test connection. */
69
+ executeConnectorTool<T = ToolResult>(appSlug: string, toolName: string, params: unknown, connection?: Partial<ToolRunConnection>, runCtx?: Partial<ToolRunContext>): Promise<T>;
70
+ /** Call a `ctx.connectors.listTools(...)` handler for a test connection. */
71
+ listConnectorTools(appSlug: string, connection?: Partial<ConnectorToolListConnection>): Promise<ConnectorToolDescriptor[]>;
72
+ /** Read raw in-memory state for assertions. */
73
+ getState(input: ScopeKey): unknown;
74
+ /** Simulate a streaming event arriving for an active session. */
75
+ simulateSessionEvent(sessionId: string, event: Omit<AgentSessionEvent, "sessionId">): void;
76
+ logs: TestHarnessLogEntry[];
77
+ activity: Array<{
78
+ message: string;
79
+ entityType?: string;
80
+ entityId?: string;
81
+ metadata?: Record<string, unknown>;
82
+ }>;
83
+ /** Startup stages reported through `ctx.environmentTasks.reportStartupStage`, in order. */
84
+ startupStageReports: Array<{
85
+ taskId: string;
86
+ stage: RunStartupStage;
87
+ }>;
88
+ metrics: Array<{
89
+ name: string;
90
+ value: number;
91
+ tags?: Record<string, string>;
92
+ }>;
93
+ telemetry: Array<{
94
+ eventName: string;
95
+ dimensions?: Record<string, string | number | boolean>;
96
+ }>;
97
+ dbQueries: Array<{
98
+ sql: string;
99
+ params?: unknown[];
100
+ }>;
101
+ dbExecutes: Array<{
102
+ sql: string;
103
+ params?: unknown[];
104
+ }>;
105
+ }
106
+ /** Recorded environment lifecycle event for assertion helpers. */
107
+ export interface EnvironmentEventRecord {
108
+ type: "validateConfig" | "probe" | "acquireLease" | "resumeLease" | "releaseLease" | "stopLease" | "inspectLease" | "destroyLease" | "realizeWorkspace" | "execute" | "startInteractiveSetup" | "getInteractiveSetup" | "captureTemplate" | "cancelInteractiveSetup" | "deleteTemplate";
109
+ driverKey: string;
110
+ environmentId: string;
111
+ timestamp: string;
112
+ params: Record<string, unknown>;
113
+ result?: unknown;
114
+ error?: string;
115
+ }
116
+ /** Options for creating an environment-aware test harness. */
117
+ export interface EnvironmentTestHarnessOptions extends TestHarnessOptions {
118
+ /** Environment driver hooks provided by the plugin under test. */
119
+ environmentDriver: {
120
+ driverKey: string;
121
+ onValidateConfig?: (params: PluginEnvironmentValidateConfigParams) => Promise<PluginEnvironmentValidationResult>;
122
+ onProbe?: (params: PluginEnvironmentProbeParams) => Promise<PluginEnvironmentProbeResult>;
123
+ onAcquireLease?: (params: PluginEnvironmentAcquireLeaseParams) => Promise<PluginEnvironmentLease>;
124
+ onResumeLease?: (params: PluginEnvironmentResumeLeaseParams) => Promise<PluginEnvironmentLease>;
125
+ onReleaseLease?: (params: PluginEnvironmentReleaseLeaseParams) => Promise<PluginEnvironmentTerminationReceipt | void>;
126
+ onStopLease?: (params: PluginEnvironmentReleaseLeaseParams) => Promise<PluginEnvironmentTerminationReceipt>;
127
+ onInspectLease?: (params: PluginEnvironmentInspectLeaseParams) => Promise<PluginEnvironmentLeaseObservation>;
128
+ onDestroyLease?: (params: PluginEnvironmentDestroyLeaseParams) => Promise<PluginEnvironmentTerminationReceipt | void>;
129
+ onRealizeWorkspace?: (params: PluginEnvironmentRealizeWorkspaceParams) => Promise<PluginEnvironmentRealizeWorkspaceResult>;
130
+ onExecute?: (params: PluginEnvironmentExecuteParams) => Promise<PluginEnvironmentExecuteResult>;
131
+ onStartInteractiveSetup?: (params: PluginEnvironmentStartInteractiveSetupParams) => Promise<PluginEnvironmentInteractiveSetupSession>;
132
+ onGetInteractiveSetup?: (params: PluginEnvironmentGetInteractiveSetupParams) => Promise<PluginEnvironmentInteractiveSetupSession>;
133
+ onCaptureTemplate?: (params: PluginEnvironmentCaptureTemplateParams) => Promise<PluginEnvironmentCaptureTemplateResult>;
134
+ onCancelInteractiveSetup?: (params: PluginEnvironmentCancelInteractiveSetupParams) => Promise<PluginEnvironmentCancelInteractiveSetupResult>;
135
+ onDeleteTemplate?: (params: PluginEnvironmentDeleteTemplateParams) => Promise<PluginEnvironmentDeleteTemplateResult>;
136
+ };
137
+ }
138
+ /** Extended test harness with environment driver simulation. */
139
+ export interface EnvironmentTestHarness extends TestHarness {
140
+ /** Recorded environment lifecycle events for assertion. */
141
+ environmentEvents: EnvironmentEventRecord[];
142
+ /** Invoke the environment driver's validateConfig hook. */
143
+ validateConfig(params: PluginEnvironmentValidateConfigParams): Promise<PluginEnvironmentValidationResult>;
144
+ /** Invoke the environment driver's probe hook. */
145
+ probe(params: PluginEnvironmentProbeParams): Promise<PluginEnvironmentProbeResult>;
146
+ /** Invoke the environment driver's acquireLease hook. */
147
+ acquireLease(params: PluginEnvironmentAcquireLeaseParams): Promise<PluginEnvironmentLease>;
148
+ /** Invoke the environment driver's resumeLease hook. */
149
+ resumeLease(params: PluginEnvironmentResumeLeaseParams): Promise<PluginEnvironmentLease>;
150
+ /** Invoke the environment driver's releaseLease hook. */
151
+ releaseLease(params: PluginEnvironmentReleaseLeaseParams): Promise<PluginEnvironmentTerminationReceipt | void>;
152
+ /** Stop and preserve an allocation independently of its release policy. */
153
+ stopLease(params: PluginEnvironmentReleaseLeaseParams): Promise<PluginEnvironmentTerminationReceipt>;
154
+ /** Observe an allocation without starting or modifying it. */
155
+ inspectLease(params: PluginEnvironmentInspectLeaseParams): Promise<PluginEnvironmentLeaseObservation | undefined>;
156
+ /** Invoke the environment driver's destroyLease hook. */
157
+ destroyLease(params: PluginEnvironmentDestroyLeaseParams): Promise<PluginEnvironmentTerminationReceipt | void>;
158
+ /** Invoke the environment driver's realizeWorkspace hook. */
159
+ realizeWorkspace(params: PluginEnvironmentRealizeWorkspaceParams): Promise<PluginEnvironmentRealizeWorkspaceResult>;
160
+ /** Invoke the environment driver's execute hook. */
161
+ execute(params: PluginEnvironmentExecuteParams): Promise<PluginEnvironmentExecuteResult>;
162
+ /** Invoke the environment driver's interactive setup start hook. */
163
+ startInteractiveSetup(params: PluginEnvironmentStartInteractiveSetupParams): Promise<PluginEnvironmentInteractiveSetupSession>;
164
+ /** Invoke the environment driver's interactive setup status hook. */
165
+ getInteractiveSetup(params: PluginEnvironmentGetInteractiveSetupParams): Promise<PluginEnvironmentInteractiveSetupSession>;
166
+ /** Invoke the environment driver's template capture hook. */
167
+ captureTemplate(params: PluginEnvironmentCaptureTemplateParams): Promise<PluginEnvironmentCaptureTemplateResult>;
168
+ /** Invoke the environment driver's interactive setup cancel hook. */
169
+ cancelInteractiveSetup(params: PluginEnvironmentCancelInteractiveSetupParams): Promise<PluginEnvironmentCancelInteractiveSetupResult>;
170
+ /** Invoke the environment driver's optional template delete hook. */
171
+ deleteTemplate(params: PluginEnvironmentDeleteTemplateParams): Promise<PluginEnvironmentDeleteTemplateResult>;
172
+ }
173
+ /** Filter environment events by type. */
174
+ export declare function filterEnvironmentEvents(events: EnvironmentEventRecord[], type: EnvironmentEventRecord["type"]): EnvironmentEventRecord[];
175
+ /** Assert that environment events occurred in the expected order. */
176
+ export declare function assertEnvironmentEventOrder(events: EnvironmentEventRecord[], expectedOrder: EnvironmentEventRecord["type"][]): void;
177
+ /** Assert that a full lease lifecycle (acquire → release) occurred for an environment. */
178
+ export declare function assertLeaseLifecycle(events: EnvironmentEventRecord[], environmentId: string): {
179
+ acquire: EnvironmentEventRecord;
180
+ release: EnvironmentEventRecord;
181
+ };
182
+ /** Assert that workspace realization occurred between lease acquire and release. */
183
+ export declare function assertWorkspaceRealizationLifecycle(events: EnvironmentEventRecord[], environmentId: string): EnvironmentEventRecord;
184
+ /** Assert that an execute call occurred within the lease lifecycle. */
185
+ export declare function assertExecutionLifecycle(events: EnvironmentEventRecord[], environmentId: string): EnvironmentEventRecord[];
186
+ /** Assert that an event recorded an error. */
187
+ export declare function assertEnvironmentError(events: EnvironmentEventRecord[], type: EnvironmentEventRecord["type"], environmentId?: string): EnvironmentEventRecord;
188
+ /** Options for creating a fake environment driver for contract testing. */
189
+ export interface FakeEnvironmentDriverOptions {
190
+ driverKey?: string;
191
+ /** Simulated acquire delay in ms. */
192
+ acquireDelayMs?: number;
193
+ /** If true, probe will return `ok: false`. */
194
+ probeFailure?: boolean;
195
+ /** If true, acquireLease will throw. */
196
+ acquireFailure?: string;
197
+ /** If true, execute will return a non-zero exit code. */
198
+ executeFailure?: boolean;
199
+ /** Custom metadata returned on lease acquire. */
200
+ leaseMetadata?: Record<string, unknown>;
201
+ }
202
+ /**
203
+ * Create a fake environment driver suitable for contract testing.
204
+ *
205
+ * This returns a driver hooks object compatible with `EnvironmentTestHarnessOptions.environmentDriver`.
206
+ * It simulates the full environment lifecycle with configurable failure injection.
207
+ */
208
+ export declare function createFakeEnvironmentDriver(options?: FakeEnvironmentDriverOptions): EnvironmentTestHarnessOptions["environmentDriver"];
209
+ /**
210
+ * Create an in-memory host harness for plugin worker tests.
211
+ *
212
+ * The harness enforces declared capabilities and simulates host APIs, so tests
213
+ * can validate plugin behavior without spinning up the Paperclip server runtime.
214
+ */
215
+ export declare function createTestHarness(options: TestHarnessOptions): TestHarness;
216
+ /**
217
+ * Create an environment-aware test harness that wraps the base harness with
218
+ * environment driver simulation and lifecycle event recording.
219
+ *
220
+ * Use this to test environment plugins through the full host contract:
221
+ * validateConfig → probe → acquireLease → realizeWorkspace → execute → releaseLease.
222
+ */
223
+ export declare function createEnvironmentTestHarness(options: EnvironmentTestHarnessOptions): EnvironmentTestHarness;
224
+ /** Run the same operation/result validation as the worker RPC boundary. */
225
+ export declare function createWorkspaceProviderHarness(handler: (params: import("./workspace-provider.js").PluginWorkspaceParams) => Promise<import("./workspace-provider.js").PluginWorkspaceResult>): {
226
+ operation(params: import("./workspace-provider.js").PluginWorkspaceParams): Promise<{
227
+ kind: "prepared";
228
+ binding: {
229
+ pluginId: string;
230
+ projectId: string;
231
+ executionWorkspaceId: string;
232
+ projectWorkspaceId: string;
233
+ sourceRevision: string;
234
+ workspaceRef: string;
235
+ };
236
+ branchName: string | null;
237
+ baseSha: string | null;
238
+ destinationRef?: string | null | undefined;
239
+ created: boolean;
240
+ branchCreatedByRuntime: boolean;
241
+ } | {
242
+ kind: "inspection";
243
+ headSha: string | null;
244
+ branchName: string | null;
245
+ hasDirtyTrackedFiles: boolean;
246
+ hasUntrackedFiles: boolean;
247
+ hasLocalOnlyData: boolean;
248
+ isMergedIntoBase: boolean | null;
249
+ remotelyRecoverable: boolean | null;
250
+ } | {
251
+ kind: "finalized";
252
+ headSha: string | null;
253
+ branchName: string | null;
254
+ } | {
255
+ kind: "removed";
256
+ }>;
257
+ };
258
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAE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