lupacode 1.0.7 → 1.0.8

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 +146 -42
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -62835,7 +62835,7 @@ class MarkdownRenderable extends Renderable {
62835
62835
  fg: this._fg,
62836
62836
  bg: this._bg,
62837
62837
  conceal: this._concealCode,
62838
- drawUnstyledText: !this._streaming,
62838
+ drawUnstyledText: true,
62839
62839
  streaming: this._streaming,
62840
62840
  treeSitterClient: this._treeSitterClient,
62841
62841
  width: "100%",
@@ -62878,7 +62878,7 @@ class MarkdownRenderable extends Renderable {
62878
62878
  renderable.fg = this._fg;
62879
62879
  renderable.bg = this._bg;
62880
62880
  renderable.conceal = this._concealCode;
62881
- renderable.drawUnstyledText = !this._streaming;
62881
+ renderable.drawUnstyledText = true;
62882
62882
  renderable.streaming = this._streaming;
62883
62883
  renderable.content = token.text;
62884
62884
  renderable.marginBottom = marginBottom;
@@ -96422,7 +96422,7 @@ var import_react35 = __toESM(require_react(), 1);
96422
96422
  // package.json
96423
96423
  var package_default2 = {
96424
96424
  name: "lupacode",
96425
- version: "1.0.7",
96425
+ version: "1.0.8",
96426
96426
  description: "AI-powered terminal coding assistant",
96427
96427
  type: "module",
96428
96428
  bin: {
@@ -98166,7 +98166,7 @@ function InputBar({ onSubmit, disabled = false, sessionId, messages }) {
98166
98166
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(SettingsDialogContent, {}, undefined, false, undefined, this)
98167
98167
  });
98168
98168
  }
98169
- if (key.name === "?" && !key.ctrl) {
98169
+ if (key.name === "?" && !key.ctrl && !textareaRef.current?.plainText) {
98170
98170
  key.preventDefault();
98171
98171
  dialog.open({
98172
98172
  title: "Keyboard Shortcuts",
@@ -98562,43 +98562,43 @@ function prettyMilliseconds(milliseconds, options) {
98562
98562
 
98563
98563
  // src/components/messages/bot-message.tsx
98564
98564
  var globalSyntaxStyle = SyntaxStyle.fromStyles({
98565
- default: { fg: "#D4D4D4" },
98566
- keyword: { fg: "#569CD6" },
98567
- "keyword.control": { fg: "#C586C0" },
98568
- "keyword.import": { fg: "#C586C0" },
98569
- "keyword.function": { fg: "#DCDCAA" },
98570
- string: { fg: "#CE9178" },
98571
- "string.special": { fg: "#CE9178" },
98572
- number: { fg: "#B5CEA8" },
98573
- "number.float": { fg: "#B5CEA8" },
98574
- comment: { fg: "#6A9955", italic: true },
98575
- function: { fg: "#DCDCAA" },
98576
- "function.call": { fg: "#DCDCAA" },
98577
- "function.method": { fg: "#DCDCAA" },
98578
- type: { fg: "#4EC9B0" },
98579
- "type.builtin": { fg: "#4EC9B0" },
98580
- variable: { fg: "#9CDCFE" },
98581
- "variable.parameter": { fg: "#9CDCFE" },
98582
- "variable.builtin": { fg: "#9CDCFE" },
98583
- constant: { fg: "#4FC1FF" },
98584
- "constant.builtin": { fg: "#569CD6" },
98585
- property: { fg: "#9CDCFE" },
98586
- operator: { fg: "#D4D4D4" },
98587
- "punctuation.delimiter": { fg: "#D4D4D4" },
98588
- "punctuation.bracket": { fg: "#D4D4D4" },
98589
- boolean: { fg: "#569CD6" },
98590
- label: { fg: "#DCDCAA" },
98591
- "markup.heading": { fg: "#569CD6", bold: true },
98565
+ default: { fg: "#E4E4E7" },
98566
+ keyword: { fg: "#C792EA" },
98567
+ "keyword.control": { fg: "#C792EA" },
98568
+ "keyword.import": { fg: "#C792EA" },
98569
+ "keyword.function": { fg: "#F59E0B" },
98570
+ string: { fg: "#FBBF24" },
98571
+ "string.special": { fg: "#FBBF24" },
98572
+ number: { fg: "#A78BFA" },
98573
+ "number.float": { fg: "#A78BFA" },
98574
+ comment: { fg: "#78716C", italic: true },
98575
+ function: { fg: "#4ADE80" },
98576
+ "function.call": { fg: "#4ADE80" },
98577
+ "function.method": { fg: "#4ADE80" },
98578
+ type: { fg: "#22D3EE" },
98579
+ "type.builtin": { fg: "#22D3EE" },
98580
+ variable: { fg: "#F5F5F4" },
98581
+ "variable.parameter": { fg: "#FDBA74" },
98582
+ "variable.builtin": { fg: "#F5F5F4" },
98583
+ constant: { fg: "#A78BFA" },
98584
+ "constant.builtin": { fg: "#C792EA" },
98585
+ property: { fg: "#F5F5F4" },
98586
+ operator: { fg: "#F472B6" },
98587
+ "punctuation.delimiter": { fg: "#A1A1AA" },
98588
+ "punctuation.bracket": { fg: "#A1A1AA" },
98589
+ boolean: { fg: "#A78BFA" },
98590
+ label: { fg: "#FDBA74" },
98591
+ "markup.heading": { fg: "#C792EA", bold: true },
98592
98592
  "markup.italic": { italic: true },
98593
- "markup.strong": { fg: "#DCDCAA", bold: true },
98594
- "markup.strikethrough": { fg: "#888888", italic: true, dim: true },
98595
- "markup.raw": { fg: "#CE9178" },
98596
- "markup.link": { fg: "#569CD6", underline: true },
98597
- "markup.link.label": { fg: "#569CD6", underline: true },
98598
- "markup.link.url": { fg: "#4FC1FF" },
98599
- "markup.list": { fg: "#569CD6" },
98600
- "markup.quote": { fg: "#6A9955", italic: true },
98601
- conceal: { fg: "#555555" }
98593
+ "markup.strong": { fg: "#C792EA", bold: true },
98594
+ "markup.strikethrough": { fg: "#78716C", italic: true, dim: true },
98595
+ "markup.raw": { fg: "#FBBF24" },
98596
+ "markup.link": { fg: "#22D3EE", underline: true },
98597
+ "markup.link.label": { fg: "#22D3EE", underline: true },
98598
+ "markup.link.url": { fg: "#A78BFA" },
98599
+ "markup.list": { fg: "#F472B6" },
98600
+ "markup.quote": { fg: "#FBBF24", italic: true },
98601
+ conceal: { fg: "#3F3F46" }
98602
98602
  });
98603
98603
  function formatToolName(name23) {
98604
98604
  return name23.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (c) => c.toUpperCase());
@@ -98617,6 +98617,29 @@ function isBashTool(tc) {
98617
98617
  const name23 = tc.type === "dynamic-tool" ? tc.toolName : tc.type.slice("tool-".length);
98618
98618
  return name23 === "bash";
98619
98619
  }
98620
+ function isEditFileTool(tc) {
98621
+ const name23 = tc.type === "dynamic-tool" ? tc.toolName : tc.type.slice("tool-".length);
98622
+ return name23 === "editFile";
98623
+ }
98624
+ function isWriteFileTool(tc) {
98625
+ const name23 = tc.type === "dynamic-tool" ? tc.toolName : tc.type.slice("tool-".length);
98626
+ return name23 === "writeFile";
98627
+ }
98628
+ function buildDiff(oldStr, newStr) {
98629
+ const oldLines = oldStr.split(`
98630
+ `);
98631
+ const newLines = newStr.split(`
98632
+ `);
98633
+ const lines = [];
98634
+ for (const line of oldLines) {
98635
+ lines.push(`- ${line}`);
98636
+ }
98637
+ for (const line of newLines) {
98638
+ lines.push(`+ ${line}`);
98639
+ }
98640
+ return lines.join(`
98641
+ `);
98642
+ }
98620
98643
  function isToolRunning(tc) {
98621
98644
  return tc.state !== "output-available" && tc.state !== "output-error";
98622
98645
  }
@@ -98638,7 +98661,6 @@ function renderToolCall(tc, colors, j2, renderKey) {
98638
98661
  }, undefined, false, undefined, this),
98639
98662
  " ",
98640
98663
  command,
98641
- running ? "" : "",
98642
98664
  tc.state === "output-error" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("em", {
98643
98665
  fg: colors.error,
98644
98666
  children: [
@@ -98652,6 +98674,88 @@ function renderToolCall(tc, colors, j2, renderKey) {
98652
98674
  }, undefined, true, undefined, this)
98653
98675
  }, renderKey, false, undefined, this);
98654
98676
  }
98677
+ if (isEditFileTool(tc)) {
98678
+ const input = tc.input;
98679
+ const path5 = input?.path ?? "";
98680
+ const oldString = input?.oldString ?? "";
98681
+ const newString = input?.newString ?? "";
98682
+ const diff = buildDiff(oldString, newString);
98683
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
98684
+ width: "100%",
98685
+ flexDirection: "column",
98686
+ children: [
98687
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
98688
+ attributes: TextAttributes.DIM,
98689
+ children: [
98690
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("em", {
98691
+ fg: colors.info,
98692
+ children: "Edit:"
98693
+ }, undefined, false, undefined, this),
98694
+ " ",
98695
+ path5,
98696
+ running ? "..." : done ? " \u2713" : "",
98697
+ tc.state === "output-error" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("em", {
98698
+ fg: colors.error,
98699
+ children: [
98700
+ " ",
98701
+ "\u2716",
98702
+ " ",
98703
+ tc.errorText
98704
+ ]
98705
+ }, undefined, true, undefined, this) : null
98706
+ ]
98707
+ }, undefined, true, undefined, this),
98708
+ done && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
98709
+ paddingX: 2,
98710
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("markdown", {
98711
+ content: "```diff\n" + diff + "\n```",
98712
+ syntaxStyle: globalSyntaxStyle,
98713
+ concealCode: true
98714
+ }, undefined, false, undefined, this)
98715
+ }, undefined, false, undefined, this)
98716
+ ]
98717
+ }, renderKey, true, undefined, this);
98718
+ }
98719
+ if (isWriteFileTool(tc)) {
98720
+ const input = tc.input;
98721
+ const path5 = input?.path ?? "";
98722
+ const content = input?.content ?? "";
98723
+ return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
98724
+ width: "100%",
98725
+ flexDirection: "column",
98726
+ children: [
98727
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
98728
+ attributes: TextAttributes.DIM,
98729
+ children: [
98730
+ /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("em", {
98731
+ fg: colors.info,
98732
+ children: "Write:"
98733
+ }, undefined, false, undefined, this),
98734
+ " ",
98735
+ path5,
98736
+ running ? "..." : done ? " \u2713" : "",
98737
+ tc.state === "output-error" ? /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("em", {
98738
+ fg: colors.error,
98739
+ children: [
98740
+ " ",
98741
+ "\u2716",
98742
+ " ",
98743
+ tc.errorText
98744
+ ]
98745
+ }, undefined, true, undefined, this) : null
98746
+ ]
98747
+ }, undefined, true, undefined, this),
98748
+ done && /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
98749
+ paddingX: 2,
98750
+ children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("markdown", {
98751
+ content: "```\n" + content + "\n```",
98752
+ syntaxStyle: globalSyntaxStyle,
98753
+ concealCode: true
98754
+ }, undefined, false, undefined, this)
98755
+ }, undefined, false, undefined, this)
98756
+ ]
98757
+ }, renderKey, true, undefined, this);
98758
+ }
98655
98759
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
98656
98760
  width: "100%",
98657
98761
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
@@ -106495,7 +106599,7 @@ function App() {
106495
106599
  }, undefined, false, undefined, this);
106496
106600
  }
106497
106601
  setCurrentVersion(package_default2.version);
106498
- checkForUpdate(package_default2.version);
106602
+ await checkForUpdate(package_default2.version);
106499
106603
  var renderer = await createCliRenderer({
106500
106604
  targetFps: 60,
106501
106605
  exitOnCtrlC: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupacode",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "AI-powered terminal coding assistant",
5
5
  "type": "module",
6
6
  "bin": {