@finalai/agent-definition 0.5.0 → 0.6.0

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.
Files changed (93) hide show
  1. package/HOSTING.md +7 -7
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/compiler-assets/{chunk-FU5VHNO4.ts → chunk-3R7MNW5L.ts} +1 -1
  4. package/dist/compiler-assets/{chunk-7KPWSOMK.ts → chunk-3SDZJK7K.ts} +1 -1
  5. package/dist/compiler-assets/{chunk-KTXTYIF4.ts → chunk-4A4EQHYK.ts} +57 -20
  6. package/dist/compiler-assets/{chunk-S5ON7OBR.ts → chunk-4MJF3ALN.ts} +5 -5
  7. package/dist/compiler-assets/{chunk-QVHDGZAN.ts → chunk-4T2URCJZ.ts} +2 -2
  8. package/dist/compiler-assets/{chunk-7MDGEPFT.ts → chunk-6K3WO73F.ts} +1 -1
  9. package/dist/compiler-assets/{chunk-KMBQVNAJ.ts → chunk-AMYJRTAC.ts} +3 -3
  10. package/dist/compiler-assets/{chunk-OVAUXBQU.ts → chunk-BHNF7BEJ.ts} +86 -17
  11. package/dist/compiler-assets/{chunk-L7E6UQX3.ts → chunk-CORCFNEY.ts} +3 -3
  12. package/dist/compiler-assets/{chunk-4ERFBLH7.ts → chunk-DRHDNSCQ.ts} +4 -4
  13. package/dist/compiler-assets/{chunk-O3JKMLDP.ts → chunk-EKR4AEM5.ts} +3 -3
  14. package/dist/compiler-assets/{chunk-YOE37BRR.ts → chunk-FE7PIPSW.ts} +57 -10
  15. package/dist/compiler-assets/{chunk-V5E4RKG6.ts → chunk-FFI2K5IJ.ts} +4 -4
  16. package/dist/compiler-assets/{chunk-36MVFRMA.ts → chunk-IZJMGIAH.ts} +2 -2
  17. package/dist/compiler-assets/{chunk-KTBNDKGJ.ts → chunk-JZTF36V2.ts} +2 -1
  18. package/dist/compiler-assets/{chunk-XJNO7EHQ.ts → chunk-KNYB36DW.ts} +2 -2
  19. package/dist/compiler-assets/{chunk-TFPXCL5W.ts → chunk-L7YJCQVB.ts} +4 -4
  20. package/dist/compiler-assets/{chunk-WJPAUIVM.ts → chunk-LGGJ6S3U.ts} +1 -1
  21. package/dist/compiler-assets/{chunk-JW4Y5OAP.ts → chunk-LIRONA4O.ts} +6 -6
  22. package/dist/compiler-assets/{chunk-ZICJVGG7.ts → chunk-MM4JCZSK.ts} +7 -7
  23. package/dist/compiler-assets/{chunk-VI5WBWUX.ts → chunk-MPZMRU56.ts} +4 -4
  24. package/dist/compiler-assets/chunk-PLQKTBKO.ts +27 -0
  25. package/dist/compiler-assets/{chunk-GOIK7WNT.ts → chunk-Q26ZPNVB.ts} +31 -12
  26. package/dist/compiler-assets/{chunk-Z7HGOUC2.ts → chunk-RTC7AJBS.ts} +1 -1
  27. package/dist/compiler-assets/{chunk-OX46N5EP.ts → chunk-TCXQ4GLM.ts} +1 -1
  28. package/dist/compiler-assets/{chunk-R4IHPPTB.ts → chunk-UUQAHJRT.ts} +2 -2
  29. package/dist/compiler-assets/{chunk-KNFPKVUS.ts → chunk-XCX6VAK7.ts} +1 -1
  30. package/dist/compiler-assets/{chunk-OBFQTLWC.ts → chunk-Y73DOSSB.ts} +3 -3
  31. package/dist/compiler-assets/{chunk-2LYL3UFK.ts → chunk-YAO6DUQO.ts} +4 -4
  32. package/dist/compiler-assets/src/authoring/agent.ts +4 -4
  33. package/dist/compiler-assets/src/authoring/approval.ts +7 -7
  34. package/dist/compiler-assets/src/authoring/brand.ts +3 -3
  35. package/dist/compiler-assets/src/authoring/channels.ts +6 -8
  36. package/dist/compiler-assets/src/authoring/connections.ts +11 -11
  37. package/dist/compiler-assets/src/authoring/credentials.ts +7 -7
  38. package/dist/compiler-assets/src/authoring/dynamic.ts +8 -8
  39. package/dist/compiler-assets/src/authoring/harness.ts +9 -9
  40. package/dist/compiler-assets/src/authoring/hooks.ts +10 -10
  41. package/dist/compiler-assets/src/authoring/index.ts +27 -26
  42. package/dist/compiler-assets/src/authoring/instructions.ts +9 -9
  43. package/dist/compiler-assets/src/authoring/sandbox.ts +11 -11
  44. package/dist/compiler-assets/src/authoring/schedules.ts +4 -4
  45. package/dist/compiler-assets/src/authoring/skills.ts +4 -4
  46. package/dist/compiler-assets/src/authoring/tools.ts +9 -9
  47. package/dist/compiler-assets/src/compatibility.ts +6 -6
  48. package/dist/compiler-assets/src/hosted-bindings.ts +6 -6
  49. package/dist/compiler-assets/src/index.ts +30 -27
  50. package/dist/compiler-assets/src/manifest.ts +6 -4
  51. package/dist/compiler-assets/src/resolve.ts +5 -5
  52. package/dist/compiler-assets/src/runtime/bundle.ts +17 -18
  53. package/dist/compiler-assets/src/runtime/describe.ts +14 -14
  54. package/dist/compiler-assets/src/runtime/described.ts +28 -16
  55. package/dist/compiler-assets/src/runtime/isolate.ts +16 -17
  56. package/dist/compiler-assets/src/runtime/lower.ts +13 -13
  57. package/dist/compiler-assets/src/runtime/schema-validation.ts +4 -4
  58. package/dist/compiler-assets/src/runtime/values.ts +2 -2
  59. package/dist/modules/authoring/agent.d.mts +25 -1
  60. package/dist/modules/authoring/agent.mjs.map +2 -2
  61. package/dist/modules/authoring/brand.d.mts +1 -0
  62. package/dist/modules/authoring/brand.mjs +1 -0
  63. package/dist/modules/authoring/brand.mjs.map +2 -2
  64. package/dist/modules/authoring/channels.d.mts +13 -96
  65. package/dist/modules/authoring/channels.mjs +6 -52
  66. package/dist/modules/authoring/channels.mjs.map +3 -3
  67. package/dist/modules/authoring/index.d.mts +1 -1
  68. package/dist/modules/authoring/index.mjs +2 -0
  69. package/dist/modules/authoring/index.mjs.map +2 -2
  70. package/dist/modules/compiler/assemble.d.mts +0 -4
  71. package/dist/modules/compiler/assemble.mjs +55 -23
  72. package/dist/modules/compiler/assemble.mjs.map +2 -2
  73. package/dist/modules/compiler/bundle.mjs.map +1 -1
  74. package/dist/modules/compiler/index.d.mts +1 -4
  75. package/dist/modules/compiler/index.mjs +4 -3
  76. package/dist/modules/compiler/index.mjs.map +2 -2
  77. package/dist/modules/manifest.d.mts +2 -2
  78. package/dist/modules/manifest.mjs +2 -0
  79. package/dist/modules/manifest.mjs.map +2 -2
  80. package/dist/modules/runtime/describe.mjs +49 -2
  81. package/dist/modules/runtime/describe.mjs.map +2 -2
  82. package/dist/modules/runtime/described.d.mts +94 -3
  83. package/dist/modules/runtime/described.mjs +14 -2
  84. package/dist/modules/runtime/described.mjs.map +2 -2
  85. package/dist/modules/runtime/isolate.d.mts +3 -2
  86. package/dist/modules/runtime/isolate.mjs +2 -0
  87. package/dist/modules/runtime/isolate.mjs.map +2 -2
  88. package/fixtures/release-scout/agent/channels/github.ts +2 -38
  89. package/fixtures/release-scout/agent/hooks/audit.ts +1 -1
  90. package/fixtures/release-scout/agent/instructions/org-context.ts +1 -1
  91. package/package.json +4 -4
  92. package/dist/compiler-assets/chunk-ISYIPH2T.ts +0 -120
  93. package/dist/compiler-assets/chunk-JRKGCYWA.ts +0 -87
