@shunagent/shun 0.1.152 → 0.1.155

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 +43 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -22,6 +22,9 @@ import { StringDecoder } from "node:string_decoder";
22
22
  import { createTwoFilesPatch } from "diff";
23
23
  import { truncateToWidth, stripTerminalSequences, Markdown, TuiMainScreen, ProcessTerminal, Container, Text, matchesKey, Editor, CombinedAutocompleteProvider, Spacer, SelectList, Input, Image } from "@earendil-works/pi-tui";
24
24
  const slashCommands = [
25
+ ["assistant", "Open your Shun assistant"],
26
+ ["activity", "Browse assistant task history"],
27
+ ["memory", "Review assistant memory"],
25
28
  ["help", "Show available commands"],
26
29
  ["connect", "Connect a model provider"],
27
30
  ["providers", "Manage model providers"],
@@ -196,6 +199,8 @@ function readProductToolPresentation(tool) {
196
199
  return backgroundPresentation(failed ? "Background output read failed" : "Read background output", input.until ? `until ${input.until}` : "");
197
200
  case "background_stop":
198
201
  return backgroundPresentation(failed ? "Background process stop failed" : "Stopped background process", backgroundTaskTarget(tool.output));
202
+ case "presentation_create":
203
+ return { title: failed ? "Presentation creation failed" : "Created presentation", detail: typeof input.output_path === "string" ? input.output_path.split(/[\\/]/).pop() || "" : "", kind: "skill" };
199
204
  case "skill_search":
200
205
  return skillPresentation(failed ? "Skill search failed" : "Searched installed Skills", input.query || "installed Skills");
201
206
  case "browser_debug":
@@ -283,6 +288,16 @@ function readProductToolPresentation(tool) {
283
288
  return { title: failed ? "Plugin tool discovery failed" : "Prepared plugin tools", detail: "", kind: "skill" };
284
289
  case "plugin_view_present":
285
290
  return { title: failed ? "Plugin view unavailable" : "Opened plugin view", detail: [input.plugin_id, input.view_id].filter(Boolean).join(" · "), kind: "skill" };
291
+ case "memory_search":
292
+ return { title: failed ? "Memory search failed" : "Read memory", detail: String(input.query || input.scope || ""), kind: "skill" };
293
+ case "memory_update":
294
+ return { title: failed ? "Memory update failed" : input.remove ? "Forgot memory" : "Updated memory", detail: "", kind: "skill" };
295
+ case "assistant_task_start":
296
+ return { title: failed ? "Task could not start" : "Started task", detail: String(input.title || ""), kind: "background" };
297
+ case "assistant_task_read":
298
+ return { title: failed ? "Task could not be read" : "Read task activity", detail: "", kind: "background" };
299
+ case "assistant_publish":
300
+ return { title: failed ? "Update could not be delivered" : "Shared assistant update", detail: "", kind: "background" };
286
301
  case "schedule_create":
287
302
  return schedulePresentation(failed ? "Scheduled task creation failed" : "Created scheduled task", input.name || scheduleTriggerDetail(input));
288
303
  case "schedule_list":
@@ -2048,6 +2063,8 @@ function pythonImportModules(content) {
2048
2063
  }
2049
2064
  const pythonDistributionAliases = {
2050
2065
  PIL: "Pillow",
2066
+ pptx: "python-pptx",
2067
+ docx: "python-docx",
2051
2068
  Crypto: "pycryptodome",
2052
2069
  bs4: "beautifulsoup4",
2053
2070
  cv2: "opencv-python",
@@ -2810,7 +2827,7 @@ async function generateTaskTitle(request2, signal, images = []) {
2810
2827
  }
2811
2828
  }
2812
2829
  function recentConversations(tasks) {
2813
- return tasks.filter((task) => !task.archivedAt).sort((a, b) => (b.lastActivityAt ?? b.updatedAt) - (a.lastActivityAt ?? a.updatedAt) || (b.createdAt || 0) - (a.createdAt || 0) || a.id.localeCompare(b.id));
2830
+ return tasks.filter((task) => !task.archivedAt && task.purpose !== "background").sort((a, b) => (b.lastActivityAt ?? b.updatedAt) - (a.lastActivityAt ?? a.updatedAt) || (b.createdAt || 0) - (a.createdAt || 0) || a.id.localeCompare(b.id));
2814
2831
  }
2815
2832
  const keys = ["providers", "providerId", "model", "endpoint", "apiKey", "contextWindow", "maxTokens"];
2816
2833
  function providerSettings(settings) {
@@ -7204,6 +7221,10 @@ class ShunHostService {
7204
7221
  async call(method, input = {}) {
7205
7222
  const desktop = this.desktop;
7206
7223
  const sharedDesktop = Boolean(desktop);
7224
+ if (["assistant.open", "assistant.overview", "assistant.memory.update"].includes(method)) {
7225
+ if (!desktop) throw Error("Open Shun Desktop to use your personal assistant. Your ordinary terminal tasks remain available.");
7226
+ return desktop(`conversation.${method}`, input);
7227
+ }
7207
7228
  if (sharedDesktop && method === "task.list" && !input.localOnly) {
7208
7229
  const local = await this.dispatch(method, input);
7209
7230
  const remote = await desktop("conversation.task.list").catch(() => []);
@@ -7772,7 +7793,7 @@ const clean$1 = (text2) => stripTerminalSequences(text2).replace(/[\x00-\x1f\x7f
7772
7793
  const accent = (text2) => `\x1B[38;5;205m${text2}\x1B[0m`;
7773
7794
  const muted = (text2) => `\x1B[2m${text2}\x1B[0m`;
7774
7795
  const bold = (text2) => `\x1B[1m${text2}\x1B[0m`;
7775
- const version$1 = "0.1.152";
7796
+ const version$1 = "0.1.155";
7776
7797
  class WelcomeHeader {
7777
7798
  state = { title: "", model: "", workspace: "", running: false, compact: false, ready: false };
7778
7799
  update(state) {
@@ -8428,6 +8449,25 @@ async function runTui(call, options = {}) {
8428
8449
  await configureModel(snapshot?.task.id);
8429
8450
  return;
8430
8451
  }
8452
+ if (name === "/activity" || name === "/memory") {
8453
+ const overview = await call("assistant.overview");
8454
+ if (name === "/activity") {
8455
+ if (!overview.runs.length) {
8456
+ notice("No assistant activity yet.");
8457
+ return;
8458
+ }
8459
+ const id = await choose("Assistant activity", overview.runs.map((run2) => ({ value: run2.id, label: run2.title, description: run2.status })));
8460
+ await selectTask(id);
8461
+ } else {
8462
+ notice(overview.memories.length ? overview.memories.map((memory) => `• ${memory.text}`).join("\n") : "No saved memories. Ask Shun to remember something.");
8463
+ }
8464
+ return;
8465
+ }
8466
+ if (name === "/assistant") {
8467
+ const task = await call("assistant.open");
8468
+ await selectTask(task.id);
8469
+ return;
8470
+ }
8431
8471
  if (name === "/new" || name === "/clear") {
8432
8472
  const workspace = argument === "--no-workspace" ? "" : argument ? resolve(argument) : snapshot?.task.workspace ?? options.workspace ?? "";
8433
8473
  const task = await call("task.create", { workspace });
@@ -8771,7 +8811,7 @@ ${activeRun ? "Task continues running in Shun.\n" : ""}Resume this conversation:
8771
8811
  process.off("SIGTERM", onSignal);
8772
8812
  process.off("SIGINT", onSignal);
8773
8813
  }
8774
- const version = "0.1.152";
8814
+ const version = "0.1.155";
8775
8815
  const args = process.argv.slice(2);
8776
8816
  async function main() {
8777
8817
  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.152"
63
+ "version": "0.1.155"
64
64
  }