@recombine-ai/engine 1.0.0-beta-4 → 1.1.0

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 (36) hide show
  1. package/.github/workflows/linting.yml +3 -3
  2. package/.github/workflows/publish.yml +6 -6
  3. package/build/lib/bosun/action.d.ts +12 -0
  4. package/build/lib/bosun/action.d.ts.map +1 -1
  5. package/build/lib/bosun/action.js +6 -0
  6. package/build/lib/bosun/agent.d.ts +19 -1
  7. package/build/lib/bosun/agent.d.ts.map +1 -1
  8. package/build/lib/bosun/agent.js +3 -0
  9. package/build/lib/bosun/api-call-tracer.d.ts +9 -0
  10. package/build/lib/bosun/api-call-tracer.d.ts.map +1 -1
  11. package/build/lib/bosun/api-call-tracer.js +3 -0
  12. package/build/lib/bosun/context.d.ts +6 -0
  13. package/build/lib/bosun/context.d.ts.map +1 -1
  14. package/build/lib/bosun/context.js +3 -0
  15. package/build/lib/bosun/conversational-tracer.d.ts +9 -0
  16. package/build/lib/bosun/conversational-tracer.d.ts.map +1 -1
  17. package/build/lib/bosun/conversational-tracer.js +3 -0
  18. package/build/lib/bosun/index.d.ts +25 -1
  19. package/build/lib/bosun/index.d.ts.map +1 -1
  20. package/build/lib/bosun/index.js +21 -0
  21. package/build/lib/bosun/mock.d.ts +3 -0
  22. package/build/lib/bosun/mock.d.ts.map +1 -1
  23. package/build/lib/bosun/mock.js +3 -0
  24. package/build/lib/bosun/step-tracer.d.ts +13 -2
  25. package/build/lib/bosun/step-tracer.d.ts.map +1 -1
  26. package/build/lib/bosun/step-tracer.js +3 -0
  27. package/build/lib/engine.d.ts.map +1 -1
  28. package/build/lib/engine.js +48 -25
  29. package/build/lib/{bosun/step-registry.d.ts → step-registry.d.ts} +2 -2
  30. package/build/lib/step-registry.d.ts.map +1 -0
  31. package/build/lib/stream/engine.d.ts.map +1 -1
  32. package/build/lib/stream/engine.js +13 -19
  33. package/changelog.md +5 -0
  34. package/package.json +1 -1
  35. package/build/lib/bosun/step-registry.d.ts.map +0 -1
  36. /package/build/lib/{bosun/step-registry.js → step-registry.js} +0 -0
@@ -11,12 +11,12 @@ jobs:
11
11
  timeout-minutes: 10
12
12
  steps:
13
13
  - name: Checkout
14
- uses: actions/checkout@v4
14
+ uses: actions/checkout@v7
15
15
 
16
16
  - name: Setup Node.js
17
- uses: actions/setup-node@v4
17
+ uses: actions/setup-node@v6
18
18
  with:
19
- node-version: 24
19
+ node-version: '24.x'
20
20
  cache: 'npm'
21
21
 
22
22
  - name: Install dependencies
@@ -10,27 +10,27 @@ permissions:
10
10
  contents: read
11
11
 
12
12
  env:
13
- NODE_VERSION: 20
13
+ NODE_VERSION: 24
14
14
 
15
15
  jobs:
16
16
  publish:
17
17
  runs-on: ubuntu-latest
18
18
 
19
19
  steps:
20
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@v7
21
21
  with:
22
22
  fetch-depth: 0
23
23
 
24
24
  - name: 'Setup Node'
25
- uses: actions/setup-node@v4
25
+ uses: actions/setup-node@v6
26
26
  with:
27
- node-version: 20
27
+ node-version: '${{ env.NODE_VERSION }}.x'
28
28
  cache: 'npm'
29
29
  registry-url: 'https://registry.npmjs.org'
30
30
 