@@ -1,120 +0,0 @@
1
- import {
2
- jsonObjectSchema
3
- } from "./chunk-FU5VHNO4.ts";
4
- import {
5
- stamp
6
- } from "./chunk-KTBNDKGJ.ts";
7
- import {
8
- array,
9
- object,
10
- string
11
- } from "./chunk-KTXTYIF4.ts";
12
-
13
- // ../agent-provider/src/channel-context.ts
14
- var channelInputReceiptSchema = object({
15
- inputId: string().min(1),
16
- sessionId: string().min(1)
17
- });
18
- var channelHandoffReceiptSchema = object({
19
- inputId: string().min(1).nullable(),
20
- sessionId: string().min(1).nullable()
21
- });
22
- var channelAccessors = (platform) => {
23
- const operations = () => {
24
- if (platform.channelSessions == null)
25
- throw new Error("channel session operations are unavailable");
26
- return platform.channelSessions;
27
- };
28
- const handle = (target) => ({
29
- inspect: () => operations().inspect(target),
30
- resolveSession: () => operations().resolve(target),
31
- send: (input) => operations().send(target, input),
32
- respond: (input) => operations().respond(target, input),
33
- cancel: (input) => operations().cancel(target, input),
34
- close: () => operations().close(target),
35
- observe: (input) => operations().observe(target, input),
36
- setConfigOption: (input) => operations().setConfigOption(target, input),
37
- park: () => operations().park(target),
38
- getState: () => operations().getState(target),
39
- setState: (state) => operations().setState(target, state)
40
- });
41
- return {
42
- from: (address) => handle({ address }),
43
- resolveSession: (address) => operations().resolve({ address }),
44
- attachSession: (sessionId) => handle({ sessionId }),
45
- to: (channel, target) => ({ send: (input) => operations().handoff(channel, target, input) })
46
- };
47
- };
48
-
49
- // ../agent-provider/src/semantic-events.ts
50
- var channelMessageCompletedSchema = object({
51
- message: object({ id: string(), content: array(jsonObjectSchema) }),
52
- finishReason: string().nullable()
53
- });
54
- var channelTurnEventSchema = object({
55
- turnId: string(),
56
- stopReason: string().nullable().optional()
57
- });
58
-
59
- // src/authoring/channels.ts
60
- var defineChannel = (definition) => {
61
- const {
62
- "message.delta": delta,
63
- "message.completed": completed,
64
- "turn.started": started,
65
- "turn.completed": ended,
66
- ...raw
67
- } = definition.events ?? {};
68
- const events = { ...raw };
69
- const wrap = (schema, handler) => handler == null ? void 0 : async (event, ctx) => handler(
70
- schema.parse(event.data),
71
- { ...channelAccessors(ctx.platform), platform: ctx.platform },
72
- {
73
- sessionId: ctx.sessionId ?? null,
74
- turnId: ctx.turn.id,
75
- state: ctx.state,
76
- config: ctx.config,
77
- secrets: ctx.secrets
78
- }
79
- );
80
- const semantic = {
81
- "message.delta": wrap(object({ messageId: string(), delta: jsonObjectSchema }), delta),
82
- "message.completed": wrap(channelMessageCompletedSchema, completed),
83
- "turn.started": wrap(object({ turnId: string() }), started),
84
- "turn.completed": wrap(
85
- object({ turnId: string(), stopReason: string().nullable() }),
86
- ended
87
- )
88
- };
89
- for (const [kind, handler] of Object.entries(semantic))
90
- if (handler != null) events[kind] = handler;
91
- const { installed, configure, ...authored } = definition;
92
- return stamp(
93
- { ...authored, configure: installed == null ? configure : void 0, events },
94
- "channel" /* Channel */
95
- );
96
- };
97
- var disableChannel = () => defineChannel({ disabled: true });
98
- var route = (method) => (path, handler) => ({
99
- method,
100
- path,
101
- handler
102
- });
103
- var GET = route("GET");
104
- var POST = route("POST");
105
- var PUT = route("PUT");
106
- var DELETE = route("DELETE");
107
- var WS = (path, handler) => ({ method: "WS", path, handler });
108
- var defineProviderChannel = (definition) => stamp(definition, "channel" /* Channel */);
109
-
110
- export {
111
- channelAccessors,
112
- defineChannel,
113
- disableChannel,
114
- GET,
115
- POST,
116
- PUT,
117
- DELETE,
118
- WS,
119
- defineProviderChannel
120
- };
@@ -1,87 +0,0 @@
1
- import {
2
- jsonObjectSchema,
3
- jsonValueSchema
4
- } from "./chunk-FU5VHNO4.ts";
5
- import {
6
- _null,
7
- array,
8
- literal,
9
- looseObject,
10
- nativeEnum,
11
- object,
12
- string,
13
- union
14
- } from "./chunk-KTXTYIF4.ts";
15
-
16
- // ../agent-provider/src/channel.ts
17
- var ChannelPrincipalType = /* @__PURE__ */ ((ChannelPrincipalType2) => {
18
- ChannelPrincipalType2["User"] = "user";
19
- ChannelPrincipalType2["Service"] = "service";
20
- return ChannelPrincipalType2;
21
- })(ChannelPrincipalType || {});
22
- var channelAuthSchema = object({
23
- principalId: string().min(1),
24
- principalType: nativeEnum(ChannelPrincipalType),
25
- authenticator: string().min(1),
26
- // How the agent and the people reading its reply name the principal.
27
- displayName: string().min(1).max(200).optional(),
28
- attributes: jsonObjectSchema.default({})
29
- });
30
- var ConversationKind = /* @__PURE__ */ ((ConversationKind2) => {
31
- ConversationKind2["Direct"] = "direct";
32
- ConversationKind2["Group"] = "group";
33
- return ConversationKind2;
34
- })(ConversationKind || {});
35
- var ParticipantKind = /* @__PURE__ */ ((ParticipantKind2) => {
36
- ParticipantKind2["User"] = "user";
37
- ParticipantKind2["Agent"] = "agent";
38
- return ParticipantKind2;
39
- })(ParticipantKind || {});
40
- var MessageKind = /* @__PURE__ */ ((MessageKind2) => {
41
- MessageKind2["Message"] = "message";
42
- MessageKind2["Card"] = "card";
43
- return MessageKind2;
44
- })(MessageKind || {});
45
- var channelReceiveResultSchema = union([
46
- object({ conversationId: string().min(1) }),
47
- object({ sessionId: string().min(1) }),
48
- _null()
49
- ]);
50
- var channelMessageInputSchema = object({
51
- conversationId: string().min(1),
52
- authorParticipantId: string().min(1),
53
- kind: nativeEnum(MessageKind).default("message" /* Message */),
54
- content: array(jsonObjectSchema).min(1),
55
- clientMessageId: string().min(1).nullish(),
56
- replyToMessageId: string().min(1).nullish(),
57
- threadRootId: string().min(1).nullish(),
58
- quotedMessageIds: array(string().min(1)).default([]),
59
- mentionedParticipantIds: array(string().min(1)).default([])
60
- });
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
- audienceParticipantIds: array(string()),
70
- request: jsonValueSchema
71
- });
72
- var decisionResolvedDataSchema = object({
73
- decisionId: string().min(1),
74
- outcome: jsonValueSchema,
75
- respondedBy: channelAuthSchema.nullable().default(null)
76
- });
77
- var turnEndSchema = looseObject({
78
- sessionUpdate: literal("state_update"),
79
- state: literal("idle"),
80
- stopReason: string().nullish(),
81
- _meta: looseObject({ "final.ai": looseObject({ stopReason: string().nullish() }).nullish() }).nullish()
82
- });
83
-
84
- export {
85
- ConversationKind,
86
- ParticipantKind
87
- };