@hmharness/cognitive 0.23.33 → 0.23.34

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 (2) hide show
  1. package/dist/rlm-sandbox.js +17 -17
  2. package/package.json +31 -31
@@ -29,23 +29,23 @@ import { Worker } from 'node:worker_threads';
29
29
  * spawn). What remains impossible to block without a per-worker
30
30
  * permission model is declared in SANDBOX_BYPASS_VECTORS below — pinned
31
31
  * by the red-team test so a silent hole can never masquerade as covered. */
32
- const WORKER_SOURCE = `
33
- const { parentPort, workerData } = require('node:worker_threads');
34
- (async () => {
35
- // hardening pass: strip escape globals BEFORE evaluating any user code
36
- try { delete globalThis.process; } catch { /* non-configurable: shadow instead below */ }
37
- try { globalThis.Worker = undefined; } catch { }
38
- try { globalThis.fetch = undefined; } catch { }
39
- try { globalThis.WebSocket = undefined; } catch { }
40
- const ctx = Object.freeze({ vars: Object.freeze({ ...workerData.vars }), meta: Object.freeze({ ...workerData.meta }) });
41
- try {
42
- const fn = new Function('ctx', 'process', 'require', 'fetch', 'Worker', 'WebSocket', '"use strict";return (async()=>{' + workerData.code + '})();');
43
- const value = await fn(ctx, undefined, undefined, undefined, undefined, undefined);
44
- parentPort.postMessage({ ok: true, value });
45
- } catch (err) {
46
- parentPort.postMessage({ ok: false, error: { code: 'E_EVAL', message: err && err.message ? String(err.message).slice(0, 500) : String(err).slice(0, 500) } });
47
- }
48
- })();
32
+ const WORKER_SOURCE = `
33
+ const { parentPort, workerData } = require('node:worker_threads');
34
+ (async () => {
35
+ // hardening pass: strip escape globals BEFORE evaluating any user code
36
+ try { delete globalThis.process; } catch { /* non-configurable: shadow instead below */ }
37
+ try { globalThis.Worker = undefined; } catch { }
38
+ try { globalThis.fetch = undefined; } catch { }
39
+ try { globalThis.WebSocket = undefined; } catch { }
40
+ const ctx = Object.freeze({ vars: Object.freeze({ ...workerData.vars }), meta: Object.freeze({ ...workerData.meta }) });
41
+ try {
42
+ const fn = new Function('ctx', 'process', 'require', 'fetch', 'Worker', 'WebSocket', '"use strict";return (async()=>{' + workerData.code + '})();');
43
+ const value = await fn(ctx, undefined, undefined, undefined, undefined, undefined);
44
+ parentPort.postMessage({ ok: true, value });
45
+ } catch (err) {
46
+ parentPort.postMessage({ ok: false, error: { code: 'E_EVAL', message: err && err.message ? String(err.message).slice(0, 500) : String(err).slice(0, 500) } });
47
+ }
48
+ })();
49
49
  `;
50
50
  /**
51
51
  * HONEST threat model: escape vectors the worker CANNOT block today (they
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "@hmharness/cognitive",
3
- "version": "0.23.33",
4
- "description": "hmharness Cognitive OS core: Environment protocol, World Model, Goal system, Exploration, RLM runtime, five-layer memory, Skill Compiler, Continual Learning control plane, Evolution 2.0 governance, Multi-Agent topology, Transfer lab and GeneralBench schema. Cognitive strategy layer per the HMH Cognitive OS blueprint (2026-09).",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "default": "./dist/index.js"
11
- }
12
- },
13
- "types": "dist/index.d.ts",
14
- "scripts": {
15
- "build": "tsc -p tsconfig.build.json"
16
- },
17
- "files": [
18
- "dist"
19
- ],
20
- "license": "MIT",
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/swsgbl/hmharness.git"
24
- },
25
- "engines": {
26
- "node": ">=22"
27
- },
28
- "dependencies": {
29
- "@hmharness/kernel": "0.23.33"
30
- }
31
- }
1
+ {
2
+ "name": "@hmharness/cognitive",
3
+ "version": "0.23.34",
4
+ "description": "hmharness Cognitive OS core: Environment protocol, World Model, Goal system, Exploration, RLM runtime, five-layer memory, Skill Compiler, Continual Learning control plane, Evolution 2.0 governance, Multi-Agent topology, Transfer lab and GeneralBench schema. Cognitive strategy layer per the HMH Cognitive OS blueprint (2026-09).",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "types": "dist/index.d.ts",
14
+ "scripts": {
15
+ "build": "tsc -p tsconfig.build.json"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/swsgbl/hmharness.git"
24
+ },
25
+ "engines": {
26
+ "node": ">=22"
27
+ },
28
+ "dependencies": {
29
+ "@hmharness/kernel": "0.23.34"
30
+ }
31
+ }