@celljs/ai-core 4.5.1 → 4.6.1

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.
@@ -1,7 +1,30 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const bun_test_1 = require("bun:test");
4
- (0, bun_test_1.describe)('ai-core package', () => {
5
- (0, bun_test_1.it)('support ai-core coverage statistics', () => { });
7
+ const core_1 = require("@celljs/core");
8
+ const assembly_test_util_1 = require("@celljs/core/lib/common/test/assembly-test-util");
9
+ const static_module_1 = __importDefault(require("@celljs/core/lib/common/static-module"));
10
+ const static_module_2 = __importDefault(require("@celljs/core/lib/node/static-module"));
11
+ const module_1 = __importDefault(require("@celljs/http/lib/common/module"));
12
+ const module_2 = __importDefault(require("./common/module"));
13
+ const chat_protocol_1 = require("./common/chat/model/chat-protocol");
14
+ core_1.currentThis.cellProps = {};
15
+ (0, bun_test_1.describe)('@celljs/ai-core', () => {
16
+ (0, bun_test_1.it)('its DI module loads after those of its dependencies and every binding resolves', () => {
17
+ const { changed, errors } = assembly_test_util_1.AssemblyTestUtil.check([static_module_1.default, static_module_2.default, module_1.default], module_2.default);
18
+ // Only the ChatModel a provider package (@celljs/ai-pi) binds is missing.
19
+ (0, bun_test_1.expect)(errors).toHaveLength(1);
20
+ (0, bun_test_1.expect)(errors[0]).toContain('No binding for Symbol(ChatModel), needed by ProxyChatModel');
21
+ (0, bun_test_1.expect)(changed).toBeGreaterThan(0);
22
+ });
23
+ (0, bun_test_1.it)('with a ChatModel bound, every binding resolves', () => {
24
+ const provider = new core_1.ContainerModule(bind => {
25
+ bind(chat_protocol_1.ChatModel).toConstantValue({});
26
+ });
27
+ (0, bun_test_1.expect)(assembly_test_util_1.AssemblyTestUtil.check([static_module_1.default, static_module_2.default, module_1.default, provider], module_2.default).errors).toEqual([]);
28
+ });
6
29
  });
7
30
  //# sourceMappingURL=package.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":";;AAAA,uCAAwC;AACxC,IAAA,mBAAQ,EAAC,iBAAiB,EAAE,GAAG,EAAE;IAE7B,IAAA,aAAE,EAAC,qCAAqC,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"package.spec.js","sourceRoot":"","sources":["../src/package.spec.ts"],"names":[],"mappings":";;;;;AAAA,uCAAgD;AAChD,uCAA4D;AAC5D,wFAAmF;AACnF,0FAAuD;AACvD,wFAAqD;AACrD,4EAAgD;AAChD,6DAAmC;AACnC,qEAA8D;AAE9D,kBAAW,CAAC,SAAS,GAAG,EAAE,CAAC;AAE3B,IAAA,mBAAQ,EAAC,iBAAiB,EAAE,GAAG,EAAE;IAC7B,IAAA,aAAE,EAAC,gFAAgF,EAAE,GAAG,EAAE;QACtF,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,qCAAgB,CAAC,KAAK,CAAC,CAAC,uBAAE,EAAE,uBAAE,EAAE,gBAAE,CAAC,EAAE,gBAAI,CAAC,CAAC;QACvE,0EAA0E;QAC1E,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,4DAA4D,CAAC,CAAC;QAC1F,IAAA,iBAAM,EAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAE,EAAC,gDAAgD,EAAE,GAAG,EAAE;QACtD,MAAM,QAAQ,GAAG,IAAI,sBAAe,CAAC,IAAI,CAAC,EAAE;YACxC,IAAI,CAAC,yBAAS,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,IAAA,iBAAM,EAAC,qCAAgB,CAAC,KAAK,CAAC,CAAC,uBAAE,EAAE,uBAAE,EAAE,gBAAE,EAAE,QAAQ,CAAC,EAAE,gBAAI,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ai-core",
3
- "version": "4.5.1",
3
+ "version": "4.6.1",
4
4
  "description": "Core domain for AI programming",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -31,8 +31,8 @@
31
31
  "watch": "tsc -b -w --preserveWatchOutput"
32
32
  },
33
33
  "dependencies": {
34
- "@celljs/core": "4.5.1",
35
- "@celljs/http": "4.5.1",
34
+ "@celljs/core": "4.6.1",
35
+ "@celljs/http": "4.6.1",
36
36
  "rxjs": "^6.6.0"
37
37
  },
38
38
  "publishConfig": {
@@ -1,5 +1,27 @@
1
- import { describe, it } from 'bun:test';
2
- describe('ai-core package', () => {
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { ContainerModule, currentThis } from '@celljs/core';
3
+ import { AssemblyTestUtil } from '@celljs/core/lib/common/test/assembly-test-util';
4
+ import m0 from '@celljs/core/lib/common/static-module';
5
+ import m1 from '@celljs/core/lib/node/static-module';
6
+ import m2 from '@celljs/http/lib/common/module';
7
+ import own0 from './common/module';
8
+ import { ChatModel } from './common/chat/model/chat-protocol';
3
9
 
4
- it('support ai-core coverage statistics', () => {});
10
+ currentThis.cellProps = {};
11
+
12
+ describe('@celljs/ai-core', () => {
13
+ it('its DI module loads after those of its dependencies and every binding resolves', () => {
14
+ const { changed, errors } = AssemblyTestUtil.check([m0, m1, m2], own0);
15
+ // Only the ChatModel a provider package (@celljs/ai-pi) binds is missing.
16
+ expect(errors).toHaveLength(1);
17
+ expect(errors[0]).toContain('No binding for Symbol(ChatModel), needed by ProxyChatModel');
18
+ expect(changed).toBeGreaterThan(0);
19
+ });
20
+
21
+ it('with a ChatModel bound, every binding resolves', () => {
22
+ const provider = new ContainerModule(bind => {
23
+ bind(ChatModel).toConstantValue({});
24
+ });
25
+ expect(AssemblyTestUtil.check([m0, m1, m2, provider], own0).errors).toEqual([]);
26
+ });
5
27
  });