@abtnode/core 1.16.53-beta-20251009-113612-7a16b6a0 → 1.16.53-beta-20251011-054719-4ed2f6b7

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.
@@ -443,8 +443,8 @@ class DiskBlockletManager extends BaseBlockletManager {
443
443
  return;
444
444
  }
445
445
  ensureBlockletRunning.initialize({
446
- restart: async (params) => {
447
- await this.restart(params);
446
+ start: async (params) => {
447
+ await this.start(params);
448
448
  },
449
449
  createAuditLog: (params) => this.createAuditLog(params),
450
450
  notification: (did, title, description, severity) => {
@@ -3540,10 +3540,15 @@ class DiskBlockletManager extends BaseBlockletManager {
3540
3540
 
3541
3541
  await this.configSynchronizer.throttledSyncAppConfig(nextBlocklet);
3542
3542
  const componentsInfo = getComponentsInternalInfo(nextBlocklet);
3543
- this.emit(BlockletInternalEvents.componentStarted, {
3543
+
3544
+ this.emit(BlockletInternalEvents.componentUpdated, {
3544
3545
  appDid: blocklet.appDid,
3545
3546
  components: componentsInfo,
3546
3547
  });
3548
+ this.emit(BlockletInternalEvents.componentStarted, {
3549
+ appDid: blocklet.appDid,
3550
+ components: (componentDids || []).map((x) => ({ did: x })),
3551
+ });
3547
3552
 
3548
3553
  this.emit(BlockletEvents.statusChange, nextBlocklet);
3549
3554
  this.emit(BlockletEvents.started, { ...nextBlocklet, componentDids });
@@ -92,12 +92,12 @@ class EnsureBlockletRunning {
92
92
  this.states = states;
93
93
  }
94
94
 
95
- initialize = ({ restart, stop, notification, checkSystemHighLoad, createAuditLog }) => {
95
+ initialize = ({ start, stop, notification, checkSystemHighLoad, createAuditLog }) => {
96
96
  if (this.initialized) {
97
97
  return;
98
98
  }
99
99
  this.initialized = true;
100
- this.restart = restart;
100
+ this.start = start;
101
101
  this.stop = stop;
102
102
  this.notification = notification;
103
103
  this.createAuditLog = createAuditLog;
@@ -308,7 +308,7 @@ class EnsureBlockletRunning {
308
308
 
309
309
  try {
310
310
  logger.info('restart blocklet:', did, componentDids);
311
- await this.restart({
311
+ await this.start({
312
312
  did,
313
313
  componentDids,
314
314
  checkHealthImmediately: true,
@@ -51,7 +51,7 @@ const verifyAigneHub = async (config, blocklet) => {
51
51
  const modelConfig = {
52
52
  apiKey: decryptValue(config.key, did),
53
53
  model: !config.model || config.model === 'auto' ? undefined : config.model,
54
- url: baseUrl,
54
+ baseURL: baseUrl,
55
55
  clientOptions: {
56
56
  clientId: did,
57
57
  },
@@ -1688,7 +1688,8 @@ const _getBlocklet = async ({
1688
1688
  throw new Error('Blocklet did does not exist');
1689
1689
  }
1690
1690
  if (!isValidDid(did)) {
1691
- throw new Error(`Blocklet did is invalid: ${did}`);
1691
+ logger.error('Blocklet did is invalid', { did });
1692
+ throw new Error('Blocklet did is invalid');
1692
1693
  }
1693
1694
 
1694
1695
  if (!dataDirs) {
@@ -1702,7 +1703,8 @@ const _getBlocklet = async ({
1702
1703
  const blocklet = await states.blocklet.getBlocklet(did);
1703
1704
  if (!blocklet) {
1704
1705
  if (throwOnNotExist || ensureIntegrity) {
1705
- throw new Error(`can not find blocklet in database by did ${did}`);
1706
+ logger.error('can not find blocklet in database by did', { did });
1707
+ throw new Error('can not find blocklet in database by did');
1706
1708
  }
1707
1709
  return null;
1708
1710
  }
@@ -1,5 +1,20 @@
1
- // 是否是自定义 docker 镜像, 并且是否挂载了数据卷
1
+ // search-kit 应该忽略蓝绿部署, 不然重启过程会失败
2
+ const SINGLE_INSTANCE_COMPONENT_DIDS = new Set(['z8iZorY6mvb5tZrxXTqhBmwu89xjEEazrgT3t']);
3
+
4
+ /**
5
+ * 检查组件是否只能以单实例模式运行
6
+ * @param {Object} meta - 组件元数据
7
+ * @param {string} meta.did - 组件DID
8
+ * @param {Object} meta.docker - Docker配置
9
+ * @returns {boolean} 是否只能单实例运行
10
+ */
2
11
  function isDockerOnlySingleInstance(meta = {}) {
12
+ if (!meta.did) {
13
+ return true;
14
+ }
15
+ if (SINGLE_INSTANCE_COMPONENT_DIDS.has(meta.did)) {
16
+ return true;
17
+ }
3
18
  if (!meta.docker) {
4
19
  return false;
5
20
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.53-beta-20251009-113612-7a16b6a0",
6
+ "version": "1.16.53-beta-20251011-054719-4ed2f6b7",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -21,21 +21,21 @@
21
21
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@abtnode/analytics": "1.16.53-beta-20251009-113612-7a16b6a0",
25
- "@abtnode/auth": "1.16.53-beta-20251009-113612-7a16b6a0",
26
- "@abtnode/certificate-manager": "1.16.53-beta-20251009-113612-7a16b6a0",
27
- "@abtnode/constant": "1.16.53-beta-20251009-113612-7a16b6a0",
28
- "@abtnode/cron": "1.16.53-beta-20251009-113612-7a16b6a0",
29
- "@abtnode/db-cache": "1.16.53-beta-20251009-113612-7a16b6a0",
30
- "@abtnode/docker-utils": "1.16.53-beta-20251009-113612-7a16b6a0",
31
- "@abtnode/logger": "1.16.53-beta-20251009-113612-7a16b6a0",
32
- "@abtnode/models": "1.16.53-beta-20251009-113612-7a16b6a0",
33
- "@abtnode/queue": "1.16.53-beta-20251009-113612-7a16b6a0",
34
- "@abtnode/rbac": "1.16.53-beta-20251009-113612-7a16b6a0",
35
- "@abtnode/router-provider": "1.16.53-beta-20251009-113612-7a16b6a0",
36
- "@abtnode/static-server": "1.16.53-beta-20251009-113612-7a16b6a0",
37
- "@abtnode/timemachine": "1.16.53-beta-20251009-113612-7a16b6a0",
38
- "@abtnode/util": "1.16.53-beta-20251009-113612-7a16b6a0",
24
+ "@abtnode/analytics": "1.16.53-beta-20251011-054719-4ed2f6b7",
25
+ "@abtnode/auth": "1.16.53-beta-20251011-054719-4ed2f6b7",
26
+ "@abtnode/certificate-manager": "1.16.53-beta-20251011-054719-4ed2f6b7",
27
+ "@abtnode/constant": "1.16.53-beta-20251011-054719-4ed2f6b7",
28
+ "@abtnode/cron": "1.16.53-beta-20251011-054719-4ed2f6b7",
29
+ "@abtnode/db-cache": "1.16.53-beta-20251011-054719-4ed2f6b7",
30
+ "@abtnode/docker-utils": "1.16.53-beta-20251011-054719-4ed2f6b7",
31
+ "@abtnode/logger": "1.16.53-beta-20251011-054719-4ed2f6b7",
32
+ "@abtnode/models": "1.16.53-beta-20251011-054719-4ed2f6b7",
33
+ "@abtnode/queue": "1.16.53-beta-20251011-054719-4ed2f6b7",
34
+ "@abtnode/rbac": "1.16.53-beta-20251011-054719-4ed2f6b7",
35
+ "@abtnode/router-provider": "1.16.53-beta-20251011-054719-4ed2f6b7",
36
+ "@abtnode/static-server": "1.16.53-beta-20251011-054719-4ed2f6b7",
37
+ "@abtnode/timemachine": "1.16.53-beta-20251011-054719-4ed2f6b7",
38
+ "@abtnode/util": "1.16.53-beta-20251011-054719-4ed2f6b7",
39
39
  "@aigne/aigne-hub": "^0.10.0",
40
40
  "@arcblock/did": "1.25.6",
41
41
  "@arcblock/did-connect-js": "1.25.6",
@@ -47,15 +47,15 @@
47
47
  "@arcblock/pm2-events": "^0.0.5",
48
48
  "@arcblock/validator": "1.25.6",
49
49
  "@arcblock/vc": "1.25.6",
50
- "@blocklet/constant": "1.16.53-beta-20251009-113612-7a16b6a0",
50
+ "@blocklet/constant": "1.16.53-beta-20251011-054719-4ed2f6b7",
51
51
  "@blocklet/did-space-js": "^1.1.29",
52
- "@blocklet/env": "1.16.53-beta-20251009-113612-7a16b6a0",
52
+ "@blocklet/env": "1.16.53-beta-20251011-054719-4ed2f6b7",
53
53
  "@blocklet/error": "^0.2.5",
54
- "@blocklet/meta": "1.16.53-beta-20251009-113612-7a16b6a0",
55
- "@blocklet/resolver": "1.16.53-beta-20251009-113612-7a16b6a0",
56
- "@blocklet/sdk": "1.16.53-beta-20251009-113612-7a16b6a0",
57
- "@blocklet/server-js": "1.16.53-beta-20251009-113612-7a16b6a0",
58
- "@blocklet/store": "1.16.53-beta-20251009-113612-7a16b6a0",
54
+ "@blocklet/meta": "1.16.53-beta-20251011-054719-4ed2f6b7",
55
+ "@blocklet/resolver": "1.16.53-beta-20251011-054719-4ed2f6b7",
56
+ "@blocklet/sdk": "1.16.53-beta-20251011-054719-4ed2f6b7",
57
+ "@blocklet/server-js": "1.16.53-beta-20251011-054719-4ed2f6b7",
58
+ "@blocklet/store": "1.16.53-beta-20251011-054719-4ed2f6b7",
59
59
  "@blocklet/theme": "^3.1.45",
60
60
  "@fidm/x509": "^1.2.1",
61
61
  "@ocap/mcrypto": "1.25.6",
@@ -120,5 +120,5 @@
120
120
  "jest": "^29.7.0",
121
121
  "unzipper": "^0.10.11"
122
122
  },
123
- "gitHead": "cb28aceba798cdfe4073bb6df9514c09aa3587ba"
123
+ "gitHead": "26bebabf3b6e72db61ec6b48e679c37b3d5088fe"
124
124
  }