@fevex/core 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (56) hide show
  1. package/README.md +771 -13
  2. package/dist/agents/index.d.mts +2 -2
  3. package/dist/agents/index.mjs +1 -1
  4. package/dist/artifacts/index.d.mts +2 -0
  5. package/dist/artifacts/index.mjs +2 -0
  6. package/dist/artifacts-gUzemET7.mjs +440 -0
  7. package/dist/channels/index.d.mts +2 -0
  8. package/dist/channels/index.mjs +192 -0
  9. package/dist/evals/index.d.mts +19 -11
  10. package/dist/evals/index.mjs +125 -122
  11. package/dist/fevex-_KOsOsB8.d.mts +129 -0
  12. package/dist/http/index.d.mts +150 -0
  13. package/dist/http/index.mjs +692 -0
  14. package/dist/index-26ilbzAs.d.mts +50 -0
  15. package/dist/index-B8EcvWeN.d.mts +103 -0
  16. package/dist/index-BEqYWean.d.mts +118 -0
  17. package/dist/index-Btth7rdL.d.mts +58 -0
  18. package/dist/{index-QTkd6a7C.d.mts → index-CFzrvDQ0.d.mts} +4 -3
  19. package/dist/index-CIHWc5V1.d.mts +116 -0
  20. package/dist/index-D7r0puBi.d.mts +64 -0
  21. package/dist/index-DHcfIfh-.d.mts +224 -0
  22. package/dist/index-DUhNa7IR.d.mts +73 -0
  23. package/dist/index-lCCFokc6.d.mts +617 -0
  24. package/dist/index.d.mts +22 -10
  25. package/dist/index.mjs +4178 -671
  26. package/dist/knowledge/index.d.mts +2 -0
  27. package/dist/knowledge/index.mjs +289 -0
  28. package/dist/model-stream-JQdHDDcj.mjs +131 -0
  29. package/dist/models/index.d.mts +2 -46
  30. package/dist/observability/index.d.mts +2 -2
  31. package/dist/policies/index.d.mts +1 -1
  32. package/dist/policies/index.mjs +1 -1
  33. package/dist/run-error-Cr17wPGH.mjs +23 -0
  34. package/dist/{model-stream-u2xMsEaf.mjs → run-support-CmZ6Xo6H.mjs} +41 -130
  35. package/dist/runtime/index.d.mts +2 -2
  36. package/dist/runtime/index.mjs +271 -9
  37. package/dist/sandbox/index.d.mts +2 -0
  38. package/dist/sandbox/index.mjs +147 -0
  39. package/dist/teams/index.d.mts +2 -0
  40. package/dist/teams/index.mjs +2 -0
  41. package/dist/teams-Ctz676G4.mjs +82 -0
  42. package/dist/testing/index.d.mts +39 -9
  43. package/dist/testing/index.mjs +512 -28
  44. package/dist/tools/index.d.mts +3 -3
  45. package/dist/tools/index.mjs +442 -2
  46. package/dist/types-CckDlhYo.d.mts +575 -0
  47. package/dist/workflows/index.d.mts +2 -0
  48. package/dist/workflows/index.mjs +6 -0
  49. package/package.json +31 -3
  50. package/dist/exact-definition-NHBBFlFR.d.mts +0 -4
  51. package/dist/fevex-Dz6GBz9o.d.mts +0 -32
  52. package/dist/index-BzxHfyYV.d.mts +0 -23
  53. package/dist/index-CZGyhNIQ.d.mts +0 -47
  54. package/dist/index-C_Zpr13f.d.mts +0 -124
  55. package/dist/index-DGWOGXzc.d.mts +0 -181
  56. package/dist/index-ojCY3lwm.d.mts +0 -79
