motifcode 0.4.2 → 0.4.4

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,5 +1,5 @@
1
1
  {
2
- "version": "0.4.2",
3
- "bytes": 2742341,
4
- "node": "v22.23.3"
2
+ "version": "0.4.4",
3
+ "bytes": 2742619,
4
+ "node": "v22.23.4"
5
5
  }
package/dist/motif.js CHANGED
@@ -48914,12 +48914,13 @@ var LoopGuard = class _LoopGuard {
48914
48914
  return actions.map((a) => `${a.name}(${JSON.stringify(a.arguments)})`).join("|");
48915
48915
  }
48916
48916
  observe(signature, output) {
48917
- if (signature !== "" && signature === this.lastSignature) this.repeats++;
48917
+ const sameOutput = output === this.lastOutput;
48918
+ if (signature !== "" && signature === this.lastSignature && sameOutput) this.repeats++;
48918
48919
  else {
48919
48920
  this.lastSignature = signature;
48920
48921
  this.repeats = 1;
48921
48922
  }
48922
- if (output === this.lastOutput && output !== "") this.stalls++;
48923
+ if (sameOutput && output !== "") this.stalls++;
48923
48924
  else {
48924
48925
  this.lastOutput = output;
48925
48926
  this.stalls = 0;
@@ -49007,7 +49008,11 @@ The person asked the summary to concentrate on: ${opts.focus}` : SUMMARIZATION_P
49007
49008
  ...opts.signal ? { signal: opts.signal } : {}
49008
49009
  });
49009
49010
  const body = response.reasoningContent !== void 0 ? response.content : splitThinking(response.rawText).content;
49010
- const text = body.replace(/<tool_call>[\s\S]*?<\/tool_call>/g, "").trim();
49011
+ const callBody = body.replace(/(["'`])<tool_call>\1/g, "");
49012
+ if ((response.toolCalls?.length ?? 0) > 0 || callBody.includes("<tool_call>")) {
49013
+ throw new Error("the model called a tool instead of writing a summary; the context was left as it was");
49014
+ }
49015
+ const text = body.trim();
49011
49016
  if (text === "") throw new Error("the model returned no summary; the context was left as it was");
49012
49017
  return text;
49013
49018
  }
@@ -58554,7 +58559,7 @@ var Chat = class {
58554
58559
  break;
58555
58560
  }
58556
58561
  if (key.type !== "ctrl" || key.key !== "c") this.ctrlCArmedAt = 0;
58557
- this.refresh();
58562
+ if (!this.quitting) this.refresh();
58558
58563
  }
58559
58564
  onControl(letter) {
58560
58565
  switch (letter) {
@@ -62663,7 +62668,7 @@ function pluginConnectionUi(signal) {
62663
62668
  }
62664
62669
 
62665
62670
  // packages/cli/src/main.ts
62666
- var VERSION = "0.4.2";
62671
+ var VERSION = "0.4.4";
62667
62672
  var SHORT_FLAGS = { p: "print", c: "continue", i: "interactive", v: "verbose", h: "help" };
62668
62673
  var BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
62669
62674
  "print",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motifcode",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "description": "Unofficial coding agent harness built for Motif-3: a Claude Code-style terminal session over the hosted endpoint",
6
6
  "keywords": [