@executor-js/sdk 0.0.1 → 0.1.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.
- package/README.md +125 -107
- package/dist/blob.d.ts +48 -0
- package/dist/blob.d.ts.map +1 -0
- package/dist/blob.test.d.ts +2 -0
- package/dist/blob.test.d.ts.map +1 -0
- package/dist/chunk-2WV7VSNL.js +4440 -0
- package/dist/chunk-2WV7VSNL.js.map +1 -0
- package/dist/client.d.ts +135 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +87 -0
- package/dist/client.js.map +1 -0
- package/dist/client.test.d.ts +2 -0
- package/dist/client.test.d.ts.map +1 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/connections.d.ts +107 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.test.d.ts +2 -0
- package/dist/connections.test.d.ts.map +1 -0
- package/dist/core-schema.d.ts +372 -0
- package/dist/core-schema.d.ts.map +1 -0
- package/dist/core.js +296 -57
- package/dist/core.js.map +1 -1
- package/dist/elicitation.d.ts +18 -34
- package/dist/elicitation.d.ts.map +1 -1
- package/dist/error-handling.test.d.ts +2 -0
- package/dist/error-handling.test.d.ts.map +1 -0
- package/dist/errors.d.ts +95 -24
- package/dist/errors.d.ts.map +1 -1
- package/dist/executor.d.ts +107 -48
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.test.d.ts +2 -0
- package/dist/executor.test.d.ts.map +1 -0
- package/dist/ids.d.ts +6 -4
- package/dist/ids.d.ts.map +1 -1
- package/dist/index.d.ts +24 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -308
- package/dist/index.js.map +1 -1
- package/dist/oauth-discovery.d.ts +138 -0
- package/dist/oauth-discovery.d.ts.map +1 -0
- package/dist/oauth-discovery.test.d.ts +2 -0
- package/dist/oauth-discovery.test.d.ts.map +1 -0
- package/dist/oauth-helpers.d.ts +89 -0
- package/dist/oauth-helpers.d.ts.map +1 -0
- package/dist/oauth-helpers.test.d.ts +2 -0
- package/dist/oauth-helpers.test.d.ts.map +1 -0
- package/dist/oauth-popup-types.d.ts +14 -0
- package/dist/oauth-popup-types.d.ts.map +1 -0
- package/dist/oauth-service.d.ts +33 -0
- package/dist/oauth-service.d.ts.map +1 -0
- package/dist/oauth.d.ts +275 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/plugin.d.ts +318 -28
- package/dist/plugin.d.ts.map +1 -1
- package/dist/policies.d.ts +56 -64
- package/dist/policies.d.ts.map +1 -1
- package/dist/policies.test.d.ts +2 -0
- package/dist/policies.test.d.ts.map +1 -0
- package/dist/promise-executor.d.ts +26 -128
- package/dist/promise-executor.d.ts.map +1 -1
- package/dist/promise.d.ts +12 -6
- package/dist/promise.d.ts.map +1 -1
- package/dist/promise.test.d.ts +2 -0
- package/dist/promise.test.d.ts.map +1 -0
- package/dist/schema-types.d.ts +6 -5
- package/dist/schema-types.d.ts.map +1 -1
- package/dist/scope.d.ts +5 -15
- package/dist/scope.d.ts.map +1 -1
- package/dist/scoped-adapter.d.ts +13 -0
- package/dist/scoped-adapter.d.ts.map +1 -0
- package/dist/scoped-adapter.test.d.ts +2 -0
- package/dist/scoped-adapter.test.d.ts.map +1 -0
- package/dist/secret-backed-value.d.ts +27 -0
- package/dist/secret-backed-value.d.ts.map +1 -0
- package/dist/secrets.d.ts +52 -106
- package/dist/secrets.d.ts.map +1 -1
- package/dist/testing.d.ts +5 -3
- package/dist/testing.d.ts.map +1 -1
- package/dist/types.d.ts +84 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +28 -4
- package/dist/chunk-D7CT3UMO.js +0 -1386
- package/dist/chunk-D7CT3UMO.js.map +0 -1
- package/dist/in-memory/policy-engine.d.ts +0 -10
- package/dist/in-memory/policy-engine.d.ts.map +0 -1
- package/dist/in-memory/secret-store.d.ts +0 -16
- package/dist/in-memory/secret-store.d.ts.map +0 -1
- package/dist/in-memory/tool-registry.d.ts +0 -35
- package/dist/in-memory/tool-registry.d.ts.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/plugin-kv.d.ts +0 -48
- package/dist/plugin-kv.d.ts.map +0 -1
- package/dist/plugins/in-memory-tools.d.ts +0 -42
- package/dist/plugins/in-memory-tools.d.ts.map +0 -1
- package/dist/runtime-tools.d.ts +0 -41
- package/dist/runtime-tools.d.ts.map +0 -1
- package/dist/sources.d.ts +0 -130
- package/dist/sources.d.ts.map +0 -1
- package/dist/tools.d.ts +0 -219
- package/dist/tools.d.ts.map +0 -1
|
@@ -1,139 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly [K in keyof T]:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type CoreSourceRegistryService = Context.Tag.Service<typeof CoreSourceRegistry>;
|
|
13
|
-
type CoreSecretStoreService = Context.Tag.Service<typeof CoreSecretStore>;
|
|
14
|
-
type CorePolicyEngineService = Context.Tag.Service<typeof CorePolicyEngine>;
|
|
15
|
-
export interface ElicitationResponse {
|
|
16
|
-
readonly action: "accept" | "decline" | "cancel";
|
|
17
|
-
readonly content?: Record<string, unknown>;
|
|
18
|
-
}
|
|
19
|
-
export type ElicitationHandler = (ctx: ElicitationContext) => Promise<ElicitationResponse>;
|
|
20
|
-
export interface InvokeOptions {
|
|
21
|
-
readonly onElicitation: ElicitationHandler | "accept-all";
|
|
22
|
-
}
|
|
23
|
-
export interface ToolInvoker {
|
|
24
|
-
readonly invoke: (toolId: string, args: unknown, options: InvokeOptions) => Promise<ToolInvocationResult>;
|
|
25
|
-
readonly resolveAnnotations?: (toolId: string) => Promise<ToolAnnotations | undefined>;
|
|
26
|
-
}
|
|
27
|
-
export interface RuntimeToolHandler {
|
|
28
|
-
readonly invoke: (args: unknown, options: InvokeOptions) => Promise<ToolInvocationResult>;
|
|
29
|
-
readonly resolveAnnotations?: () => Promise<ToolAnnotations | undefined>;
|
|
30
|
-
}
|
|
31
|
-
export type SourceManager = PromisifyService<EffectSourceManager>;
|
|
32
|
-
export type SecretProvider = PromisifyService<EffectSecretProvider>;
|
|
33
|
-
export interface PluginContext {
|
|
34
|
-
readonly scope: Scope;
|
|
35
|
-
readonly tools: ToolRegistry;
|
|
36
|
-
readonly sources: SourceRegistry;
|
|
37
|
-
readonly secrets: SecretStore;
|
|
38
|
-
readonly policies: PolicyEngine;
|
|
39
|
-
}
|
|
40
|
-
export interface ToolRegistry extends Omit<PromisifyService<CoreToolRegistryService>, "list" | "invoke" | "registerInvoker" | "registerRuntimeHandler"> {
|
|
41
|
-
readonly list: (filter?: {
|
|
42
|
-
sourceId?: string;
|
|
43
|
-
query?: string;
|
|
44
|
-
}) => Promise<readonly ToolMetadata[]>;
|
|
45
|
-
readonly invoke: (toolId: string, args: unknown, options: InvokeOptions) => Promise<ToolInvocationResult>;
|
|
46
|
-
readonly registerInvoker: (pluginKey: string, invoker: ToolInvoker) => Promise<void>;
|
|
47
|
-
readonly registerRuntimeHandler: (toolId: string, handler: RuntimeToolHandler) => Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
export interface SourceRegistry extends Omit<PromisifyService<CoreSourceRegistryService>, "addManager"> {
|
|
50
|
-
readonly addManager: (manager: SourceManager) => Promise<void>;
|
|
51
|
-
}
|
|
52
|
-
export interface SecretStore extends Omit<PromisifyService<CoreSecretStoreService>, "set" | "addProvider"> {
|
|
53
|
-
readonly set: (input: {
|
|
54
|
-
readonly id: string;
|
|
55
|
-
readonly scopeId: string;
|
|
56
|
-
readonly name: string;
|
|
57
|
-
readonly value: string;
|
|
58
|
-
readonly provider?: string;
|
|
59
|
-
readonly purpose?: string;
|
|
60
|
-
}) => Promise<SecretRef>;
|
|
61
|
-
readonly addProvider: (provider: SecretProvider) => Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
export interface PolicyEngine extends Omit<PromisifyService<CorePolicyEngineService>, "check"> {
|
|
64
|
-
readonly check: (input: {
|
|
65
|
-
scopeId: string;
|
|
66
|
-
toolId: string;
|
|
67
|
-
}) => Promise<void>;
|
|
68
|
-
}
|
|
69
|
-
export interface Plugin<TKey extends string = string, TExtension extends object = object> {
|
|
70
|
-
readonly key: TKey;
|
|
71
|
-
/** @internal */
|
|
72
|
-
readonly _promise?: true;
|
|
73
|
-
readonly init: (ctx: PluginContext) => Promise<PluginHandle<TExtension>>;
|
|
74
|
-
}
|
|
75
|
-
export interface PluginHandle<TExtension extends object = object> {
|
|
76
|
-
readonly extension: TExtension;
|
|
77
|
-
readonly close?: () => Promise<void>;
|
|
78
|
-
}
|
|
79
|
-
export declare const definePlugin: <const TKey extends string, TExtension extends object>(plugin: Plugin<TKey, TExtension>) => Plugin<TKey, TExtension>;
|
|
80
|
-
type Promisified<T> = T extends (...args: infer A) => Effect.Effect<infer R, infer _E> ? (...args: A) => Promise<R> : T extends object ? {
|
|
1
|
+
import { Brand, Effect } from "effect";
|
|
2
|
+
import { type Executor as EffectExecutor, type OnElicitation } from "./executor";
|
|
3
|
+
import type { AnyPlugin } from "./plugin";
|
|
4
|
+
type Unbrand<T> = T extends Brand.Brand<string> ? string : T extends readonly (infer U)[] ? readonly Unbrand<U>[] : T extends ReadonlyMap<infer K, infer V> ? ReadonlyMap<Unbrand<K>, Unbrand<V>> : T extends ReadonlySet<infer U> ? ReadonlySet<Unbrand<U>> : T extends Date ? T : T extends (...args: infer A) => infer R ? (...args: {
|
|
5
|
+
[I in keyof A]: Unbrand<A[I]>;
|
|
6
|
+
}) => Unbrand<R> : T extends object ? {
|
|
7
|
+
readonly [K in keyof T]: Unbrand<T[K]>;
|
|
8
|
+
} : T;
|
|
9
|
+
export type Promisified<T> = T extends (...args: infer A) => Effect.Effect<infer R, infer _E> ? (...args: {
|
|
10
|
+
[I in keyof A]: Unbrand<A[I]>;
|
|
11
|
+
}) => Promise<R> : T extends readonly unknown[] ? T : T extends object ? {
|
|
81
12
|
readonly [K in keyof T]: Promisified<T[K]>;
|
|
82
13
|
} : T;
|
|
83
|
-
export type AnyPlugin =
|
|
84
|
-
export type Executor<TPlugins extends readonly AnyPlugin[] = []> = {
|
|
85
|
-
readonly scope: Scope;
|
|
86
|
-
readonly tools: Pick<ToolRegistry, "list" | "schema" | "definitions" | "invoke">;
|
|
87
|
-
readonly sources: Pick<SourceRegistry, "list" | "remove" | "refresh" | "detect">;
|
|
88
|
-
readonly policies: {
|
|
89
|
-
readonly list: () => Promise<readonly Policy[]>;
|
|
90
|
-
readonly add: (policy: Omit<Policy, "id" | "createdAt">) => Promise<Policy>;
|
|
91
|
-
readonly remove: (policyId: string) => Promise<boolean>;
|
|
92
|
-
};
|
|
93
|
-
readonly secrets: {
|
|
94
|
-
readonly list: () => Promise<readonly SecretRef[]>;
|
|
95
|
-
readonly resolve: (secretId: string) => Promise<string>;
|
|
96
|
-
readonly status: (secretId: string) => Promise<"resolved" | "missing">;
|
|
97
|
-
readonly set: (input: {
|
|
98
|
-
readonly id: string;
|
|
99
|
-
readonly name: string;
|
|
100
|
-
readonly value: string;
|
|
101
|
-
readonly provider?: string;
|
|
102
|
-
readonly purpose?: string;
|
|
103
|
-
}) => Promise<SecretRef>;
|
|
104
|
-
readonly remove: (secretId: string) => Promise<boolean>;
|
|
105
|
-
readonly addProvider: (provider: SecretProvider) => Promise<void>;
|
|
106
|
-
readonly providers: () => Promise<readonly string[]>;
|
|
107
|
-
};
|
|
108
|
-
readonly close: () => Promise<void>;
|
|
109
|
-
} & PluginExtensions<TPlugins>;
|
|
110
|
-
type PluginExtensions<TPlugins extends readonly AnyPlugin[]> = {
|
|
111
|
-
readonly [P in TPlugins[number] as P["key"]]: P extends Plugin<string, infer TExt> ? TExt : P extends ExecutorPlugin<string, infer TExt> ? Promisified<TExt> : never;
|
|
112
|
-
};
|
|
14
|
+
export type Executor<TPlugins extends readonly AnyPlugin[] = []> = Promisified<EffectExecutor<TPlugins>>;
|
|
113
15
|
export interface ExecutorConfig<TPlugins extends readonly AnyPlugin[] = []> {
|
|
114
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Precedence-ordered scope stack (innermost first). Optional — defaults
|
|
18
|
+
* to a single-element stack with id "default-scope". Pass an array of
|
|
19
|
+
* `{ id, name }` partials to build a multi-scope executor.
|
|
20
|
+
*/
|
|
21
|
+
readonly scopes?: readonly {
|
|
115
22
|
readonly id?: string;
|
|
116
23
|
readonly name?: string;
|
|
117
|
-
};
|
|
24
|
+
}[];
|
|
118
25
|
readonly plugins?: TPlugins;
|
|
119
26
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/** Custom source registry implementation. Defaults to an in-memory store. */
|
|
126
|
-
readonly sources?: SourceRegistry;
|
|
127
|
-
/**
|
|
128
|
-
* Custom secret store implementation. Defaults to an in-memory store.
|
|
129
|
-
* For most use cases, prefer passing a custom `SecretProvider` via
|
|
130
|
-
* `executor.secrets.addProvider(...)` — only replace the whole store if you
|
|
131
|
-
* need to persist the `SecretRef` metadata itself.
|
|
27
|
+
* How to respond when a tool requests user input mid-invocation. Pass
|
|
28
|
+
* `"accept-all"` for tests / non-interactive hosts, or a handler
|
|
29
|
+
* `(ctx) => Promise<ElicitationResponse>` for interactive ones.
|
|
30
|
+
* Required at construction so per-invoke calls don't have to thread
|
|
31
|
+
* an options arg.
|
|
132
32
|
*/
|
|
133
|
-
readonly
|
|
134
|
-
/** Custom policy engine implementation. Defaults to an in-memory store. */
|
|
135
|
-
readonly policies?: PolicyEngine;
|
|
33
|
+
readonly onElicitation: OnElicitation;
|
|
136
34
|
}
|
|
137
|
-
export declare const createExecutor: <const TPlugins extends readonly AnyPlugin[] = []>(config
|
|
35
|
+
export declare const createExecutor: <const TPlugins extends readonly AnyPlugin[] = []>(config: ExecutorConfig<TPlugins>) => Promise<Executor<TPlugins>>;
|
|
138
36
|
export {};
|
|
139
37
|
//# sourceMappingURL=promise-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-executor.d.ts","sourceRoot":"","sources":["../src/promise-executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"promise-executor.d.ts","sourceRoot":"","sources":["../src/promise-executor.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKvC,OAAO,EAGL,KAAK,QAAQ,IAAI,cAAc,EAC/B,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAgB1C,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAC3C,MAAM,GACN,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC5B,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,GACrB,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GACrC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GACnC,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAC5B,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvB,CAAC,SAAS,IAAI,GACZ,CAAC,GACD,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACrC,CAAC,GAAG,IAAI,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAC1D,CAAC,SAAS,MAAM,GACd;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC1C,CAAC,CAAC;AAElB,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CACrC,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,GACjC,CAAC,GAAG,IAAI,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAC1D,CAAC,SAAS,SAAS,OAAO,EAAE,GAC1B,CAAC,GACD,CAAC,SAAS,MAAM,GACd;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC9C,CAAC,CAAC;AAEV,MAAM,MAAM,QAAQ,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,EAAE,IAAI,WAAW,CAC5E,cAAc,CAAC,QAAQ,CAAC,CACzB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,EAAE;IACxE;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;CACvC;AAyDD,eAAO,MAAM,cAAc,GACzB,KAAK,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,EAAE,EAEhD,QAAQ,cAAc,CAAC,QAAQ,CAAC,KAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAyC5B,CAAC"}
|
package/dist/promise.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
export { createExecutor, type Executor, type ExecutorConfig, type
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export type
|
|
6
|
-
export {
|
|
1
|
+
export { createExecutor, type Executor, type ExecutorConfig, type Promisified, } from "./promise-executor";
|
|
2
|
+
export { ScopeId, ToolId, SecretId, PolicyId } from "./ids";
|
|
3
|
+
export { Scope } from "./scope";
|
|
4
|
+
export { SecretRef, SetSecretInput } from "./secrets";
|
|
5
|
+
export { ToolSchema, SourceDetectionResult, type Source, type Tool, type ToolListFilter, } from "./types";
|
|
6
|
+
export type { ToolAnnotations } from "./core-schema";
|
|
7
|
+
export type { AnyPlugin, PluginExtensions } from "./plugin";
|
|
8
|
+
export type { OnElicitation, InvokeOptions } from "./executor";
|
|
9
|
+
export { FormElicitation, UrlElicitation, ElicitationAction, ElicitationResponse, type ElicitationRequest, type ElicitationContext, type ElicitationHandler, } from "./elicitation";
|
|
10
|
+
export { SecretBackedValue, SecretBackedMap, isSecretBackedRef, resolveSecretBackedMap, type ResolveSecretBackedMapOptions, } from "./secret-backed-value";
|
|
11
|
+
export { defineExecutorConfig, type ExecutorCliConfig, type ExecutorDialect, } from "./config";
|
|
12
|
+
export { ToolNotFoundError, ToolInvocationError, NoHandlerError, SourceNotFoundError, SourceRemovalNotAllowedError, PluginNotLoadedError, SecretNotFoundError, SecretResolutionError, type ExecutorError, } from "./errors";
|
|
7
13
|
//# sourceMappingURL=promise.d.ts.map
|
package/dist/promise.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../src/promise.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../src/promise.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI/D,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promise.test.d.ts","sourceRoot":"","sources":["../src/promise.test.ts"],"names":[],"mappings":""}
|
package/dist/schema-types.d.ts
CHANGED
|
@@ -11,14 +11,15 @@ export type TypeScriptSchemaPreview = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare const schemaToTypeScriptPreview: (schema: unknown, options?: TypeScriptRenderOptions) => TypeScriptSchemaPreview;
|
|
13
13
|
export declare const schemaToTypeScriptPreviewWithDefs: (schema: unknown, defs: ReadonlyMap<string, unknown>, options?: TypeScriptRenderOptions) => TypeScriptSchemaPreview;
|
|
14
|
+
export type ToolTypeScriptPreview = {
|
|
15
|
+
inputTypeScript?: string;
|
|
16
|
+
outputTypeScript?: string;
|
|
17
|
+
typeScriptDefinitions?: Record<string, string>;
|
|
18
|
+
};
|
|
14
19
|
export declare const buildToolTypeScriptPreview: (input: {
|
|
15
20
|
inputSchema?: unknown;
|
|
16
21
|
outputSchema?: unknown;
|
|
17
22
|
defs: ReadonlyMap<string, unknown>;
|
|
18
23
|
options?: TypeScriptRenderOptions;
|
|
19
|
-
}) =>
|
|
20
|
-
inputTypeScript?: string;
|
|
21
|
-
outputTypeScript?: string;
|
|
22
|
-
typeScriptDefinitions?: Record<string, string>;
|
|
23
|
-
};
|
|
24
|
+
}) => ToolTypeScriptPreview;
|
|
24
25
|
//# sourceMappingURL=schema-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-types.d.ts","sourceRoot":"","sources":["../src/schema-types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAgGF,eAAO,MAAM,yBAAyB,GACpC,QAAQ,OAAO,EACf,UAAS,uBAA4B,KACpC,uBAGF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,QAAQ,OAAO,EACf,MAAM,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,UAAS,uBAA4B,KACpC,uBAmPF,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"schema-types.d.ts","sourceRoot":"","sources":["../src/schema-types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAgGF,eAAO,MAAM,yBAAyB,GACpC,QAAQ,OAAO,EACf,UAAS,uBAA4B,KACpC,uBAGF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,QAAQ,OAAO,EACf,MAAM,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,UAAS,uBAA4B,KACpC,uBAmPF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,OAAO;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC,KAAG,qBAsBH,CAAC"}
|
package/dist/scope.d.ts
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
declare const Scope_base: Schema.Class<Scope, {
|
|
3
|
-
id: Schema.brand<
|
|
4
|
-
name:
|
|
5
|
-
createdAt:
|
|
6
|
-
}
|
|
7
|
-
id: Schema.brand<typeof Schema.String, "ScopeId">;
|
|
8
|
-
name: typeof Schema.String;
|
|
9
|
-
createdAt: typeof Schema.DateFromNumber;
|
|
10
|
-
}>, never, {
|
|
11
|
-
readonly id: string & import("effect/Brand").Brand<"ScopeId">;
|
|
12
|
-
} & {
|
|
13
|
-
readonly name: string;
|
|
14
|
-
} & {
|
|
15
|
-
readonly createdAt: Date;
|
|
16
|
-
}, {}, {}>;
|
|
2
|
+
declare const Scope_base: Schema.Class<Scope, Schema.Struct<{
|
|
3
|
+
readonly id: Schema.brand<Schema.String, "ScopeId">;
|
|
4
|
+
readonly name: Schema.String;
|
|
5
|
+
readonly createdAt: Schema.Date;
|
|
6
|
+
}>, {}>;
|
|
17
7
|
export declare class Scope extends Scope_base {
|
|
18
8
|
}
|
|
19
9
|
export {};
|
package/dist/scope.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../src/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../src/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;AAIhC,qBAAa,KAAM,SAAQ,UAIzB;CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type DBAdapter, type DBSchema } from "@executor-js/storage-core";
|
|
2
|
+
export interface ScopeContext {
|
|
3
|
+
/**
|
|
4
|
+
* Precedence-ordered list of scope ids the wrapper accepts on reads
|
|
5
|
+
* and writes. Innermost first. Reads walk every scope in the list
|
|
6
|
+
* (via `scope_id IN (...)`); writes must name one of them explicitly
|
|
7
|
+
* via `scope_id` in the payload.
|
|
8
|
+
*/
|
|
9
|
+
readonly scopes: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const scopeAdapter: (inner: DBAdapter, ctx: ScopeContext, schema: DBSchema) => DBAdapter;
|
|
12
|
+
export declare const __scopeField = "scope_id";
|
|
13
|
+
//# sourceMappingURL=scoped-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-adapter.d.ts","sourceRoot":"","sources":["../src/scoped-adapter.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,QAAQ,EAGd,MAAM,2BAA2B,CAAC;AAInC,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AA0KD,eAAO,MAAM,YAAY,GACvB,OAAO,SAAS,EAChB,KAAK,YAAY,EACjB,QAAQ,QAAQ,KACf,SAiBF,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-adapter.test.d.ts","sourceRoot":"","sources":["../src/scoped-adapter.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
export declare const SecretBackedValue: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
3
|
+
readonly secretId: Schema.String;
|
|
4
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
5
|
+
}>]>;
|
|
6
|
+
export type SecretBackedValue = typeof SecretBackedValue.Type;
|
|
7
|
+
export declare const SecretBackedMap: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
8
|
+
readonly secretId: Schema.String;
|
|
9
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
10
|
+
}>]>>;
|
|
11
|
+
export type SecretBackedMap = typeof SecretBackedMap.Type;
|
|
12
|
+
export declare const isSecretBackedRef: (value: SecretBackedValue) => value is Extract<SecretBackedValue, {
|
|
13
|
+
readonly secretId: string;
|
|
14
|
+
}>;
|
|
15
|
+
export type ResolveSecretBackedMapOptions<E, E2> = {
|
|
16
|
+
readonly values: Record<string, SecretBackedValue> | undefined;
|
|
17
|
+
readonly getSecret: (secretId: string) => Effect.Effect<string | null, E>;
|
|
18
|
+
readonly onMissing: (name: string, value: Extract<SecretBackedValue, {
|
|
19
|
+
readonly secretId: string;
|
|
20
|
+
}>) => E2;
|
|
21
|
+
readonly onError?: (error: E, name: string, value: Extract<SecretBackedValue, {
|
|
22
|
+
readonly secretId: string;
|
|
23
|
+
}>) => E | E2;
|
|
24
|
+
readonly missing?: "fail" | "drop";
|
|
25
|
+
};
|
|
26
|
+
export declare const resolveSecretBackedMap: <E, E2 = E>({ values, getSecret, onMissing, onError, missing, }: ResolveSecretBackedMapOptions<E, E2>) => Effect.Effect<Record<string, string> | undefined, E | E2>;
|
|
27
|
+
//# sourceMappingURL=secret-backed-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-backed-value.d.ts","sourceRoot":"","sources":["../src/secret-backed-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,eAAO,MAAM,iBAAiB;;;IAM5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC;AAE9D,eAAO,MAAM,eAAe;;;KAAkD,CAAC;AAC/E,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,eAAO,MAAM,iBAAiB,GAC5B,OAAO,iBAAiB,KACvB,KAAK,IAAI,OAAO,CAAC,iBAAiB,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAA8B,CAAC;AAEnG,MAAM,MAAM,6BAA6B,CAAC,CAAC,EAAE,EAAE,IAAI;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAAS,CAAC;IAC/D,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1E,QAAQ,CAAC,SAAS,EAAE,CAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,CAAC,iBAAiB,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAC7D,EAAE,CAAC;IACR,QAAQ,CAAC,OAAO,CAAC,EAAE,CACjB,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,CAAC,iBAAiB,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAC7D,CAAC,GAAG,EAAE,CAAC;IACZ,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,qDAM/C,6BAA6B,CAAC,CAAC,EAAE,EAAE,CAAC,KAAG,MAAM,CAAC,MAAM,CACrD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClC,CAAC,GAAG,EAAE,CA2BP,CAAC"}
|
package/dist/secrets.d.ts
CHANGED
|
@@ -1,118 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SecretNotFoundError, SecretResolutionError } from "./errors";
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import type { StorageFailure } from "@executor-js/storage-core";
|
|
4
3
|
export interface SecretProvider {
|
|
5
|
-
/** Unique key (e.g. "keychain", "env", "1password", "memory") */
|
|
4
|
+
/** Unique key (e.g. "keychain", "env", "1password", "memory"). */
|
|
6
5
|
readonly key: string;
|
|
7
|
-
/**
|
|
6
|
+
/** If false, `set` and `delete` are never called. The executor
|
|
7
|
+
* honours this before routing writes — trying to write to a
|
|
8
|
+
* read-only provider is an error, not a silent drop. */
|
|
8
9
|
readonly writable: boolean;
|
|
9
|
-
/** Get a secret value
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
/** Get a secret value. `scope` is the executor scope the lookup is
|
|
11
|
+
* being made on behalf of — providers that partition their storage
|
|
12
|
+
* by scope (memory, keychain via service name, per-vault in
|
|
13
|
+
* 1password) use it; providers without tenancy ignore it and fall
|
|
14
|
+
* back to a flat lookup. Failures (provider unreachable, decryption
|
|
15
|
+
* failed, etc.) surface as `StorageFailure` — the executor treats
|
|
16
|
+
* a provider call the same as a DB call; `StorageError` is captured
|
|
17
|
+
* at the HTTP edge to `InternalError`, `UniqueViolationError` dies. */
|
|
18
|
+
readonly get: (id: string, scope: string) => Effect.Effect<string | null, StorageFailure>;
|
|
19
|
+
/** Check whether a provider has a backing value without returning it.
|
|
20
|
+
* Providers that can answer this cheaply should implement it so
|
|
21
|
+
* stale core routing rows don't appear as selectable secrets. */
|
|
22
|
+
readonly has?: (id: string, scope: string) => Effect.Effect<boolean, StorageFailure>;
|
|
23
|
+
/** Set a secret value at a named scope. Only called on writable
|
|
24
|
+
* providers. Providers that partition by scope use this arg to
|
|
25
|
+
* decide where to write; flat providers ignore it. */
|
|
26
|
+
readonly set?: (id: string, value: string, scope: string) => Effect.Effect<void, StorageFailure>;
|
|
27
|
+
/** Delete a secret at a named scope. Only called on writable providers.
|
|
28
|
+
* Returns true if something was deleted. */
|
|
29
|
+
readonly delete?: (id: string, scope: string) => Effect.Effect<boolean, StorageFailure>;
|
|
30
|
+
/** Enumerate known secret entries. Optional — not all backends can
|
|
31
|
+
* enumerate (env-backed providers, for example). */
|
|
16
32
|
readonly list?: () => Effect.Effect<readonly {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
}[]>;
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly name: string;
|
|
35
|
+
}[], StorageFailure>;
|
|
20
36
|
}
|
|
21
|
-
declare const SecretRef_base: Schema.Class<SecretRef, {
|
|
22
|
-
id: Schema.brand<
|
|
23
|
-
scopeId: Schema.brand<
|
|
37
|
+
declare const SecretRef_base: Schema.Class<SecretRef, Schema.Struct<{
|
|
38
|
+
readonly id: Schema.brand<Schema.String, "SecretId">;
|
|
39
|
+
readonly scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
24
40
|
/** Human-readable label (e.g. "Cloudflare API Token") */
|
|
25
|
-
name:
|
|
26
|
-
/**
|
|
27
|
-
provider: Schema.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/** What this secret is for */
|
|
31
|
-
purpose: Schema.optional<typeof Schema.String>;
|
|
32
|
-
createdAt: typeof Schema.DateFromNumber;
|
|
33
|
-
}, Schema.Struct.Encoded<{
|
|
34
|
-
id: Schema.brand<typeof Schema.String, "SecretId">;
|
|
35
|
-
scopeId: Schema.brand<typeof Schema.String, "ScopeId">;
|
|
36
|
-
/** Human-readable label (e.g. "Cloudflare API Token") */
|
|
37
|
-
name: typeof Schema.String;
|
|
38
|
-
/** Optional: pin to a specific provider */
|
|
39
|
-
provider: Schema.optionalWith<typeof Schema.String, {
|
|
40
|
-
as: "Option";
|
|
41
|
-
}>;
|
|
42
|
-
/** What this secret is for */
|
|
43
|
-
purpose: Schema.optional<typeof Schema.String>;
|
|
44
|
-
createdAt: typeof Schema.DateFromNumber;
|
|
45
|
-
}>, never, {
|
|
46
|
-
readonly id: string & import("effect/Brand").Brand<"SecretId">;
|
|
47
|
-
} & {
|
|
48
|
-
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
49
|
-
} & {
|
|
50
|
-
readonly name: string;
|
|
51
|
-
} & {
|
|
52
|
-
readonly createdAt: Date;
|
|
53
|
-
} & {
|
|
54
|
-
readonly provider: import("effect/Option").Option<string>;
|
|
55
|
-
} & {
|
|
56
|
-
readonly purpose?: string | undefined;
|
|
57
|
-
}, {}, {}>;
|
|
41
|
+
readonly name: Schema.String;
|
|
42
|
+
/** Which provider holds the value */
|
|
43
|
+
readonly provider: Schema.String;
|
|
44
|
+
readonly createdAt: Schema.Date;
|
|
45
|
+
}>, {}>;
|
|
58
46
|
export declare class SecretRef extends SecretRef_base {
|
|
59
47
|
}
|
|
60
|
-
declare const SetSecretInput_base: Schema.Class<SetSecretInput, {
|
|
61
|
-
id: Schema.brand<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
purpose: Schema.optional<typeof Schema.String>;
|
|
74
|
-
}>, never, {
|
|
75
|
-
readonly value: string;
|
|
76
|
-
} & {
|
|
77
|
-
readonly id: string & import("effect/Brand").Brand<"SecretId">;
|
|
78
|
-
} & {
|
|
79
|
-
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
80
|
-
} & {
|
|
81
|
-
readonly name: string;
|
|
82
|
-
} & {
|
|
83
|
-
readonly provider?: string | undefined;
|
|
84
|
-
} & {
|
|
85
|
-
readonly purpose?: string | undefined;
|
|
86
|
-
}, {}, {}>;
|
|
48
|
+
declare const SetSecretInput_base: Schema.Class<SetSecretInput, Schema.Struct<{
|
|
49
|
+
readonly id: Schema.brand<Schema.String, "SecretId">;
|
|
50
|
+
/** Scope id to own this secret. Must be one of the executor's
|
|
51
|
+
* configured scopes. */
|
|
52
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
53
|
+
/** Display name shown in secret-list UI. */
|
|
54
|
+
readonly name: Schema.String;
|
|
55
|
+
/** The secret value itself — never persisted outside the provider. */
|
|
56
|
+
readonly value: Schema.String;
|
|
57
|
+
/** Optional provider routing. If unset the executor picks the first
|
|
58
|
+
* writable provider in registration order. */
|
|
59
|
+
readonly provider: Schema.optional<Schema.String>;
|
|
60
|
+
}>, {}>;
|
|
87
61
|
export declare class SetSecretInput extends SetSecretInput_base {
|
|
88
62
|
}
|
|
89
|
-
declare const SecretStore_base: Context.TagClass<SecretStore, "@executor-js/sdk/SecretStore", {
|
|
90
|
-
/** List all secret refs for a scope */
|
|
91
|
-
readonly list: (scopeId: ScopeId) => Effect.Effect<readonly SecretRef[]>;
|
|
92
|
-
/** Get a specific secret ref by id */
|
|
93
|
-
readonly get: (secretId: SecretId) => Effect.Effect<SecretRef, SecretNotFoundError>;
|
|
94
|
-
/**
|
|
95
|
-
* Resolve a secret value by id.
|
|
96
|
-
* Walks the provider chain (and optionally scope chain) to find the value.
|
|
97
|
-
*/
|
|
98
|
-
readonly resolve: (secretId: SecretId, scopeId: ScopeId) => Effect.Effect<string, SecretNotFoundError | SecretResolutionError>;
|
|
99
|
-
/**
|
|
100
|
-
* Check if a secret can be resolved.
|
|
101
|
-
*/
|
|
102
|
-
readonly status: (secretId: SecretId, scopeId: ScopeId) => Effect.Effect<"resolved" | "missing">;
|
|
103
|
-
/**
|
|
104
|
-
* Store a secret value. Creates a ref and writes the value to the
|
|
105
|
-
* preferred writable provider.
|
|
106
|
-
*/
|
|
107
|
-
readonly set: (input: SetSecretInput) => Effect.Effect<SecretRef, SecretResolutionError>;
|
|
108
|
-
/** Remove a secret ref and its value from the provider */
|
|
109
|
-
readonly remove: (secretId: SecretId) => Effect.Effect<boolean, SecretNotFoundError>;
|
|
110
|
-
/** Register a secret provider */
|
|
111
|
-
readonly addProvider: (provider: SecretProvider) => Effect.Effect<void>;
|
|
112
|
-
/** List registered provider keys */
|
|
113
|
-
readonly providers: () => Effect.Effect<readonly string[]>;
|
|
114
|
-
}>;
|
|
115
|
-
export declare class SecretStore extends SecretStore_base {
|
|
116
|
-
}
|
|
117
63
|
export {};
|
|
118
64
|
//# sourceMappingURL=secrets.d.ts.map
|
package/dist/secrets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAehE,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;6DAEyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;;;;;4EAOwE;IACxE,QAAQ,CAAC,GAAG,EAAE,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,CAAC;IAClD;;sEAEkE;IAClE,QAAQ,CAAC,GAAG,CAAC,EAAE,CACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC5C;;2DAEuD;IACvD,QAAQ,CAAC,GAAG,CAAC,EAAE,CACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACzC;iDAC6C;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,CAChB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC5C;yDACqD;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,CACjC,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,EACzD,cAAc,CACf,CAAC;CACH;;;;IAWC,yDAAyD;;IAEzD,qCAAqC;;;;AALvC,qBAAa,SAAU,SAAQ,cAQ7B;CAAG;;;IAiBH;6BACyB;;IAEzB,4CAA4C;;IAE5C,sEAAsE;;IAEtE;mDAC+C;;;AAZjD,qBAAa,cAAe,SAAQ,mBAclC;CAAG"}
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ExecutorConfig } from "./executor";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { AnyPlugin } from "./plugin";
|
|
3
|
+
import { Scope } from "./scope";
|
|
4
|
+
export declare const makeTestConfig: <const TPlugins extends readonly AnyPlugin[] = []>(options?: {
|
|
5
|
+
readonly scopeName?: string;
|
|
6
|
+
readonly scopes?: readonly Scope[];
|
|
5
7
|
readonly plugins?: TPlugins;
|
|
6
8
|
}) => ExecutorConfig<TPlugins>;
|
|
7
9
|
//# sourceMappingURL=testing.d.ts.map
|
package/dist/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAWhC,eAAO,MAAM,cAAc,GACzB,KAAK,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,EAAE,EAChD,UAAU;IACV,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;CAC7B,KAAG,cAAc,CAAC,QAAQ,CAsB1B,CAAC"}
|