@hasna/assistants 1.1.13 → 1.1.14

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/dist/index.js CHANGED
@@ -71617,6 +71617,14 @@ Assistants:
71617
71617
  });
71618
71618
  await context.refreshIdentityContext?.();
71619
71619
  context.emit("text", `System prompt cleared for ${active.name}.
71620
+ `);
71621
+ context.emit("done");
71622
+ return { handled: true };
71623
+ }
71624
+ if (action === "update") {
71625
+ context.emit("text", `To update assistants, run:
71626
+ `);
71627
+ context.emit("text", ` bun install -g @hasna/assistants
71620
71628
  `);
71621
71629
  context.emit("done");
71622
71630
  return { handled: true };
@@ -71643,6 +71651,8 @@ Assistants:
71643
71651
  context.emit("text", `/assistants prompt [text] Get/set assistant system prompt
71644
71652
  `);
71645
71653
  context.emit("text", `/assistants prompt-clear Clear assistant system prompt
71654
+ `);
71655
+ context.emit("text", `/assistants update Update CLI via bun install -g
71646
71656
  `);
71647
71657
  context.emit("text", `/assistants help Show this help
71648
71658
  `);
@@ -74448,6 +74458,14 @@ Configure the external source with the URL and secret above.
74448
74458
  context.emit("text", `${result.success ? result.message : `Error: ${result.message}`}
74449
74459
  `);
74450
74460
  context.emit("done");
74461
+ if (activePerson && result.success) {
74462
+ return {
74463
+ handled: false,
74464
+ prompt: `[Channel Message] ${activePerson.name} posted in #${channel}: "${message}"
74465
+
74466
+ Please respond to this in the #${channel} channel using the channel_send tool. Be helpful and conversational.`
74467
+ };
74468
+ }
74451
74469
  return { handled: true };
74452
74470
  }
74453
74471
  if (subcommand === "read") {
@@ -79300,7 +79318,7 @@ ${repoUrl}/issues/new
79300
79318
  context.setProjectContext(projectContext);
79301
79319
  }
79302
79320
  }
