@finalai/agent-definition 0.1.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.

Potentially problematic release.


This version of @finalai/agent-definition might be problematic. Click here for more details.

Files changed (206) hide show
  1. package/README.md +16 -0
  2. package/THIRD_PARTY_NOTICES.md +303 -0
  3. package/dist/compiler-assets/chunk-2CZRHOLL.ts +10 -0
  4. package/dist/compiler-assets/chunk-32O3ODZE.ts +39 -0
  5. package/dist/compiler-assets/chunk-5BK6FVRE.ts +75 -0
  6. package/dist/compiler-assets/chunk-6WR3PGNF.ts +0 -0
  7. package/dist/compiler-assets/chunk-7QP2CKPI.ts +30 -0
  8. package/dist/compiler-assets/chunk-7VSSVZM4.ts +55 -0
  9. package/dist/compiler-assets/chunk-7WGYG73V.ts +42 -0
  10. package/dist/compiler-assets/chunk-BLB6JGLO.ts +481 -0
  11. package/dist/compiler-assets/chunk-CWWRTRWW.ts +76 -0
  12. package/dist/compiler-assets/chunk-EVQIK62B.ts +188 -0
  13. package/dist/compiler-assets/chunk-GNR7XBPN.ts +3364 -0
  14. package/dist/compiler-assets/chunk-GTUZOATD.ts +10 -0
  15. package/dist/compiler-assets/chunk-HFS4KLEL.ts +10 -0
  16. package/dist/compiler-assets/chunk-HGW4YHAY.ts +6865 -0
  17. package/dist/compiler-assets/chunk-HNPUTP35.ts +172 -0
  18. package/dist/compiler-assets/chunk-JIPNTA56.ts +59 -0
  19. package/dist/compiler-assets/chunk-JNJE72EH.ts +10 -0
  20. package/dist/compiler-assets/chunk-JPY4L2UJ.ts +349 -0
  21. package/dist/compiler-assets/chunk-JTGTLYDT.ts +0 -0
  22. package/dist/compiler-assets/chunk-LUSAAV4L.ts +33 -0
  23. package/dist/compiler-assets/chunk-MZMSKIKU.ts +472 -0
  24. package/dist/compiler-assets/chunk-NMYHO2QN.ts +25 -0
  25. package/dist/compiler-assets/chunk-NYTOYKKF.ts +28 -0
  26. package/dist/compiler-assets/chunk-OWC6SFFF.ts +295 -0
  27. package/dist/compiler-assets/chunk-QMKWAFVZ.ts +59 -0
  28. package/dist/compiler-assets/chunk-QMWTDPNT.ts +79 -0
  29. package/dist/compiler-assets/chunk-RWUIMTBI.ts +13 -0
  30. package/dist/compiler-assets/chunk-SKTNMUO7.ts +64 -0
  31. package/dist/compiler-assets/chunk-T6WG4L4M.ts +19 -0
  32. package/dist/compiler-assets/chunk-TATN3PYK.ts +81 -0
  33. package/dist/compiler-assets/chunk-VHXHUU7L.ts +16 -0
  34. package/dist/compiler-assets/chunk-WMXMVFHM.ts +121 -0
  35. package/dist/compiler-assets/chunk-XHKPWT3G.ts +55 -0
  36. package/dist/compiler-assets/chunk-ZDLVA6XF.ts +476 -0
  37. package/dist/compiler-assets/src/authoring/agent.ts +10 -0
  38. package/dist/compiler-assets/src/authoring/approval.ts +19 -0
  39. package/dist/compiler-assets/src/authoring/brand.ts +23 -0
  40. package/dist/compiler-assets/src/authoring/channels.ts +26 -0
  41. package/dist/compiler-assets/src/authoring/connections.ts +10 -0
  42. package/dist/compiler-assets/src/authoring/context.ts +7 -0
  43. package/dist/compiler-assets/src/authoring/credentials.ts +21 -0
  44. package/dist/compiler-assets/src/authoring/dynamic.ts +10 -0
  45. package/dist/compiler-assets/src/authoring/harness.ts +17 -0
  46. package/dist/compiler-assets/src/authoring/hooks.ts +28 -0
  47. package/dist/compiler-assets/src/authoring/index.ts +110 -0
  48. package/dist/compiler-assets/src/authoring/instructions.ts +14 -0
  49. package/dist/compiler-assets/src/authoring/sandbox.ts +25 -0
  50. package/dist/compiler-assets/src/authoring/schedules.ts +10 -0
  51. package/dist/compiler-assets/src/authoring/skills.ts +10 -0
  52. package/dist/compiler-assets/src/authoring/tools.ts +23 -0
  53. package/dist/compiler-assets/src/compatibility.ts +14810 -0
  54. package/dist/compiler-assets/src/compiler/evaluate-child.mjs +77 -0
  55. package/dist/compiler-assets/src/index.ts +195 -0
  56. package/dist/compiler-assets/src/manifest.ts +72 -0
  57. package/dist/compiler-assets/src/resolve.ts +19 -0
  58. package/dist/compiler-assets/src/runtime/bundle.ts +72 -0
  59. package/dist/compiler-assets/src/runtime/describe.ts +31 -0
  60. package/dist/compiler-assets/src/runtime/described.ts +142 -0
  61. package/dist/compiler-assets/src/runtime/isolate.ts +28 -0
  62. package/dist/compiler-assets/src/runtime/layout.ts +15 -0
  63. package/dist/compiler-assets/src/runtime/lower.ts +52 -0
  64. package/dist/compiler-assets/src/runtime/schema-validation.ts +21 -0
  65. package/dist/compiler-assets/src/runtime/values.ts +38 -0
  66. package/dist/modules/authoring/agent.d.mts +22 -0
  67. package/dist/modules/authoring/agent.mjs +6 -0
  68. package/dist/modules/authoring/agent.mjs.map +7 -0
  69. package/dist/modules/authoring/approval.d.mts +17 -0
  70. package/dist/modules/authoring/approval.mjs +42 -0
  71. package/dist/modules/authoring/approval.mjs.map +7 -0
  72. package/dist/modules/authoring/brand.d.mts +27 -0
  73. package/dist/modules/authoring/brand.mjs +51 -0
  74. package/dist/modules/authoring/brand.mjs.map +7 -0
  75. package/dist/modules/authoring/channels.d.mts +41 -0
  76. package/dist/modules/authoring/channels.mjs +65 -0
  77. package/dist/modules/authoring/channels.mjs.map +7 -0
  78. package/dist/modules/authoring/connections.d.mts +23 -0
  79. package/dist/modules/authoring/connections.mjs +6 -0
  80. package/dist/modules/authoring/connections.mjs.map +7 -0
  81. package/dist/modules/authoring/context.d.mts +83 -0
  82. package/dist/modules/authoring/context.mjs +12 -0
  83. package/dist/modules/authoring/context.mjs.map +7 -0
  84. package/dist/modules/authoring/credentials.d.mts +10 -0
  85. package/dist/modules/authoring/credentials.mjs +31 -0
  86. package/dist/modules/authoring/credentials.mjs.map +7 -0
  87. package/dist/modules/authoring/dynamic.d.mts +30 -0
  88. package/dist/modules/authoring/dynamic.mjs +15 -0
  89. package/dist/modules/authoring/dynamic.mjs.map +7 -0
  90. package/dist/modules/authoring/harness.d.mts +85 -0
  91. package/dist/modules/authoring/harness.mjs +55 -0
  92. package/dist/modules/authoring/harness.mjs.map +7 -0
  93. package/dist/modules/authoring/hooks.d.mts +120 -0
  94. package/dist/modules/authoring/hooks.mjs +72 -0
  95. package/dist/modules/authoring/hooks.mjs.map +7 -0
  96. package/dist/modules/authoring/index.d.mts +27 -0
  97. package/dist/modules/authoring/index.mjs +63 -0
  98. package/dist/modules/authoring/index.mjs.map +7 -0
  99. package/dist/modules/authoring/instructions.d.mts +13 -0
  100. package/dist/modules/authoring/instructions.mjs +15 -0
  101. package/dist/modules/authoring/instructions.mjs.map +7 -0
  102. package/dist/modules/authoring/sandbox.d.mts +21 -0
  103. package/dist/modules/authoring/sandbox.mjs +13 -0
  104. package/dist/modules/authoring/sandbox.mjs.map +7 -0
  105. package/dist/modules/authoring/schedules.d.mts +8 -0
  106. package/dist/modules/authoring/schedules.mjs +6 -0
  107. package/dist/modules/authoring/schedules.mjs.map +7 -0
  108. package/dist/modules/authoring/skills.d.mts +8 -0
  109. package/dist/modules/authoring/skills.mjs +6 -0
  110. package/dist/modules/authoring/skills.mjs.map +7 -0
  111. package/dist/modules/authoring/tools.d.mts +80 -0
  112. package/dist/modules/authoring/tools.mjs +70 -0
  113. package/dist/modules/authoring/tools.mjs.map +7 -0
  114. package/dist/modules/compatibility.d.mts +36 -0
  115. package/dist/modules/compatibility.mjs +536 -0
  116. package/dist/modules/compatibility.mjs.map +7 -0
  117. package/dist/modules/compiler/assemble.d.mts +30 -0
  118. package/dist/modules/compiler/assemble.mjs +923 -0
  119. package/dist/modules/compiler/assemble.mjs.map +7 -0
  120. package/dist/modules/compiler/bundle.d.mts +22 -0
  121. package/dist/modules/compiler/bundle.mjs +385 -0
  122. package/dist/modules/compiler/bundle.mjs.map +7 -0
  123. package/dist/modules/compiler/diagnostics.d.mts +40 -0
  124. package/dist/modules/compiler/diagnostics.mjs +38 -0
  125. package/dist/modules/compiler/diagnostics.mjs.map +7 -0
  126. package/dist/modules/compiler/discovery.d.mts +36 -0
  127. package/dist/modules/compiler/discovery.mjs +158 -0
  128. package/dist/modules/compiler/discovery.mjs.map +7 -0
  129. package/dist/modules/compiler/evaluate.d.mts +13 -0
  130. package/dist/modules/compiler/evaluate.mjs +194 -0
  131. package/dist/modules/compiler/evaluate.mjs.map +7 -0
  132. package/dist/modules/compiler/files.d.mts +19 -0
  133. package/dist/modules/compiler/files.mjs +90 -0
  134. package/dist/modules/compiler/files.mjs.map +7 -0
  135. package/dist/modules/compiler/frontmatter.d.mts +9 -0
  136. package/dist/modules/compiler/frontmatter.mjs +34 -0
  137. package/dist/modules/compiler/frontmatter.mjs.map +7 -0
  138. package/dist/modules/compiler/index.d.mts +49 -0
  139. package/dist/modules/compiler/index.mjs +244 -0
  140. package/dist/modules/compiler/index.mjs.map +7 -0
  141. package/dist/modules/compiler/load.d.mts +8 -0
  142. package/dist/modules/compiler/load.mjs +45 -0
  143. package/dist/modules/compiler/load.mjs.map +7 -0
  144. package/dist/modules/compiler/local-isolate.d.mts +20 -0
  145. package/dist/modules/compiler/local-isolate.mjs +93 -0
  146. package/dist/modules/compiler/local-isolate.mjs.map +7 -0
  147. package/dist/modules/compiler/packages.d.mts +66 -0
  148. package/dist/modules/compiler/packages.mjs +307 -0
  149. package/dist/modules/compiler/packages.mjs.map +7 -0
  150. package/dist/modules/index.d.mts +7 -0
  151. package/dist/modules/index.mjs +25 -0
  152. package/dist/modules/index.mjs.map +7 -0
  153. package/dist/modules/manifest.d.mts +2 -0
  154. package/dist/modules/manifest.mjs +67 -0
  155. package/dist/modules/manifest.mjs.map +7 -0
  156. package/dist/modules/resolve.d.mts +24 -0
  157. package/dist/modules/resolve.mjs +176 -0
  158. package/dist/modules/resolve.mjs.map +7 -0
  159. package/dist/modules/runtime/bundle.d.mts +12 -0
  160. package/dist/modules/runtime/bundle.mjs +48 -0
  161. package/dist/modules/runtime/bundle.mjs.map +7 -0
  162. package/dist/modules/runtime/describe.d.mts +19 -0
  163. package/dist/modules/runtime/describe.mjs +471 -0
  164. package/dist/modules/runtime/describe.mjs.map +7 -0
  165. package/dist/modules/runtime/described.d.mts +376 -0
  166. package/dist/modules/runtime/described.mjs +116 -0
  167. package/dist/modules/runtime/described.mjs.map +7 -0
  168. package/dist/modules/runtime/isolate.d.mts +70 -0
  169. package/dist/modules/runtime/isolate.mjs +454 -0
  170. package/dist/modules/runtime/isolate.mjs.map +7 -0
  171. package/dist/modules/runtime/layout.d.mts +21 -0
  172. package/dist/modules/runtime/layout.mjs +24 -0
  173. package/dist/modules/runtime/layout.mjs.map +7 -0
  174. package/dist/modules/runtime/lower.d.mts +73 -0
  175. package/dist/modules/runtime/lower.mjs +463 -0
  176. package/dist/modules/runtime/lower.mjs.map +7 -0
  177. package/dist/modules/runtime/schema-validation.d.mts +21 -0
  178. package/dist/modules/runtime/schema-validation.mjs +238 -0
  179. package/dist/modules/runtime/schema-validation.mjs.map +7 -0
  180. package/dist/modules/runtime/values.d.mts +20 -0
  181. package/dist/modules/runtime/values.mjs +48 -0
  182. package/dist/modules/runtime/values.mjs.map +7 -0
  183. package/fixtures/acme-fleet/agent/agent.ts +74 -0
  184. package/fixtures/acme-fleet/agent/instructions.md +1 -0
  185. package/fixtures/assistant/agent/agent.ts +16 -0
  186. package/fixtures/assistant/agent/instructions.md +1 -0
  187. package/fixtures/assistant/agent/tools/current_time.ts +9 -0
  188. package/fixtures/assistant-with-tools/agent/agent.ts +16 -0
  189. package/fixtures/assistant-with-tools/agent/instructions.md +1 -0
  190. package/fixtures/assistant-with-tools/agent/tools/current_time.ts +9 -0
  191. package/fixtures/final-connection/agent/agent.ts +15 -0
  192. package/fixtures/final-connection/agent/connections/final.ts +9 -0
  193. package/fixtures/release-scout/agent/agent.ts +22 -0
  194. package/fixtures/release-scout/agent/channels/github-signature.ts +27 -0
  195. package/fixtures/release-scout/agent/channels/github.ts +38 -0
  196. package/fixtures/release-scout/agent/connections/linear.ts +9 -0
  197. package/fixtures/release-scout/agent/hooks/audit.ts +24 -0
  198. package/fixtures/release-scout/agent/instructions/org-context.ts +26 -0
  199. package/fixtures/release-scout/agent/instructions.md +2 -0
  200. package/fixtures/release-scout/agent/sandbox.ts +20 -0
  201. package/fixtures/release-scout/agent/schedules/daily-digest.md +7 -0
  202. package/fixtures/release-scout/agent/skills/triage/SKILL.md +8 -0
  203. package/fixtures/release-scout/agent/skills/triage/checklist.md +3 -0
  204. package/fixtures/release-scout/agent/tools/lookup_release_notes.ts +24 -0
  205. package/fixtures/tsconfig.json +5 -0
  206. package/package.json +94 -0
