@executor-js/sdk 0.0.2 → 0.2.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 +21 -29
- package/dist/api-errors.d.ts +10 -0
- package/dist/api-errors.d.ts.map +1 -0
- package/dist/blob.d.ts.map +1 -1
- package/dist/chunk-6SQWMOM4.js +51 -0
- package/dist/chunk-6SQWMOM4.js.map +1 -0
- package/dist/chunk-FPV6KONN.js +78 -0
- package/dist/chunk-FPV6KONN.js.map +1 -0
- package/dist/chunk-VLVPSIQ4.js +5532 -0
- package/dist/chunk-VLVPSIQ4.js.map +1 -0
- package/dist/client.d.ts +132 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +81 -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 +17 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/connections.d.ts +7 -0
- package/dist/connections.d.ts.map +1 -1
- package/dist/core-schema.d.ts +83 -3
- package/dist/core-schema.d.ts.map +1 -1
- package/dist/core.js +113 -50
- package/dist/core.js.map +1 -1
- package/dist/credential-bindings.d.ts +173 -0
- package/dist/credential-bindings.d.ts.map +1 -0
- package/dist/credential-bindings.test.d.ts +2 -0
- package/dist/credential-bindings.test.d.ts.map +1 -0
- package/dist/errors.d.ts +27 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/executor.d.ts +47 -13
- package/dist/executor.d.ts.map +1 -1
- package/dist/hosted-http-client.d.ts +17 -0
- package/dist/hosted-http-client.d.ts.map +1 -0
- package/dist/hosted-http-client.test.d.ts +2 -0
- package/dist/hosted-http-client.test.d.ts.map +1 -0
- package/dist/ids.d.ts +2 -0
- package/dist/ids.d.ts.map +1 -1
- package/dist/index.d.ts +17 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -18
- package/dist/index.js.map +1 -1
- package/dist/oauth-discovery.d.ts +19 -4
- package/dist/oauth-discovery.d.ts.map +1 -1
- package/dist/oauth-helpers.d.ts +21 -0
- package/dist/oauth-helpers.d.ts.map +1 -1
- package/dist/oauth-popup-types.d.ts.map +1 -1
- package/dist/oauth-service.d.ts +16 -5
- package/dist/oauth-service.d.ts.map +1 -1
- package/dist/oauth.d.ts +19 -16
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oxlint-plugin-executor.test.d.ts +2 -0
- package/dist/oxlint-plugin-executor.test.d.ts.map +1 -0
- package/dist/plugin.d.ts +123 -22
- package/dist/plugin.d.ts.map +1 -1
- package/dist/policies.d.ts +10 -15
- package/dist/policies.d.ts.map +1 -1
- package/dist/promise-executor.d.ts.map +1 -1
- package/dist/promise.d.ts +5 -3
- package/dist/promise.d.ts.map +1 -1
- package/dist/schema-types.d.ts.map +1 -1
- package/dist/scoped-adapter.d.ts +17 -2
- package/dist/scoped-adapter.d.ts.map +1 -1
- package/dist/secrets.d.ts +12 -0
- package/dist/secrets.d.ts.map +1 -1
- package/dist/test-config.d.ts +10 -0
- package/dist/test-config.d.ts.map +1 -0
- package/dist/testing.d.ts +30 -8
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +56 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +11 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/usage-visibility.test.d.ts +2 -0
- package/dist/usage-visibility.test.d.ts.map +1 -0
- package/dist/usages.d.ts +20 -0
- package/dist/usages.d.ts.map +1 -0
- package/package.json +36 -4
- package/dist/chunk-6LMMN2GP.js +0 -4396
- package/dist/chunk-6LMMN2GP.js.map +0 -1
package/dist/oauth-helpers.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ export type OAuth2TokenResponse = {
|
|
|
25
25
|
export declare const OAUTH2_REFRESH_SKEW_MS = 60000;
|
|
26
26
|
/** Default token-endpoint timeout. */
|
|
27
27
|
export declare const OAUTH2_DEFAULT_TIMEOUT_MS = 20000;
|
|
28
|
+
export interface OAuthEndpointUrlPolicy {
|
|
29
|
+
readonly allowHttp?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const isSupportedOAuthEndpointUrl: (value: string, policy?: OAuthEndpointUrlPolicy) => boolean;
|
|
32
|
+
export declare const assertSupportedOAuthEndpointUrl: (value: string, label?: string, policy?: OAuthEndpointUrlPolicy) => string;
|
|
28
33
|
export declare const createPkceCodeVerifier: () => string;
|
|
29
34
|
export declare const createPkceCodeChallenge: (verifier: string) => Promise<string>;
|
|
30
35
|
export type BuildAuthorizationUrlInput = {
|
|
@@ -37,8 +42,13 @@ export type BuildAuthorizationUrlInput = {
|
|
|
37
42
|
readonly codeChallenge: string;
|
|
38
43
|
/** Separator between scopes. RFC 6749 says space; some providers use comma. */
|
|
39
44
|
readonly scopeSeparator?: string;
|
|
45
|
+
/** RFC 8707 Resource Indicator. MCP Authorization 2025-06-18 §"Resource
|
|
46
|
+
* Parameter Implementation" requires clients to send this on every
|
|
47
|
+
* authorization request, regardless of AS support. */
|
|
48
|
+
readonly resource?: string;
|
|
40
49
|
/** Provider-specific extras (e.g. Google's `access_type=offline`). */
|
|
41
50
|
readonly extraParams?: Readonly<Record<string, string>>;
|
|
51
|
+
readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;
|
|
42
52
|
};
|
|
43
53
|
/** Build an RFC 6749 §4.1.1 authorization URL. Sync; pre-computed
|
|
44
54
|
* challenge lets this stay out of the Promise world. */
|
|
@@ -54,7 +64,12 @@ export type ExchangeAuthorizationCodeInput = {
|
|
|
54
64
|
readonly code: string;
|
|
55
65
|
readonly clientAuth?: ClientAuthMethod;
|
|
56
66
|
readonly idTokenSigningAlgValuesSupported?: readonly string[];
|
|
67
|
+
/** RFC 8707 Resource Indicator. MCP Auth spec MUST-requires this on
|
|
68
|
+
* the token request when the client knows the resource it intends
|
|
69
|
+
* to call. */
|
|
70
|
+
readonly resource?: string;
|
|
57
71
|
readonly timeoutMs?: number;
|
|
72
|
+
readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;
|
|
58
73
|
};
|
|
59
74
|
export declare const exchangeAuthorizationCode: (input: ExchangeAuthorizationCodeInput) => Effect.Effect<OAuth2TokenResponse, OAuth2Error>;
|
|
60
75
|
export type ExchangeClientCredentialsInput = {
|
|
@@ -65,6 +80,7 @@ export type ExchangeClientCredentialsInput = {
|
|
|
65
80
|
readonly scopeSeparator?: string;
|
|
66
81
|
readonly clientAuth?: ClientAuthMethod;
|
|
67
82
|
readonly timeoutMs?: number;
|
|
83
|
+
readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;
|
|
68
84
|
};
|
|
69
85
|
export declare const exchangeClientCredentials: (input: ExchangeClientCredentialsInput) => Effect.Effect<OAuth2TokenResponse, OAuth2Error>;
|
|
70
86
|
export type RefreshAccessTokenInput = {
|
|
@@ -77,7 +93,12 @@ export type RefreshAccessTokenInput = {
|
|
|
77
93
|
readonly scopeSeparator?: string;
|
|
78
94
|
readonly clientAuth?: ClientAuthMethod;
|
|
79
95
|
readonly idTokenSigningAlgValuesSupported?: readonly string[];
|
|
96
|
+
/** RFC 8707 Resource Indicator — MCP spec MUST-requires this on
|
|
97
|
+
* refresh requests so the new access token's audience is bound to
|
|
98
|
+
* the same resource. */
|
|
99
|
+
readonly resource?: string;
|
|
80
100
|
readonly timeoutMs?: number;
|
|
101
|
+
readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;
|
|
81
102
|
};
|
|
82
103
|
export declare const refreshAccessToken: (input: RefreshAccessTokenInput) => Effect.Effect<OAuth2TokenResponse, OAuth2Error>;
|
|
83
104
|
export declare const shouldRefreshToken: (input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-helpers.d.ts","sourceRoot":"","sources":["../src/oauth-helpers.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"oauth-helpers.d.ts","sourceRoot":"","sources":["../src/oauth-helpers.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAQ,MAAM,EAAa,MAAM,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AQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,uBAAuB,KAC7B,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,WAAW,CAoCC,CAAC;AAMnD,eAAO,MAAM,kBAAkB,GAAI,OAAO;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B,KAAG,OAKH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-popup-types.d.ts","sourceRoot":"","sources":["../src/oauth-popup-types.ts"],"names":[],"mappings":"AAQA,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,EAAG,uBAAgC,CAAC;AAEzE,MAAM,MAAM,gBAAgB,CAAC,KAAK,IAC9B,CAAC;IACC,QAAQ,CAAC,IAAI,EAAE,OAAO,wBAAwB,CAAC;IAC/C,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GAAG,KAAK,CAAC,GACV;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,wBAAwB,CAAC;IAC/C,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN,eAAO,MAAM,kBAAkB,GAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"oauth-popup-types.d.ts","sourceRoot":"","sources":["../src/oauth-popup-types.ts"],"names":[],"mappings":"AAQA,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,EAAG,uBAAgC,CAAC;AAEzE,MAAM,MAAM,gBAAgB,CAAC,KAAK,IAC9B,CAAC;IACC,QAAQ,CAAC,IAAI,EAAE,OAAO,wBAAwB,CAAC;IAC/C,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GAAG,KAAK,CAAC,GACV;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,wBAAwB,CAAC;IAC/C,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN,eAAO,MAAM,kBAAkB,GAAI,KAAK,EAAE,OAAO,OAAO,KAAG,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAGzB,CAAC"}
|
package/dist/oauth-service.d.ts
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { HttpClient } from "effect/unstable/http";
|
|
3
|
+
import type { StorageFailure, TypedAdapter } from "@executor-js/storage-core";
|
|
3
4
|
import { CreateConnectionInput, type ConnectionProvider, type ConnectionRef } from "./connections";
|
|
4
5
|
import type { ConnectionProviderNotRegisteredError } from "./errors";
|
|
5
6
|
import type { CoreSchema } from "./core-schema";
|
|
6
7
|
import { SetSecretInput, type SecretRef } from "./secrets";
|
|
7
8
|
import { type OAuthService } from "./oauth";
|
|
9
|
+
import { type OAuthEndpointUrlPolicy } from "./oauth-helpers";
|
|
10
|
+
import type { ScopedDBAdapter } from "./scoped-adapter";
|
|
8
11
|
export interface OAuthServiceDeps {
|
|
9
12
|
/** Typed core-schema adapter. Already scope-wrapped upstream so reads
|
|
10
13
|
* fall through the scope stack; writes stamp the scope the caller
|
|
11
14
|
* named (`tokenScope` on start input). */
|
|
12
15
|
readonly adapter: TypedAdapter<CoreSchema>;
|
|
13
|
-
/**
|
|
14
|
-
* `.transaction` directly. */
|
|
15
|
-
readonly rawAdapter:
|
|
16
|
+
/** Scoped adapter for opening transactions — the typed one doesn't
|
|
17
|
+
* expose `.transaction` directly. */
|
|
18
|
+
readonly rawAdapter: ScopedDBAdapter;
|
|
16
19
|
/** Resolves client-id / client-secret refs at start + refresh time.
|
|
17
20
|
* A `null` return means "secret row is gone" and aborts the flow. */
|
|
18
21
|
readonly secretsGet: (id: string) => Effect.Effect<string | null, StorageFailure>;
|
|
22
|
+
readonly secretsGetResolved?: (id: string) => Effect.Effect<{
|
|
23
|
+
readonly value: string;
|
|
24
|
+
readonly scopeId: string | null;
|
|
25
|
+
} | null, StorageFailure>;
|
|
26
|
+
readonly secretsGetAtScope?: (id: string, scope: string) => Effect.Effect<string | null, StorageFailure>;
|
|
19
27
|
readonly secretsSet: (input: SetSecretInput) => Effect.Effect<SecretRef, StorageFailure>;
|
|
20
28
|
/** Mints the Connection row + backing secret rows. Called from
|
|
21
29
|
* `complete` (and from `start` for `client-credentials`). */
|
|
@@ -25,6 +33,9 @@ export interface OAuthServiceDeps {
|
|
|
25
33
|
readonly newSessionId?: () => string;
|
|
26
34
|
/** `Date.now()` substitute — tests override to drive TTL behavior. */
|
|
27
35
|
readonly now?: () => number;
|
|
36
|
+
/** Outbound HTTP client used for OAuth metadata/DCR probes. */
|
|
37
|
+
readonly httpClientLayer?: Layer.Layer<HttpClient.HttpClient>;
|
|
38
|
+
readonly endpointUrlPolicy?: OAuthEndpointUrlPolicy;
|
|
28
39
|
}
|
|
29
40
|
export declare const makeOAuth2Service: (deps: OAuthServiceDeps) => {
|
|
30
41
|
readonly service: OAuthService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-service.d.ts","sourceRoot":"","sources":["../src/oauth-service.ts"],"names":[],"mappings":"AAqCA,OAAO,
|
|
1
|
+
{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f,CAAC;IACF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAC3B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,EAAE,cAAc,CAAC,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IACzF;kEAC8D;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,CAC1B,KAAK,EAAE,qBAAqB,KACzB,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,oCAAoC,GAAG,cAAc,CAAC,CAAC;IACzF;yBACqB;IACrB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IACrC,sEAAsE;IACtE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;CACrD;AAqCD,eAAO,MAAM,iBAAiB,GAC5B,MAAM,gBAAgB,KACrB;IAAE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAA;CAs8BnF,CAAC"}
|
package/dist/oauth.d.ts
CHANGED
|
@@ -115,25 +115,34 @@ export declare const OAuthProviderState: Schema.Union<readonly [Schema.Struct<{
|
|
|
115
115
|
* issued one) is a separate secret row. */
|
|
116
116
|
readonly clientId: Schema.String;
|
|
117
117
|
readonly clientSecretSecretId: Schema.NullOr<Schema.String>;
|
|
118
|
+
readonly clientSecretSecretScopeId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
118
119
|
readonly clientAuth: Schema.Literals<readonly ["body", "basic"]>;
|
|
119
120
|
readonly scopes: Schema.withDecodingDefaultType<Schema.$Array<Schema.String>>;
|
|
120
121
|
readonly scopeSeparator: Schema.optional<Schema.String>;
|
|
121
122
|
readonly scope: Schema.NullOr<Schema.String>;
|
|
123
|
+
/** RFC 8707 canonical resource URL. Replayed on refresh so the new
|
|
124
|
+
* access token's audience stays bound to the same resource. */
|
|
125
|
+
readonly resource: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
122
126
|
}>, Schema.Struct<{
|
|
123
127
|
readonly kind: Schema.Literal<"authorization-code">;
|
|
124
128
|
readonly tokenEndpoint: Schema.String;
|
|
125
129
|
readonly issuerUrl: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
126
130
|
readonly clientIdSecretId: Schema.String;
|
|
131
|
+
readonly clientIdSecretScopeId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
127
132
|
readonly clientSecretSecretId: Schema.NullOr<Schema.String>;
|
|
133
|
+
readonly clientSecretSecretScopeId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
128
134
|
readonly clientAuth: Schema.Literals<readonly ["body", "basic"]>;
|
|
129
135
|
readonly scopes: Schema.withDecodingDefaultType<Schema.$Array<Schema.String>>;
|
|
130
136
|
readonly scopeSeparator: Schema.optional<Schema.String>;
|
|
131
137
|
readonly scope: Schema.NullOr<Schema.String>;
|
|
138
|
+
readonly resource: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
132
139
|
}>, Schema.Struct<{
|
|
133
140
|
readonly kind: Schema.Literal<"client-credentials">;
|
|
134
141
|
readonly tokenEndpoint: Schema.String;
|
|
135
142
|
readonly clientIdSecretId: Schema.String;
|
|
143
|
+
readonly clientIdSecretScopeId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
136
144
|
readonly clientSecretSecretId: Schema.String;
|
|
145
|
+
readonly clientSecretSecretScopeId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
137
146
|
readonly scopes: Schema.$Array<Schema.String>;
|
|
138
147
|
readonly scopeSeparator: Schema.optional<Schema.String>;
|
|
139
148
|
readonly clientAuth: Schema.Literals<readonly ["body", "basic"]>;
|
|
@@ -142,9 +151,7 @@ export declare const OAuthProviderState: Schema.Union<readonly [Schema.Struct<{
|
|
|
142
151
|
export type OAuthProviderState = typeof OAuthProviderState.Type;
|
|
143
152
|
/** The canonical refresh handler key. Every OAuth2-minted connection
|
|
144
153
|
* registers under this single value; the handler switches on
|
|
145
|
-
* `providerState.kind`.
|
|
146
|
-
* `openapi:oauth2`, `google-discovery:google`) are aliased to this
|
|
147
|
-
* during migration. */
|
|
154
|
+
* `providerState.kind`. */
|
|
148
155
|
export declare const OAUTH2_PROVIDER_KEY: "oauth2";
|
|
149
156
|
export interface OAuthProbeInput {
|
|
150
157
|
readonly endpoint: string;
|
|
@@ -216,6 +223,9 @@ export interface OAuthStartResult {
|
|
|
216
223
|
export interface OAuthCompleteInput {
|
|
217
224
|
/** RFC 6749 `state` parameter — maps to a session row id. */
|
|
218
225
|
readonly state: string;
|
|
226
|
+
/** Optional scope check for route-scoped completions. Browser callback
|
|
227
|
+
* completions omit this because the callback URL has no scope path. */
|
|
228
|
+
readonly tokenScope?: string;
|
|
219
229
|
readonly code?: string;
|
|
220
230
|
/** RFC 6749 `error` parameter — set when the AS redirected back with
|
|
221
231
|
* a failure. The service surfaces this as a tagged error. */
|
|
@@ -230,17 +240,16 @@ declare const OAuthProbeError_base: Schema.Class<OAuthProbeError, Schema.TaggedS
|
|
|
230
240
|
readonly message: Schema.String;
|
|
231
241
|
}>, import("effect/Cause").YieldableError>;
|
|
232
242
|
export declare class OAuthProbeError extends OAuthProbeError_base {
|
|
233
|
-
static annotations: {
|
|
234
|
-
httpApiStatus: number;
|
|
235
|
-
};
|
|
236
243
|
}
|
|
237
244
|
declare const OAuthStartError_base: Schema.Class<OAuthStartError, Schema.TaggedStruct<"OAuthStartError", {
|
|
238
245
|
readonly message: Schema.String;
|
|
246
|
+
/** RFC 6749 §5.2 / RFC 7591 §3.2.2 error code propagated up from the
|
|
247
|
+
* authorization server (e.g. `invalid_client_metadata`). UI surfaces
|
|
248
|
+
* it as the structured "AS rejected the registration" reason. */
|
|
249
|
+
readonly error: Schema.optional<Schema.String>;
|
|
250
|
+
readonly errorDescription: Schema.optional<Schema.String>;
|
|
239
251
|
}>, import("effect/Cause").YieldableError>;
|
|
240
252
|
export declare class OAuthStartError extends OAuthStartError_base {
|
|
241
|
-
static annotations: {
|
|
242
|
-
httpApiStatus: number;
|
|
243
|
-
};
|
|
244
253
|
}
|
|
245
254
|
declare const OAuthCompleteError_base: Schema.Class<OAuthCompleteError, Schema.TaggedStruct<"OAuthCompleteError", {
|
|
246
255
|
readonly message: Schema.String;
|
|
@@ -250,17 +259,11 @@ declare const OAuthCompleteError_base: Schema.Class<OAuthCompleteError, Schema.T
|
|
|
250
259
|
readonly code: Schema.optional<Schema.String>;
|
|
251
260
|
}>, import("effect/Cause").YieldableError>;
|
|
252
261
|
export declare class OAuthCompleteError extends OAuthCompleteError_base {
|
|
253
|
-
static annotations: {
|
|
254
|
-
httpApiStatus: number;
|
|
255
|
-
};
|
|
256
262
|
}
|
|
257
263
|
declare const OAuthSessionNotFoundError_base: Schema.Class<OAuthSessionNotFoundError, Schema.TaggedStruct<"OAuthSessionNotFoundError", {
|
|
258
264
|
readonly sessionId: Schema.String;
|
|
259
265
|
}>, import("effect/Cause").YieldableError>;
|
|
260
266
|
export declare class OAuthSessionNotFoundError extends OAuthSessionNotFoundError_base {
|
|
261
|
-
static annotations: {
|
|
262
|
-
httpApiStatus: number;
|
|
263
|
-
};
|
|
264
267
|
}
|
|
265
268
|
export interface OAuthService {
|
|
266
269
|
readonly probe: (input: OAuthProbeInput) => Effect.Effect<OAuthProbeResult, OAuthProbeError>;
|
|
@@ -268,7 +271,7 @@ export interface OAuthService {
|
|
|
268
271
|
readonly complete: (input: OAuthCompleteInput) => Effect.Effect<OAuthCompleteResult, OAuthCompleteError | OAuthSessionNotFoundError | StorageFailure>;
|
|
269
272
|
/** Drop an in-flight session without completing — used when the
|
|
270
273
|
* user cancels the popup or the source is deleted mid-onboarding. */
|
|
271
|
-
readonly cancel: (sessionId: string, tokenScope
|
|
274
|
+
readonly cancel: (sessionId: string, tokenScope: string) => Effect.Effect<void, StorageFailure>;
|
|
272
275
|
}
|
|
273
276
|
export declare const OAUTH2_SESSION_TTL_MS: number;
|
|
274
277
|
export { ConnectionId };
|
package/dist/oauth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../src/oauth.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAWrC;;;yDAGyD;AACzD,eAAO,MAAM,uBAAuB;;IAElC;mDAC+C;;EAE/C,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC,IAAI,CAAC;AAE1E;;;2EAG2E;AAC3E,eAAO,MAAM,8BAA8B;;;;IAIzC;;wEAEoE;;IAEpE;;4DAEwD;;IAExD;8CAC0C;;;IAG1C;sCACkC;;IAElC;mEAC+D;;
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../src/oauth.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAWrC;;;yDAGyD;AACzD,eAAO,MAAM,uBAAuB;;IAElC;mDAC+C;;EAE/C,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAC,IAAI,CAAC;AAE1E;;;2EAG2E;AAC3E,eAAO,MAAM,8BAA8B;;;;IAIzC;;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E,cAAc,CAAC,CAAC;CACjG;AAOD,eAAO,MAAM,qBAAqB,QAAiB,CAAC;AAIpD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxlint-plugin-executor.test.d.ts","sourceRoot":"","sources":["../src/oxlint-plugin-executor.test.ts"],"names":[],"mappings":""}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import type { Effect } from "effect";
|
|
2
|
-
import type {
|
|
1
|
+
import type { Context, Effect, Layer } from "effect";
|
|
2
|
+
import type { HttpClient } from "effect/unstable/http";
|
|
3
|
+
import type { HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
import type { DBSchema, StorageFailure } from "@executor-js/storage-core";
|
|
3
5
|
import type { PluginBlobStore } from "./blob";
|
|
4
|
-
import type { ConnectionProvider, ConnectionRef, ConnectionRefreshError, CreateConnectionInput, UpdateConnectionTokensInput } from "./connections";
|
|
6
|
+
import type { ConnectionProvider, ConnectionRef, ConnectionRefreshError, CreateConnectionInput, RemoveConnectionInput, UpdateConnectionTokensInput } from "./connections";
|
|
7
|
+
import type { CredentialBindingsFacade } from "./credential-bindings";
|
|
5
8
|
import type { DefinitionsInput, SourceInput, ToolAnnotations, ToolRow } from "./core-schema";
|
|
6
|
-
import type { SourceDetectionResult } from "./types";
|
|
9
|
+
import type { RemoveSourceInput, SourceDetectionResult } from "./types";
|
|
7
10
|
import type { ElicitationDeclinedError, ElicitationHandler, ElicitationRequest, ElicitationResponse } from "./elicitation";
|
|
8
|
-
import type { ConnectionNotFoundError, ConnectionProviderNotRegisteredError, ConnectionReauthRequiredError, ConnectionRefreshNotSupportedError, SecretOwnedByConnectionError } from "./errors";
|
|
11
|
+
import type { ConnectionInUseError, ConnectionNotFoundError, ConnectionProviderNotRegisteredError, ConnectionReauthRequiredError, ConnectionRefreshNotSupportedError, SecretInUseError, SecretOwnedByConnectionError } from "./errors";
|
|
9
12
|
import type { OAuthService } from "./oauth";
|
|
10
13
|
import type { Scope } from "./scope";
|
|
11
|
-
import type {
|
|
14
|
+
import type { ScopedDBAdapter, ScopedTypedAdapter } from "./scoped-adapter";
|
|
15
|
+
import type { RemoveSecretInput, SecretProvider, SecretRef, SetSecretInput } from "./secrets";
|
|
16
|
+
import type { Usage, UsagesForConnectionInput, UsagesForSecretInput } from "./usages";
|
|
12
17
|
export interface StorageDeps<TSchema extends DBSchema | undefined = undefined> {
|
|
13
18
|
/**
|
|
14
19
|
* Precedence-ordered scope stack visible to this executor. Innermost
|
|
@@ -25,7 +30,7 @@ export interface StorageDeps<TSchema extends DBSchema | undefined = undefined> {
|
|
|
25
30
|
* `@executor-js/api` `withCapture`) is the one place that
|
|
26
31
|
* translates it to the opaque `InternalError({ traceId })`.
|
|
27
32
|
*/
|
|
28
|
-
readonly adapter: TSchema extends DBSchema ?
|
|
33
|
+
readonly adapter: TSchema extends DBSchema ? ScopedTypedAdapter<TSchema> : ScopedDBAdapter;
|
|
29
34
|
readonly blobs: PluginBlobStore;
|
|
30
35
|
}
|
|
31
36
|
export declare const defineSchema: <const S extends DBSchema>(schema: S) => S;
|
|
@@ -39,10 +44,11 @@ export interface PluginCtx<TStore = unknown> {
|
|
|
39
44
|
*/
|
|
40
45
|
readonly scopes: readonly Scope[];
|
|
41
46
|
readonly storage: TStore;
|
|
47
|
+
readonly httpClientLayer: Layer.Layer<HttpClient.HttpClient>;
|
|
42
48
|
readonly core: {
|
|
43
49
|
readonly sources: {
|
|
44
50
|
readonly register: (input: SourceInput) => Effect.Effect<void, StorageFailure>;
|
|
45
|
-
readonly unregister: (
|
|
51
|
+
readonly unregister: (input: RemoveSourceInput) => Effect.Effect<void, StorageFailure>;
|
|
46
52
|
readonly update: (input: {
|
|
47
53
|
readonly id: string;
|
|
48
54
|
readonly scope: string;
|
|
@@ -62,6 +68,7 @@ export interface PluginCtx<TStore = unknown> {
|
|
|
62
68
|
};
|
|
63
69
|
readonly secrets: {
|
|
64
70
|
readonly get: (id: string) => Effect.Effect<string | null, SecretOwnedByConnectionError | StorageFailure>;
|
|
71
|
+
readonly getAtScope: (id: string, scope: string) => Effect.Effect<string | null, SecretOwnedByConnectionError | StorageFailure>;
|
|
65
72
|
/** List user-visible secrets. Connection-owned secrets (rows with
|
|
66
73
|
* `owned_by_connection_id` set) are filtered out so they don't
|
|
67
74
|
* clutter the UI — users see the Connection instead. */
|
|
@@ -80,8 +87,10 @@ export interface PluginCtx<TStore = unknown> {
|
|
|
80
87
|
/** Delete a secret from its pinned provider and the core table.
|
|
81
88
|
* Rejects with `SecretOwnedByConnectionError` if the row is owned
|
|
82
89
|
* by a connection — callers must go through `connections.remove`
|
|
83
|
-
* to drop the whole sign-in.
|
|
84
|
-
|
|
90
|
+
* to drop the whole sign-in. Rejects with `SecretInUseError` if
|
|
91
|
+
* any plugin reports the secret as in use; the caller should ask
|
|
92
|
+
* the user to detach the listed sources first. */
|
|
93
|
+
readonly remove: (input: RemoveSecretInput) => Effect.Effect<void, SecretOwnedByConnectionError | SecretInUseError | StorageFailure>;
|
|
85
94
|
};
|
|
86
95
|
/** Connections — product-level sign-in state. Owns backing secret
|
|
87
96
|
* rows via `secret.owned_by_connection_id`. Plugins call
|
|
@@ -90,6 +99,7 @@ export interface PluginCtx<TStore = unknown> {
|
|
|
90
99
|
* keyed by `connection.provider`). */
|
|
91
100
|
readonly connections: {
|
|
92
101
|
readonly get: (id: string) => Effect.Effect<ConnectionRef | null, StorageFailure>;
|
|
102
|
+
readonly getAtScope: (id: string, scope: string) => Effect.Effect<ConnectionRef | null, StorageFailure>;
|
|
93
103
|
readonly list: () => Effect.Effect<readonly ConnectionRef[], StorageFailure>;
|
|
94
104
|
readonly create: (input: CreateConnectionInput) => Effect.Effect<ConnectionRef, ConnectionProviderNotRegisteredError | StorageFailure>;
|
|
95
105
|
readonly updateTokens: (input: UpdateConnectionTokensInput) => Effect.Effect<ConnectionRef, ConnectionNotFoundError | StorageFailure>;
|
|
@@ -98,8 +108,13 @@ export interface PluginCtx<TStore = unknown> {
|
|
|
98
108
|
* `refresh` handler if `expires_at` is in the past / within the
|
|
99
109
|
* refresh skew window. */
|
|
100
110
|
readonly accessToken: (id: string) => Effect.Effect<string, ConnectionNotFoundError | ConnectionProviderNotRegisteredError | ConnectionRefreshNotSupportedError | ConnectionReauthRequiredError | ConnectionRefreshError | StorageFailure>;
|
|
101
|
-
readonly
|
|
111
|
+
readonly accessTokenAtScope: (id: string, scope: string) => Effect.Effect<string, ConnectionNotFoundError | ConnectionProviderNotRegisteredError | ConnectionRefreshNotSupportedError | ConnectionReauthRequiredError | ConnectionRefreshError | StorageFailure>;
|
|
112
|
+
/** Refuses with `ConnectionInUseError` if any plugin reports the
|
|
113
|
+
* connection as in use. Caller surfaces the `usages` list to the
|
|
114
|
+
* user. */
|
|
115
|
+
readonly remove: (input: RemoveConnectionInput) => Effect.Effect<void, ConnectionInUseError | StorageFailure>;
|
|
102
116
|
};
|
|
117
|
+
readonly credentialBindings: CredentialBindingsFacade;
|
|
103
118
|
/** Shared OAuth service. Plugins use this to probe/start/complete OAuth
|
|
104
119
|
* flows; invocation should still resolve tokens via `connections.accessToken`. */
|
|
105
120
|
readonly oauth: OAuthService;
|
|
@@ -166,8 +181,16 @@ export interface SourceLifecycleInput<TStore = unknown> {
|
|
|
166
181
|
*/
|
|
167
182
|
readonly scope: string;
|
|
168
183
|
}
|
|
169
|
-
export interface PluginSpec<TId extends string = string, TExtension extends object =
|
|
184
|
+
export interface PluginSpec<TId extends string = string, TExtension extends object = any, TStore = any, TSchema extends DBSchema | undefined = any, TExtensionService extends Context.Service<any, any> | undefined = any, THandlersLayer extends Layer.Layer<any, any, any> = any, TGroup extends HttpApiGroup.Any = HttpApiGroup.Any> {
|
|
170
185
|
readonly id: TId;
|
|
186
|
+
/** npm package name. The Vite plugin uses this to derive the
|
|
187
|
+
* `./client` import path for the frontend bundle (so the same
|
|
188
|
+
* `executor.config.ts` drives both server and client) — `${packageName}/client`
|
|
189
|
+
* is what gets bundled. The author writes the same string they
|
|
190
|
+
* publish to npm; no transforms, no scope conventions. Required for
|
|
191
|
+
* plugins that ship a `./client` entry; can be omitted for SDK-only
|
|
192
|
+
* plugins (no client bundle = nothing to resolve). */
|
|
193
|
+
readonly packageName?: string;
|
|
171
194
|
/** Plugin-declared schema. Merged with coreSchema and other plugins'
|
|
172
195
|
* schemas at executor startup via `collectSchemas`. The type flows
|
|
173
196
|
* into the `storage` factory's `deps.adapter` as a `TypedAdapter<TSchema>`
|
|
@@ -178,6 +201,19 @@ export interface PluginSpec<TId extends string = string, TExtension extends obje
|
|
|
178
201
|
* scoped to the plugin id so key collisions across plugins are
|
|
179
202
|
* structurally impossible. */
|
|
180
203
|
readonly storage: (deps: StorageDeps<TSchema>) => TStore;
|
|
204
|
+
/** JSON-serializable config the plugin wants its `./client` bundle to
|
|
205
|
+
* see. The Vite plugin reads this off each `executor.config.ts` spec
|
|
206
|
+
* at build time and bakes it into the virtual `plugins-client`
|
|
207
|
+
* module by calling the plugin's default `./client` export as a
|
|
208
|
+
* factory: `__p(<JSON.stringify(clientConfig)>)`. Plugins that don't
|
|
209
|
+
* set this stay as bare-value default exports — no churn.
|
|
210
|
+
*
|
|
211
|
+
* Use this when a server-side option (e.g. `dangerouslyAllowStdioMCP`)
|
|
212
|
+
* needs to drive client UI behaviour: declaring it once in
|
|
213
|
+
* `executor.config.ts` flows through to the bundle automatically,
|
|
214
|
+
* with no runtime fetch and no parallel client-side flag to keep in
|
|
215
|
+
* sync. */
|
|
216
|
+
readonly clientConfig?: unknown;
|
|
181
217
|
/** Build the plugin's extension API. The returned object becomes
|
|
182
218
|
* `executor[plugin.id]` and is also the `self` passed to
|
|
183
219
|
* `staticSources`. Field order matters: `extension` MUST appear
|
|
@@ -190,6 +226,53 @@ export interface PluginSpec<TId extends string = string, TExtension extends obje
|
|
|
190
226
|
* that delegates to the plugin's real API is a one-liner:
|
|
191
227
|
* `({ args }) => self.addSpec(args)`. */
|
|
192
228
|
readonly staticSources?: (self: NoInfer<TExtension>) => readonly StaticSourceDecl<TStore>[];
|
|
229
|
+
/** HttpApiGroup contributed by this plugin. Composed into the host's
|
|
230
|
+
* `HttpApi` via the `addGroup` helper at runtime. The host mounts
|
|
231
|
+
* the group at `/_executor/plugins/{id}/...` (or wherever the
|
|
232
|
+
* plugin declares its base path) with the host's auth + scope
|
|
233
|
+
* middleware applied. Endpoints automatically appear in the
|
|
234
|
+
* executor OpenAPI doc and the typed reactive client.
|
|
235
|
+
*
|
|
236
|
+
* TGroup is inferred from the plugin's own group declaration so the
|
|
237
|
+
* precise group identity flows through `composePluginApi(plugins)` —
|
|
238
|
+
* the host's typed `HttpApi<"executor", CoreGroups | PluginGroups>`
|
|
239
|
+
* is derived from the plugin tuple alone, with no per-plugin Group
|
|
240
|
+
* imports at the host. Per-endpoint typing already lives inside the
|
|
241
|
+
* plugin — its `handlers` Layer is built against its own bundled
|
|
242
|
+
* `HttpApi.make("foo").add(FooApi)` for full `.handle("name", ...)`
|
|
243
|
+
* inference, and its client imports the same group directly. */
|
|
244
|
+
readonly routes?: () => TGroup;
|
|
245
|
+
/** Handlers Layer for this plugin's group. Built by the plugin against
|
|
246
|
+
* its own bundled API for full type safety on `.handle("name", ...)`,
|
|
247
|
+
* composes into the host's runtime `FullApi` because
|
|
248
|
+
* `HttpApiBuilder.group` keys the layer by group identity, not by the
|
|
249
|
+
* surrounding API.
|
|
250
|
+
*
|
|
251
|
+
* Late-binding: the layer leaves the plugin's extension as a Service
|
|
252
|
+
* Tag requirement (see `extensionService` below). The host satisfies
|
|
253
|
+
* it however its runtime wants:
|
|
254
|
+
* - local: at boot via `Layer.succeed(extensionService)(executor[id])`
|
|
255
|
+
* (see `composePluginHandlers`)
|
|
256
|
+
* - cloud: per-request via `Effect.provideService(extensionService,
|
|
257
|
+
* requestExecutor[id])` in the auth middleware
|
|
258
|
+
*
|
|
259
|
+
* The Layer's channels are typed `any` because `Layer<RIn, E, ROut>`'s
|
|
260
|
+
* `ROut` is contravariant — the host accepts any layer here and merges
|
|
261
|
+
* them; per-plugin requirements flow through the merge. */
|
|
262
|
+
readonly handlers?: () => THandlersLayer;
|
|
263
|
+
/** Service tag the plugin's `handlers` layer requires. Set by plugins
|
|
264
|
+
* whose handlers consume their extension via a `Context.Service` tag
|
|
265
|
+
* (the established pattern: `*Handlers` reads `*ExtensionService`).
|
|
266
|
+
* The host binds the tag to the live extension — at boot for local,
|
|
267
|
+
* per request for cloud. Pairs with `handlers`; either both fields
|
|
268
|
+
* are set or neither.
|
|
269
|
+
*
|
|
270
|
+
* Inferred via the `TExtensionService` generic so the per-plugin
|
|
271
|
+
* Service class identity propagates through `composePluginHandlers`,
|
|
272
|
+
* `composePluginHandlerLayer`, and `providePluginExtensions` —
|
|
273
|
+
* cloud's per-request middleware needs the precise tag for layer
|
|
274
|
+
* satisfaction. */
|
|
275
|
+
readonly extensionService?: TExtensionService;
|
|
193
276
|
/** Invoke a dynamic tool. Called when the executor's static-handler
|
|
194
277
|
* map doesn't have the toolId. The plugin reads its own enrichment
|
|
195
278
|
* via `ctx.storage` and returns the result. Optional — plugins with
|
|
@@ -217,10 +300,28 @@ export interface PluginSpec<TId extends string = string, TExtension extends obje
|
|
|
217
300
|
readonly sourceId: string;
|
|
218
301
|
readonly toolRows: readonly ToolRow[];
|
|
219
302
|
}) => Effect.Effect<Record<string, ToolAnnotations>, unknown>;
|
|
220
|
-
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* the
|
|
303
|
+
/** Find every place a secret id is referenced by this plugin's stored
|
|
304
|
+
* rows. Implementations query their normalized columns (e.g.
|
|
305
|
+
* `WHERE secret_id = $1`) and return one `Usage` per hit, with
|
|
306
|
+
* `ownerKind` / `slot` tagging the location. The executor fans out
|
|
307
|
+
* across all plugins and the result powers the Secrets-tab "Used
|
|
308
|
+
* by" list and the deletion-blocking check in `secrets.remove`.
|
|
309
|
+
*
|
|
310
|
+
* Plugins that never store secret refs (secret-provider-only
|
|
311
|
+
* plugins like keychain / file-secrets / 1password) omit this. */
|
|
312
|
+
readonly usagesForSecret?: (input: {
|
|
313
|
+
readonly ctx: PluginCtx<TStore>;
|
|
314
|
+
readonly args: UsagesForSecretInput;
|
|
315
|
+
}) => Effect.Effect<readonly Usage[], unknown>;
|
|
316
|
+
/** Same shape as `usagesForSecret`, but for connection refs. */
|
|
317
|
+
readonly usagesForConnection?: (input: {
|
|
318
|
+
readonly ctx: PluginCtx<TStore>;
|
|
319
|
+
readonly args: UsagesForConnectionInput;
|
|
320
|
+
}) => Effect.Effect<readonly Usage[], unknown>;
|
|
321
|
+
/** Called when `executor.sources.remove({ id, targetScope })` targets
|
|
322
|
+
* a source owned by this plugin. Plugin-side cleanup only; the
|
|
323
|
+
* executor deletes the core source/tool rows after this callback
|
|
324
|
+
* returns, inside the same transaction. */
|
|
224
325
|
readonly removeSource?: (input: SourceLifecycleInput<TStore>) => Effect.Effect<void, unknown>;
|
|
225
326
|
readonly refreshSource?: (input: SourceLifecycleInput<TStore>) => Effect.Effect<void, unknown>;
|
|
226
327
|
/** URL autodetection hook. When the user pastes a URL in the
|
|
@@ -249,15 +350,15 @@ export interface PluginSpec<TId extends string = string, TExtension extends obje
|
|
|
249
350
|
readonly connectionProviders?: readonly ConnectionProvider[] | ((ctx: PluginCtx<TStore>) => readonly ConnectionProvider[]) | ((ctx: PluginCtx<TStore>) => Effect.Effect<readonly ConnectionProvider[]>);
|
|
250
351
|
readonly close?: () => Effect.Effect<void, unknown>;
|
|
251
352
|
}
|
|
252
|
-
export interface Plugin<TId extends string = string, TExtension extends object =
|
|
353
|
+
export interface Plugin<TId extends string = string, TExtension extends object = any, TStore = any, TSchema extends DBSchema | undefined = any, TExtensionService extends Context.Service<any, any> | undefined = any, THandlersLayer extends Layer.Layer<any, any, any> = any, TGroup extends HttpApiGroup.Any = HttpApiGroup.Any> extends PluginSpec<TId, TExtension, TStore, TSchema, TExtensionService, THandlersLayer, TGroup> {
|
|
253
354
|
}
|
|
254
|
-
export type ConfiguredPlugin<TId extends string, TExtension extends object, TStore, TOptions extends object, TSchema extends DBSchema | undefined> = (options?: TOptions & {
|
|
355
|
+
export type ConfiguredPlugin<TId extends string, TExtension extends object, TStore, TOptions extends object, TSchema extends DBSchema | undefined, TExtensionService extends Context.Service<any, any> | undefined = undefined, THandlersLayer extends Layer.Layer<any, any, any> = Layer.Layer<unknown, never, never>, TGroup extends HttpApiGroup.Any = HttpApiGroup.Any> = (options?: TOptions & {
|
|
255
356
|
readonly storage?: (deps: StorageDeps<TSchema>) => TStore;
|
|
256
|
-
}) => Plugin<TId, TExtension, TStore, TSchema>;
|
|
257
|
-
export declare function definePlugin<TId extends string, TExtension extends object, TStore, TSchema extends DBSchema | undefined = undefined, TOptions extends object = {}>(authorFactory: (options?: TOptions) => PluginSpec<TId, TExtension, TStore, TSchema>): ConfiguredPlugin<TId, TExtension, TStore, TOptions, TSchema>;
|
|
258
|
-
export type AnyPlugin = Plugin<string
|
|
357
|
+
}) => Plugin<TId, TExtension, TStore, TSchema, TExtensionService, THandlersLayer, TGroup>;
|
|
358
|
+
export declare function definePlugin<TId extends string, TExtension extends object, TStore, TSchema extends DBSchema | undefined = undefined, TOptions extends object = {}, TExtensionService extends Context.Service<any, any> | undefined = undefined, THandlersLayer extends Layer.Layer<any, any, any> = Layer.Layer<unknown, never, never>, TGroup extends HttpApiGroup.Any = HttpApiGroup.Any>(authorFactory: (options?: TOptions) => PluginSpec<TId, TExtension, TStore, TSchema, TExtensionService, THandlersLayer, TGroup>): ConfiguredPlugin<TId, TExtension, TStore, TOptions, TSchema, TExtensionService, THandlersLayer, TGroup>;
|
|
359
|
+
export type AnyPlugin = Plugin<string>;
|
|
259
360
|
export type PluginExtensions<TPlugins extends readonly AnyPlugin[]> = {
|
|
260
|
-
readonly [P in TPlugins[number] as P["id"]]: P extends Plugin<string, infer TExt
|
|
361
|
+
readonly [P in TPlugins[number] as P["id"]]: P extends Plugin<string, infer TExt> ? TExt : never;
|
|
261
362
|
};
|
|
262
363
|
/** Lightweight projection of a secret entry as returned by `ctx.secrets.list`. */
|
|
263
364
|
export interface SecretListEntry {
|
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,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACb,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,OAAO,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,uBAAuB,EACvB,oCAAoC,EACpC,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAc3E,MAAM,WAAW,WAAW,CAAC,OAAO,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS;IAC3E;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IAClC;;;;;;;OAOG;IAC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E,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK;CACjG,CAAC;AAEF,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAGD,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/policies.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface ToolPolicy {
|
|
|
14
14
|
readonly updatedAt: Date;
|
|
15
15
|
}
|
|
16
16
|
export interface CreateToolPolicyInput {
|
|
17
|
-
readonly
|
|
17
|
+
readonly targetScope: string;
|
|
18
18
|
readonly pattern: string;
|
|
19
19
|
readonly action: ToolPolicyAction;
|
|
20
20
|
/** Optional explicit position. Defaults to a key above the current
|
|
@@ -23,10 +23,15 @@ export interface CreateToolPolicyInput {
|
|
|
23
23
|
}
|
|
24
24
|
export interface UpdateToolPolicyInput {
|
|
25
25
|
readonly id: string;
|
|
26
|
+
readonly targetScope: string;
|
|
26
27
|
readonly pattern?: string;
|
|
27
28
|
readonly action?: ToolPolicyAction;
|
|
28
29
|
readonly position?: string;
|
|
29
30
|
}
|
|
31
|
+
export interface RemoveToolPolicyInput {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly targetScope: string;
|
|
34
|
+
}
|
|
30
35
|
export interface PolicyMatch {
|
|
31
36
|
readonly action: ToolPolicyAction;
|
|
32
37
|
readonly pattern: string;
|
|
@@ -43,20 +48,10 @@ export interface EffectivePolicy {
|
|
|
43
48
|
}
|
|
44
49
|
export declare const matchPattern: (pattern: string, toolId: string) => boolean;
|
|
45
50
|
export declare const isValidPattern: (pattern: string) => boolean;
|
|
46
|
-
export declare const comparePolicyRow: (a:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
position: unknown;
|
|
51
|
-
id: unknown;
|
|
52
|
-
}) => number;
|
|
53
|
-
export declare const resolveToolPolicy: (toolId: string, policies: readonly ToolPolicyRow[], scopeRank: (row: {
|
|
54
|
-
scope_id: unknown;
|
|
55
|
-
}) => number) => PolicyMatch | undefined;
|
|
56
|
-
export declare const resolveEffectivePolicy: (toolId: string, policies: readonly ToolPolicyRow[], scopeRank: (row: {
|
|
57
|
-
scope_id: unknown;
|
|
58
|
-
}) => number, defaultRequiresApproval?: boolean) => EffectivePolicy;
|
|
59
|
-
export declare const effectivePolicyFromSorted: (toolId: string, sortedPolicies: readonly Pick<ToolPolicy, "pattern" | "action" | "id">[], defaultRequiresApproval?: boolean) => EffectivePolicy;
|
|
51
|
+
export declare const comparePolicyRow: (a: Pick<ToolPolicyRow, "position" | "id">, b: Pick<ToolPolicyRow, "position" | "id">) => number;
|
|
52
|
+
export declare const resolveToolPolicy: (toolId: string, policies: readonly ToolPolicyRow[], scopeRank: (row: Pick<ToolPolicyRow, "scope_id">) => number) => PolicyMatch | undefined;
|
|
53
|
+
export declare const resolveEffectivePolicy: (toolId: string, policies: readonly ToolPolicyRow[], scopeRank: (row: Pick<ToolPolicyRow, "scope_id">) => number, defaultRequiresApproval?: boolean) => EffectivePolicy;
|
|
54
|
+
export declare const effectivePolicyFromSorted: (toolId: string, sortedPolicies: readonly (Pick<ToolPolicy, "pattern" | "action" | "id"> & Partial<Pick<ToolPolicy, "scopeId">>)[], defaultRequiresApproval?: boolean) => EffectivePolicy;
|
|
60
55
|
export declare const rowToToolPolicy: (row: ToolPolicyRow) => ToolPolicy;
|
|
61
56
|
export declare const ToolPolicyActionSchema: Schema.Literals<readonly ["approve", "require_approval", "block"]>;
|
|
62
57
|
//# sourceMappingURL=policies.d.ts.map
|