@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
package/README.md CHANGED
@@ -28,18 +28,26 @@ adapters, validation and tests without adopting a heavy runtime.
28
28
  npm install @fevex/core
29
29
  ```
30
30
 
31
- For official model adapters:
31
+ The npm release pipeline publishes exactly three official packages:
32
32
 
33
33
  ```bash
34
34
  npm install @fevex/core @fevex/openai
35
35
  npm install @fevex/core @fevex/deepseek
36
- npm install @fevex/core @fevex/mcp
37
- npm install @fevex/core @fevex/openapi
38
- npm install @fevex/core @fevex/sqlite
39
- npm install @fevex/core @fevex/postgres
40
- npm install @fevex/core @fevex/opentelemetry @opentelemetry/api
41
36
  ```
42
37
 
38
+ CI builds, typechecks, tests and tarball-smokes all nine packages. The
39
+ repository-only integrations below are **not published to npm** by the release
40
+ pipeline; use them from this repository until they are published:
41
+
42
+ | Package | Purpose |
43
+ | --- | --- |
44
+ | `@fevex/mcp` | Model Context Protocol tools and connections |
45
+ | `@fevex/openapi` | Tools generated from an OpenAPI document |
46
+ | `@fevex/sqlite` | SQLite run and session store |
47
+ | `@fevex/postgres` | PostgreSQL run and session store |
48
+ | `@fevex/opentelemetry` | OpenTelemetry trace and metric export |
49
+ | `@fevex/browser` | Browser automation tools |
50
+
43
51
  Schemas are optional. The examples use Zod 4, but any Standard
44
52
  Schema-compatible validator can be used:
45
53
 
@@ -47,6 +55,20 @@ Schema-compatible validator can be used:
47
55
  npm install zod
48
56
  ```
49
57
 
