typeclaw 0.39.0 → 0.39.2
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 -0
- package/package.json +2 -2
- package/src/agent/attention-escalation.ts +154 -4
- package/src/agent/git-nudge.ts +7 -7
- package/src/agent/session-origin.ts +21 -0
- package/src/bundled-plugins/backup/index.ts +5 -2
- package/src/bundled-plugins/backup/runner.ts +55 -23
- package/src/bundled-plugins/guard/policies/uncommitted-changes.ts +7 -8
- package/src/bundled-plugins/memory/dreaming.ts +37 -24
- package/src/channels/adapters/kakaotalk-membership.ts +67 -0
- package/src/channels/adapters/kakaotalk.ts +8 -0
- package/src/channels/adapters/line-token.ts +55 -0
- package/src/channels/adapters/line.ts +74 -0
- package/src/channels/adapters/webex-bot-classify.ts +14 -1
- package/src/channels/adapters/webex-bot.ts +24 -1
- package/src/channels/adapters/webex-classify.ts +16 -1
- package/src/channels/adapters/webex.ts +27 -1
- package/src/channels/router.ts +112 -13
- package/src/cli/hostd.ts +40 -0
- package/src/compose/logs.ts +20 -6
- package/src/config/config.ts +7 -5
- package/src/container/logs.ts +19 -4
- package/src/container/shared.ts +222 -18
- package/src/container/shell.ts +12 -2
- package/src/container/start.ts +191 -30
- package/src/doctor/commit.ts +10 -10
- package/src/dreams/git.ts +20 -7
- package/src/dreams/index.ts +22 -7
- package/src/git/reconcile-ignored.ts +56 -27
- package/src/git/resolve-agent-git.ts +12 -0
- package/src/git/system-commit.ts +16 -10
- package/src/hostd/daemon.ts +16 -0
- package/src/hostd/webex-renewal-manager.ts +216 -0
- package/src/init/auto-upgrade.ts +38 -4
- package/src/init/cli-version.ts +30 -1
- package/src/init/dockerfile.ts +31 -9
- package/src/init/gitignore.ts +4 -2
- package/src/init/index.ts +47 -39
- package/src/init/windows-dev-link.ts +64 -0
- package/src/secrets/schema.ts +1 -0
- package/src/secrets/webex-renewal.ts +215 -0
- package/src/server/index.ts +25 -3
- package/typeclaw.schema.json +6 -1
package/src/server/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type CreateSessionOptions,
|
|
9
9
|
type CreateSessionResult,
|
|
10
10
|
} from '@/agent'
|
|
11
|
-
import { applyTurnThinkingLevel } from '@/agent/attention-escalation'
|
|
11
|
+
import { applyTurnThinkingLevel, getQuestionSignal, type QuestionSignal } from '@/agent/attention-escalation'
|
|
12
12
|
import { runPluginDoctorChecks, runPluginDoctorFix } from '@/agent/doctor'
|
|
13
13
|
import type { LiveSessionRegistry } from '@/agent/live-sessions'
|
|
14
14
|
import type { LiveSubagentRegistry } from '@/agent/live-subagents'
|
|
@@ -165,6 +165,14 @@ type TunnelLogsWs = ServerWebSocket<TunnelLogsWsData>
|
|
|
165
165
|
type InspectWs = ServerWebSocket<InspectWsData>
|
|
166
166
|
type AnyOwnerWs = Ws | CommandWs
|
|
167
167
|
|
|
168
|
+
// A turn whose assistant leaf aborted or errored never produced a usable turn,
|
|
169
|
+
// so its question shape must not seed the next turn's cross-turn escalation.
|
|
170
|
+
function tuiTurnLeafFailed(session: AgentSession): boolean {
|
|
171
|
+
const leaf = session.sessionManager?.getLeafEntry()
|
|
172
|
+
if (!leaf || leaf.type !== 'message' || leaf.message.role !== 'assistant') return false
|
|
173
|
+
return leaf.message.stopReason === 'aborted' || leaf.message.stopReason === 'error'
|
|
174
|
+
}
|
|
175
|
+
|
|
168
176
|
type QueuedPrompt = {
|
|
169
177
|
streamMessageId: StreamMessageId
|
|
170
178
|
text: string
|
|
@@ -180,6 +188,9 @@ type SessionState = {
|
|
|
180
188
|
// loop, no-stream fallback) can use the live getter as the reset target — both
|
|
181
189
|
// read this captured default instead.
|
|
182
190
|
turnThinkingDefault: AgentSession['thinkingLevel']
|
|
191
|
+
// Prior real user turn's question shape, for cross-turn "Jeff Bezos" escalation.
|
|
192
|
+
// Null until the first user turn; carried turn-to-turn within this session only.
|
|
193
|
+
lastQuestionSignal: QuestionSignal | null
|
|
183
194
|
sessionFileId: string
|
|
184
195
|
origin: SessionOrigin
|
|
185
196
|
sessionManager: { getSessionFile: () => string | undefined } | undefined
|
|
@@ -525,6 +536,7 @@ export function createServer({
|
|
|
525
536
|
const state: SessionState = {
|
|
526
537
|
session,
|
|
527
538
|
turnThinkingDefault: session.thinkingLevel,
|
|
539
|
+
lastQuestionSignal: null,
|
|
528
540
|
sessionFileId,
|
|
529
541
|
origin,
|
|
530
542
|
sessionManager,
|
|
@@ -789,8 +801,12 @@ export function createServer({
|
|
|
789
801
|
retrievalContext.results.length > 0
|
|
790
802
|
? `${renderTurnTimeAnchor()}\n\n${msg.text}\n\n${retrievalContext.results}`
|
|
791
803
|
: `${renderTurnTimeAnchor()}\n\n${msg.text}`
|
|
792
|
-
applyTurnThinkingLevel(state.session, msg.text, state.turnThinkingDefault)
|
|
804
|
+
applyTurnThinkingLevel(state.session, msg.text, state.turnThinkingDefault, state.lastQuestionSignal)
|
|
793
805
|
await state.session.prompt(turnText)
|
|
806
|
+
// A usable turn seeds the next turn's escalation; a failed leaf must
|
|
807
|
+
// CLEAR the prior signal (not just skip), else an older question
|
|
808
|
+
// leaks across the failed turn and wrongly escalates the next one.
|
|
809
|
+
state.lastQuestionSignal = tuiTurnLeafFailed(state.session) ? null : getQuestionSignal(msg.text)
|
|
794
810
|
send(ws, doneMessage(state))
|
|
795
811
|
} catch (err) {
|
|
796
812
|
const message = err instanceof Error ? err.message : String(err)
|
|
@@ -1094,8 +1110,14 @@ async function drain(
|
|
|
1094
1110
|
retrievalContext.results.length > 0
|
|
1095
1111
|
? `${renderTurnTimeAnchor()}\n\n${item.text}\n\n${retrievalContext.results}`
|
|
1096
1112
|
: `${renderTurnTimeAnchor()}\n\n${item.text}`
|
|
1097
|
-
applyTurnThinkingLevel(state.session, item.text, state.turnThinkingDefault)
|
|
1113
|
+
applyTurnThinkingLevel(state.session, item.text, state.turnThinkingDefault, state.lastQuestionSignal)
|
|
1098
1114
|
await state.session.prompt(turnText)
|
|
1115
|
+
// Only real user turns move the signal: a usable turn seeds it, a failed
|
|
1116
|
+
// leaf CLEARS it (else an older question leaks across the failed turn).
|
|
1117
|
+
// Todo-continuation turns are not user turns, so they leave it untouched.
|
|
1118
|
+
if (item.source !== TODO_CONTINUATION_SOURCE) {
|
|
1119
|
+
state.lastQuestionSignal = tuiTurnLeafFailed(state.session) ? null : getQuestionSignal(item.text)
|
|
1120
|
+
}
|
|
1099
1121
|
send(ws, doneMessage(state))
|
|
1100
1122
|
} catch (err) {
|
|
1101
1123
|
const message = err instanceof Error ? err.message : String(err)
|
package/typeclaw.schema.json
CHANGED
|
@@ -454,13 +454,18 @@
|
|
|
454
454
|
},
|
|
455
455
|
"compose": {
|
|
456
456
|
"default": {
|
|
457
|
-
"exclude": false
|
|
457
|
+
"exclude": false,
|
|
458
|
+
"monorepo": false
|
|
458
459
|
},
|
|
459
460
|
"type": "object",
|
|
460
461
|
"properties": {
|
|
461
462
|
"exclude": {
|
|
462
463
|
"default": false,
|
|
463
464
|
"type": "boolean"
|
|
465
|
+
},
|
|
466
|
+
"monorepo": {
|
|
467
|
+
"default": false,
|
|
468
|
+
"type": "boolean"
|
|
464
469
|
}
|
|
465
470
|
}
|
|
466
471
|
},
|