@myrialabs/clopen 0.4.9 → 0.4.10
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 +10 -7
- package/backend/database/queries/session-queries.ts +11 -0
- package/backend/project/status-manager.ts +7 -25
- package/backend/utils/static-curl.ts +12 -54
- package/backend/ws/sessions/crud.ts +12 -0
- package/dist/assets/{index-BdRui-1z.js → index-C3kp8wpM.js} +1 -1
- package/dist/assets/{index-BjaIjmd4.js → index-cVUk7das.js} +1 -1
- package/dist/assets/main-CuCxUeqZ.js +533 -0
- package/dist/index.html +1 -1
- package/package.json +24 -24
- package/shared/utils/interactive-input.ts +71 -0
- package/dist/assets/main-Cf8SUfQ1.js +0 -533
package/dist/index.html
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
})();
|
|
60
60
|
</script>
|
|
61
|
-
<script type="module" crossorigin src="/assets/main-
|
|
61
|
+
<script type="module" crossorigin src="/assets/main-CuCxUeqZ.js"></script>
|
|
62
62
|
<link rel="stylesheet" crossorigin href="/assets/main-D4pdkiQK.css">
|
|
63
63
|
</head>
|
|
64
64
|
<body
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrialabs/clopen",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"description": "All-in-one web workspace for Claude Code & OpenCode — chat, terminal, git, browser preview, checkpoints, and real-time collaboration",
|
|
5
5
|
"author": "Myria Labs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -93,35 +93,35 @@
|
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@anthropic-ai/claude-agent-sdk": "0.3.158",
|
|
95
95
|
"@anthropic-ai/sdk": "0.100.1",
|
|
96
|
-
"@elysiajs/cors": "
|
|
96
|
+
"@elysiajs/cors": "1.4.1",
|
|
97
97
|
"@github/copilot-sdk": "1.0.0-beta.9",
|
|
98
|
-
"@iconify-json/lucide": "
|
|
99
|
-
"@iconify-json/material-icon-theme": "
|
|
98
|
+
"@iconify-json/lucide": "1.2.96",
|
|
99
|
+
"@iconify-json/material-icon-theme": "1.2.55",
|
|
100
100
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
101
|
-
"@monaco-editor/loader": "
|
|
102
|
-
"@myrialabs/ptykit": "
|
|
103
|
-
"@myrialabs/tunnelkit": "
|
|
104
|
-
"@myrialabs/zipkit": "
|
|
101
|
+
"@monaco-editor/loader": "1.7.0",
|
|
102
|
+
"@myrialabs/ptykit": "0.0.5",
|
|
103
|
+
"@myrialabs/tunnelkit": "0.0.15",
|
|
104
|
+
"@myrialabs/zipkit": "0.0.11",
|
|
105
105
|
"@openai/codex-sdk": "0.135.0",
|
|
106
106
|
"@opencode-ai/sdk": "1.15.12",
|
|
107
107
|
"@qwen-code/sdk": "0.1.7",
|
|
108
108
|
"@sinclair/typebox": "0.34.48",
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"puppeteer
|
|
120
|
-
"puppeteer-extra
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
109
|
+
"bson": "7.2.0",
|
|
110
|
+
"bun-pty": "0.4.8",
|
|
111
|
+
"dompurify": "3.4.9",
|
|
112
|
+
"elysia": "1.4.27",
|
|
113
|
+
"file-type": "21.3.1",
|
|
114
|
+
"is-text-path": "3.0.0",
|
|
115
|
+
"marked": "16.4.2",
|
|
116
|
+
"monaco-editor": "0.52.2",
|
|
117
|
+
"mongodb": "7.2.0",
|
|
118
|
+
"nanoid": "5.1.6",
|
|
119
|
+
"puppeteer": "24.38.0",
|
|
120
|
+
"puppeteer-extra": "3.3.6",
|
|
121
|
+
"puppeteer-extra-plugin-stealth": "2.11.2",
|
|
122
|
+
"qrcode": "1.5.4",
|
|
123
|
+
"sharp": "0.34.5",
|
|
124
|
+
"ssh2": "1.17.0"
|
|
125
125
|
},
|
|
126
126
|
"trustedDependencies": [
|
|
127
127
|
"puppeteer",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the "is this conversation waiting for user input?"
|
|
3
|
+
* derivation. Both the backend presence layer (status-manager) and the frontend
|
|
4
|
+
* chat service consume this so the logic can never drift between them.
|
|
5
|
+
*
|
|
6
|
+
* Historically this logic was duplicated in three places with subtly different
|
|
7
|
+
* rules, which let the "Needs input" status get stuck after an interrupt →
|
|
8
|
+
* continue flow. Keeping one pure function here removes that class of bug.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Tools that block the stream waiting for a user response. */
|
|
12
|
+
export const INTERACTIVE_TOOLS = new Set(['AskUserQuestion']);
|
|
13
|
+
|
|
14
|
+
/** Minimal structural shape shared by UnifiedMessage and its frontend supersets. */
|
|
15
|
+
interface WaitingInputMessage {
|
|
16
|
+
type: string;
|
|
17
|
+
stopReason?: string | null;
|
|
18
|
+
content?: unknown;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface WaitingInputBlock {
|
|
22
|
+
type: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
interrupted?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A conversation is "waiting for user input" if and only if its trailing turn
|
|
29
|
+
* contains an unanswered, non-interrupted interactive tool_use.
|
|
30
|
+
*
|
|
31
|
+
* The rule is intentionally derived from message ordering rather than tracked
|
|
32
|
+
* imperatively, so it stays correct across every entry path:
|
|
33
|
+
* - Answered normally → the tool_result (a user message) lands after the
|
|
34
|
+
* question, so the question is no longer trailing.
|
|
35
|
+
* - Interrupted → continue → the follow-up user message lands after the
|
|
36
|
+
* question, so it is no longer trailing (was the bug).
|
|
37
|
+
* - Interrupted, no follow → the question turn is marked interrupted (via the
|
|
38
|
+
* message stopReason or the block flag) and skipped.
|
|
39
|
+
* - Genuinely pending → the question is the trailing turn and counts.
|
|
40
|
+
*
|
|
41
|
+
* Both interrupted representations are honored (message `stopReason` set by the
|
|
42
|
+
* backend, block `interrupted` set by the frontend) so the reader tolerates
|
|
43
|
+
* either signal regardless of which side produced the messages.
|
|
44
|
+
*/
|
|
45
|
+
export function isWaitingForInteractiveInput(messages: readonly WaitingInputMessage[]): boolean {
|
|
46
|
+
// Find the index of the last user message — anything before it has already
|
|
47
|
+
// been superseded by subsequent user activity and cannot be pending.
|
|
48
|
+
let lastUserIndex = -1;
|
|
49
|
+
for (let i = 0; i < messages.length; i++) {
|
|
50
|
+
if (messages[i]?.type === 'user') lastUserIndex = i;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (let i = lastUserIndex + 1; i < messages.length; i++) {
|
|
54
|
+
const msg = messages[i];
|
|
55
|
+
if (!msg || msg.type !== 'assistant') continue;
|
|
56
|
+
// An interrupted assistant turn never counts as waiting.
|
|
57
|
+
if (msg.stopReason === 'interrupted') continue;
|
|
58
|
+
if (!Array.isArray(msg.content)) continue;
|
|
59
|
+
|
|
60
|
+
const hasPending = (msg.content as WaitingInputBlock[]).some(
|
|
61
|
+
block =>
|
|
62
|
+
block?.type === 'tool_use' &&
|
|
63
|
+
!!block.name &&
|
|
64
|
+
INTERACTIVE_TOOLS.has(block.name) &&
|
|
65
|
+
!block.interrupted
|
|
66
|
+
);
|
|
67
|
+
if (hasPending) return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return false;
|
|
71
|
+
}
|