@fevex/core 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (35) hide show
  1. package/README.md +100 -9
  2. package/dist/agents/index.d.mts +1 -1
  3. package/dist/artifacts/index.d.mts +1 -1
  4. package/dist/channels/index.d.mts +1 -1
  5. package/dist/evals/index.d.mts +4 -4
  6. package/dist/{fevex-B5NxFKcV.d.mts → fevex-CVMLnZsk.d.mts} +41 -12
  7. package/dist/http/index.d.mts +4 -4
  8. package/dist/http/index.mjs +2 -0
  9. package/dist/{index-Dsulk-n6.d.mts → index-1cHr7KB_.d.mts} +3 -3
  10. package/dist/{index-CKQCNvJz.d.mts → index-5p3q2yIp.d.mts} +2 -2
  11. package/dist/index-B0AdFbgr.d.mts +116 -0
  12. package/dist/{index--_LdSEuF.d.mts → index-BTD1c4Ys.d.mts} +3 -3
  13. package/dist/{index-BPwkgdo3.d.mts → index-BgKFd9yw.d.mts} +1 -1
  14. package/dist/{index-Cb3AB98n.d.mts → index-CbACw6xZ.d.mts} +2 -2
  15. package/dist/index-CpLDt6Rw.d.mts +118 -0
  16. package/dist/{index-Br-zPxZH.d.mts → index-CseuTR-F.d.mts} +2 -2
  17. package/dist/{index-CGmHXV31.d.mts → index-CzAi2Y_Z.d.mts} +13 -6
  18. package/dist/{index-BFnWUu7j.d.mts → index-Df84VWmN.d.mts} +1 -1
  19. package/dist/index.d.mts +13 -13
  20. package/dist/index.mjs +569 -78
  21. package/dist/knowledge/index.d.mts +2 -2
  22. package/dist/knowledge/index.mjs +236 -36
  23. package/dist/models/index.d.mts +1 -1
  24. package/dist/observability/index.d.mts +2 -2
  25. package/dist/policies/index.d.mts +1 -1
  26. package/dist/runtime/index.d.mts +2 -2
  27. package/dist/sandbox/index.d.mts +1 -1
  28. package/dist/teams/index.d.mts +1 -1
  29. package/dist/testing/index.d.mts +6 -6
  30. package/dist/tools/index.d.mts +2 -2
  31. package/dist/{types-BDVUoAU6.d.mts → types-B8laW1hM.d.mts} +2 -0
  32. package/dist/workflows/index.d.mts +1 -1
  33. package/package.json +1 -1
  34. package/dist/index-D6lnI92z.d.mts +0 -80
  35. package/dist/index-aayvtf0J.d.mts +0 -70
@@ -1,2 +1,2 @@
1
- import { a as MemoryQuery, c as MemoryWrite, d as defineContextProvider, f as defineSkill, i as KnowledgeContext, l as SkillDefinition, n as ContextBlock, o as MemoryRecord, r as ContextProvider, s as MemoryStore, t as InMemoryMemoryStore, u as createMemoryContextProvider } from "../index-aayvtf0J.mjs";
2
- export { ContextBlock, ContextProvider, InMemoryMemoryStore, KnowledgeContext, MemoryQuery, MemoryRecord, MemoryStore, MemoryWrite, SkillDefinition, createMemoryContextProvider, defineContextProvider, defineSkill };
1
+ import { _ as defineContextProvider, a as AgentsMdOptions, c as ContextProvider, d as MemoryRecord, f as MemoryStore, g as createMemoryContextProvider, h as SkillDefinition, i as InMemoryMemoryStore, l as KnowledgeContext, m as ProgressiveSkillProvider, n as loadSkillFile, o as createAgentsMdContextProvider, p as MemoryWrite, r as loadSkillFiles, s as ContextBlock, t as LoadSkillFileOptions, u as MemoryQuery, v as defineSkill, y as isProgressiveSkillProvider } from "../index-B0AdFbgr.mjs";
2
+ export { AgentsMdOptions, ContextBlock, ContextProvider, InMemoryMemoryStore, KnowledgeContext, LoadSkillFileOptions, MemoryQuery, MemoryRecord, MemoryStore, MemoryWrite, ProgressiveSkillProvider, SkillDefinition, createAgentsMdContextProvider, createMemoryContextProvider, defineContextProvider, defineSkill, isProgressiveSkillProvider, loadSkillFile, loadSkillFiles };
@@ -1,39 +1,10 @@
1
- //#region src/knowledge/in-memory-memory-store.ts
2
- /** Volatile keyword-search memory store for tests and local development. */
3
- var InMemoryMemoryStore = class {
4
- #records = /* @__PURE__ */ new Map();
5
- async search(query, context) {
6
- context.signal?.throwIfAborted();
7
- const terms = query.query.toLowerCase().split(/\s+/).filter(Boolean);
8
- const scored = [...this.#records.values()].filter((record) => matchesScope(record, query)).map((record) => ({
9
- record,
10
- score: score(record.content, terms)
11
- })).filter(({ score }) => !terms.length || score > 0).sort((left, right) => right.score - left.score || right.record.createdAt.localeCompare(left.record.createdAt));
12
- return scored.slice(0, query.limit ?? scored.length).map(({ record }) => structuredClone(record));
13
- }
14
- async write(record, context) {
15
- context.signal?.throwIfAborted();
16
- const saved = {
17
- id: crypto.randomUUID(),
18
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
19
- ...structuredClone(record)
20
- };
21
- this.#records.set(saved.id, saved);
22
- return structuredClone(saved);
23
- }
24
- };
25
- function matchesScope(record, query) {
26
- return matches(record.agentName, query.agentName) && matches(record.sessionId, query.sessionId) && matches(record.namespace, query.namespace) && matches(record.actor?.id, query.actor?.id);
27
- }
28
- function matches(left, right) {
29
- return right === void 0 || left === void 0 || left === right;
30
- }
31
- function score(content, terms) {
32
- const text = content.toLowerCase();
33
- return terms.reduce((total, term) => total + (text.includes(term) ? 1 : 0), 0);
34
- }
35
- //#endregion
1
+ import { readFile, readdir, realpath, stat } from "node:fs/promises";
2
+ import { dirname, isAbsolute, relative, resolve } from "node:path";
36
3
  //#region src/knowledge/knowledge.ts
