@mnmal-ai/cortext-omp 1.0.0-alpha.18 → 1.0.0-alpha.19

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/extension.js +15 -8
  2. package/package.json +2 -2
package/dist/extension.js CHANGED
@@ -3180,8 +3180,9 @@ const REQUEST_MAX = 2e3;
3180
3180
  * facts); the oldest dropped only once the list passes STEPS_BUDGET. */
3181
3181
  const RECENT_STEPS = 5;
3182
3182
  const OLD_CLIP = 40;
3183
- const STEPS_BUDGET = 4500;
3184
- const NEXT_ACTION = "Carry on with the request from where the steps above leave off; do not redo a step listed there.";
3183
+ const HINT_MAX = 30;
3184
+ const STEPS_BUDGET = 5500;
3185
+ const NEXT_ACTION = "Compare the request with the steps above: do only what the request names that the steps do not show, and when nothing remains, give the answer.";
3185
3186
  /** Argument keys whose values are never saved. */
3186
3187
  const SECRET_KEY = /token|secret|passw|api[-_]?key|auth|cookie|credential|private/i;
3187
3188
  /** Known-safe names the substring match would mask, each only for the value
@@ -3304,9 +3305,11 @@ function stepLine(s, callMax, resultMax, brief = false) {
3304
3305
  function times(s) {
3305
3306
  return s.count > 1 ? ` ×${s.count}` : "";
3306
3307
  }
3307
- /** An older step: the tool and its result's short facts, else a short brief. */
3308
+ /** An older step: the tool, a short hint of what it was for, and its result's
3309
+ * short facts (the hint keeps facts attributable when a result omits its key),
3310
+ * else a short brief. */
3308
3311
  function olderLine(s) {
3309
- if (s.facts && !s.error) return `${s.tool} → ${JSON.stringify(s.facts)}${times(s)}`;
3312
+ if (s.facts && !s.error) return `${s.tool}(${clip(s.hint, HINT_MAX)}) → ${JSON.stringify(s.facts)}${times(s)}`;
3310
3313
  return stepLine(s, OLD_CLIP, OLD_CLIP, true);
3311
3314
  }
3312
3315
  /**
@@ -3317,11 +3320,11 @@ function olderLine(s) {
3317
3320
  */
3318
3321
  function mergeSteps(prev, next) {
3319
3322
  const out = [...prev];
3320
- const at = new Map(out.map((s, i) => [s.call, i]));
3323
+ const at = new Map(out.map((s, i) => [s.key, i]));
3321
3324
  for (const s of next) {
3322
- const i = at.get(s.call);
3325
+ const i = at.get(s.key);
3323
3326
  if (i === void 0) {
3324
- at.set(s.call, out.length);
3327
+ at.set(s.key, out.length);
3325
3328
  out.push(s);
3326
3329
  continue;
3327
3330
  }
@@ -3346,11 +3349,15 @@ function buildCheckpoint(messages) {
3346
3349
  if (c?.type !== "toolCall") continue;
3347
3350
  pending.set(String(c.id), calls.length);
3348
3351
  const args = argsOf(c.arguments);
3352
+ const parsed = JSON.parse(args);
3353
+ const { i: intent, ...rest } = parsed && typeof parsed === "object" ? parsed : {};
3349
3354
  const tool = redact(shortName(String(c.name)));
3350
3355
  calls.push({
3351
3356
  call: redact(`${c.name}(${args})`),
3352
- brief: redact(`${tool}(${leaves(JSON.parse(args)).join(", ")})`),
3357
+ brief: redact(`${tool}(${leaves(parsed).join(", ")})`),
3353
3358
  tool,
3359
+ hint: redact(typeof intent === "string" && intent.trim() ? intent : leaves(rest).join(", ")),
3360
+ key: redact(`${c.name}(${JSON.stringify(rest)})`),
3354
3361
  result: null,
3355
3362
  facts: "",
3356
3363
  error: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnmal-ai/cortext-omp",
3
- "version": "1.0.0-alpha.18",
3
+ "version": "1.0.0-alpha.19",
4
4
  "description": "Cortext — the OMP (oh-my-pi) skin: cold-start and inbox seams as an OMP extension, bundling the @mnmal-ai/synoptic host into a committed dist artifact.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "devDependencies": {
26
- "@mnmal-ai/synoptic": "1.0.0-alpha.18",
26
+ "@mnmal-ai/synoptic": "1.0.0-alpha.19",
27
27
  "@types/node": "^26.6.4",
28
28
  "tsdown": "^0.23.0",
29
29
  "typescript": "^7.0.2",