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

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 +786 -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
@@ -1,23 +0,0 @@
1
- import { t as ExactDefinition } from "./exact-definition-NHBBFlFR.mjs";
2
- import { ModelRef, ReasoningEffort } from "./models/index.mjs";
3
- import { StandardSchemaV1 } from "@standard-schema/spec";
4
- //#region src/agents/index.d.ts
5
- interface AgentLimits {
6
- maxSteps?: number;
7
- maxToolCalls?: number;
8
- maxInputTokens?: number | false;
9
- maxOutputTokens?: number | false;
10
- }
11
- interface AgentDefinition<TOutput = unknown> {
12
- name: string;
13
- instructions: string;
14
- model?: ModelRef;
15
- tools?: string[];
16
- reasoning?: ReasoningEffort;
17
- modelOptions?: Record<string, unknown>;
18
- outputSchema?: StandardSchemaV1<unknown, TOutput>;
19
- limits?: AgentLimits;
20
- }
21
- declare function defineAgent<T extends AgentDefinition>(agent: ExactDefinition<T, AgentDefinition>): T;
22
- //#endregion
23
- export { AgentLimits as n, defineAgent as r, AgentDefinition as t };
@@ -1,47 +0,0 @@
1
- import { t as ExactDefinition } from "./exact-definition-NHBBFlFR.mjs";
2
- import { f as RunId, h as ToolSpec, l as JsonValue, o as ExecutionContext, s as JsonObject } from "./index-C_Zpr13f.mjs";
3
- import { StandardSchemaV1 } from "@standard-schema/spec";
4
- //#region src/tools/index.d.ts
5
- interface ToolExecutionContext {
6
- runId: RunId;
7
- toolCallId: string;
8
- attempt: number;
9
- idempotencyKey: string;
10
- getCredential(name: string): Promise<string>;
11
- context?: ExecutionContext;
12
- signal?: AbortSignal;
13
- }
14
- type ToolRisk = 'read' | 'write' | 'sensitive' | 'destructive';
15
- type ToolApproval = 'never' | 'required';
16
- type ToolIdempotency = 'none' | 'keyed';
17
- interface ToolRetryPolicy {
18
- maxAttempts: number;
19
- backoffMs: number;
20
- maxBackoffMs?: number;
21
- }
22
- interface ToolDefinition<TInput = unknown, TOutput = unknown> {
23
- name: string;
24
- description?: string;
25
- inputSchema?: StandardSchemaV1<unknown, TInput>;
26
- outputSchema?: StandardSchemaV1<unknown, TOutput>;
27
- risk?: ToolRisk;
28
- approval?: ToolApproval;
29
- idempotency?: ToolIdempotency;
30
- retry?: ToolRetryPolicy;
31
- credentials?: string[];
32
- execute(input: TInput, context: ToolExecutionContext): TOutput | Promise<TOutput>;
33
- }
34
- type ToolWithSchemas<TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1> = Omit<ToolDefinition<StandardSchemaV1.InferOutput<TInputSchema>, StandardSchemaV1.InferOutput<TOutputSchema>>, 'inputSchema' | 'outputSchema'> & {
35
- inputSchema: TInputSchema;
36
- outputSchema: TOutputSchema;
37
- };
38
- type ToolWithInputSchema<TInputSchema extends StandardSchemaV1> = Omit<ToolDefinition<StandardSchemaV1.InferOutput<TInputSchema>, unknown>, 'inputSchema'> & {
39
- inputSchema: TInputSchema;
40
- };
41
- declare function defineTool<TInputSchema extends StandardSchemaV1, TOutputSchema extends StandardSchemaV1, TDefinition extends ToolWithSchemas<TInputSchema, TOutputSchema>>(tool: ToolWithSchemas<TInputSchema, TOutputSchema> & ExactDefinition<TDefinition, ToolWithSchemas<TInputSchema, TOutputSchema>>): TDefinition;
42
- declare function defineTool<TInputSchema extends StandardSchemaV1, TDefinition extends ToolWithInputSchema<TInputSchema>>(tool: ToolWithInputSchema<TInputSchema> & ExactDefinition<TDefinition, ToolWithInputSchema<TInputSchema>>): TDefinition;
43
- declare function defineTool<TDefinition extends ToolDefinition>(tool: ToolDefinition & ExactDefinition<TDefinition, ToolDefinition>): TDefinition;
44
- declare function toToolSpec(tool: ToolDefinition, inputSchema?: JsonObject): ToolSpec;
45
- type ToolResult = JsonValue;
46
- //#endregion
47
- export { ToolResult as a, defineTool as c, ToolIdempotency as i, toToolSpec as l, ToolDefinition as n, ToolRetryPolicy as o, ToolExecutionContext as r, ToolRisk as s, ToolApproval as t };
@@ -1,124 +0,0 @@
1
- //#region src/core/index.d.ts
2
- type JsonPrimitive = string | number | boolean | null;
3
- type JsonObject = {
4
- [key: string]: JsonValue;
5
- };
6
- type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
7
- type RunId = string;
8
- declare const SCHEMA_NOT_TRANSPORTABLE = "SCHEMA_NOT_TRANSPORTABLE";
9
- declare const PROVIDER_SCHEMA_UNSUPPORTED = "PROVIDER_SCHEMA_UNSUPPORTED";
10
- declare const PROVIDER_REASONING_UNSUPPORTED = "PROVIDER_REASONING_UNSUPPORTED";
11
- interface ExecutionContext {
12
- namespace?: string;
13
- actor?: {
14
- id: string;
15
- type?: string;
16
- };
17
- attributes?: JsonObject;
18
- prompt?: JsonObject;
19
- }
20
- type AgentMessageRole = 'system' | 'user' | 'assistant' | 'tool';
21
- interface AgentMessage {
22
- role: AgentMessageRole;
23
- content: string;
24
- name?: string;
25
- toolCallId?: string;
26
- toolCalls?: ToolCall[];
27
- }
28
- interface ToolSpec {
29
- name: string;
30
- description?: string;
31
- inputSchema?: JsonObject;
32
- }
33
- interface ToolCall {
34
- id: string;
35
- name: string;
36
- input: JsonValue;
37
- }
38
- type AgentEventType = 'run.started' | 'run.paused' | 'run.resumed' | 'model.started' | 'model.output.delta' | 'model.completed' | 'tool.started' | 'tool.completed' | 'tool.failed' | 'tool.retrying' | 'tool.execution_unknown' | 'approval.requested' | 'approval.resolved' | 'run.completed' | 'run.failed' | 'run.cancelled';
39
- interface AgentEventPayloads {
40
- 'run.started': undefined;
41
- 'run.paused': {
42
- reason: 'approval' | 'tool_execution_unknown';
43
- toolCallId: string;
44
- };
45
- 'run.resumed': undefined;
46
- 'model.started': {
47
- step: number;
48
- };
49
- 'model.output.delta': {
50
- step: number;
51
- delta: string;
52
- };
53
- 'model.completed': {
54
- step: number;
55
- usage?: JsonObject;
56
- };
57
- 'tool.started': {
58
- step: number;
59
- toolCallId: string;
60
- toolName: string;
61
- attempt?: number;
62
- };
63
- 'tool.completed': {
64
- step: number;
65
- toolCallId: string;
66
- toolName: string;
67
- attempt?: number;
68
- };
69
- 'tool.failed': {
70
- step: number;
71
- toolCallId: string;
72
- toolName: string;
73
- error: string;
74
- };
75
- 'tool.retrying': {
76
- step: number;
77
- toolCallId: string;
78
- toolName: string;
79
- attempt: number;
80
- delayMs: number;
81
- error: string;
82
- };
83
- 'tool.execution_unknown': {
84
- step: number;
85
- toolCallId: string;
86
- toolName: string;
87
- };
88
- 'approval.requested': {
89
- approvalId: string;
90
- toolCallId: string;
91
- toolName: string;
92
- };
93
- 'approval.resolved': {
94
- approvalId: string;
95
- toolCallId: string;
96
- decision: 'approve' | 'reject';
97
- actorId: string;
98
- };
99
- 'run.completed': {
100
- output: JsonValue;
101
- usage?: JsonObject;
102
- };
103
- 'run.failed': {
104
- error: string;
105
- };
106
- 'run.cancelled': {
107
- reason: 'aborted' | 'timeout' | 'approval_rejected';
108
- };
109
- }
110
- interface AgentEventBase {
111
- id: string;
112
- sequence: number;
113
- runId: RunId;
114
- timestamp: string;
115
- }
116
- type AgentEvent<TType extends AgentEventType = AgentEventType> = { [TCurrent in TType]: AgentEventBase & {
117
- type: TCurrent;
118
- } & (AgentEventPayloads[TCurrent] extends undefined ? {
119
- payload?: never;
120
- } : {
121
- payload: AgentEventPayloads[TCurrent];
122
- }); }[TType];
123
- //#endregion
124
- export { AgentMessageRole as a, JsonPrimitive as c, PROVIDER_SCHEMA_UNSUPPORTED as d, RunId as f, ToolSpec as h, AgentMessage as i, JsonValue as l, ToolCall as m, AgentEventPayloads as n, ExecutionContext as o, SCHEMA_NOT_TRANSPORTABLE as p, AgentEventType as r, JsonObject as s, AgentEvent as t, PROVIDER_REASONING_UNSUPPORTED as u };
@@ -1,181 +0,0 @@
1
- import { f as RunId, i as AgentMessage, l as JsonValue, o as ExecutionContext, t as AgentEvent } from "./index-C_Zpr13f.mjs";
2
- import { ModelUsage } from "./models/index.mjs";
3
- import { StandardSchemaV1 } from "@standard-schema/spec";
4
- //#region src/runtime/index.d.ts
5
- type SessionId = string;
6
- type RunStatus = 'running' | 'paused' | 'completed' | 'failed' | 'cancelled';
7
- interface ApprovalRequest {
8
- id: string;
9
- toolCallId: string;
10
- toolName: string;
11
- input: JsonValue;
12
- risk: 'read' | 'write' | 'sensitive' | 'destructive';
13
- requestedAt: string;
14
- }
15
- type RunPause = {
16
- type: 'approval';
17
- approval: ApprovalRequest;
18
- } | {
19
- type: 'tool_execution_unknown';
20
- toolCallId: string;
21
- toolName: string;
22
- input: JsonValue;
23
- };
24
- interface ApprovalResolution {
25
- type: 'approval';
26
- approvalId: string;
27
- decision: 'approve' | 'reject';
28
- actor: {
29
- id: string;
30
- type?: string;
31
- };
32
- }
33
- type ToolExecutionResolution = {
34
- type: 'tool_execution';
35
- toolCallId: string;
36
- decision: 'use_output';
37
- output: JsonValue;
38
- actor: {
39
- id: string;
40
- type?: string;
41
- };
42
- } | {
43
- type: 'tool_execution';
44
- toolCallId: string;
45
- decision: 'retry';
46
- actor: {
47
- id: string;
48
- type?: string;
49
- };
50
- };
51
- type ResumeRunResolution = ApprovalResolution | ToolExecutionResolution;
52
- interface AgentRun<TOutput = JsonValue> {
53
- id: RunId;
54
- sessionId: SessionId;
55
- agentName: string;
56
- status: RunStatus;
57
- revision: number;
58
- pause?: RunPause;
59
- createdAt: string;
60
- updatedAt: string;
61
- output?: TOutput;
62
- error?: string;
63
- usage?: ModelUsage;
64
- }
65
- interface Session {
66
- id: SessionId;
67
- history: AgentMessage[];
68
- createdAt: string;
69
- updatedAt: string;
70
- }
71
- interface ListEventsOptions {
72
- after?: AgentEvent['id'];
73
- }
74
- interface RunStore {
75
- getRun(runId: RunId): Promise<AgentRun | undefined>;
76
- saveRun(run: AgentRun): Promise<void>;
77
- getSession(sessionId: SessionId): Promise<Session | undefined>;
78
- saveSession(session: Session): Promise<void>;
79
- appendEvent(event: AgentEvent): Promise<void>;
80
- listEvents(runId: RunId, options?: ListEventsOptions): Promise<AgentEvent[]>;
81
- }
82
- interface CredentialStore {
83
- resolve(input: {
84
- name: string;
85
- namespace?: string;
86
- actor?: {
87
- id: string;
88
- type?: string;
89
- };
90
- }): Promise<string | undefined>;
91
- }
92
- interface PendingToolExecution {
93
- call: {
94
- id: string;
95
- name: string;
96
- input: JsonValue;
97
- };
98
- input: JsonValue;
99
- idempotencyKey: string;
100
- attempt: number;
101
- }
102
- interface RunCheckpoint {
103
- runId: RunId;
104
- definitionHash: string;
105
- messages: AgentMessage[];
106
- inputContent: string;
107
- context?: ExecutionContext;
108
- usage?: ModelUsage;
109
- providerState?: JsonValue;
110
- step: number;
111
- toolCallCount: number;
112
- seenToolCallIds: string[];
113
- pendingTools: PendingToolExecution[];
114
- pendingIndex: number;
115
- }
116
- type ToolExecutionStatus = 'started' | 'completed' | 'failed' | 'unknown';
117
- interface ToolExecutionRecord {
118
- runId: RunId;
119
- toolCallId: string;
120
- toolName: string;
121
- input: JsonValue;
122
- status: ToolExecutionStatus;
123
- attempt: number;
124
- idempotencyKey: string;
125
- output?: JsonValue;
126
- error?: string;
127
- updatedAt: string;
128
- }
129
- interface RunLease {
130
- runId: RunId;
131
- ownerId: string;
132
- expiresAt: string;
133
- }
134
- interface ExecutionCommit {
135
- expectedRevision: number;
136
- run: AgentRun;
137
- checkpoint?: RunCheckpoint | null;
138
- session?: Session;
139
- toolExecution?: ToolExecutionRecord;
140
- events?: AgentEvent[];
141
- }
142
- interface DurableRunStore extends RunStore {
143
- getCheckpoint(runId: RunId): Promise<RunCheckpoint | undefined>;
144
- getToolExecution(runId: RunId, toolCallId: string): Promise<ToolExecutionRecord | undefined>;
145
- commitExecution(commit: ExecutionCommit): Promise<boolean>;
146
- acquireLease(lease: RunLease): Promise<boolean>;
147
- renewLease(lease: RunLease): Promise<boolean>;
148
- releaseLease(runId: RunId, ownerId: string): Promise<void>;
149
- }
150
- declare function isDurableRunStore(store: RunStore): store is DurableRunStore;
151
- declare class InMemoryRunStore implements DurableRunStore {
152
- #private;
153
- getRun(runId: RunId): Promise<AgentRun | undefined>;
154
- saveRun(run: AgentRun): Promise<void>;
155
- getSession(sessionId: SessionId): Promise<Session | undefined>;
156
- saveSession(session: Session): Promise<void>;
157
- appendEvent(event: AgentEvent): Promise<void>;
158
- listEvents(runId: RunId, options?: ListEventsOptions): Promise<AgentEvent[]>;
159
- getCheckpoint(runId: RunId): Promise<RunCheckpoint | undefined>;
160
- getToolExecution(runId: RunId, toolCallId: string): Promise<ToolExecutionRecord | undefined>;
161
- commitExecution(commit: ExecutionCommit): Promise<boolean>;
162
- acquireLease(lease: RunLease): Promise<boolean>;
163
- renewLease(lease: RunLease): Promise<boolean>;
164
- releaseLease(runId: RunId, ownerId: string): Promise<void>;
165
- }
166
- interface RunRequest<TInput = unknown, TOutput = unknown> {
167
- input: TInput;
168
- context?: ExecutionContext;
169
- outputSchema?: StandardSchemaV1<unknown, TOutput>;
170
- sessionId?: SessionId;
171
- signal?: AbortSignal;
172
- }
173
- interface RunResult<TOutput = unknown> {
174
- runId: RunId;
175
- sessionId: SessionId;
176
- output: TOutput;
177
- events?: AgentEvent[];
178
- usage?: ModelUsage;
179
- }
180
- //#endregion
181
- export { isDurableRunStore as C, ToolExecutionStatus as S, RunStore as _, DurableRunStore as a, ToolExecutionRecord as b, ListEventsOptions as c, RunCheckpoint as d, RunLease as f, RunStatus as g, RunResult as h, CredentialStore as i, PendingToolExecution as l, RunRequest as m, ApprovalRequest as n, ExecutionCommit as o, RunPause as p, ApprovalResolution as r, InMemoryRunStore as s, AgentRun as t, ResumeRunResolution as u, Session as v, ToolExecutionResolution as x, SessionId as y };
@@ -1,79 +0,0 @@
1
- import { f as RunId, l as JsonValue, s as JsonObject } from "./index-C_Zpr13f.mjs";
2
- import { ModelMetadata, ModelUsage } from "./models/index.mjs";
3
- import { y as SessionId } from "./index-DGWOGXzc.mjs";
4
- //#region src/observability/index.d.ts
5
- type TraceStatus = 'completed' | 'failed' | 'cancelled';
6
- type TraceSpanKind = 'model' | 'tool';
7
- type TraceContentKind = 'run.output' | 'model.output' | 'error.message';
8
- interface TraceCost {
9
- amount: number;
10
- currency: string;
11
- }
12
- interface TraceContent {
13
- kind: TraceContentKind;
14
- value: JsonValue;
15
- }
16
- interface TraceAnnotation {
17
- name: string;
18
- timestamp: string;
19
- attributes?: JsonObject;
20
- }
21
- interface TraceSpan {
22
- id: string;
23
- parentId: string;
24
- kind: TraceSpanKind;
25
- name: string;
26
- startedAt: string;
27
- endedAt: string;
28
- durationMs: number;
29
- status: TraceStatus;
30
- attributes: JsonObject;
31
- annotations: TraceAnnotation[];
32
- usage?: ModelUsage;
33
- cost?: TraceCost;
34
- content?: TraceContent[];
35
- }
36
- interface RunTrace {
37
- schemaVersion: '1';
38
- traceId: string;
39
- runId: RunId;
40
- sessionId: SessionId;
41
- agentName: string;
42
- modelRegistryName: string;
43
- model?: ModelMetadata;
44
- startedAt: string;
45
- endedAt: string;
46
- durationMs: number;
47
- status: TraceStatus;
48
- attributes: JsonObject;
49
- annotations: TraceAnnotation[];
50
- spans: TraceSpan[];
51
- usage?: ModelUsage;
52
- cost?: TraceCost;
53
- content?: TraceContent[];
54
- }
55
- interface CostCalculatorInput {
56
- modelRegistryName: string;
57
- model?: ModelMetadata;
58
- usage: ModelUsage;
59
- }
60
- type CostCalculator = (input: CostCalculatorInput) => TraceCost | undefined;
61
- interface TraceRedactorInput {
62
- kind: TraceContentKind;
63
- value: JsonValue;
64
- }
65
- type TraceRedactor = (input: TraceRedactorInput) => JsonValue | undefined;
66
- interface TraceContentPolicy {
67
- include: readonly TraceContentKind[];
68
- redact?: TraceRedactor;
69
- }
70
- interface TraceExporter {
71
- export(trace: Readonly<RunTrace>): void | Promise<void>;
72
- }
73
- interface ObservabilityOptions {
74
- exporters: readonly TraceExporter[];
75
- calculateCost?: CostCalculator;
76
- content?: TraceContentPolicy;
77
- }
78
- //#endregion
79
- 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 };