4
+ function isProgressiveSkillProvider(provider) {
5
+ const candidate = provider;
6
+ return typeof candidate.load === "function" && typeof candidate.description === "string";
7
+ }
37
8
  function defineContextProvider(provider) {
38
9
  return provider;
39
10
  }
@@ -86,4 +57,233 @@ function stringifyKnowledge(value) {
86
57
  return typeof value === "string" ? value : JSON.stringify(value);
87
58
  }
88
59
  //#endregion
89
- export { InMemoryMemoryStore, createMemoryContextProvider, defineContextProvider, defineSkill };
60
+ //#region src/knowledge/agents-md.ts
61
+ const DEFAULT_MAX_BYTES$1 = 256 * 1024;
62
+ /**
63
+ * Reads one explicit `AGENTS.md` file as context.
64
+ *
65
+ * Fevex never walks the filesystem looking for `AGENTS.md`; register one
66
+ * provider per file and reference its name from `agent.context`.
67
+ */
68
+ function createAgentsMdContextProvider(options) {
69
+ const path = typeof options === "string" ? options : options.path;
70
+ const name = ((typeof options === "string" ? void 0 : options.name) ?? "agents-md").trim();
71
+ const maxBytes = (typeof options === "string" ? void 0 : options.maxBytes) ?? DEFAULT_MAX_BYTES$1;
72
+ if (!Number.isSafeInteger(maxBytes) || maxBytes <= 0) throw new TypeError("AGENTS.md maxBytes must be a positive safe integer");
73
+ if (!name.trim()) throw new TypeError("AGENTS.md provider name cannot be empty");
74
+ return defineContextProvider({
75
+ name,
76
+ async read() {
77
+ if ((await stat(path)).size > maxBytes) throw new Error(`AGENTS.md file "${path}" exceeds ${maxBytes} bytes`);
78
+ const content = await readFile(path, "utf8");
79
+ if (Buffer.byteLength(content) > maxBytes) throw new Error(`AGENTS.md file "${path}" exceeds ${maxBytes} bytes`);
80
+ return content.trim() ? [{
81
+ id: "agents-md",
82
+ content
83
+ }] : [];
84
+ }
85
+ });
86
+ }
87
+ //#endregion
88
+ //#region src/knowledge/in-memory-memory-store.ts
89
+ /** Volatile keyword-search memory store for tests and local development. */
90
+ var InMemoryMemoryStore = class {
91
+ #records = /* @__PURE__ */ new Map();
92
+ async search(query, context) {
93
+ context.signal?.throwIfAborted();
94
+ const terms = query.query.toLowerCase().split(/\s+/).filter(Boolean);
95
+ const scored = [...this.#records.values()].filter((record) => matchesScope(record, query)).map((record) => ({
96
+ record,
97
+ score: score(record.content, terms)
98
+ })).filter(({ score }) => !terms.length || score > 0).sort((left, right) => right.score - left.score || right.record.createdAt.localeCompare(left.record.createdAt));
99
+ return scored.slice(0, query.limit ?? scored.length).map(({ record }) => structuredClone(record));
100
+ }
101
+ async write(record, context) {
102
+ context.signal?.throwIfAborted();
103
+ const saved = {
104
+ id: crypto.randomUUID(),
105
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
106
+ ...structuredClone(record)
107
+ };
108
+ this.#records.set(saved.id, saved);
109
+ return structuredClone(saved);
110
+ }
111
+ };
112
+ function matchesScope(record, query) {
113
+ return matches(record.agentName, query.agentName) && matches(record.sessionId, query.sessionId) && matches(record.namespace, query.namespace) && matches(record.actor?.id, query.actor?.id);
114
+ }
115
+ function matches(left, right) {
116
+ return right === void 0 || left === void 0 || left === right;
117
+ }
118
+ function score(content, terms) {
119
+ const text = content.toLowerCase();
120
+ return terms.reduce((total, term) => total + (text.includes(term) ? 1 : 0), 0);
121
+ }
122
+ //#endregion
123
+ //#region src/knowledge/skill-file.ts
124
+ const DEFAULT_MAX_BYTES = 256 * 1024;
125
+ const DEFAULT_MAX_RESOURCE_BYTES = 256 * 1024;
126
+ const MAX_RESOURCES = 200;
127
+ const SKILL_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
128
+ const RESOURCE_DIRECTORIES = [
129
+ "references",
130
+ "scripts",
131
+ "assets"
132
+ ];
133
+ /**
134
+ * Loads one explicit `SKILL.md` file.
135
+ *
136
+ * Only `name` and `description` are advertised up front. The body and any
137
+ * files under `references/`, `scripts/` or `assets/` load on demand.
138
+ */
139
+ async function loadSkillFile(path, options = {}) {
140
+ const maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
141
+ const maxResourceBytes = options.maxResourceBytes ?? DEFAULT_MAX_RESOURCE_BYTES;
142
+ assertPositiveInteger(maxBytes, "maxBytes");
143
+ assertPositiveInteger(maxResourceBytes, "maxResourceBytes");
144
+ const absolute = await realpath(resolve(path));
145
+ if ((await stat(absolute)).size > maxBytes) throw new Error(`Skill file "${path}" exceeds ${maxBytes} bytes`);
146
+ const source = (await readFile(absolute, "utf8")).replace(/^\uFEFF/, "");
147
+ if (Buffer.byteLength(source) > maxBytes) throw new Error(`Skill file "${path}" exceeds ${maxBytes} bytes`);
148
+ const skill = parseSkillFile(source, path);
149
+ const root = dirname(absolute);
150
+ return defineContextProvider({
151
+ name: skill.name,
152
+ description: skill.description,
153
+ async read() {
154
+ return [{
155
+ id: `${skill.name}:metadata`,
156
+ content: skill.description
157
+ }];
158
+ },
159
+ async load(_context, resource) {
160
+ if (resource !== void 0) return [{
161
+ id: `${skill.name}:resource:${resource}`,
162
+ content: await readResource(root, resource, maxResourceBytes)
163
+ }];
164
+ const blocks = [{
165
+ id: `${skill.name}:instructions`,
166
+ content: skill.instructions
167
+ }];
168
+ const resources = await listResources(root);
169
+ if (resources.length) blocks.push({
170
+ id: `${skill.name}:resources`,
171
+ content: [
172
+ "Resources:",
173
+ ...resources.map((item) => `- ${item.path} (${formatBytes(item.size)})`),
174
+ "Load one by passing its path as the resource argument.",
175
+ ...resources.some((item) => item.path.startsWith("scripts/")) ? ["Scripts are for reference only and are not executed by this runtime."] : []
176
+ ].join("\n")
177
+ });
178
+ return blocks;
179
+ }
180
+ });
181
+ }
182
+ /** Loads several explicit `SKILL.md` files; it never scans directories. */
183
+ function loadSkillFiles(paths, options = {}) {
184
+ return Promise.all(paths.map((path) => loadSkillFile(path, options)));
185
+ }
186
+ function parseSkillFile(source, path) {
187
+ const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(source);
188
+ if (!match) throw new Error(`Skill file "${path}" must start with --- frontmatter`);
189
+ const fields = parseFrontmatter(match[1]);
190
+ const name = fields.name?.trim();
191
+ const description = fields.description?.trim();
192
+ const instructions = match[2].trim();
193
+ if (!name) throw new Error(`Skill file "${path}" must define a name`);
194
+ if (name.length > 64 || !SKILL_NAME.test(name) || name.startsWith("fevex__")) throw new Error(`Skill file "${path}" has an invalid name; use lowercase letters, numbers and hyphens, up to 64 characters`);
195
+ if (!description) throw new Error(`Skill file "${path}" must define a description`);
196
+ if (!instructions) throw new Error(`Skill file "${path}" must contain instructions`);
197
+ return {
198
+ name,
199
+ description,
200
+ instructions
201
+ };
202
+ }
203
+ function parseFrontmatter(source) {
204
+ const fields = {};
205
+ const lines = source.split(/\r?\n/);
206
+ for (let index = 0; index < lines.length; index += 1) {
207
+ const line = lines[index];
208
+ if (!line.trim() || line.trimStart().startsWith("#")) continue;
209
+ if (/^\s/.test(line)) continue;
210
+ const colon = line.indexOf(":");
211
+ if (colon <= 0) continue;
212
+ const key = line.slice(0, colon).trim();
213
+ let value = line.slice(colon + 1).trim();
214
+ if (value === "|" || value === ">" || value === "|-" || value === ">-") {
215
+ const block = [];
216
+ while (index + 1 < lines.length) {
217
+ const next = lines[index + 1];
218
+ if (next.trim() && !/^\s/.test(next)) break;
219
+ index += 1;
220
+ block.push(next.replace(/^\s+/, ""));
221
+ }
222
+ while (block.length && !block[block.length - 1]) block.pop();
223
+ value = value.startsWith(">") ? block.filter(Boolean).join(" ") : block.join("\n");
224
+ } else if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
225
+ fields[key] = value;
226
+ }
227
+ return fields;
228
+ }
229
+ async function listResources(root) {
230
+ const resources = [];
231
+ for (const directory of RESOURCE_DIRECTORIES) await walkResources(resolve(root, directory), root, resources);
232
+ return resources.sort((left, right) => left.path.localeCompare(right.path)).slice(0, MAX_RESOURCES);
233
+ }
234
+ async function walkResources(directory, root, resources) {
235
+ if (resources.length >= MAX_RESOURCES) return;
236
+ let entries;
237
+ try {
238
+ entries = await readdir(directory, { withFileTypes: true });
239
+ } catch (error) {
240
+ if (isMissing(error)) return;
241
+ throw error;
242
+ }
243
+ for (const entry of entries) {
244
+ if (resources.length >= MAX_RESOURCES) return;
245
+ if (entry.isSymbolicLink()) continue;
246
+ const target = resolve(directory, entry.name);
247
+ if (entry.isDirectory()) {
248
+ await walkResources(target, root, resources);
249
+ continue;
250
+ }
251
+ if (!entry.isFile()) continue;
252
+ const info = await stat(target);
253
+ resources.push({
254
+ path: relative(root, target).split("\\").join("/"),
255
+ size: info.size
256
+ });
257
+ }
258
+ }
259
+ async function readResource(root, resource, maxBytes) {
260
+ if (resource.includes("\0")) throw new Error("Skill resource path is invalid");
261
+ const requested = resolve(root, resource);
262
+ const requestedPath = relative(root, requested);
263
+ if (!requestedPath || requestedPath.startsWith("..") || isAbsolute(requestedPath)) throw new Error(`Skill resource "${resource}" is outside the skill directory`);
264
+ let target;
265
+ try {
266
+ target = await realpath(requested);
267
+ } catch {
268
+ throw new Error(`Skill resource "${resource}" was not found`);
269
+ }
270
+ const path = relative(root, target);
271
+ if (!path || path.startsWith("..") || isAbsolute(path)) throw new Error(`Skill resource "${resource}" is outside the skill directory`);
272
+ const info = await stat(target);
273
+ if (!info.isFile()) throw new Error(`Skill resource "${resource}" is not a file`);
274
+ if (info.size > maxBytes) throw new Error(`Skill resource "${resource}" exceeds ${maxBytes} bytes`);
275
+ const buffer = await readFile(target);
276
+ if (buffer.includes(0)) throw new Error(`Skill resource "${resource}" is not UTF-8 text`);
277
+ return buffer.toString("utf8");
278
+ }
279
+ function formatBytes(bytes) {
280
+ return bytes < 1024 ? `${bytes} B` : `${(bytes / 1024).toFixed(1)} KB`;
281
+ }
282
+ function assertPositiveInteger(value, name) {
283
+ if (!Number.isSafeInteger(value) || value <= 0) throw new TypeError(`Skill ${name} must be a positive safe integer`);
284
+ }
285
+ function isMissing(error) {
286
+ return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
287
+ }
288
+ //#endregion
289
+ export { InMemoryMemoryStore, createAgentsMdContextProvider, createMemoryContextProvider, defineContextProvider, defineSkill, isProgressiveSkillProvider, loadSkillFile, loadSkillFiles };
@@ -1,2 +1,2 @@
1
- import { a as ModelResult, c as ReasoningEffort, i as ModelRef, l as ToolChoice, n as ModelInput, o as ModelStreamEvent, r as ModelMetadata, s as ModelUsage, t as ModelGateway } from "../index-BPwkgdo3.mjs";
1
+ import { a as ModelResult, c as ReasoningEffort, i as ModelRef, l as ToolChoice, n as ModelInput, o as ModelStreamEvent, r as ModelMetadata, s as ModelUsage, t as ModelGateway } from "../index-BgKFd9yw.mjs";
2
2
  export { ModelGateway, ModelInput, ModelMetadata, ModelRef, ModelResult, ModelStreamEvent, ModelUsage, ReasoningEffort, ToolChoice };
