@psiclawops/hypercompositor 0.5.1 → 0.5.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EAId,MAAM,sBAAsB,CAAC;AAU9B,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AA4oElG;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1F;;;;;;;;AAMD,wBAwBG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EAId,MAAM,sBAAsB,CAAC;AAU9B,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAsrElG;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1F;;;;;;;;AAMD,wBAwBG"}
package/dist/index.js CHANGED
@@ -61,6 +61,9 @@ let _evictionConfig;
61
61
  let _contextWindowSize = 128_000;
62
62
  let _contextWindowReserve = 0.25;
63
63
  let _deferToolPruning = false;
64
+ // Subagent warming mode: 'full' | 'light' | 'off'. Default: 'light'.
65
+ // Controls how much HyperMem context is injected into subagent sessions.
66
+ let _subagentWarming = 'light';
64
67
  // Cache replay threshold: 15min default. Set to 0 in user config to disable.
65
68
  let _cacheReplayThresholdMs = 900_000;
66
69
  // ─── System overhead cache ────────────────────────────────────
@@ -176,6 +179,11 @@ async function getHyperMem() {
176
179
  _deferToolPruning = true;
177
180
  console.log('[hypermem-plugin] deferToolPruning: true — tool gradient deferred to host contextPruning');
178
181
  }
182
+ const warmingVal = userConfig.subagentWarming;
183
+ if (warmingVal === 'full' || warmingVal === 'light' || warmingVal === 'off') {
184
+ _subagentWarming = warmingVal;
185
+ console.log(`[hypermem-plugin] subagentWarming: ${_subagentWarming}`);
186
+ }
179
187
  if (typeof userConfig.warmCacheReplayThresholdMs === 'number') {
180
188
  _cacheReplayThresholdMs = userConfig.warmCacheReplayThresholdMs;
181
189
  }
@@ -1218,6 +1226,25 @@ function createHyperMemEngine() {
1218
1226
  const hm = await getHyperMem();
1219
1227
  const sk = resolveSessionKey(sessionId, sessionKey);
1220
1228
  const agentId = extractAgentId(sk);
1229
+ // ── Subagent warming control ─────────────────────────────────────────
1230
+ // Detect subagent sessions by key pattern and apply warming mode.
1231
+ // 'off' = passthrough (no HyperMem context at all)
1232
+ // 'light' = facts + history only (skip library/wiki/semantic/keystones/doc chunks)
1233
+ // 'full' = standard compositor pipeline
1234
+ const isSubagent = sk.includes('subagent:');
1235
+ if (isSubagent && _subagentWarming === 'off') {
1236
+ console.log(`[hypermem-plugin] assemble: subagent warming=off, passthrough (sk: ${sk})`);
1237
+ return {
1238
+ messages: messages,
1239
+ estimatedTokens: messages.reduce((sum, m) => {
1240
+ const msg = m;
1241
+ return sum + Math.ceil((typeof msg.textContent === 'string' ? msg.textContent.length : 0) / 4);
1242
+ }, 0),
1243
+ };
1244
+ }
1245
+ if (isSubagent) {
1246
+ console.log(`[hypermem-plugin] assemble: subagent warming=${_subagentWarming} (sk: ${sk})`);
1247
+ }
1221
1248
  // Resolve agent tier from fleet store (for doc chunk tier filtering)
1222
1249
  let tier;
1223
1250
  try {
@@ -1331,6 +1358,9 @@ function createHyperMemEngine() {
1331
1358
  // Non-fatal — fall through to full assembly
1332
1359
  }
1333
1360
  }
1361
+ // Subagent light mode: skip library/wiki/semantic/keystones/doc chunks.
1362
+ // Keeps: system, identity, history, active facts, output profile, tool gradient.
1363
+ const subagentLight = isSubagent && _subagentWarming === 'light';
1334
1364
  const request = {
1335
1365
  agentId,
1336
1366
  sessionKey: sk,
@@ -1338,7 +1368,10 @@ function createHyperMemEngine() {
1338
1368
  historyDepth,
1339
1369
  tier,
1340
1370
  model, // pass model for provider detection
1341
- includeDocChunks: !cachedContextBlock, // skip doc retrieval on cache hit
1371
+ includeDocChunks: subagentLight ? false : !cachedContextBlock, // skip doc retrieval on cache hit or subagent light
1372
+ includeLibrary: subagentLight ? false : undefined, // skip wiki/knowledge/preferences
1373
+ includeSemanticRecall: subagentLight ? false : undefined, // skip vector/FTS recall
1374
+ includeKeystones: subagentLight ? false : undefined, // skip keystone history injection
1342
1375
  prompt,
1343
1376
  skipProviderTranslation: true, // runtime handles provider translation
1344
1377
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psiclawops/hypercompositor",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "HyperCompositor \u2014 context engine plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,6 +29,9 @@
29
29
  "build": "tsc",
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
+ "dependencies": {
33
+ "@psiclawops/hypermem": "^0.5.2"
34
+ },
32
35
  "devDependencies": {
33
36
  "@psiclawops/hypermem": "file:..",
34
37
  "openclaw": "*",