flavor-code 1.4.1-beta.1 → 1.4.2

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.
@@ -7,6 +7,7 @@ function execFileNoThrow(file, args, options = {}) {
7
7
  return new Promise((resolve2) => {
8
8
  const child = execFile(file, args, {
9
9
  timeout: options.timeout,
10
+ maxBuffer: options.maxBuffer,
10
11
  cwd: options.useCwd === false ? void 0 : process.cwd(),
11
12
  env: options.env,
12
13
  encoding: "utf8",
@@ -4,7 +4,7 @@ import {
4
4
  message,
5
5
  redactErrorText,
6
6
  redactSecrets
7
- } from "./chunk-O2PC44GY.js";
7
+ } from "./chunk-QKND3FX7.js";
8
8
 
9
9
  // src/rpc/server.ts
10
10
  import { createInterface } from "readline";
@@ -37,7 +37,7 @@ import {
37
37
  resolveLanguage,
38
38
  setUsageSession,
39
39
  usageLogPath
40
- } from "./chunk-ZJCAQXA7.js";
40
+ } from "./chunk-B23V72YR.js";
41
41
 
42
42
  // src/models/types.ts
43
43
  function modelContentText(content) {
@@ -3357,6 +3357,7 @@ var MVP_COMMANDS = [
3357
3357
  "finish",
3358
3358
  "compact",
3359
3359
  "clear",
3360
+ "paste-image",
3360
3361
  "help",
3361
3362
  "exit",
3362
3363
  "audit",
@@ -3398,6 +3399,7 @@ var COMMAND_DESCRIPTIONS = {
3398
3399
  finish: "Complete this task and evaluate long-term memory",
3399
3400
  compact: "Compact the conversation context",
3400
3401
  clear: "Clear the transcript",
3402
+ "paste-image": "Attach the clipboard image explicitly",
3401
3403
  help: "Show available commands",
3402
3404
  exit: "Exit Flavor",
3403
3405
  audit: "Query tool failure audit log",
@@ -3444,7 +3446,7 @@ function parseSlashCommand(input, dynamicCommands = [], skillCommands = [], mana
3444
3446
  return { name: "skill", skill: name, prompt: args.join(" ") };
3445
3447
  }
3446
3448
  if (!MVP_COMMANDS.includes(name)) {
3447
- return { name: "unknown", input: rawName, suggestions: suggestionsFor(name) };
3449
+ return null;
3448
3450
  }
3449
3451
  if (name === "model") {
3450
3452
  const [role, modelId, ...extra] = args;
@@ -3578,24 +3580,6 @@ function validTarget(value) {
3578
3580
  function validText(value) {
3579
3581
  return value.length > 0 && Buffer.byteLength(value, "utf8") <= MAX_MESSAGE_BYTES;
3580
3582
  }
3581
- function suggestionsFor(input) {
3582
- return MVP_COMMANDS.map((command) => ({ command, distance: editDistance(input, command) })).filter(({ distance }) => distance <= Math.max(2, Math.floor(input.length / 3))).sort((left, right) => left.distance - right.distance || left.command.localeCompare(right.command)).slice(0, 3).map(({ command }) => command);
3583
- }
3584
- function editDistance(left, right) {
3585
- let previous = Array.from({ length: right.length + 1 }, (_, index) => index);
3586
- for (let leftIndex = 1; leftIndex <= left.length; leftIndex += 1) {
3587
- const current = [leftIndex];
3588
- for (let rightIndex = 1; rightIndex <= right.length; rightIndex += 1) {
3589
- current[rightIndex] = Math.min(
3590
- (current[rightIndex - 1] ?? 0) + 1,
3591
- (previous[rightIndex] ?? 0) + 1,
3592
- (previous[rightIndex - 1] ?? 0) + (left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1)
3593
- );
3594
- }
3595
- previous = current;
3596
- }
3597
- return previous[right.length] ?? left.length;
3598
- }
3599
3583
 
3600
3584
  // src/agent/message-queue.ts
3601
3585
  var AgentMessageQueue = class {
@@ -3696,7 +3680,7 @@ var HELP = [
3696
3680
  "/init /config /skills /plugins /hooks /tasks /doctor",
3697
3681
  "/memory /remember [type] <text> /forget <text-or-id> /forget-cold /finish",
3698
3682
  "/checkpoint [label] /tree /rewind <node> /unrevert /fork <node>",
3699
- "/compact /clear /help /exit",
3683
+ "/compact /clear /paste-image /help /exit",
3700
3684
  "/loop <goal> run a verified autonomous loop",
3701
3685
  "/goal <objective> run a goal pipeline with adversarial verification",
3702
3686
  "/commit [hint] draft a commit message for staged changes and commit",
@@ -4114,9 +4098,7 @@ Address this now (for example run the required verification or fix), then finish
4114
4098
  });
4115
4099
  }
4116
4100
  async #dispatch(command, signal) {
4117
- if (command.name === "unknown") {
4118
- this.#notice(command.suggestions.length ? `Unknown command /${command.input}. Try ${command.suggestions.map((item) => `/${item}`).join(", ")}.` : `Unknown command /${command.input}. Use /help to list commands.`);
4119
- } else if (command.name === "invalid") this.#notice(command.message);
4101
+ if (command.name === "invalid") this.#notice(command.message);
4120
4102
  else if (command.name === "model") {
4121
4103
  await this.#services.setModel(command.role, command.modelId);
4122
4104
  this.#notice(`${command.role} model set to ${command.modelId}.`);
@@ -4210,7 +4192,8 @@ Address this now (for example run the required verification or fix), then finish
4210
4192
  this.#notice(await this.#services.login());
4211
4193
  } else if (command.name === "logout") {
4212
4194
  this.#notice(await this.#services.logout());
4213
- } else if (command.name === "help") this.#notice(HELP);
4195
+ } else if (command.name === "paste-image") this.#notice("Use /paste-image in the interactive CLI to attach the clipboard image.");
4196
+ else if (command.name === "help") this.#notice(HELP);
4214
4197
  else if (command.name === "exit") this.#services.output({ type: "exit" });
4215
4198
  }
4216
4199
  #notice(message2) {
@@ -5,7 +5,7 @@ import {
5
5
  getGraphemeSegmenter,
6
6
  isEnvTruthy,
7
7
  logError
8
- } from "./chunk-ZJCAQXA7.js";
8
+ } from "./chunk-B23V72YR.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __require,
@@ -16901,6 +16901,9 @@ function shiftSelectionForFollow(s, dRow, minRow, maxRow) {
16901
16901
  function hasSelection(s) {
16902
16902
  return s.anchor !== null && s.focus !== null;
16903
16903
  }
16904
+ function shouldCopySelectionOnRelease(wasDragging, selection, platform = process.platform) {
16905
+ return platform === "darwin" && wasDragging && !selection.isDragging && hasSelection(selection);
16906
+ }
16904
16907
  function selectionBounds(s) {
16905
16908
  if (!s.anchor || !s.focus) return null;
16906
16909
  return comparePoints(s.anchor, s.focus) <= 0 ? { start: s.anchor, end: s.focus } : { start: s.focus, end: s.anchor };
@@ -20282,6 +20285,7 @@ var Ink = class {
20282
20285
  // pass in onRender can read it and App.tsx can update it from mouse
20283
20286
  // events. Public so instances.get() callers can access.
20284
20287
  selection = createSelectionState();
20288
+ selectionWasDragging = false;
20285
20289
  // Search highlight query (alt-screen only). Setter below triggers
20286
20290
  // scheduleRender; applySearchHighlight in onRender inverts matching cells.
20287
20291
  searchHighlightQuery = "";
@@ -21046,8 +21050,14 @@ var Ink = class {
21046
21050
  return () => this.selectionListeners.delete(cb);
21047
21051
  }
21048
21052
  notifySelectionChange() {
21053
+ const copyOnRelease = shouldCopySelectionOnRelease(
21054
+ this.selectionWasDragging,
21055
+ this.selection
21056
+ );
21057
+ this.selectionWasDragging = this.selection.isDragging;
21049
21058
  this.onRender();
21050
21059
  for (const cb of this.selectionListeners) cb();
21060
+ if (copyOnRelease) this.copySelectionNoClear();
21051
21061
  }
21052
21062
  /**
21053
21063
  * Hit-test the rendered DOM tree at (col, row) and bubble a ClickEvent
@@ -10,8 +10,8 @@ import {
10
10
  useStdout,
11
11
  use_app_default,
12
12
  use_input_default
13
- } from "./chunk-VMQWXQEC.js";
14
- import "./chunk-ZJCAQXA7.js";
13
+ } from "./chunk-W2TIY6JY.js";
14
+ import "./chunk-B23V72YR.js";
15
15
  import "./chunk-S32JRDZK.js";
16
16
  export {
17
17
  AlternateScreen,
package/dist/cli-main.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module"; const require = createRequire(impor
3
3
  import {
4
4
  FlavorRpcServer,
5
5
  TraceRecorder
6
- } from "./chunk-FAORPP4F.js";
6
+ } from "./chunk-KMBDK4SN.js";
7
7
  import {
8
8
  staticTaskLines
9
9
  } from "./chunk-RAYH6K2H.js";
@@ -29,7 +29,7 @@ import {
29
29
  redactErrorText,
30
30
  runDoctor,
31
31
  runPalBroker
32
- } from "./chunk-O2PC44GY.js";
32
+ } from "./chunk-QKND3FX7.js";
33
33
  import {
34
34
  MEMORY_RESTART_EXIT_CODE
35
35
  } from "./chunk-N5MXHJKD.js";
@@ -45,7 +45,7 @@ import {
45
45
  import {
46
46
  gt,
47
47
  isValidVersion
48
- } from "./chunk-ZJCAQXA7.js";
48
+ } from "./chunk-B23V72YR.js";
49
49
  import "./chunk-S32JRDZK.js";
50
50
 
51
51
  // src/cli.tsx
@@ -919,9 +919,9 @@ async function runInteractiveCli(props) {
919
919
  const disposeUserTimingSweeper = installUiUserTimingSweeper();
920
920
  try {
921
921
  const [{ render, AlternateScreen }, { createElement }, { App }] = await Promise.all([
922
- import("./claude-ink-JZXNSAQS.js"),
922
+ import("./claude-ink-VQU3C5UL.js"),
923
923
  import("react"),
924
- import("./app-UKTPW3E6.js")
924
+ import("./app-4CUS3GEJ.js")
925
925
  ]);
926
926
  const instance = await render(createElement(
927
927
  AlternateScreen,
@@ -9299,6 +9299,7 @@ function execFileNoThrow(file, args, options = {}) {
9299
9299
  return new Promise((resolve44) => {
9300
9300
  const child = execFile(file, args, {
9301
9301
  timeout: options.timeout,
9302
+ maxBuffer: options.maxBuffer,
9302
9303
  cwd: options.useCwd === false ? void 0 : process.cwd(),
9303
9304
  env: options.env,
9304
9305
  encoding: "utf8",
@@ -22324,6 +22325,7 @@ var MVP_COMMANDS = [
22324
22325
  "finish",
22325
22326
  "compact",
22326
22327
  "clear",
22328
+ "paste-image",
22327
22329
  "help",
22328
22330
  "exit",
22329
22331
  "audit",
@@ -22370,7 +22372,7 @@ function parseSlashCommand(input, dynamicCommands = [], skillCommands = [], mana
22370
22372
  return { name: "skill", skill: name, prompt: args.join(" ") };
22371
22373
  }
22372
22374
  if (!MVP_COMMANDS.includes(name)) {
22373
- return { name: "unknown", input: rawName, suggestions: suggestionsFor(name) };
22375
+ return null;
22374
22376
  }
22375
22377
  if (name === "model") {
22376
22378
  const [role, modelId, ...extra] = args;
@@ -22504,24 +22506,6 @@ function validTarget(value) {
22504
22506
  function validText(value) {
22505
22507
  return value.length > 0 && Buffer.byteLength(value, "utf8") <= MAX_MESSAGE_BYTES;
22506
22508
  }
22507
- function suggestionsFor(input) {
22508
- return MVP_COMMANDS.map((command) => ({ command, distance: editDistance(input, command) })).filter(({ distance }) => distance <= Math.max(2, Math.floor(input.length / 3))).sort((left, right) => left.distance - right.distance || left.command.localeCompare(right.command)).slice(0, 3).map(({ command }) => command);
22509
- }
22510
- function editDistance(left, right) {
22511
- let previous = Array.from({ length: right.length + 1 }, (_, index) => index);
22512
- for (let leftIndex = 1; leftIndex <= left.length; leftIndex += 1) {
22513
- const current = [leftIndex];
22514
- for (let rightIndex = 1; rightIndex <= right.length; rightIndex += 1) {
22515
- current[rightIndex] = Math.min(
22516
- (current[rightIndex - 1] ?? 0) + 1,
22517
- (previous[rightIndex] ?? 0) + 1,
22518
- (previous[rightIndex - 1] ?? 0) + (left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1)
22519
- );
22520
- }
22521
- previous = current;
22522
- }
22523
- return previous[right.length] ?? left.length;
22524
- }
22525
22509
 
22526
22510
  // src/agent/message-queue.ts
22527
22511
  var AgentMessageQueue = class {
@@ -22622,7 +22606,7 @@ var HELP = [
22622
22606
  "/init /config /skills /plugins /hooks /tasks /doctor",
22623
22607
  "/memory /remember [type] <text> /forget <text-or-id> /forget-cold /finish",
22624
22608
  "/checkpoint [label] /tree /rewind <node> /unrevert /fork <node>",
22625
- "/compact /clear /help /exit",
22609
+ "/compact /clear /paste-image /help /exit",
22626
22610
  "/loop <goal> run a verified autonomous loop",
22627
22611
  "/goal <objective> run a goal pipeline with adversarial verification",
22628
22612
  "/commit [hint] draft a commit message for staged changes and commit",
@@ -23040,9 +23024,7 @@ Address this now (for example run the required verification or fix), then finish
23040
23024
  });
23041
23025
  }
23042
23026
  async #dispatch(command, signal) {
23043
- if (command.name === "unknown") {
23044
- this.#notice(command.suggestions.length ? `Unknown command /${command.input}. Try ${command.suggestions.map((item) => `/${item}`).join(", ")}.` : `Unknown command /${command.input}. Use /help to list commands.`);
23045
- } else if (command.name === "invalid") this.#notice(command.message);
23027
+ if (command.name === "invalid") this.#notice(command.message);
23046
23028
  else if (command.name === "model") {
23047
23029
  await this.#services.setModel(command.role, command.modelId);
23048
23030
  this.#notice(`${command.role} model set to ${command.modelId}.`);
@@ -23136,7 +23118,8 @@ Address this now (for example run the required verification or fix), then finish
23136
23118
  this.#notice(await this.#services.login());
23137
23119
  } else if (command.name === "logout") {
23138
23120
  this.#notice(await this.#services.logout());
23139
- } else if (command.name === "help") this.#notice(HELP);
23121
+ } else if (command.name === "paste-image") this.#notice("Use /paste-image in the interactive CLI to attach the clipboard image.");
23122
+ else if (command.name === "help") this.#notice(HELP);
23140
23123
  else if (command.name === "exit") this.#services.output({ type: "exit" });
23141
23124
  }
23142
23125
  #notice(message2) {