dsh-monkeyai-sessions 0.1.4 → 0.1.5
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/README.md +1 -1
- package/README.zh.md +1 -1
- package/client.js +1 -0
- package/lib/client-runtime.cjs +1 -0
- package/package.json +1 -1
- package/src/client/index.js +1 -0
- package/src/host/monkeyai-remote.js +17 -17
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ From a checkout:
|
|
|
61
61
|
npm install
|
|
62
62
|
npm run build
|
|
63
63
|
npm pack
|
|
64
|
-
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.
|
|
64
|
+
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.5.tgz
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Verified against a real DSH `0.2.2-rc.1` web profile and a live MonkeyAI runtime: authorization, full history loading, prompt delivery, model switching, and turn cancellation all work end to end.
|
package/README.zh.md
CHANGED
|
@@ -28,7 +28,7 @@ https://artenx.github.io/dsh-monkeyai-sessions/index.json
|
|
|
28
28
|
npm install
|
|
29
29
|
npm run build
|
|
30
30
|
npm pack
|
|
31
|
-
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.
|
|
31
|
+
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.5.tgz
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
已在真实的 DSH `0.2.2-rc.1` web profile 与在线 MonkeyAI runtime 上端到端验证:授权、完整历史加载、指令下发、模型切换、回合取消均正常工作。
|
package/client.js
CHANGED
|
@@ -1080,6 +1080,7 @@ window.__ModuleLoader__.load({
|
|
|
1080
1080
|
historyLoadedRef.current = true;
|
|
1081
1081
|
setStatus("\u5386\u53F2\u5DF2\u52A0\u8F7D");
|
|
1082
1082
|
setHistoryLoading(false);
|
|
1083
|
+
setSessionStatus((current) => current || "idle");
|
|
1083
1084
|
if (frame.model) setCurrentModel(frame.model);
|
|
1084
1085
|
}
|
|
1085
1086
|
if (frame.type === "history_incomplete") {
|
package/lib/client-runtime.cjs
CHANGED
|
@@ -1075,6 +1075,7 @@ function RemoteSessionPage({ api }) {
|
|
|
1075
1075
|
historyLoadedRef.current = true;
|
|
1076
1076
|
setStatus("\u5386\u53F2\u5DF2\u52A0\u8F7D");
|
|
1077
1077
|
setHistoryLoading(false);
|
|
1078
|
+
setSessionStatus((current) => current || "idle");
|
|
1078
1079
|
if (frame.model) setCurrentModel(frame.model);
|
|
1079
1080
|
}
|
|
1080
1081
|
if (frame.type === "history_incomplete") {
|
package/package.json
CHANGED
package/src/client/index.js
CHANGED
|
@@ -560,6 +560,7 @@ function RemoteSessionPage({ api }) {
|
|
|
560
560
|
historyLoadedRef.current = true
|
|
561
561
|
setStatus('历史已加载')
|
|
562
562
|
setHistoryLoading(false)
|
|
563
|
+
setSessionStatus(current => current || 'idle')
|
|
563
564
|
if (frame.model) setCurrentModel(frame.model)
|
|
564
565
|
}
|
|
565
566
|
if (frame.type === 'history_incomplete') {
|
|
@@ -971,24 +971,24 @@ export class MonkeyAIRemoteService extends TypertRemoteService {
|
|
|
971
971
|
if (httpHistoryComplete) {
|
|
972
972
|
historyRefreshPromise = historyRefreshPromise.then(() => refreshPersistedHistory())
|
|
973
973
|
await historyRefreshPromise
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
} catch {
|
|
989
|
-
// Older runtimes may not expose the state read; live notifications
|
|
990
|
-
// still drive the status once the next turn starts.
|
|
974
|
+
}
|
|
975
|
+
// The desktop client tracks turn state via _monkeyai/session/state
|
|
976
|
+
// notifications. Seed the panel with the current status so a turn
|
|
977
|
+
// already running when the panel opens is shown as 进行中.
|
|
978
|
+
try {
|
|
979
|
+
const state = await readSessionState({ httpBase: ticketHttpBase, ticket: ticketValue, sessionId: selectedSession, signal })
|
|
980
|
+
const status = state?.state?.status
|
|
981
|
+
if (typeof status === 'string' && ['running', 'idle', 'error', 'interrupted'].includes(status)) {
|
|
982
|
+
emit({
|
|
983
|
+
type: 'notification',
|
|
984
|
+
sessionId: selectedSession,
|
|
985
|
+
method: '_monkeyai/session/state',
|
|
986
|
+
data: { sessionId: selectedSession, state: { status }, eventSeq: state.eventSeq },
|
|
987
|
+
})
|
|
991
988
|
}
|
|
989
|
+
} catch {
|
|
990
|
+
// Older runtimes may not expose the state read; live notifications
|
|
991
|
+
// still drive the status once the next turn starts.
|
|
992
992
|
}
|
|
993
993
|
} catch (error) {
|
|
994
994
|
if (signal?.aborted) throw error
|