@@ -1,2 +1,2 @@
1
- import { a as TraceAnnotation, c as TraceContentPolicy, d as TraceRedactor, f as TraceRedactorInput, h as TraceStatus, i as RunTrace, l as TraceCost, m as TraceSpanKind, n as CostCalculatorInput, o as TraceContent, p as TraceSpan, r as ObservabilityOptions, s as TraceContentKind, t as CostCalculator, u as TraceExporter } from "../index-D6lnI92z.mjs";
2
- export { CostCalculator, CostCalculatorInput, ObservabilityOptions, RunTrace, TraceAnnotation, TraceContent, TraceContentKind, TraceContentPolicy, TraceCost, TraceExporter, TraceRedactor, TraceRedactorInput, TraceSpan, TraceSpanKind, TraceStatus };
1
+ import { _ as TraceSpanKind, a as RunTrace, c as TraceContentKind, d as TraceExportQueueOptions, f as TraceExporter, g as TraceSpan, h as TraceRunKind, i as ObservabilityStats, l as TraceContentPolicy, m as TraceRedactorInput, n as CostCalculatorInput, o as TraceAnnotation, p as TraceRedactor, r as ObservabilityOptions, s as TraceContent, t as CostCalculator, u as TraceCost, v as TraceStatus } from "../index-CpLDt6Rw.mjs";
2
+ export { CostCalculator, CostCalculatorInput, ObservabilityOptions, ObservabilityStats, RunTrace, TraceAnnotation, TraceContent, TraceContentKind, TraceContentPolicy, TraceCost, TraceExportQueueOptions, TraceExporter, TraceRedactor, TraceRedactorInput, TraceRunKind, TraceSpan, TraceSpanKind, TraceStatus };
@@ -1,2 +1,2 @@
1
- import { i as definePolicy, n as PolicyDecision, r as PolicyDefinition, t as PolicyAuthorization } from "../index-Cb3AB98n.mjs";
1
+ import { i as definePolicy, n as PolicyDecision, r as PolicyDefinition, t as PolicyAuthorization } from "../index-CbACw6xZ.mjs";
2
2
  export { PolicyAuthorization, PolicyDecision, PolicyDefinition, definePolicy };
