@hasna/assistants 1.1.12 → 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.
@@ -1,5 +1,14 @@
1
1
  {
2
- "tasks": [],
2
+ "tasks": [
3
+ {
4
+ "id": "f14a3078-c44b-41ef-8e1d-ee37e4568c82",
5
+ "description": "Test task for Andrei",
6
+ "status": "pending",
7
+ "priority": "normal",
8
+ "createdAt": 1770542415358,
9
+ "isRecurringTemplate": false
10
+ }
11
+ ],
3
12
  "paused": false,
4
13
  "autoRun": true
5
14
  }
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.12";
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
  }
@@ -206818,6 +206840,26 @@ function OnboardingPanel({
206818
206840
  });
206819
206841
  const [enabledConnectors, setEnabledConnectors] = import_react51.useState(() => new Set(discoveredConnectors));
206820
206842
  const [connectorKeysNeeded] = import_react51.useState([]);
206843
+ const currentStepRef = import_react51.useRef(currentStep);
206844
+ currentStepRef.current = currentStep;
206845
+ const { setRawMode, isRawModeSupported } = use_stdin_default();
206846
+ import_react51.useEffect(() => {
206847
+ if (isRawModeSupported && setRawMode) {
206848
+ setRawMode(true);
206849
+ }
206850
+ const handleData = (data) => {
206851
+ const s6 = data.toString();
206852
+ if (s6 === "\x1B") {
206853
+ if (currentStepRef.current === "welcome") {
206854
+ onCancel();
206855
+ }
206856
+ }
206857
+ };
206858
+ process.stdin.on("data", handleData);
206859
+ return () => {
206860
+ process.stdin.removeListener("data", handleData);
206861
+ };
206862
+ }, [onCancel, isRawModeSupported, setRawMode]);
206821
206863
  const [connectorKeys, setConnectorKeys] = import_react51.useState({});
206822
206864
  const [connectorKeyIndex, setConnectorKeyIndex] = import_react51.useState(0);
206823
206865
  const [connectorKeyValue, setConnectorKeyValue] = import_react51.useState("");
@@ -218150,6 +218192,30 @@ function App2({ cwd: cwd2, version: version3 }) {
218150
218192
  }
218151
218193
  return;
218152
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
+ }
218153
218219
  if (cmdName === "assistants" && !cmdArgs) {
218154
218220
  setShowAssistantsPanel(true);
218155
218221
  return;
@@ -219556,7 +219622,14 @@ When done, report the result.`);
219556
219622
  manager: channelsManager,
219557
219623
  onClose: () => setShowChannelsPanel(false),
219558
219624
  activePersonId: activeSession?.client.getPeopleManager?.()?.getActivePersonId?.() || undefined,
219559
- 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
+ }
219560
219633
  }, undefined, false, undefined, this);
219561
219634
  }
219562
219635
  if (showPeoplePanel) {
@@ -220347,7 +220420,7 @@ Interactive Mode:
220347
220420
  // packages/terminal/src/index.tsx
220348
220421
  var jsx_dev_runtime44 = __toESM(require_jsx_dev_runtime(), 1);
220349
220422
  setRuntime(bunRuntime);
220350
- var VERSION4 = "1.1.12";
220423
+ var VERSION4 = "1.1.14";
220351
220424
  var SYNC_START = "\x1B[?2026h";
220352
220425
  var SYNC_END = "\x1B[?2026l";
220353
220426
  function enableSynchronizedOutput() {
@@ -220487,4 +220560,4 @@ export {
220487
220560
  main
220488
220561
  };
220489
220562
 
220490
- //# debugId=935038E737EE38BC64756E2164756E21
220563
+ //# debugId=0560D59943D0C69864756E2164756E21