@shunagent/shun 0.1.149 → 0.1.152

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/cli.js +16 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -92,6 +92,12 @@ function readProductToolPresentation(tool) {
92
92
  const skill = tool.name === "read" ? skillInstructionName(input.path) : "";
93
93
  if (skill) return skillPresentation(failed ? "Skill instructions read failed" : "Read Skill instructions", `${skill} · instructions`);
94
94
  switch (tool.name) {
95
+ case "web_history_read":
96
+ return {
97
+ title: failed ? "Earlier source read failed" : tool.state === "running" ? "Reading earlier source" : "Read earlier source",
98
+ detail: "This conversation",
99
+ kind: "web"
100
+ };
95
101
  case "github_repo_list":
96
102
  return {
97
103
  title: failed ? "GitHub repository listing failed" : "Listed GitHub repositories",
@@ -718,6 +724,7 @@ function capabilityPrompt(activeTools, context = {}) {
718
724
  if (activeTools.includes("edit")) {
719
725
  lines.push("Edit file is a one-shot atomic batch boundary. For one coherent requested change to one file, send all independent replacements together in one edits[] call. Do not split the file into sequential edit batches or run shell commands merely to count which replacements remain. Already-present replacements and ordinary whitespace-only drift are handled by the tool.");
720
726
  }
727
+ if (activeTools.includes("attachment_save")) lines.push("Use attachment_save to copy an uploaded attachment into a project as original bytes, preserving its format and transparency. Read or transform that saved project file normally.");
721
728
  if (activeTools.includes("attachment_read")) {
722
729
  lines.push("Files uploaded to this task are task-owned attachments, not workspace files, and their original source paths are deliberately unavailable. Discover their stable IDs with attachment_list and read them by ID with attachment_read. An image arrives whole and already at the resolution this session is shown, so when something inside it is too small to read — print on a label, a price tag, a dense table — read that part of it with region=[x, y, width, height], four fractions of the image from the top-left corner, instead of going after the file. That region read is the enlarged view, and it is the only one this session has. Never locate an upload with workspace read, bash, find, or filename search.");
723
730
  }
@@ -3093,6 +3100,13 @@ class AttachmentStore {
3093
3100
  if (bytes.length !== metadata.size || createHash("sha256").update(bytes).digest("hex") !== metadata.sha256) throw Error("Attachment content failed its integrity check.");
3094
3101
  return { metadata, bytes };
3095
3102
  }
3103
+ async save(taskId, attachmentId, destination) {
3104
+ const { metadata, bytes } = await this.read(taskId, attachmentId);
3105
+ const path = resolve(destination);
3106
+ await mkdir(dirname(path), { recursive: true });
3107
+ await writeFile(path, bytes, { flag: "wx" });
3108
+ return { path, size: metadata.size, sha256: metadata.sha256 };
3109
+ }
3096
3110
  /** What an attachment says about itself, without reading its content. */
3097
3111
  async describe(taskId, attachmentId) {
3098
3112
  let metadata;
@@ -7758,7 +7772,7 @@ const clean$1 = (text2) => stripTerminalSequences(text2).replace(/[\x00-\x1f\x7f
7758
7772
  const accent = (text2) => `\x1B[38;5;205m${text2}\x1B[0m`;
7759
7773
  const muted = (text2) => `\x1B[2m${text2}\x1B[0m`;
7760
7774
  const bold = (text2) => `\x1B[1m${text2}\x1B[0m`;
7761
- const version$1 = "0.1.149";
7775
+ const version$1 = "0.1.152";
7762
7776
  class WelcomeHeader {
7763
7777
  state = { title: "", model: "", workspace: "", running: false, compact: false, ready: false };
7764
7778
  update(state) {
@@ -8757,7 +8771,7 @@ ${activeRun ? "Task continues running in Shun.\n" : ""}Resume this conversation:
8757
8771
  process.off("SIGTERM", onSignal);
8758
8772
  process.off("SIGINT", onSignal);
8759
8773
  }
8760
- const version = "0.1.149";
8774
+ const version = "0.1.152";
8761
8775
  const args = process.argv.slice(2);
8762
8776
  async function main() {
8763
8777
  if (args.includes("--version") || args.includes("-v")) {
package/package.json CHANGED
@@ -60,5 +60,5 @@
60
60
  "mcp",
61
61
  "developer-tools"
62
62
  ],
63
- "version": "0.1.149"
63
+ "version": "0.1.152"
64
64
  }