@hasna/assistants 1.1.89 → 1.1.91
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 +51 -7
- package/dist/index.js.map +8 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112152,7 +112152,7 @@ ${defs.length} agent(s) total. Use /agents show <name> for details.
|
|
|
112152
112152
|
};
|
|
112153
112153
|
}
|
|
112154
112154
|
}
|
|
112155
|
-
var VERSION2 = "1.1.
|
|
112155
|
+
var VERSION2 = "1.1.91";
|
|
112156
112156
|
var init_builtin = __esm(async () => {
|
|
112157
112157
|
init_src2();
|
|
112158
112158
|
init_context3();
|
|
@@ -198158,7 +198158,8 @@ class EmbeddedClient {
|
|
|
198158
198158
|
messages: this.messages,
|
|
198159
198159
|
startedAt: this.startedAt,
|
|
198160
198160
|
updatedAt: new Date().toISOString(),
|
|
198161
|
-
cwd: this.cwd
|
|
198161
|
+
cwd: this.cwd,
|
|
198162
|
+
pendingQueue: this.messageQueue.length > 0 ? [...this.messageQueue] : undefined
|
|
198162
198163
|
});
|
|
198163
198164
|
}
|
|
198164
198165
|
onChunk(callback) {
|
|
@@ -198413,6 +198414,9 @@ class EmbeddedClient {
|
|
|
198413
198414
|
this.messageQueue = [];
|
|
198414
198415
|
this.logger.info("Message queue cleared");
|
|
198415
198416
|
}
|
|
198417
|
+
getPendingQueue() {
|
|
198418
|
+
return [...this.messageQueue];
|
|
198419
|
+
}
|
|
198416
198420
|
mergeMessages(contextMessages) {
|
|
198417
198421
|
if (contextMessages.length === 0)
|
|
198418
198422
|
return;
|
|
@@ -203734,6 +203738,7 @@ class SessionRegistry {
|
|
|
203734
203738
|
chunkBuffers = new Map;
|
|
203735
203739
|
chunkCallbacks = [];
|
|
203736
203740
|
errorCallbacks = [];
|
|
203741
|
+
labelChangeCallbacks = [];
|
|
203737
203742
|
clientFactory;
|
|
203738
203743
|
maxBufferedChunks = 2000;
|
|
203739
203744
|
store;
|
|
@@ -203768,6 +203773,9 @@ class SessionRegistry {
|
|
|
203768
203773
|
session.label = label;
|
|
203769
203774
|
session.updatedAt = Date.now();
|
|
203770
203775
|
this.persistSession(session);
|
|
203776
|
+
for (const callback of this.labelChangeCallbacks) {
|
|
203777
|
+
callback(sessionId, label);
|
|
203778
|
+
}
|
|
203771
203779
|
}
|
|
203772
203780
|
}
|
|
203773
203781
|
};
|
|
@@ -203823,6 +203831,9 @@ class SessionRegistry {
|
|
|
203823
203831
|
session.label = label;
|
|
203824
203832
|
session.updatedAt = Date.now();
|
|
203825
203833
|
this.persistSession(session);
|
|
203834
|
+
for (const callback of this.labelChangeCallbacks) {
|
|
203835
|
+
callback(sessionId, label);
|
|
203836
|
+
}
|
|
203826
203837
|
}
|
|
203827
203838
|
persistSession(session) {
|
|
203828
203839
|
this.store.save({
|
|
@@ -203988,6 +203999,9 @@ class SessionRegistry {
|
|
|
203988
203999
|
onError(callback) {
|
|
203989
204000
|
this.errorCallbacks.push(callback);
|
|
203990
204001
|
}
|
|
204002
|
+
onLabelChange(callback) {
|
|
204003
|
+
this.labelChangeCallbacks.push(callback);
|
|
204004
|
+
}
|
|
203991
204005
|
setProcessing(id, isProcessing) {
|
|
203992
204006
|
const session = this.sessions.get(id);
|
|
203993
204007
|
if (session) {
|
|
@@ -215890,9 +215904,11 @@ You are running in **autonomous mode**. You manage your own wakeup schedule.
|
|
|
215890
215904
|
if (!this.sessionAutoNamed && this.onSessionLabel && source === "user") {
|
|
215891
215905
|
this.sessionAutoNamed = true;
|
|
215892
215906
|
const bgModel = this.config?.backgroundModel;
|
|
215907
|
+
const sessionId = this.sessionId;
|
|
215908
|
+
const labelCallback = this.onSessionLabel;
|
|
215893
215909
|
generateSessionName(userMessage, { model: bgModel }).then((label) => {
|
|
215894
|
-
|
|
215895
|
-
}).catch(() => {});
|
|
215910
|
+
labelCallback?.(sessionId, label);
|
|
215911
|
+
}).catch((err) => {});
|
|
215896
215912
|
}
|
|
215897
215913
|
return { ok: true, summary: summary ? summary.slice(0, 200) : undefined };
|
|
215898
215914
|
} catch (error4) {
|
|
@@ -264868,7 +264884,7 @@ function Status({
|
|
|
264868
264884
|
const total = inputCost + outputCost + cacheReadCost + cacheWriteCost;
|
|
264869
264885
|
return total < 0.01 ? `$${total.toFixed(3)}` : `$${total.toFixed(2)}`;
|
|
264870
264886
|
}, [tokenUsage, modelId]);
|
|
264871
|
-
const sessionInfo = sessionCount && sessionCount > 1 && sessionIndex !== undefined ? `${sessionIndex
|
|
264887
|
+
const sessionInfo = sessionCount && sessionCount > 1 && sessionIndex !== undefined ? `${sessionIndex}/${sessionCount}` : "";
|
|
264872
264888
|
const bgIndicator = backgroundProcessingCount > 0 ? ` +${backgroundProcessingCount}` : "";
|
|
264873
264889
|
const voiceLabel = voiceState?.enabled ? voiceState.isTalking ? "talk" : voiceState.isListening ? "mic" : voiceState.isSpeaking ? "spk" : "voice" : "";
|
|
264874
264890
|
const heartbeatLabel = heartbeatState?.enabled ? heartbeatState.isStale ? "hb!" : "hb" : "";
|
|
@@ -292840,6 +292856,7 @@ function App2({ cwd: cwd3, version: version4, permissionMode: initialPermissionM
|
|
|
292840
292856
|
const [activeSessionId, setActiveSessionId] = import_react86.useState(null);
|
|
292841
292857
|
const [isInitializing, setIsInitializing] = import_react86.useState(true);
|
|
292842
292858
|
const [showSessionSelector, setShowSessionSelector] = import_react86.useState(false);
|
|
292859
|
+
const [sessionVersion, setSessionVersion] = import_react86.useState(0);
|
|
292843
292860
|
const [recoverableSessions, setRecoverableSessions] = import_react86.useState([]);
|
|
292844
292861
|
const [showRecoveryPanel, setShowRecoveryPanel] = import_react86.useState(false);
|
|
292845
292862
|
const [showConnectorsPanel, setShowConnectorsPanel] = import_react86.useState(false);
|
|
@@ -293762,6 +293779,30 @@ function App2({ cwd: cwd3, version: version4, permissionMode: initialPermissionM
|
|
|
293762
293779
|
seedSessionState(session.id, sessionData.messages);
|
|
293763
293780
|
}
|
|
293764
293781
|
await switchToSession(session.id);
|
|
293782
|
+
const pending = sessionData.pendingQueue;
|
|
293783
|
+
let messagesToRequeue = [];
|
|
293784
|
+
if (pending && pending.length > 0) {
|
|
293785
|
+
messagesToRequeue = pending.map((content3) => ({ id: generateId(), content: content3 }));
|
|
293786
|
+
} else {
|
|
293787
|
+
const msgs = sessionData.messages;
|
|
293788
|
+
for (let i6 = msgs.length - 1;i6 >= 0; i6--) {
|
|
293789
|
+
if (msgs[i6].role === "user" && msgs[i6].content) {
|
|
293790
|
+
messagesToRequeue.unshift({ id: msgs[i6].id, content: msgs[i6].content });
|
|
293791
|
+
} else {
|
|
293792
|
+
break;
|
|
293793
|
+
}
|
|
293794
|
+
}
|
|
293795
|
+
}
|
|
293796
|
+
if (messagesToRequeue.length > 0) {
|
|
293797
|
+
const restoredQueue = messagesToRequeue.map(({ id, content: content3 }) => ({
|
|
293798
|
+
id,
|
|
293799
|
+
sessionId: session.id,
|
|
293800
|
+
content: content3,
|
|
293801
|
+
queuedAt: Date.now(),
|
|
293802
|
+
mode: "queued"
|
|
293803
|
+
}));
|
|
293804
|
+
setMessageQueue((prev) => [...prev, ...restoredQueue]);
|
|
293805
|
+
}
|
|
293765
293806
|
}, [cwd3, registry3, beginAskUser, beginInterview, seedSessionState, switchToSession, workspaceBaseDir]);
|
|
293766
293807
|
const switchWorkspace = import_react86.useCallback(async (workspaceId) => {
|
|
293767
293808
|
if (workspaceId === activeWorkspaceId) {
|
|
@@ -294399,6 +294440,9 @@ function App2({ cwd: cwd3, version: version4, permissionMode: initialPermissionM
|
|
|
294399
294440
|
}
|
|
294400
294441
|
setQueueFlushTrigger((prev) => prev + 1);
|
|
294401
294442
|
});
|
|
294443
|
+
registry3.onLabelChange(() => {
|
|
294444
|
+
setSessionVersion((prev) => prev + 1);
|
|
294445
|
+
});
|
|
294402
294446
|
}
|
|
294403
294447
|
let initialMessages;
|
|
294404
294448
|
let sessionId;
|
|
@@ -297849,7 +297893,7 @@ process.on("unhandledRejection", (reason) => {
|
|
|
297849
297893
|
cleanup();
|
|
297850
297894
|
process.exit(1);
|
|
297851
297895
|
});
|
|
297852
|
-
var VERSION4 = "1.1.
|
|
297896
|
+
var VERSION4 = "1.1.91";
|
|
297853
297897
|
var SYNC_START = "\x1B[?2026h";
|
|
297854
297898
|
var SYNC_END = "\x1B[?2026l";
|
|
297855
297899
|
function enableSynchronizedOutput() {
|
|
@@ -298023,4 +298067,4 @@ export {
|
|
|
298023
298067
|
main
|
|
298024
298068
|
};
|
|
298025
298069
|
|
|
298026
|
-
//# debugId=
|
|
298070
|
+
//# debugId=D4CEEF3343A33BAE64756E2164756E21
|