@@ -1,2 +1,2 @@
1
- import { $ as validatePurgeRunsOptions, A as RunRecord, B as TimerResolution, C as PurgeRunsResult, D as RunCheckpoint, E as RetainableRunStore, F as Session, G as WorkflowCheckpoint, H as ToolExecutionResolution, I as SessionId, J as WorkflowStepRecord, K as WorkflowCompensationRecord, L as StoredRunCheckpoint, M as RunResult, N as RunStatus, O as RunLease, P as RunStore, Q as validateListEventsOptions, R as TeamCheckpoint, S as PurgeRunsOptions, T as RetainableRunStatus, U as ToolExecutionStatus, V as ToolExecutionRecord, W as WorkflowBudgetUsage, X as isDurableRunStore, Y as WorkflowWaitRecord, Z as isRetainableRunStore, _ as EventResolution, a as AgentRun, b as ListEventsOptions, c as ApprovalRequest, d as CoordinatorRun, f as CredentialStore, g as ElicitationResolution, h as ElicitationRequest, i as InMemoryRunStore, j as RunRequest, k as RunPause, l as ApprovalResolution, m as ElicitationMode, o as AgentRunPause, p as DurableRunStore, q as WorkflowRun, s as ApprovalMode, u as CoordinatorCheckpoint, v as ExecutionCommit, w as ResumeRunResolution, x as PendingToolExecution, y as ExecutionCreate, z as TeamRun } from "../index-CGmHXV31.mjs";
2
- export { AgentRun, AgentRunPause, ApprovalMode, ApprovalRequest, ApprovalResolution, CoordinatorCheckpoint, CoordinatorRun, CredentialStore, DurableRunStore, ElicitationMode, ElicitationRequest, ElicitationResolution, EventResolution, ExecutionCommit, ExecutionCreate, InMemoryRunStore, ListEventsOptions, PendingToolExecution, PurgeRunsOptions, PurgeRunsResult, ResumeRunResolution, RetainableRunStatus, RetainableRunStore, RunCheckpoint, RunLease, RunPause, RunRecord, RunRequest, RunResult, RunStatus, RunStore, Session, SessionId, StoredRunCheckpoint, TeamCheckpoint, TeamRun, TimerResolution, ToolExecutionRecord, ToolExecutionResolution, ToolExecutionStatus, WorkflowBudgetUsage, WorkflowCheckpoint, WorkflowCompensationRecord, WorkflowRun, WorkflowStepRecord, WorkflowWaitRecord, isDurableRunStore, isRetainableRunStore, validateListEventsOptions, validatePurgeRunsOptions };
1
+ import { $ as validateListEventsOptions, A as RunPause, B as TeamRun, C as PurgeRunsResult, D as RunCheckpoint, E as RetainableRunStore, F as RunStore, G as WorkflowBudgetUsage, H as ToolExecutionRecord, I as Session, J as WorkflowRun, K as WorkflowCheckpoint, L as SessionId, M as RunRequest, N as RunResult, O as RunCorrelation, P as RunStatus, Q as isRetainableRunStore, R as StoredRunCheckpoint, S as PurgeRunsOptions, T as RetainableRunStatus, U as ToolExecutionResolution, V as TimerResolution, W as ToolExecutionStatus, X as WorkflowWaitRecord, Y as WorkflowStepRecord, Z as isDurableRunStore, _ as EventResolution, a as AgentRun, b as ListEventsOptions, c as ApprovalRequest, d as CoordinatorRun, et as validatePurgeRunsOptions, f as CredentialStore, g as ElicitationResolution, h as ElicitationRequest, i as InMemoryRunStore, j as RunRecord, k as RunLease, l as ApprovalResolution, m as ElicitationMode, o as AgentRunPause, p as DurableRunStore, q as WorkflowCompensationRecord, s as ApprovalMode, u as CoordinatorCheckpoint, v as ExecutionCommit, w as ResumeRunResolution, x as PendingToolExecution, y as ExecutionCreate, z as TeamCheckpoint } from "../index-CzAi2Y_Z.mjs";
2
+ export { AgentRun, AgentRunPause, ApprovalMode, ApprovalRequest, ApprovalResolution, CoordinatorCheckpoint, CoordinatorRun, CredentialStore, DurableRunStore, ElicitationMode, ElicitationRequest, ElicitationResolution, EventResolution, ExecutionCommit, ExecutionCreate, InMemoryRunStore, ListEventsOptions, PendingToolExecution, PurgeRunsOptions, PurgeRunsResult, ResumeRunResolution, RetainableRunStatus, RetainableRunStore, RunCheckpoint, RunCorrelation, RunLease, RunPause, RunRecord, RunRequest, RunResult, RunStatus, RunStore, Session, SessionId, StoredRunCheckpoint, TeamCheckpoint, TeamRun, TimerResolution, ToolExecutionRecord, ToolExecutionResolution, ToolExecutionStatus, WorkflowBudgetUsage, WorkflowCheckpoint, WorkflowCompensationRecord, WorkflowRun, WorkflowStepRecord, WorkflowWaitRecord, isDurableRunStore, isRetainableRunStore, validateListEventsOptions, validatePurgeRunsOptions };
@@ -1,2 +1,2 @@
1
- import { a as SandboxError, c as sandboxResultToJson, i as SandboxCapabilities, n as createLocalSandbox, o as SandboxRunRequest, r as Sandbox, s as SandboxRunResult, t as LocalSandboxOptions } from "../index-BFnWUu7j.mjs";
1
+ import { a as SandboxError, c as sandboxResultToJson, i as SandboxCapabilities, n as createLocalSandbox, o as SandboxRunRequest, r as Sandbox, s as SandboxRunResult, t as LocalSandboxOptions } from "../index-Df84VWmN.mjs";
2
2
  export { LocalSandboxOptions, Sandbox, SandboxCapabilities, SandboxError, SandboxRunRequest, SandboxRunResult, createLocalSandbox, sandboxResultToJson };