79303
- var VERSION = "1.1.13";
79321
+ var VERSION = "1.1.14";
79304
79322
  var init_builtin = __esm(async () => {
79305
79323
  init_src2();
79306
79324
  init_store();
@@ -159042,7 +159060,7 @@ class ChannelsManager {
159042
159060
  return { success: false, message: `Channel #${channel.name} is archived.` };
159043
159061
  }
159044
159062
  if (!this.store.isMember(channel.id, senderId)) {
159045
- return { success: false, message: `${senderName} is not a member of #${channel.name}. Join first.` };
159063
+ this.store.addMember(channel.id, senderId, senderName, "member", "person");
159046
159064
  }
159047
159065
  const messageId = this.store.sendMessage(channel.id, senderId, senderName, content);
159048
159066
  return {
@@ -205109,7 +205127,7 @@ function formatRelativeTime5(isoDate) {
205109
205127
  return `${minutes}m ago`;
205110
205128
  return `${seconds}s ago`;
205111
205129
  }
205112
- function ChannelsPanel({ manager, onClose, activePersonId, activePersonName }) {
205130
+ function ChannelsPanel({ manager, onClose, activePersonId, activePersonName, onPersonMessage }) {
205113
205131
  const [mode, setMode] = import_react46.useState("list");
205114
205132
  const [channels2, setChannels] = import_react46.useState([]);
205115
205133
  const [selectedIndex, setSelectedIndex] = import_react46.useState(0);
@@ -205393,11 +205411,15 @@ function ChannelsPanel({ manager, onClose, activePersonId, activePersonName }) {
205393
205411
  onChange: setChatInput,
205394
205412
  onSubmit: () => {
205395
205413
  if (chatInput.trim()) {
205396
- const result = activePersonId && activePersonName ? manager.sendAs(selectedChannel.id, chatInput.trim(), activePersonId, activePersonName) : manager.send(selectedChannel.id, chatInput.trim());
205414
+ const msg = chatInput.trim();
205415
+ const result = activePersonId && activePersonName ? manager.sendAs(selectedChannel.id, msg, activePersonId, activePersonName) : manager.send(selectedChannel.id, msg);
205397
205416
  if (result.success) {
205398
205417
  setChatInput("");
205399
205418
  const updated = manager.readMessages(selectedChannel.id, 50);
205400
205419
  setMessages(updated?.messages || []);
205420
+ if (activePersonId && activePersonName && onPersonMessage && selectedChannel) {
205421
+ onPersonMessage(selectedChannel.name, activePersonName, msg);
205422
+ }
205401
205423
  } else {
205402
205424
  setStatusMessage(`Error: ${result.message}`);
205403
205425
  }
@@ -218170,6 +218192,30 @@ function App2({ cwd: cwd2, version: version3 }) {
218170
218192
  }
218171
218193
  return;
218172
218194
  }
218195
+ if (cmdName === "assistants" && cmdArgs) {
218196
+ const [subcommand] = cmdArgs.split(/\s+/);
218197
+ if (subcommand?.toLowerCase() === "update") {
218198
+ const shellCommand = "bun install -g @hasna/assistants";
218199
+ const shellCwd = activeSession?.cwd || cwd2;
218200
+ setError(null);
218201
+ try {
218202
+ const result = await runShellCommand(shellCommand, shellCwd);
218203
+ setMessages((prev) => [
218204
+ ...prev,
218205
+ {
218206
+ id: generateId(),
218207
+ role: "assistant",
218208
+ content: formatShellResult(shellCommand, result),
218209
+ timestamp: now()
218210
+ }
218211
+ ]);
218212
+ } catch (err) {
218213
+ const message = err instanceof Error ? err.message : String(err);
218214
+ setError(message);
218215
+ }
218216
+ return;
218217
+ }
218218
+ }
218173
218219
  if (cmdName === "assistants" && !cmdArgs) {
218174
218220
  setShowAssistantsPanel(true);
218175
218221
  return;
@@ -219576,7 +219622,14 @@ When done, report the result.`);
219576
219622
  manager: channelsManager,
219577
219623
  onClose: () => setShowChannelsPanel(false),
219578
219624
  activePersonId: activeSession?.client.getPeopleManager?.()?.getActivePersonId?.() || undefined,
219579
- activePersonName: activeSession?.client.getPeopleManager?.()?.getActivePerson?.()?.name || undefined
219625
+ activePersonName: activeSession?.client.getPeopleManager?.()?.getActivePerson?.()?.name || undefined,
219626
+ onPersonMessage: (channelName, personName, message) => {
219627
+ setShowChannelsPanel(false);
219628
+ const prompt = `[Channel Message] ${personName} posted in #${channelName}: "${message}"
219629
+
219630
+ Please respond to this in the #${channelName} channel using the channel_send tool. Be helpful and conversational.`;
219631
+ activeSession?.client.send(prompt);
219632
+ }
219580
219633
  }, undefined, false, undefined, this);
219581
219634
  }
219582
219635
  if (showPeoplePanel) {
@@ -220367,7 +220420,7 @@ Interactive Mode:
220367
220420
  // packages/terminal/src/index.tsx
220368
220421
  var jsx_dev_runtime44 = __toESM(require_jsx_dev_runtime(), 1);
220369
220422
  setRuntime(bunRuntime);
220370
- var VERSION4 = "1.1.13";
220423
+ var VERSION4 = "1.1.14";
220371
220424
  var SYNC_START = "\x1B[?2026h";
220372
220425
  var SYNC_END = "\x1B[?2026l";
220373
220426
  function enableSynchronizedOutput() {
@@ -220507,4 +220560,4 @@ export {
220507
220560
  main
220508
220561
  };
220509
220562
 
220510
- //# debugId=1CAB81672590576764756E2164756E21
220563
+ //# debugId=0560D59943D0C69864756E2164756E21