@cortexkit/pi-magic-context 0.49.60 → 0.49.61

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/index.js +21 -6
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -3601,7 +3601,7 @@ function startHostStallProfilerSwitch() {
3601
3601
  // package.json
3602
3602
  var package_default = {
3603
3603
  name: "@cortexkit/pi-magic-context",
3604
- version: "0.49.60",
3604
+ version: "0.49.61",
3605
3605
  type: "module",
3606
3606
  description: "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
3607
3607
  main: "dist/index.js",
@@ -3670,6 +3670,7 @@ var package_default = {
3670
3670
  "omp-coding-agent-18132": "npm:@oh-my-pi/pi-coding-agent@18.13.2",
3671
3671
  "omp-coding-agent-18186": "npm:@oh-my-pi/pi-coding-agent@18.18.6",
3672
3672
  "omp-coding-agent-18190": "npm:@oh-my-pi/pi-coding-agent@18.19.0",
3673
+ "omp-coding-agent-18220": "npm:@oh-my-pi/pi-coding-agent@18.22.0",
3673
3674
  "omp-pi-ai-171": "npm:@oh-my-pi/pi-ai@17.1.7",
3674
3675
  "omp-pi-ai-1889": "npm:@oh-my-pi/pi-ai@18.8.9",
3675
3676
  "omp-pi-ai-1811": "npm:@oh-my-pi/pi-ai@18.11.3",
@@ -37426,10 +37427,20 @@ function isOmpSideContext(event) {
37426
37427
  return row.role === "developer" && row.attribution === "agent" && textContainsReminder(row.content);
37427
37428
  });
37428
37429
  }
37429
- var ADVISOR_PREFIX = "<conventions>\nRFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. `NEVER`=`MUST NOT`; `AVOID`=`SHOULD NOT`.\n</conventions>\n\nUser, code-quality, robustness advocate; peer-shadow main agent.\n";
37430
+ var ADVISOR_CONVENTIONS = "<conventions>\nRFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL. `NEVER`=`MUST NOT`; `AVOID`=`SHOULD NOT`.\n</conventions>\n\n";
37431
+ var ADVISOR_ROLE = `User, code-quality, robustness advocate; peer-shadow main agent.
37432
+ `;
37430
37433
  var ADVISOR_WORKFLOW = `<workflow>
37431
37434
  Receive incremental agent transcript, including thoughts.
37432
37435
  `;
37436
+ var SESSION_UPDATE = `### Session update
37437
+
37438
+ `;
37439
+ var COMPACTION_SUMMARY = `Prior model work/tool state available.
37440
+ MUST build on prior work; NEVER duplicate prior work.
37441
+
37442
+ <summary>
37443
+ `;
37433
37444
  var CAPTURE_PREFIX = "Automated capture turn — not a user reply; user has not responded to your previous turn.";
37434
37445
  function record3(value) {
37435
37446
  return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
@@ -37509,11 +37520,17 @@ function firstTextBlock(value) {
37509
37520
  const part = record3(value);
37510
37521
  return part?.type === "text" && typeof part.text === "string" ? part.text : undefined;
37511
37522
  }
37523
+ function isOmpStockAdvisorPrompt(text) {
37524
+ if (typeof text !== "string")
37525
+ return false;
37526
+ const body = text.startsWith(ADVISOR_CONVENTIONS) ? text.slice(ADVISOR_CONVENTIONS.length) : text;
37527
+ return body.startsWith(ADVISOR_ROLE) && body.includes(ADVISOR_WORKFLOW);
37528
+ }
37512
37529
  function isOmpAdvisorRequest(payload) {
37513
37530
  const request = providerRequest(payload);
37514
37531
  if (!request?.tools.includes("advise"))
37515
37532
  return false;
37516
- if (!request.system.some((text) => text?.startsWith(ADVISOR_PREFIX) && text.includes(ADVISOR_WORKFLOW)))
37533
+ if (!request.system.some(isOmpStockAdvisorPrompt))
37517
37534
  return false;
37518
37535
  const first = record3(request.messages[0]);
37519
37536
  if (first?.role !== "user")
@@ -37521,9 +37538,7 @@ function isOmpAdvisorRequest(payload) {
37521
37538
  let text = firstText(first.content, request.textType)?.replace(/^<system-reminder>\nToday: [^\n]+\n<\/system-reminder>(?:\n|$)/, "");
37522
37539
  if (text === "" && Array.isArray(first.content))
37523
37540
  text = firstText(first.content.slice(1, 2), request.textType);
37524
- return text?.startsWith(`### Session update
37525
-
37526
- `) === true;
37541
+ return text?.startsWith(SESSION_UPDATE) === true || text?.startsWith(COMPACTION_SUMMARY) === true;
37527
37542
  }
37528
37543
  function isOmpUnmanagedCaptureRequest(payload) {
37529
37544
  return isOmpLegacyCaptureRequest(payload) || isOmpAutolearnCapture(payload);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.49.60",
3
+ "version": "0.49.61",
4
4
  "type": "module",
5
5
  "description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -69,6 +69,7 @@
69
69
  "omp-coding-agent-18132": "npm:@oh-my-pi/pi-coding-agent@18.13.2",
70
70
  "omp-coding-agent-18186": "npm:@oh-my-pi/pi-coding-agent@18.18.6",
71
71
  "omp-coding-agent-18190": "npm:@oh-my-pi/pi-coding-agent@18.19.0",
72
+ "omp-coding-agent-18220": "npm:@oh-my-pi/pi-coding-agent@18.22.0",
72
73
  "omp-pi-ai-171": "npm:@oh-my-pi/pi-ai@17.1.7",
73
74
  "omp-pi-ai-1889": "npm:@oh-my-pi/pi-ai@18.8.9",
74
75
  "omp-pi-ai-1811": "npm:@oh-my-pi/pi-ai@18.11.3",