every-plugin 0.1.2 → 0.1.4
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.
- package/dist/client/index.d.ts +18 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +33 -0
- package/dist/effect.d.ts +2 -0
- package/dist/effect.d.ts.map +1 -0
- package/dist/effect.js +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/orpc.d.ts +3 -0
- package/dist/orpc.d.ts.map +1 -0
- package/dist/orpc.js +2 -0
- package/dist/plugin.d.ts +56 -85
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +33 -103
- package/dist/runtime/errors.d.ts +0 -14
- package/dist/runtime/errors.d.ts.map +1 -1
- package/dist/runtime/errors.js +0 -2
- package/dist/runtime/index.d.ts +40 -18
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +127 -24
- package/dist/runtime/services/module-federation.service.d.ts +3 -2
- package/dist/runtime/services/module-federation.service.d.ts.map +1 -1
- package/dist/runtime/services/module-federation.service.js +21 -23
- package/dist/runtime/services/normalize.d.ts +18 -0
- package/dist/runtime/services/normalize.d.ts.map +1 -0
- package/dist/runtime/services/normalize.js +17 -0
- package/dist/runtime/services/plugin-lifecycle.service.d.ts +17 -0
- package/dist/runtime/services/plugin-lifecycle.service.d.ts.map +1 -0
- package/dist/runtime/services/plugin-lifecycle.service.js +35 -0
- package/dist/runtime/services/plugin-loader.service.d.ts +21 -0
- package/dist/runtime/services/plugin-loader.service.d.ts.map +1 -0
- package/dist/runtime/services/plugin-loader.service.js +83 -0
- package/dist/runtime/services/plugin.service.d.ts +12 -20
- package/dist/runtime/services/plugin.service.d.ts.map +1 -1
- package/dist/runtime/services/plugin.service.js +18 -268
- package/dist/runtime/services/secrets.service.d.ts +2 -3
- package/dist/runtime/services/secrets.service.d.ts.map +1 -1
- package/dist/runtime/services/secrets.service.js +7 -5
- package/dist/runtime/services.d.ts +1 -1
- package/dist/runtime/services.d.ts.map +1 -1
- package/dist/runtime/services.js +1 -1
- package/dist/testing/index.d.ts +11 -16
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +25 -27
- package/dist/testing/mocks/module-federation.service.d.ts +1 -1
- package/dist/testing/mocks/module-federation.service.d.ts.map +1 -1
- package/dist/types.d.ts +177 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/zod.d.ts +2 -0
- package/dist/zod.d.ts.map +1 -0
- package/dist/zod.js +1 -0
- package/package.json +99 -57
- package/dist/runtime/streaming/index.d.ts +0 -4
- package/dist/runtime/streaming/index.d.ts.map +0 -1
- package/dist/runtime/streaming/index.js +0 -2
- package/dist/runtime/streaming/state-effects.d.ts +0 -28
- package/dist/runtime/streaming/state-effects.d.ts.map +0 -1
- package/dist/runtime/streaming/state-effects.js +0 -30
- package/dist/runtime/streaming/streaming.d.ts +0 -8
- package/dist/runtime/streaming/streaming.d.ts.map +0 -1
- package/dist/runtime/streaming/streaming.js +0 -113
- package/dist/runtime/streaming/types.d.ts +0 -19
- package/dist/runtime/streaming/types.d.ts.map +0 -1
- package/dist/runtime/test-utils.d.ts +0 -3
- package/dist/runtime/test-utils.d.ts.map +0 -1
- package/dist/runtime/test-utils.js +0 -7
- package/dist/runtime/types.d.ts +0 -40
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/types.js +0 -1
- /package/dist/{runtime/streaming/types.js → types.js} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AnyContractRouter } from "@orpc/contract";
|
|
2
|
+
import { type ClientContext, type CreateProcedureClientOptions, type ErrorMap, type InferRouterInitialContext, type Meta, type RouterClient, type Schema } from "@orpc/server";
|
|
3
|
+
import type { AnyPlugin, InitializedPlugin, RouterOf } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Extracts the oRPC router from an initialized plugin.
|
|
6
|
+
* The router type is precisely inferred from the plugin's contract.
|
|
7
|
+
* Useful for mounting into HTTP frameworks or direct router usage.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPluginRouter<T extends AnyPlugin>(initialized: InitializedPlugin<T>): RouterOf<T> & AnyContractRouter;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a fully type-safe client for calling plugin procedures as methods.
|
|
12
|
+
* The client type is precisely inferred from the plugin's contract, providing
|
|
13
|
+
* complete autocomplete and type safety for all procedures, inputs, and outputs.
|
|
14
|
+
*
|
|
15
|
+
* Type safety flows: Plugin Contract → Router → RouterClient with full procedure autocomplete
|
|
16
|
+
*/
|
|
17
|
+
export declare function createPluginClient<T extends AnyPlugin, TClientContext extends ClientContext = Record<never, never>>(initialized: InitializedPlugin<T>, options?: CreateProcedureClientOptions<InferRouterInitialContext<RouterOf<T>>, Schema<unknown, unknown>, ErrorMap, Meta, TClientContext>): RouterClient<RouterOf<T>, TClientContext>;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,4BAA4B,EAEjC,KAAK,QAAQ,EACb,KAAK,yBAAyB,EAC9B,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,MAAM,EACZ,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEvE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,SAAS,EACjD,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAChC,QAAQ,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAmBjC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,SAAS,SAAS,EACnB,cAAc,SAAS,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAE3D,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC,EACjC,OAAO,CAAC,EAAE,4BAA4B,CACpC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACtC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EACxB,QAAQ,EACR,IAAI,EACJ,cAAc,CACf,GACA,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAS3C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createRouterClient } from "@orpc/server";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts the oRPC router from an initialized plugin.
|
|
4
|
+
* The router type is precisely inferred from the plugin's contract.
|
|
5
|
+
* Useful for mounting into HTTP frameworks or direct router usage.
|
|
6
|
+
*/
|
|
7
|
+
export function getPluginRouter(initialized) {
|
|
8
|
+
if (!initialized) {
|
|
9
|
+
throw new Error("InitializedPlugin is undefined - plugin initialization failed");
|
|
10
|
+
}
|
|
11
|
+
if (!initialized.plugin) {
|
|
12
|
+
throw new Error("Plugin instance is undefined - check service layer dependencies (ModuleFederationService, SecretsService)");
|
|
13
|
+
}
|
|
14
|
+
if (typeof initialized.plugin.createRouter !== "function") {
|
|
15
|
+
throw new Error(`Plugin ${initialized.metadata?.pluginId || 'unknown'} does not have a createRouter method`);
|
|
16
|
+
}
|
|
17
|
+
if (!initialized.context) {
|
|
18
|
+
throw new Error("Plugin context is undefined - plugin initialization incomplete");
|
|
19
|
+
}
|
|
20
|
+
const router = initialized.plugin.createRouter(initialized.context);
|
|
21
|
+
return router;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates a fully type-safe client for calling plugin procedures as methods.
|
|
25
|
+
* The client type is precisely inferred from the plugin's contract, providing
|
|
26
|
+
* complete autocomplete and type safety for all procedures, inputs, and outputs.
|
|
27
|
+
*
|
|
28
|
+
* Type safety flows: Plugin Contract → Router → RouterClient with full procedure autocomplete
|
|
29
|
+
*/
|
|
30
|
+
export function createPluginClient(initialized, options) {
|
|
31
|
+
const router = getPluginRouter(initialized);
|
|
32
|
+
return createRouterClient(router, options);
|
|
33
|
+
}
|
package/dist/effect.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../src/effect.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/dist/effect.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "effect";
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAIA,qBAAa,wBAAyB,SAAQ,8BAA6C;IAC1F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CACvB,CAAC;IACD,IAAa,IAAI,WAAyC;CAC1D"}
|
package/dist/errors.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "./errors";
|
|
2
2
|
export * from "./plugin";
|
|
3
3
|
export * from "./runtime";
|
|
4
|
+
export { getNormalizedRemoteName } from "./runtime/services/normalize";
|
|
5
|
+
export type { AnyPlugin, ConfigOf, InitializedPlugin, PluginConstructor, PluginInstance, PluginOf, PluginRegistry, PluginRegistryFor, PluginRuntimeConfig, RegistryBindings, RouterOf, SecretsConfig } from "./types";
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,YAAY,EACX,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/orpc.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orpc.d.ts","sourceRoot":"","sources":["../src/orpc.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
package/dist/orpc.js
ADDED
package/dist/plugin.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { Context,
|
|
1
|
+
import type { AnyContractRouter } from "@orpc/contract";
|
|
2
|
+
import type { Context, Router } from "@orpc/server";
|
|
3
|
+
import { Effect, type Scope } from "effect";
|
|
3
4
|
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Derive router type from contract at the type level
|
|
7
|
+
*/
|
|
8
|
+
type RouterFromContract<C extends AnyContractRouter, TContext extends Context = Record<never, never>> = Router<C, TContext>;
|
|
9
|
+
/**
|
|
10
|
+
* Helper type that correctly constructs the config schema type
|
|
11
|
+
*/
|
|
12
|
+
export type PluginConfigFor<V extends z.ZodTypeAny, S extends z.ZodTypeAny> = z.ZodObject<{
|
|
7
13
|
variables: V;
|
|
8
14
|
secrets: S;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export interface PluginRegistry {
|
|
21
|
-
[pluginId: string]: PluginMetadata;
|
|
22
|
-
}
|
|
23
|
-
export interface PluginLogger {
|
|
24
|
-
readonly logInfo: (message: string, context?: unknown) => Effect.Effect<void>;
|
|
25
|
-
readonly logWarning: (message: string, context?: unknown) => Effect.Effect<void>;
|
|
26
|
-
readonly logError: (message: string, error?: unknown, context?: unknown) => Effect.Effect<void>;
|
|
27
|
-
readonly logDebug: (message: string, context?: unknown) => Effect.Effect<void>;
|
|
28
|
-
}
|
|
29
|
-
declare const PluginLoggerTag_base: Context.TagClass<PluginLoggerTag, "PluginLogger", PluginLogger>;
|
|
30
|
-
export declare class PluginLoggerTag extends PluginLoggerTag_base {
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Plugin constructor with static binding property
|
|
18
|
+
*/
|
|
19
|
+
export interface PluginConstructorWithBinding<TContract extends AnyContractRouter, TVariables extends z.ZodTypeAny, TSecrets extends z.ZodTypeAny, TContext extends Context = Record<never, never>> {
|
|
20
|
+
new (): Plugin<TContract, TVariables, TSecrets, TContext>;
|
|
21
|
+
binding: {
|
|
22
|
+
contract: TContract;
|
|
23
|
+
config: PluginConfigFor<TVariables, TSecrets>;
|
|
24
|
+
};
|
|
31
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Utility type to extract binding from plugin constructor
|
|
28
|
+
*/
|
|
29
|
+
export type PluginBinding<T> = T extends {
|
|
30
|
+
binding: infer B;
|
|
31
|
+
} ? B : never;
|
|
32
32
|
/**
|
|
33
33
|
* Common error schemas that all plugins can use
|
|
34
34
|
* These provide consistent error handling across the plugin ecosystem
|
|
@@ -88,70 +88,41 @@ export declare const CommonPluginErrors: {
|
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Plugin interface
|
|
92
92
|
*/
|
|
93
|
-
export
|
|
94
|
-
export declare function createPluginOutputSchema<TContract extends Contract, TStateSchema extends z.ZodTypeAny>(contract: TContract, stateSchema: TStateSchema): z.ZodUnion<[z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, ...z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>[]]>;
|
|
95
|
-
/**
|
|
96
|
-
* Unified Plugin interface for all plugin types
|
|
97
|
-
*/
|
|
98
|
-
export interface Plugin<TContract extends Contract, TConfigSchema extends z.ZodTypeAny = z.ZodTypeAny, TStateSchema extends z.ZodTypeAny = z.ZodNull> {
|
|
93
|
+
export interface Plugin<TContract extends AnyContractRouter, TVariables extends z.ZodTypeAny, TSecrets extends z.ZodTypeAny, TContext extends Context = Record<never, never>> {
|
|
99
94
|
readonly id: string;
|
|
100
|
-
readonly type:
|
|
95
|
+
readonly type: string;
|
|
101
96
|
readonly contract: TContract;
|
|
102
|
-
readonly configSchema:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
shutdown(): Effect.Effect<void, never
|
|
108
|
-
createRouter(): Contract;
|
|
109
|
-
isStreamable(procedureName: string): boolean;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* State transition utilities for plugins
|
|
113
|
-
* These provide a functional approach to state updates while keeping the API simple
|
|
114
|
-
*/
|
|
115
|
-
export declare const StateTransitions: {
|
|
116
|
-
/**
|
|
117
|
-
* Transition to a new phase with optional updates
|
|
118
|
-
*/
|
|
119
|
-
to: <T extends {
|
|
120
|
-
phase?: string;
|
|
121
|
-
}>(phase: string, updates?: Partial<T>) => (state: T) => T;
|
|
122
|
-
/**
|
|
123
|
-
* Add polling delay to state
|
|
124
|
-
*/
|
|
125
|
-
withPolling: <T>(delayMs: number) => (state: T) => T;
|
|
126
|
-
/**
|
|
127
|
-
* Set error state with message and stop polling
|
|
128
|
-
*/
|
|
129
|
-
withError: <T>(errorMessage: string) => (state: T) => T;
|
|
97
|
+
readonly configSchema: PluginConfigFor<TVariables, TSecrets>;
|
|
98
|
+
initialize(config: {
|
|
99
|
+
variables: z.infer<TVariables>;
|
|
100
|
+
secrets: z.infer<TSecrets>;
|
|
101
|
+
}): Effect.Effect<TContext, unknown, Scope.Scope>;
|
|
102
|
+
shutdown(): Effect.Effect<void, never>;
|
|
130
103
|
/**
|
|
131
|
-
*
|
|
104
|
+
* Creates the strongly-typed oRPC router for this plugin.
|
|
105
|
+
* The router's procedure types are inferred directly from the contract.
|
|
106
|
+
* @param context The initialized plugin context
|
|
107
|
+
* @returns A router with procedures matching the plugin's contract
|
|
132
108
|
*/
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Simple pipe utility for composing state transformations
|
|
137
|
-
*/
|
|
138
|
-
export declare const pipe: <T>(value: T, ...fns: Array<(val: T) => T>) => T;
|
|
109
|
+
createRouter(context?: TContext): RouterFromContract<TContract, TContext>;
|
|
110
|
+
}
|
|
139
111
|
/**
|
|
140
|
-
*
|
|
141
|
-
* Plugin just needs to define contract, config, and create oRPC router
|
|
112
|
+
* Factory function to create plugins
|
|
142
113
|
*/
|
|
143
|
-
export declare
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
114
|
+
export declare function createPlugin<V extends z.ZodTypeAny, S extends z.ZodTypeAny, TContract extends AnyContractRouter, TContext extends Context = Record<never, never>>(config: {
|
|
115
|
+
id: string;
|
|
116
|
+
type?: string;
|
|
117
|
+
variables: V;
|
|
118
|
+
secrets: S;
|
|
119
|
+
contract: TContract;
|
|
120
|
+
initialize?: (config: {
|
|
121
|
+
variables: z.infer<V>;
|
|
122
|
+
secrets: z.infer<S>;
|
|
123
|
+
}) => Effect.Effect<TContext, Error, Scope.Scope>;
|
|
124
|
+
createRouter: (ctx: TContext) => RouterFromContract<TContract, TContext>;
|
|
125
|
+
shutdown?: (ctx: TContext) => Effect.Effect<void, Error, never>;
|
|
126
|
+
}): PluginConstructorWithBinding<TContract, V, S, TContext>;
|
|
156
127
|
export {};
|
|
157
128
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,KAAK,kBAAkB,CAAC,CAAC,SAAS,iBAAiB,EAAE,QAAQ,SAAS,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE5H;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU,IACzE,CAAC,CAAC,SAAS,CAAC;IAAE,SAAS,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,4BAA4B,C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1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
export function createConfigSchema(variablesSchema, secretsSchema) {
|
|
4
|
-
return z.object({
|
|
5
|
-
variables: variablesSchema,
|
|
6
|
-
secrets: secretsSchema
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
export function createStateSchema(pluginStateSchema) {
|
|
10
|
-
const BaseStreamingStateSchema = z.object({
|
|
11
|
-
nextPollMs: z.number().nullable().optional(), // null = terminate, undefined/0 = no delay, number = delay ms
|
|
12
|
-
});
|
|
13
|
-
return BaseStreamingStateSchema.and(pluginStateSchema);
|
|
14
|
-
}
|
|
15
|
-
export class PluginLoggerTag extends Context.Tag("PluginLogger")() {
|
|
16
|
-
}
|
|
17
3
|
/**
|
|
18
4
|
* Common error schemas that all plugins can use
|
|
19
5
|
* These provide consistent error handling across the plugin ecosystem
|
|
@@ -65,95 +51,39 @@ export const CommonPluginErrors = {
|
|
|
65
51
|
}
|
|
66
52
|
};
|
|
67
53
|
/**
|
|
68
|
-
*
|
|
54
|
+
* Factory function to create plugins
|
|
69
55
|
*/
|
|
70
|
-
export function
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const inputSchema = procedureSpec['~orpc']?.inputSchema || z.object({});
|
|
75
|
-
const outputSchema = procedureSpec['~orpc']?.outputSchema || z.object({});
|
|
76
|
-
// Check if this procedure is streamable (has nextState in output)
|
|
77
|
-
const isStreamable = outputSchema._def?.shape?.nextState !== undefined;
|
|
78
|
-
const baseSchema = z.object({
|
|
79
|
-
procedure: z.literal(procedureName),
|
|
80
|
-
input: inputSchema,
|
|
81
|
-
});
|
|
82
|
-
// Only add state field for streamable procedures
|
|
83
|
-
// Allow null state for initial calls to streamable procedures
|
|
84
|
-
const stateInputSchema = stateSchema.nullable();
|
|
85
|
-
return isStreamable
|
|
86
|
-
? baseSchema.extend({ state: stateInputSchema })
|
|
87
|
-
: baseSchema;
|
|
56
|
+
export function createPlugin(config) {
|
|
57
|
+
const configSchema = z.object({
|
|
58
|
+
variables: config.variables,
|
|
59
|
+
secrets: config.secrets
|
|
88
60
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
* Add polling delay to state
|
|
111
|
-
*/
|
|
112
|
-
withPolling: (delayMs) => (state) => ({ ...state, nextPollMs: delayMs }),
|
|
113
|
-
/**
|
|
114
|
-
* Set error state with message and stop polling
|
|
115
|
-
*/
|
|
116
|
-
withError: (errorMessage) => (state) => ({
|
|
117
|
-
...state,
|
|
118
|
-
phase: 'error',
|
|
119
|
-
errorMessage,
|
|
120
|
-
nextPollMs: null
|
|
121
|
-
}),
|
|
122
|
-
/**
|
|
123
|
-
* Preserve existing state with updates
|
|
124
|
-
*/
|
|
125
|
-
update: (updates) => (state) => ({ ...state, ...updates }),
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Simple pipe utility for composing state transformations
|
|
129
|
-
*/
|
|
130
|
-
export const pipe = (value, ...fns) => fns.reduce((acc, fn) => fn(acc), value);
|
|
131
|
-
/**
|
|
132
|
-
* Simple plugin base class that uses pure oRPC patterns
|
|
133
|
-
* Plugin just needs to define contract, config, and create oRPC router
|
|
134
|
-
*/
|
|
135
|
-
export class SimplePlugin {
|
|
136
|
-
// Auto-generated schemas
|
|
137
|
-
get inputSchema() {
|
|
138
|
-
return createPluginInputSchema(this.contract, this.stateSchema);
|
|
139
|
-
}
|
|
140
|
-
get outputSchema() {
|
|
141
|
-
return createPluginOutputSchema(this.contract, this.stateSchema);
|
|
142
|
-
}
|
|
143
|
-
// Default implementations - runtime handles validation
|
|
144
|
-
initialize(config) {
|
|
145
|
-
return Effect.void;
|
|
146
|
-
}
|
|
147
|
-
shutdown() {
|
|
148
|
-
return Effect.void;
|
|
149
|
-
}
|
|
150
|
-
// Default streamable detection
|
|
151
|
-
isStreamable(procedureName) {
|
|
152
|
-
const contractEntries = Object.entries(this.contract);
|
|
153
|
-
const procedure = contractEntries.find(([name]) => name === procedureName);
|
|
154
|
-
if (!procedure)
|
|
155
|
-
return false;
|
|
156
|
-
const outputSchema = procedure[1]['~orpc']?.outputSchema;
|
|
157
|
-
return outputSchema?._def?.shape?.nextState !== undefined;
|
|
61
|
+
class CreatedPlugin {
|
|
62
|
+
id = config.id;
|
|
63
|
+
type = config.type || "source";
|
|
64
|
+
contract = config.contract;
|
|
65
|
+
configSchema = configSchema;
|
|
66
|
+
_context = null;
|
|
67
|
+
initialize(pluginConfig) {
|
|
68
|
+
const init = config.initialize ?? (() => Effect.succeed({}));
|
|
69
|
+
return init(pluginConfig).pipe(Effect.tap((ctx) => Effect.sync(() => { this._context = ctx; })), Effect.map(() => this._context), Effect.mapError((error) => error));
|
|
70
|
+
}
|
|
71
|
+
shutdown() {
|
|
72
|
+
const self = this;
|
|
73
|
+
return Effect.gen(function* () {
|
|
74
|
+
if (config.shutdown && self._context) {
|
|
75
|
+
yield* config.shutdown(self._context).pipe(Effect.catchAll(() => Effect.void));
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
createRouter(context) {
|
|
80
|
+
return config.createRouter(context);
|
|
81
|
+
}
|
|
158
82
|
}
|
|
83
|
+
const PluginConstructor = CreatedPlugin;
|
|
84
|
+
PluginConstructor.binding = {
|
|
85
|
+
contract: config.contract,
|
|
86
|
+
config: configSchema
|
|
87
|
+
};
|
|
88
|
+
return PluginConstructor;
|
|
159
89
|
}
|
package/dist/runtime/errors.d.ts
CHANGED
|
@@ -29,20 +29,6 @@ export declare class ValidationError extends ValidationError_base<{
|
|
|
29
29
|
readonly zodError: z.ZodError;
|
|
30
30
|
}> {
|
|
31
31
|
}
|
|
32
|
-
declare const StreamError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
33
|
-
readonly _tag: "StreamError";
|
|
34
|
-
} & Readonly<A>;
|
|
35
|
-
export declare class StreamError extends StreamError_base<{
|
|
36
|
-
readonly pluginId: string;
|
|
37
|
-
readonly operation: "callback" | "state-extraction" | "item-extraction" | "stream-termination";
|
|
38
|
-
readonly cause?: Error;
|
|
39
|
-
readonly context?: {
|
|
40
|
-
readonly iteration?: number;
|
|
41
|
-
readonly itemsProcessed?: number;
|
|
42
|
-
readonly procedureName?: string;
|
|
43
|
-
};
|
|
44
|
-
}> {
|
|
45
|
-
}
|
|
46
32
|
export declare const isRetryableORPCCode: (code: string) => boolean;
|
|
47
33
|
export declare const wrapORPCError: (orpcError: ORPCError<string, unknown>, pluginId?: string, procedureName?: string, operation?: string) => PluginRuntimeError;
|
|
48
34
|
export declare const toPluginRuntimeError: (error: unknown, pluginId?: string, procedureName?: string, operation?: string, defaultRetryable?: boolean) => PluginRuntimeError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/runtime/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;;;;AAE7B,qBAAa,kBAAmB,SAAQ,wBAAuC;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CA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;IAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxD,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC;CAC9B,CAAC;CAAI;AAGN,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,OAWlD,CAAC;AAGF,eAAO,MAAM,aAAa,GACzB,WAAW,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,YAAY,MAAM,KAChB,kBAQF,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAChC,OAAO,OAAO,EACd,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,YAAY,MAAM,EAClB,0BAAwB,KACtB,kBAgBF,CAAC"}
|
package/dist/runtime/errors.js
CHANGED
|
@@ -6,8 +6,6 @@ export class ModuleFederationError extends Data.TaggedError("ModuleFederationErr
|
|
|
6
6
|
}
|
|
7
7
|
export class ValidationError extends Data.TaggedError("ValidationError") {
|
|
8
8
|
}
|
|
9
|
-
export class StreamError extends Data.TaggedError("StreamError") {
|
|
10
|
-
}
|
|
11
9
|
// Helper to determine if an oRPC error code is retryable
|
|
12
10
|
export const isRetryableORPCCode = (code) => {
|
|
13
11
|
switch (code) {
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,24 +1,46 @@
|
|
|
1
|
-
import { Effect, Layer, ManagedRuntime
|
|
1
|
+
import { Context, Effect, Layer, ManagedRuntime } from "effect";
|
|
2
2
|
import type { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import type { InitializedPlugin, PluginConstructor, PluginInstance, PluginOf, PluginRegistry, PluginResult, PluginRuntimeConfig, RegistryBindings, RuntimeOptions, SecretsConfig } from "../types";
|
|
4
4
|
import { PluginRuntimeError } from "./errors";
|
|
5
|
-
import { type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly executePlugin: <T extends AnyPlugin>(initializedPlugin: InitializedPlugin<T>, input: z.infer<T["inputSchema"]>) => Effect.Effect<z.infer<T["outputSchema"]>, PluginRuntimeError>;
|
|
12
|
-
readonly usePlugin: <T extends AnyPlugin>(pluginId: string, config: z.infer<T["configSchema"]>) => Effect.Effect<InitializedPlugin<T>, PluginRuntimeError>;
|
|
13
|
-
readonly streamPlugin: <T extends Plugin<Contract>, TInput extends z.infer<T["inputSchema"]> = z.infer<T["inputSchema"]>, TItem = unknown, TPluginState extends z.infer<T["stateSchema"]> = z.infer<T["stateSchema"]>>(pluginId: string, config: z.infer<T["configSchema"]>, input: TInput, options?: StreamingOptions<TItem, TPluginState>) => Effect.Effect<Stream.Stream<TItem, PluginRuntimeError>, PluginRuntimeError>;
|
|
5
|
+
import { type IPluginService } from "./services/plugin.service";
|
|
6
|
+
export interface IPluginRuntime<R extends RegistryBindings = RegistryBindings> {
|
|
7
|
+
readonly loadPlugin: <K extends keyof R>(pluginId: K) => Effect.Effect<PluginConstructor<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
8
|
+
readonly instantiatePlugin: <K extends keyof R>(ctor: PluginConstructor<PluginOf<R[K]>>) => Effect.Effect<PluginInstance<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
9
|
+
readonly initializePlugin: <K extends keyof R>(instance: PluginInstance<PluginOf<R[K]>>, config: z.infer<PluginOf<R[K]>["configSchema"]>) => Effect.Effect<InitializedPlugin<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
10
|
+
readonly usePlugin: <K extends keyof R>(pluginId: K, config: z.infer<PluginOf<R[K]>["configSchema"]>) => Effect.Effect<PluginResult<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
14
11
|
readonly shutdown: () => Effect.Effect<void, never, never>;
|
|
15
12
|
}
|
|
16
|
-
declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
export declare class PluginRuntimeImpl<R extends RegistryBindings = RegistryBindings> implements IPluginRuntime<R> {
|
|
14
|
+
private pluginService;
|
|
15
|
+
private registry;
|
|
16
|
+
private pluginCache;
|
|
17
|
+
constructor(pluginService: IPluginService, registry: PluginRegistry);
|
|
18
|
+
private generateCacheKey;
|
|
19
|
+
private validatePluginId;
|
|
20
|
+
loadPlugin<K extends keyof R>(pluginId: K): Effect.Effect<PluginConstructor<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
21
|
+
instantiatePlugin<K extends keyof R>(ctor: PluginConstructor<PluginOf<R[K]>>): Effect.Effect<PluginInstance<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
22
|
+
initializePlugin<K extends keyof R>(instance: PluginInstance<PluginOf<R[K]>>, config: z.infer<PluginOf<R[K]>["configSchema"]>): Effect.Effect<InitializedPlugin<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
23
|
+
usePlugin<K extends keyof R>(pluginId: K, config: z.infer<PluginOf<R[K]>["configSchema"]>): Effect.Effect<PluginResult<PluginOf<R[K]>>, PluginRuntimeError>;
|
|
24
|
+
shutdown(): Effect.Effect<void, never, never>;
|
|
25
|
+
/**
|
|
26
|
+
* Evict a plugin from cache and shutdown its instance
|
|
27
|
+
*/
|
|
28
|
+
evictPlugin<K extends keyof R>(pluginId: K, config: z.infer<PluginOf<R[K]>["configSchema"]>): Effect.Effect<void, never>;
|
|
29
|
+
}
|
|
30
|
+
declare const PluginRuntimeService_base: Context.TagClass<PluginRuntimeService, "PluginRuntimeService", IPluginService>;
|
|
31
|
+
export declare class PluginRuntimeService extends PluginRuntimeService_base {
|
|
32
|
+
static Live: <R extends RegistryBindings = RegistryBindings>(config: PluginRuntimeConfig<R>) => Layer.Layer<PluginRuntimeService, never, never>;
|
|
21
33
|
}
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Creates a typed plugin runtime with compile-time registry key validation.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createPluginRuntime<R extends RegistryBindings = RegistryBindings>(config: {
|
|
38
|
+
registry: PluginRegistry;
|
|
39
|
+
secrets?: SecretsConfig;
|
|
40
|
+
options?: RuntimeOptions;
|
|
41
|
+
}): {
|
|
42
|
+
runtime: ManagedRuntime.ManagedRuntime<PluginRuntimeService, never>;
|
|
43
|
+
PluginRuntime: Effect.Effect<PluginRuntimeImpl<R>, never, never>;
|
|
44
|
+
};
|
|
45
|
+
export type { ConfigOf, InitializedPlugin, PluginOf, PluginResult, RegistryBindings } from "../types";
|
|
24
46
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAQ,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAEX,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,KAAK,cAAc,EAAiB,MAAM,2BAA2B,CAAC;AAE/E,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IAC5E,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EACtC,QAAQ,EAAE,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAE1E,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