gm-skill 2.0.1465 → 2.0.1467

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
- 0.1.601
1
+ 0.1.602
@@ -1 +1 @@
1
- 350a27fea5159b8b7cf914bca606d0b6275f6480a1e50d462ddc963537f5bfdb plugkit.wasm
1
+ c65ccc2945ab439d829fb2e894b635e4eaef3e6a10babeaa57063e6c8c4c3239 plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1465",
3
+ "version": "2.0.1467",
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": {
@@ -213,9 +213,19 @@ function dispatchAutoRecall(instance, queryPrompt) {
213
213
  } catch (_) { return null; }
214
214
  }
215
215
 
216
- function tryAutoRecallForTurnEntry(instance, sess, cwd) {
216
+ function promptFromInstructionBody(body) {
217
217
  try {
218
- const prompt = readUserPromptForRecall(cwd);
218
+ const obj = JSON.parse(body);
219
+ if (obj && typeof obj.prompt === 'string' && obj.prompt.trim()) return obj.prompt.trim();
220
+ } catch (_) {}
221
+ return '';
222
+ }
223
+
224
+ function tryAutoRecallForTurnEntry(instance, sess, cwd, bodyPrompt) {
225
+ try {
226
+ const prompt = (typeof bodyPrompt === 'string' && bodyPrompt.trim())
227
+ ? bodyPrompt.trim()
228
+ : readUserPromptForRecall(cwd);
219
229
  let emptyPromptFallback = false;
220
230
  let effectivePrompt = prompt;
221
231
  if (!prompt || !String(prompt).trim()) {
@@ -271,6 +281,22 @@ function tryAutoRecallForTurnEntry(instance, sess, cwd) {
271
281
  }
272
282
  }
273
283
 
284
+ function capHitText(hits, maxLen, maxCount) {
285
+ if (!Array.isArray(hits)) return hits;
286
+ return hits.slice(0, maxCount).map((h) => {
287
+ if (!h || typeof h !== 'object' || typeof h.text !== 'string' || h.text.length <= maxLen) return h;
288
+ return { ...h, text: h.text.slice(0, maxLen) + '…[+' + (h.text.length - maxLen) + 'ch]' };
289
+ });
290
+ }
291
+
292
+ function capInstructionPacks(parsed) {
293
+ const target = (parsed.data && typeof parsed.data === 'object') ? parsed.data : parsed;
294
+ if (Array.isArray(target.recall_hits)) target.recall_hits = capHitText(target.recall_hits, 360, 8);
295
+ if (target.auto_recall && Array.isArray(target.auto_recall.hits)) {
296
+ target.auto_recall.hits = capHitText(target.auto_recall.hits, 360, 8);
297
+ }
298
+ }
299
+
274
300
  function mergeAutoRecallIntoInstructionResponse(resultStr, autoRecall) {
275
301
  if (!autoRecall) return resultStr;
276
302
  let parsed;
@@ -281,6 +307,7 @@ function mergeAutoRecallIntoInstructionResponse(resultStr, autoRecall) {
281
307
  } else {
282
308
  parsed.auto_recall = autoRecall;
283
309
  }
310
+ capInstructionPacks(parsed);
284
311
  if (typeof parsed.stdout === 'string' && parsed.stdout.length > 0) {
285
312
  try {
286
313
  const inner = JSON.parse(parsed.stdout);
@@ -2744,7 +2771,7 @@ async function runSpoolWatcher(instance, spoolDir) {
2744
2771
  if (verb === 'instruction') {
2745
2772
  const sessForRecall = readCurrentSess();
2746
2773
  if (isInstructionTurnStart(sessForRecall)) {
2747
- autoRecallPayload = tryAutoRecallForTurnEntry(instance, sessForRecall, process.cwd());
2774
+ autoRecallPayload = tryAutoRecallForTurnEntry(instance, sessForRecall, process.cwd(), promptFromInstructionBody(body));
2748
2775
  try {
2749
2776
  const _spoolDir = path.join(process.cwd(), '.gm', 'exec-spool');
2750
2777
  for (const _f of ['.turn-browser-edits.json', '.turn-browser-witnessed']) {
@@ -2771,6 +2798,14 @@ async function runSpoolWatcher(instance, spoolDir) {
2771
2798
 
2772
2799
  if (autoRecallPayload) {
2773
2800
  resultStr = mergeAutoRecallIntoInstructionResponse(resultStr, autoRecallPayload);
2801
+ } else if (verb === 'instruction' || verb === 'transition') {
2802
+ try {
2803
+ const parsed = JSON.parse(resultStr);
2804
+ if (parsed && typeof parsed === 'object') {
2805
+ capInstructionPacks(parsed);
2806
+ resultStr = JSON.stringify(parsed);
2807
+ }
2808
+ } catch (_) {}
2774
2809
  }
2775
2810
 
2776
2811
  const outName = dir === '.' ? `${taskBase}.json` : `${verb}-${taskBase}.json`;
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1465",
3
+ "version": "2.0.1467",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "plugkitVersion": "0.1.601"
20
+ "plugkitVersion": "0.1.602"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1465",
3
+ "version": "2.0.1467",
4
4
  "description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",