@bifrost-ai/engine 0.0.1-build.1778597197821

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.
@@ -0,0 +1,4 @@
1
+ export * from './types';
2
+ export * from './interface';
3
+ export * from './test-engine';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,59 @@
1
+ //#region src/test-engine.ts
2
+ var e = class {
3
+ #e;
4
+ constructor(e = {}) {
5
+ this.#e = {
6
+ success: !0,
7
+ lastMessage: "Test execution complete",
8
+ simulateError: !1,
9
+ simulateDelay: 0,
10
+ mockStats: null,
11
+ ...e
12
+ };
13
+ }
14
+ async execute(e) {
15
+ if (this.#e.simulateDelay && this.#e.simulateDelay > 0 && await new Promise((e) => setTimeout(e, this.#e.simulateDelay)), this.#e.simulateError) throw Error("Simulated engine error");
16
+ let t = Date.now(), n = {
17
+ durationMs: 0,
18
+ inputTokens: 100,
19
+ outputTokens: 50,
20
+ cacheReadTokens: 10,
21
+ cacheCreationTokens: 5,
22
+ totalCostUsd: .005,
23
+ numTurns: 1,
24
+ ...this.#e.mockStats
25
+ };
26
+ return n.durationMs = Date.now() - t, {
27
+ success: this.#e.success ?? !0,
28
+ skipFulfill: !1,
29
+ lastMessage: `${this.#e.lastMessage} (task: ${e.taskId}, agent: ${e.agentName})`,
30
+ stats: n
31
+ };
32
+ }
33
+ async sendFollowUp(e) {
34
+ this.#e.simulateDelay && this.#e.simulateDelay > 0 && await new Promise((e) => setTimeout(e, this.#e.simulateDelay));
35
+ let t = {
36
+ durationMs: this.#e.simulateDelay ?? 10,
37
+ inputTokens: 50,
38
+ outputTokens: 25,
39
+ cacheReadTokens: 5,
40
+ cacheCreationTokens: 2,
41
+ totalCostUsd: .0025,
42
+ numTurns: 1
43
+ };
44
+ return {
45
+ success: this.#e.success ?? !0,
46
+ skipFulfill: !1,
47
+ lastMessage: `Follow-up: ${e}`,
48
+ stats: t
49
+ };
50
+ }
51
+ setConfig(e) {
52
+ this.#e = {
53
+ ...this.#e,
54
+ ...e
55
+ };
56
+ }
57
+ };
58
+ //#endregion
59
+ export { e as TestEngine };
@@ -0,0 +1,6 @@
1
+ import { EngineContext, EngineResult } from './types';
2
+ export type Engine = {
3
+ execute: (context: EngineContext) => Promise<EngineResult>;
4
+ };
5
+ export type { EngineContext, EngineResult };
6
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG3D,MAAM,MAAM,MAAM,GAAG;IAEnB,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CAC5D,CAAC;AAGF,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interface.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.spec.d.ts","sourceRoot":"","sources":["../src/interface.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { EngineContext, EngineResult } from './types';
2
+ import { Engine } from './interface';
3
+ export type TestEngineConfig = {
4
+ success?: boolean;
5
+ lastMessage?: string;
6
+ simulateError?: boolean;
7
+ simulateDelay?: number;
8
+ mockStats?: Partial<EngineResult["stats"]>;
9
+ };
10
+ /**
11
+ * Test Engine implementation for testing and development.
12
+ * Simulates engine execution with configurable behavior.
13
+ */
14
+ export declare class TestEngine implements Engine {
15
+ #private;
16
+ constructor(config?: TestEngineConfig);
17
+ execute(context: EngineContext): Promise<EngineResult>;
18
+ sendFollowUp(message: string): Promise<EngineResult>;
19
+ /**
20
+ * Update engine configuration.
21
+ */
22
+ setConfig(config: Partial<TestEngineConfig>): void;
23
+ }
24
+ //# sourceMappingURL=test-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-engine.d.ts","sourceRoot":"","sources":["../src/test-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF;;;GAGG;AACH,qBAAa,UAAW,YAAW,MAAM;;gBAGpB,MAAM,GAAE,gBAAqB;IAWnC,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAmCtD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAwBjE;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;CAG1D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=test-engine.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-engine.spec.d.ts","sourceRoot":"","sources":["../src/test-engine.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ export type EngineContext = {
2
+ taskId: string;
3
+ workingDir: string;
4
+ agentName: string;
5
+ taskState: Record<string, unknown>;
6
+ metadata: Record<string, unknown>;
7
+ setState: (newState: Record<string, unknown>) => Promise<void>;
8
+ verbose: boolean;
9
+ };
10
+ export type EngineResult = {
11
+ success: boolean;
12
+ skipFulfill: boolean;
13
+ lastMessage: string | null;
14
+ stats: ExecutionStats | null;
15
+ };
16
+ export type ExecutionStats = {
17
+ durationMs: number;
18
+ inputTokens: number;
19
+ outputTokens: number;
20
+ cacheReadTokens: number;
21
+ cacheCreationTokens: number;
22
+ totalCostUsd: number;
23
+ numTurns: number;
24
+ };
25
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9B,CAAC;AAGF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.spec.d.ts","sourceRoot":"","sources":["../src/types.spec.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@bifrost-ai/engine",
3
+ "version": "0.0.1-build.1778597197821",
4
+ "description": "Engine interface and types for Orchestrator Framework",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "dist/**/*.d.ts"
17
+ ],
18
+ "scripts": {
19
+ "build": "vite build"
20
+ }
21
+ }