shennian 0.2.56 → 0.2.57
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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @arch docs/architecture/cli/native-session-fusion.md
|
|
2
|
+
// @test src/__tests__/session-manager.test.ts
|
|
3
|
+
export async function handleSessionRefresh(runtime, req) {
|
|
4
|
+
const params = req.params;
|
|
5
|
+
if (!params.sessionId) {
|
|
6
|
+
runtime.client.sendRes({
|
|
7
|
+
type: 'res',
|
|
8
|
+
id: req.id,
|
|
9
|
+
ok: false,
|
|
10
|
+
error: 'sessionId is required',
|
|
11
|
+
});
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!runtime.nativeFusion) {
|
|
15
|
+
runtime.client.sendRes({
|
|
16
|
+
type: 'res',
|
|
17
|
+
id: req.id,
|
|
18
|
+
ok: true,
|
|
19
|
+
payload: { scanned: false },
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
await runtime.nativeFusion.scanNow();
|
|
24
|
+
runtime.client.sendRes({
|
|
25
|
+
type: 'res',
|
|
26
|
+
id: req.id,
|
|
27
|
+
ok: true,
|
|
28
|
+
payload: {
|
|
29
|
+
scanned: true,
|
|
30
|
+
sessionId: params.sessionId,
|
|
31
|
+
agentType: params.agentType ?? null,
|
|
32
|
+
agentSessionId: params.agentSessionId ?? null,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -9,6 +9,7 @@ import { handleUpgradeStart, handleUpgradeStatus } from '../commands/upgrade.js'
|
|
|
9
9
|
import { handleAgentsRefresh, handleModelsRefresh } from './handlers/agents.js';
|
|
10
10
|
import { handleAgentConfigClear, handleAgentConfigGet, handleAgentConfigTest, handleAgentConfigUpsert, } from './handlers/agent-config.js';
|
|
11
11
|
import { handleChatAbort, handleChatSend } from './handlers/chat.js';
|
|
12
|
+
import { handleSessionRefresh } from './handlers/session-refresh.js';
|
|
12
13
|
import { cleanupPendingTransfers, handleFsLs, handleFsRead, handleFsTransfer, handleFsTransferAbort, handleFsTransferChunk, handleFsTransferFinish, handleFsTransferStart, } from './handlers/fs.js';
|
|
13
14
|
import { handleRegionProbe, handleRegionSwitch, handleUpgradeSetPolicy } from './handlers/control.js';
|
|
14
15
|
import { ManagerRuntimeService, setManagerRuntimeService } from '../manager/runtime.js';
|
|
@@ -128,6 +129,9 @@ export class SessionManager {
|
|
|
128
129
|
case 'chat.abort':
|
|
129
130
|
await handleChatAbort(runtime, req);
|
|
130
131
|
break;
|
|
132
|
+
case 'session.refresh':
|
|
133
|
+
await handleSessionRefresh(runtime, req);
|
|
134
|
+
break;
|
|
131
135
|
case 'fs.ls':
|
|
132
136
|
await handleFsLs(runtime, req);
|
|
133
137
|
break;
|