@@ -0,0 +1,77 @@
1
+ // Runs one agent bundle's top-level code to read its static description.
2
+ // Started by evaluate.ts as a separate Node process with an empty
3
+ // environment, the permission model (no filesystem beyond this file, no
4
+ // network, child processes, workers or addons), a memory cap and a hard
5
+ // timeout. node:vm is not a security boundary; this process is. The vm
6
+ // context below is defense in depth and keeps authored globals predictable.
7
+ //
8
+ // Protocol: the evaluation script on stdin; one JSON line on stdout,
9
+ // { ok: true, described: string } or { ok: false, message: string }.
10
+ import vm from 'node:vm';
11
+
12
+ const EVALUATION_TIMEOUT_MS = 10_000;
13
+
14
+ const offline = () => {
15
+ throw new Error(
16
+ 'network access is not available while compiling; move it into a tool or a defineDynamic resolver',
17
+ );
18
+ };
19
+
20
+ const noop = () => undefined;
21
+
22
+ const createContext = () =>
23
+ vm.createContext(
24
+ {
25
+ console: { log: noop, info: noop, warn: noop, error: noop, debug: noop, trace: noop },
26
+ URL,
27
+ URLSearchParams,
28
+ TextEncoder,
29
+ TextDecoder,
30
+ ReadableStream,
31
+ WritableStream,
32
+ TransformStream,
33
+ AbortController,
34
+ AbortSignal,
35
+ Headers,
36
+ Request,
37
+ Response,
38
+ Blob,
39
+ structuredClone,
40
+ atob,
41
+ btoa,
42
+ queueMicrotask,
43
+ crypto: {
44
+ randomUUID: () => globalThis.crypto.randomUUID(),
45
+ getRandomValues: (array) => globalThis.crypto.getRandomValues(array),
46
+ },
47
+ fetch: offline,
48
+ setTimeout: offline,
49
+ setInterval: offline,
50
+ },
51
+ { name: 'final-agent-compile', codeGeneration: { strings: false, wasm: false } },
52
+ );
53
+
54
+ const messageOf = (cause) => (cause instanceof Error ? cause.message : String(cause));
55
+
56
+ const reply = (message) =>
57
+ new Promise((resolve) => {
58
+ process.stdout.write(`${JSON.stringify(message)}\n`, () => resolve());
59
+ });
60
+
61
+ const chunks = [];
62
+ for await (const chunk of process.stdin) chunks.push(chunk);
63
+ const script = Buffer.concat(chunks).toString('utf8');
64
+
65
+ try {
66
+ const described = vm.runInContext(script, createContext(), {
67
+ timeout: EVALUATION_TIMEOUT_MS,
68
+ filename: 'agent-bundle.js',
69
+ });
70
+ await reply({ ok: true, described: String(described) });
71
+ } catch (cause) {
72
+ await reply({
73
+ ok: false,
74
+ message: `evaluating the authored modules failed: ${messageOf(cause)}`,
75
+ });
76
+ }
77
+ process.exit(0);
@@ -0,0 +1,195 @@
1
+ import "../chunk-JTGTLYDT.ts";
2
+ import {
3
+ SlotValueKind,
4
+ resolveManifest,
5
+ resolveManifestDetailed,
6
+ slotKindOf,
7
+ validateSlotValue
8
+ } from "../chunk-EVQIK62B.ts";
9
+ import {
10
+ AGENT_DYNAMIC_PREFIX,
11
+ AUTHORED_SERVER_KEY,
12
+ COMBINED_MCP_SERVERS_EXPORT
13
+ } from "../chunk-NMYHO2QN.ts";
14
+ import "../chunk-6WR3PGNF.ts";
15
+ import {
16
+ completeHarnessDescription,
17
+ defineHarness
18
+ } from "../chunk-QMKWAFVZ.ts";
19
+ import {
20
+ HookEvent,
21
+ defineHook
22
+ } from "../chunk-QMWTDPNT.ts";
23
+ import {
24
+ defineInstructions
25
+ } from "../chunk-VHXHUU7L.ts";
26
+ import {
27
+ baseTools,
28
+ defineSandbox,
29
+ defineSandboxProvider,
30
+ harnessHost
31
+ } from "../chunk-LUSAAV4L.ts";
32
+ import "../chunk-CWWRTRWW.ts";
33
+ import {
34
+ SandboxWire
35
+ } from "../chunk-JPY4L2UJ.ts";
36
+ import {
37
+ defineSchedule
38
+ } from "../chunk-GTUZOATD.ts";
39
+ import {
40
+ defineSkill
41
+ } from "../chunk-HFS4KLEL.ts";
42
+ import {
43
+ defineTool,
44
+ toolResultFrom
45
+ } from "../chunk-TATN3PYK.ts";
46
+ import "../chunk-GNR7XBPN.ts";
47
+ import "../chunk-7WGYG73V.ts";
48
+ import {
49
+ defineAgent
50
+ } from "../chunk-2CZRHOLL.ts";
51
+ import {
52
+ always,
53
+ never,
54
+ whenInput
55
+ } from "../chunk-7VSSVZM4.ts";
56
+ import {
57
+ BaseCapability,
58
+ InstructionRole,
59
+ MANIFEST_VERSION,
60
+ McpServerBindingKind,
61
+ SandboxAccess,
62
+ SandboxAttach,
63
+ ScheduleTarget,
64
+ ToolApproval,
65
+ agentManifestSchema,
66
+ baseToolsSchema,
67
+ bundleSchema,
68
+ channelBindingSchema,
69
+ emptyManifest,
70
+ harnessBindingSchema,
71
+ hookBindingSchema,
72
+ httpMcpServerBindingSchema,
73
+ identitySchema,
74
+ instructionFragmentSchema,
75
+ mcpAuthSchema,
76
+ mcpServerBindingSchema,
77
+ resolvedAgentManifestSchema,
78
+ sandboxBindingSchema,
79
+ scheduleDefinitionSchema,
80
+ skillBundleSchema,
81
+ skillFileSchema,
82
+ toolDescriptorSchema,
83
+ workerMcpServerBindingSchema
84
+ } from "../chunk-OWC6SFFF.ts";
85
+ import {
86
+ DELETE,
87
+ GET,
88
+ POST,
89
+ PUT,
90
+ WS,
91
+ defineChannel,
92
+ defineProviderChannel,
93
+ disableChannel
94
+ } from "../chunk-WMXMVFHM.ts";
95
+ import "../chunk-5BK6FVRE.ts";
96
+ import "../chunk-7QP2CKPI.ts";
97
+ import {
98
+ defineMcpClientConnection
99
+ } from "../chunk-JNJE72EH.ts";
100
+ import {
101
+ TranscriptRole
102
+ } from "../chunk-RWUIMTBI.ts";
103
+ import {
104
+ credentials
105
+ } from "../chunk-NYTOYKKF.ts";
106
+ import {
107
+ CredentialOwner,
108
+ CredentialPayer
109
+ } from "../chunk-HNPUTP35.ts";
110
+ import {
111
+ DynamicEvent,
112
+ dynamicSlotSchema,
113
+ findDynamicSlots,
114
+ isDynamicSlot
115
+ } from "../chunk-SKTNMUO7.ts";
116
+ import {
117
+ defineDynamic
118
+ } from "../chunk-T6WG4L4M.ts";
119
+ import "../chunk-XHKPWT3G.ts";
120
+ import "../chunk-JIPNTA56.ts";
121
+ import "../chunk-HGW4YHAY.ts";
122
+ import "../chunk-32O3ODZE.ts";
123
+ export {
124
+ AGENT_DYNAMIC_PREFIX,
125
+ AUTHORED_SERVER_KEY,
126
+ BaseCapability,
127
+ COMBINED_MCP_SERVERS_EXPORT,
128
+ CredentialOwner,
129
+ CredentialPayer,
130
+ DELETE,
131
+ DynamicEvent,
132
+ GET,
133
+ HookEvent,
134
+ InstructionRole,
135
+ MANIFEST_VERSION,
136
+ McpServerBindingKind,
137
+ POST,
138
+ PUT,
139
+ SandboxAccess,
140
+ SandboxAttach,
141
+ SandboxWire,
142
+ ScheduleTarget,
143
+ SlotValueKind,
144
+ ToolApproval,
145
+ TranscriptRole,
146
+ WS,
147
+ agentManifestSchema,
148
+ always,
149
+ baseTools,
150
+ baseToolsSchema,
151
+ bundleSchema,
152
+ channelBindingSchema,
153
+ completeHarnessDescription,
154
+ credentials,
155
+ defineAgent,
156
+ defineChannel,
157
+ defineDynamic,
158
+ defineHarness,
159
+ defineHook,
160
+ defineInstructions,
161
+ defineMcpClientConnection,
162
+ defineProviderChannel,
163
+ defineSandbox,
164
+ defineSandboxProvider,
165
+ defineSchedule,
166
+ defineSkill,
167
+ defineTool,
168
+ disableChannel,
169
+ dynamicSlotSchema,
170
+ emptyManifest,
171
+ findDynamicSlots,
172
+ harnessBindingSchema,
173
+ harnessHost,
174
+ hookBindingSchema,
175
+ httpMcpServerBindingSchema,
176
+ identitySchema,
177
+ instructionFragmentSchema,
178
+ isDynamicSlot,
179
+ mcpAuthSchema,
180
+ mcpServerBindingSchema,
181
+ never,
182
+ resolveManifest,
183
+ resolveManifestDetailed,
184
+ resolvedAgentManifestSchema,
185
+ sandboxBindingSchema,
186
+ scheduleDefinitionSchema,
187
+ skillBundleSchema,
188
+ skillFileSchema,
189
+ slotKindOf,
190
+ toolDescriptorSchema,
191
+ toolResultFrom,
192
+ validateSlotValue,
193
+ whenInput,
194
+ workerMcpServerBindingSchema
195
+ };
@@ -0,0 +1,72 @@
1
+ import "../chunk-JTGTLYDT.ts";
2
+ import {
3
+ BaseCapability,
4
+ InstructionRole,
5
+ MANIFEST_VERSION,
6
+ McpServerBindingKind,
7
+ SandboxAccess,
8
+ SandboxAttach,
9
+ ScheduleTarget,
10
+ ToolApproval,
11
+ agentManifestSchema,
12
+ baseToolsSchema,
13
+ bundleSchema,
14
+ channelBindingSchema,
15
+ emptyManifest,
16
+ harnessBindingSchema,
17
+ hookBindingSchema,
18
+ httpMcpServerBindingSchema,
19
+ identitySchema,
20
+ instructionFragmentSchema,
21
+ mcpAuthSchema,
22
+ mcpServerBindingSchema,
23
+ resolvedAgentManifestSchema,
24
+ sandboxBindingSchema,
25
+ scheduleDefinitionSchema,
26
+ skillBundleSchema,
27
+ skillFileSchema,
28
+ toolDescriptorSchema,
29
+ workerMcpServerBindingSchema
30
+ } from "../chunk-OWC6SFFF.ts";
31
+ import "../chunk-7QP2CKPI.ts";
32
+ import {
33
+ DynamicEvent,
34
+ dynamicSlotSchema,
35
+ findDynamicSlots,
36
+ isDynamicSlot
37
+ } from "../chunk-SKTNMUO7.ts";
38
+ import "../chunk-HGW4YHAY.ts";
39
+ import "../chunk-32O3ODZE.ts";
40
+ export {
41
+ BaseCapability,
42
+ DynamicEvent,
43
+ InstructionRole,
44
+ MANIFEST_VERSION,
45
+ McpServerBindingKind,
46
+ SandboxAccess,
47
+ SandboxAttach,
48
+ ScheduleTarget,
49
+ ToolApproval,
50
+ agentManifestSchema,
51
+ baseToolsSchema,
52
+ bundleSchema,
53
+ channelBindingSchema,
54
+ dynamicSlotSchema,
55
+ emptyManifest,
56
+ findDynamicSlots,
57
+ harnessBindingSchema,
58
+ hookBindingSchema,
59
+ httpMcpServerBindingSchema,
60
+ identitySchema,
61
+ instructionFragmentSchema,
62
+ isDynamicSlot,
63
+ mcpAuthSchema,
64
+ mcpServerBindingSchema,
65
+ resolvedAgentManifestSchema,
66
+ sandboxBindingSchema,
67
+ scheduleDefinitionSchema,
68
+ skillBundleSchema,
69
+ skillFileSchema,
70
+ toolDescriptorSchema,
71
+ workerMcpServerBindingSchema
72
+ };
@@ -0,0 +1,19 @@
1
+ import {
2
+ SlotValueKind,
3
+ resolveManifest,
4
+ resolveManifestDetailed,
5
+ slotKindOf,
6
+ validateSlotValue
7
+ } from "../chunk-EVQIK62B.ts";
8
+ import "../chunk-OWC6SFFF.ts";
9
+ import "../chunk-7QP2CKPI.ts";
10
+ import "../chunk-SKTNMUO7.ts";
11
+ import "../chunk-HGW4YHAY.ts";
12
+ import "../chunk-32O3ODZE.ts";
13
+ export {
14
+ SlotValueKind,
15
+ resolveManifest,
16
+ resolveManifestDetailed,
17
+ slotKindOf,
18
+ validateSlotValue
19
+ };
@@ -0,0 +1,72 @@
1
+ import {
2
+ describeBundle,
3
+ needsCombinedMcpServers,
4
+ synthesizedExports
5
+ } from "../../chunk-MZMSKIKU.ts";
6
+ import {
7
+ combineMcpServers,
8
+ createIsolateRuntime
9
+ } from "../../chunk-BLB6JGLO.ts";
10
+ import "../../chunk-ZDLVA6XF.ts";
11
+ import {
12
+ COMBINED_MCP_SERVERS_EXPORT,
13
+ namedExportName
14
+ } from "../../chunk-NMYHO2QN.ts";
15
+ import "../../chunk-QMWTDPNT.ts";
16
+ import "../../chunk-CWWRTRWW.ts";
17
+ import {
18
+ registerToolName
19
+ } from "../../chunk-TATN3PYK.ts";
20
+ import "../../chunk-GNR7XBPN.ts";
21
+ import "../../chunk-7WGYG73V.ts";
22
+ import "../../chunk-7VSSVZM4.ts";
23
+ import "../../chunk-OWC6SFFF.ts";
24
+ import "../../chunk-5BK6FVRE.ts";
25
+ import "../../chunk-7QP2CKPI.ts";
26
+ import "../../chunk-RWUIMTBI.ts";
27
+ import "../../chunk-SKTNMUO7.ts";
28
+ import "../../chunk-T6WG4L4M.ts";
29
+ import "../../chunk-XHKPWT3G.ts";
30
+ import "../../chunk-JIPNTA56.ts";
31
+ import "../../chunk-HGW4YHAY.ts";
32
+ import "../../chunk-32O3ODZE.ts";
33
+
34
+ // src/runtime/bundle.ts
35
+ var createAgentBundle = (args) => {
36
+ const entries = args.layout.map((layout, index) => ({
37
+ layout,
38
+ namespace: { ...args.namespaces[index] }
39
+ }));
40
+ const modules = {};
41
+ for (const entry of entries) {
42
+ for (const [name, value] of Object.entries(entry.namespace)) {
43
+ modules[namedExportName(entry.layout.base, name)] = value;
44
+ }
45
+ if (entry.layout.slot === "tool" /* Tool */)
46
+ registerToolName(entry.namespace["default"], entry.layout.key);
47
+ }
48
+ const synthesized = synthesizedExports(entries);
49
+ for (const item of synthesized) modules[item.name] = item.value;
50
+ const names = synthesized.map((item) => item.name);
51
+ if (needsCombinedMcpServers(entries)) {
52
+ modules[COMBINED_MCP_SERVERS_EXPORT] = combineMcpServers(
53
+ entries.filter(
54
+ (entry) => entry.layout.slot === "tool" /* Tool */ || entry.layout.slot === "connection" /* Connection */
55
+ ).filter((entry) => entry.namespace["default"] != null).map((entry) => ({
56
+ kind: entry.layout.slot === "tool" /* Tool */ ? "tool" : "connection",
57
+ key: entry.layout.key,
58
+ exportName: entry.layout.base,
59
+ value: entry.namespace["default"]
60
+ }))
61
+ );
62
+ names.push(COMBINED_MCP_SERVERS_EXPORT);
63
+ }
64
+ return {
65
+ modules,
66
+ runtime: createIsolateRuntime(modules),
67
+ describe: () => JSON.stringify(describeBundle(entries, names))
68
+ };
69
+ };
70
+ export {
71
+ createAgentBundle
72
+ };
@@ -0,0 +1,31 @@
1
+ import {
2
+ collectAgentDynamics,
3
+ describeBundle,
4
+ describeDynamic,
5
+ needsCombinedMcpServers,
6
+ synthesizedExports
7
+ } from "../../chunk-MZMSKIKU.ts";
8
+ import "../../chunk-ZDLVA6XF.ts";
9
+ import {
10
+ COMBINED_MCP_SERVERS_EXPORT
11
+ } from "../../chunk-NMYHO2QN.ts";
12
+ import "../../chunk-TATN3PYK.ts";
13
+ import "../../chunk-GNR7XBPN.ts";
14
+ import "../../chunk-7WGYG73V.ts";
15
+ import "../../chunk-7VSSVZM4.ts";
16
+ import "../../chunk-OWC6SFFF.ts";
17
+ import "../../chunk-7QP2CKPI.ts";
18
+ import "../../chunk-SKTNMUO7.ts";
19
+ import "../../chunk-T6WG4L4M.ts";
20
+ import "../../chunk-XHKPWT3G.ts";
21
+ import "../../chunk-JIPNTA56.ts";
22
+ import "../../chunk-HGW4YHAY.ts";
23
+ import "../../chunk-32O3ODZE.ts";
24
+ export {
25
+ COMBINED_MCP_SERVERS_EXPORT,
26
+ collectAgentDynamics,
27
+ describeBundle,
28
+ describeDynamic,
29
+ needsCombinedMcpServers,
30
+ synthesizedExports
31
+ };
@@ -0,0 +1,142 @@
1
+ import {
2
+ IssueSeverity
3
+ } from "../../chunk-ZDLVA6XF.ts";
4
+ import {
5
+ SlotKind
6
+ } from "../../chunk-NMYHO2QN.ts";
7
+ import "../../chunk-TATN3PYK.ts";
8
+ import "../../chunk-GNR7XBPN.ts";
9
+ import "../../chunk-7WGYG73V.ts";
10
+ import "../../chunk-7VSSVZM4.ts";
11
+ import "../../chunk-OWC6SFFF.ts";
12
+ import {
13
+ jsonValueSchema
14
+ } from "../../chunk-7QP2CKPI.ts";
15
+ import "../../chunk-SKTNMUO7.ts";
16
+ import "../../chunk-T6WG4L4M.ts";
17
+ import "../../chunk-XHKPWT3G.ts";
18
+ import "../../chunk-JIPNTA56.ts";
19
+ import {
20
+ array,
21
+ boolean,
22
+ discriminatedUnion,
23
+ literal,
24
+ nativeEnum,
25
+ object,
26
+ record,
27
+ string
28
+ } from "../../chunk-HGW4YHAY.ts";
29
+ import "../../chunk-32O3ODZE.ts";
30
+
31
+ // src/runtime/described.ts
32
+ var issueSchema = object({ severity: nativeEnum(IssueSeverity), message: string() });
33
+ var providerHintSchema = object({
34
+ ref: jsonValueSchema.nullable(),
35
+ name: string().nullable()
36
+ });
37
+ var describedDynamicSchema = object({
38
+ type: literal("dynamic"),
39
+ events: array(string()),
40
+ description: string().nullable(),
41
+ preview: string().nullable(),
42
+ provider: providerHintSchema.nullable()
43
+ });
44
+ var describedAgentSchema = object({
45
+ type: literal("agent"),
46
+ name: string().nullable(),
47
+ description: string().nullable(),
48
+ avatarUrl: string().nullable(),
49
+ harness: object({ harness: jsonValueSchema, config: jsonValueSchema }).nullable(),
50
+ tools: record(string(), string()).nullable(),
51
+ // Capabilities bound to `harnessHost` (the harness's own host, no target).
52
+ hostTools: array(string()).nullable().default(null),
53
+ toolPolicy: record(string(), string()).nullable(),
54
+ secrets: array(string()).nullable(),
55
+ channels: array(
56
+ object({ key: string().nullable(), channel: jsonValueSchema, config: jsonValueSchema })
57
+ ).nullable()
58
+ });
59
+ var describedInstructionsSchema = object({
60
+ type: literal("instructions"),
61
+ role: string(),
62
+ content: string()
63
+ });
64
+ var describedSkillSchema = object({ type: literal("skill"), skill: jsonValueSchema });
65
+ var describedToolSchema = object({
66
+ type: literal("tool"),
67
+ descriptor: jsonValueSchema,
68
+ approval: string()
69
+ });
70
+ var describedConnectionSchema = object({
71
+ type: literal("connection"),
72
+ binding: jsonValueSchema
73
+ });
74
+ var describedScheduleSchema = object({
75
+ type: literal("schedule"),
76
+ cron: string().nullable(),
77
+ markdown: string().nullable(),
78
+ timezone: string().nullable(),
79
+ target: string().nullable()
80
+ });
81
+ var describedHookSchema = object({ type: literal("hook"), keys: array(string()) });
82
+ var describedChannelSchema = object({
83
+ type: literal("channel"),
84
+ routes: array(object({ method: string(), path: string() })),
85
+ turnPolicy: string().nullable(),
86
+ config: jsonValueSchema,
87
+ disabled: boolean().default(false),
88
+ installed: jsonValueSchema.nullable().default(null)
89
+ });
90
+ var describedEnvironmentSchema = object({
91
+ providerName: string(),
92
+ providerRef: jsonValueSchema.nullable(),
93
+ options: jsonValueSchema,
94
+ openOptions: jsonValueSchema.nullable()
95
+ });
96
+ var describedSandboxTargetSchema = object({
97
+ exportName: string(),
98
+ environment: describedEnvironmentSchema.nullable(),
99
+ dynamic: describedDynamicSchema.nullable()
100
+ });
101
+ var describedSandboxSchema = object({
102
+ type: literal("sandbox"),
103
+ targets: record(string(), describedSandboxTargetSchema),
104
+ // Bundle export name → provider name, for providers defined in sandbox.ts.
105
+ providers: record(string(), string()),
106
+ selector: boolean(),
107
+ defaultTarget: string().nullable()
108
+ });
109
+ var describedValueSchema = discriminatedUnion("type", [
110
+ describedAgentSchema,
111
+ describedDynamicSchema,
112
+ describedInstructionsSchema,
113
+ describedSkillSchema,
114
+ describedToolSchema,
115
+ describedConnectionSchema,
116
+ describedScheduleSchema,
117
+ describedHookSchema,
118
+ describedChannelSchema,
119
+ describedSandboxSchema
120
+ ]);
121
+ var describedModuleSchema = object({
122
+ base: string(),
123
+ path: string(),
124
+ slot: nativeEnum(SlotKind),
125
+ key: string(),
126
+ hasDefault: boolean(),
127
+ issues: array(issueSchema),
128
+ value: describedValueSchema.nullable()
129
+ });
130
+ var describedBundleSchema = object({
131
+ modules: array(describedModuleSchema),
132
+ // Exports the bundle synthesizes beyond the authored ones.
133
+ synthesized: array(string())
134
+ });
135
+ export {
136
+ describedBundleSchema,
137
+ describedDynamicSchema,
138
+ describedEnvironmentSchema,
139
+ describedModuleSchema,
140
+ describedValueSchema,
141
+ issueSchema
142
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ combineMcpServers,
3
+ createIsolateRuntime,
4
+ lowerResolvedValue
5
+ } from "../../chunk-BLB6JGLO.ts";
6
+ import "../../chunk-ZDLVA6XF.ts";
7
+ import "../../chunk-NMYHO2QN.ts";
8
+ import "../../chunk-QMWTDPNT.ts";
9
+ import "../../chunk-CWWRTRWW.ts";
10
+ import "../../chunk-TATN3PYK.ts";
11
+ import "../../chunk-GNR7XBPN.ts";
12
+ import "../../chunk-7WGYG73V.ts";
13
+ import "../../chunk-7VSSVZM4.ts";
14
+ import "../../chunk-OWC6SFFF.ts";
15
+ import "../../chunk-5BK6FVRE.ts";
16
+ import "../../chunk-7QP2CKPI.ts";
17
+ import "../../chunk-RWUIMTBI.ts";
18
+ import "../../chunk-SKTNMUO7.ts";
19
+ import "../../chunk-T6WG4L4M.ts";
20
+ import "../../chunk-XHKPWT3G.ts";
21
+ import "../../chunk-JIPNTA56.ts";
22
+ import "../../chunk-HGW4YHAY.ts";
23
+ import "../../chunk-32O3ODZE.ts";
24
+ export {
25
+ combineMcpServers,
26
+ createIsolateRuntime,
27
+ lowerResolvedValue
28
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ AGENT_DYNAMIC_PREFIX,
3
+ AUTHORED_SERVER_KEY,
4
+ COMBINED_MCP_SERVERS_EXPORT,
5
+ SlotKind,
6
+ namedExportName
7
+ } from "../../chunk-NMYHO2QN.ts";
8
+ import "../../chunk-32O3ODZE.ts";
9
+ export {
10
+ AGENT_DYNAMIC_PREFIX,
11
+ AUTHORED_SERVER_KEY,
12
+ COMBINED_MCP_SERVERS_EXPORT,
13
+ SlotKind,
14
+ namedExportName
15
+ };
@@ -0,0 +1,52 @@
1
+ import {
2
+ IssueSeverity,
3
+ childPath,
4
+ dynamicEventsOf,
5
+ error,
6
+ isDynamicSentinel,
7
+ isEnvironmentLike,
8
+ isOpenRequestLike,
9
+ lowerConnection,
10
+ lowerEnvironment,
11
+ lowerInstructions,
12
+ lowerSkill,
13
+ lowerTool,
14
+ note,
15
+ sandboxProviderNameOf,
16
+ skillMarkdown,
17
+ toJson,
18
+ toJsonSchema,
19
+ warning
20
+ } from "../../chunk-ZDLVA6XF.ts";
21
+ import "../../chunk-TATN3PYK.ts";
22
+ import "../../chunk-GNR7XBPN.ts";
23
+ import "../../chunk-7WGYG73V.ts";
24
+ import "../../chunk-7VSSVZM4.ts";
25
+ import "../../chunk-OWC6SFFF.ts";
26
+ import "../../chunk-7QP2CKPI.ts";
27
+ import "../../chunk-SKTNMUO7.ts";
28
+ import "../../chunk-T6WG4L4M.ts";
29
+ import "../../chunk-XHKPWT3G.ts";
30
+ import "../../chunk-JIPNTA56.ts";
31
+ import "../../chunk-HGW4YHAY.ts";
32
+ import "../../chunk-32O3ODZE.ts";
33
+ export {
34
+ IssueSeverity,
35
+ childPath,
36
+ dynamicEventsOf,
37
+ error,
38
+ isDynamicSentinel,
39
+ isEnvironmentLike,
40
+ isOpenRequestLike,
41
+ lowerConnection,
42
+ lowerEnvironment,
43
+ lowerInstructions,
44
+ lowerSkill,
45
+ lowerTool,
46
+ note,
47
+ sandboxProviderNameOf,
48
+ skillMarkdown,
49
+ toJson,
50
+ toJsonSchema,
51
+ warning
52
+ };