@valon-technologies/gestalt 0.0.1-alpha.18 → 0.0.1-alpha.19
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 +34 -12
- package/package.json +5 -3
- package/src/agent-conversions.ts +201 -0
- package/src/agent-manager.ts +272 -83
- package/src/agent.ts +1023 -224
- package/src/api.ts +42 -0
- package/src/auth.ts +3 -3
- package/src/authorization.ts +1700 -51
- package/src/cache.ts +3 -3
- package/src/catalog.ts +22 -0
- package/src/http-subject.ts +9 -2
- package/src/index.ts +191 -17
- package/src/indexeddb.ts +3 -15
- package/src/internal/gen/v1/agent_pb.ts +137 -51
- package/src/internal/gen/v1/authorization_pb.ts +505 -27
- package/src/internal/gen/v1/plugin_pb.ts +67 -21
- package/src/internal/gen/v1/pluginruntime_pb.ts +95 -6
- package/src/internal/gen/v1/workflow_pb.ts +344 -62
- package/src/invoker.ts +6 -35
- package/src/plugin.ts +12 -12
- package/src/pluginruntime.ts +337 -49
- package/src/protocol/v1.ts +19 -0
- package/src/protocol-internal.ts +19 -0
- package/src/protocol.ts +183 -0
- package/src/provider-kind.ts +7 -3
- package/src/provider.ts +21 -13
- package/src/runtime-log-host.ts +80 -52
- package/src/runtime.ts +67 -0
- package/src/s3.ts +13 -28
- package/src/secrets.ts +3 -3
- package/src/workflow-manager.ts +350 -121
- package/src/workflow.ts +2598 -389
package/src/api.ts
CHANGED
|
@@ -6,6 +6,26 @@ export interface Subject {
|
|
|
6
6
|
kind: string;
|
|
7
7
|
displayName: string;
|
|
8
8
|
authSource: string;
|
|
9
|
+
email: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Subject payload authored by provider-side hooks.
|
|
14
|
+
*/
|
|
15
|
+
export interface SubjectInput {
|
|
16
|
+
id: string;
|
|
17
|
+
kind: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
authSource: string;
|
|
20
|
+
email?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Provider-owned external identity attached to an incoming provider request.
|
|
25
|
+
*/
|
|
26
|
+
export interface ExternalIdentity {
|
|
27
|
+
type: string;
|
|
28
|
+
id: string;
|
|
9
29
|
}
|
|
10
30
|
|
|
11
31
|
/**
|
|
@@ -40,6 +60,9 @@ export interface Request {
|
|
|
40
60
|
token: string;
|
|
41
61
|
connectionParams: Record<string, string>;
|
|
42
62
|
subject: Subject;
|
|
63
|
+
agentSubject: Subject;
|
|
64
|
+
externalIdentity: ExternalIdentity;
|
|
65
|
+
agentExternalIdentity: ExternalIdentity;
|
|
43
66
|
credential: Credential;
|
|
44
67
|
access: Access;
|
|
45
68
|
host: Host;
|
|
@@ -115,6 +138,9 @@ export function request(
|
|
|
115
138
|
invocationToken = "",
|
|
116
139
|
idempotencyKey = "",
|
|
117
140
|
host: Partial<Host> = {},
|
|
141
|
+
agentSubject: Partial<Subject> = {},
|
|
142
|
+
externalIdentity: Partial<ExternalIdentity> = {},
|
|
143
|
+
agentExternalIdentity: Partial<ExternalIdentity> = {},
|
|
118
144
|
): Request {
|
|
119
145
|
return {
|
|
120
146
|
token,
|
|
@@ -126,6 +152,22 @@ export function request(
|
|
|
126
152
|
kind: subject.kind ?? "",
|
|
127
153
|
displayName: subject.displayName ?? "",
|
|
128
154
|
authSource: subject.authSource ?? "",
|
|
155
|
+
email: subject.email ?? "",
|
|
156
|
+
},
|
|
157
|
+
agentSubject: {
|
|
158
|
+
id: agentSubject.id ?? "",
|
|
159
|
+
kind: agentSubject.kind ?? "",
|
|
160
|
+
displayName: agentSubject.displayName ?? "",
|
|
161
|
+
authSource: agentSubject.authSource ?? "",
|
|
162
|
+
email: agentSubject.email ?? "",
|
|
163
|
+
},
|
|
164
|
+
externalIdentity: {
|
|
165
|
+
type: externalIdentity.type ?? "",
|
|
166
|
+
id: externalIdentity.id ?? "",
|
|
167
|
+
},
|
|
168
|
+
agentExternalIdentity: {
|
|
169
|
+
type: agentExternalIdentity.type ?? "",
|
|
170
|
+
id: agentExternalIdentity.id ?? "",
|
|
129
171
|
},
|
|
130
172
|
credential: {
|
|
131
173
|
mode: credential.mode ?? "",
|
package/src/auth.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProviderBase, type ProviderBaseOptions } from "./provider.ts";
|
|
2
2
|
import type { MaybePromise } from "./api.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -52,7 +52,7 @@ export interface AuthenticationSessionSettings {
|
|
|
52
52
|
/**
|
|
53
53
|
* Runtime hooks required to implement a Gestalt authentication provider.
|
|
54
54
|
*/
|
|
55
|
-
export interface AuthenticationProviderOptions extends
|
|
55
|
+
export interface AuthenticationProviderOptions extends ProviderBaseOptions {
|
|
56
56
|
beginLogin: (
|
|
57
57
|
request: BeginLoginRequest,
|
|
58
58
|
) => MaybePromise<BeginLoginResponse>;
|
|
@@ -68,7 +68,7 @@ export interface AuthenticationProviderOptions extends RuntimeProviderOptions {
|
|
|
68
68
|
/**
|
|
69
69
|
* Authentication provider implementation consumed by the Gestalt runtime.
|
|
70
70
|
*/
|
|
71
|
-
export class AuthenticationProvider extends
|
|
71
|
+
export class AuthenticationProvider extends ProviderBase {
|
|
72
72
|
readonly kind = "authentication" as const;
|
|
73
73
|
|
|
74
74
|
private readonly beginLoginHandler: AuthenticationProviderOptions["beginLogin"];
|