@@ -0,0 +1,50 @@
1
+ import { z as ExactDefinition } from "./index-DHcfIfh-.mjs";
2
+ import { o as ExecutionContext } from "./types-CckDlhYo.mjs";
3
+ import { n as AgentLimits } from "./index-lCCFokc6.mjs";
4
+ import { t as WorkflowAgentResult } from "./index-Btth7rdL.mjs";
5
+ import { StandardSchemaV1 } from "@standard-schema/spec";
6
+ //#region src/teams/team.d.ts
7
+ interface TeamMember {
8
+ agent: string;
9
+ role: string;
10
+ description?: string;
11
+ }
12
+ interface TeamLimits extends AgentLimits {
13
+ maxDelegations?: number;
14
+ maxParallel?: number;
15
+ }
16
+ interface TeamDelegation<TInput = unknown> {
17
+ agent: string;
18
+ task: TInput;
19
+ context?: ExecutionContext;
20
+ limits?: AgentLimits;
21
+ expectedOutput?: string;
22
+ constraints?: string[];
23
+ }
24
+ interface TeamHandoff<TInput = unknown> extends Omit<TeamDelegation<TInput>, 'agent'> {
25
+ from: string;
26
+ to: string;
27
+ reason: string;
28
+ }
29
+ type TeamTaskResult<TOutput = unknown> = WorkflowAgentResult<TOutput> & {
30
+ delegationId: string;
31
+ agentName: string;
32
+ };
33
+ interface TeamStep {
34
+ delegate<TInput = unknown, TOutput = unknown>(delegationId: string, delegation: TeamDelegation<TInput>): Promise<TeamTaskResult<TOutput>>;
35
+ handoff<TInput = unknown, TOutput = unknown>(delegationId: string, handoff: TeamHandoff<TInput>): Promise<TeamTaskResult<TOutput>>;
36
+ parallel<TTasks extends Record<string, () => Promise<unknown>>>(stepId: string, tasks: TTasks): Promise<{ [TKey in keyof TTasks]: Awaited<ReturnType<TTasks[TKey]>>; }>;
37
+ }
38
+ interface TeamDefinition<TInput = unknown, TOutput = unknown> {
39
+ name: string;
40
+ version?: string;
41
+ supervisor: string;
42
+ members: TeamMember[];
43
+ limits?: TeamLimits;
44
+ inputSchema?: StandardSchemaV1<unknown, TInput>;
45
+ outputSchema?: StandardSchemaV1<unknown, TOutput>;
46
+ run(team: TeamStep, input: TInput): TOutput | Promise<TOutput>;
47
+ }
48
+ declare function defineTeam<T extends TeamDefinition>(team: ExactDefinition<T, TeamDefinition>): T;
49
+ //#endregion
50
+ export { TeamMember as a, defineTeam as c, TeamLimits as i, TeamDelegation as n, TeamStep as o, TeamHandoff as r, TeamTaskResult as s, TeamDefinition as t };
@@ -0,0 +1,103 @@
1
+ import { f as RunId, o as ExecutionContext, s as JsonObject, t as AgentEvent } from "./types-CckDlhYo.mjs";
2
+ import { et as SessionId, j as ElicitationRequest, x as AgentRun } from "./index-lCCFokc6.mjs";
3
+ import { t as Fevex } from "./fevex-_KOsOsB8.mjs";
4
+ //#region src/channels/channel.d.ts
5
+ interface ChannelMessage {
6
+ id: string;
7
+ deliveryId: string;
8
+ conversationId: string;
9
+ threadId?: string;
10
+ content: string;
11
+ actor?: ExecutionContext['actor'];
12
+ metadata?: JsonObject;
13
+ }
14
+ interface ChannelOutput {
15
+ deliveryId: string;
16
+ conversationId: string;
17
+ threadId?: string;
18
+ content: string;
19
+ metadata?: JsonObject;
20
+ }
21
+ interface ChannelContext {
22
+ signal?: AbortSignal;
23
+ }
24
+ interface ChannelElicitationContext extends ChannelContext {
25
+ /** Stable key for transport-level idempotency, preserved across delivery retries. */
26
+ deliveryId: string;
27
+ runId: RunId;
28
+ sessionId: SessionId;
29
+ conversationId: string;
30
+ threadId?: string;
31
+ }
32
+ interface ChannelAdapter<TInput = unknown, TOutput = unknown> {
33
+ name: string;
34
+ parse(input: TInput, context: ChannelContext): Promise<ChannelMessage | null>;
35
+ deliver(output: ChannelOutput, context: ChannelContext): Promise<TOutput>;
36
+ deliverElicitation?(request: ElicitationRequest, context: ChannelElicitationContext): Promise<TOutput>;
37
+ }
38
+ type ChannelEventType = 'channel.received' | 'channel.delivered' | 'channel.failed';
39
+ type ChannelFailurePhase = 'parse' | 'run' | 'deliver';
40
+ interface ChannelEventBase {
41
+ id: string;
42
+ timestamp: string;
43
+ adapter: string;
44
+ messageId?: string;
45
+ deliveryId?: string;
46
+ conversationId?: string;
47
+ threadId?: string;
48
+ runId?: RunId;
49
+ requestId?: string;
50
+ }
51
+ type ChannelEvent = (ChannelEventBase & {
52
+ type: 'channel.received';
53
+ actor?: ExecutionContext['actor'];
54
+ }) | (ChannelEventBase & {
55
+ type: 'channel.delivered';
56
+ }) | (ChannelEventBase & {
57
+ type: 'channel.failed';
58
+ phase: ChannelFailurePhase;
59
+ error: string;
60
+ });
61
+ type ChannelRunEvent = ChannelEvent | AgentEvent;
62
+ declare class ChannelError extends Error {
63
+ readonly code: string;
64
+ readonly safeMessage: string;
65
+ readonly name = "ChannelError";
66
+ readonly runId?: RunId;
67
+ constructor(code: string, safeMessage: string, options?: ErrorOptions & {
68
+ runId?: RunId;
69
+ });
70
+ }
71
+ interface ChannelDeliveryOptions<TInput = unknown, TDelivery = unknown> {
72
+ fevex: Fevex;
73
+ adapter: ChannelAdapter<TInput, TDelivery>;
74
+ onEvent?: (event: ChannelEvent) => void;
75
+ signal?: AbortSignal;
76
+ }
77
+ interface ChannelRunOptions<TInput = unknown, TDelivery = unknown> extends ChannelDeliveryOptions<TInput, TDelivery> {
78
+ agentName: string;
79
+ resolveSessionId?: (message: ChannelMessage) => SessionId | undefined | Promise<SessionId | undefined>;
80
+ }
81
+ type ChannelRunResult<TDelivery = unknown> = {
82
+ ignored: true;
83
+ events: ChannelRunEvent[];
84
+ } | {
85
+ ignored: false;
86
+ message: ChannelMessage;
87
+ run: AgentRun;
88
+ output: ChannelOutput;
89
+ delivery: TDelivery;
90
+ /** Present when the agent is waiting for external information. */
91
+ elicitation?: ElicitationRequest;
92
+ events: ChannelRunEvent[];
93
+ };
94
+ //#endregion
95
+ //#region src/channels/handle-channel-input.d.ts
96
+ /** Parses one channel input, runs the configured agent, and delivers its result or elicitation. */
97
+ declare function handleChannelInput<TInput, TDelivery>(input: TInput, options: ChannelRunOptions<TInput, TDelivery>): Promise<ChannelRunResult<TDelivery>>;
98
+ /** Delivers a stored agent result or elicitation without executing the agent again. */
99
+ declare function deliverChannelRun<TInput, TDelivery>(runId: RunId, message: ChannelMessage, options: ChannelDeliveryOptions<TInput, TDelivery>): Promise<Exclude<ChannelRunResult<TDelivery>, {
100
+ ignored: true;
101
+ }>>;
102
+ //#endregion
103
+ export { ChannelDeliveryOptions as a, ChannelEvent as c, ChannelMessage as d, ChannelOutput as f, ChannelRunResult as h, ChannelContext as i, ChannelEventType as l, ChannelRunOptions as m, handleChannelInput as n, ChannelElicitationContext as o, ChannelRunEvent as p, ChannelAdapter as r, ChannelError as s, deliverChannelRun as t, ChannelFailurePhase as u };
@@ -0,0 +1,118 @@
1
+ import { r as ModelMetadata, s as ModelUsage } from "./index-D7r0puBi.mjs";
2
+ import { f as RunId, l as JsonValue, s as JsonObject } from "./types-CckDlhYo.mjs";
3
+ import { et as SessionId } from "./index-lCCFokc6.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 };
@@ -0,0 +1,58 @@
1
+ import { z as ExactDefinition } from "./index-DHcfIfh-.mjs";
2
+ import { f as RunId, l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-CckDlhYo.mjs";
3
+ import { J as RunRequest, Y as RunResult, et as SessionId, n as AgentLimits } from "./index-lCCFokc6.mjs";
4
+ import { StandardSchemaV1 } from "@standard-schema/spec";
5
+ //#region src/workflows/workflow.d.ts
6
+ /** Context shared with workflow steps and compensation handlers. */
7
+ interface WorkflowStepContext {
8
+ runId: RunId;
9
+ sessionId: SessionId;
10
+ stepId: string;
11
+ context?: ExecutionContext;
12
+ signal: AbortSignal;
13
+ }
14
+ interface WorkflowStepOptions<TResult = unknown> {
15
+ compensate?(result: TResult, context: WorkflowStepContext): void | Promise<void>;
16
+ /** Metadata persisted with the step and its lifecycle events. */
17
+ metadata?: JsonObject;
18
+ }
19
+ type WorkflowAgentResult<TOutput = unknown> = Omit<RunResult<TOutput>, 'events'>;
20
+ interface WorkflowEventResult<TPayload extends JsonValue = JsonValue> {
21
+ payload?: TPayload;
22
+ actor?: NonNullable<ExecutionContext['actor']>;
23
+ receivedAt: string;
24
+ }
25
+ interface WorkflowEventDefinition<TPayload extends JsonValue = JsonValue> {
26
+ payloadSchema?: StandardSchemaV1<unknown, TPayload>;
27
+ requireActor?: boolean;
28
+ }
29
+ interface WorkflowStep {
30
+ agent<TInput = unknown, TOutput = unknown>(stepId: string, agentName: string, request: RunRequest<TInput, TOutput>, options?: WorkflowStepOptions<WorkflowAgentResult<TOutput>>): Promise<WorkflowAgentResult<TOutput>>;
31
+ parallel<TTasks extends Record<string, () => Promise<unknown>>>(stepId: string, tasks: TTasks, options?: WorkflowStepOptions<{ [TKey in keyof TTasks]: Awaited<ReturnType<TTasks[TKey]>>; }>): Promise<{ [TKey in keyof TTasks]: Awaited<ReturnType<TTasks[TKey]>>; }>;
32
+ waitUntil(stepId: string, resumeAt: string | Date): Promise<void>;
33
+ waitForEvent<TPayload extends JsonValue = JsonValue>(stepId: string, eventName: string): Promise<WorkflowEventResult<TPayload>>;
34
+ }
35
+ interface WorkflowDefinition<TInput = unknown, TOutput = unknown> {
36
+ name: string;
37
+ inputSchema?: StandardSchemaV1<unknown, TInput>;
38
+ outputSchema?: StandardSchemaV1<unknown, TOutput>;
39
+ events?: Record<string, WorkflowEventDefinition>;
40
+ limits?: AgentLimits;
41
+ /**
42
+ * Semantic version of `run`, defaults to `"1"`.
43
+ *
44
+ * A paused run only resumes against the same version. Bump it whenever a
45
+ * change to `run` — or to anything `run` calls — would make replaying an
46
+ * in-flight run incorrect: reordered steps, a reused `stepId` that now means
47
+ * something else, or a changed business rule.
48
+ *
49
+ * The runtime cannot infer this. Hashing the source of `run` would break on
50
+ * every minified redeploy while still missing changes in the functions `run`
51
+ * closes over, so the decision belongs to the author.
52
+ */
53
+ version?: string;
54
+ run(step: WorkflowStep, input: TInput): TOutput | Promise<TOutput>;
55
+ }
56
+ declare function defineWorkflow<T extends WorkflowDefinition>(workflow: ExactDefinition<T, WorkflowDefinition>): T;
57
+ //#endregion
58
+ export { WorkflowStep as a, defineWorkflow as c, WorkflowEventResult as i, WorkflowDefinition as n, WorkflowStepContext as o, WorkflowEventDefinition as r, WorkflowStepOptions as s, WorkflowAgentResult as t };
@@ -1,6 +1,7 @@
1
- import { f as RunId, l as JsonValue, o as ExecutionContext } from "./index-C_Zpr13f.mjs";
2
- import { s as ToolRisk } from "./index-CZGyhNIQ.mjs";
3
- //#region src/policies/index.d.ts
1
+ import { I as ToolRisk } from "./index-DHcfIfh-.mjs";
2
+ import { f as RunId, l as JsonValue, o as ExecutionContext } from "./types-CckDlhYo.mjs";
3
+ //#region src/policies/policy.d.ts
4
+ /** Authorization outcome returned by a policy. */
4
5
  type PolicyDecision = 'allow' | 'deny' | 'require_approval';
5
6
  interface PolicyAuthorization {
6
7
  runId: RunId;
@@ -0,0 +1,116 @@
1
+ import { l as JsonValue, o as ExecutionContext, s as JsonObject } from "./types-CckDlhYo.mjs";
2
+ import { et as SessionId } from "./index-lCCFokc6.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 };
@@ -0,0 +1,64 @@
1
+ import { g as ToolSpec, i as AgentMessage, l as JsonValue, m as ToolCall, s as JsonObject } from "./types-CckDlhYo.mjs";
2
+ //#region src/models/embedding.d.ts
3
+ /** Provider-neutral embedding model used to index tools and queries. */
4
+ interface EmbeddingModel {
5
+ /** Stable identity: provider, model and dimensions. Used in cache keys. */
6
+ readonly id: string;
7
+ /** Expected vector dimensions. Optional; inferred from the first result. */
8
+ readonly dimensions?: number;
9
+ embed(input: {
10
+ texts: string[];
11
+ signal?: AbortSignal;
12
+ }): Promise<number[][]>;
13
+ }
14
+ //#endregion
15
+ //#region src/models/model.d.ts
16
+ /** Provider-neutral reasoning levels accepted by model gateways. */
17
+ type ReasoningEffort = 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
18
+ interface ModelUsage {
19
+ inputTokens?: number;
20
+ outputTokens?: number;
21
+ totalTokens?: number;
22
+ }
23
+ type ToolChoice = 'auto' | 'required' | 'none' | {
24
+ name: string;
25
+ };
26
+ interface ModelInput {
27
+ messages: AgentMessage[];
28
+ tools?: ToolSpec[];
29
+ toolChoice?: ToolChoice;
30
+ reasoning?: ReasoningEffort;
31
+ modelOptions?: Record<string, unknown>;
32
+ outputSchema?: JsonObject;
33
+ maxOutputTokens?: number;
34
+ providerState?: unknown;
35
+ signal?: AbortSignal;
36
+ }
37
+ interface ModelResult<TOutput = unknown> {
38
+ output?: TOutput;
39
+ toolCalls?: ToolCall[];
40
+ usage?: ModelUsage;
41
+ providerState?: unknown;
42
+ }
43
+ interface ModelMetadata {
44
+ provider?: string;
45
+ model?: string;
46
+ }
47
+ interface ModelGateway {
48
+ stream(input: ModelInput): AsyncIterable<ModelStreamEvent>;
49
+ metadata?: ModelMetadata;
50
+ stateCodec?: {
51
+ serialize(state: unknown): JsonValue;
52
+ restore(state: JsonValue): unknown;
53
+ };
54
+ }
55
+ type ModelStreamEvent<TOutput = unknown> = {
56
+ type: 'output.delta';
57
+ delta: string;
58
+ } | {
59
+ type: 'completed';
60
+ result: ModelResult<TOutput>;
61
+ };
62
+ type ModelRef = string | ModelGateway;
63
+ //#endregion
64
+ export { ModelResult as a, ReasoningEffort as c, ModelRef as i, ToolChoice as l, ModelInput as n, ModelStreamEvent as o, ModelMetadata as r, ModelUsage as s, ModelGateway as t, EmbeddingModel as u };