@hasna/assistants 1.1.68 → 1.1.69

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
@@ -11235,8 +11235,35 @@ var init_connector = __esm(async () => {
11235
11235
  }
11236
11236
  } catch {}
11237
11237
  }
11238
+ const connectorsDir = join7(baseCwd, ".connectors");
11239
+ try {
11240
+ const entries = readdirSync3(connectorsDir);
11241
+ for (const entry of entries) {
11242
+ if (!entry.startsWith("connect-"))
11243
+ continue;
11244
+ const name = entry.replace("connect-", "");
11245
+ if (name && !name.includes(".")) {
11246
+ connectorNames.add(name);
11247
+ }
11248
+ }
11249
+ } catch {}
11238
11250
  return Array.from(connectorNames);
11239
11251
  }
11252
+ async ensureConnectorBuilt(connectorDir) {
11253
+ const binPath = join7(connectorDir, "bin", "index.js");
11254
+ if (existsSync6(binPath))
11255
+ return true;
11256
+ const pkgPath = join7(connectorDir, "package.json");
11257
+ if (!existsSync6(pkgPath))
11258
+ return false;
11259
+ try {
11260
+ const runtime = getRuntime();
11261
+ await runtime.shell`cd ${connectorDir} && bun install --silent && bun run build`.quiet().nothrow();
11262
+ return existsSync6(binPath);
11263
+ } catch {
11264
+ return false;
11265
+ }
11266
+ }
11240
11267
  fastDiscover(connectorNames) {
11241
11268
  this.connectors.clear();
11242
11269
  if (ConnectorBridge.cache.size > 0) {
@@ -11367,6 +11394,15 @@ var init_connector = __esm(async () => {
11367
11394
  }
11368
11395
  }
11369
11396
  async resolveConnectorCli(name) {
11397
+ const baseCwd = this.cwd || process.cwd();
11398
+ const connectorDir = join7(baseCwd, ".connectors", `connect-${name}`);
11399
+ const connectorBin = join7(connectorDir, "bin", "index.js");
11400
+ if (existsSync6(join7(connectorDir, "package.json"))) {
11401
+ const built = await this.ensureConnectorBuilt(connectorDir);
11402
+ if (built && existsSync6(connectorBin)) {
11403
+ return connectorBin;
11404
+ }
11405
+ }
11370
11406
  const base = `connect-${name}`;
11371
11407
  const candidates = [base];
11372
11408
  const extCandidates = [".exe", ".cmd", ".bat", ".ps1"];
@@ -89205,7 +89241,7 @@ Not a git repository or git not available.
89205
89241
  context.setProjectContext(projectContext);
89206
89242
  }
89207
89243
  }
89208
- var VERSION2 = "1.1.68";
89244
+ var VERSION2 = "1.1.69";
89209
89245
  var init_builtin = __esm(async () => {
89210
89246
  init_src2();
89211
89247
  init_context3();
@@ -233829,6 +233865,11 @@ var Input = import_react30.default.forwardRef(function Input2({
233829
233865
  }
233830
233866
  if (!isAskingUser) {
233831
233867
  if (key.tab) {
233868
+ if (isProcessing && value.trim()) {
233869
+ onSubmit(value, "queue");
233870
+ setValueAndCursor("");
233871
+ return;
233872
+ }
233832
233873
  if (autocompleteItems.length > 0) {
233833
233874
  const selected = autocompleteItems[selectedIndex] || autocompleteItems[0];
233834
233875
  if (autocompleteMode === "file") {
@@ -233842,11 +233883,6 @@ var Input = import_react30.default.forwardRef(function Input2({
233842
233883
  }
233843
233884
  return;
233844
233885
  }
233845
- if (isProcessing && value.trim()) {
233846
- onSubmit(value, "queue");
233847
- setValueAndCursor("");
233848
- return;
233849
- }
233850
233886
  }
233851
233887
  if (autocompleteItems.length > 0 && !value.includes(`
233852
233888
  `)) {
@@ -264798,6 +264834,7 @@ function App2({ cwd: cwd3, version: version4 }) {
264798
264834
  const [isProcessing, setIsProcessing] = import_react86.useState(false);
264799
264835
  const [error4, setError] = import_react86.useState(null);
264800
264836
  const [messageQueue, setMessageQueue] = import_react86.useState([]);
264837
+ const messageQueueRef = import_react86.useRef([]);
264801
264838
  const [inlinePending, setInlinePending] = import_react86.useState([]);
264802
264839
  const [activityLog, setActivityLog] = import_react86.useState([]);
264803
264840
  const [tokenUsage, setTokenUsage] = import_react86.useState();
@@ -266295,12 +266332,15 @@ function App2({ cwd: cwd3, version: version4 }) {
266295
266332
  }, [registry3]);
266296
266333
  const processQueue = import_react86.useCallback(async () => {
266297
266334
  const activeSession2 = registryRef.current.getActiveSession();
266298
- if (!activeSession2 || !activeSessionId)
266335
+ if (!activeSessionId || !activeSession2)
266299
266336
  return;
266300
- const { next: nextMessage, remaining } = takeNextQueuedMessage(messageQueue, activeSessionId);
266337
+ const currentQueue = messageQueueRef.current;
266338
+ const { next: nextMessage } = takeNextQueuedMessage(currentQueue, activeSessionId);
266301
266339
  if (!nextMessage)
266302
266340
  return;
266303
- setMessageQueue(remaining);
266341
+ setMessageQueue((prev) => prev.filter((msg) => msg.id !== nextMessage.id));
266342
+ setInlinePending((prev) => prev.filter((msg) => msg.sessionId !== activeSessionId));
266343
+ pendingSendsRef.current = pendingSendsRef.current.filter((entry) => entry.sessionId !== activeSessionId);
266304
266344
  const userMessage = {
266305
266345
  id: nextMessage.id,
266306
266346
  role: "user",
@@ -266339,7 +266379,7 @@ function App2({ cwd: cwd3, version: version4 }) {
266339
266379
  registryRef.current.setProcessing(activeSession2.id, false);
266340
266380
  setQueueFlushTrigger((prev) => prev + 1);
266341
266381
  }
266342
- }, [activeSessionId, clearPendingSend, messageQueue]);
266382
+ }, [activeSessionId, clearPendingSend]);
266343
266383
  const activeQueue = activeSessionId ? messageQueue.filter((msg) => msg.sessionId === activeSessionId) : [];
266344
266384
  const activeInline = activeSessionId ? inlinePending.filter((msg) => msg.sessionId === activeSessionId) : [];
266345
266385
  const queuedMessageIds = import_react86.useMemo(() => new Set(activeQueue.filter((msg) => msg.mode === "queued").map((msg) => msg.id)), [activeQueue]);
@@ -266402,6 +266442,9 @@ function App2({ cwd: cwd3, version: version4 }) {
266402
266442
  import_react86.useEffect(() => {
266403
266443
  hasPendingToolsRef.current = hasPendingTools;
266404
266444
  }, [hasPendingTools]);
266445
+ import_react86.useEffect(() => {
266446
+ messageQueueRef.current = messageQueue;
266447
+ }, [messageQueue]);
266405
266448
  const isBusy = isProcessing || hasPendingTools;
266406
266449
  const stopHint = isBusy && !activeAskQuestion ? "[esc] to stop" : null;
266407
266450
  const pttStatus = voiceState?.isTalking ? "talking" : pttTranscribing ? "transcribing" : pttRecording ? "recording" : null;
@@ -269404,7 +269447,7 @@ process.on("unhandledRejection", (reason) => {
269404
269447
  cleanup();
269405
269448
  process.exit(1);
269406
269449
  });
269407
- var VERSION4 = "1.1.68";
269450
+ var VERSION4 = "1.1.69";
269408
269451
  var SYNC_START = "\x1B[?2026h";
269409
269452
  var SYNC_END = "\x1B[?2026l";
269410
269453
  function enableSynchronizedOutput() {
@@ -269545,4 +269588,4 @@ export {
269545
269588
  main
269546
269589
  };
269547
269590
 
269548
- //# debugId=185AA4EF92CD31F064756E2164756E21
269591
+ //# debugId=1C9BBD6FD909EAE064756E2164756E21