gm-plugkit 2.0.1189 → 2.0.1190

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1189",
3
+ "version": "2.0.1190",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -27,6 +27,23 @@ const ORCHESTRATOR_VERBS = new Set(['instruction', 'transition', 'phase-status',
27
27
  const TURN_IDLE_MS = 30_000;
28
28
  const _turns = new Map();
29
29
 
30
+ function applyDisciplineSigil(rawBody) {
31
+ let parsed;
32
+ try { parsed = JSON.parse(rawBody); } catch (_) { return rawBody; }
33
+ if (!parsed || typeof parsed !== 'object') return rawBody;
34
+ const SIGIL = /^@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\s+/;
35
+ for (const key of ['query', 'text']) {
36
+ const v = parsed[key];
37
+ if (typeof v !== 'string') continue;
38
+ const m = v.match(SIGIL);
39
+ if (!m) continue;
40
+ if (!parsed.namespace) parsed.namespace = m[1];
41
+ parsed[key] = v.slice(m[0].length);
42
+ break;
43
+ }
44
+ return JSON.stringify(parsed);
45
+ }
46
+
30
47
  function turnTick(sess, verb, taskBase, phase) {
31
48
  const key = sess || '(no-session)';
32
49
  const now = Date.now();
@@ -1344,9 +1361,13 @@ async function runSpoolWatcher(instance, spoolDir) {
1344
1361
  const relPath = path.relative(inDir, filePath);
1345
1362
  const dir = path.dirname(relPath);
1346
1363
  const verb = dir === '.' ? path.basename(filePath, path.extname(filePath)) : dir;
1347
- const body = content.trim() || '{}';
1364
+ let body = content.trim() || '{}';
1348
1365
  const taskBase = path.basename(filePath, path.extname(filePath));
1349
1366
 
1367
+ if (verb === 'recall' || verb === 'memorize' || verb === 'codesearch' || verb === 'memorize-fire') {
1368
+ body = applyDisciplineSigil(body);
1369
+ }
1370
+
1350
1371
  const verbBytes = new TextEncoder().encode(verb);
1351
1372
  const bodyBytes = new TextEncoder().encode(body);
1352
1373