@hasna/assistants 0.6.18 → 0.6.19

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
@@ -38775,6 +38775,10 @@ class SchedulerTool {
38775
38775
  type: "string",
38776
38776
  description: "Optional description for this schedule"
38777
38777
  },
38778
+ sessionId: {
38779
+ type: "string",
38780
+ description: "Session id to scope the schedule to"
38781
+ },
38778
38782
  id: {
38779
38783
  type: "string",
38780
38784
  description: "Schedule id (for delete/pause/resume)"
@@ -38819,6 +38823,7 @@ class SchedulerTool {
38819
38823
  createdAt: now2,
38820
38824
  updatedAt: now2,
38821
38825
  createdBy: "agent",
38826
+ sessionId: typeof input.sessionId === "string" ? input.sessionId : undefined,
38822
38827
  command,
38823
38828
  description: input.description,
38824
38829
  status: "active",
@@ -40862,6 +40867,7 @@ Keep it concise but comprehensive.`
40862
40867
  createdAt: now2,
40863
40868
  updatedAt: now2,
40864
40869
  createdBy: "user",
40870
+ sessionId: context.sessionId,
40865
40871
  command,
40866
40872
  status: "active",
40867
40873
  schedule: {
@@ -43036,6 +43042,12 @@ class AgentLoop {
43036
43042
  toolCall.input.cwd = this.cwd;
43037
43043
  }
43038
43044
  }
43045
+ if (toolCall.name === "schedule") {
43046
+ const input = toolCall.input;
43047
+ if (input.sessionId === undefined) {
43048
+ input.sessionId = this.sessionId;
43049
+ }
43050
+ }
43039
43051
  if (preHookResult?.continue === false || preHookResult?.permissionDecision === "deny") {
43040
43052
  const blockedResult = {
43041
43053
  toolCallId: toolCall.id,
@@ -43461,6 +43473,9 @@ ${effects.message}
43461
43473
  const now2 = Date.now();
43462
43474
  const due = await getDueSchedules(this.cwd, now2);
43463
43475
  for (const schedule of due) {
43476
+ if (schedule.sessionId && schedule.sessionId !== this.sessionId) {
43477
+ continue;
43478
+ }
43464
43479
  const locked = await acquireScheduleLock(this.cwd, schedule.id, this.sessionId);
43465
43480
  if (!locked)
43466
43481
  continue;
@@ -43490,7 +43505,7 @@ ${effects.message}
43490
43505
  if (!schedule)
43491
43506
  break;
43492
43507
  const current = await readSchedule(this.cwd, schedule.id);
43493
- if (!current || current.status !== "active" || !current.nextRunAt || current.nextRunAt > Date.now()) {
43508
+ if (!current || current.status !== "active" || !current.nextRunAt || current.nextRunAt > Date.now() || current.sessionId && current.sessionId !== this.sessionId) {
43494
43509
  await releaseScheduleLock(this.cwd, schedule.id, this.sessionId);
43495
43510
  continue;
43496
43511
  }
@@ -44513,15 +44528,23 @@ function Input({ onSubmit, isProcessing, queueLength = 0, commands, skills = []
44513
44528
  }, [value, autocompleteMode, skills]);
44514
44529
  const autocompleteItems = autocompleteMode === "skill" ? filteredSkills : filteredCommands;
44515
44530
  use_input_default((input, key) => {
44516
- if (key.tab && autocompleteItems.length > 0) {
44517
- const selected = autocompleteItems[selectedIndex] || autocompleteItems[0];
44518
- if (autocompleteMode === "skill") {
44519
- setValue("$" + selected.name + " ");
44520
- } else {
44521
- setValue(selected.name + " ");
44531
+ if (key.tab) {
44532
+ if (autocompleteItems.length > 0) {
44533
+ const selected = autocompleteItems[selectedIndex] || autocompleteItems[0];
44534
+ if (autocompleteMode === "skill") {
44535
+ setValue("$" + selected.name + " ");
44536
+ } else {
44537
+ setValue(selected.name + " ");
44538
+ }
44539
+ setSelectedIndex(0);
44540
+ return;
44541
+ }
44542
+ if (value.trim()) {
44543
+ onSubmit(value, "queue");
44544
+ setValue("");
44545
+ setSelectedIndex(0);
44546
+ return;
44522
44547
  }
44523
- setSelectedIndex(0);
44524
- return;
44525
44548
  }
44526
44549
  if (autocompleteItems.length > 0) {
44527
44550
  if (key.downArrow) {
@@ -44555,18 +44578,14 @@ function Input({ onSubmit, isProcessing, queueLength = 0, commands, skills = []
44555
44578
  if (autocompleteMode === "command" && filteredCommands.length > 0 && !submittedValue.includes(" ")) {
44556
44579
  const selected = filteredCommands[selectedIndex] || filteredCommands[0];
44557
44580
  if (selected) {
44558
- if (isProcessing) {
44559
- onSubmit(selected.name, "queue");
44560
- } else {
44561
- onSubmit(selected.name, "normal");
44562
- }
44581
+ onSubmit(selected.name, isProcessing ? "interrupt" : "normal");
44563
44582
  setValue("");
44564
44583
  setSelectedIndex(0);
44565
44584
  return;
44566
44585
  }
44567
44586
  }
44568
44587
  if (isProcessing) {
44569
- onSubmit(submittedValue, "queue");
44588
+ onSubmit(submittedValue, "interrupt");
44570
44589
  } else {
44571
44590
  onSubmit(submittedValue, "normal");
44572
44591
  }
@@ -44577,7 +44596,7 @@ function Input({ onSubmit, isProcessing, queueLength = 0, commands, skills = []
44577
44596
  let placeholder = "Type a message...";
44578
44597
  if (isProcessing) {
44579
44598
  prompt = "\u22EF";
44580
- placeholder = queueLength > 0 ? "Type to queue another..." : "Type to queue (Enter) or interrupt (Shift+Enter)...";
44599
+ placeholder = queueLength > 0 ? "Type to interrupt (Enter) or queue (Tab)..." : "Type to interrupt (Enter) or queue (Tab)...";
44581
44600
  }
44582
44601
  const truncateDescription = (desc, maxLen = 60) => {
44583
44602
  if (desc.length <= maxLen)
@@ -45618,7 +45637,6 @@ function MessageBubble({ message, queuedMessageIds }) {
45618
45637
  ]
45619
45638
  }, undefined, true, undefined, this),
45620
45639
  toolCalls.length > 0 && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
45621
- marginLeft: hasContent ? 2 : 0,
45622
45640
  marginTop: hasContent ? 1 : 0,
45623
45641
  children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ToolCallPanel, {
45624
45642
  toolCalls,
@@ -47085,7 +47103,7 @@ function App2({ cwd: cwd2, version }) {
47085
47103
  setShowSessionSelector(true);
47086
47104
  return;
47087
47105
  }
47088
- if (mode === "queue" || isProcessing && mode === "normal") {
47106
+ if (mode === "queue") {
47089
47107
  if (!activeSessionId)
47090
47108
  return;
47091
47109
  const queuedId = generateId();
@@ -47521,7 +47539,7 @@ function formatStreamEvent(chunk) {
47521
47539
 
47522
47540
  // packages/terminal/src/index.tsx
47523
47541
  var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
47524
- var VERSION3 = "0.6.18";
47542
+ var VERSION3 = "0.6.19";
47525
47543
  function parseArgs(argv) {
47526
47544
  const args = argv.slice(2);
47527
47545
  const options = {
@@ -47684,4 +47702,4 @@ if (options.print !== null) {
47684
47702
  });
47685
47703
  }
47686
47704
 
47687
- //# debugId=EED40350F624F85864756E2164756E21
47705
+ //# debugId=6BDD2D63CEF73C2464756E2164756E21