martty 0.2.33 → 0.2.34
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/lib/acp-session-plan.js +4 -1
- package/lib/acp-session-stats.js +11 -5
- package/package.json +2 -2
- package/vendor/darwin-arm64/martty +0 -0
- package/vendor/darwin-x64/martty +0 -0
- package/vendor/linux-arm64/martty +0 -0
- package/vendor/linux-x64/martty +0 -0
- package/vendor/win32-x64/martty.exe +0 -0
package/lib/acp-session-plan.js
CHANGED
|
@@ -107,6 +107,7 @@ export function installAcpSessionPlan(ctx) {
|
|
|
107
107
|
? readString(message.params, 'sessionId', 'session_id')
|
|
108
108
|
: undefined,
|
|
109
109
|
})
|
|
110
|
+
if (message.method === 'session/load') reset(readString(message.params, 'sessionId', 'session_id'))
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
function observeAgent(message) {
|
|
@@ -117,7 +118,9 @@ export function installAcpSessionPlan(ctx) {
|
|
|
117
118
|
if (message.error !== undefined || !isObject(message.result)) return
|
|
118
119
|
const bound = readString(message.result, 'sessionId', 'session_id') ?? tracked.sessionId
|
|
119
120
|
if (!selectionKnown) sessionId = bound
|
|
120
|
-
|
|
121
|
+
// Replay notifications precede the setup response. Preserve their state.
|
|
122
|
+
if (!plansBySession.has(bound)) reset(bound)
|
|
123
|
+
else if (bound === sessionId) publish()
|
|
121
124
|
return
|
|
122
125
|
}
|
|
123
126
|
if (message.method !== 'session/update' || !isObject(message.params)) return
|
package/lib/acp-session-stats.js
CHANGED
|
@@ -120,6 +120,7 @@ export function installAcpSessionStats(ctx, options = {}) {
|
|
|
120
120
|
? readString(message.params, 'sessionId', 'session_id')
|
|
121
121
|
: undefined,
|
|
122
122
|
})
|
|
123
|
+
if (message.method === 'session/load') reset(readString(message.params, 'sessionId', 'session_id'))
|
|
123
124
|
return
|
|
124
125
|
}
|
|
125
126
|
if (message.method !== 'session/prompt') return
|
|
@@ -128,13 +129,16 @@ export function installAcpSessionStats(ctx, options = {}) {
|
|
|
128
129
|
if (!selectionKnown && sessionId === undefined) sessionId = promptSessionId
|
|
129
130
|
const prompt = {
|
|
130
131
|
sessionId: promptSessionId,
|
|
132
|
+
primary: !activePrompts.has(promptSessionId),
|
|
131
133
|
started: now(),
|
|
132
134
|
firstToken: undefined,
|
|
133
135
|
toolMillis: 0,
|
|
134
136
|
}
|
|
135
137
|
pendingPrompts.set(message.id, prompt)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
if (prompt.primary) {
|
|
139
|
+
activePrompts.set(promptSessionId, prompt)
|
|
140
|
+
stateFor(promptSessionId).stats.turns += 1
|
|
141
|
+
}
|
|
138
142
|
publishIf(promptSessionId)
|
|
139
143
|
}
|
|
140
144
|
|
|
@@ -146,19 +150,21 @@ export function installAcpSessionStats(ctx, options = {}) {
|
|
|
146
150
|
if (message.error !== undefined || !object(message.result)) return
|
|
147
151
|
const bound = readString(message.result, 'sessionId', 'session_id') ?? tracked.sessionId
|
|
148
152
|
if (!selectionKnown) sessionId = bound
|
|
149
|
-
|
|
153
|
+
// Replay notifications precede the setup response. Preserve their state.
|
|
154
|
+
if (!values.has(bound)) reset(bound)
|
|
155
|
+
else if (bound === sessionId) publish()
|
|
150
156
|
return
|
|
151
157
|
}
|
|
152
158
|
if (message.id !== undefined && pendingPrompts.has(message.id)) {
|
|
153
159
|
const prompt = pendingPrompts.get(message.id)
|
|
154
160
|
pendingPrompts.delete(message.id)
|
|
155
|
-
activePrompts.delete(prompt.sessionId)
|
|
161
|
+
if (activePrompts.get(prompt.sessionId) === prompt) activePrompts.delete(prompt.sessionId)
|
|
156
162
|
const value = stateFor(prompt.sessionId)
|
|
157
163
|
if (message.error === undefined && object(message.result)) {
|
|
158
164
|
addUsage(value, message.result.usage)
|
|
159
165
|
}
|
|
160
166
|
const elapsed = Math.max(0, now() - prompt.started)
|
|
161
|
-
value.stats.llmMillis += Math.max(0, elapsed - prompt.toolMillis)
|
|
167
|
+
if (prompt.primary) value.stats.llmMillis += Math.max(0, elapsed - prompt.toolMillis)
|
|
162
168
|
publishIf(prompt.sessionId)
|
|
163
169
|
return
|
|
164
170
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "martty",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"description": "Terminal-native ACP client UI; Cordis client tree, any ACP agent",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
78
|
-
"@openma/deepseek-harness-acp": "0.4.
|
|
78
|
+
"@openma/deepseek-harness-acp": "0.4.29"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@deepseek-ai/dsh": "0.1.1-rc.2"
|
|
Binary file
|
package/vendor/darwin-x64/martty
CHANGED
|
Binary file
|
|
Binary file
|
package/vendor/linux-x64/martty
CHANGED
|
Binary file
|
|
Binary file
|