@@ -1,2 +1,2 @@
1
- import { a as TeamMember, c as defineTeam, i as TeamLimits, n as TeamDelegation, o as TeamStep, r as TeamHandoff, s as TeamTaskResult, t as TeamDefinition } from "../index-Dsulk-n6.mjs";
1
+ import { a as TeamMember, c as defineTeam, i as TeamLimits, n as TeamDelegation, o as TeamStep, r as TeamHandoff, s as TeamTaskResult, t as TeamDefinition } from "../index-1cHr7KB_.mjs";
2
2
  export { type TeamDefinition, type TeamDelegation, type TeamHandoff, type TeamLimits, type TeamMember, type TeamStep, type TeamTaskResult, defineTeam };
@@ -1,9 +1,9 @@
1
- import { m as ToolCall } from "../types-BDVUoAU6.mjs";
2
- import { a as ModelResult, n as ModelInput, t as ModelGateway } from "../index-BPwkgdo3.mjs";
3
- import { h as ElicitationRequest, p as DurableRunStore } from "../index-CGmHXV31.mjs";
4
- import { s as MemoryStore } from "../index-aayvtf0J.mjs";
5
- import { d as ToolProvider } from "../index-CKQCNvJz.mjs";
6
- import { d as ChannelMessage, f as ChannelOutput, o as ChannelElicitationContext, r as ChannelAdapter } from "../index--_LdSEuF.mjs";
1
+ import { m as ToolCall } from "../types-B8laW1hM.mjs";
2
+ import { a as ModelResult, n as ModelInput, t as ModelGateway } from "../index-BgKFd9yw.mjs";
3
+ import { h as ElicitationRequest, p as DurableRunStore } from "../index-CzAi2Y_Z.mjs";
4
+ import { f as MemoryStore } from "../index-B0AdFbgr.mjs";
5
+ import { d as ToolProvider } from "../index-5p3q2yIp.mjs";
6
+ import { d as ChannelMessage, f as ChannelOutput, o as ChannelElicitationContext, r as ChannelAdapter } from "../index-BTD1c4Ys.mjs";
7
7
  //#region src/testing/contracts.d.ts
