-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathshared.ts
More file actions
180 lines (168 loc) · 4.83 KB
/
Copy pathshared.ts
File metadata and controls
180 lines (168 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// ---------------------------------------------------------------------------
// @executor-js/sdk/shared — browser-safe domain contracts.
//
// For React and plugin UI code that needs the v2 runtime ids, tagged errors,
// policy helpers, and wire contracts without importing the server/plugin SDK
// root (which pulls fumadb / node). Everything re-exported here must be
// browser-safe: pure Effect/Schema, no `fuma-runtime` / `core-schema` value
// imports. (The `ToolPolicyAction` *type* is fine — types erase at runtime.)
// ---------------------------------------------------------------------------
// Branded ids + the owner literal.
export {
AuthTemplateSlug,
ConnectionAddress,
ConnectionName,
ElicitationId,
IntegrationSlug,
OAuthClientSlug,
OAuthState,
Owner,
PolicyId,
ProviderItemId,
ProviderKey,
Subject,
Tenant,
ToolAddress,
ToolName,
} from "./ids";
export { connectionIdentifier, isConnectionIdentifier } from "./connection-name-identifier";
// Domain projections (types only — no runtime cost).
export type {
AuthMethodDescriptor,
AuthMethodOAuthDescriptor,
AuthPlacementDescriptor,
Integration,
IntegrationConfig,
IntegrationDisplayDescriptor,
} from "./integration";
export type {
Connection,
ConnectionRef,
ConnectionValueInput,
CreateConnectionInput,
UpdateConnectionInput,
ValidateConnectionInput,
} from "./connection";
export type { CredentialProvider, ProviderEntry } from "./provider";
export type { Tool, ToolDef, ToolListFilter, ToolAnnotations } from "./tool";
// Tagged errors (Schema-based — browser-safe).
export {
ToolNotFoundError,
ToolInvocationError,
ToolBlockedError,
PluginNotLoadedError,
NoHandlerError,
IntegrationNotFoundError,
IntegrationAlreadyExistsError,
IntegrationRemovalNotAllowedError,
ConnectionNotFoundError,
InvalidConnectionInputError,
CredentialProviderNotRegisteredError,
CredentialResolutionError,
isUserActionableError,
type ExecuteError,
type ExecutorError,
type UserActionableError,
} from "./errors";
// Elicitation wire schemas.
export {
FormElicitation,
UrlElicitation,
ElicitationAction,
ElicitationResponse,
ElicitationDeclinedError,
type ElicitationRequest,
type ElicitationContext,
type ElicitationHandler,
type OnElicitation,
type InvokeOptions,
} from "./elicitation";
// Tool-policy helpers + projections (pure functions / Schema).
export {
matchPattern,
isValidPattern,
effectivePolicyFromSorted,
comparePolicyRow,
patternSpecificity,
positionForNewPattern,
ToolPolicyActionSchema,
type ToolPolicy,
type CreateToolPolicyInput,
type UpdateToolPolicyInput,
type RemoveToolPolicyInput,
type PolicyMatch,
type EffectivePolicy,
type PolicySource,
} from "./policies";
export type { ToolPolicyAction } from "./core-schema";
// Schema-side views + onboarding autodetect.
export { ToolSchemaView, IntegrationDetectionResult } from "./types";
export {
decodeOAuthCallbackState,
encodeOAuthCallbackState,
type OAuthCallbackState,
} from "./oauth";
// Health-check vocabulary (pure Schema + helpers).
export {
HealthStatus,
HealthCheckSpec,
HealthCheckResult,
HealthCheckCandidate,
HealthCheckCandidateParameter,
classifyHttpStatus,
classifyProbeResponse,
extractIdentity,
compareHealthCheckCandidates,
candidateIdentityTier,
sortHealthCheckCandidatesByIdentity,
identityPathTier,
rankResponseSample,
} from "./health-check";
// OAuth wire contracts (data + tagged errors; the flow impl is server-only).
export {
type OAuthGrant,
type OAuthAuthentication,
type OAuthClient,
type OAuthClientOrigin,
type OAuthClientSummary,
type CreateOAuthClientInput,
type RegisterDynamicClientInput,
type ConnectResult,
type OAuthStartInput,
type OAuthCompleteInput,
type OAuthProbeInput,
type OAuthProbeResult,
type OAuthService,
OAuthStartError,
OAuthCompleteError,
OAuthProbeError,
OAuthRegisterDynamicError,
OAuthSessionNotFoundError,
} from "./oauth-client";
// Wire-level HTTP error schema for plugin HttpApiGroup definitions.
export { InternalError } from "./api-errors";
// Executor server connection contracts (browser-safe).
export {
DEFAULT_EXECUTOR_SERVER_ORIGIN,
DEFAULT_EXECUTOR_SERVER_USERNAME,
EXECUTOR_ORG_SELECTOR_HEADER,
apiBaseUrlForServerOrigin,
getExecutorServerAuthorizationHeader,
normalizeExecutorServerConnection,
normalizeExecutorServerOrigin,
originFromApiBaseUrl,
parseExecutorLocalServerManifest,
serializeExecutorLocalServerManifest,
type ExecutorServerAuth,
type ExecutorServerConnection,
type ExecutorServerConnectionInput,
type ExecutorServerConnectionKind,
type ExecutorLocalServerKind,
type ExecutorLocalServerManifest,
} from "./server-connection";
// OAuth popup postMessage contract (browser-safe).
export {
OAUTH_POPUP_MESSAGE_TYPE,
type OAuthPopupResult,
isOAuthPopupResult,
} from "./oauth-popup-types";