@nextclaw/kernel 0.6.8 → 0.6.9

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,2 +1,2 @@
1
- import { a as getUnsignedUpdateManifest, c as UpdateBlockReason, d as UpdateSnapshot, f as UpdateStatus, i as UpdateManifestReader, l as UpdatePreferences, n as UpdateHostKind, o as serializeUnsignedUpdateManifest, r as UpdateManifest, s as InstallationKind, t as UnsignedUpdateManifest, u as UpdateProgress } from "../update-manifest.types-DLWDvs_v.js";
2
- export { InstallationKind, UnsignedUpdateManifest, UpdateBlockReason, UpdateHostKind, UpdateManifest, UpdateManifestReader, UpdatePreferences, UpdateProgress, UpdateSnapshot, UpdateStatus, getUnsignedUpdateManifest, serializeUnsignedUpdateManifest };
1
+ import { a as getUnsignedUpdateManifest, c as UpdateBlockReason, d as UpdateStatus, i as UpdateManifestReader, l as UpdateProgress, n as UpdateHostKind, o as serializeUnsignedUpdateManifest, r as UpdateManifest, s as InstallationKind, t as UnsignedUpdateManifest, u as UpdateSnapshot } from "../update-manifest.types-CQpbURTE.js";
2
+ export { InstallationKind, UnsignedUpdateManifest, UpdateBlockReason, UpdateHostKind, UpdateManifest, UpdateManifestReader, UpdateProgress, UpdateSnapshot, UpdateStatus, getUnsignedUpdateManifest, serializeUnsignedUpdateManifest };
@@ -1,4 +1,4 @@
1
- import { InstallationKind, UpdateBlockReason, UpdatePreferences, UpdateProgress, UpdateSnapshot, UpdateStatus } from "@nextclaw/shared";
1
+ import { InstallationKind, UpdateBlockReason, UpdateProgress, UpdateSnapshot, UpdateStatus } from "@nextclaw/shared";
2
2
 
3
3
  //#region src/types/update-manifest.types.d.ts
4
4
  type UpdateHostKind = "desktop-bundle" | "npm-runtime-bundle";
@@ -24,5 +24,5 @@ declare class UpdateManifestReader {
24
24
  private readHostKind;
25
25
  }
26
26
  //#endregion
