@finalai/agent-definition 0.1.2 → 0.1.3
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/HOSTING.md +165 -0
- package/README.md +7 -0
- package/dist/compiler-assets/{chunk-TATN3PYK.ts → chunk-2ZRYQO4Q.ts} +4 -4
- package/dist/compiler-assets/{chunk-HGW4YHAY.ts → chunk-3K4C4SVG.ts} +9 -0
- package/dist/compiler-assets/{chunk-JPY4L2UJ.ts → chunk-3YAKMWV4.ts} +7 -7
- package/dist/compiler-assets/{chunk-CWWRTRWW.ts → chunk-4E5HECVD.ts} +1 -1
- package/dist/compiler-assets/{chunk-7QP2CKPI.ts → chunk-4X2DS5BR.ts} +1 -1
- package/dist/compiler-assets/{chunk-ZDLVA6XF.ts → chunk-5IZTHCGZ.ts} +8 -8
- package/dist/compiler-assets/{chunk-2CZRHOLL.ts → chunk-7XUPKRZU.ts} +1 -1
- package/dist/compiler-assets/{chunk-7VSSVZM4.ts → chunk-BEFBCBUL.ts} +4 -4
- package/dist/compiler-assets/{chunk-HFS4KLEL.ts → chunk-D3SB4CCB.ts} +1 -1
- package/dist/compiler-assets/{chunk-EVQIK62B.ts → chunk-FHKYXT3F.ts} +11 -7
- package/dist/compiler-assets/{chunk-HNPUTP35.ts → chunk-GCFSHHH2.ts} +2 -2
- package/dist/compiler-assets/{chunk-MZMSKIKU.ts → chunk-I6U47R5U.ts} +14 -5
- package/dist/compiler-assets/{chunk-5BK6FVRE.ts → chunk-IF6MR7JF.ts} +2 -2
- package/dist/compiler-assets/{chunk-LUSAAV4L.ts → chunk-IZGOMT7K.ts} +2 -2
- package/dist/compiler-assets/{chunk-GTUZOATD.ts → chunk-JGQ2KAN7.ts} +1 -1
- package/dist/compiler-assets/chunk-JXJPBM5W.ts +61 -0
- package/dist/compiler-assets/{chunk-NYTOYKKF.ts → chunk-K6D7ZK74.ts} +3 -3
- package/dist/compiler-assets/{chunk-WMXMVFHM.ts → chunk-K7V4IMOB.ts} +3 -3
- package/dist/compiler-assets/{chunk-VHXHUU7L.ts → chunk-LHMUAIYJ.ts} +1 -1
- package/dist/compiler-assets/{chunk-SKTNMUO7.ts → chunk-MSE7X5YG.ts} +25 -2
- package/dist/compiler-assets/{chunk-OWC6SFFF.ts → chunk-OO67EO5E.ts} +10 -9
- package/dist/compiler-assets/chunk-PFLSBTJA.ts +39 -0
- package/dist/compiler-assets/{chunk-XHKPWT3G.ts → chunk-QJ26GEUM.ts} +1 -1
- package/dist/compiler-assets/chunk-RMIQJHSL.ts +0 -0
- package/dist/compiler-assets/{chunk-BLB6JGLO.ts → chunk-TCKYMNPM.ts} +27 -24
- package/dist/compiler-assets/{chunk-QMWTDPNT.ts → chunk-TJZS457N.ts} +3 -3
- package/dist/compiler-assets/{chunk-JIPNTA56.ts → chunk-TM36NO3C.ts} +1 -1
- package/dist/compiler-assets/{chunk-QMKWAFVZ.ts → chunk-TS7XNNHN.ts} +3 -3
- package/dist/compiler-assets/chunk-ULI5WWRR.ts +40 -0
- package/dist/compiler-assets/chunk-W6DOJA4W.ts +3763 -0
- package/dist/compiler-assets/src/authoring/agent.ts +4 -4
- package/dist/compiler-assets/src/authoring/approval.ts +7 -7
- package/dist/compiler-assets/src/authoring/brand.ts +3 -3
- package/dist/compiler-assets/src/authoring/channels.ts +6 -6
- package/dist/compiler-assets/src/authoring/connections.ts +14 -4
- package/dist/compiler-assets/src/authoring/credentials.ts +7 -6
- package/dist/compiler-assets/src/authoring/dynamic.ts +9 -4
- package/dist/compiler-assets/src/authoring/harness.ts +9 -9
- package/dist/compiler-assets/src/authoring/hooks.ts +10 -8
- package/dist/compiler-assets/src/authoring/index.ts +33 -26
- package/dist/compiler-assets/src/authoring/instructions.ts +10 -5
- package/dist/compiler-assets/src/authoring/sandbox.ts +10 -10
- package/dist/compiler-assets/src/authoring/schedules.ts +4 -4
- package/dist/compiler-assets/src/authoring/skills.ts +4 -4
- package/dist/compiler-assets/src/authoring/tools.ts +10 -8
- package/dist/compiler-assets/src/compatibility.ts +11 -11
- package/dist/compiler-assets/src/hosted-bindings.ts +15 -0
- package/dist/compiler-assets/src/index.ts +50 -41
- package/dist/compiler-assets/src/manifest.ts +4 -4
- package/dist/compiler-assets/src/resolve.ts +5 -5
- package/dist/compiler-assets/src/runtime/bundle.ts +22 -20
- package/dist/compiler-assets/src/runtime/describe.ts +14 -12
- package/dist/compiler-assets/src/runtime/described.ts +16 -11
- package/dist/compiler-assets/src/runtime/isolate.ts +18 -16
- package/dist/compiler-assets/src/runtime/lower.ts +13 -11
- package/dist/compiler-assets/src/runtime/schema-validation.ts +4 -4
- package/dist/compiler-assets/src/runtime/values.ts +2 -2
- package/dist/modules/authoring/connections.d.mts +5 -0
- package/dist/modules/authoring/connections.mjs +36 -0
- package/dist/modules/authoring/connections.mjs.map +2 -2
- package/dist/modules/authoring/context.d.mts +3 -1
- package/dist/modules/authoring/context.mjs.map +2 -2
- package/dist/modules/authoring/dynamic.d.mts +3 -1
- package/dist/modules/authoring/dynamic.mjs +19 -1
- package/dist/modules/authoring/dynamic.mjs.map +2 -2
- package/dist/modules/authoring/hooks.d.mts +2 -1
- package/dist/modules/authoring/hooks.mjs.map +2 -2
- package/dist/modules/authoring/index.d.mts +4 -2
- package/dist/modules/authoring/index.mjs +4 -1
- package/dist/modules/authoring/index.mjs.map +2 -2
- package/dist/modules/authoring/sandbox.d.mts +2 -1
- package/dist/modules/authoring/sandbox.mjs.map +2 -2
- package/dist/modules/compiler/assemble.mjs +5 -0
- package/dist/modules/compiler/assemble.mjs.map +2 -2
- package/dist/modules/compiler/index.d.mts +2 -1
- package/dist/modules/compiler/index.mjs +18 -0
- package/dist/modules/compiler/index.mjs.map +2 -2
- package/dist/modules/compiler/local-isolate.d.mts +2 -1
- package/dist/modules/compiler/local-isolate.mjs +6 -1
- package/dist/modules/compiler/local-isolate.mjs.map +2 -2
- package/dist/modules/hosted-bindings.d.mts +10 -0
- package/dist/modules/hosted-bindings.mjs +36 -0
- package/dist/modules/hosted-bindings.mjs.map +7 -0
- package/dist/modules/index.d.mts +2 -0
- package/dist/modules/index.mjs +2 -0
- package/dist/modules/index.mjs.map +2 -2
- package/dist/modules/resolve.mjs +4 -0
- package/dist/modules/resolve.mjs.map +2 -2
- package/dist/modules/runtime/describe.mjs +8 -1
- package/dist/modules/runtime/describe.mjs.map +2 -2
- package/dist/modules/runtime/described.d.mts +36 -0
- package/dist/modules/runtime/described.mjs +2 -1
- package/dist/modules/runtime/described.mjs.map +2 -2
- package/dist/modules/runtime/isolate.d.mts +2 -0
- package/dist/modules/runtime/isolate.mjs +7 -4
- package/dist/modules/runtime/isolate.mjs.map +2 -2
- package/dist/modules/runtime/schema-validation.mjs +19 -2
- package/dist/modules/runtime/schema-validation.mjs.map +2 -2
- package/package.json +4 -3
- package/dist/compiler-assets/chunk-GNR7XBPN.ts +0 -3364
- package/dist/compiler-assets/chunk-JNJE72EH.ts +0 -10
- package/dist/compiler-assets/chunk-T6WG4L4M.ts +0 -19
- /package/dist/compiler-assets/{chunk-6WR3PGNF.ts → chunk-CIWWFQHL.ts} +0 -0
|
@@ -27,15 +27,15 @@ import {
|
|
|
27
27
|
skillFileSchema,
|
|
28
28
|
toolDescriptorSchema,
|
|
29
29
|
workerMcpServerBindingSchema
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-7QP2CKPI.ts";
|
|
30
|
+
} from "../chunk-OO67EO5E.ts";
|
|
32
31
|
import {
|
|
33
32
|
DynamicEvent,
|
|
34
33
|
dynamicSlotSchema,
|
|
35
34
|
findDynamicSlots,
|
|
36
35
|
isDynamicSlot
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-MSE7X5YG.ts";
|
|
37
|
+
import "../chunk-4X2DS5BR.ts";
|
|
38
|
+
import "../chunk-3K4C4SVG.ts";
|
|
39
39
|
import "../chunk-32O3ODZE.ts";
|
|
40
40
|
export {
|
|
41
41
|
BaseCapability,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
resolveManifestDetailed,
|
|
5
5
|
slotKindOf,
|
|
6
6
|
validateSlotValue
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-FHKYXT3F.ts";
|
|
8
|
+
import "../chunk-OO67EO5E.ts";
|
|
9
|
+
import "../chunk-MSE7X5YG.ts";
|
|
10
|
+
import "../chunk-4X2DS5BR.ts";
|
|
11
|
+
import "../chunk-3K4C4SVG.ts";
|
|
12
12
|
import "../chunk-32O3ODZE.ts";
|
|
13
13
|
export {
|
|
14
14
|
SlotValueKind,
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
combineMcpServers,
|
|
3
|
+
createIsolateRuntime
|
|
4
|
+
} from "../../chunk-TCKYMNPM.ts";
|
|
1
5
|
import {
|
|
2
6
|
describeBundle,
|
|
3
7
|
needsCombinedMcpServers,
|
|
4
8
|
synthesizedExports
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import
|
|
7
|
-
combineMcpServers,
|
|
8
|
-
createIsolateRuntime
|
|
9
|
-
} from "../../chunk-BLB6JGLO.ts";
|
|
10
|
-
import "../../chunk-ZDLVA6XF.ts";
|
|
9
|
+
} from "../../chunk-I6U47R5U.ts";
|
|
10
|
+
import "../../chunk-5IZTHCGZ.ts";
|
|
11
11
|
import {
|
|
12
12
|
COMBINED_MCP_SERVERS_EXPORT,
|
|
13
13
|
namedExportName
|
|
14
14
|
} from "../../chunk-NMYHO2QN.ts";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-TJZS457N.ts";
|
|
16
|
+
import "../../chunk-4E5HECVD.ts";
|
|
17
17
|
import {
|
|
18
18
|
registerToolName
|
|
19
|
-
} from "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-5BK6FVRE.ts";
|
|
25
|
-
import "../../chunk-7QP2CKPI.ts";
|
|
19
|
+
} from "../../chunk-2ZRYQO4Q.ts";
|
|
20
|
+
import "../../chunk-BEFBCBUL.ts";
|
|
21
|
+
import "../../chunk-IF6MR7JF.ts";
|
|
22
|
+
import "../../chunk-CIWWFQHL.ts";
|
|
23
|
+
import "../../chunk-OO67EO5E.ts";
|
|
26
24
|
import "../../chunk-RWUIMTBI.ts";
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
30
|
-
import "../../chunk-
|
|
31
|
-
import "../../chunk-
|
|
25
|
+
import "../../chunk-PFLSBTJA.ts";
|
|
26
|
+
import "../../chunk-ULI5WWRR.ts";
|
|
27
|
+
import "../../chunk-W6DOJA4W.ts";
|
|
28
|
+
import "../../chunk-7WGYG73V.ts";
|
|
29
|
+
import "../../chunk-MSE7X5YG.ts";
|
|
30
|
+
import "../../chunk-4X2DS5BR.ts";
|
|
31
|
+
import "../../chunk-QJ26GEUM.ts";
|
|
32
|
+
import "../../chunk-TM36NO3C.ts";
|
|
33
|
+
import "../../chunk-3K4C4SVG.ts";
|
|
32
34
|
import "../../chunk-32O3ODZE.ts";
|
|
33
35
|
|
|
34
36
|
// src/runtime/bundle.ts
|
|
@@ -4,22 +4,24 @@ import {
|
|
|
4
4
|
describeDynamic,
|
|
5
5
|
needsCombinedMcpServers,
|
|
6
6
|
synthesizedExports
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-I6U47R5U.ts";
|
|
8
|
+
import "../../chunk-5IZTHCGZ.ts";
|
|
9
9
|
import {
|
|
10
10
|
COMBINED_MCP_SERVERS_EXPORT
|
|
11
11
|
} from "../../chunk-NMYHO2QN.ts";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-2ZRYQO4Q.ts";
|
|
13
|
+
import "../../chunk-BEFBCBUL.ts";
|
|
14
|
+
import "../../chunk-CIWWFQHL.ts";
|
|
15
|
+
import "../../chunk-OO67EO5E.ts";
|
|
16
|
+
import "../../chunk-PFLSBTJA.ts";
|
|
17
|
+
import "../../chunk-ULI5WWRR.ts";
|
|
18
|
+
import "../../chunk-W6DOJA4W.ts";
|
|
14
19
|
import "../../chunk-7WGYG73V.ts";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-XHKPWT3G.ts";
|
|
21
|
-
import "../../chunk-JIPNTA56.ts";
|
|
22
|
-
import "../../chunk-HGW4YHAY.ts";
|
|
20
|
+
import "../../chunk-MSE7X5YG.ts";
|
|
21
|
+
import "../../chunk-4X2DS5BR.ts";
|
|
22
|
+
import "../../chunk-QJ26GEUM.ts";
|
|
23
|
+
import "../../chunk-TM36NO3C.ts";
|
|
24
|
+
import "../../chunk-3K4C4SVG.ts";
|
|
23
25
|
import "../../chunk-32O3ODZE.ts";
|
|
24
26
|
export {
|
|
25
27
|
COMBINED_MCP_SERVERS_EXPORT,
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IssueSeverity
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-5IZTHCGZ.ts";
|
|
4
4
|
import {
|
|
5
5
|
SlotKind
|
|
6
6
|
} from "../../chunk-NMYHO2QN.ts";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-2ZRYQO4Q.ts";
|
|
8
|
+
import "../../chunk-BEFBCBUL.ts";
|
|
9
|
+
import "../../chunk-CIWWFQHL.ts";
|
|
10
|
+
import "../../chunk-OO67EO5E.ts";
|
|
11
|
+
import "../../chunk-PFLSBTJA.ts";
|
|
12
|
+
import "../../chunk-ULI5WWRR.ts";
|
|
13
|
+
import "../../chunk-W6DOJA4W.ts";
|
|
9
14
|
import "../../chunk-7WGYG73V.ts";
|
|
10
|
-
import
|
|
11
|
-
|
|
15
|
+
import {
|
|
16
|
+
hostedBindingRequirementSchema
|
|
17
|
+
} from "../../chunk-MSE7X5YG.ts";
|
|
12
18
|
import {
|
|
13
19
|
jsonValueSchema
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-XHKPWT3G.ts";
|
|
18
|
-
import "../../chunk-JIPNTA56.ts";
|
|
20
|
+
} from "../../chunk-4X2DS5BR.ts";
|
|
21
|
+
import "../../chunk-QJ26GEUM.ts";
|
|
22
|
+
import "../../chunk-TM36NO3C.ts";
|
|
19
23
|
import {
|
|
20
24
|
array,
|
|
21
25
|
boolean,
|
|
@@ -25,7 +29,7 @@ import {
|
|
|
25
29
|
object,
|
|
26
30
|
record,
|
|
27
31
|
string
|
|
28
|
-
} from "../../chunk-
|
|
32
|
+
} from "../../chunk-3K4C4SVG.ts";
|
|
29
33
|
import "../../chunk-32O3ODZE.ts";
|
|
30
34
|
|
|
31
35
|
// src/runtime/described.ts
|
|
@@ -39,6 +43,7 @@ var describedDynamicSchema = object({
|
|
|
39
43
|
events: array(string()),
|
|
40
44
|
description: string().nullable(),
|
|
41
45
|
preview: string().nullable(),
|
|
46
|
+
requiredBindings: array(hostedBindingRequirementSchema).optional(),
|
|
42
47
|
provider: providerHintSchema.nullable()
|
|
43
48
|
});
|
|
44
49
|
var describedAgentSchema = object({
|
|
@@ -2,24 +2,26 @@ import {
|
|
|
2
2
|
combineMcpServers,
|
|
3
3
|
createIsolateRuntime,
|
|
4
4
|
lowerResolvedValue
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-TCKYMNPM.ts";
|
|
6
|
+
import "../../chunk-5IZTHCGZ.ts";
|
|
7
7
|
import "../../chunk-NMYHO2QN.ts";
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-5BK6FVRE.ts";
|
|
16
|
-
import "../../chunk-7QP2CKPI.ts";
|
|
8
|
+
import "../../chunk-TJZS457N.ts";
|
|
9
|
+
import "../../chunk-4E5HECVD.ts";
|
|
10
|
+
import "../../chunk-2ZRYQO4Q.ts";
|
|
11
|
+
import "../../chunk-BEFBCBUL.ts";
|
|
12
|
+
import "../../chunk-IF6MR7JF.ts";
|
|
13
|
+
import "../../chunk-CIWWFQHL.ts";
|
|
14
|
+
import "../../chunk-OO67EO5E.ts";
|
|
17
15
|
import "../../chunk-RWUIMTBI.ts";
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-PFLSBTJA.ts";
|
|
17
|
+
import "../../chunk-ULI5WWRR.ts";
|
|
18
|
+
import "../../chunk-W6DOJA4W.ts";
|
|
19
|
+
import "../../chunk-7WGYG73V.ts";
|
|
20
|
+
import "../../chunk-MSE7X5YG.ts";
|
|
21
|
+
import "../../chunk-4X2DS5BR.ts";
|
|
22
|
+
import "../../chunk-QJ26GEUM.ts";
|
|
23
|
+
import "../../chunk-TM36NO3C.ts";
|
|
24
|
+
import "../../chunk-3K4C4SVG.ts";
|
|
23
25
|
import "../../chunk-32O3ODZE.ts";
|
|
24
26
|
export {
|
|
25
27
|
combineMcpServers,
|
|
@@ -17,18 +17,20 @@ import {
|
|
|
17
17
|
toJson,
|
|
18
18
|
toJsonSchema,
|
|
19
19
|
warning
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-5IZTHCGZ.ts";
|
|
21
|
+
import "../../chunk-2ZRYQO4Q.ts";
|
|
22
|
+
import "../../chunk-BEFBCBUL.ts";
|
|
23
|
+
import "../../chunk-CIWWFQHL.ts";
|
|
24
|
+
import "../../chunk-OO67EO5E.ts";
|
|
25
|
+
import "../../chunk-PFLSBTJA.ts";
|
|
26
|
+
import "../../chunk-ULI5WWRR.ts";
|
|
27
|
+
import "../../chunk-W6DOJA4W.ts";
|
|
23
28
|
import "../../chunk-7WGYG73V.ts";
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-XHKPWT3G.ts";
|
|
30
|
-
import "../../chunk-JIPNTA56.ts";
|
|
31
|
-
import "../../chunk-HGW4YHAY.ts";
|
|
29
|
+
import "../../chunk-MSE7X5YG.ts";
|
|
30
|
+
import "../../chunk-4X2DS5BR.ts";
|
|
31
|
+
import "../../chunk-QJ26GEUM.ts";
|
|
32
|
+
import "../../chunk-TM36NO3C.ts";
|
|
33
|
+
import "../../chunk-3K4C4SVG.ts";
|
|
32
34
|
import "../../chunk-32O3ODZE.ts";
|
|
33
35
|
export {
|
|
34
36
|
IssueSeverity,
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
resultMatchesSchema,
|
|
6
6
|
standardValidatorSchema,
|
|
7
7
|
validateSchemaValue
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-W6DOJA4W.ts";
|
|
9
9
|
import "../../chunk-7WGYG73V.ts";
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-4X2DS5BR.ts";
|
|
11
|
+
import "../../chunk-TM36NO3C.ts";
|
|
12
|
+
import "../../chunk-3K4C4SVG.ts";
|
|
13
13
|
import "../../chunk-32O3ODZE.ts";
|
|
14
14
|
export {
|
|
15
15
|
SchemaIo,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
messageOf,
|
|
16
16
|
optionalValueSchema,
|
|
17
17
|
stringOrNull
|
|
18
|
-
} from "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
} from "../../chunk-TM36NO3C.ts";
|
|
19
|
+
import "../../chunk-3K4C4SVG.ts";
|
|
20
20
|
import "../../chunk-32O3ODZE.ts";
|
|
21
21
|
export {
|
|
22
22
|
authoredRecordSchema,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ApprovalPolicyIface } from "./approval.mjs";
|
|
2
|
+
import { type DynamicSentinelIface } from "./dynamic.mjs";
|
|
2
3
|
export type McpConnectionAuthIface = {
|
|
3
4
|
readonly secretKey: string;
|
|
4
5
|
readonly headerName: string | null;
|
|
@@ -21,3 +22,7 @@ export interface McpClientConnectionDefinitionIface {
|
|
|
21
22
|
readonly instanceKey?: string;
|
|
22
23
|
}
|
|
23
24
|
export declare const defineMcpClientConnection: <TConnection extends McpClientConnectionDefinitionIface>(definition: TConnection) => TConnection;
|
|
25
|
+
export interface HostedConnectionDefinitionIface extends Omit<McpClientConnectionDefinitionIface, 'url' | 'auth' | 'headers' | 'protocolVersionDiscovery' | 'instanceKey'> {
|
|
26
|
+
readonly binding: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const defineHostedConnection: (definition: HostedConnectionDefinitionIface) => DynamicSentinelIface<McpClientConnectionDefinitionIface>;
|
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
import { AuthoredKind, stamp } from "./brand.mjs";
|
|
2
|
+
import { jsonObjectSchema, mcpAuthSchema, requireHostedBinding } from "@finalai/agent-provider";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
import { defineDynamic } from "./dynamic.mjs";
|
|
2
5
|
const defineMcpClientConnection = (definition) => stamp({ ...definition }, AuthoredKind.Connection);
|
|
6
|
+
const hostedConnectionSchema = z.strictObject({
|
|
7
|
+
url: z.string().url(),
|
|
8
|
+
auth: mcpAuthSchema.nullable().optional(),
|
|
9
|
+
headers: z.record(z.string(), z.string()).optional()
|
|
10
|
+
});
|
|
11
|
+
const defineHostedConnection = (definition) => {
|
|
12
|
+
const { binding, description, tools, approval } = definition;
|
|
13
|
+
if (binding.trim().length === 0) throw new Error("Hosted connection binding must not be empty");
|
|
14
|
+
return defineDynamic({
|
|
15
|
+
description: definition.description ?? `Hosted connection ${binding}`,
|
|
16
|
+
preview: `Resolved by hosting from ${binding}`,
|
|
17
|
+
requiredBindings: [
|
|
18
|
+
{ name: binding, schema: jsonObjectSchema.parse(z.toJSONSchema(hostedConnectionSchema)) }
|
|
19
|
+
],
|
|
20
|
+
events: {
|
|
21
|
+
"session.started": async (_event, ctx) => {
|
|
22
|
+
const value = await requireHostedBinding({ bindings: ctx.bindings, name: binding });
|
|
23
|
+
const parsed = hostedConnectionSchema.safeParse(value);
|
|
24
|
+
if (!parsed.success)
|
|
25
|
+
throw new Error(`Hosted connection ${binding} has invalid configuration`);
|
|
26
|
+
const { auth, ...transport } = parsed.data;
|
|
27
|
+
return defineMcpClientConnection({
|
|
28
|
+
...transport,
|
|
29
|
+
description,
|
|
30
|
+
tools,
|
|
31
|
+
approval,
|
|
32
|
+
...auth == null ? {} : { auth }
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
3
38
|
export {
|
|
39
|
+
defineHostedConnection,
|
|
4
40
|
defineMcpClientConnection
|
|
5
41
|
};
|
|
6
42
|
//# sourceMappingURL=connections.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/authoring/connections.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ApprovalPolicyIface } from \"./approval.mjs\";\nimport { AuthoredKind, stamp } from \"./brand.mjs\";\n\n// An MCP connection. Secrets are references by\n// name: the MCP host injects them, so they never reach the harness. Final's\n// own MCP server is an ordinary connection with `auth: { kind: 'final-session' }`.\n\nexport type McpConnectionAuthIface =\n // Sent as `Authorization: Bearer <secret>` when headerName is null.\n | { readonly secretKey: string; readonly headerName: string | null }\n | { readonly kind: 'final-session' };\n\nexport interface McpConnectionToolsIface {\n // Only these tools are exposed; omit to expose every tool the server lists.\n readonly allow?: readonly string[];\n // These tools are hidden, whatever `allow` says.\n readonly deny?: readonly string[];\n // Per-tool approval; tools not listed use the connection's `approval`.\n readonly approval?: Readonly<Record<string, ApprovalPolicyIface<never>>>;\n}\n\nexport interface McpClientConnectionDefinitionIface {\n readonly url: string;\n readonly description?: string;\n readonly auth?: McpConnectionAuthIface;\n readonly headers?: Readonly<Record<string, string>>;\n readonly tools?: McpConnectionToolsIface;\n // Default approval for every tool of this connection.\n readonly approval?: ApprovalPolicyIface<never>;\n readonly protocolVersionDiscovery?: boolean;\n readonly instanceKey?: string;\n}\n\nexport const defineMcpClientConnection = <TConnection extends McpClientConnectionDefinitionIface>(\n definition: TConnection,\n): TConnection => stamp({ ...definition }, AuthoredKind.Connection);\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,cAAc,aAAa;
|
|
4
|
+
"sourcesContent": ["import type { ApprovalPolicyIface } from \"./approval.mjs\";\nimport { AuthoredKind, stamp } from \"./brand.mjs\";\nimport { jsonObjectSchema, mcpAuthSchema, requireHostedBinding } from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport { defineDynamic, type DynamicSentinelIface } from \"./dynamic.mjs\";\n\n// An MCP connection. Secrets are references by\n// name: the MCP host injects them, so they never reach the harness. Final's\n// own MCP server is an ordinary connection with `auth: { kind: 'final-session' }`.\n\nexport type McpConnectionAuthIface =\n // Sent as `Authorization: Bearer <secret>` when headerName is null.\n | { readonly secretKey: string; readonly headerName: string | null }\n | { readonly kind: 'final-session' };\n\nexport interface McpConnectionToolsIface {\n // Only these tools are exposed; omit to expose every tool the server lists.\n readonly allow?: readonly string[];\n // These tools are hidden, whatever `allow` says.\n readonly deny?: readonly string[];\n // Per-tool approval; tools not listed use the connection's `approval`.\n readonly approval?: Readonly<Record<string, ApprovalPolicyIface<never>>>;\n}\n\nexport interface McpClientConnectionDefinitionIface {\n readonly url: string;\n readonly description?: string;\n readonly auth?: McpConnectionAuthIface;\n readonly headers?: Readonly<Record<string, string>>;\n readonly tools?: McpConnectionToolsIface;\n // Default approval for every tool of this connection.\n readonly approval?: ApprovalPolicyIface<never>;\n readonly protocolVersionDiscovery?: boolean;\n readonly instanceKey?: string;\n}\n\nexport const defineMcpClientConnection = <TConnection extends McpClientConnectionDefinitionIface>(\n definition: TConnection,\n): TConnection => stamp({ ...definition }, AuthoredKind.Connection);\n\nexport interface HostedConnectionDefinitionIface extends Omit<\n McpClientConnectionDefinitionIface,\n 'url' | 'auth' | 'headers' | 'protocolVersionDiscovery' | 'instanceKey'\n> {\n readonly binding: string;\n}\n\nconst hostedConnectionSchema = z.strictObject({\n url: z.string().url(),\n auth: mcpAuthSchema.nullable().optional(),\n headers: z.record(z.string(), z.string()).optional(),\n});\n\n// Built-in and third-party bindings use the ordinary dynamic connection path.\nexport const defineHostedConnection = (\n definition: HostedConnectionDefinitionIface,\n): DynamicSentinelIface<McpClientConnectionDefinitionIface> => {\n const { binding, description, tools, approval } = definition;\n if (binding.trim().length === 0) throw new Error('Hosted connection binding must not be empty');\n return defineDynamic({\n description: definition.description ?? `Hosted connection ${binding}`,\n preview: `Resolved by hosting from ${binding}`,\n requiredBindings: [\n { name: binding, schema: jsonObjectSchema.parse(z.toJSONSchema(hostedConnectionSchema)) },\n ],\n events: {\n 'session.started': async (_event, ctx) => {\n const value = await requireHostedBinding({ bindings: ctx.bindings, name: binding });\n const parsed = hostedConnectionSchema.safeParse(value);\n if (!parsed.success)\n throw new Error(`Hosted connection ${binding} has invalid configuration`);\n const { auth, ...transport } = parsed.data;\n return defineMcpClientConnection({\n ...transport,\n description,\n tools,\n approval,\n ...(auth == null ? {} : { auth }),\n });\n },\n },\n });\n};\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,cAAc,aAAa;AACpC,SAAS,kBAAkB,eAAe,4BAA4B;AACtE,YAAY,OAAO;AACnB,SAAS,qBAAgD;AAgClD,MAAM,4BAA4B,CACvC,eACgB,MAAM,EAAE,GAAG,WAAW,GAAG,aAAa,UAAU;AASlE,MAAM,yBAAyB,EAAE,aAAa;AAAA,EAC5C,KAAK,EAAE,OAAO,EAAE,IAAI;AAAA,EACpB,MAAM,cAAc,SAAS,EAAE,SAAS;AAAA,EACxC,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,SAAS;AACrD,CAAC;AAGM,MAAM,yBAAyB,CACpC,eAC6D;AAC7D,QAAM,EAAE,SAAS,aAAa,OAAO,SAAS,IAAI;AAClD,MAAI,QAAQ,KAAK,EAAE,WAAW,EAAG,OAAM,IAAI,MAAM,6CAA6C;AAC9F,SAAO,cAAc;AAAA,IACnB,aAAa,WAAW,eAAe,qBAAqB,OAAO;AAAA,IACnE,SAAS,4BAA4B,OAAO;AAAA,IAC5C,kBAAkB;AAAA,MAChB,EAAE,MAAM,SAAS,QAAQ,iBAAiB,MAAM,EAAE,aAAa,sBAAsB,CAAC,EAAE;AAAA,IAC1F;AAAA,IACA,QAAQ;AAAA,MACN,mBAAmB,OAAO,QAAQ,QAAQ;AACxC,cAAM,QAAQ,MAAM,qBAAqB,EAAE,UAAU,IAAI,UAAU,MAAM,QAAQ,CAAC;AAClF,cAAM,SAAS,uBAAuB,UAAU,KAAK;AACrD,YAAI,CAAC,OAAO;AACV,gBAAM,IAAI,MAAM,qBAAqB,OAAO,4BAA4B;AAC1E,cAAM,EAAE,MAAM,GAAG,UAAU,IAAI,OAAO;AACtC,eAAO,0BAA0B;AAAA,UAC/B,GAAG;AAAA,UACH;AAAA,UACA;AAAA,UACA;AAAA,UACA,GAAI,QAAQ,OAAO,CAAC,IAAI,EAAE,KAAK;AAAA,QACjC,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConversationMessageIface } from '@finalai/agent-protocol/agent-platform';
|
|
2
|
-
import type { ConversationKind, JsonObject, JsonValue, NetworkSandboxSessionIface, ParticipantKind, ProviderRef } from '@finalai/agent-provider';
|
|
2
|
+
import type { ConversationKind, HostedBindingsIface, JsonObject, JsonValue, NetworkSandboxSessionIface, ParticipantKind, ProviderRef } from '@finalai/agent-provider';
|
|
3
3
|
export interface ParticipantInfoIface {
|
|
4
4
|
id: string;
|
|
5
5
|
kind: ParticipantKind;
|
|
@@ -63,6 +63,7 @@ export interface FinalPlatformClientIface {
|
|
|
63
63
|
}): Promise<ConversationMessageIface[]>;
|
|
64
64
|
}
|
|
65
65
|
export interface ToolContextIface {
|
|
66
|
+
readonly bindings?: HostedBindingsIface;
|
|
66
67
|
readonly session: AgentSessionInfoIface;
|
|
67
68
|
readonly callId: string;
|
|
68
69
|
readonly toolName: string;
|
|
@@ -73,6 +74,7 @@ export interface ToolContextIface {
|
|
|
73
74
|
readonly final: FinalPlatformClientIface;
|
|
74
75
|
}
|
|
75
76
|
export interface DynamicResolveContextIface {
|
|
77
|
+
readonly bindings?: HostedBindingsIface;
|
|
76
78
|
readonly previousValue?: JsonValue | null;
|
|
77
79
|
readonly session: AgentSessionInfoIface;
|
|
78
80
|
readonly messages: readonly TranscriptMessageIface[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/authoring/context.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ConversationMessageIface } from '@finalai/agent-protocol/agent-platform';\nimport type {\n ConversationKind,\n JsonObject,\n JsonValue,\n NetworkSandboxSessionIface,\n ParticipantKind,\n ProviderRef,\n} from '@finalai/agent-provider';\n\n// What authored code (tools, hooks, dynamic resolvers, channel routes) sees of\n// the session it runs for. Everything is provided by\n// the session service through the Worker isolate; none of it is harness state.\n//\n// Ids are the public API's wire ids (`<prefix>_<base58>`), the same strings the\n// client SDK and `/api/v1` return: a session is `ases_\u2026`, a conversation\n// `conv_\u2026`, a participant `cpart_\u2026`, a turn `atrn_\u2026`, a user `usr_\u2026`. Pass them\n// back unchanged (`ctx.final.post({ conversationId })`, channel platform\n// calls); raw UUIDs are refused. ACP ids (`toolCallId`, prompt message ids)\n// and provider or model ids are passed through as the harness sent them.\n\nexport interface ParticipantInfoIface {\n // `cpart_\u2026`; `userId` is `usr_\u2026`.\n id: string;\n kind: ParticipantKind;\n displayName: string;\n userId: string | null;\n}\n\nexport interface ConversationInfoIface {\n // `conv_\u2026`, as `client` and `/api/v1/conversations` name it.\n id: string;\n kind: ConversationKind;\n title: string | null;\n metadata: JsonObject;\n participants: ParticipantInfoIface[];\n}\n\nexport interface PromptAuthorIface {\n participantId: string | null;\n userId: string | null;\n displayName: string;\n}\n\nexport interface AgentSessionInfoIface {\n // `ases_\u2026`: what `client.sessions.attach(id)` takes.\n id: string;\n // `org_\u2026`.\n organizationId: string;\n // The agent (`adef_\u2026`) and its published revision (`arev_\u2026`).\n definitionId: string;\n revisionId: string;\n conversation: ConversationInfoIface | null;\n // Who prompted the current turn; null outside a turn and for system input.\n author: PromptAuthorIface | null;\n // `atrn_\u2026`.\n turn: { id: string } | null;\n harness: ProviderRef;\n}\n\nexport enum TranscriptRole {\n User = 'user',\n Assistant = 'assistant',\n Tool = 'tool',\n Thought = 'thought',\n Summary = 'summary',\n}\n\n// One entry of the transcript rebuilt from the session's ACP log. Not the\n// harness's byte-exact model input (no system prompt).\nexport interface TranscriptMessageIface {\n role: TranscriptRole;\n // ACP content blocks.\n content: JsonValue[];\n toolCallId: string | null;\n seq: number;\n}\n\nexport interface SecretsIface {\n get(name: string): Promise<string | null>;\n}\n\nexport interface PostMessageInputIface {\n text?: string;\n // ACP content blocks; appended after `text` when both are given.\n content?: JsonValue[];\n // A `conv_\u2026` id; defaults to the session's conversation.\n conversationId?: string;\n}\n\n// The agent-platform client handed to authored code (a Final addition).\nexport interface FinalPlatformClientIface {\n // Resolves the posted message's `cnmsg_\u2026` id.\n post(input: PostMessageInputIface): Promise<{ messageId: string }>;\n conversation(): Promise<ConversationInfoIface | null>;\n // The current conversation's visible history, oldest first within the page.\n // `before` is a cnmsg_\u2026 id; other conversations are refused by the platform.\n read(options?: {\n conversationId?: string;\n limit?: number;\n before?: string;\n }): Promise<ConversationMessageIface[]>;\n}\n\nexport interface ToolContextIface {\n readonly session: AgentSessionInfoIface;\n // The MCP request id the harness chose; shows up as the ACP toolCallId.\n readonly callId: string;\n // Qualified name as the harness saw it.\n readonly toolName: string;\n readonly abortSignal: AbortSignal;\n // The same handle the sandbox MCP server uses; the first call starts the\n // sandbox. Defaults to the definition's default target.\n getSandbox(target?: string): Promise<NetworkSandboxSessionIface>;\n readonly messages: readonly TranscriptMessageIface[];\n readonly secrets: SecretsIface;\n readonly final: FinalPlatformClientIface;\n}\n\nexport interface DynamicResolveContextIface {\n // The persisted value of this slot at its previous lifecycle boundary.\n readonly previousValue?: JsonValue | null;\n readonly session: AgentSessionInfoIface;\n // The transcript at the boundary (empty at session.started for a new session).\n readonly messages: readonly TranscriptMessageIface[];\n readonly channel: { kind: string | null };\n readonly secrets: SecretsIface;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { ConversationMessageIface } from '@finalai/agent-protocol/agent-platform';\nimport type {\n ConversationKind,\n HostedBindingsIface,\n JsonObject,\n JsonValue,\n NetworkSandboxSessionIface,\n ParticipantKind,\n ProviderRef,\n} from '@finalai/agent-provider';\n\n// What authored code (tools, hooks, dynamic resolvers, channel routes) sees of\n// the session it runs for. Everything is provided by\n// the session service through the Worker isolate; none of it is harness state.\n//\n// Ids are the public API's wire ids (`<prefix>_<base58>`), the same strings the\n// client SDK and `/api/v1` return: a session is `ases_\u2026`, a conversation\n// `conv_\u2026`, a participant `cpart_\u2026`, a turn `atrn_\u2026`, a user `usr_\u2026`. Pass them\n// back unchanged (`ctx.final.post({ conversationId })`, channel platform\n// calls); raw UUIDs are refused. ACP ids (`toolCallId`, prompt message ids)\n// and provider or model ids are passed through as the harness sent them.\n\nexport interface ParticipantInfoIface {\n // `cpart_\u2026`; `userId` is `usr_\u2026`.\n id: string;\n kind: ParticipantKind;\n displayName: string;\n userId: string | null;\n}\n\nexport interface ConversationInfoIface {\n // `conv_\u2026`, as `client` and `/api/v1/conversations` name it.\n id: string;\n kind: ConversationKind;\n title: string | null;\n metadata: JsonObject;\n participants: ParticipantInfoIface[];\n}\n\nexport interface PromptAuthorIface {\n participantId: string | null;\n userId: string | null;\n displayName: string;\n}\n\nexport interface AgentSessionInfoIface {\n // `ases_\u2026`: what `client.sessions.attach(id)` takes.\n id: string;\n // `org_\u2026`.\n organizationId: string;\n // The agent (`adef_\u2026`) and its published revision (`arev_\u2026`).\n definitionId: string;\n revisionId: string;\n conversation: ConversationInfoIface | null;\n // Who prompted the current turn; null outside a turn and for system input.\n author: PromptAuthorIface | null;\n // `atrn_\u2026`.\n turn: { id: string } | null;\n harness: ProviderRef;\n}\n\nexport enum TranscriptRole {\n User = 'user',\n Assistant = 'assistant',\n Tool = 'tool',\n Thought = 'thought',\n Summary = 'summary',\n}\n\n// One entry of the transcript rebuilt from the session's ACP log. Not the\n// harness's byte-exact model input (no system prompt).\nexport interface TranscriptMessageIface {\n role: TranscriptRole;\n // ACP content blocks.\n content: JsonValue[];\n toolCallId: string | null;\n seq: number;\n}\n\nexport interface SecretsIface {\n get(name: string): Promise<string | null>;\n}\n\nexport interface PostMessageInputIface {\n text?: string;\n // ACP content blocks; appended after `text` when both are given.\n content?: JsonValue[];\n // A `conv_\u2026` id; defaults to the session's conversation.\n conversationId?: string;\n}\n\n// The agent-platform client handed to authored code (a Final addition).\nexport interface FinalPlatformClientIface {\n // Resolves the posted message's `cnmsg_\u2026` id.\n post(input: PostMessageInputIface): Promise<{ messageId: string }>;\n conversation(): Promise<ConversationInfoIface | null>;\n // The current conversation's visible history, oldest first within the page.\n // `before` is a cnmsg_\u2026 id; other conversations are refused by the platform.\n read(options?: {\n conversationId?: string;\n limit?: number;\n before?: string;\n }): Promise<ConversationMessageIface[]>;\n}\n\nexport interface ToolContextIface {\n readonly bindings?: HostedBindingsIface;\n readonly session: AgentSessionInfoIface;\n // The MCP request id the harness chose; shows up as the ACP toolCallId.\n readonly callId: string;\n // Qualified name as the harness saw it.\n readonly toolName: string;\n readonly abortSignal: AbortSignal;\n // The same handle the sandbox MCP server uses; the first call starts the\n // sandbox. Defaults to the definition's default target.\n getSandbox(target?: string): Promise<NetworkSandboxSessionIface>;\n readonly messages: readonly TranscriptMessageIface[];\n readonly secrets: SecretsIface;\n readonly final: FinalPlatformClientIface;\n}\n\nexport interface DynamicResolveContextIface {\n readonly bindings?: HostedBindingsIface;\n // The persisted value of this slot at its previous lifecycle boundary.\n readonly previousValue?: JsonValue | null;\n readonly session: AgentSessionInfoIface;\n // The transcript at the boundary (empty at session.started for a new session).\n readonly messages: readonly TranscriptMessageIface[];\n readonly channel: { kind: string | null };\n readonly secrets: SecretsIface;\n}\n"],
|
|
5
|
+
"mappings": "AA6DO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,UAAO;AACP,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,UAAO;AACP,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,aAAU;AALA,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["TranscriptRole"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ProviderRef } from '@finalai/agent-provider';
|
|
1
|
+
import type { HostedBindingRequirementIface, ProviderRef } from '@finalai/agent-provider';
|
|
2
2
|
import type { DynamicResolveContextIface } from "./context.mjs";
|
|
3
3
|
export type DynamicHandler<TResult> = (event: DynamicBoundaryEventIface, ctx: DynamicResolveContextIface) => TResult | Promise<TResult>;
|
|
4
4
|
export interface DynamicBoundaryEventIface {
|
|
@@ -19,6 +19,7 @@ export interface DynamicDefinitionIface<TResult> {
|
|
|
19
19
|
readonly description?: string;
|
|
20
20
|
readonly preview?: string;
|
|
21
21
|
readonly provider?: DynamicProviderHint;
|
|
22
|
+
readonly requiredBindings?: readonly HostedBindingRequirementIface[];
|
|
22
23
|
}
|
|
23
24
|
export interface DynamicSentinelIface<TResult = unknown> {
|
|
24
25
|
readonly kind: 'final:dynamic';
|
|
@@ -26,5 +27,6 @@ export interface DynamicSentinelIface<TResult = unknown> {
|
|
|
26
27
|
readonly description?: string;
|
|
27
28
|
readonly preview?: string;
|
|
28
29
|
readonly provider?: DynamicProviderHint;
|
|
30
|
+
readonly requiredBindings?: readonly HostedBindingRequirementIface[];
|
|
29
31
|
}
|
|
30
32
|
export declare const defineDynamic: <TResult>(definition: DynamicDefinitionIface<TResult>) => DynamicSentinelIface<TResult>;
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { AuthoredKind, stamp } from "./brand.mjs";
|
|
2
|
+
import { validateHostedBindingRequirements } from "../hosted-bindings.mjs";
|
|
2
3
|
const defineDynamic = (definition) => {
|
|
4
|
+
const checked = (handler) => {
|
|
5
|
+
if (handler == null || (definition.requiredBindings?.length ?? 0) === 0) return handler;
|
|
6
|
+
return async (event, ctx) => {
|
|
7
|
+
await validateHostedBindingRequirements({
|
|
8
|
+
requirements: definition.requiredBindings ?? [],
|
|
9
|
+
bindings: ctx.bindings
|
|
10
|
+
});
|
|
11
|
+
const result = await handler(event, ctx);
|
|
12
|
+
if (result == null) throw new Error("Required hosted binding resolver returned no value");
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
3
16
|
const sentinel = {
|
|
4
17
|
kind: "final:dynamic",
|
|
5
|
-
events:
|
|
18
|
+
events: {
|
|
19
|
+
...definition.events,
|
|
20
|
+
"session.started": checked(definition.events["session.started"]),
|
|
21
|
+
"turn.started": checked(definition.events["turn.started"])
|
|
22
|
+
}
|
|
6
23
|
};
|
|
7
24
|
if (definition.description != null) sentinel.description = definition.description;
|
|
8
25
|
if (definition.preview != null) sentinel.preview = definition.preview;
|
|
9
26
|
if (definition.provider != null) sentinel.provider = definition.provider;
|
|
27
|
+
if (definition.requiredBindings != null) sentinel.requiredBindings = definition.requiredBindings;
|
|
10
28
|
return stamp(sentinel, AuthoredKind.Dynamic);
|
|
11
29
|
};
|
|
12
30
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/authoring/dynamic.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ProviderRef } from '@finalai/agent-provider';\nimport { AuthoredKind, stamp } from \"./brand.mjs\";\nimport type { DynamicResolveContextIface } from \"./context.mjs\";\n\n// defineDynamic: a definition computed at a lifecycle\n// boundary. The directory a file sits in decides what a handler must return.\n// `description` and `preview` are Final additions so Build can render a slot\n// without resolving it.\n\nexport type DynamicHandler<TResult> = (\n event: DynamicBoundaryEventIface,\n ctx: DynamicResolveContextIface,\n) => TResult | Promise<TResult>;\n\nexport interface DynamicBoundaryEventIface {\n type: 'session.started' | 'turn.started';\n // The prompt that started the turn (turn.started only), as ACP content blocks.\n prompt: unknown[] | null;\n}\n\nexport interface DynamicEventsIface<TResult> {\n readonly 'session.started'?: DynamicHandler<TResult>;\n readonly 'turn.started'?: DynamicHandler<TResult>;\n}\n\n// A sandbox target whose environment is dynamic still needs its provider at\n// compile time: an installed provider helper, a provider defined with\n// defineSandboxProvider, or a provider reference.\nexport type DynamicProviderHint =\n | ProviderRef\n | { readonly name: string }\n | { readonly providerRef: ProviderRef };\n\nexport interface DynamicDefinitionIface<TResult> {\n readonly events: DynamicEventsIface<TResult>;\n readonly description?: string;\n readonly preview?: string;\n readonly provider?: DynamicProviderHint;\n}\n\nexport interface DynamicSentinelIface<TResult = unknown> {\n readonly kind: 'final:dynamic';\n readonly events: DynamicEventsIface<TResult>;\n readonly description?: string;\n readonly preview?: string;\n readonly provider?: DynamicProviderHint;\n}\n\ninterface DynamicSentinelFieldsIface<TResult> {\n kind: 'final:dynamic';\n events: DynamicEventsIface<TResult>;\n description?: string;\n preview?: string;\n provider?: DynamicProviderHint;\n}\n\nexport const defineDynamic = <TResult>(\n definition: DynamicDefinitionIface<TResult>,\n): DynamicSentinelIface<TResult> => {\n const sentinel: DynamicSentinelFieldsIface<TResult> = {\n kind: 'final:dynamic',\n events: definition.events,\n };\n if (definition.description != null) sentinel.description = definition.description;\n if (definition.preview != null) sentinel.preview = definition.preview;\n if (definition.provider != null) sentinel.provider = definition.provider;\n return stamp(sentinel, AuthoredKind.Dynamic);\n};\n"],
|
|
5
|
-
"mappings": "AACA,SAAS,cAAc,aAAa;
|
|
4
|
+
"sourcesContent": ["import type { HostedBindingRequirementIface, ProviderRef } from '@finalai/agent-provider';\nimport { AuthoredKind, stamp } from \"./brand.mjs\";\nimport { validateHostedBindingRequirements } from \"../hosted-bindings.mjs\";\nimport type { DynamicResolveContextIface } from \"./context.mjs\";\n\n// defineDynamic: a definition computed at a lifecycle\n// boundary. The directory a file sits in decides what a handler must return.\n// `description` and `preview` are Final additions so Build can render a slot\n// without resolving it.\n\nexport type DynamicHandler<TResult> = (\n event: DynamicBoundaryEventIface,\n ctx: DynamicResolveContextIface,\n) => TResult | Promise<TResult>;\n\nexport interface DynamicBoundaryEventIface {\n type: 'session.started' | 'turn.started';\n // The prompt that started the turn (turn.started only), as ACP content blocks.\n prompt: unknown[] | null;\n}\n\nexport interface DynamicEventsIface<TResult> {\n readonly 'session.started'?: DynamicHandler<TResult>;\n readonly 'turn.started'?: DynamicHandler<TResult>;\n}\n\n// A sandbox target whose environment is dynamic still needs its provider at\n// compile time: an installed provider helper, a provider defined with\n// defineSandboxProvider, or a provider reference.\nexport type DynamicProviderHint =\n | ProviderRef\n | { readonly name: string }\n | { readonly providerRef: ProviderRef };\n\nexport interface DynamicDefinitionIface<TResult> {\n readonly events: DynamicEventsIface<TResult>;\n readonly description?: string;\n readonly preview?: string;\n readonly provider?: DynamicProviderHint;\n readonly requiredBindings?: readonly HostedBindingRequirementIface[];\n}\n\nexport interface DynamicSentinelIface<TResult = unknown> {\n readonly kind: 'final:dynamic';\n readonly events: DynamicEventsIface<TResult>;\n readonly description?: string;\n readonly preview?: string;\n readonly provider?: DynamicProviderHint;\n readonly requiredBindings?: readonly HostedBindingRequirementIface[];\n}\n\ninterface DynamicSentinelFieldsIface<TResult> {\n kind: 'final:dynamic';\n events: DynamicEventsIface<TResult>;\n description?: string;\n preview?: string;\n provider?: DynamicProviderHint;\n requiredBindings?: readonly HostedBindingRequirementIface[];\n}\n\nexport const defineDynamic = <TResult>(\n definition: DynamicDefinitionIface<TResult>,\n): DynamicSentinelIface<TResult> => {\n const checked = (\n handler: DynamicHandler<TResult> | undefined,\n ): DynamicHandler<TResult> | undefined => {\n if (handler == null || (definition.requiredBindings?.length ?? 0) === 0) return handler;\n return async (event, ctx) => {\n await validateHostedBindingRequirements({\n requirements: definition.requiredBindings ?? [],\n bindings: ctx.bindings,\n });\n const result = await handler(event, ctx);\n if (result == null) throw new Error('Required hosted binding resolver returned no value');\n return result;\n };\n };\n const sentinel: DynamicSentinelFieldsIface<TResult> = {\n kind: 'final:dynamic',\n events: {\n ...definition.events,\n 'session.started': checked(definition.events['session.started']),\n 'turn.started': checked(definition.events['turn.started']),\n },\n };\n if (definition.description != null) sentinel.description = definition.description;\n if (definition.preview != null) sentinel.preview = definition.preview;\n if (definition.provider != null) sentinel.provider = definition.provider;\n if (definition.requiredBindings != null) sentinel.requiredBindings = definition.requiredBindings;\n return stamp(sentinel, AuthoredKind.Dynamic);\n};\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,cAAc,aAAa;AACpC,SAAS,yCAAyC;AA0D3C,MAAM,gBAAgB,CAC3B,eACkC;AAClC,QAAM,UAAU,CACd,YACwC;AACxC,QAAI,WAAW,SAAS,WAAW,kBAAkB,UAAU,OAAO,EAAG,QAAO;AAChF,WAAO,OAAO,OAAO,QAAQ;AAC3B,YAAM,kCAAkC;AAAA,QACtC,cAAc,WAAW,oBAAoB,CAAC;AAAA,QAC9C,UAAU,IAAI;AAAA,MAChB,CAAC;AACD,YAAM,SAAS,MAAM,QAAQ,OAAO,GAAG;AACvC,UAAI,UAAU,KAAM,OAAM,IAAI,MAAM,oDAAoD;AACxF,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,WAAgD;AAAA,IACpD,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,GAAG,WAAW;AAAA,MACd,mBAAmB,QAAQ,WAAW,OAAO,iBAAiB,CAAC;AAAA,MAC/D,gBAAgB,QAAQ,WAAW,OAAO,cAAc,CAAC;AAAA,IAC3D;AAAA,EACF;AACA,MAAI,WAAW,eAAe,KAAM,UAAS,cAAc,WAAW;AACtE,MAAI,WAAW,WAAW,KAAM,UAAS,UAAU,WAAW;AAC9D,MAAI,WAAW,YAAY,KAAM,UAAS,WAAW,WAAW;AAChE,MAAI,WAAW,oBAAoB,KAAM,UAAS,mBAAmB,WAAW;AAChF,SAAO,MAAM,UAAU,aAAa,OAAO;AAC7C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsonValue, NetworkSandboxSessionIface } from '@finalai/agent-provider';
|
|
1
|
+
import type { HostedBindingsIface, JsonValue, NetworkSandboxSessionIface } from '@finalai/agent-provider';
|
|
2
2
|
import { type AuthoredValue } from "../runtime/values.mjs";
|
|
3
3
|
import type { AgentSessionInfoIface, FinalPlatformClientIface, SecretsIface, TranscriptMessageIface } from "./context.mjs";
|
|
4
4
|
import type { ToolCallEventDataIface } from "./tools.mjs";
|
|
@@ -101,6 +101,7 @@ export interface HookContextIface {
|
|
|
101
101
|
getSandbox(target?: string): Promise<NetworkSandboxSessionIface>;
|
|
102
102
|
cancel(): void;
|
|
103
103
|
readonly secrets: SecretsIface;
|
|
104
|
+
readonly bindings?: HostedBindingsIface;
|
|
104
105
|
readonly final: FinalPlatformClientIface;
|
|
105
106
|
}
|
|
106
107
|
export type HookHandler<TKey extends string> = (event: HookEventFor<TKey>, ctx: HookContextIface) => void | Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/authoring/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import type {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type {\n HostedBindingsIface,\n JsonValue,\n NetworkSandboxSessionIface,\n} from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport { authoredRecordSchema, isCallable, type AuthoredValue } from \"../runtime/values.mjs\";\nimport { AuthoredKind, stamp } from \"./brand.mjs\";\nimport type {\n AgentSessionInfoIface,\n FinalPlatformClientIface,\n SecretsIface,\n TranscriptMessageIface,\n} from \"./context.mjs\";\nimport type { ToolCallEventDataIface } from \"./tools.mjs\";\n\nexport { toolResultFrom } from \"./tools.mjs\";\n\n// Observe-only subscribers to the session's ACP log. Event\n// names are ACP update kinds and request methods plus a few session-service\n// lifecycle events. Only these canonical names are accepted.\n\nexport enum HookEvent {\n SessionOpened = 'session.opened',\n TurnStarted = 'turn.started',\n TurnEnded = 'turn.ended',\n UserMessageChunk = 'user_message_chunk',\n AgentMessageChunk = 'agent_message_chunk',\n AgentMessage = 'agent_message',\n AgentThoughtChunk = 'agent_thought_chunk',\n ToolCall = 'tool_call',\n ToolCallUpdate = 'tool_call_update',\n ToolCallContentChunk = 'tool_call_content_chunk',\n Plan = 'plan',\n PendingCreated = 'pending.created',\n PendingResolved = 'pending.resolved',\n StateUpdate = 'state_update',\n SessionFailed = 'session.failed',\n SessionClosed = 'session.closed',\n CompactionUpdate = 'compaction_update',\n UsageUpdate = 'usage_update',\n AvailableCommandsUpdate = 'available_commands_update',\n CurrentModeUpdate = 'current_mode_update',\n ConfigOptionUpdate = 'config_option_update',\n SessionInfoUpdate = 'session_info_update',\n Notice = 'notice',\n}\n\nexport const HOOK_WILDCARD = '*';\n\nconst CANONICAL_EVENTS: ReadonlySet<string> = new Set(Object.values(HookEvent));\n\nexport enum HookEventKeyKind {\n Canonical = 'canonical',\n Wildcard = 'wildcard',\n Unknown = 'unknown',\n}\n\nexport interface NormalizedHookKeyIface {\n key: string;\n kind: HookEventKeyKind;\n // Canonical event names this key subscribes to ('*' for the wildcard).\n events: string[];\n}\n\nexport const normalizeHookKey = (key: string): NormalizedHookKeyIface => {\n if (key === HOOK_WILDCARD)\n return { key, kind: HookEventKeyKind.Wildcard, events: [HOOK_WILDCARD] };\n if (CANONICAL_EVENTS.has(key) || key.startsWith('_final/')) {\n return { key, kind: HookEventKeyKind.Canonical, events: [key] };\n }\n return { key, kind: HookEventKeyKind.Unknown, events: [] };\n};\n\nexport interface HookEventMetaIface {\n // '<sessionId>:<seq>' with the session's wire id (`ases_\u2026:12`): sortable\n // within a session and stable across redelivery.\n id: string;\n at: string;\n seq: number;\n}\n\nexport interface HookEventIface<TType extends string = string, TData = AuthoredValue> {\n type: TType;\n data: TData;\n meta: HookEventMetaIface;\n}\n\n// Lifecycle event data names platform objects by their wire ids, as the public\n// API does: sessions `ases_\u2026`, turns `atrn_\u2026`, participants `cpart_\u2026`, pending\n// requests `apnd_\u2026`. `promptMessageId` is the harness's ACP message id. ACP\n// update events (tool_call, agent_message_chunk, \u2026) carry the ACP payload as is.\nexport interface HookEventDataMapIface {\n 'session.opened': { sessionId: string };\n 'turn.started': {\n turnId: string;\n promptMessageId: string | null;\n authorParticipantId: string | null;\n };\n 'turn.ended': { turnId: string; stopReason: string | null };\n tool_call: ToolCallEventDataIface;\n tool_call_update: ToolCallEventDataIface;\n tool_call_content_chunk: ToolCallEventDataIface;\n 'pending.created': {\n pendingId: string;\n kind: 'permission' | 'elicitation' | 'authorization';\n request: JsonValue;\n };\n 'pending.resolved': { pendingId: string; outcome: JsonValue };\n 'session.failed': { reason: string | null };\n 'session.closed': { reason: string | null };\n}\n\ntype CanonicalData<TKey extends string> = TKey extends keyof HookEventDataMapIface\n ? HookEventDataMapIface[TKey]\n : Record<string, JsonValue>;\n\nexport type HookEventKey = `${HookEvent}` | typeof HOOK_WILDCARD | `_final/${string}`;\n\nexport type HookEventFor<TKey extends string> = TKey extends typeof HOOK_WILDCARD\n ? HookEventIface\n : HookEventIface<TKey, CanonicalData<TKey>>;\n\nexport interface HookSessionInfoIface extends AgentSessionInfoIface {\n readonly messages: readonly TranscriptMessageIface[];\n}\n\nexport interface HookContextIface {\n readonly session: HookSessionInfoIface;\n readonly agent: {\n readonly definitionId: string;\n readonly name: string;\n readonly revisionId: string;\n };\n readonly channel: { readonly kind: string | null };\n getSandbox(target?: string): Promise<NetworkSandboxSessionIface>;\n // Sends session/cancel for the running turn.\n cancel(): void;\n readonly secrets: SecretsIface;\n readonly bindings?: HostedBindingsIface;\n readonly final: FinalPlatformClientIface;\n}\n\nexport type HookHandler<TKey extends string> = (\n event: HookEventFor<TKey>,\n ctx: HookContextIface,\n) => void | Promise<void>;\n\nexport type HookHandlersIface = { readonly [TKey in HookEventKey]?: HookHandler<TKey> };\n\nexport interface HookDefinitionIface {\n readonly events?: HookHandlersIface;\n}\n\nexport const defineHook = (definition: HookDefinitionIface): HookDefinitionIface =>\n stamp({ ...definition }, AuthoredKind.Hook);\n\nexport interface HookDispatchEventIface {\n type: string;\n data: AuthoredValue;\n meta: HookEventMetaIface;\n}\n\nconst keyMatches = (key: string, event: HookDispatchEventIface): boolean =>\n key === event.type && (CANONICAL_EVENTS.has(key) || key.startsWith('_final/'));\n\nexport type HookInvocable = (event: HookDispatchEventIface, ctx: HookContextIface) => AuthoredValue;\n\nconst hookEventsSchema = z.looseObject({ events: authoredRecordSchema });\n\n// Handlers for one event: typed handlers in declaration order, then the\n// wildcard.\nexport const hookHandlersFor = (\n hook: AuthoredValue,\n event: HookDispatchEventIface,\n): HookInvocable[] => {\n const parsed = hookEventsSchema.safeParse(hook);\n if (!parsed.success) return [];\n const typed: HookInvocable[] = [];\n let wildcard: HookInvocable | null = null;\n for (const [key, handler] of Object.entries(parsed.data.events)) {\n if (!isCallable(handler)) continue;\n const invoke: HookInvocable = (dispatched, ctx) => handler(dispatched, ctx);\n if (key === HOOK_WILDCARD) wildcard = invoke;\n else if (keyMatches(key, event)) typed.push(invoke);\n }\n return wildcard == null ? typed : [...typed, wildcard];\n};\n"],
|
|
5
|
+
"mappings": "AAKA,YAAY,OAAO;AACnB,SAAS,sBAAsB,kBAAsC;AACrE,SAAS,cAAc,aAAa;AASpC,SAAS,sBAAsB;AAMxB,IAAK,YAAL,kBAAKA,eAAL;AACL,EAAAA,WAAA,mBAAgB;AAChB,EAAAA,WAAA,iBAAc;AACd,EAAAA,WAAA,eAAY;AACZ,EAAAA,WAAA,sBAAmB;AACnB,EAAAA,WAAA,uBAAoB;AACpB,EAAAA,WAAA,kBAAe;AACf,EAAAA,WAAA,uBAAoB;AACpB,EAAAA,WAAA,cAAW;AACX,EAAAA,WAAA,oBAAiB;AACjB,EAAAA,WAAA,0BAAuB;AACvB,EAAAA,WAAA,UAAO;AACP,EAAAA,WAAA,oBAAiB;AACjB,EAAAA,WAAA,qBAAkB;AAClB,EAAAA,WAAA,iBAAc;AACd,EAAAA,WAAA,mBAAgB;AAChB,EAAAA,WAAA,mBAAgB;AAChB,EAAAA,WAAA,sBAAmB;AACnB,EAAAA,WAAA,iBAAc;AACd,EAAAA,WAAA,6BAA0B;AAC1B,EAAAA,WAAA,uBAAoB;AACpB,EAAAA,WAAA,wBAAqB;AACrB,EAAAA,WAAA,uBAAoB;AACpB,EAAAA,WAAA,YAAS;AAvBC,SAAAA;AAAA,GAAA;AA0BL,MAAM,gBAAgB;AAE7B,MAAM,mBAAwC,IAAI,IAAI,OAAO,OAAO,SAAS,CAAC;AAEvE,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;AAaL,MAAM,mBAAmB,CAAC,QAAwC;AACvE,MAAI,QAAQ;AACV,WAAO,EAAE,KAAK,MAAM,2BAA2B,QAAQ,CAAC,aAAa,EAAE;AACzE,MAAI,iBAAiB,IAAI,GAAG,KAAK,IAAI,WAAW,SAAS,GAAG;AAC1D,WAAO,EAAE,KAAK,MAAM,6BAA4B,QAAQ,CAAC,GAAG,EAAE;AAAA,EAChE;AACA,SAAO,EAAE,KAAK,MAAM,yBAA0B,QAAQ,CAAC,EAAE;AAC3D;AAkFO,MAAM,aAAa,CAAC,eACzB,MAAM,EAAE,GAAG,WAAW,GAAG,aAAa,IAAI;AAQ5C,MAAM,aAAa,CAAC,KAAa,UAC/B,QAAQ,MAAM,SAAS,iBAAiB,IAAI,GAAG,KAAK,IAAI,WAAW,SAAS;AAI9E,MAAM,mBAAmB,EAAE,YAAY,EAAE,QAAQ,qBAAqB,CAAC;AAIhE,MAAM,kBAAkB,CAC7B,MACA,UACoB;AACpB,QAAM,SAAS,iBAAiB,UAAU,IAAI;AAC9C,MAAI,CAAC,OAAO,QAAS,QAAO,CAAC;AAC7B,QAAM,QAAyB,CAAC;AAChC,MAAI,WAAiC;AACrC,aAAW,CAAC,KAAK,OAAO,KAAK,OAAO,QAAQ,OAAO,KAAK,MAAM,GAAG;AAC/D,QAAI,CAAC,WAAW,OAAO,EAAG;AAC1B,UAAM,SAAwB,CAAC,YAAY,QAAQ,QAAQ,YAAY,GAAG;AAC1E,QAAI,QAAQ,cAAe,YAAW;AAAA,aAC7B,WAAW,KAAK,KAAK,EAAG,OAAM,KAAK,MAAM;AAAA,EACpD;AACA,SAAO,YAAY,OAAO,QAAQ,CAAC,GAAG,OAAO,QAAQ;AACvD;",
|
|
6
6
|
"names": ["HookEvent", "HookEventKeyKind"]
|
|
7
7
|
}
|
|
@@ -4,9 +4,11 @@ export { always, never, whenInput } from "./approval.mjs";
|
|
|
4
4
|
export type { ApprovalPolicyIface } from "./approval.mjs";
|
|
5
5
|
export { DELETE, GET, POST, PUT, WS, defineChannel, defineProviderChannel, disableChannel, } from "./channels.mjs";
|
|
6
6
|
export type { AuthoredChannelDefinitionIface, RouteHandler, RouteHandlerArgsIface, } from "./channels.mjs";
|
|
7
|
-
export { defineMcpClientConnection } from "./connections.mjs";
|
|
8
|
-
export type { McpClientConnectionDefinitionIface, McpConnectionAuthIface } from "./connections.mjs";
|
|
7
|
+
export { defineHostedConnection, defineMcpClientConnection } from "./connections.mjs";
|
|
8
|
+
export type { HostedConnectionDefinitionIface, McpClientConnectionDefinitionIface, McpConnectionAuthIface, } from "./connections.mjs";
|
|
9
9
|
export * from "./context.mjs";
|
|
10
|
+
export { requireHostedBinding } from '@finalai/agent-provider';
|
|
11
|
+
export type { HostedBindingsIface } from '@finalai/agent-provider';
|
|
10
12
|
export { CredentialOwner, CredentialPayer, credentials } from "./credentials.mjs";
|
|
11
13
|
export type { CredentialNode, CredentialPolicyIface } from "./credentials.mjs";
|
|
12
14
|
export { defineDynamic } from "./dynamic.mjs";
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
defineProviderChannel,
|
|
11
11
|
disableChannel
|
|
12
12
|
} from "./channels.mjs";
|
|
13
|
-
import { defineMcpClientConnection } from "./connections.mjs";
|
|
13
|
+
import { defineHostedConnection, defineMcpClientConnection } from "./connections.mjs";
|
|
14
14
|
export * from "./context.mjs";
|
|
15
|
+
import { requireHostedBinding } from "@finalai/agent-provider";
|
|
15
16
|
import { CredentialOwner, CredentialPayer, credentials } from "./credentials.mjs";
|
|
16
17
|
import { defineDynamic } from "./dynamic.mjs";
|
|
17
18
|
import { completeHarnessDescription, defineHarness } from "./harness.mjs";
|
|
@@ -46,6 +47,7 @@ export {
|
|
|
46
47
|
defineDynamic,
|
|
47
48
|
defineHarness,
|
|
48
49
|
defineHook,
|
|
50
|
+
defineHostedConnection,
|
|
49
51
|
defineInstructions,
|
|
50
52
|
defineMcpClientConnection,
|
|
51
53
|
defineProviderChannel,
|
|
@@ -57,6 +59,7 @@ export {
|
|
|
57
59
|
disableChannel,
|
|
58
60
|
harnessHost,
|
|
59
61
|
never,
|
|
62
|
+
requireHostedBinding,
|
|
60
63
|
toolResultFrom,
|
|
61
64
|
whenInput
|
|
62
65
|
};
|