8
8
  interface ModelGatewayContract {
9
9
  output?: unknown;
@@ -1,3 +1,3 @@
1
- import { g as ToolSpec, m as ToolCall } from "../types-BDVUoAU6.mjs";
2
- import { C as toToolSpec, S as defineTool, _ as ToolExecutionContext, a as compileFevexJsonSchema, b as ToolRetryPolicy, c as ConnectionToolPolicy, d as ToolProvider, f as ToolProviderContext, g as ToolDefinition, h as ToolApproval, i as FevexJsonSchemaValidator, l as IntegrationError, m as defineConnection, n as FevexJsonSchemaProfileLimits, o as validateFevexJsonSchemaProfile, p as ToolProviderTool, r as FevexJsonSchemaProfileOptions, s as ConnectionDefinition, t as FEVEX_JSON_SCHEMA_PROFILE_VERSION, u as IntegrationErrorCategory, v as ToolIdempotency, x as ToolRisk, y as ToolResult } from "../index-CKQCNvJz.mjs";
1
+ import { g as ToolSpec, m as ToolCall } from "../types-B8laW1hM.mjs";
2
+ import { C as toToolSpec, S as defineTool, _ as ToolExecutionContext, a as compileFevexJsonSchema, b as ToolRetryPolicy, c as ConnectionToolPolicy, d as ToolProvider, f as ToolProviderContext, g as ToolDefinition, h as ToolApproval, i as FevexJsonSchemaValidator, l as IntegrationError, m as defineConnection, n as FevexJsonSchemaProfileLimits, o as validateFevexJsonSchemaProfile, p as ToolProviderTool, r as FevexJsonSchemaProfileOptions, s as ConnectionDefinition, t as FEVEX_JSON_SCHEMA_PROFILE_VERSION, u as IntegrationErrorCategory, v as ToolIdempotency, x as ToolRisk, y as ToolResult } from "../index-5p3q2yIp.mjs";
3
3
  export { ConnectionDefinition, ConnectionToolPolicy, FEVEX_JSON_SCHEMA_PROFILE_VERSION, FevexJsonSchemaProfileLimits, FevexJsonSchemaProfileOptions, FevexJsonSchemaValidator, IntegrationError, IntegrationErrorCategory, ToolApproval, type ToolCall, ToolDefinition, ToolExecutionContext, ToolIdempotency, ToolProvider, ToolProviderContext, ToolProviderTool, ToolResult, ToolRetryPolicy, ToolRisk, type ToolSpec, compileFevexJsonSchema, defineConnection, defineTool, toToolSpec, validateFevexJsonSchemaProfile };
@@ -429,6 +429,7 @@ interface AgentEventPayloads {
429
429
  stepId: string;
430
430
  kind: 'agent' | 'parallel';
431
431
  agentName?: string;
432
+ childRunId?: string;
432
433
  };
433
434
  'workflow.step.completed': {
434
435
  stepId: string;
@@ -494,6 +495,7 @@ interface AgentEventPayloads {
494
495
  action: 'delegate' | 'handoff';
495
496
  expectedOutput?: string;
496
497
  constraints?: string[];
498
+ childRunId?: string;
497
499
  };
498
500
  'team.handoff.created': {
499
501
  delegationId: string;
@@ -1,2 +1,2 @@
1
- import { a as WorkflowStep, c as defineWorkflow, i as WorkflowEventResult, n as WorkflowDefinition, o as WorkflowStepContext, r as WorkflowEventDefinition, s as WorkflowStepOptions, t as WorkflowAgentResult } from "../index-Br-zPxZH.mjs";
1
+ import { a as WorkflowStep, c as defineWorkflow, i as WorkflowEventResult, n as WorkflowDefinition, o as WorkflowStepContext, r as WorkflowEventDefinition, s as WorkflowStepOptions, t as WorkflowAgentResult } from "../index-CseuTR-F.mjs";
2
2
  export { WorkflowAgentResult, WorkflowDefinition, WorkflowEventDefinition, WorkflowEventResult, WorkflowStep, WorkflowStepContext, WorkflowStepOptions, defineWorkflow };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fevex/core",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.7",
4
4
  "description": "Agent Engineering Framework for code-first, provider-neutral AI agents.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1,80 +0,0 @@
1
- import { f as RunId, l as JsonValue, s as JsonObject } from "./types-BDVUoAU6.mjs";
2
- import { r as ModelMetadata, s as ModelUsage } from "./index-BPwkgdo3.mjs";
3
- import { I as SessionId } from "./index-CGmHXV31.mjs";
4
- //#region src/observability/trace.d.ts
5
- /** Final state represented by an exported run trace. */
6
- type TraceStatus = 'completed' | 'failed' | 'cancelled';
7
- type TraceSpanKind = 'model' | 'tool';
8
- type TraceContentKind = 'run.output' | 'model.output' | 'error.message';
9
- interface TraceCost {
10
- amount: number;
11
- currency: string;
12
- }
13
- interface TraceContent {
14
- kind: TraceContentKind;
15
- value: JsonValue;
16
- }
17
- interface TraceAnnotation {
18
- name: string;
19
- timestamp: string;
20
- attributes?: JsonObject;
21
- }
22
- interface TraceSpan {
23
- id: string;
24
- parentId: string;
25
- kind: TraceSpanKind;
26
- name: string;
27
- startedAt: string;
28
- endedAt: string;
29
- durationMs: number;
30
- status: TraceStatus;
31
- attributes: JsonObject;
32
- annotations: TraceAnnotation[];
33
- usage?: ModelUsage;
34
- cost?: TraceCost;
35
- content?: TraceContent[];
36
- }
37
- interface RunTrace {
38
- schemaVersion: '1';
39
- traceId: string;
40
- runId: RunId;
41
- sessionId: SessionId;
42
- agentName: string;
43
- modelRegistryName: string;
44
- model?: ModelMetadata;
45
- startedAt: string;
46
- endedAt: string;
47
- durationMs: number;
48
- status: TraceStatus;
49
- attributes: JsonObject;
50
- annotations: TraceAnnotation[];
51
- spans: TraceSpan[];
52
- usage?: ModelUsage;
53
- cost?: TraceCost;
54
- content?: TraceContent[];
55
- }
56
- interface CostCalculatorInput {
57
- modelRegistryName: string;
58
- model?: ModelMetadata;
59
- usage: ModelUsage;
60
- }
61
- type CostCalculator = (input: CostCalculatorInput) => TraceCost | undefined;
62
- interface TraceRedactorInput {
63
- kind: TraceContentKind;
64
- value: JsonValue;
65
- }
66
- type TraceRedactor = (input: TraceRedactorInput) => JsonValue | undefined;
67
- interface TraceContentPolicy {
68
- include: readonly TraceContentKind[];
69
- redact?: TraceRedactor;
70
- }
71
- interface TraceExporter {
72
- export(trace: Readonly<RunTrace>): void | Promise<void>;
73
- }
74
- interface ObservabilityOptions {
75
- exporters: readonly TraceExporter[];
76
- calculateCost?: CostCalculator;
77
- content?: TraceContentPolicy;
78
- }
79
- //#endregion
80
- export { TraceAnnotation as a, TraceContentPolicy as c, TraceRedactor as d, TraceRedactorInput as f, TraceStatus as h, RunTrace as i, TraceCost as l, TraceSpanKind as m, CostCalculatorInput as n, TraceContent as o, TraceSpan as p, ObservabilityOptions as r, TraceContentKind as s, CostCalculator as t, TraceExporter as u };
@@ -1,70 +0,0 @@
1
- import { l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-BDVUoAU6.mjs";
2
- import { I as SessionId } from "./index-CGmHXV31.mjs";
3
- //#region src/knowledge/knowledge.d.ts
4
- /** Runtime context supplied to knowledge providers and memory stores. */
5
- interface KnowledgeContext {
6
- agentName: string;
7
- input: string;
8
- sessionId: SessionId;
9
- context?: ExecutionContext;
10
- signal?: AbortSignal;
11
- }
12
- interface ContextBlock {
13
- id: string;
14
- content: string;
15
- metadata?: JsonObject;
16
- }
17
- interface ContextProvider {
18
- name: string;
19
- read(context: KnowledgeContext): Promise<ContextBlock[]>;
20
- }
21
- interface MemoryQuery {
22
- query: string;
23
- limit?: number;
24
- agentName?: string;
25
- sessionId?: SessionId;
26
- namespace?: string;
27
- actor?: ExecutionContext['actor'];
28
- }
29
- interface MemoryWrite {
30
- content: string;
31
- agentName?: string;
32
- sessionId?: SessionId;
33
- namespace?: string;
34
- actor?: ExecutionContext['actor'];
35
- metadata?: JsonObject;
36
- }
37
- interface MemoryRecord extends MemoryWrite {
38
- id: string;
39
- createdAt: string;
40
- }
41
- interface MemoryStore {
42
- search(query: MemoryQuery, context: KnowledgeContext): Promise<MemoryRecord[]>;
43
- write(record: MemoryWrite, context: KnowledgeContext): Promise<MemoryRecord>;
44
- }
45
- interface SkillDefinition {
46
- name: string;
47
- instructions: string;
48
- resources?: Array<string | JsonValue | {
49
- id?: string;
50
- content: string | JsonValue;
51
- metadata?: JsonObject;
52
- }>;
53
- }
54
- declare function defineContextProvider<T extends ContextProvider>(provider: T): T;
55
- declare function defineSkill(skill: SkillDefinition): ContextProvider;
56
- declare function createMemoryContextProvider(options: {
57
- name?: string;
58
- store: MemoryStore;
59
- limit?: number;
60
- }): ContextProvider;
61
- //#endregion
62
- //#region src/knowledge/in-memory-memory-store.d.ts
63
- /** Volatile keyword-search memory store for tests and local development. */
64
- declare class InMemoryMemoryStore implements MemoryStore {
65
- #private;
66
- search(query: MemoryQuery, context: KnowledgeContext): Promise<MemoryRecord[]>;
67
- write(record: MemoryWrite, context: KnowledgeContext): Promise<MemoryRecord>;
68
- }
69
- //#endregion
70
- export { MemoryQuery as a, MemoryWrite as c, defineContextProvider as d, defineSkill as f, KnowledgeContext as i, SkillDefinition as l, ContextBlock as n, MemoryRecord as o, ContextProvider as r, MemoryStore as s, InMemoryMemoryStore as t, createMemoryContextProvider as u };