@valon-technologies/gestalt 0.0.1-alpha.17 → 0.0.1-alpha.18
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/package.json +1 -1
- package/src/agent.ts +11 -0
- package/src/api.ts +12 -0
- package/src/authorization.ts +2 -1
- package/src/cache.ts +2 -1
- package/src/http-subject.ts +5 -1
- package/src/index.ts +3 -0
- package/src/indexeddb.ts +2 -1
- package/src/internal/gen/v1/agent_pb.ts +260 -67
- package/src/internal/gen/v1/authentication_pb.ts +1 -1
- package/src/internal/gen/v1/authorization_pb.ts +1 -1
- package/src/internal/gen/v1/cache_pb.ts +1 -1
- package/src/internal/gen/v1/datastore_pb.ts +1 -1
- package/src/internal/gen/v1/external_credential_pb.ts +434 -29
- package/src/internal/gen/v1/plugin_pb.ts +38 -14
- package/src/internal/gen/v1/pluginruntime_pb.ts +1 -1
- package/src/internal/gen/v1/runtime_pb.ts +1 -1
- package/src/internal/gen/v1/s3_pb.ts +1 -1
- package/src/internal/gen/v1/secrets_pb.ts +1 -1
- package/src/internal/gen/v1/workflow_pb.ts +6 -6
- package/src/runtime-log-host.ts +1 -1
- package/src/runtime.ts +5 -0
- package/src/s3.ts +2 -1
- package/src/workflow.ts +1 -1
package/package.json
CHANGED
package/src/agent.ts
CHANGED
|
@@ -65,7 +65,9 @@ import {
|
|
|
65
65
|
type ListAgentProviderTurnEventsRequest,
|
|
66
66
|
type ListAgentProviderTurnsRequest,
|
|
67
67
|
type ListedAgentTool,
|
|
68
|
+
type ResolveAgentConnectionRequest,
|
|
68
69
|
type ResolveAgentProviderInteractionRequest,
|
|
70
|
+
type ResolvedAgentConnection,
|
|
69
71
|
type ResolvedAgentTool,
|
|
70
72
|
type UpdateAgentProviderSessionRequest,
|
|
71
73
|
} from "./internal/gen/v1/agent_pb.ts";
|
|
@@ -114,7 +116,9 @@ export type {
|
|
|
114
116
|
ListAgentProviderTurnEventsRequest,
|
|
115
117
|
ListAgentProviderTurnsRequest,
|
|
116
118
|
ListedAgentTool,
|
|
119
|
+
ResolveAgentConnectionRequest,
|
|
117
120
|
ResolveAgentProviderInteractionRequest,
|
|
121
|
+
ResolvedAgentConnection,
|
|
118
122
|
ResolvedAgentTool,
|
|
119
123
|
UpdateAgentProviderSessionRequest,
|
|
120
124
|
};
|
|
@@ -461,6 +465,13 @@ export class AgentHost {
|
|
|
461
465
|
): Promise<ListAgentToolsResponse> {
|
|
462
466
|
return await this.client.listTools(request);
|
|
463
467
|
}
|
|
468
|
+
|
|
469
|
+
/** Resolves a configured agent connection for the current turn. */
|
|
470
|
+
async resolveConnection(
|
|
471
|
+
request: ResolveAgentConnectionRequest,
|
|
472
|
+
): Promise<ResolvedAgentConnection> {
|
|
473
|
+
return await this.client.resolveConnection(request);
|
|
474
|
+
}
|
|
464
475
|
}
|
|
465
476
|
|
|
466
477
|
function agentHostTransportOptions(rawTarget: string): {
|
package/src/api.ts
CHANGED
|
@@ -26,6 +26,13 @@ export interface Access {
|
|
|
26
26
|
role: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Describes public host metadata available to provider code.
|
|
31
|
+
*/
|
|
32
|
+
export interface Host {
|
|
33
|
+
publicBaseUrl: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
/**
|
|
30
37
|
* Request metadata forwarded to provider handlers by the Gestalt runtime.
|
|
31
38
|
*/
|
|
@@ -35,6 +42,7 @@ export interface Request {
|
|
|
35
42
|
subject: Subject;
|
|
36
43
|
credential: Credential;
|
|
37
44
|
access: Access;
|
|
45
|
+
host: Host;
|
|
38
46
|
idempotencyKey: string;
|
|
39
47
|
// Workflow callback metadata uses a JSON-style lowerCamelCase object such as
|
|
40
48
|
// runId, target.plugin.pluginName, trigger.scheduleId, and trigger.event.specVersion.
|
|
@@ -106,6 +114,7 @@ export function request(
|
|
|
106
114
|
workflow: Record<string, unknown> = {},
|
|
107
115
|
invocationToken = "",
|
|
108
116
|
idempotencyKey = "",
|
|
117
|
+
host: Partial<Host> = {},
|
|
109
118
|
): Request {
|
|
110
119
|
return {
|
|
111
120
|
token,
|
|
@@ -131,6 +140,9 @@ export function request(
|
|
|
131
140
|
workflow: {
|
|
132
141
|
...workflow,
|
|
133
142
|
},
|
|
143
|
+
host: {
|
|
144
|
+
publicBaseUrl: host.publicBaseUrl ?? "",
|
|
145
|
+
},
|
|
134
146
|
invocationToken,
|
|
135
147
|
idempotencyKey: idempotencyKey.trim(),
|
|
136
148
|
};
|
package/src/authorization.ts
CHANGED
|
@@ -80,7 +80,8 @@ export class AuthorizationClient {
|
|
|
80
80
|
...(transportOptions.nodeOptions
|
|
81
81
|
? {
|
|
82
82
|
nodeOptions: {
|
|
83
|
-
createConnection: () =>
|
|
83
|
+
createConnection: () =>
|
|
84
|
+
connect({ path: transportOptions.nodeOptions!.path }),
|
|
84
85
|
},
|
|
85
86
|
}
|
|
86
87
|
: {}),
|
package/src/cache.ts
CHANGED
|
@@ -139,7 +139,8 @@ export class Cache {
|
|
|
139
139
|
...(transportOptions.nodeOptions
|
|
140
140
|
? {
|
|
141
141
|
nodeOptions: {
|
|
142
|
-
createConnection: () =>
|
|
142
|
+
createConnection: () =>
|
|
143
|
+
connect({ path: transportOptions.nodeOptions!.path }),
|
|
143
144
|
},
|
|
144
145
|
}
|
|
145
146
|
: {}),
|
package/src/http-subject.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Access, Credential, MaybePromise, Subject } from "./api.ts";
|
|
1
|
+
import type { Access, Credential, Host, MaybePromise, Subject } from "./api.ts";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Verified hosted HTTP request metadata passed into optional plugin-local
|
|
@@ -26,6 +26,7 @@ export interface HTTPSubjectResolutionContext {
|
|
|
26
26
|
subject: Subject;
|
|
27
27
|
credential: Credential;
|
|
28
28
|
access: Access;
|
|
29
|
+
host: Host;
|
|
29
30
|
workflow: Record<string, unknown>;
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -96,6 +97,9 @@ export function cloneHTTPSubjectResolutionContext(
|
|
|
96
97
|
access: {
|
|
97
98
|
...input.access,
|
|
98
99
|
},
|
|
100
|
+
host: {
|
|
101
|
+
...input.host,
|
|
102
|
+
},
|
|
99
103
|
workflow: {
|
|
100
104
|
...input.workflow,
|
|
101
105
|
},
|
package/src/index.ts
CHANGED
|
@@ -52,6 +52,7 @@ export {
|
|
|
52
52
|
responseBrand,
|
|
53
53
|
request,
|
|
54
54
|
type Access,
|
|
55
|
+
type Host,
|
|
55
56
|
type MaybePromise,
|
|
56
57
|
type Credential,
|
|
57
58
|
type OperationResult,
|
|
@@ -363,7 +364,9 @@ export {
|
|
|
363
364
|
type ListAgentProviderTurnEventsRequest,
|
|
364
365
|
type ListAgentProviderTurnsRequest,
|
|
365
366
|
type ListedAgentTool,
|
|
367
|
+
type ResolveAgentConnectionRequest,
|
|
366
368
|
type ResolveAgentProviderInteractionRequest,
|
|
369
|
+
type ResolvedAgentConnection,
|
|
367
370
|
type ResolvedAgentTool,
|
|
368
371
|
type UpdateAgentProviderSessionRequest,
|
|
369
372
|
} from "./agent.ts";
|
package/src/indexeddb.ts
CHANGED
|
@@ -536,7 +536,8 @@ export class IndexedDB {
|
|
|
536
536
|
...(transportOptions.nodeOptions
|
|
537
537
|
? {
|
|
538
538
|
nodeOptions: {
|
|
539
|
-
createConnection: () =>
|
|
539
|
+
createConnection: () =>
|
|
540
|
+
connect({ path: transportOptions.nodeOptions!.path }),
|
|
540
541
|
},
|
|
541
542
|
}
|
|
542
543
|
: {}),
|