31
- # Ensure npm 11.5.1 or later is installed
31
+ # Keep npm on a major compatible with Node 24.
32
32
  - name: Update npm
33
- run: npm install -g npm@latest
33
+ run: npm install -g npm@^11
34
34
 
35
35
  - name: 'Install dependencies'
36
36
  run: npm ci
@@ -1,10 +1,22 @@
1
+ /**
2
+ * @deprecated unused
3
+ */
1
4
  export interface Action {
2
5
  id: string;
3
6
  type: string;
4
7
  state: 'started' | 'completed' | 'failed';
5
8
  message: string;
6
9
  }
10
+ /**
11
+ * @deprecated unused
12
+ */
7
13
  export type SendAction = (action: Action) => Promise<void>;
14
+ /**
15
+ * @deprecated unused
16
+ */
8
17
  export declare function makeActionWrapper(sendAction: SendAction): (message: string, type: string, action: () => Promise<unknown>) => Promise<void>;
18
+ /**
19
+ * @deprecated unused
20
+ */
9
21
  export declare function makeAction(sendAction: SendAction | undefined, type: string, message: string): (state?: Action["state"]) => Promise<void>;
10
22
  //# sourceMappingURL=action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/action.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;IACzC,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE1D,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,IAEhD,SAAS,MAAM,EACf,MAAM,MAAM,EACZ,QAAQ,MAAM,OAAO,CAAC,OAAO,CAAC,mBAiBrC;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAM1D,MAAM,CAAC,OAAO,CAAC,mBAQhD"}
1
+ {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/action.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;IACzC,OAAO,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE1D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,IAEhD,SAAS,MAAM,EACf,MAAM,MAAM,EACZ,QAAQ,MAAM,OAAO,CAAC,OAAO,CAAC,mBAiBrC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAM1D,MAAM,CAAC,OAAO,CAAC,mBAQhD"}
@@ -3,6 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.makeActionWrapper = makeActionWrapper;
5
5
  exports.makeAction = makeAction;
6
+ /**
7
+ * @deprecated unused
8
+ */
6
9
  function makeActionWrapper(sendAction) {
7
10
  return async function wrapAction(message, type, action) {
8
11
  const id = Math.random().toString();
@@ -21,6 +24,9 @@ function makeActionWrapper(sendAction) {
21
24
  });
22
25
  };
23
26
  }
