@evermore.work/plugin-sdk 2026.509.0-canary.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.
Files changed (62) hide show
  1. package/README.md +1215 -0
  2. package/dist/bundlers.d.ts +57 -0
  3. package/dist/bundlers.d.ts.map +1 -0
  4. package/dist/bundlers.js +106 -0
  5. package/dist/bundlers.js.map +1 -0
  6. package/dist/define-plugin.d.ts +266 -0
  7. package/dist/define-plugin.d.ts.map +1 -0
  8. package/dist/define-plugin.js +85 -0
  9. package/dist/define-plugin.js.map +1 -0
  10. package/dist/dev-cli.d.ts +3 -0
  11. package/dist/dev-cli.d.ts.map +1 -0
  12. package/dist/dev-cli.js +49 -0
  13. package/dist/dev-cli.js.map +1 -0
  14. package/dist/dev-server.d.ts +34 -0
  15. package/dist/dev-server.d.ts.map +1 -0
  16. package/dist/dev-server.js +194 -0
  17. package/dist/dev-server.js.map +1 -0
  18. package/dist/host-client-factory.d.ts +272 -0
  19. package/dist/host-client-factory.d.ts.map +1 -0
  20. package/dist/host-client-factory.js +481 -0
  21. package/dist/host-client-factory.js.map +1 -0
  22. package/dist/index.d.ts +84 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +84 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/protocol.d.ts +1285 -0
  27. package/dist/protocol.d.ts.map +1 -0
  28. package/dist/protocol.js +306 -0
  29. package/dist/protocol.js.map +1 -0
  30. package/dist/testing.d.ts +166 -0
  31. package/dist/testing.d.ts.map +1 -0
  32. package/dist/testing.js +1766 -0
  33. package/dist/testing.js.map +1 -0
  34. package/dist/types.d.ts +1330 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/types.js +12 -0
  37. package/dist/types.js.map +1 -0
  38. package/dist/ui/components.d.ts +511 -0
  39. package/dist/ui/components.d.ts.map +1 -0
  40. package/dist/ui/components.js +135 -0
  41. package/dist/ui/components.js.map +1 -0
  42. package/dist/ui/hooks.d.ts +155 -0
  43. package/dist/ui/hooks.d.ts.map +1 -0
  44. package/dist/ui/hooks.js +195 -0
  45. package/dist/ui/hooks.js.map +1 -0
  46. package/dist/ui/index.d.ts +54 -0
  47. package/dist/ui/index.d.ts.map +1 -0
  48. package/dist/ui/index.js +51 -0
  49. package/dist/ui/index.js.map +1 -0
  50. package/dist/ui/runtime.d.ts +3 -0
  51. package/dist/ui/runtime.d.ts.map +1 -0
  52. package/dist/ui/runtime.js +30 -0
  53. package/dist/ui/runtime.js.map +1 -0
  54. package/dist/ui/types.d.ts +388 -0
  55. package/dist/ui/types.d.ts.map +1 -0
  56. package/dist/ui/types.js +17 -0
  57. package/dist/ui/types.js.map +1 -0
  58. package/dist/worker-rpc-host.d.ts +127 -0
  59. package/dist/worker-rpc-host.d.ts.map +1 -0
  60. package/dist/worker-rpc-host.js +1279 -0
  61. package/dist/worker-rpc-host.js.map +1 -0
  62. package/package.json +88 -0