27
- export { getUnsignedUpdateManifest as a, UpdateBlockReason as c, UpdateSnapshot as d, UpdateStatus as f, UpdateManifestReader as i, UpdatePreferences as l, UpdateHostKind as n, serializeUnsignedUpdateManifest as o, UpdateManifest as r, InstallationKind as s, UnsignedUpdateManifest as t, UpdateProgress as u };
28
- //# sourceMappingURL=update-manifest.types-DLWDvs_v.d.ts.map
27
+ export { getUnsignedUpdateManifest as a, UpdateBlockReason as c, UpdateStatus as d, UpdateManifestReader as i, UpdateProgress as l, UpdateHostKind as n, serializeUnsignedUpdateManifest as o, UpdateManifest as r, InstallationKind as s, UnsignedUpdateManifest as t, UpdateSnapshot as u };
28
+ //# sourceMappingURL=update-manifest.types-CQpbURTE.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-manifest.types-DLWDvs_v.d.ts","names":[],"sources":["../src/types/update-manifest.types.ts"],"mappings":";;;KAAY,cAAA;AAAA,KAEA,sBAAA;EACV,OAAA;EACA,QAAA;EACA,IAAA;EACA,QAAA,GAAW,cAAA;EACX,aAAA;EACA,sBAAA;EACA,SAAA;EACA,YAAA;EACA,eAAA;EACA,eAAA;AAAA;AAAA,KAGU,cAAA,GAAiB,sBAAA;EAC3B,iBAAA;AAAA;AAAA,iBAWc,yBAAA,CAA0B,QAAA,EAAU,cAAA,GAAiB,sBAAA,GAAyB,sBAAA;AAAA,iBAe9E,+BAAA,CAAgC,QAAA,EAAU,cAAA,GAAiB,sBAAA;AAAA,cAI9D,oBAAA;EACX,KAAA,GAAS,KAAA,WAAgB,OAAA,cAA8B,cAAA;EAAA,QA0B/C,YAAA;AAAA"}
1
+ {"version":3,"file":"update-manifest.types-CQpbURTE.d.ts","names":[],"sources":["../src/types/update-manifest.types.ts"],"mappings":";;;KAAY,cAAA;AAAA,KAEA,sBAAA;EACV,OAAA;EACA,QAAA;EACA,IAAA;EACA,QAAA,GAAW,cAAA;EACX,aAAA;EACA,sBAAA;EACA,SAAA;EACA,YAAA;EACA,eAAA;EACA,eAAA;AAAA;AAAA,KAGU,cAAA,GAAiB,sBAAA;EAC3B,iBAAA;AAAA;AAAA,iBAWc,yBAAA,CAA0B,QAAA,EAAU,cAAA,GAAiB,sBAAA,GAAyB,sBAAA;AAAA,iBAe9E,+BAAA,CAAgC,QAAA,EAAU,cAAA,GAAiB,sBAAA;AAAA,cAI9D,oBAAA;EACX,KAAA,GAAS,KAAA,WAAgB,OAAA,cAA8B,cAAA;EAAA,QA0B/C,YAAA;AAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/utils/automatic-update-check.utils.d.ts
2
+ declare const AUTOMATIC_UPDATE_CHECK_INTERVAL_MS: number;
3
+ type AutomaticUpdateCheckIntervalOptions = {
4
+ verificationMode: boolean;
5
+ verificationIntervalMs: string | undefined;
6
+ };
7
+ declare function resolveAutomaticUpdateCheckIntervalMs(options: AutomaticUpdateCheckIntervalOptions): number;
8
+ declare function getAutomaticUpdateCheckDelay(lastCheckedAt: string | null, now: number, intervalMs?: number): number;
9
+ //#endregion
10
+ export { AUTOMATIC_UPDATE_CHECK_INTERVAL_MS, getAutomaticUpdateCheckDelay, resolveAutomaticUpdateCheckIntervalMs };
11
+ //# sourceMappingURL=automatic-update-check.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automatic-update-check.utils.d.ts","names":[],"sources":["../../src/utils/automatic-update-check.utils.ts"],"mappings":";cAAa,kCAAA;AAAA,KAIR,mCAAA;EACH,gBAAA;EACA,sBAAA;AAAA;AAAA,iBAGc,qCAAA,CACd,OAAA,EAAS,mCAAA;AAAA,iBAeK,4BAAA,CACd,aAAA,iBACA,GAAA,UACA,UAAA"}
@@ -0,0 +1,18 @@
1
+ //#region src/utils/automatic-update-check.utils.ts
2
+ const AUTOMATIC_UPDATE_CHECK_INTERVAL_MS = 7200 * 1e3;
3
+ const MINIMUM_VERIFICATION_INTERVAL_MS = 100;
4
+ function resolveAutomaticUpdateCheckIntervalMs(options) {
5
+ if (!options.verificationMode) return AUTOMATIC_UPDATE_CHECK_INTERVAL_MS;
6
+ const intervalMs = Number(options.verificationIntervalMs);
7
+ if (!Number.isInteger(intervalMs) || intervalMs < MINIMUM_VERIFICATION_INTERVAL_MS) throw new Error(`NEXTCLAW_UPDATE_VERIFICATION_INTERVAL_MS must be an integer of at least ${MINIMUM_VERIFICATION_INTERVAL_MS}.`);
8
+ return intervalMs;
9
+ }
10
+ function getAutomaticUpdateCheckDelay(lastCheckedAt, now, intervalMs = AUTOMATIC_UPDATE_CHECK_INTERVAL_MS) {
11
+ const lastCheckedAtMs = Date.parse(lastCheckedAt ?? "");
12
+ if (!Number.isFinite(lastCheckedAtMs) || lastCheckedAtMs > now) return 0;
13
+ return Math.max(0, lastCheckedAtMs + intervalMs - now);
14
+ }
15
+ //#endregion
16
+ export { AUTOMATIC_UPDATE_CHECK_INTERVAL_MS, getAutomaticUpdateCheckDelay, resolveAutomaticUpdateCheckIntervalMs };
17
+
18
+ //# sourceMappingURL=automatic-update-check.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automatic-update-check.utils.js","names":[],"sources":["../../src/utils/automatic-update-check.utils.ts"],"sourcesContent":["export const AUTOMATIC_UPDATE_CHECK_INTERVAL_MS = 2 * 60 * 60 * 1000;\n\nconst MINIMUM_VERIFICATION_INTERVAL_MS = 100;\n\ntype AutomaticUpdateCheckIntervalOptions = {\n verificationMode: boolean;\n verificationIntervalMs: string | undefined;\n};\n\nexport function resolveAutomaticUpdateCheckIntervalMs(\n options: AutomaticUpdateCheckIntervalOptions,\n): number {\n if (!options.verificationMode) {\n return AUTOMATIC_UPDATE_CHECK_INTERVAL_MS;\n }\n\n const intervalMs = Number(options.verificationIntervalMs);\n if (!Number.isInteger(intervalMs) || intervalMs < MINIMUM_VERIFICATION_INTERVAL_MS) {\n throw new Error(\n `NEXTCLAW_UPDATE_VERIFICATION_INTERVAL_MS must be an integer of at least ${MINIMUM_VERIFICATION_INTERVAL_MS}.`,\n );\n }\n return intervalMs;\n}\n\nexport function getAutomaticUpdateCheckDelay(\n lastCheckedAt: string | null,\n now: number,\n intervalMs = AUTOMATIC_UPDATE_CHECK_INTERVAL_MS,\n): number {\n const lastCheckedAtMs = Date.parse(lastCheckedAt ?? \"\");\n if (!Number.isFinite(lastCheckedAtMs) || lastCheckedAtMs > now) {\n return 0;\n }\n return Math.max(0, lastCheckedAtMs + intervalMs - now);\n}\n"],"mappings":";AAAA,MAAa,qCAAqC,OAAc;AAEhE,MAAM,mCAAmC;AAOzC,SAAgB,sCACd,SACQ;AACR,KAAI,CAAC,QAAQ,iBACX,QAAO;CAGT,MAAM,aAAa,OAAO,QAAQ,uBAAuB;AACzD,KAAI,CAAC,OAAO,UAAU,WAAW,IAAI,aAAa,iCAChD,OAAM,IAAI,MACR,2EAA2E,iCAAiC,GAC7G;AAEH,QAAO;;AAGT,SAAgB,6BACd,eACA,KACA,aAAa,oCACL;CACR,MAAM,kBAAkB,KAAK,MAAM,iBAAiB,GAAG;AACvD,KAAI,CAAC,OAAO,SAAS,gBAAgB,IAAI,kBAAkB,IACzD,QAAO;AAET,QAAO,KAAK,IAAI,GAAG,kBAAkB,aAAa,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/kernel",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "private": false,
5
5
  "description": "NextClaw product kernel skeleton for agents, tasks, sessions, context, tools, skills, providers, automation, and channels.",
6
6
  "type": "module",
@@ -14,6 +14,12 @@
14
14
  "development": "./src/types/update-contract.types.ts",
15
15
  "types": "./dist/types/update-contract.types.d.ts",
16
16
  "default": "./dist/types/update-contract.types.js"
17
+ },
18
+ "./automatic-update-check": {
19
+ "development": "./src/utils/automatic-update-check.utils.ts",
20
+ "types": "./dist/utils/automatic-update-check.utils.d.ts",
21
+ "require": "./dist/cjs/automatic-update-check.utils.cjs",
22
+ "default": "./dist/utils/automatic-update-check.utils.js"
17
23
  }
