@executor-js/sdk 0.0.1 → 0.0.2
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-6LMMN2GP.js +4396 -0
- package/dist/chunk-6LMMN2GP.js.map +1 -0
- package/dist/config.d.ts +14 -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 +273 -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 +22 -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 +261 -27
- 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 +7 -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
package/dist/errors.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { ToolId } from "./ids";
|
|
3
|
-
declare const ToolNotFoundError_base: Schema.
|
|
4
|
-
readonly
|
|
5
|
-
}
|
|
6
|
-
toolId: Schema.brand<typeof Schema.String, "ToolId">;
|
|
7
|
-
}>;
|
|
3
|
+
declare const ToolNotFoundError_base: Schema.Class<ToolNotFoundError, Schema.TaggedStruct<"ToolNotFoundError", {
|
|
4
|
+
readonly toolId: Schema.brand<Schema.String, "ToolId">;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
6
|
export declare class ToolNotFoundError extends ToolNotFoundError_base {
|
|
9
7
|
}
|
|
10
8
|
declare const ToolInvocationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
@@ -16,29 +14,102 @@ export declare class ToolInvocationError extends ToolInvocationError_base<{
|
|
|
16
14
|
readonly cause?: unknown;
|
|
17
15
|
}> {
|
|
18
16
|
}
|
|
19
|
-
declare const
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
declare const PluginNotLoadedError_base: Schema.Class<PluginNotLoadedError, Schema.TaggedStruct<"PluginNotLoadedError", {
|
|
18
|
+
readonly pluginId: Schema.String;
|
|
19
|
+
readonly toolId: Schema.brand<Schema.String, "ToolId">;
|
|
20
|
+
}>, import("effect/Cause").YieldableError>;
|
|
21
|
+
/** Tool row exists in the DB but its owning plugin isn't loaded. Means
|
|
22
|
+
* the tool was registered by a plugin that's no longer present in the
|
|
23
|
+
* current executor config — usually a stale row from an older session. */
|
|
24
|
+
export declare class PluginNotLoadedError extends PluginNotLoadedError_base {
|
|
25
|
+
}
|
|
26
|
+
declare const NoHandlerError_base: Schema.Class<NoHandlerError, Schema.TaggedStruct<"NoHandlerError", {
|
|
27
|
+
readonly toolId: Schema.brand<Schema.String, "ToolId">;
|
|
28
|
+
readonly pluginId: Schema.String;
|
|
29
|
+
}>, import("effect/Cause").YieldableError>;
|
|
30
|
+
/** Tool was found but its owning plugin has no `invokeTool` handler —
|
|
31
|
+
* the plugin only declares static tools and this one's id matched
|
|
32
|
+
* dynamically somehow. Shouldn't happen in practice; guards against
|
|
33
|
+
* programmer error. */
|
|
34
|
+
export declare class NoHandlerError extends NoHandlerError_base {
|
|
35
|
+
}
|
|
36
|
+
declare const ToolBlockedError_base: Schema.Class<ToolBlockedError, Schema.TaggedStruct<"ToolBlockedError", {
|
|
37
|
+
readonly toolId: Schema.brand<Schema.String, "ToolId">;
|
|
38
|
+
readonly pattern: Schema.String;
|
|
39
|
+
}>, import("effect/Cause").YieldableError>;
|
|
40
|
+
/** Tool invocation was rejected because a workspace `tool_policy` rule
|
|
41
|
+
* with `action: "block"` matched. `pattern` is the matched policy
|
|
42
|
+
* pattern so callers / agents can render a useful "this is blocked
|
|
43
|
+
* by your `vercel.dns.*` rule" message. */
|
|
44
|
+
export declare class ToolBlockedError extends ToolBlockedError_base {
|
|
45
|
+
}
|
|
46
|
+
declare const SourceNotFoundError_base: Schema.Class<SourceNotFoundError, Schema.TaggedStruct<"SourceNotFoundError", {
|
|
47
|
+
readonly sourceId: Schema.String;
|
|
48
|
+
}>, import("effect/Cause").YieldableError>;
|
|
49
|
+
export declare class SourceNotFoundError extends SourceNotFoundError_base {
|
|
50
|
+
}
|
|
51
|
+
declare const SourceRemovalNotAllowedError_base: Schema.Class<SourceRemovalNotAllowedError, Schema.TaggedStruct<"SourceRemovalNotAllowedError", {
|
|
52
|
+
readonly sourceId: Schema.String;
|
|
53
|
+
}>, import("effect/Cause").YieldableError>;
|
|
54
|
+
/** `executor.sources.remove(id)` was called on a source with
|
|
55
|
+
* `canRemove: false` — typically a static source declared by a plugin
|
|
56
|
+
* at startup. Removing static sources is a bug in the caller. */
|
|
57
|
+
export declare class SourceRemovalNotAllowedError extends SourceRemovalNotAllowedError_base {
|
|
58
|
+
}
|
|
59
|
+
declare const SecretNotFoundError_base: Schema.Class<SecretNotFoundError, Schema.TaggedStruct<"SecretNotFoundError", {
|
|
60
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
61
|
+
}>, import("effect/Cause").YieldableError>;
|
|
24
62
|
export declare class SecretNotFoundError extends SecretNotFoundError_base {
|
|
25
63
|
}
|
|
26
|
-
declare const SecretResolutionError_base: Schema.
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
message: typeof Schema.String;
|
|
31
|
-
}>;
|
|
64
|
+
declare const SecretResolutionError_base: Schema.Class<SecretResolutionError, Schema.TaggedStruct<"SecretResolutionError", {
|
|
65
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
66
|
+
readonly message: Schema.String;
|
|
67
|
+
}>, import("effect/Cause").YieldableError>;
|
|
32
68
|
export declare class SecretResolutionError extends SecretResolutionError_base {
|
|
33
69
|
}
|
|
34
|
-
declare const
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
70
|
+
declare const SecretOwnedByConnectionError_base: Schema.Class<SecretOwnedByConnectionError, Schema.TaggedStruct<"SecretOwnedByConnectionError", {
|
|
71
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
72
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
73
|
+
}>, import("effect/Cause").YieldableError>;
|
|
74
|
+
/** Raised when `secrets.remove(id)` is called on a secret whose row has
|
|
75
|
+
* `owned_by_connection_id` set. The connection owns the lifecycle —
|
|
76
|
+
* callers must go through `connections.remove(connectionId)` to
|
|
77
|
+
* delete it along with its siblings. */
|
|
78
|
+
export declare class SecretOwnedByConnectionError extends SecretOwnedByConnectionError_base {
|
|
79
|
+
}
|
|
80
|
+
declare const ConnectionNotFoundError_base: Schema.Class<ConnectionNotFoundError, Schema.TaggedStruct<"ConnectionNotFoundError", {
|
|
81
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
82
|
+
}>, import("effect/Cause").YieldableError>;
|
|
83
|
+
export declare class ConnectionNotFoundError extends ConnectionNotFoundError_base {
|
|
84
|
+
}
|
|
85
|
+
declare const ConnectionProviderNotRegisteredError_base: Schema.Class<ConnectionProviderNotRegisteredError, Schema.TaggedStruct<"ConnectionProviderNotRegisteredError", {
|
|
86
|
+
readonly provider: Schema.String;
|
|
87
|
+
readonly connectionId: Schema.optional<Schema.brand<Schema.String, "ConnectionId">>;
|
|
88
|
+
}>, import("effect/Cause").YieldableError>;
|
|
89
|
+
export declare class ConnectionProviderNotRegisteredError extends ConnectionProviderNotRegisteredError_base {
|
|
90
|
+
}
|
|
91
|
+
declare const ConnectionRefreshNotSupportedError_base: Schema.Class<ConnectionRefreshNotSupportedError, Schema.TaggedStruct<"ConnectionRefreshNotSupportedError", {
|
|
92
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
93
|
+
readonly provider: Schema.String;
|
|
94
|
+
}>, import("effect/Cause").YieldableError>;
|
|
95
|
+
export declare class ConnectionRefreshNotSupportedError extends ConnectionRefreshNotSupportedError_base {
|
|
96
|
+
}
|
|
97
|
+
declare const ConnectionReauthRequiredError_base: Schema.Class<ConnectionReauthRequiredError, Schema.TaggedStruct<"ConnectionReauthRequiredError", {
|
|
98
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
99
|
+
readonly provider: Schema.String;
|
|
100
|
+
readonly message: Schema.String;
|
|
101
|
+
}>, import("effect/Cause").YieldableError>;
|
|
102
|
+
/**
|
|
103
|
+
* Raised by `connections.accessToken(id)` when the provider's refresh
|
|
104
|
+
* handler reported that the stored refresh token is permanently
|
|
105
|
+
* invalid (RFC 6749 §5.2 `invalid_grant` and friends). The caller —
|
|
106
|
+
* typically a tool invocation — surfaces this so the UI can prompt the
|
|
107
|
+
* user to sign in again. Distinct from `ConnectionRefreshError` so
|
|
108
|
+
* "the network flaked, retry later" and "the grant is dead, re-auth"
|
|
109
|
+
* don't collapse into one error tag at the plugin boundary.
|
|
110
|
+
*/
|
|
111
|
+
export declare class ConnectionReauthRequiredError extends ConnectionReauthRequiredError_base {
|
|
42
112
|
}
|
|
113
|
+
export type ExecutorError = ToolNotFoundError | ToolInvocationError | PluginNotLoadedError | NoHandlerError | ToolBlockedError | SourceNotFoundError | SourceRemovalNotAllowedError | SecretNotFoundError | SecretResolutionError | SecretOwnedByConnectionError | ConnectionNotFoundError | ConnectionProviderNotRegisteredError | ConnectionRefreshNotSupportedError | ConnectionReauthRequiredError;
|
|
43
114
|
export {};
|
|
44
115
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAgB,MAAM,EAAY,MAAM,OAAO,CAAC;;;;AAMvD,qBAAa,iBAAkB,SAAQ,sBAGtC;CAAG;;;;AAEJ,qBAAa,mBAAoB,SAAQ,yBAAwC;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;CAAG;;;;;AAEL;;2EAE2E;AAC3E,qBAAa,oBAAqB,SAAQ,yBAMzC;CAAG;;;;;AAEJ;;;wBAGwB;AACxB,qBAAa,cAAe,SAAQ,mBAMnC;CAAG;;;;;AAEJ;;;4CAG4C;AAC5C,qBAAa,gBAAiB,SAAQ,qBAMrC;CAAG;;;;AAMJ,qBAAa,mBAAoB,SAAQ,wBAGxC;CAAG;;;;AAEJ;;kEAEkE;AAClE,qBAAa,4BAA6B,SAAQ,iCAGjD;CAAG;;;;AAMJ,qBAAa,mBAAoB,SAAQ,wBAGxC;CAAG;;;;;AAEJ,qBAAa,qBAAsB,SAAQ,0BAM1C;CAAG;;;;;AAEJ;;;yCAGyC;AACzC,qBAAa,4BAA6B,SAAQ,iCAMjD;CAAG;;;;AAMJ,qBAAa,uBAAwB,SAAQ,4BAG5C;CAAG;;;;;AAEJ,qBAAa,oCAAqC,SAAQ,yCAMzD;CAAG;;;;;AAEJ,qBAAa,kCAAmC,SAAQ,uCAMvD;CAAG;;;;;;AAEJ;;;;;;;;GAQG;AACH,qBAAa,6BAA8B,SAAQ,kCAOlD;CAAG;AAMJ,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,GACpB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,4BAA4B,GAC5B,mBAAmB,GACnB,qBAAqB,GACrB,4BAA4B,GAC5B,uBAAuB,GACvB,oCAAoC,GACpC,kCAAkC,GAClC,6BAA6B,CAAC"}
|
package/dist/executor.d.ts
CHANGED
|
@@ -1,60 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { type DBAdapter, type DBSchema, type StorageFailure } from "@executor-js/storage-core";
|
|
3
|
+
import { type BlobStore } from "./blob";
|
|
4
|
+
import { ConnectionRef, ConnectionRefreshError, type CreateConnectionInput, type UpdateConnectionTokensInput } from "./connections";
|
|
5
|
+
import { ElicitationDeclinedError, type ElicitationHandler } from "./elicitation";
|
|
6
|
+
import { ConnectionNotFoundError, ConnectionProviderNotRegisteredError, ConnectionReauthRequiredError, ConnectionRefreshNotSupportedError, NoHandlerError, PluginNotLoadedError, SecretOwnedByConnectionError, SourceRemovalNotAllowedError, ToolBlockedError, ToolInvocationError, ToolNotFoundError } from "./errors";
|
|
7
|
+
import type { OAuthService } from "./oauth";
|
|
8
|
+
import { type CreateToolPolicyInput, type PolicyMatch, type ToolPolicy, type UpdateToolPolicyInput } from "./policies";
|
|
9
|
+
import type { AnyPlugin, PluginExtensions } from "./plugin";
|
|
7
10
|
import type { Scope } from "./scope";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
11
|
+
import { SecretRef, SetSecretInput } from "./secrets";
|
|
12
|
+
import { ToolSchema, type Source, type SourceDetectionResult, type Tool, type ToolListFilter } from "./types";
|
|
13
|
+
export type OnElicitation = ElicitationHandler | "accept-all";
|
|
14
|
+
export interface InvokeOptions {
|
|
15
|
+
/** Override the executor-level handler for this single call. */
|
|
16
|
+
readonly onElicitation?: OnElicitation;
|
|
17
|
+
}
|
|
18
|
+
export type Executor<TPlugins extends readonly AnyPlugin[] = []> = {
|
|
19
|
+
/**
|
|
20
|
+
* Precedence-ordered scope stack this executor was configured with.
|
|
21
|
+
* Innermost first. Consumers that need "the display scope" typically
|
|
22
|
+
* pick `scopes.at(-1)` (outermost, e.g. the organization) or
|
|
23
|
+
* `scopes[0]` (innermost, e.g. the current user-in-org) depending on
|
|
24
|
+
* what they're rendering.
|
|
25
|
+
*/
|
|
26
|
+
readonly scopes: readonly Scope[];
|
|
13
27
|
readonly tools: {
|
|
14
|
-
readonly list: (filter?: ToolListFilter) => Effect.Effect<readonly
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
readonly list: (filter?: ToolListFilter) => Effect.Effect<readonly Tool[], StorageFailure>;
|
|
29
|
+
/** Fetch a tool's full schema view: JSON schemas with `$defs`
|
|
30
|
+
* attached from the core `definition` table, plus TypeScript
|
|
31
|
+
* preview strings rendered from them. Returns `null` for unknown
|
|
32
|
+
* tool ids. */
|
|
33
|
+
readonly schema: (toolId: string) => Effect.Effect<ToolSchema | null, StorageFailure>;
|
|
34
|
+
/** Every `$defs` entry across every source, grouped by source id.
|
|
35
|
+
* Used for bulk schema export and downstream TypeScript rendering. */
|
|
36
|
+
readonly definitions: () => Effect.Effect<Record<string, Record<string, unknown>>, StorageFailure>;
|
|
37
|
+
readonly invoke: (toolId: string, args: unknown, options?: InvokeOptions) => Effect.Effect<unknown, ToolNotFoundError | ToolBlockedError | PluginNotLoadedError | NoHandlerError | ToolInvocationError | ElicitationDeclinedError | StorageFailure>;
|
|
19
38
|
};
|
|
20
39
|
readonly sources: {
|
|
21
|
-
readonly list: () => Effect.Effect<readonly Source[]>;
|
|
22
|
-
readonly remove: (sourceId: string) => Effect.Effect<void>;
|
|
23
|
-
readonly refresh: (sourceId: string) => Effect.Effect<void>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
|
|
29
|
-
readonly
|
|
40
|
+
readonly list: () => Effect.Effect<readonly Source[], StorageFailure>;
|
|
41
|
+
readonly remove: (sourceId: string) => Effect.Effect<void, SourceRemovalNotAllowedError | StorageFailure>;
|
|
42
|
+
readonly refresh: (sourceId: string) => Effect.Effect<void, StorageFailure>;
|
|
43
|
+
/** URL autodetection — fans out to every plugin's `detect` hook
|
|
44
|
+
* (if declared), returns every high/medium/low-confidence match.
|
|
45
|
+
* UI picks a winner from the list. */
|
|
46
|
+
readonly detect: (url: string) => Effect.Effect<readonly SourceDetectionResult[], StorageFailure>;
|
|
47
|
+
/** All `$defs` registered for a single source, keyed by def name. */
|
|
48
|
+
readonly definitions: (sourceId: string) => Effect.Effect<Record<string, unknown>, StorageFailure>;
|
|
30
49
|
};
|
|
31
50
|
readonly secrets: {
|
|
32
|
-
readonly
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
readonly set: (input:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
readonly get: (id: string) => Effect.Effect<string | null, SecretOwnedByConnectionError | StorageFailure>;
|
|
52
|
+
/** Fast-path existence check — hits the core `secret` routing table
|
|
53
|
+
* only, never calls the provider. Use this for UI state ("secret
|
|
54
|
+
* missing, prompt to add") to avoid keychain permission prompts
|
|
55
|
+
* or 1password IPC roundtrips on a pre-flight check. */
|
|
56
|
+
readonly status: (id: string) => Effect.Effect<"resolved" | "missing", StorageFailure>;
|
|
57
|
+
readonly set: (input: SetSecretInput) => Effect.Effect<SecretRef, StorageFailure>;
|
|
58
|
+
/** Delete a bare (non-connection-owned) secret. Connection-owned
|
|
59
|
+
* secrets are rejected with `SecretOwnedByConnectionError` — use
|
|
60
|
+
* `connections.remove` instead. */
|
|
61
|
+
readonly remove: (id: string) => Effect.Effect<void, SecretOwnedByConnectionError | StorageFailure>;
|
|
62
|
+
readonly list: () => Effect.Effect<readonly SecretRef[], StorageFailure>;
|
|
43
63
|
readonly providers: () => Effect.Effect<readonly string[]>;
|
|
44
64
|
};
|
|
45
|
-
readonly
|
|
65
|
+
readonly connections: {
|
|
66
|
+
readonly get: (id: string) => Effect.Effect<ConnectionRef | null, StorageFailure>;
|
|
67
|
+
readonly list: () => Effect.Effect<readonly ConnectionRef[], StorageFailure>;
|
|
68
|
+
readonly create: (input: CreateConnectionInput) => Effect.Effect<ConnectionRef, ConnectionProviderNotRegisteredError | StorageFailure>;
|
|
69
|
+
readonly updateTokens: (input: UpdateConnectionTokensInput) => Effect.Effect<ConnectionRef, ConnectionNotFoundError | StorageFailure>;
|
|
70
|
+
readonly setIdentityLabel: (id: string, label: string | null) => Effect.Effect<void, ConnectionNotFoundError | StorageFailure>;
|
|
71
|
+
readonly accessToken: (id: string) => Effect.Effect<string, ConnectionNotFoundError | ConnectionProviderNotRegisteredError | ConnectionRefreshNotSupportedError | ConnectionReauthRequiredError | ConnectionRefreshError | StorageFailure>;
|
|
72
|
+
readonly remove: (id: string) => Effect.Effect<void, StorageFailure>;
|
|
73
|
+
readonly providers: () => Effect.Effect<readonly string[]>;
|
|
74
|
+
};
|
|
75
|
+
/** Shared OAuth service. Hosts use this through the core HTTP OAuth group;
|
|
76
|
+
* plugins see the same service as `ctx.oauth`. */
|
|
77
|
+
readonly oauth: OAuthService;
|
|
78
|
+
readonly policies: {
|
|
79
|
+
/** All policies visible across the executor's scope stack, sorted
|
|
80
|
+
* by (innermost-scope-first, position ascending) — i.e. the order
|
|
81
|
+
* in which they're evaluated by first-match-wins. */
|
|
82
|
+
readonly list: () => Effect.Effect<readonly ToolPolicy[], StorageFailure>;
|
|
83
|
+
/** Create a new policy. Defaults to the top of the target scope's
|
|
84
|
+
* list (highest precedence) when `position` is omitted. */
|
|
85
|
+
readonly create: (input: CreateToolPolicyInput) => Effect.Effect<ToolPolicy, StorageFailure>;
|
|
86
|
+
readonly update: (input: UpdateToolPolicyInput) => Effect.Effect<ToolPolicy, StorageFailure>;
|
|
87
|
+
readonly remove: (id: string) => Effect.Effect<void, StorageFailure>;
|
|
88
|
+
/** Resolve the effective policy for a tool id by walking the scope-
|
|
89
|
+
* stacked policy list with first-match-wins semantics. Returns
|
|
90
|
+
* `undefined` when no rule matches (caller falls back to the
|
|
91
|
+
* plugin's `resolveAnnotations` output). */
|
|
92
|
+
readonly resolve: (toolId: string) => Effect.Effect<PolicyMatch | undefined, StorageFailure>;
|
|
93
|
+
};
|
|
94
|
+
readonly close: () => Effect.Effect<void, StorageFailure>;
|
|
46
95
|
} & PluginExtensions<TPlugins>;
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
readonly
|
|
56
|
-
readonly
|
|
96
|
+
export interface ExecutorConfig<TPlugins extends readonly AnyPlugin[] = []> {
|
|
97
|
+
/**
|
|
98
|
+
* Precedence-ordered scope stack. Innermost first; typical shape is
|
|
99
|
+
* `[userInOrgScope, orgScope]`. Reads on scoped tables walk the
|
|
100
|
+
* stack (first hit wins for shadow-by-id consumers like secrets and
|
|
101
|
+
* blobs); writes require callers to name an explicit target scope.
|
|
102
|
+
* Must be non-empty.
|
|
103
|
+
*/
|
|
104
|
+
readonly scopes: readonly Scope[];
|
|
105
|
+
readonly adapter: DBAdapter;
|
|
106
|
+
readonly blobs: BlobStore;
|
|
57
107
|
readonly plugins?: TPlugins;
|
|
108
|
+
/**
|
|
109
|
+
* How to respond when a tool requests user input mid-invocation. Pass
|
|
110
|
+
* `"accept-all"` for tests / non-interactive hosts, or a handler
|
|
111
|
+
* `(ctx) => Effect<ElicitationResponse>` for interactive ones.
|
|
112
|
+
* Required at construction so per-invoke calls don't have to thread
|
|
113
|
+
* an options arg.
|
|
114
|
+
*/
|
|
115
|
+
readonly onElicitation: OnElicitation;
|
|
58
116
|
}
|
|
59
|
-
export declare const
|
|
117
|
+
export declare const collectSchemas: (plugins: readonly AnyPlugin[]) => DBSchema;
|
|
118
|
+
export declare const createExecutor: <const TPlugins extends readonly AnyPlugin[] = []>(config: ExecutorConfig<TPlugins>) => Effect.Effect<Executor<TPlugins>, Error>;
|
|
60
119
|
//# sourceMappingURL=executor.d.ts.map
|
package/dist/executor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,MAAM,EAAqC,MAAM,QAAQ,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
{"version":3,"file":"executor.test.d.ts","sourceRoot":"","sources":["../src/executor.test.ts"],"names":[],"mappings":""}
|
package/dist/ids.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const ScopeId: Schema.brand<
|
|
2
|
+
export declare const ScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
3
3
|
export type ScopeId = typeof ScopeId.Type;
|
|
4
|
-
export declare const ToolId: Schema.brand<
|
|
4
|
+
export declare const ToolId: Schema.brand<Schema.String, "ToolId">;
|
|
5
5
|
export type ToolId = typeof ToolId.Type;
|
|
6
|
-
export declare const SecretId: Schema.brand<
|
|
6
|
+
export declare const SecretId: Schema.brand<Schema.String, "SecretId">;
|
|
7
7
|
export type SecretId = typeof SecretId.Type;
|
|
8
|
-
export declare const PolicyId: Schema.brand<
|
|
8
|
+
export declare const PolicyId: Schema.brand<Schema.String, "PolicyId">;
|
|
9
9
|
export type PolicyId = typeof PolicyId.Type;
|
|
10
|
+
export declare const ConnectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
11
|
+
export type ConnectionId = typeof ConnectionId.Type;
|
|
10
12
|
//# sourceMappingURL=ids.d.ts.map
|
package/dist/ids.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,OAAO,wCAA8C,CAAC;AACnE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAE1C,eAAO,MAAM,MAAM,uCAA6C,CAAC;AACjE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC;AAExC,eAAO,MAAM,QAAQ,yCAA+C,CAAC;AACrE,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C,eAAO,MAAM,QAAQ,yCAA+C,CAAC;AACrE,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C,eAAO,MAAM,YAAY,6CAAmD,CAAC;AAC7E,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export { FormElicitation, UrlElicitation, ElicitationAction, ElicitationResponse, ElicitationDeclinedError, type ElicitationRequest, type ElicitationHandler, type ElicitationContext, } from "./elicitation";
|
|
6
|
-
export { SecretRef, SetSecretInput, SecretStore, type SecretProvider } from "./secrets";
|
|
7
|
-
export { Policy, PolicyAction, PolicyCheckInput, PolicyEngine } from "./policies";
|
|
1
|
+
export type { DBAdapter, DBSchema, DBFieldAttribute, DBFieldType, StorageFailure, TypedAdapter, Where, WhereOperator, } from "@executor-js/storage-core";
|
|
2
|
+
export { typedAdapter } from "@executor-js/storage-core";
|
|
3
|
+
export { StorageError, UniqueViolationError } from "@executor-js/storage-core";
|
|
4
|
+
export { ScopeId, ToolId, SecretId, PolicyId, ConnectionId } from "./ids";
|
|
8
5
|
export { Scope } from "./scope";
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
6
|
+
export { ToolNotFoundError, ToolInvocationError, ToolBlockedError, NoHandlerError, SourceNotFoundError, SourceRemovalNotAllowedError, PluginNotLoadedError, SecretNotFoundError, SecretResolutionError, SecretOwnedByConnectionError, ConnectionNotFoundError, ConnectionProviderNotRegisteredError, ConnectionRefreshNotSupportedError, ConnectionReauthRequiredError, type ExecutorError, } from "./errors";
|
|
7
|
+
export { ToolSchema, SourceDetectionResult, type Source, type Tool, type ToolListFilter, } from "./types";
|
|
8
|
+
export { coreSchema, isToolPolicyAction, TOOL_POLICY_ACTIONS, type CoreSchema, type SourceInput, type SourceInputTool, type SourceRow, type ToolRow, type DefinitionRow, type SecretRow, type ConnectionRow, type ToolPolicyRow, type ToolPolicyAction, type DefinitionsInput, type ToolAnnotations, } from "./core-schema";
|
|
9
|
+
export { matchPattern, isValidPattern, resolveToolPolicy, resolveEffectivePolicy, effectivePolicyFromSorted, rowToToolPolicy, ToolPolicyActionSchema, type ToolPolicy, type CreateToolPolicyInput, type UpdateToolPolicyInput, type PolicyMatch, type EffectivePolicy, type PolicySource, } from "./policies";
|
|
10
|
+
export { SecretRef, SetSecretInput, type SecretProvider } from "./secrets";
|
|
11
|
+
export { SecretBackedMap, SecretBackedValue, isSecretBackedRef, resolveSecretBackedMap, type ResolveSecretBackedMapOptions, } from "./secret-backed-value";
|
|
12
|
+
export { ConnectionRef, ConnectionProviderState, CreateConnectionInput, UpdateConnectionTokensInput, TokenMaterial, ConnectionRefreshError, type ConnectionProvider, type ConnectionRefreshInput, type ConnectionRefreshResult, } from "./connections";
|
|
13
|
+
export { FormElicitation, UrlElicitation, ElicitationAction, ElicitationResponse, ElicitationDeclinedError, type ElicitationRequest, type ElicitationHandler, type ElicitationContext, } from "./elicitation";
|
|
14
|
+
export { type BlobStore, type PluginBlobStore, pluginBlobStore, makeInMemoryBlobStore, } from "./blob";
|
|
15
|
+
export { type OAuthService, type OAuthStrategy, type OAuthDynamicDcrStrategy, type OAuthAuthorizationCodeStrategy, type OAuthClientCredentialsStrategy, type OAuthProviderState, type OAuthProbeInput, type OAuthProbeResult, type OAuthStartInput, type OAuthStartResult, type OAuthCompleteInput, type OAuthCompleteResult, OAuthProbeError, OAuthStartError, OAuthCompleteError, OAuthSessionNotFoundError, OAUTH2_PROVIDER_KEY, OAUTH2_SESSION_TTL_MS, OAuthStrategy as OAuthStrategySchema, OAuthProviderState as OAuthProviderStateSchema, OAuthDynamicDcrStrategy as OAuthDynamicDcrStrategySchema, OAuthAuthorizationCodeStrategy as OAuthAuthorizationCodeStrategySchema, OAuthClientCredentialsStrategy as OAuthClientCredentialsStrategySchema, } from "./oauth";
|
|
16
|
+
export { OAuth2Error, OAUTH2_DEFAULT_TIMEOUT_MS, OAUTH2_REFRESH_SKEW_MS, buildAuthorizationUrl, createPkceCodeChallenge, createPkceCodeVerifier, exchangeAuthorizationCode, exchangeClientCredentials, refreshAccessToken, shouldRefreshToken, type OAuth2TokenResponse, type BuildAuthorizationUrlInput, type ClientAuthMethod, type ExchangeAuthorizationCodeInput, type ExchangeClientCredentialsInput, type RefreshAccessTokenInput, } from "./oauth-helpers";
|
|
17
|
+
export { makeOAuth2Service, type OAuthServiceDeps } from "./oauth-service";
|
|
18
|
+
export { OAuthDiscoveryError, OAuthAuthorizationServerMetadataSchema, OAuthClientInformationSchema, OAuthProtectedResourceMetadataSchema, beginDynamicAuthorization, discoverAuthorizationServerMetadata, discoverProtectedResourceMetadata, registerDynamicClient, type BeginDynamicAuthorizationInput, type DiscoveryRequestOptions, type DynamicAuthorizationState, type DynamicAuthorizationStartResult, type DynamicClientMetadata, type OAuthAuthorizationServerMetadata, type OAuthClientInformation, type OAuthProtectedResourceMetadata, type RegisterDynamicClientInput, } from "./oauth-discovery";
|
|
19
|
+
export { OAUTH_POPUP_MESSAGE_TYPE, type OAuthPopupResult, isOAuthPopupResult, } from "./oauth-popup-types";
|
|
20
|
+
export { type Plugin, type PluginSpec, type PluginCtx, type PluginExtensions, type ConfiguredPlugin, type AnyPlugin, type StorageDeps, type StaticSourceDecl, type StaticToolDecl, type StaticToolHandlerInput, type InvokeToolInput, type SourceLifecycleInput, type SecretListEntry, type Elicit, definePlugin, defineSchema, } from "./plugin";
|
|
21
|
+
export { type Executor, type ExecutorConfig, type OnElicitation, type InvokeOptions, createExecutor, collectSchemas, } from "./executor";
|
|
22
|
+
export { defineExecutorConfig, type ExecutorCliConfig, type ExecutorDialect } from "./config";
|
|
23
|
+
export { makeTestConfig } from "./testing";
|
|
12
24
|
export { hoistDefinitions, collectRefs, reattachDefs, normalizeRefs } from "./schema-refs";
|
|
13
25
|
export { schemaToTypeScriptPreview, schemaToTypeScriptPreviewWithDefs, buildToolTypeScriptPreview, type TypeScriptRenderOptions, type TypeScriptSchemaPreview, } from "./schema-types";
|
|
14
|
-
export { registerRuntimeTools, runtimeTool, type RuntimeSourceDefinition, type RuntimeToolDefinition, } from "./runtime-tools";
|
|
15
|
-
export { makeInMemoryToolRegistry } from "./in-memory/tool-registry";
|
|
16
|
-
export { makeInMemorySecretStore, makeInMemorySecretProvider } from "./in-memory/secret-store";
|
|
17
|
-
export { makeInMemoryPolicyEngine } from "./in-memory/policy-engine";
|
|
18
|
-
export { makeTestConfig } from "./testing";
|
|
19
|
-
export { type Kv, type KvEntry, type ScopedKv, scopeKv, makeInMemoryScopedKv } from "./plugin-kv";
|
|
20
26
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,KAAK,EACL,aAAa,GACd,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAG/E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAA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