@finalai/agent-definition 0.4.3 → 0.5.1
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 +3 -3
- package/dist/compiler-assets/{chunk-6MVG5NYI.ts → chunk-4T2XPIPH.ts} +5 -5
- package/dist/compiler-assets/{chunk-JW4Y5OAP.ts → chunk-BMX2HP6G.ts} +1 -1
- package/dist/compiler-assets/{chunk-GOIK7WNT.ts → chunk-EAEQQT33.ts} +6 -3
- package/dist/compiler-assets/{chunk-ZICJVGG7.ts → chunk-GIRUQ7QF.ts} +2 -2
- package/dist/compiler-assets/{chunk-JFNLGXQM.ts → chunk-JRKGCYWA.ts} +10 -10
- package/dist/compiler-assets/{chunk-BLF6KTBB.ts → chunk-KMBQVNAJ.ts} +2 -2
- package/dist/compiler-assets/{chunk-YOE37BRR.ts → chunk-MBX6PIN7.ts} +2 -2
- package/dist/compiler-assets/{chunk-TFPXCL5W.ts → chunk-O2JWY454.ts} +1 -1
- package/dist/compiler-assets/{chunk-L7E6UQX3.ts → chunk-U3MFLFVF.ts} +2 -2
- package/dist/compiler-assets/{chunk-2LYL3UFK.ts → chunk-VRW24MOJ.ts} +1 -1
- package/dist/compiler-assets/{chunk-V5E4RKG6.ts → chunk-YEKSPL76.ts} +1 -1
- package/dist/compiler-assets/src/authoring/approval.ts +2 -2
- package/dist/compiler-assets/src/authoring/channels.ts +1 -1
- package/dist/compiler-assets/src/authoring/connections.ts +2 -2
- package/dist/compiler-assets/src/authoring/harness.ts +3 -3
- package/dist/compiler-assets/src/authoring/hooks.ts +1 -1
- package/dist/compiler-assets/src/authoring/index.ts +8 -8
- package/dist/compiler-assets/src/authoring/sandbox.ts +3 -3
- package/dist/compiler-assets/src/compatibility.ts +2 -2
- package/dist/compiler-assets/src/index.ts +11 -9
- package/dist/compiler-assets/src/manifest.ts +3 -1
- package/dist/compiler-assets/src/resolve.ts +2 -2
- package/dist/compiler-assets/src/runtime/bundle.ts +7 -7
- package/dist/compiler-assets/src/runtime/describe.ts +4 -4
- package/dist/compiler-assets/src/runtime/described.ts +3 -3
- package/dist/compiler-assets/src/runtime/isolate.ts +6 -6
- package/dist/compiler-assets/src/runtime/lower.ts +3 -3
- package/dist/modules/authoring/channels.d.mts +6 -6
- package/dist/modules/authoring/channels.mjs.map +1 -1
- package/dist/modules/authoring/hooks.d.mts +6 -6
- package/dist/modules/authoring/hooks.mjs +2 -2
- package/dist/modules/authoring/hooks.mjs.map +2 -2
- package/dist/modules/manifest.d.mts +2 -2
- package/dist/modules/manifest.mjs +2 -0
- package/dist/modules/manifest.mjs.map +2 -2
- package/package.json +3 -3
- /package/dist/compiler-assets/{chunk-S5ON7OBR.ts → chunk-LZSLGWS7.ts} +0 -0
package/HOSTING.md
CHANGED
|
@@ -7,13 +7,13 @@ resolve against dev and production configuration without source edits.
|
|
|
7
7
|
## Selecting a deployment
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
export FINAL_API_HOST=https
|
|
11
|
-
export FINAL_API_KEY=<dev-
|
|
10
|
+
export FINAL_API_HOST=https://<dev-agents-api-host>/api
|
|
11
|
+
export FINAL_API_KEY=<dev-api-key>
|
|
12
12
|
pnpm exec final-agents build ./agent
|
|
13
13
|
pnpm exec final-agents publish ./agent --agent my-agent
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Choose production by changing the host and
|
|
16
|
+
Choose production by changing the host and API key. `--host` overrides
|
|
17
17
|
`FINAL_API_HOST`; without either, the existing production default remains. Build
|
|
18
18
|
compiles locally and optionally checks installed-harness compatibility. Publish
|
|
19
19
|
compiles again and sends source/release requests to the selected deployment.
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
lowerSkill,
|
|
9
9
|
lowerTool,
|
|
10
10
|
toJson
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GIRUQ7QF.ts";
|
|
12
12
|
import {
|
|
13
13
|
AUTHORED_SERVER_KEY
|
|
14
14
|
} from "./chunk-NMYHO2QN.ts";
|
|
15
15
|
import {
|
|
16
16
|
hookHandlersFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KMBQVNAJ.ts";
|
|
18
18
|
import {
|
|
19
19
|
unopenedRequestOf
|
|
20
20
|
} from "./chunk-KNFPKVUS.ts";
|
|
@@ -24,15 +24,15 @@ import {
|
|
|
24
24
|
} from "./chunk-4ERFBLH7.ts";
|
|
25
25
|
import {
|
|
26
26
|
lowerApproval
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-O2JWY454.ts";
|
|
28
28
|
import {
|
|
29
29
|
ConversationKind,
|
|
30
30
|
ParticipantKind
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JRKGCYWA.ts";
|
|
32
32
|
import {
|
|
33
33
|
mcpServerBindingSchema,
|
|
34
34
|
providerRefSchema
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-EAEQQT33.ts";
|
|
36
36
|
import {
|
|
37
37
|
TranscriptRole
|
|
38
38
|
} from "./chunk-RWUIMTBI.ts";
|
|
@@ -182,6 +182,9 @@ var mcpServerBindingSchema = discriminatedUnion("kind", [
|
|
|
182
182
|
workerMcpServerBindingSchema,
|
|
183
183
|
httpMcpServerBindingSchema
|
|
184
184
|
]);
|
|
185
|
+
var sandboxCredentialRefSchema = strictObject({
|
|
186
|
+
secretRef: string().min(1).max(256)
|
|
187
|
+
});
|
|
185
188
|
var sandboxBindingSchema = object({
|
|
186
189
|
provider: providerRefSchema,
|
|
187
190
|
// Provider-defined environment options (`computer`: a setup guide reference or
|
|
@@ -241,9 +244,8 @@ var agentManifestSchema = object({
|
|
|
241
244
|
sandboxes: maybeDynamic(record(string(), sandboxBindingSchema)),
|
|
242
245
|
tools: baseToolsSchema,
|
|
243
246
|
toolPolicy: record(string(), nativeEnum(ToolApproval)),
|
|
244
|
-
//
|
|
245
|
-
//
|
|
246
|
-
// binding organization secrets requires an organization admin at publish.
|
|
247
|
+
// Secrets this agent may read, by name (`secrets.get`, MCP `secretKey`,
|
|
248
|
+
// `apiKey({ secret })`). Nothing else is readable.
|
|
247
249
|
secrets: array(string().min(1)).default([]),
|
|
248
250
|
channels: array(channelBindingSchema),
|
|
249
251
|
channelSources: record(string(), object({ path: string(), source: string(), disabled: boolean() })).optional(),
|
|
@@ -318,6 +320,7 @@ export {
|
|
|
318
320
|
workerMcpServerBindingSchema,
|
|
319
321
|
httpMcpServerBindingSchema,
|
|
320
322
|
mcpServerBindingSchema,
|
|
323
|
+
sandboxCredentialRefSchema,
|
|
321
324
|
sandboxBindingSchema,
|
|
322
325
|
baseToolsSchema,
|
|
323
326
|
channelBindingSchema,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-4ERFBLH7.ts";
|
|
4
4
|
import {
|
|
5
5
|
lowerApproval
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-O2JWY454.ts";
|
|
7
7
|
import {
|
|
8
8
|
toolAnnotationSelectorSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EAEQQT33.ts";
|
|
10
10
|
import {
|
|
11
11
|
jsonSchemaDeclarationError
|
|
12
12
|
} from "./chunk-O3JKMLDP.ts";
|
|
@@ -58,19 +58,19 @@ var channelMessageInputSchema = object({
|
|
|
58
58
|
quotedMessageIds: array(string().min(1)).default([]),
|
|
59
59
|
mentionedParticipantIds: array(string().min(1)).default([])
|
|
60
60
|
});
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return
|
|
65
|
-
})(
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
kind: nativeEnum(
|
|
61
|
+
var DecisionKind = /* @__PURE__ */ ((DecisionKind2) => {
|
|
62
|
+
DecisionKind2["Permission"] = "permission";
|
|
63
|
+
DecisionKind2["Elicitation"] = "elicitation";
|
|
64
|
+
return DecisionKind2;
|
|
65
|
+
})(DecisionKind || {});
|
|
66
|
+
var decisionCreatedDataSchema = object({
|
|
67
|
+
decisionId: string().min(1),
|
|
68
|
+
kind: nativeEnum(DecisionKind),
|
|
69
69
|
audienceParticipantIds: array(string()),
|
|
70
70
|
request: jsonValueSchema
|
|
71
71
|
});
|
|
72
|
-
var
|
|
73
|
-
|
|
72
|
+
var decisionResolvedDataSchema = object({
|
|
73
|
+
decisionId: string().min(1),
|
|
74
74
|
outcome: jsonValueSchema,
|
|
75
75
|
respondedBy: channelAuthSchema.nullable().default(null)
|
|
76
76
|
});
|
|
@@ -22,8 +22,8 @@ var HookEvent = /* @__PURE__ */ ((HookEvent2) => {
|
|
|
22
22
|
HookEvent2["ToolCallUpdate"] = "tool_call_update";
|
|
23
23
|
HookEvent2["ToolCallContentChunk"] = "tool_call_content_chunk";
|
|
24
24
|
HookEvent2["Plan"] = "plan";
|
|
25
|
-
HookEvent2["
|
|
26
|
-
HookEvent2["
|
|
25
|
+
HookEvent2["DecisionCreated"] = "decision.created";
|
|
26
|
+
HookEvent2["DecisionResolved"] = "decision.resolved";
|
|
27
27
|
HookEvent2["StateUpdate"] = "state_update";
|
|
28
28
|
HookEvent2["SessionFailed"] = "session.failed";
|
|
29
29
|
HookEvent2["SessionClosed"] = "session.closed";
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
note,
|
|
14
14
|
sandboxProviderNameOf,
|
|
15
15
|
toJson
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GIRUQ7QF.ts";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_DYNAMIC_PREFIX,
|
|
19
19
|
namedExportName
|
|
20
20
|
} from "./chunk-NMYHO2QN.ts";
|
|
21
21
|
import {
|
|
22
22
|
agentAvatarSchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-EAEQQT33.ts";
|
|
24
24
|
import {
|
|
25
25
|
hostedBindingRequirementSchema
|
|
26
26
|
} from "./chunk-R4IHPPTB.ts";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
lowerApproval,
|
|
4
4
|
never,
|
|
5
5
|
whenInput
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-O2JWY454.ts";
|
|
7
|
+
import "../../chunk-EAEQQT33.ts";
|
|
8
8
|
import "../../chunk-R4IHPPTB.ts";
|
|
9
9
|
import "../../chunk-FU5VHNO4.ts";
|
|
10
10
|
import "../../chunk-KTBNDKGJ.ts";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
defineProviderChannel,
|
|
10
10
|
disableChannel
|
|
11
11
|
} from "../../chunk-ISYIPH2T.ts";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-JRKGCYWA.ts";
|
|
13
13
|
import "../../chunk-FU5VHNO4.ts";
|
|
14
14
|
import "../../chunk-KTBNDKGJ.ts";
|
|
15
15
|
import "../../chunk-OX46N5EP.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineHostedConnection,
|
|
3
3
|
defineMcpClientConnection
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-BMX2HP6G.ts";
|
|
5
5
|
import "../../chunk-VI5WBWUX.ts";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-EAEQQT33.ts";
|
|
7
7
|
import "../../chunk-36MVFRMA.ts";
|
|
8
8
|
import "../../chunk-XJNO7EHQ.ts";
|
|
9
9
|
import "../../chunk-O3JKMLDP.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
completeHarnessDescription,
|
|
3
3
|
defineHarness
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-U3MFLFVF.ts";
|
|
5
|
+
import "../../chunk-YEKSPL76.ts";
|
|
6
|
+
import "../../chunk-EAEQQT33.ts";
|
|
7
7
|
import "../../chunk-QVHDGZAN.ts";
|
|
8
8
|
import "../../chunk-R4IHPPTB.ts";
|
|
9
9
|
import "../../chunk-FU5VHNO4.ts";
|
|
@@ -2,11 +2,11 @@ import "../../chunk-RMIQJHSL.ts";
|
|
|
2
2
|
import {
|
|
3
3
|
completeHarnessDescription,
|
|
4
4
|
defineHarness
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-U3MFLFVF.ts";
|
|
6
6
|
import {
|
|
7
7
|
HookEvent,
|
|
8
8
|
defineHook
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-KMBQVNAJ.ts";
|
|
10
10
|
import {
|
|
11
11
|
defineInstructions
|
|
12
12
|
} from "../../chunk-WJPAUIVM.ts";
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
defineSandbox,
|
|
16
16
|
defineSandboxProvider,
|
|
17
17
|
harnessHost
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-LZSLGWS7.ts";
|
|
19
19
|
import "../../chunk-KNFPKVUS.ts";
|
|
20
20
|
import {
|
|
21
21
|
SandboxWire
|
|
22
|
-
} from "../../chunk-
|
|
22
|
+
} from "../../chunk-YEKSPL76.ts";
|
|
23
23
|
import {
|
|
24
24
|
defineSchedule
|
|
25
25
|
} from "../../chunk-7MDGEPFT.ts";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
always,
|
|
38
38
|
never,
|
|
39
39
|
whenInput
|
|
40
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-O2JWY454.ts";
|
|
41
41
|
import {
|
|
42
42
|
DELETE,
|
|
43
43
|
GET,
|
|
@@ -48,13 +48,13 @@ import {
|
|
|
48
48
|
defineProviderChannel,
|
|
49
49
|
disableChannel
|
|
50
50
|
} from "../../chunk-ISYIPH2T.ts";
|
|
51
|
-
import "../../chunk-
|
|
51
|
+
import "../../chunk-JRKGCYWA.ts";
|
|
52
52
|
import {
|
|
53
53
|
defineHostedConnection,
|
|
54
54
|
defineMcpClientConnection
|
|
55
|
-
} from "../../chunk-
|
|
55
|
+
} from "../../chunk-BMX2HP6G.ts";
|
|
56
56
|
import "../../chunk-VI5WBWUX.ts";
|
|
57
|
-
import "../../chunk-
|
|
57
|
+
import "../../chunk-EAEQQT33.ts";
|
|
58
58
|
import {
|
|
59
59
|
TranscriptRole
|
|
60
60
|
} from "../../chunk-RWUIMTBI.ts";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
defineSandbox,
|
|
4
4
|
defineSandboxProvider,
|
|
5
5
|
harnessHost
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-LZSLGWS7.ts";
|
|
7
7
|
import "../../chunk-KNFPKVUS.ts";
|
|
8
8
|
import {
|
|
9
9
|
SandboxWire
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-YEKSPL76.ts";
|
|
11
11
|
import "../../chunk-VI5WBWUX.ts";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-EAEQQT33.ts";
|
|
13
13
|
import "../../chunk-QVHDGZAN.ts";
|
|
14
14
|
import "../../chunk-R4IHPPTB.ts";
|
|
15
15
|
import "../../chunk-FU5VHNO4.ts";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
SHARED_SCHEMAS,
|
|
4
4
|
deliveredHarnessConfig,
|
|
5
5
|
referencedSharedSchemas
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-YEKSPL76.ts";
|
|
7
7
|
import {
|
|
8
8
|
BaseCapability,
|
|
9
9
|
formatProviderRef
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-EAEQQT33.ts";
|
|
11
11
|
import {
|
|
12
12
|
credentialPolicySchema,
|
|
13
13
|
inferenceKindOfNode
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveManifestDetailed,
|
|
6
6
|
slotKindOf,
|
|
7
7
|
validateSlotValue
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-VRW24MOJ.ts";
|
|
9
9
|
import {
|
|
10
10
|
AGENT_DYNAMIC_PREFIX,
|
|
11
11
|
AUTHORED_SERVER_KEY,
|
|
@@ -15,11 +15,11 @@ import "../chunk-RMIQJHSL.ts";
|
|
|
15
15
|
import {
|
|
16
16
|
completeHarnessDescription,
|
|
17
17
|
defineHarness
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-U3MFLFVF.ts";
|
|
19
19
|
import {
|
|
20
20
|
HookEvent,
|
|
21
21
|
defineHook
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-KMBQVNAJ.ts";
|
|
23
23
|
import {
|
|
24
24
|
defineInstructions
|
|
25
25
|
} from "../chunk-WJPAUIVM.ts";
|
|
@@ -28,11 +28,11 @@ import {
|
|
|
28
28
|
defineSandbox,
|
|
29
29
|
defineSandboxProvider,
|
|
30
30
|
harnessHost
|
|
31
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-LZSLGWS7.ts";
|
|
32
32
|
import "../chunk-KNFPKVUS.ts";
|
|
33
33
|
import {
|
|
34
34
|
SandboxWire
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-YEKSPL76.ts";
|
|
36
36
|
import {
|
|
37
37
|
defineSchedule
|
|
38
38
|
} from "../chunk-7MDGEPFT.ts";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
always,
|
|
51
51
|
never,
|
|
52
52
|
whenInput
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-O2JWY454.ts";
|
|
54
54
|
import {
|
|
55
55
|
DELETE,
|
|
56
56
|
GET,
|
|
@@ -61,11 +61,11 @@ import {
|
|
|
61
61
|
defineProviderChannel,
|
|
62
62
|
disableChannel
|
|
63
63
|
} from "../chunk-ISYIPH2T.ts";
|
|
64
|
-
import "../chunk-
|
|
64
|
+
import "../chunk-JRKGCYWA.ts";
|
|
65
65
|
import {
|
|
66
66
|
defineHostedConnection,
|
|
67
67
|
defineMcpClientConnection
|
|
68
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-BMX2HP6G.ts";
|
|
69
69
|
import "../chunk-VI5WBWUX.ts";
|
|
70
70
|
import {
|
|
71
71
|
BaseCapability,
|
|
@@ -92,12 +92,13 @@ import {
|
|
|
92
92
|
mcpServerBindingSchema,
|
|
93
93
|
resolvedAgentManifestSchema,
|
|
94
94
|
sandboxBindingSchema,
|
|
95
|
+
sandboxCredentialRefSchema,
|
|
95
96
|
scheduleDefinitionSchema,
|
|
96
97
|
skillBundleSchema,
|
|
97
98
|
skillFileSchema,
|
|
98
99
|
toolDescriptorSchema,
|
|
99
100
|
workerMcpServerBindingSchema
|
|
100
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-EAEQQT33.ts";
|
|
101
102
|
import {
|
|
102
103
|
TranscriptRole
|
|
103
104
|
} from "../chunk-RWUIMTBI.ts";
|
|
@@ -195,6 +196,7 @@ export {
|
|
|
195
196
|
resolveManifestDetailed,
|
|
196
197
|
resolvedAgentManifestSchema,
|
|
197
198
|
sandboxBindingSchema,
|
|
199
|
+
sandboxCredentialRefSchema,
|
|
198
200
|
scheduleDefinitionSchema,
|
|
199
201
|
skillBundleSchema,
|
|
200
202
|
skillFileSchema,
|
|
@@ -24,12 +24,13 @@ import {
|
|
|
24
24
|
mcpServerBindingSchema,
|
|
25
25
|
resolvedAgentManifestSchema,
|
|
26
26
|
sandboxBindingSchema,
|
|
27
|
+
sandboxCredentialRefSchema,
|
|
27
28
|
scheduleDefinitionSchema,
|
|
28
29
|
skillBundleSchema,
|
|
29
30
|
skillFileSchema,
|
|
30
31
|
toolDescriptorSchema,
|
|
31
32
|
workerMcpServerBindingSchema
|
|
32
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-EAEQQT33.ts";
|
|
33
34
|
import {
|
|
34
35
|
DynamicEvent,
|
|
35
36
|
dynamicSlotSchema,
|
|
@@ -68,6 +69,7 @@ export {
|
|
|
68
69
|
mcpServerBindingSchema,
|
|
69
70
|
resolvedAgentManifestSchema,
|
|
70
71
|
sandboxBindingSchema,
|
|
72
|
+
sandboxCredentialRefSchema,
|
|
71
73
|
scheduleDefinitionSchema,
|
|
72
74
|
skillBundleSchema,
|
|
73
75
|
skillFileSchema,
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
resolveManifestDetailed,
|
|
5
5
|
slotKindOf,
|
|
6
6
|
validateSlotValue
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-VRW24MOJ.ts";
|
|
8
|
+
import "../chunk-EAEQQT33.ts";
|
|
9
9
|
import "../chunk-R4IHPPTB.ts";
|
|
10
10
|
import "../chunk-FU5VHNO4.ts";
|
|
11
11
|
import "../chunk-KTXTYIF4.ts";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
combineMcpServers,
|
|
3
3
|
createIsolateRuntime
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-4T2XPIPH.ts";
|
|
5
5
|
import {
|
|
6
6
|
describeBundle,
|
|
7
7
|
needsCombinedMcpServers,
|
|
8
8
|
synthesizedExports
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-MBX6PIN7.ts";
|
|
10
|
+
import "../../chunk-GIRUQ7QF.ts";
|
|
11
11
|
import {
|
|
12
12
|
COMBINED_MCP_SERVERS_EXPORT,
|
|
13
13
|
namedExportName
|
|
14
14
|
} from "../../chunk-NMYHO2QN.ts";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-KMBQVNAJ.ts";
|
|
16
16
|
import "../../chunk-KNFPKVUS.ts";
|
|
17
17
|
import {
|
|
18
18
|
registerToolName
|
|
19
19
|
} from "../../chunk-4ERFBLH7.ts";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-O2JWY454.ts";
|
|
21
|
+
import "../../chunk-JRKGCYWA.ts";
|
|
22
22
|
import "../../chunk-VI5WBWUX.ts";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-EAEQQT33.ts";
|
|
24
24
|
import "../../chunk-RWUIMTBI.ts";
|
|
25
25
|
import "../../chunk-36MVFRMA.ts";
|
|
26
26
|
import "../../chunk-XJNO7EHQ.ts";
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
describeDynamic,
|
|
5
5
|
needsCombinedMcpServers,
|
|
6
6
|
synthesizedExports
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-MBX6PIN7.ts";
|
|
8
|
+
import "../../chunk-GIRUQ7QF.ts";
|
|
9
9
|
import {
|
|
10
10
|
COMBINED_MCP_SERVERS_EXPORT
|
|
11
11
|
} from "../../chunk-NMYHO2QN.ts";
|
|
12
12
|
import "../../chunk-4ERFBLH7.ts";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-O2JWY454.ts";
|
|
14
14
|
import "../../chunk-VI5WBWUX.ts";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-EAEQQT33.ts";
|
|
16
16
|
import "../../chunk-36MVFRMA.ts";
|
|
17
17
|
import "../../chunk-XJNO7EHQ.ts";
|
|
18
18
|
import "../../chunk-O3JKMLDP.ts";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IssueSeverity
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-GIRUQ7QF.ts";
|
|
4
4
|
import {
|
|
5
5
|
SlotKind
|
|
6
6
|
} from "../../chunk-NMYHO2QN.ts";
|
|
7
7
|
import "../../chunk-4ERFBLH7.ts";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-O2JWY454.ts";
|
|
9
9
|
import "../../chunk-VI5WBWUX.ts";
|
|
10
10
|
import {
|
|
11
11
|
agentAvatarSchema
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-EAEQQT33.ts";
|
|
13
13
|
import "../../chunk-36MVFRMA.ts";
|
|
14
14
|
import "../../chunk-XJNO7EHQ.ts";
|
|
15
15
|
import "../../chunk-O3JKMLDP.ts";
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
combineMcpServers,
|
|
3
3
|
createIsolateRuntime,
|
|
4
4
|
lowerResolvedValue
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-4T2XPIPH.ts";
|
|
6
|
+
import "../../chunk-GIRUQ7QF.ts";
|
|
7
7
|
import "../../chunk-NMYHO2QN.ts";
|
|
8
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-KMBQVNAJ.ts";
|
|
9
9
|
import "../../chunk-KNFPKVUS.ts";
|
|
10
10
|
import "../../chunk-4ERFBLH7.ts";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-O2JWY454.ts";
|
|
12
|
+
import "../../chunk-JRKGCYWA.ts";
|
|
13
13
|
import "../../chunk-VI5WBWUX.ts";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-EAEQQT33.ts";
|
|
15
15
|
import "../../chunk-RWUIMTBI.ts";
|
|
16
16
|
import "../../chunk-36MVFRMA.ts";
|
|
17
17
|
import "../../chunk-XJNO7EHQ.ts";
|
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
toJson,
|
|
18
18
|
toJsonSchema,
|
|
19
19
|
warning
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-GIRUQ7QF.ts";
|
|
21
21
|
import "../../chunk-4ERFBLH7.ts";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-O2JWY454.ts";
|
|
23
23
|
import "../../chunk-VI5WBWUX.ts";
|
|
24
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-EAEQQT33.ts";
|
|
25
25
|
import "../../chunk-36MVFRMA.ts";
|
|
26
26
|
import "../../chunk-XJNO7EHQ.ts";
|
|
27
27
|
import "../../chunk-O3JKMLDP.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AcpUpdateKind, KnownAcpUpdateKind, ChannelAddressContextIface, ChannelDefinitionIface, ChannelEventHandler, ChannelReceiveContextIface, ChannelReceiveResult, ChannelSemanticDataByKindIface, HttpChannelRouteDefinitionIface, JsonObject, JsonValue,
|
|
1
|
+
import type { AcpUpdateKind, KnownAcpUpdateKind, ChannelAddressContextIface, ChannelDefinitionIface, ChannelEventHandler, ChannelReceiveContextIface, ChannelReceiveResult, ChannelSemanticDataByKindIface, HttpChannelRouteDefinitionIface, JsonObject, JsonValue, DecisionEventKind, ProjectionContextIface, TurnPolicy, WebSocketChannelRouteDefinitionIface } from '@finalai/agent-provider';
|
|
2
2
|
export { channelAccessors } from '@finalai/agent-provider';
|
|
3
3
|
export type RouteHandler = HttpChannelRouteDefinitionIface['handler'];
|
|
4
4
|
export type RouteHandlerArgsIface = Parameters<RouteHandler>[0];
|
|
@@ -24,7 +24,7 @@ export type AuthoredSemanticEventsIface = {
|
|
|
24
24
|
};
|
|
25
25
|
type AuthoredSemanticHandlerIface = NonNullable<AuthoredSemanticEventsIface[keyof AuthoredSemanticEventsIface]>;
|
|
26
26
|
export type AuthoredChannelEventsIface = AuthoredSemanticEventsIface & {
|
|
27
|
-
[Kind in `${
|
|
27
|
+
[Kind in `${DecisionEventKind}` | KnownAcpUpdateKind]?: ChannelEventHandler;
|
|
28
28
|
} & {
|
|
29
29
|
[kind: AcpUpdateKind]: ChannelEventHandler | AuthoredSemanticHandlerIface | undefined;
|
|
30
30
|
};
|
|
@@ -55,8 +55,8 @@ export declare const defineChannel: <TChannel extends AuthoredChannelDefinitionI
|
|
|
55
55
|
subagent_update?: ChannelEventHandler | undefined;
|
|
56
56
|
session_message?: ChannelEventHandler | undefined;
|
|
57
57
|
session_message_chunk?: ChannelEventHandler | undefined;
|
|
58
|
-
"
|
|
59
|
-
"
|
|
58
|
+
"decision.created"?: ChannelEventHandler | undefined;
|
|
59
|
+
"decision.resolved"?: ChannelEventHandler | undefined;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
export declare const disableChannel: () => Omit<{
|
|
@@ -88,8 +88,8 @@ export declare const disableChannel: () => Omit<{
|
|
|
88
88
|
subagent_update?: ChannelEventHandler | undefined;
|
|
89
89
|
session_message?: ChannelEventHandler | undefined;
|
|
90
90
|
session_message_chunk?: ChannelEventHandler | undefined;
|
|
91
|
-
"
|
|
92
|
-
"
|
|
91
|
+
"decision.created"?: ChannelEventHandler | undefined;
|
|
92
|
+
"decision.resolved"?: ChannelEventHandler | undefined;
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
export declare const GET: (path: string, handler: RouteHandler) => HttpChannelRouteDefinitionIface;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/authoring/channels.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\n AcpUpdateKind,\n KnownAcpUpdateKind,\n ChannelAddressContextIface,\n ChannelDefinitionIface,\n ChannelEventHandler,\n ChannelReceiveContextIface,\n ChannelReceiveResult,\n ChannelSemanticDataByKindIface,\n HttpChannelRouteDefinitionIface,\n JsonObject,\n JsonValue,\n
|
|
4
|
+
"sourcesContent": ["import type {\n AcpUpdateKind,\n KnownAcpUpdateKind,\n ChannelAddressContextIface,\n ChannelDefinitionIface,\n ChannelEventHandler,\n ChannelReceiveContextIface,\n ChannelReceiveResult,\n ChannelSemanticDataByKindIface,\n HttpChannelRouteDefinitionIface,\n JsonObject,\n JsonValue,\n DecisionEventKind,\n ProjectionContextIface,\n TurnPolicy,\n WebSocketChannelRouteDefinitionIface,\n} from '@finalai/agent-provider';\nimport {\n channelAccessors,\n channelMessageCompletedSchema,\n jsonObjectSchema,\n} from '@finalai/agent-provider';\n\n// Session handles over a projection context's platform (`attachSession(ctx.sessionId)`)\n// for raw event handlers (`decision.created`, ACP updates).\nexport { channelAccessors } from '@finalai/agent-provider';\nimport * as z from 'zod';\nimport { AuthoredKind, stamp } from \"./brand.mjs\";\n\n// A custom channel in channels/<stem>.ts. Its routes run\n// in the agent's Worker isolate and are mounted by the session service's\n// front door at /<org>/<agent>/<stem><path> (and /b/<bindingId><path>);\n// the members it authors (receive, route, project, events) run there too,\n// driven by the session service exactly like a built-in channel's. What it\n// leaves out is the platform default: receive takes `{ target, content }`,\n// route follows the default routing rules, and the conversation's own channel projects.\n//\n// A bundle channel sees wire ids everywhere (conversations `conv_\u2026`,\n// participants `cpart_\u2026`, messages `cnmsg_\u2026`, users `usr_\u2026`, its binding\n// `chbind_\u2026`, turns `atrn_\u2026`, decisions `adec_\u2026`), the same strings the\n// public API returns, and must pass wire ids back to `ctx.platform`, `receive`\n// results and route decisions; raw UUIDs are refused.\n\nexport type RouteHandler = HttpChannelRouteDefinitionIface['handler'];\nexport type RouteHandlerArgsIface = Parameters<RouteHandler>[0];\n\nexport type AuthoredChannelDefinitionIface = Partial<\n Omit<ChannelDefinitionIface<JsonValue, JsonValue>, 'turnPolicy' | 'events' | 'receive'>\n> & {\n receive?: (\n input: JsonValue,\n ctx: ChannelReceiveContextIface & ChannelAddressContextIface,\n ) => Promise<ChannelReceiveResult>;\n events?: AuthoredChannelEventsIface;\n readonly turnPolicy?: TurnPolicy | `${TurnPolicy}`;\n // Static binding config recorded in the manifest.\n readonly config?: JsonObject;\n readonly disabled?: boolean;\n};\n\nexport interface AuthoredChannelContextIface extends ChannelAddressContextIface {\n platform: ProjectionContextIface['platform'];\n}\nexport interface AuthoredSessionContextIface {\n sessionId: string | null;\n turnId: string;\n state: ProjectionContextIface['state'];\n // The binding's config and the agent's secrets: what a channel needs to post\n // its replies back to its own service.\n config: JsonObject;\n secrets: ProjectionContextIface['secrets'];\n}\nexport type AuthoredSemanticEventsIface = {\n [Kind in keyof ChannelSemanticDataByKindIface]?: (\n data: ChannelSemanticDataByKindIface[Kind],\n channel: AuthoredChannelContextIface,\n ctx: AuthoredSessionContextIface,\n ) => void | Promise<void>;\n};\n\ntype AuthoredSemanticHandlerIface = NonNullable<\n AuthoredSemanticEventsIface[keyof AuthoredSemanticEventsIface]\n>;\n\n// Semantic events (`message.delta`, \u2026) take `(data, channel, ctx)`; decision\n// events and ACP update kinds (`tool_call`, `plan`, \u2026) the raw `(event, ctx)`.\n// Named kinds keep a single handler type, so their parameters are typed from\n// context; ACP kinds the SDK does not name share the open index signature and\n// need annotated parameters.\nexport type AuthoredChannelEventsIface = AuthoredSemanticEventsIface & {\n [Kind in `${DecisionEventKind}` | KnownAcpUpdateKind]?: ChannelEventHandler;\n} & {\n [kind: AcpUpdateKind]: ChannelEventHandler | AuthoredSemanticHandlerIface | undefined;\n};\n\nexport const defineChannel = <TChannel extends AuthoredChannelDefinitionIface>(\n definition: TChannel,\n) => {\n const {\n 'message.delta': delta,\n 'message.completed': completed,\n 'turn.started': started,\n 'turn.completed': ended,\n ...raw\n } = definition.events ?? {};\n const events = { ...raw };\n const wrap = <Data>(\n schema: z.ZodType<Data>,\n handler:\n | ((\n data: Data,\n channel: AuthoredChannelContextIface,\n ctx: AuthoredSessionContextIface,\n ) => void | Promise<void>)\n | undefined,\n ): ChannelEventHandler | undefined =>\n handler == null\n ? undefined\n : async (event, ctx) =>\n handler(\n schema.parse(event.data),\n { ...channelAccessors(ctx.platform), platform: ctx.platform },\n {\n sessionId: ctx.sessionId ?? null,\n turnId: ctx.turn.id,\n state: ctx.state,\n config: ctx.config,\n secrets: ctx.secrets,\n },\n );\n const semantic = {\n 'message.delta': wrap(z.object({ messageId: z.string(), delta: jsonObjectSchema }), delta),\n 'message.completed': wrap(channelMessageCompletedSchema, completed),\n 'turn.started': wrap(z.object({ turnId: z.string() }), started),\n 'turn.completed': wrap(\n z.object({ turnId: z.string(), stopReason: z.string().nullable() }),\n ended,\n ),\n };\n for (const [kind, handler] of Object.entries(semantic))\n if (handler != null) events[kind] = handler;\n const { installed, configure, ...authored } = definition;\n return stamp(\n { ...authored, configure: installed == null ? configure : undefined, events },\n AuthoredKind.Channel,\n );\n};\n\nexport const disableChannel = () => defineChannel({ disabled: true });\n\nconst route =\n (method: HttpChannelRouteDefinitionIface['method']) =>\n (path: string, handler: RouteHandler): HttpChannelRouteDefinitionIface => ({\n method,\n path,\n handler,\n });\n\nexport const GET = route('GET');\nexport const POST = route('POST');\nexport const PUT = route('PUT');\nexport const DELETE = route('DELETE');\n\nexport const WS = (\n path: string,\n handler: WebSocketChannelRouteDefinitionIface['handler'],\n): WebSocketChannelRouteDefinitionIface => ({ method: 'WS', path, handler });\n\n// Provider factories already own their installed reference and runtime handlers.\nexport const defineProviderChannel = <T extends ChannelDefinitionIface<JsonValue, JsonValue>>(\n definition: T,\n): T => stamp(definition, AuthoredKind.Channel);\n"],
|
|
5
5
|
"mappings": "AAiBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,oBAAAA,yBAAwB;AACjC,YAAY,OAAO;AACnB,SAAS,cAAc,aAAa;AAoE7B,MAAM,gBAAgB,CAC3B,eACG;AACH,QAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,GAAG;AAAA,EACL,IAAI,WAAW,UAAU,CAAC;AAC1B,QAAM,SAAS,EAAE,GAAG,IAAI;AACxB,QAAM,OAAO,CACX,QACA,YAQA,WAAW,OACP,SACA,OAAO,OAAO,QACZ;AAAA,IACE,OAAO,MAAM,MAAM,IAAI;AAAA,IACvB,EAAE,GAAG,iBAAiB,IAAI,QAAQ,GAAG,UAAU,IAAI,SAAS;AAAA,IAC5D;AAAA,MACE,WAAW,IAAI,aAAa;AAAA,MAC5B,QAAQ,IAAI,KAAK;AAAA,MACjB,OAAO,IAAI;AAAA,MACX,QAAQ,IAAI;AAAA,MACZ,SAAS,IAAI;AAAA,IACf;AAAA,EACF;AACR,QAAM,WAAW;AAAA,IACf,iBAAiB,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,iBAAiB,CAAC,GAAG,KAAK;AAAA,IACzF,qBAAqB,KAAK,+BAA+B,SAAS;AAAA,IAClE,gBAAgB,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO;AAAA,IAC9D,kBAAkB;AAAA,MAChB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAAA,MAClE;AAAA,IACF;AAAA,EACF;AACA,aAAW,CAAC,MAAM,OAAO,KAAK,OAAO,QAAQ,QAAQ;AACnD,QAAI,WAAW,KAAM,QAAO,IAAI,IAAI;AACtC,QAAM,EAAE,WAAW,WAAW,GAAG,SAAS,IAAI;AAC9C,SAAO;AAAA,IACL,EAAE,GAAG,UAAU,WAAW,aAAa,OAAO,YAAY,QAAW,OAAO;AAAA,IAC5E,aAAa;AAAA,EACf;AACF;AAEO,MAAM,iBAAiB,MAAM,cAAc,EAAE,UAAU,KAAK,CAAC;AAEpE,MAAM,QACJ,CAAC,WACD,CAAC,MAAc,aAA4D;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AACF;AAEK,MAAM,MAAM,MAAM,KAAK;AACvB,MAAM,OAAO,MAAM,MAAM;AACzB,MAAM,MAAM,MAAM,KAAK;AACvB,MAAM,SAAS,MAAM,QAAQ;AAE7B,MAAM,KAAK,CAChB,MACA,aAC0C,EAAE,QAAQ,MAAM,MAAM,QAAQ;AAGnE,MAAM,wBAAwB,CACnC,eACM,MAAM,YAAY,aAAa,OAAO;",
|
|
6
6
|
"names": ["channelAccessors"]
|
|
7
7
|
}
|
|
@@ -15,8 +15,8 @@ export declare enum HookEvent {
|
|
|
15
15
|
ToolCallUpdate = "tool_call_update",
|
|
16
16
|
ToolCallContentChunk = "tool_call_content_chunk",
|
|
17
17
|
Plan = "plan",
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
DecisionCreated = "decision.created",
|
|
19
|
+
DecisionResolved = "decision.resolved",
|
|
20
20
|
StateUpdate = "state_update",
|
|
21
21
|
SessionFailed = "session.failed",
|
|
22
22
|
SessionClosed = "session.closed",
|
|
@@ -66,13 +66,13 @@ export interface HookEventDataMapIface {
|
|
|
66
66
|
tool_call: ToolCallEventDataIface;
|
|
67
67
|
tool_call_update: ToolCallEventDataIface;
|
|
68
68
|
tool_call_content_chunk: ToolCallEventDataIface;
|
|
69
|
-
'
|
|
70
|
-
|
|
69
|
+
'decision.created': {
|
|
70
|
+
decisionId: string;
|
|
71
71
|
kind: 'permission' | 'elicitation' | 'authorization';
|
|
72
72
|
request: JsonValue;
|
|
73
73
|
};
|
|
74
|
-
'
|
|
75
|
-
|
|
74
|
+
'decision.resolved': {
|
|
75
|
+
decisionId: string;
|
|
76
76
|
outcome: JsonValue;
|
|
77
77
|
};
|
|
78
78
|
'session.failed': {
|
|
@@ -14,8 +14,8 @@ var HookEvent = /* @__PURE__ */ ((HookEvent2) => {
|
|
|
14
14
|
HookEvent2["ToolCallUpdate"] = "tool_call_update";
|
|
15
15
|
HookEvent2["ToolCallContentChunk"] = "tool_call_content_chunk";
|
|
16
16
|
HookEvent2["Plan"] = "plan";
|
|
17
|
-
HookEvent2["
|
|
18
|
-
HookEvent2["
|
|
17
|
+
HookEvent2["DecisionCreated"] = "decision.created";
|
|
18
|
+
HookEvent2["DecisionResolved"] = "decision.resolved";
|
|
19
19
|
HookEvent2["StateUpdate"] = "state_update";
|
|
20
20
|
HookEvent2["SessionFailed"] = "session.failed";
|
|
21
21
|
HookEvent2["SessionClosed"] = "session.closed";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/authoring/hooks.ts"],
|
|
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
|
|
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,
|
|
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 DecisionCreated = 'decision.created',\n DecisionResolved = 'decision.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`,\n// decisions `adec_\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 'decision.created': {\n decisionId: string;\n kind: 'permission' | 'elicitation' | 'authorization';\n request: JsonValue;\n };\n 'decision.resolved': { decisionId: 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,qBAAkB;AAClB,EAAAA,WAAA,sBAAmB;AACnB,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
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BaseCapability, DynamicEvent, InstructionRole, MANIFEST_VERSION, McpServerBindingKind, SandboxAccess, SandboxAttach, ScheduleTarget, ToolApproval, agentAvatarSchema, avatarMediaSchema, agentManifestSchema, baseToolsSchema, bundleSchema, channelBindingSchema, dynamicSlotSchema, emptyManifest, findDynamicSlots, harnessBindingSchema, hookBindingSchema, httpMcpServerBindingSchema, identitySchema, instructionFragmentSchema, isDynamicSlot, mcpAuthSchema, mcpServerBindingSchema, resolvedAgentManifestSchema, sandboxBindingSchema, scheduleDefinitionSchema, skillBundleSchema, skillFileSchema, toolDescriptorSchema, workerMcpServerBindingSchema, } from '@finalai/agent-provider';
|
|
2
|
-
export type { AgentAvatarIface, AvatarMedia, AvatarState, AgentManifestIface, BaseToolsIface, BundleIface, ChannelBindingIface, DynamicSlotIface, DynamicSlotLocationIface, HarnessBindingIface, HookBindingIface, HttpMcpServerBindingIface, IdentityIface, InstructionFragmentIface, McpAuth, McpServerBinding, ResolvedAgentManifestIface, ResolvedSandboxBindingIface, SandboxBindingIface, ScheduleDefinitionIface, SkillBundleIface, ToolDescriptorIface, WorkerMcpServerBindingIface, } from '@finalai/agent-provider';
|
|
1
|
+
export { BaseCapability, DynamicEvent, InstructionRole, MANIFEST_VERSION, McpServerBindingKind, SandboxAccess, SandboxAttach, ScheduleTarget, ToolApproval, agentAvatarSchema, avatarMediaSchema, agentManifestSchema, baseToolsSchema, bundleSchema, channelBindingSchema, dynamicSlotSchema, emptyManifest, findDynamicSlots, harnessBindingSchema, hookBindingSchema, httpMcpServerBindingSchema, identitySchema, instructionFragmentSchema, isDynamicSlot, mcpAuthSchema, mcpServerBindingSchema, resolvedAgentManifestSchema, sandboxBindingSchema, sandboxCredentialRefSchema, scheduleDefinitionSchema, skillBundleSchema, skillFileSchema, toolDescriptorSchema, workerMcpServerBindingSchema, } from '@finalai/agent-provider';
|
|
2
|
+
export type { AgentAvatarIface, AvatarMedia, AvatarState, AgentManifestIface, BaseToolsIface, BundleIface, ChannelBindingIface, DynamicSlotIface, DynamicSlotLocationIface, HarnessBindingIface, HookBindingIface, HttpMcpServerBindingIface, IdentityIface, InstructionFragmentIface, McpAuth, McpServerBinding, ResolvedAgentManifestIface, ResolvedSandboxBindingIface, SandboxBindingIface, SandboxCredentialRefIface, ScheduleDefinitionIface, SkillBundleIface, ToolDescriptorIface, WorkerMcpServerBindingIface, } from '@finalai/agent-provider';
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
mcpServerBindingSchema,
|
|
28
28
|
resolvedAgentManifestSchema,
|
|
29
29
|
sandboxBindingSchema,
|
|
30
|
+
sandboxCredentialRefSchema,
|
|
30
31
|
scheduleDefinitionSchema,
|
|
31
32
|
skillBundleSchema,
|
|
32
33
|
skillFileSchema,
|
|
@@ -62,6 +63,7 @@ export {
|
|
|
62
63
|
mcpServerBindingSchema,
|
|
63
64
|
resolvedAgentManifestSchema,
|
|
64
65
|
sandboxBindingSchema,
|
|
66
|
+
sandboxCredentialRefSchema,
|
|
65
67
|
scheduleDefinitionSchema,
|
|
66
68
|
skillBundleSchema,
|
|
67
69
|
skillFileSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["// The Agent Manifest lives in the provider contract (harnesses, sandboxes and\n// channels receive it); this package compiles directories into it.\nexport {\n BaseCapability,\n DynamicEvent,\n InstructionRole,\n MANIFEST_VERSION,\n McpServerBindingKind,\n SandboxAccess,\n SandboxAttach,\n ScheduleTarget,\n ToolApproval,\n agentAvatarSchema,\n avatarMediaSchema,\n agentManifestSchema,\n baseToolsSchema,\n bundleSchema,\n channelBindingSchema,\n dynamicSlotSchema,\n emptyManifest,\n findDynamicSlots,\n harnessBindingSchema,\n hookBindingSchema,\n httpMcpServerBindingSchema,\n identitySchema,\n instructionFragmentSchema,\n isDynamicSlot,\n mcpAuthSchema,\n mcpServerBindingSchema,\n resolvedAgentManifestSchema,\n sandboxBindingSchema,\n scheduleDefinitionSchema,\n skillBundleSchema,\n skillFileSchema,\n toolDescriptorSchema,\n workerMcpServerBindingSchema,\n} from '@finalai/agent-provider';\nexport type {\n AgentAvatarIface,\n AvatarMedia,\n AvatarState,\n AgentManifestIface,\n BaseToolsIface,\n BundleIface,\n ChannelBindingIface,\n DynamicSlotIface,\n DynamicSlotLocationIface,\n HarnessBindingIface,\n HookBindingIface,\n HttpMcpServerBindingIface,\n IdentityIface,\n InstructionFragmentIface,\n McpAuth,\n McpServerBinding,\n ResolvedAgentManifestIface,\n ResolvedSandboxBindingIface,\n SandboxBindingIface,\n ScheduleDefinitionIface,\n SkillBundleIface,\n ToolDescriptorIface,\n WorkerMcpServerBindingIface,\n} from '@finalai/agent-provider';\n"],
|
|
5
|
-
"mappings": "AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
4
|
+
"sourcesContent": ["// The Agent Manifest lives in the provider contract (harnesses, sandboxes and\n// channels receive it); this package compiles directories into it.\nexport {\n BaseCapability,\n DynamicEvent,\n InstructionRole,\n MANIFEST_VERSION,\n McpServerBindingKind,\n SandboxAccess,\n SandboxAttach,\n ScheduleTarget,\n ToolApproval,\n agentAvatarSchema,\n avatarMediaSchema,\n agentManifestSchema,\n baseToolsSchema,\n bundleSchema,\n channelBindingSchema,\n dynamicSlotSchema,\n emptyManifest,\n findDynamicSlots,\n harnessBindingSchema,\n hookBindingSchema,\n httpMcpServerBindingSchema,\n identitySchema,\n instructionFragmentSchema,\n isDynamicSlot,\n mcpAuthSchema,\n mcpServerBindingSchema,\n resolvedAgentManifestSchema,\n sandboxBindingSchema,\n sandboxCredentialRefSchema,\n scheduleDefinitionSchema,\n skillBundleSchema,\n skillFileSchema,\n toolDescriptorSchema,\n workerMcpServerBindingSchema,\n} from '@finalai/agent-provider';\nexport type {\n AgentAvatarIface,\n AvatarMedia,\n AvatarState,\n AgentManifestIface,\n BaseToolsIface,\n BundleIface,\n ChannelBindingIface,\n DynamicSlotIface,\n DynamicSlotLocationIface,\n HarnessBindingIface,\n HookBindingIface,\n HttpMcpServerBindingIface,\n IdentityIface,\n InstructionFragmentIface,\n McpAuth,\n McpServerBinding,\n ResolvedAgentManifestIface,\n ResolvedSandboxBindingIface,\n SandboxBindingIface,\n SandboxCredentialRefIface,\n ScheduleDefinitionIface,\n SkillBundleIface,\n ToolDescriptorIface,\n WorkerMcpServerBindingIface,\n} from '@finalai/agent-provider';\n"],
|
|
5
|
+
"mappings": "AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finalai/agent-definition",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Provider-independent agent authoring, manifest schemas, directory compiler, and harness compatibility reports.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"registry": "https://registry.npmjs.org/"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@finalai/agent-protocol": "0.
|
|
79
|
-
"@finalai/agent-provider": "0.
|
|
78
|
+
"@finalai/agent-protocol": "0.6.0",
|
|
79
|
+
"@finalai/agent-provider": "0.5.1",
|
|
80
80
|
"ajv": "^8.20.0",
|
|
81
81
|
"ajv-formats": "^3.0.1",
|
|
82
82
|
"croner": "^10.0.1",
|
|
File without changes
|