18
24
  },
19
25
  "files": [
@@ -22,19 +28,19 @@
22
28
  "dependencies": {
23
29
  "rxjs": "^7.8.2",
24
30
  "yaml": "^2.8.1",
25
- "@nextclaw/channel-extension-feishu": "0.2.6",
26
- "@nextclaw/channel-extension-weixin": "0.2.6",
27
- "@nextclaw/core": "0.15.6",
28
- "@nextclaw/mcp": "0.3.6",
29
- "@nextclaw/ncp-agent-runtime": "0.4.4",
30
- "@nextclaw/ncp-agent-runtime-next": "0.1.4",
31
- "@nextclaw/ncp-toolkit": "0.6.5",
32
- "@nextclaw/ncp-mcp": "0.2.6",
33
- "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.3.7",
34
- "@nextclaw/nextclaw-ncp-runtime-http-client": "0.3.4",
35
- "@nextclaw/runtime": "0.4.6",
36
- "@nextclaw/shared": "0.4.5",
37
- "@nextclaw/ncp": "0.7.4"
31
+ "@nextclaw/channel-extension-feishu": "0.2.7",
32
+ "@nextclaw/channel-extension-weixin": "0.2.7",
33
+ "@nextclaw/core": "0.15.7",
34
+ "@nextclaw/mcp": "0.3.7",
35
+ "@nextclaw/ncp-agent-runtime": "0.4.5",
36
+ "@nextclaw/ncp-agent-runtime-next": "0.1.5",
37
+ "@nextclaw/ncp-mcp": "0.2.7",
38
+ "@nextclaw/ncp-toolkit": "0.6.6",
39
+ "@nextclaw/nextclaw-ncp-runtime-http-client": "0.3.5",
40
+ "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.3.8",
41
+ "@nextclaw/runtime": "0.4.7",
42
+ "@nextclaw/shared": "0.4.6",
43
+ "@nextclaw/ncp": "0.7.5"
38
44
  },
39
45
  "devDependencies": {
40
46
  "@types/node": "^20.17.6",
@@ -43,7 +49,7 @@
43
49
  "vitest": "^4.1.2"
44
50
  },
45
51
  "scripts": {
46
- "build": "tsdown src/index.ts src/types/update-contract.types.ts --dts.sourcemap --clean --target es2022 --no-fixedExtension",
52
+ "build": "tsdown src/index.ts src/types/update-contract.types.ts src/utils/automatic-update-check.utils.ts --dts.sourcemap --clean --target es2022 --no-fixedExtension && tsdown src/utils/automatic-update-check.utils.ts --format cjs --out-dir dist/cjs --no-clean --target es2022 --no-fixedExtension",
47
53
  "lint": "eslint .",
48
54
  "test": "vitest run",
49
55
  "tsc": "tsc -p tsconfig.json"