58
+ ## Compatibility & releases
59
+
60
+ FEVEX is pre-1.0. Documented imports from official packages are the public API;
61
+ `src/internal`, undocumented paths and checkpoint shapes are not. While in alpha,
62
+ `minor` releases may contain breaking changes with migration notes; `patch`
63
+ releases stay compatible. Store migrations are forward-only, checkpoints are
64
+ versioned and private, and downgrades are not supported.
65
+
66
+ Only the latest alpha is supported; pin exact versions in production. Releases
67
+ come from reviewed changesets, publish only the three official packages, and
68
+ place alpha versions on the npm `latest` tag. Read the full
69
+ [compatibility and release policy](https://fevex.dev/docs/compatibility/) before
70
+ upgrading a durable deployment.
71
+
50
72
  ## Quickstart
51
73
 
52
74
  This example executes a complete model-tool-model cycle without network access:
@@ -730,8 +752,50 @@ Traces contain only metadata by default. Output and safe error capture require
730
752
  an explicit `content.include` policy; sensitive object keys are redacted before
731
753
  an optional application redactor runs. Exporters run outside the run path: their
732
754
  errors never change the run result, and `flushObservability()` reports pending
733
- export failures. OpenTelemetry SDK setup, OTLP export and shutdown remain
734
- application responsibilities.
755
+ export failures. Export work is bounded and deduplicated:
756
+
757
+ ```ts
758
+ const app = createFevex({
759
+ models,
760
+ agents,
761
+ observability: {
762
+ exporters: [createOpenTelemetryExporter()],
763
+ exportQueue: {
764
+ concurrency: 4,
765
+ maxQueued: 100,
766
+ timeoutMs: 30_000,
767
+ maxFailures: 100,
768
+ },
769
+ },
770
+ });
771
+
772
+ await app.flushObservability({ timeoutMs: 5_000 });
773
+ console.log(app.getObservabilityStats());
774
+ ```
775
+
776
+ Workflow and team traces carry `kind` and a span per step. Agent steps expose
777
+ `childRunId`; child agent traces carry `parentRunId` and `rootRunId`, and tool
778
+ spans are nested under the model call that requested them. A dropped trace or a
779
+ failed export is counted in `getObservabilityStats()`, and the next
780
+ `flushObservability()` rejects with the failures accumulated since the previous
781
+ flush. OpenTelemetry SDK setup, OTLP export and shutdown remain application
782
+ responsibilities.
783
+
784
+ ## Graceful shutdown
785
+
786
+ `shutdown` stops admission, drains active runs, cancels what remains at the
787
+ deadline and flushes trace exports:
788
+
789
+ ```ts
790
+ const result = await app.shutdown({ timeoutMs: 30_000 });
791
+ console.log(result.timedOut, result.cancelledRunIds, result.observability);
792
+ ```
793
+
794
+ New starts, resumes and recoveries fail with `RUNTIME_CLOSED` (HTTP `503`) once
795
+ shutdown begins. The host closes its HTTP server, stores and external adapters
796
+ after `shutdown` returns. See
797
+ [Operations & soak tests](https://fevex.dev/docs/operations/) for crash recovery
798
+ and the 1–8 hour load harness.
735
799
 
736
800
  ## Evaluations
737
801
 
@@ -914,6 +978,33 @@ const app = createFevex({
914
978
  });
915
979
  ```
916
980
 
981
+ For longer instructions, keep them in an explicit `SKILL.md` file. Only the
982
+ frontmatter metadata enters the prompt; the body loads on demand:
983
+
984
+ ```ts
985
+ import { createAgentsMdContextProvider, loadSkillFile } from '@fevex/core';
986
+
987
+ const refunds = await loadSkillFile('./skills/refunds/SKILL.md');
988
+
989
+ const app = createFevex({
990
+ models,
991
+ contextProviders: [refunds, createAgentsMdContextProvider('./AGENTS.md')],
992
+ agents: [
993
+ defineAgent({
994
+ name: 'support',
995
+ instructions: 'Answer with business context.',
996
+ skills: ['refunds'],
997
+ context: ['agents-md'],
998
+ }),
999
+ ],
1000
+ });
1001
+ ```
1002
+
1003
+ `SKILL.md` uses `name` and `description` frontmatter. The reserved
1004
+ `fevex__load_skill` tool loads the body and lists files under `references/`,
1005
+ `scripts/` and `assets/`; scripts are not executed by the runtime. Paths are
1006
+ explicit, with no automatic discovery.
1007
+
917
1008
  Context providers are lazy per run. Memory is a replaceable store; the built-in
918
1009
  store is in-memory substring search, not embeddings, vector search or durable
919
1010
  storage.
@@ -1049,7 +1140,7 @@ the artifact available.
1049
1140
  | `@fevex/core/runtime` | Runs, sessions and store contracts |
1050
1141
  | `@fevex/core/sandbox` | Sandbox contract and local development sandbox |
1051
1142
  | `@fevex/core/policies` | Authorization policy contracts |
1052
- | `@fevex/core/observability` | Trace, redaction and cost contracts |
1143
+ | `@fevex/core/observability` | Trace, bounded export queue, redaction and cost contracts |
1053
1144
  | `@fevex/core/evals` | Datasets, scorers, reporters and regressions |
1054
1145
  | `@fevex/core/testing` | Deterministic testing helpers |
1055
1146
 
@@ -1,2 +1,2 @@
1
- import { n as AgentLimits, r as defineAgent, t as AgentDefinition } from "../index-CGmHXV31.mjs";
1
+ import { n as AgentLimits, r as defineAgent, t as AgentDefinition } from "../index-CzAi2Y_Z.mjs";
2
2
  export { AgentDefinition, AgentLimits, defineAgent };
@@ -1,2 +1,2 @@
1
- import { A as ArtifactError, C as FileSystemArtifactStore, D as ArtifactCatalog, E as CatalogedArtifactStoreOptions, F as ArtifactStore, I as ArtifactStoreContext, L as ArtifactWrite, M as ArtifactId, N as ArtifactQuery, O as ArtifactContent, P as ArtifactRecord, R as artifactTenantId, S as InMemoryArtifactCatalog, T as CatalogedArtifactStore, _ as S3ArtifactStore, b as InMemoryArtifactStore, j as ArtifactErrorCode, k as ArtifactDescriptor, v as S3ArtifactStoreOptions, w as FileSystemArtifactStoreOptions, x as InMemoryArtifactStoreOptions, y as S3ObjectClient, z as assertArtifactId } from "../types-BDVUoAU6.mjs";
1
+ import { A as ArtifactError, C as FileSystemArtifactStore, D as ArtifactCatalog, E as CatalogedArtifactStoreOptions, F as ArtifactStore, I as ArtifactStoreContext, L as ArtifactWrite, M as ArtifactId, N as ArtifactQuery, O as ArtifactContent, P as ArtifactRecord, R as artifactTenantId, S as InMemoryArtifactCatalog, T as CatalogedArtifactStore, _ as S3ArtifactStore, b as InMemoryArtifactStore, j as ArtifactErrorCode, k as ArtifactDescriptor, v as S3ArtifactStoreOptions, w as FileSystemArtifactStoreOptions, x as InMemoryArtifactStoreOptions, y as S3ObjectClient, z as assertArtifactId } from "../types-B8laW1hM.mjs";
2
2
  export { ArtifactCatalog, ArtifactContent, ArtifactDescriptor, ArtifactError, ArtifactErrorCode, ArtifactId, ArtifactQuery, ArtifactRecord, ArtifactStore, ArtifactStoreContext, ArtifactWrite, CatalogedArtifactStore, CatalogedArtifactStoreOptions, FileSystemArtifactStore, FileSystemArtifactStoreOptions, InMemoryArtifactCatalog, InMemoryArtifactStore, InMemoryArtifactStoreOptions, S3ArtifactStore, S3ArtifactStoreOptions, S3ObjectClient, artifactTenantId, assertArtifactId };
@@ -1,2 +1,2 @@
1
- import { a as ChannelDeliveryOptions, c as ChannelEvent, d as ChannelMessage, f as ChannelOutput, h as ChannelRunResult, i as ChannelContext, l as ChannelEventType, m as ChannelRunOptions, n as handleChannelInput, o as ChannelElicitationContext, p as ChannelRunEvent, r as ChannelAdapter, s as ChannelError, t as deliverChannelRun, u as ChannelFailurePhase } from "../index--_LdSEuF.mjs";
1
+ import { a as ChannelDeliveryOptions, c as ChannelEvent, d as ChannelMessage, f as ChannelOutput, h as ChannelRunResult, i as ChannelContext, l as ChannelEventType, m as ChannelRunOptions, n as handleChannelInput, o as ChannelElicitationContext, p as ChannelRunEvent, r as ChannelAdapter, s as ChannelError, t as deliverChannelRun, u as ChannelFailurePhase } from "../index-BTD1c4Ys.mjs";
2
2
  export { ChannelAdapter, ChannelContext, ChannelDeliveryOptions, ChannelElicitationContext, ChannelError, ChannelEvent, ChannelEventType, ChannelFailurePhase, ChannelMessage, ChannelOutput, ChannelRunEvent, ChannelRunOptions, ChannelRunResult, deliverChannelRun, handleChannelInput };
@@ -1,7 +1,7 @@
1
- import { l as JsonValue, o as ExecutionContext, t as AgentEvent } from "../types-BDVUoAU6.mjs";
2
- import { r as ModelMetadata, s as ModelUsage } from "../index-BPwkgdo3.mjs";
3
- import { l as TraceCost, t as CostCalculator } from "../index-D6lnI92z.mjs";
4
- import { t as Fevex } from "../fevex-B5NxFKcV.mjs";
1
+ import { l as JsonValue, o as ExecutionContext, t as AgentEvent } from "../types-B8laW1hM.mjs";
2
+ import { r as ModelMetadata, s as ModelUsage } from "../index-BgKFd9yw.mjs";
3
+ import { t as CostCalculator, u as TraceCost } from "../index-CpLDt6Rw.mjs";
4
+ import { t as Fevex } from "../fevex-CVMLnZsk.mjs";
5
5
  //#region src/evals/canonical-json.d.ts
6
6
  /** Serializes JSON-like data with stable object-key ordering. */
7
7
  declare function serializeCanonical(value: unknown): string;
@@ -1,13 +1,13 @@
1
- import { F as ArtifactStore, f as RunId, o as ExecutionContext, t as AgentEvent } from "./types-BDVUoAU6.mjs";
2
- import { t as ModelGateway } from "./index-BPwkgdo3.mjs";
3
- import { A as RunRecord, C as PurgeRunsResult, F as Session, I as SessionId, M as RunResult, P as RunStore, S as PurgeRunsOptions, a as AgentRun, b as ListEventsOptions, f as CredentialStore, j as RunRequest, q as WorkflowRun, t as AgentDefinition, w as ResumeRunResolution, z as TeamRun } from "./index-CGmHXV31.mjs";
4
- import { r as ContextProvider, s as MemoryStore } from "./index-aayvtf0J.mjs";
5
- import { r as ObservabilityOptions } from "./index-D6lnI92z.mjs";
6
- import { r as Sandbox } from "./index-BFnWUu7j.mjs";
7
- import { g as ToolDefinition, s as ConnectionDefinition } from "./index-CKQCNvJz.mjs";
8
- import { r as PolicyDefinition } from "./index-Cb3AB98n.mjs";
9
- import { n as WorkflowDefinition } from "./index-Br-zPxZH.mjs";
10
- import { t as TeamDefinition } from "./index-Dsulk-n6.mjs";
1
+ import { F as ArtifactStore, f as RunId, o as ExecutionContext, t as AgentEvent } from "./types-B8laW1hM.mjs";
2
+ import { t as ModelGateway } from "./index-BgKFd9yw.mjs";
3
+ import { B as TeamRun, C as PurgeRunsResult, F as RunStore, I as Session, J as WorkflowRun, L as SessionId, M as RunRequest, N as RunResult, S as PurgeRunsOptions, a as AgentRun, b as ListEventsOptions, f as CredentialStore, j as RunRecord, t as AgentDefinition, w as ResumeRunResolution } from "./index-CzAi2Y_Z.mjs";
4
+ import { c as ContextProvider, f as MemoryStore } from "./index-B0AdFbgr.mjs";
5
+ import { i as ObservabilityStats, r as ObservabilityOptions } from "./index-CpLDt6Rw.mjs";
6
+ import { r as Sandbox } from "./index-Df84VWmN.mjs";
7
+ import { g as ToolDefinition, s as ConnectionDefinition } from "./index-5p3q2yIp.mjs";
8
+ import { r as PolicyDefinition } from "./index-CbACw6xZ.mjs";
9
+ import { n as WorkflowDefinition } from "./index-CseuTR-F.mjs";
10
+ import { t as TeamDefinition } from "./index-1cHr7KB_.mjs";
11
11
  //#region src/fevex.d.ts
12
12
  interface FevexAdmissionRequest {
13
13
  kind: 'agent' | 'workflow' | 'team';
@@ -27,6 +27,25 @@ interface FevexAdmission {
27
27
  /** Custom admission check, called after the built-in limits. */
28
28
  authorize?: (request: FevexAdmissionRequest) => boolean | Promise<boolean>;
29
29
  }
30
+ interface FevexShutdownOptions {
31
+ /**
32
+ * Maximum time to wait for active runs before cancelling them. Defaults to
33
+ * 30 seconds. Use `0` to cancel immediately. If the deadline expires,
34
+ * shutdown allows up to 5 additional seconds for forced cancellation and the
35
+ * final trace flush.
36
+ */
37
+ timeoutMs?: number;
38
+ }
39
+ interface FevexShutdownResult {
40
+ /** Runs that were still active when the grace period expired. */
41
+ cancelledRunIds: RunId[];
42
+ /** True when the grace deadline expired before all active runs finished. */
43
+ timedOut: boolean;
44
+ /** Error surfaced while flushing pending traces, if any. */
45
+ exportError?: unknown;
46
+ /** Observability counters after the shutdown flush. */
47
+ observability: ObservabilityStats;
48
+ }
30
49
  interface FevexLimits {
31
50
  /**
32
51
  * Maximum non-control events persisted for one run. Control events such as
@@ -77,7 +96,17 @@ interface Fevex {
77
96
  }): Promise<RunRecord<TOutput>>;
78
97
  purgeRuns(options?: PurgeRunsOptions): Promise<PurgeRunsResult>;
79
98
  compactSession(sessionId: SessionId, summary: string): Promise<Session>;
80
- flushObservability(): Promise<void>;
99
+ /** Waits for queued exports and rejects with failures accumulated since the previous flush. */
100
+ flushObservability(options?: {
101
+ timeoutMs?: number;
102
+ }): Promise<void>;
103
+ /** Cumulative trace export counters for this runtime. */
104
+ getObservabilityStats(): ObservabilityStats;
105
+ /**
106
+ * Stops admitting new work, drains or cancels active runs, and flushes trace
107
+ * exports. The host still owns closing its stores and external adapters.
108
+ */
109
+ shutdown(options?: FevexShutdownOptions): Promise<FevexShutdownResult>;
81
110
  }
82
111
  /**
83
112
  * Validates a configuration snapshot and creates an isolated runtime.
@@ -87,4 +116,4 @@ interface Fevex {
87
116
  */
88
117
  declare function createFevex(config: FevexConfig): Fevex;
89
118
  //#endregion
90
- export { FevexLimits as a, FevexConfig as i, FevexAdmission as n, createFevex as o, FevexAdmissionRequest as r, Fevex as t };
119
+ export { FevexLimits as a, createFevex as c, FevexConfig as i, FevexAdmission as n, FevexShutdownOptions as o, FevexAdmissionRequest as r, FevexShutdownResult as s, Fevex as t };
@@ -1,7 +1,7 @@
1
- import { D as ArtifactCatalog, F as ArtifactStore, f as RunId, k as ArtifactDescriptor, l as JsonValue, o as ExecutionContext, t as AgentEvent } from "../types-BDVUoAU6.mjs";
2
- import { c as ReasoningEffort } from "../index-BPwkgdo3.mjs";
3
- import { A as RunRecord, I as SessionId, a as AgentRun, q as WorkflowRun, z as TeamRun } from "../index-CGmHXV31.mjs";
4
- import { t as Fevex } from "../fevex-B5NxFKcV.mjs";
1
+ import { D as ArtifactCatalog, F as ArtifactStore, f as RunId, k as ArtifactDescriptor, l as JsonValue, o as ExecutionContext, t as AgentEvent } from "../types-B8laW1hM.mjs";
2
+ import { c as ReasoningEffort } from "../index-BgKFd9yw.mjs";
3
+ import { B as TeamRun, J as WorkflowRun, L as SessionId, a as AgentRun, j as RunRecord } from "../index-CzAi2Y_Z.mjs";
4
+ import { t as Fevex } from "../fevex-CVMLnZsk.mjs";
5
5
  //#region src/http/protocol.d.ts
6
6
  declare const FEVEX_HTTP_PROTOCOL_VERSION = "3";
7
7
  declare const FEVEX_HTTP_PROTOCOL_VERSION_HEADER = "Fevex-Protocol-Version";
@@ -24,6 +24,7 @@ const FEVEX_RUN_ERROR_CODES = /* @__PURE__ */ new Set([
24
24
  "RUN_DEFINITION_CHANGED",
25
25
  "POLICY_DENIED",
26
26
  "ADMISSION_DENIED",
27
+ "RUNTIME_CLOSED",
27
28
  "CREDENTIAL_NOT_FOUND",
28
29
  "SANDBOX_REQUIRED",
29
30
  "ELICITATION_INVALID",
@@ -654,6 +655,7 @@ function statusForRunErrorCode(code) {
654
655
  if (code === "APPROVAL_INVALID" || code === "INVALID_CURSOR") return 400;
655
656
  if (code === "POLICY_DENIED") return 403;
656
657
  if (code === "ADMISSION_DENIED") return 429;
658
+ if (code === "RUNTIME_CLOSED") return 503;
657
659
  return 409;
658
660
  }
659
661
  function statusForArtifactErrorCode(code) {
@@ -1,7 +1,7 @@
1
1
  import { t as ExactDefinition } from "./exact-definition-NHBBFlFR.mjs";
2
- import { o as ExecutionContext } from "./types-BDVUoAU6.mjs";
3
- import { n as AgentLimits } from "./index-CGmHXV31.mjs";
4
- import { t as WorkflowAgentResult } from "./index-Br-zPxZH.mjs";
2
+ import { o as ExecutionContext } from "./types-B8laW1hM.mjs";
3
+ import { n as AgentLimits } from "./index-CzAi2Y_Z.mjs";
4
+ import { t as WorkflowAgentResult } from "./index-CseuTR-F.mjs";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
  //#region src/teams/team.d.ts
7
7
  interface TeamMember {
@@ -1,6 +1,6 @@
1
1
  import { t as ExactDefinition } from "./exact-definition-NHBBFlFR.mjs";
2
- import { F as ArtifactStore, f as RunId, g as ToolSpec, h as ToolEventSource, l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-BDVUoAU6.mjs";
3
- import { i as SandboxCapabilities, r as Sandbox } from "./index-BFnWUu7j.mjs";
2
+ import { F as ArtifactStore, f as RunId, g as ToolSpec, h as ToolEventSource, l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-B8laW1hM.mjs";
3
+ import { i as SandboxCapabilities, r as Sandbox } from "./index-Df84VWmN.mjs";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
  //#region src/tools/tool.d.ts
6
6
  interface ToolExecutionContext {
@@ -0,0 +1,116 @@
1
+ import { l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-B8laW1hM.mjs";
2
+ import { L as SessionId } from "./index-CzAi2Y_Z.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
+ /**
55
+ * Context provider that advertises a skill's metadata and defers its full
56
+ * instructions until the model calls the reserved load-skill tool.
57
+ *
58
+ * The provider name is the skill name referenced from `agent.skills`.
59
+ */
60
+ interface ProgressiveSkillProvider extends ContextProvider {
61
+ /** Short description shown to the model before the skill is loaded. */
62
+ readonly description: string;
63
+ /** Loads the full instructions, or one resource when `resource` is set. */
64
+ load(context: KnowledgeContext, resource?: string): Promise<ContextBlock[]>;
65
+ }
66
+ declare function isProgressiveSkillProvider(provider: ContextProvider): provider is ProgressiveSkillProvider;
67
+ declare function defineContextProvider<T extends ContextProvider>(provider: T): T;
68
+ declare function defineSkill(skill: SkillDefinition): ContextProvider;
69
+ declare function createMemoryContextProvider(options: {
70
+ name?: string;
71
+ store: MemoryStore;
72
+ limit?: number;
73
+ }): ContextProvider;
74
+ //#endregion
75
+ //#region src/knowledge/agents-md.d.ts
76
+ interface AgentsMdOptions {
77
+ /** Explicit path to an `AGENTS.md` file. */
78
+ path: string;
79
+ /** Context provider name; defaults to `agents-md`. */
80
+ name?: string;
81
+ maxBytes?: number;
82
+ }
83
+ /**
84
+ * Reads one explicit `AGENTS.md` file as context.
85
+ *
86
+ * Fevex never walks the filesystem looking for `AGENTS.md`; register one
87
+ * provider per file and reference its name from `agent.context`.
88
+ */
89
+ declare function createAgentsMdContextProvider(options: AgentsMdOptions | string): ContextProvider;
90
+ //#endregion
91
+ //#region src/knowledge/in-memory-memory-store.d.ts
92
+ /** Volatile keyword-search memory store for tests and local development. */
93
+ declare class InMemoryMemoryStore implements MemoryStore {
94
+ #private;
95
+ search(query: MemoryQuery, context: KnowledgeContext): Promise<MemoryRecord[]>;
96
+ write(record: MemoryWrite, context: KnowledgeContext): Promise<MemoryRecord>;
97
+ }
98
+ //#endregion
99
+ //#region src/knowledge/skill-file.d.ts
100
+ interface LoadSkillFileOptions {
101
+ /** Maximum size of the `SKILL.md` file. */
102
+ maxBytes?: number;
103
+ /** Maximum size of one resource loaded on demand. */
104
+ maxResourceBytes?: number;
105
+ }
106
+ /**
107
+ * Loads one explicit `SKILL.md` file.
108
+ *
109
+ * Only `name` and `description` are advertised up front. The body and any
110
+ * files under `references/`, `scripts/` or `assets/` load on demand.
111
+ */
112
+ declare function loadSkillFile(path: string, options?: LoadSkillFileOptions): Promise<ProgressiveSkillProvider>;
113
+ /** Loads several explicit `SKILL.md` files; it never scans directories. */
114
+ declare function loadSkillFiles(paths: readonly string[], options?: LoadSkillFileOptions): Promise<ProgressiveSkillProvider[]>;
115
+ //#endregion
116
+ export { defineContextProvider as _, AgentsMdOptions as a, ContextProvider as c, MemoryRecord as d, MemoryStore as f, createMemoryContextProvider as g, SkillDefinition as h, InMemoryMemoryStore as i, KnowledgeContext as l, ProgressiveSkillProvider as m, loadSkillFile as n, createAgentsMdContextProvider as o, MemoryWrite as p, loadSkillFiles as r, ContextBlock as s, LoadSkillFileOptions as t, MemoryQuery as u, defineSkill as v, isProgressiveSkillProvider as y };
@@ -1,6 +1,6 @@
1
- import { f as RunId, o as ExecutionContext, s as JsonObject, t as AgentEvent } from "./types-BDVUoAU6.mjs";
2
- import { I as SessionId, a as AgentRun, h as ElicitationRequest } from "./index-CGmHXV31.mjs";
3
- import { t as Fevex } from "./fevex-B5NxFKcV.mjs";
1
+ import { f as RunId, o as ExecutionContext, s as JsonObject, t as AgentEvent } from "./types-B8laW1hM.mjs";
2
+ import { L as SessionId, a as AgentRun, h as ElicitationRequest } from "./index-CzAi2Y_Z.mjs";
3
+ import { t as Fevex } from "./fevex-CVMLnZsk.mjs";
4
4
  //#region src/channels/channel.d.ts
5
5
  interface ChannelMessage {
6
6
  id: string;
@@ -1,4 +1,4 @@
1
- import { g as ToolSpec, i as AgentMessage, l as JsonValue, m as ToolCall, s as JsonObject } from "./types-BDVUoAU6.mjs";
1
+ import { g as ToolSpec, i as AgentMessage, l as JsonValue, m as ToolCall, s as JsonObject } from "./types-B8laW1hM.mjs";
2
2
  //#region src/models/model.d.ts
3
3
  /** Provider-neutral reasoning levels accepted by model gateways. */
4
4
  type ReasoningEffort = 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
@@ -1,5 +1,5 @@
1
- import { f as RunId, l as JsonValue, o as ExecutionContext } from "./types-BDVUoAU6.mjs";
2
- import { x as ToolRisk } from "./index-CKQCNvJz.mjs";
1
+ import { f as RunId, l as JsonValue, o as ExecutionContext } from "./types-B8laW1hM.mjs";
2
+ import { x as ToolRisk } from "./index-5p3q2yIp.mjs";
3
3
  //#region src/policies/policy.d.ts
4
4
  /** Authorization outcome returned by a policy. */
5
5
  type PolicyDecision = 'allow' | 'deny' | 'require_approval';
@@ -0,0 +1,118 @@
1
+ import { f as RunId, l as JsonValue, s as JsonObject } from "./types-B8laW1hM.mjs";
2
+ import { r as ModelMetadata, s as ModelUsage } from "./index-BgKFd9yw.mjs";
3
+ import { L as SessionId } from "./index-CzAi2Y_Z.mjs";
4
+ //#region src/observability/trace.d.ts
5
+ /** Final state represented by an exported run trace. */
6
+ type TraceStatus = 'completed' | 'failed' | 'cancelled';
7
+ /** Kind of run that produced a trace. Absent means `agent` for older traces. */
8
+ type TraceRunKind = 'agent' | 'workflow' | 'team';
9
+ /** Model and tool calls are agent spans; steps belong to workflow and team traces. */
10
+ type TraceSpanKind = 'model' | 'tool' | 'step';
11
+ type TraceContentKind = 'run.output' | 'model.output' | 'error.message';
12
+ interface TraceCost {
13
+ amount: number;
14
+ currency: string;
15
+ }
16
+ interface TraceContent {
17
+ kind: TraceContentKind;
18
+ value: JsonValue;
19
+ }
20
+ interface TraceAnnotation {
21
+ name: string;
22
+ timestamp: string;
23
+ attributes?: JsonObject;
24
+ }
25
+ interface TraceSpan {
26
+ id: string;
27
+ /** Run or span that contains this span. */
28
+ parentId: string;
29
+ kind: TraceSpanKind;
30
+ name: string;
31
+ startedAt: string;
32
+ endedAt: string;
33
+ durationMs: number;
34
+ status: TraceStatus;
35
+ attributes: JsonObject;
36
+ annotations: TraceAnnotation[];
37
+ usage?: ModelUsage;
38
+ cost?: TraceCost;
39
+ content?: TraceContent[];
40
+ }
41
+ interface RunTrace {
42
+ schemaVersion: '1';
43
+ /** Absent on traces produced before coordinator traces existed; treat as `agent`. */
44
+ kind?: TraceRunKind;
45
+ traceId: string;
46
+ runId: RunId;
47
+ sessionId: SessionId;
48
+ /** Agent, workflow or team name. */
49
+ agentName: string;
50
+ /** Run that created this one, when it belongs to a workflow or team. */
51
+ parentRunId?: RunId;
52
+ /** Top-level run in the correlation tree. Defaults to `runId`. */
53
+ rootRunId?: RunId;
54
+ /** Only present on agent traces. */
55
+ modelRegistryName?: string;
56
+ model?: ModelMetadata;
57
+ startedAt: string;
58
+ endedAt: string;
59
+ durationMs: number;
60
+ status: TraceStatus;
61
+ attributes: JsonObject;
62
+ annotations: TraceAnnotation[];
63
+ spans: TraceSpan[];
64
+ usage?: ModelUsage;
65
+ cost?: TraceCost;
66
+ content?: TraceContent[];
67
+ }
68
+ interface CostCalculatorInput {
69
+ modelRegistryName: string;
70
+ model?: ModelMetadata;
71
+ usage: ModelUsage;
72
+ }
73
+ type CostCalculator = (input: CostCalculatorInput) => TraceCost | undefined;
74
+ interface TraceRedactorInput {
75
+ kind: TraceContentKind;
76
+ value: JsonValue;
77
+ }
78
+ type TraceRedactor = (input: TraceRedactorInput) => JsonValue | undefined;
79
+ interface TraceContentPolicy {
80
+ include: readonly TraceContentKind[];
81
+ redact?: TraceRedactor;
82
+ }
83
+ interface TraceExporter {
84
+ export(trace: Readonly<RunTrace>): void | Promise<void>;
85
+ }
86
+ interface TraceExportQueueOptions {
87
+ /** Traces exported at once. Defaults to 4. */
88
+ concurrency?: number;
89
+ /** Traces waiting for an export slot before new traces are dropped. Defaults to 100. */
90
+ maxQueued?: number;
91
+ /** Deadline for each exporter call. Defaults to 30 seconds. */
92
+ timeoutMs?: number;
93
+ /** Failures retained for the next `flushObservability` call. Defaults to 100. */
94
+ maxFailures?: number;
95
+ }
96
+ /** Queue and failure counters for the runtime's trace exporters. */
97
+ interface ObservabilityStats {
98
+ /** Traces exported successfully since the runtime started. */
99
+ exported: number;
100
+ /** Failed exports and dropped traces since the runtime started. */
101
+ failed: number;
102
+ /** Traces dropped because the queue was full. */
103
+ dropped: number;
104
+ /** Traces waiting for an export slot. */
105
+ queued: number;
106
+ /** Traces currently being exported. */
107
+ active: number;
108
+ /** Failures retained for the next flush. */
109
+ retainedFailures: number;
110
+ }
111
+ interface ObservabilityOptions {
112
+ exporters: readonly TraceExporter[];
113
+ calculateCost?: CostCalculator;
114
+ content?: TraceContentPolicy;
115
+ exportQueue?: TraceExportQueueOptions;
116
+ }
117
+ //#endregion
118
+ export { TraceSpanKind as _, RunTrace as a, TraceContentKind as c, TraceExportQueueOptions as d, TraceExporter as f, TraceSpan as g, TraceRunKind as h, ObservabilityStats as i, TraceContentPolicy as l, TraceRedactorInput as m, CostCalculatorInput as n, TraceAnnotation as o, TraceRedactor as p, ObservabilityOptions as r, TraceContent as s, CostCalculator as t, TraceCost as u, TraceStatus as v };
@@ -1,6 +1,6 @@
1
1
  import { t as ExactDefinition } from "./exact-definition-NHBBFlFR.mjs";
2
- import { f as RunId, l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-BDVUoAU6.mjs";
3
- import { I as SessionId, M as RunResult, j as RunRequest, n as AgentLimits } from "./index-CGmHXV31.mjs";
2
+ import { f as RunId, l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-B8laW1hM.mjs";
3
+ import { L as SessionId, M as RunRequest, N as RunResult, n as AgentLimits } from "./index-CzAi2Y_Z.mjs";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
  //#region src/workflows/workflow.d.ts
6
6
  /** Context shared with workflow steps and compensation handlers. */
@@ -1,6 +1,6 @@
1
1
  import { t as ExactDefinition } from "./exact-definition-NHBBFlFR.mjs";
2
- import { f as RunId, i as AgentMessage, l as JsonValue, o as ExecutionContext, s as JsonObject, t as AgentEvent } from "./types-BDVUoAU6.mjs";
3
- import { c as ReasoningEffort, i as ModelRef, l as ToolChoice, r as ModelMetadata, s as ModelUsage } from "./index-BPwkgdo3.mjs";
2
+ import { f as RunId, i as AgentMessage, l as JsonValue, o as ExecutionContext, s as JsonObject, t as AgentEvent } from "./types-B8laW1hM.mjs";
3
+ import { c as ReasoningEffort, i as ModelRef, l as ToolChoice, r as ModelMetadata, s as ModelUsage } from "./index-BgKFd9yw.mjs";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
  //#region src/runtime/run-store.d.ts
6
6
  /** Stable identifier for conversation history shared across runs. */
@@ -110,7 +110,14 @@ type EventResolution = {
110
110
  };
111
111
  };
112
112
  type ResumeRunResolution = ElicitationResolution | ApprovalResolution | ToolExecutionResolution | TimerResolution | EventResolution;
113
- interface AgentRun<TOutput = JsonValue> {
113
+ /** Correlation fields for runs created by a workflow or team coordinator. */
114
+ interface RunCorrelation {
115
+ /** Run that created this one. */
116
+ parentRunId?: RunId;
117
+ /** Top-level run in the correlation tree. */
118
+ rootRunId?: RunId;
119
+ }
120
+ interface AgentRun<TOutput = JsonValue> extends RunCorrelation {
114
121
  kind?: 'agent';
115
122
  id: RunId;
116
123
  sessionId: SessionId;
@@ -129,7 +136,7 @@ interface AgentRun<TOutput = JsonValue> {
129
136
  error?: string;
130
137
  usage?: ModelUsage;
131
138
  }
132
- interface WorkflowRun<TOutput = JsonValue> {
139
+ interface WorkflowRun<TOutput = JsonValue> extends RunCorrelation {
133
140
  kind: 'workflow';
134
141
  id: RunId;
135
142
  sessionId: SessionId;
@@ -145,7 +152,7 @@ interface WorkflowRun<TOutput = JsonValue> {
145
152
  error?: string;
146
153
  usage?: ModelUsage;
147
154
  }
148
- interface TeamRun<TOutput = JsonValue> {
155
+ interface TeamRun<TOutput = JsonValue> extends RunCorrelation {
149
156
  kind: 'team';
150
157
  id: RunId;
151
158
  sessionId: SessionId;
@@ -457,4 +464,4 @@ interface AgentDefinition<TInput = unknown, TOutput = unknown> {
457
464
  }
458
465
  declare function defineAgent<T extends AgentDefinition>(agent: ExactDefinition<T, AgentDefinition>): T;
459
466
  //#endregion
460
- export { validatePurgeRunsOptions as $, RunRecord as A, TimerResolution as B, PurgeRunsResult as C, RunCheckpoint as D, RetainableRunStore as E, Session as F, WorkflowCheckpoint as G, ToolExecutionResolution as H, SessionId as I, WorkflowStepRecord as J, WorkflowCompensationRecord as K, StoredRunCheckpoint as L, RunResult as M, RunStatus as N, RunLease as O, RunStore as P, validateListEventsOptions as Q, TeamCheckpoint as R, PurgeRunsOptions as S, RetainableRunStatus as T, ToolExecutionStatus as U, ToolExecutionRecord as V, WorkflowBudgetUsage as W, isDurableRunStore as X, WorkflowWaitRecord as Y, isRetainableRunStore as Z, EventResolution as _, AgentRun as a, ListEventsOptions as b, ApprovalRequest as c, CoordinatorRun as d, CredentialStore as f, ElicitationResolution as g, ElicitationRequest as h, InMemoryRunStore as i, RunRequest as j, RunPause as k, ApprovalResolution as l, ElicitationMode as m, AgentLimits as n, AgentRunPause as o, DurableRunStore as p, WorkflowRun as q, defineAgent as r, ApprovalMode as s, AgentDefinition as t, CoordinatorCheckpoint as u, ExecutionCommit as v, ResumeRunResolution as w, PendingToolExecution as x, ExecutionCreate as y, TeamRun as z };
467
+ export { validateListEventsOptions as $, RunPause as A, TeamRun as B, PurgeRunsResult as C, RunCheckpoint as D, RetainableRunStore as E, RunStore as F, WorkflowBudgetUsage as G, ToolExecutionRecord as H, Session as I, WorkflowRun as J, WorkflowCheckpoint as K, SessionId as L, RunRequest as M, RunResult as N, RunCorrelation as O, RunStatus as P, isRetainableRunStore as Q, StoredRunCheckpoint as R, PurgeRunsOptions as S, RetainableRunStatus as T, ToolExecutionResolution as U, TimerResolution as V, ToolExecutionStatus as W, WorkflowWaitRecord as X, WorkflowStepRecord as Y, isDurableRunStore as Z, EventResolution as _, AgentRun as a, ListEventsOptions as b, ApprovalRequest as c, CoordinatorRun as d, validatePurgeRunsOptions as et, CredentialStore as f, ElicitationResolution as g, ElicitationRequest as h, InMemoryRunStore as i, RunRecord as j, RunLease as k, ApprovalResolution as l, ElicitationMode as m, AgentLimits as n, AgentRunPause as o, DurableRunStore as p, WorkflowCompensationRecord as q, defineAgent as r, ApprovalMode as s, AgentDefinition as t, CoordinatorCheckpoint as u, ExecutionCommit as v, ResumeRunResolution as w, PendingToolExecution as x, ExecutionCreate as y, TeamCheckpoint as z };
@@ -1,4 +1,4 @@
1
- import { f as RunId, l as JsonValue, o as ExecutionContext } from "./types-BDVUoAU6.mjs";
1
+ import { f as RunId, l as JsonValue, o as ExecutionContext } from "./types-B8laW1hM.mjs";
2
2
  //#region src/sandbox/sandbox.d.ts
3
3
  interface SandboxCapabilities {
4
4
  process?: {