@shunagent/shun 0.1.148 → 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.
- package/README.md +2 -6
- package/dist/cli.js +32 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,10 +19,7 @@ shun
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Alternatively, use `pnpm add -g @shunagent/shun` or `bun add -g @shunagent/shun`.
|
|
22
|
-
|
|
23
|
-
components download automatically when first needed and are reused from your
|
|
24
|
-
local Shun profile. Basic conversations do not install these components.
|
|
25
|
-
Standalone Browser Preview also downloads its testing browser on first use.
|
|
22
|
+
Shun TUI runs independently of Shun Desktop.
|
|
26
23
|
|
|
27
24
|
## Start a conversation
|
|
28
25
|
|
|
@@ -43,8 +40,7 @@ menu. `/connect` adds a connection, `/providers` manages connections, and `/mode
|
|
|
43
40
|
chooses a model. `/new` starts a new conversation; `/resume` opens history.
|
|
44
41
|
|
|
45
42
|
Answers stream as they arrive. Markdown and tables render in the terminal.
|
|
46
|
-
Click an activity row to expand its details.
|
|
47
|
-
24; scroll up and click **Show earlier messages** to read more.
|
|
43
|
+
Click an activity row to expand its details. Scroll up and click **Show earlier messages** to read conversation history.
|
|
48
44
|
|
|
49
45
|
Ctrl+C stops the current generation, cancels an open menu, or returns from a
|
|
50
46
|
finished conversation to the welcome screen. At the welcome screen, press it
|
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.
|
|
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) {
|
|
@@ -7852,6 +7866,21 @@ ${output}` : ""}`;
|
|
|
7852
7866
|
}
|
|
7853
7867
|
return rows.join("\n");
|
|
7854
7868
|
}
|
|
7869
|
+
function toolSummary(tools, width = 80) {
|
|
7870
|
+
const titles = tools.map((tool) => {
|
|
7871
|
+
const product = productToolPresentation(tool);
|
|
7872
|
+
if (product) return product.title;
|
|
7873
|
+
const running = tool.state === "running", failed = tool.state === "error";
|
|
7874
|
+
if (tool.name === "web_search") return running ? "Searching web" : failed ? "Web search failed" : "Searched web";
|
|
7875
|
+
if (tool.name === "web_read") return running ? "Reading web page" : failed ? "Web page read failed" : "Read web page";
|
|
7876
|
+
if (shellCommand(tool)) return running ? "Running command" : failed ? "Command failed" : "Command completed";
|
|
7877
|
+
return hostToolLabel(tool);
|
|
7878
|
+
});
|
|
7879
|
+
const unique = [...new Set(titles)];
|
|
7880
|
+
const summary = unique.slice(-2).join(" · ");
|
|
7881
|
+
const more = unique.length > 2 ? ` · +${unique.length - 2} more` : "";
|
|
7882
|
+
return clean(truncateToWidth(clean(summary + more).replace(/\s+/g, " "), Math.max(12, width - 6), "…"));
|
|
7883
|
+
}
|
|
7855
7884
|
const require$1 = createRequire(import.meta.url);
|
|
7856
7885
|
async function clipboardImage(load = nativeClipboard) {
|
|
7857
7886
|
if (process.env.SSH_CONNECTION || process.env.SSH_TTY) throw Error("This remote terminal cannot read your local clipboard. Attach a file with /attach, or run Shun locally.");
|
|
@@ -8141,7 +8170,7 @@ async function runTui(call, options = {}) {
|
|
|
8141
8170
|
row += heading.render(width).length;
|
|
8142
8171
|
if (turn.tools?.length) {
|
|
8143
8172
|
const expanded = expandedTurns.has(turn.id);
|
|
8144
|
-
const toggle = new Text(dim(`${expanded ? "▾" : "▸"} ${turn.tools
|
|
8173
|
+
const toggle = new Text(dim(`${expanded ? "▾" : "▸"} ${toolSummary(turn.tools, width)}`), 1, 0);
|
|
8145
8174
|
feed.addChild(toggle);
|
|
8146
8175
|
const size = toggle.render(width).length;
|
|
8147
8176
|
toolRows.push({ start: row, end: row + size, id: turn.id });
|
|
@@ -8742,7 +8771,7 @@ ${activeRun ? "Task continues running in Shun.\n" : ""}Resume this conversation:
|
|
|
8742
8771
|
process.off("SIGTERM", onSignal);
|
|
8743
8772
|
process.off("SIGINT", onSignal);
|
|
8744
8773
|
}
|
|
8745
|
-
const version = "0.1.
|
|
8774
|
+
const version = "0.1.152";
|
|
8746
8775
|
const args = process.argv.slice(2);
|
|
8747
8776
|
async function main() {
|
|
8748
8777
|
if (args.includes("--version") || args.includes("-v")) {
|
package/package.json
CHANGED