@open1s/ezbos 1.1.1 → 1.1.2

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 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ import { describe, it } from 'node:test';
2
+ import { BrainOS } from '../index.js';
3
+ describe('AgentBuilder.stop()', () => {
4
+ it('should call stop on inner agent without error', async () => {
5
+ const brain = new BrainOS();
6
+ await brain.start();
7
+ const builder = brain.agent('test-stop');
8
+ const agent = await builder.start();
9
+ builder.stop();
10
+ await agent.close();
11
+ await brain.stop();
12
+ });
13
+ it('should handle stop when no inner agent', async () => {
14
+ const brain = new BrainOS();
15
+ await brain.start();
16
+ const builder = brain.agent('test-stop-empty');
17
+ builder.stop();
18
+ builder.stop();
19
+ await brain.stop();
20
+ });
21
+ it('should stop after start and allow close', async () => {
22
+ const brain = new BrainOS();
23
+ await brain.start();
24
+ const builder = brain.agent('test-stop-stream');
25
+ const agent = await builder.start();
26
+ builder.stop();
27
+ await agent.close();
28
+ await brain.stop();
29
+ });
30
+ });
package/dist/agent.d.ts CHANGED
@@ -74,5 +74,6 @@ export declare class Agent {
74
74
  listMcpTools(): Promise<any[]>;
75
75
  get metrics(): jsbos.PerfSnapshot;
76
76
  resetMetrics(): void;
77
+ stop(): Promise<void>;
77
78
  close(): Promise<void>;
78
79
  }
package/dist/agent.js CHANGED
@@ -310,7 +310,11 @@ export class Agent {
310
310
  resetMetrics() {
311
311
  this._inner.resetPerfMetrics();
312
312
  }
313
+ async stop() {
314
+ this._inner.stop();
315
+ }
313
316
  async close() {
317
+ this._inner.stop();
314
318
  this._inner.close();
315
319
  }
316
320
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open1s/ezbos",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Simple BrainOS - Easy wrapper for @open1s/jsbos",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",