27
+ /**
28
+ * @deprecated unused
29
+ */
24
30
  function makeAction(sendAction, type, message) {
25
31
  if (!sendAction) {
26
32
  // noop
@@ -1,6 +1,6 @@
1
1
  import { Logger, Message, Scheduler } from '../interfaces';
2
2
  import { Context } from './context';
3
- import { StepRegistry } from './step-registry';
3
+ import { StepRegistry } from '../step-registry';
4
4
  import { StepTracer } from './step-tracer';
5
5
  import { ApiCallTracer } from './api-call-tracer';
6
6
  import { ConversationalTracer } from './conversational-tracer';
@@ -25,6 +25,9 @@ import { ConversationalTracer } from './conversational-tracer';
25
25
  * ```
26
26
  */
27
27
  type DefaultContext = Record<string, any>;
28
+ /**
29
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
30
+ */
28
31
  export interface TestAgentFactoryProps<CTX extends DefaultContext = DefaultContext> {
29
32
  stepRegistry: StepRegistry;
30
33
  /**
@@ -46,6 +49,9 @@ export interface TestAgentFactoryProps<CTX extends DefaultContext = DefaultConte
46
49
  sendMessage: (message: string | Message) => Promise<void>;
47
50
  ctx: Context<CTX>;
48
51
  }
52
+ /**
53
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
54
+ */
49
55
  export interface TestTextAgent {
50
56
  start: () => Promise<unknown>;
51
57
  reactOnMessage: () => Promise<unknown>;
@@ -53,6 +59,9 @@ export interface TestTextAgent {
53
59
  isAssigned: () => Promise<boolean>;
54
60
  onFatalError: (error: Error) => Promise<unknown>;
55
61
  }
62
+ /**
63
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
64
+ */
56
65
  export interface TestVoiceAgent {
57
66
  streamResponse: () => Promise<unknown>;
58
67
  onCallEnd: () => Promise<unknown>;
@@ -60,8 +69,17 @@ export interface TestVoiceAgent {
60
69
  onFatalError: (error: Error) => Promise<unknown>;
61
70
  resetContext: () => Promise<unknown>;
62
71
  }
72
+ /**
73
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
74
+ */
63
75
  export type TestAgent = TestTextAgent | TestVoiceAgent;
76
+ /**
77
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
78
+ */
64
79
  export type TestAgentFactory<T extends DefaultContext = DefaultContext> = (props: TestAgentFactoryProps<T>) => Promise<TestAgent>;
80
+ /**
81
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
82
+ */
65
83
  export declare function createTestAgentFactory<T extends DefaultContext>(creator: TestAgentFactory<T>): TestAgentFactory<T>;
66
84
  export {};
67
85
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,KAAK,cAAc,GAAG,MAAM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,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7B,cAAc,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACtC,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACxC,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAClC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACnD;AACD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,cAAc,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACtC,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACjC,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAEhD,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CACvC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,cAAc,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI,CACtE,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAC9B,OAAO,CAAC,SAAS,CAAC,CAAA;AAEvB;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,cAAc,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,uBAE5F"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTestAgentFactory = createTestAgentFactory;
4
+ /**
5
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
6
+ */
4
7
  function createTestAgentFactory(creator) {
5
8
  return creator;
6
9
  }
@@ -6,6 +6,9 @@ import { Logger } from '../interfaces';
6
6
  * your domain "call"/"conversation" identifier. To get a per-call UI timeline, scope your tracer in the app
7
7
  * layer by injecting `conversationId` onto every `ApiCallTrace` before passing it to the SDK.
8
8
  */
9
+ /**
10
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
11
+ */
9
12
  export type ApiCallTrace = {
10
13
  /** Unique ID for the trace */
11
14
  traceId?: string;
@@ -29,10 +32,16 @@ export type ApiCallTrace = {
29
32
  /** Timestamp in milliseconds */
30
33
  createdAt: number;
31
34
  };
35
+ /**
36
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
37
+ */
32
38
  export interface ApiCallTracer {
33
39
  addApiCallTrace(trace: ApiCallTrace): void;
34
40
  flush(): Promise<void>;
35
41
  }
42
+ /**
43
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
44
+ */
36
45
  export declare function createStubApiCallTracer(logger: Logger): {
37
46
  addApiCallTrace(trace: ApiCallTrace): void;
38
47
  flush(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"api-call-tracer.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/api-call-tracer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,oCAAoC;IACpC,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IAEZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CA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M,WAAW,aAAa;IAC1B,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;IAC1C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM;2BAEvB,YAAY;;EAQ1C"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStubApiCallTracer = createStubApiCallTracer;
4
+ /**
5
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
6
+ */
4
7
  function createStubApiCallTracer(logger) {
5
8
  return {
6
9
  addApiCallTrace(trace) {
@@ -15,10 +15,16 @@ declare class Context<T extends Ctx> {
15
15
  setPromptContextMapper(promptMapper: (ctx: T) => object): void;
16
16
  getPromptContextMapper(): (ctx: T) => object;
17
17
  }
18
+ /**
19
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
20
+ */
18
21
  export declare function createContext<T extends Ctx>(context: T): Context<T>;
19
22
  type Public<T> = {
20
23
  [P in keyof T]: T[P];
21
24
  };
22
25
  type PublicContext<T extends Ctx> = Public<Context<T>>;
26
+ /**
27
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
28
+ */
23
29
  export type { PublicContext as Context };
24
30
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/context.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC9B,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAC1B;KACK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC,MAAM,CAAC,CAAC,GACV,KAAK,CAA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AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,CAAC,cAEtD;AAED,KAAK,MAAM,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAA;AAEzC,KAAK,aAAa,CAAC,CAAC,SAAS,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAEtD;;GAEG;AACH,YAAY,EAAE,aAAa,IAAI,OAAO,EAAE,CAAA"}
@@ -41,6 +41,9 @@ class Context {
41
41
  return this.#promptMapper;
42
42
  }
43
43
  }
44
+ /**
45
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
46
+ */
44
47
  function createContext(context) {
45
48
  return new Context(context);
46
49
  }
@@ -4,6 +4,9 @@ import { Logger } from '../interfaces';
4
4
  * message received/sent, streaming finished, handler invoked) that UIs may want to show on the same
5
5
  * per-conversation timeline.
6
6
  */
7
+ /**
8
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
9
+ */
7
10
  export type ConversationalTrace = {
8
11
  /** Unique ID for the trace */
9
12
  traceId?: string;
@@ -23,10 +26,16 @@ export type ConversationalTrace = {
23
26
  createdAt: number;
24
27
  error?: unknown;
25
28
  };
29
+ /**
30
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
31
+ */
26
32
  export interface ConversationalTracer {
27
33
  addConversationalTrace(trace: ConversationalTrace): void;
28
34
  flush(): Promise<void>;
29
35
  }
36
+ /**
37
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
38
+ */
30
39
  export declare function createStubConversationalTracer(logger: Logger): {
31
40
  addConversationalTrace(trace: ConversationalTrace): void;
32
41
  flush(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"conversational-tracer.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/conversational-tracer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eA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CAAA;IAEhB,wCAAwC;IACxC,SAAS,EACH,8BAA8B,GAC9B,8BAA8B,GAC9B,kBAAkB,GAClB,cAAc,GACd,oBAAoB,GACpB,kBAAkB,CAAA;IAExB,sDAAsD;IACtD,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAEjD,qDAAqD;IACrD,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAE5C,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAA;IAEf,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM;kCAEvB,mBAAmB;;EAKxD"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStubConversationalTracer = createStubConversationalTracer;
4
+ /**
5
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
6
+ */
4
7
  function createStubConversationalTracer(logger) {
5
8
  return {
6
9
  addConversationalTrace(trace) {
@@ -1,9 +1,33 @@
1
+ /**
2
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
3
+ */
1
4
  export * from './action';
5
+ /**
6
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
7
+ */
2
8
  export * from './context';
9
+ /**
10
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
11
+ */
3
12
  export * from './agent';
13
+ /**
14
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
15
+ */
4
16
  export * from './mock';
5
- export { PromptString, StepDef, StepRegistry } from './step-registry';
17
+ /**
18
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
19
+ */
20
+ export { PromptString, StepDef, StepRegistry } from '../step-registry';
21
+ /**
22
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
23
+ */
6
24
  export * from './step-tracer';
25
+ /**
26
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
27
+ */
7
28
  export * from './api-call-tracer';
29
+ /**
30
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
31
+ */
8
32
  export * from './conversational-tracer';
9
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACrE,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,UAAU,CAAA;AACxB;;GAEG;AACH,cAAc,WAAW,CAAA;AACzB;;GAEG;AACH,cAAc,SAAS,CAAA;AACvB;;GAEG;AACH,cAAc,QAAQ,CAAA;AACtB;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACtE;;GAEG;AACH,cAAc,eAAe,CAAA;AAC7B;;GAEG;AACH,cAAc,mBAAmB,CAAA;AACjC;;GAEG;AACH,cAAc,yBAAyB,CAAA"}
@@ -14,10 +14,31 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
19
+ */
17
20
  __exportStar(require("./action"), exports);
21
+ /**
22
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
23
+ */
18
24
  __exportStar(require("./context"), exports);
25
+ /**
26
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
27
+ */
19
28
  __exportStar(require("./agent"), exports);
29
+ /**
30
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
31
+ */
20
32
  __exportStar(require("./mock"), exports);
33
+ /**
34
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
35
+ */
21
36
  __exportStar(require("./step-tracer"), exports);
37
+ /**
38
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
39
+ */
22
40
  __exportStar(require("./api-call-tracer"), exports);
41
+ /**
42
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
43
+ */
23
44
  __exportStar(require("./conversational-tracer"), exports);
@@ -1,6 +1,9 @@
1
1
  import { Logger } from '../interfaces';
2
2
  type ConstructorType<T> = new (...args: any[]) => T;
3
3
  type InstanceType<T extends ConstructorType<any>> = T extends new (...args: any[]) => infer R ? R : never;
4
+ /**
5
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
6
+ */
4
7
  export declare function createMock<T extends ConstructorType<any>>(logger: Logger, constructor: T, overrides?: Partial<InstanceType<T>>): InstanceType<T>;
5
8
  export {};
6
9
  //# sourceMappingURL=mock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC,KAAK,eAAe,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AACnD,KAAK,YAAY,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,GACvF,CAAC,GACD,KAAK,CAAA;AAEX,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,EACrD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,CAAC,EACd,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GACrC,YAAY,CAAC,CAAC,CAAC,CAuBjB"}
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC,KAAK,eAAe,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AACnD,KAAK,YAAY,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,GACvF,CAAC,GACD,KAAK,CAAA;AAEX;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,EACrD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,CAAC,EACd,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GACrC,YAAY,CAAC,CAAC,CAAC,CAuBjB"}
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createMock = createMock;
4
4
  const node_util_1 = require("node:util");
5
+ /**
6
+ * @deprecated Use the analog from @recombine-ai/bosun-lib instead.
7
+ */
5
8
  function createMock(logger, constructor, overrides) {
6
9
  const mock = Object.create(constructor.prototype);
7
10
  const properties = Object.getOwnPropertyDescriptors(constructor.prototype);
@@ -1,12 +1,17 @@
1
1
  import { type ZodType } from 'zod';
2
- import { PromptFile } from '../prompt-fs';
3
2
  import { Logger } from '../interfaces';
3
+ /**
4
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
5
+ */
4
6
  export type LlmUsage = {
5
7
  promptTokens?: number;
6
8
  completionTokens?: number;
7
9
  totalTokens?: number;
8
10
  cachedPromptTokens?: number;
9
11
  };
12
+ /**
13
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
14
+ */
10
15
  export type StepTrace = {
11
16
  /** Unique ID for the trace */
12
17
  traceId?: string;
@@ -20,7 +25,7 @@ export type StepTrace = {
20
25
  name: string;
21
26
  renderedPrompt?: string;
22
27
  receivedContext?: Record<string, unknown> | unknown;
23
- receivedPrompt?: string | PromptFile | File;
28
+ receivedPrompt?: string;
24
29
  stringifiedConversation?: string;
25
30
  schema?: ZodType;
26
31
  model?: string;
@@ -31,6 +36,9 @@ export type StepTrace = {
31
36
  createdAt: number;
32
37
  error?: Error;
33
38
  };
39
+ /**
40
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
41
+ */
34
42
  export interface StepTracer {
35
43
  /**
36
44
  * Add a step trace
@@ -42,6 +50,9 @@ export interface StepTracer {
42
50
  */
43
51
  flush(): Promise<void>;
44
52
  }
53
+ /**
54
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
55
+ */
45
56
  export declare function createStubStepTracer(logger: Logger): {
46
57
  addStepTrace(trace: StepTrace): void;
47
58
  flush(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"step-tracer.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/step-tracer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,KAAK,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC,MAAM,MAAM,QAAQ,GAAG;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAA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AM,EAAE,MAAM;wBAEvB,SAAS;;EA2BpC"}
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStubStepTracer = createStubStepTracer;
4
4
  const zod_1 = require("zod");
5
+ /**
6
+ * @deprecated Use the analog from @recombine-ai/telescope instead.
7
+ */
5
8
  function createStubStepTracer(logger) {
6
9
  return {
7
10
  addStepTrace(trace) {
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/lib/engine.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,YAAY,EAGZ,OAAO,EAEP,WAAW,EAKd,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,MAAM,EAAE,GAAG,GAAE,YAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,CA+NxF;AAuDD,wBAAgB,kBAAkB,CAAC,eAAe,GAAE,OAAO,EAAO,GAAG,YAAY,CA2ChF;AAED,wBAAgB,cAAc,CAAC,GAAG,GAAG,OAAO,KAAK,WAAW,CAAC,GAAG,CAAC,CAEhE"}
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/lib/engine.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,YAAY,EAGZ,OAAO,EAEP,WAAW,EAKd,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAK5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,GAAG,SAAS,MAAM,EAAE,GAAG,GAAE,YAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAkQxF;AAuDD,wBAAgB,kBAAkB,CAAC,eAAe,GAAE,OAAO,EAAO,GAAG,YAAY,CA2ChF;AAED,wBAAgB,cAAc,CAAC,GAAG,GAAG,OAAO,KAAK,WAAW,CAAC,GAAG,CAAC,CAEhE"}
@@ -44,7 +44,8 @@ const crypto_1 = require("crypto");
44
44
  const nunjucks_1 = __importDefault(require("nunjucks"));
45
45
  const Zod = __importStar(require("zod"));
46
46
  const step_tracer_1 = require("./bosun/step-tracer");
47
- const step_registry_1 = require("./bosun/step-registry");
47
+ const step_registry_1 = require("./step-registry");
48
+ const STRUCTURED_RESPONSE_MAX_ATTEMPTS = 3;
48
49
  /**
49
50
  * Creates an AI Engine with the given configuration.
50
51
  *
@@ -146,30 +147,9 @@ function createAIEngine(cfg = {}) {
146
147
  });
147
148
  stepTrace.stringifiedConversation = stringifiedMessages;
148
149
  if ('schema' in step) {
149
- const stringResponse = await runLLM(step.model, prompt, stringifiedMessages, step.schema);
150
- stepTrace.response = stringResponse;
151
- let parsedJsonResponse = undefined;
152
- try {
153
- parsedJsonResponse = JSON.parse(stringResponse);
154
- response = step.schema.parse(parsedJsonResponse);
155
- }
156
- catch (err) {
157
- if (err instanceof SyntaxError) {
158
- logger.error(`AI-generated response is not valid JSON in step ${step.name}`, {
159
- response: stringResponse,
160
- schema: Zod.toJSONSchema(step.schema),
161
- });
162
- throw new Error(`Response is not valid JSON for step ${step.name}`);
163
- }
164
- else {
165
- logger.error(`AI-generated response in step ${step.name} violates schema`, {
166
- response: stringResponse,
167
- schema: Zod.toJSONSchema(step.schema),
168
- errors: step.schema.safeParse(parsedJsonResponse).error,
169
- });
170
- throw new Error(`Response validation failed for step ${step.name}`);
171
- }
172
- }
150
+ const { parsedResponse, rawResponse } = await runStructuredStepWithRetries(step.model, prompt, stringifiedMessages, step.name, step.schema);
151
+ response = parsedResponse;
152
+ stepTrace.response = rawResponse;
173
153
  }
174
154
  else {
175
155
  response = await runLLM(step.model, prompt, stringifiedMessages, undefined);
@@ -239,6 +219,49 @@ function createAIEngine(cfg = {}) {
239
219
  });
240
220
  return nunjucks_1.default.renderString(prompt, context ?? {});
241
221
  }
222
+ async function runStructuredStepWithRetries(model, prompt, stringifiedMessages, stepName, schema) {
223
+ for (let attempt = 1; attempt <= STRUCTURED_RESPONSE_MAX_ATTEMPTS; attempt++) {
224
+ const stringResponse = await runLLM(model, prompt, stringifiedMessages, schema);
225
+ let parsedJsonResponse = undefined;
226
+ try {
227
+ parsedJsonResponse = JSON.parse(stringResponse);
228
+ }
229
+ catch {
230
+ const hasAttemptsLeft = attempt < STRUCTURED_RESPONSE_MAX_ATTEMPTS;
231
+ if (hasAttemptsLeft) {
232
+ logger.debug(`AI-generated response is not valid JSON in step ${stepName}, retry ${attempt}/${STRUCTURED_RESPONSE_MAX_ATTEMPTS}`);
233
+ continue;
234
+ }
235
+ logger.error(`AI-generated response is not valid JSON in step ${stepName}`, {
236
+ response: stringResponse,
237
+ schema: Zod.toJSONSchema(schema),
238
+ });
239
+ throw new Error(`Response is not valid JSON for step ${stepName}`);
240
+ }
241
+ const parsedResponse = schema.safeParse(parsedJsonResponse);
242
+ if (parsedResponse.success) {
243
+ return {
244
+ parsedResponse: parsedResponse.data,
245
+ rawResponse: stringResponse,
246
+ };
247
+ }
248
+ const hasAttemptsLeft = attempt < STRUCTURED_RESPONSE_MAX_ATTEMPTS;
249
+ if (hasAttemptsLeft) {
250
+ logger.debug(`AI-generated response in step ${stepName} violates schema, retry ${attempt}/${STRUCTURED_RESPONSE_MAX_ATTEMPTS}`, {
251
+ response: stringResponse,
252
+ errors: parsedResponse.error,
253
+ });
254
+ continue;
255
+ }
256
+ logger.error(`AI-generated response in step ${stepName} violates schema`, {
257
+ response: stringResponse,
258
+ schema: Zod.toJSONSchema(schema),
259
+ errors: parsedResponse.error,
260
+ });
261
+ throw new Error(`Response validation failed for step ${stepName}`);
262
+ }
263
+ throw new Error(`Response validation failed for step ${stepName}`);
264
+ }
242
265
  return {
243
266
  createWorkflow,
244
267
  createConversation,
@@ -1,6 +1,6 @@
1
1
  import { type ZodType } from 'zod';
2
- import { PromptFile } from '../prompt-fs';
3
- import { Logger } from '../interfaces';
2
+ import { PromptFile } from './prompt-fs';
3
+ import { Logger } from './interfaces';
4
4
  export interface PromptString {
5
5
  type: 'string';
6
6
  content: () => Promise<string>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-registry.d.ts","sourceRoot":"","sources":["../../src/lib/step-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAErC,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,MAAM,CAAA;IACxD,MAAM,EAAE,UAAU,GAAG,YAAY,CAAA;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAM/D;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,6BAQpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/lib/stream/engine.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,cAAc,EAEd,qBAAqB,EAGxB,MAAM,eAAe,CAAA;AAItB,wBAAgB,oBAAoB,CAAC,GAAG,SAAS,EAAE,EAC/C,GAAG,EAAE,qBAAqB,GAC3B,cAAc,CAAC,GAAG,CAAC,CAgJrB"}
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/lib/stream/engine.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,cAAc,EAEd,qBAAqB,EAGxB,MAAM,eAAe,CAAA;AAItB,wBAAgB,oBAAoB,CAAC,GAAG,SAAS,EAAE,EAC/C,GAAG,EAAE,qBAAqB,GAC3B,cAAc,CAAC,GAAG,CAAC,CAwIrB"}
@@ -7,7 +7,7 @@ exports.createAIStreamEngine = createAIStreamEngine;
7
7
  // cspell:words TTFT lstrip
8
8
  const nunjucks_1 = __importDefault(require("nunjucks"));
9
9
  const bosun_1 = require("../bosun");
10
- const step_registry_1 = require("../bosun/step-registry");
10
+ const step_registry_1 = require("../step-registry");
11
11
  const token_transformers_1 = require("./token-transformers");
12
12
  function createAIStreamEngine(cfg) {
13
13
  function createWorkflow({ name, prompt, model, tokenTransformers = [token_transformers_1.agentFilter], onError, }) {
@@ -25,6 +25,14 @@ function createAIStreamEngine(cfg) {
25
25
  const startTime = performance.now();
26
26
  const transcript = createTranscript(logger, messages);
27
27
  const initiatedTransformers = tokenTransformers.map((init) => init());
28
+ const template = typeof prompt === 'string' ? prompt : await prompt.content();
29
+ nunjucks_1.default.configure({
30
+ autoescape: true,
31
+ trimBlocks: true,
32
+ lstripBlocks: true,
33
+ });
34
+ const renderedPrompt = nunjucks_1.default.renderString(template, ctx || {});
35
+ const stringifiedConversation = transcript.toString();
28
36
  // Create step trace for telescope
29
37
  const mainStepTrace = {
30
38
  workflowId: name,
@@ -33,11 +41,11 @@ function createAIStreamEngine(cfg) {
33
41
  model: JSON.stringify(model.getOptions()),
34
42
  createdAt: Date.now(),
35
43
  response: '',
44
+ receivedContext: ctx,
45
+ receivedPrompt: template,
46
+ renderedPrompt: renderedPrompt,
47
+ stringifiedConversation: stringifiedConversation,
36
48
  };
37
- const renderedPrompt = await renderPrompt(prompt, ctx);
38
- const stringifiedConversation = transcript.toString();
39
- mainStepTrace.renderedPrompt = renderedPrompt;
40
- mainStepTrace.stringifiedConversation = stringifiedConversation;
41
49
  let mainStepStream;
42
50
  try {
43
51
  mainStepStream = await model.generateStream(renderedPrompt, stringifiedConversation);
@@ -109,20 +117,6 @@ function createAIStreamEngine(cfg) {
109
117
  },
110
118
  });
111
119
  }
112
- async function renderPrompt(prompt, context) {
113
- logger.debug('Streaming AI, CONTEXT:', context);
114
- const template = typeof prompt === 'string' ? prompt : await prompt.content();
115
- if (context) {
116
- logger.debug('Loaded context: ', context);
117
- nunjucks_1.default.configure({
118
- autoescape: true,
119
- trimBlocks: true,
120
- lstripBlocks: true,
121
- });
122
- return nunjucks_1.default.renderString(template, context);
123
- }
124
- return template;
125
- }
126
120
  return {
127
121
  run,
128
122
  };
package/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.0 → 1.1.0
4
+
5
+ - Added retries on broken JSON in structured responses.
6
+
3
7
  ### 0.11.4 → 1.0.0
4
8
 
5
9
  - **Breaking:** `model` field on `LLMStep` is now required and must be an `LlmAdapter` (string model names removed)
@@ -13,6 +17,7 @@
13
17
  - Added `createOpenAIStreamAdapter` to `llm-adapters`
14
18
  - Added `createMockAdapter` to `llm-adapters` for testing without OpenAI keys
15
19
  - Added streaming engine (`createAIStreamEngine`) with filter support
20
+ - Deprecated everything related to Bosun and Telescope in favor of `@recombine/bosun-lib` and `@recombine-ai/telescope`
16
21
 
17
22
  ### 0.11.3 → 0.11.4 (unstable)
18
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recombine-ai/engine",
3
- "version": "1.0.0-beta-4",
3
+ "version": "1.1.0",
4
4
  "description": "Recombine AI engine for creating conversational AI agents",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/recombine-ai/engine.git"
@@ -1 +0,0 @@
1
- {"version":3,"file":"step-registry.d.ts","sourceRoot":"","sources":["../../../src/lib/bosun/step-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,oBAAoB,GAAG,kBAAkB,GAAG,MAAM,CAAA;IACxD,MAAM,EAAE,UAAU,GAAG,YAAY,CAAA;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAA;CAC9B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAM/D;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,6BAQpD"}