package/dist/index.js ADDED
@@ -0,0 +1,84 @@
1
+ /**
2
+ * `@evermore.work/plugin-sdk` — Evermore plugin worker-side SDK.
3
+ *
4
+ * This is the main entrypoint for plugin worker code. For plugin UI bundles,
5
+ * import from `@evermore.work/plugin-sdk/ui` instead.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * // Plugin worker entrypoint (dist/worker.ts)
10
+ * import { definePlugin, runWorker, z } from "@evermore.work/plugin-sdk";
11
+ *
12
+ * const plugin = definePlugin({
13
+ * async setup(ctx) {
14
+ * ctx.logger.info("Plugin starting up");
15
+ *
16
+ * ctx.events.on("issue.created", async (event) => {
17
+ * ctx.logger.info("Issue created", { issueId: event.entityId });
18
+ * });
19
+ *
20
+ * ctx.jobs.register("full-sync", async (job) => {
21
+ * ctx.logger.info("Starting full sync", { runId: job.runId });
22
+ * // ... sync implementation
23
+ * });
24
+ *
25
+ * ctx.data.register("sync-health", async ({ companyId }) => {
26
+ * const state = await ctx.state.get({
27
+ * scopeKind: "company",
28
+ * scopeId: String(companyId),
29
+ * stateKey: "last-sync-at",
30
+ * });
31
+ * return { lastSync: state };
32
+ * });
33
+ * },
34
+ *
35
+ * async onHealth() {
36
+ * return { status: "ok" };
37
+ * },
38
+ * });
39
+ *
40
+ * export default plugin;
41
+ * runWorker(plugin, import.meta.url);
42
+ * ```
43
+ *
44
+ * @see PLUGIN_SPEC.md §14 — SDK Surface
45
+ * @see PLUGIN_SPEC.md §29.2 — SDK Versioning
46
+ */
47
+ // ---------------------------------------------------------------------------
48
+ // Main factory
49
+ // ---------------------------------------------------------------------------
50
+ export { definePlugin } from "./define-plugin.js";
51
+ export { createTestHarness, createEnvironmentTestHarness, createFakeEnvironmentDriver, filterEnvironmentEvents, assertEnvironmentEventOrder, assertLeaseLifecycle, assertWorkspaceRealizationLifecycle, assertExecutionLifecycle, assertEnvironmentError } from "./testing.js";
52
+ export { createPluginBundlerPresets } from "./bundlers.js";
53
+ export { startPluginDevServer, getUiBuildSnapshot } from "./dev-server.js";
54
+ export { startWorkerRpcHost, runWorker } from "./worker-rpc-host.js";
55
+ export { createHostClientHandlers, getRequiredCapability, CapabilityDeniedError, } from "./host-client-factory.js";
56
+ // JSON-RPC protocol helpers and constants
57
+ export { JSONRPC_VERSION, JSONRPC_ERROR_CODES, PLUGIN_RPC_ERROR_CODES, HOST_TO_WORKER_REQUIRED_METHODS, HOST_TO_WORKER_OPTIONAL_METHODS, MESSAGE_DELIMITER, createRequest, createSuccessResponse, createErrorResponse, createNotification, isJsonRpcRequest, isJsonRpcNotification, isJsonRpcResponse, isJsonRpcSuccessResponse, isJsonRpcErrorResponse, serializeMessage, parseMessage, JsonRpcParseError, JsonRpcCallError, _resetIdCounter, } from "./protocol.js";
58
+ // ---------------------------------------------------------------------------
59
+ // Zod re-export
60
+ // ---------------------------------------------------------------------------
61
+ /**
62
+ * Zod is re-exported for plugin authors to use when defining their
63
+ * `instanceConfigSchema` and tool `parametersSchema`.
64
+ *
65
+ * Plugin authors do not need to add a separate `zod` dependency.
66
+ *
67
+ * @see PLUGIN_SPEC.md §14.1 — Example SDK Shape
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * import { z } from "@evermore.work/plugin-sdk";
72
+ *
73
+ * const configSchema = z.object({
74
+ * apiKey: z.string().describe("Your API key"),
75
+ * workspace: z.string().optional(),
76
+ * });
77
+ * ```
78
+ */
79
+ export { z } from "zod";
80
+ // ---------------------------------------------------------------------------
81
+ // Constants re-exports (for plugin code that needs to check values at runtime)
82
+ // ---------------------------------------------------------------------------
83
+ export { PLUGIN_API_VERSION, PLUGIN_STATUSES, PLUGIN_CATEGORIES, PLUGIN_CAPABILITIES, PLUGIN_UI_SLOT_TYPES, PLUGIN_UI_SLOT_ENTITY_TYPES, PLUGIN_STATE_SCOPE_KINDS, PLUGIN_JOB_STATUSES, PLUGIN_JOB_RUN_STATUSES, PLUGIN_JOB_RUN_TRIGGERS, PLUGIN_WEBHOOK_DELIVERY_STATUSES, PLUGIN_EVENT_TYPES, PLUGIN_BRIDGE_ERROR_CODES, } from "@evermore.work/shared";
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,mCAAmC,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC/Q,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;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