charness 4.0.0 → 4.1.0
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/CHANGELOG.md +18 -0
- package/DEVELOPMENT.md +2 -1
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +2 -0
- package/agent-plugin/skills/charness-orchestration/SKILL.md +5 -0
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +3 -2
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +1 -0
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +19 -4
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +1 -0
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +11 -0
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +268 -268
- package/dist/bot.js.map +1 -1
- package/dist/connectors/telegram/answerSink.d.ts +12 -0
- package/dist/connectors/telegram/answerSink.d.ts.map +1 -1
- package/dist/connectors/telegram/answerSink.js +23 -0
- package/dist/connectors/telegram/answerSink.js.map +1 -1
- package/dist/connectors/telegram/botApiConnection.d.ts +2 -1
- package/dist/connectors/telegram/botApiConnection.d.ts.map +1 -1
- package/dist/connectors/telegram/botApiConnection.js +19 -1
- package/dist/connectors/telegram/botApiConnection.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +13 -5
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.js +9 -5
- package/dist/connectors/telegram/commands/runners.js.map +1 -1
- package/dist/connectors/telegram/outbound.d.ts +1 -1
- package/dist/connectors/telegram/outbound.d.ts.map +1 -1
- package/dist/connectors/telegram/outbound.js +3 -1
- package/dist/connectors/telegram/outbound.js.map +1 -1
- package/dist/connectors/telegram/outputBacklogGlue.d.ts +1 -1
- package/dist/connectors/telegram/outputBacklogGlue.js +1 -1
- package/dist/connectors/telegram/outputFlushPlan.d.ts +23 -8
- package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -1
- package/dist/connectors/telegram/outputFlushPlan.js +22 -13
- package/dist/connectors/telegram/outputFlushPlan.js.map +1 -1
- package/dist/connectors/telegram/pinnedNoticeSlot.d.ts +31 -0
- package/dist/connectors/telegram/pinnedNoticeSlot.d.ts.map +1 -0
- package/dist/connectors/telegram/pinnedNoticeSlot.js +43 -0
- package/dist/connectors/telegram/pinnedNoticeSlot.js.map +1 -0
- package/dist/connectors/telegram/sendOutcome.d.ts +48 -0
- package/dist/connectors/telegram/sendOutcome.d.ts.map +1 -0
- package/dist/connectors/telegram/sendOutcome.js +49 -0
- package/dist/connectors/telegram/sendOutcome.js.map +1 -0
- package/dist/connectors/telegram/telegramFailureRetry.d.ts +9 -0
- package/dist/connectors/telegram/telegramFailureRetry.d.ts.map +1 -0
- package/dist/connectors/telegram/telegramFailureRetry.js +21 -0
- package/dist/connectors/telegram/telegramFailureRetry.js.map +1 -0
- package/dist/connectors/telegram/unpinMessages.d.ts +1 -1
- package/dist/connectors/telegram/unpinMessages.d.ts.map +1 -1
- package/dist/connectors/telegram/unpinMessages.js +3 -18
- package/dist/connectors/telegram/unpinMessages.js.map +1 -1
- package/dist/hooks/claudeSkillsRestoreHook.d.ts +105 -0
- package/dist/hooks/claudeSkillsRestoreHook.d.ts.map +1 -0
- package/dist/hooks/claudeSkillsRestoreHook.js +276 -0
- package/dist/hooks/claudeSkillsRestoreHook.js.map +1 -0
- package/dist/platform/outbound.d.ts +4 -1
- package/dist/platform/outbound.d.ts.map +1 -1
- package/dist/platform/outbound.js.map +1 -1
- package/dist/rateLimiter.d.ts +33 -1
- package/dist/rateLimiter.d.ts.map +1 -1
- package/dist/rateLimiter.js +91 -5
- package/dist/rateLimiter.js.map +1 -1
- package/dist/runnerUtility/pueueDaemon.d.ts +7 -13
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +8 -27
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/selfUpdate/selfCheck.d.ts.map +1 -1
- package/dist/selfUpdate/selfCheck.js +1 -1
- package/dist/selfUpdate/selfCheck.js.map +1 -1
- package/dist/testTimings.d.ts +4 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +4 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agentPlugin.d.ts +7 -0
- package/dist/utils/agentPlugin.d.ts.map +1 -1
- package/dist/utils/agentPlugin.js +12 -0
- package/dist/utils/agentPlugin.js.map +1 -1
- package/dist/utils/claudeCompactHook.d.ts +73 -10
- package/dist/utils/claudeCompactHook.d.ts.map +1 -1
- package/dist/utils/claudeCompactHook.js +96 -17
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeProfiles.d.ts +8 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +12 -2
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeTranscriptEpoch.d.ts +15 -0
- package/dist/utils/claudeTranscriptEpoch.d.ts.map +1 -0
- package/dist/utils/claudeTranscriptEpoch.js +120 -0
- package/dist/utils/claudeTranscriptEpoch.js.map +1 -0
- package/dist/utils/clearStatusCoalescer.d.ts +24 -0
- package/dist/utils/clearStatusCoalescer.d.ts.map +1 -0
- package/dist/utils/clearStatusCoalescer.js +25 -0
- package/dist/utils/clearStatusCoalescer.js.map +1 -0
- package/dist/utils/compactOnIdle.d.ts +91 -34
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +149 -31
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/groupOutputBacklog.d.ts +90 -0
- package/dist/utils/groupOutputBacklog.d.ts.map +1 -0
- package/dist/utils/groupOutputBacklog.js +134 -0
- package/dist/utils/groupOutputBacklog.js.map +1 -0
- package/dist/utils/messageSendService.d.ts +26 -3
- package/dist/utils/messageSendService.d.ts.map +1 -1
- package/dist/utils/messageSendService.js +35 -3
- package/dist/utils/messageSendService.js.map +1 -1
- package/dist/utils/openCodeCompactPlugin.d.ts +33 -0
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
- package/dist/utils/openCodeCompactPlugin.js +192 -1
- package/dist/utils/openCodeCompactPlugin.js.map +1 -1
- package/dist/utils/skillsRestore.d.ts +235 -0
- package/dist/utils/skillsRestore.d.ts.map +1 -0
- package/dist/utils/skillsRestore.js +515 -0
- package/dist/utils/skillsRestore.js.map +1 -0
- package/dist/utils/statusFlushDecision.js +1 -1
- package/dist/utils/streamedCompactionSummary.d.ts +4 -4
- package/dist/utils/streamedCompactionSummary.js +5 -5
- package/dist/utils/streamedCompactionSummary.js.map +1 -1
- package/dist/utils/streamedOutputLanding.d.ts +14 -0
- package/dist/utils/streamedOutputLanding.d.ts.map +1 -0
- package/dist/utils/streamedOutputLanding.js +45 -0
- package/dist/utils/streamedOutputLanding.js.map +1 -0
- package/dist/utils/typingLoopBackstop.d.ts +8 -7
- package/dist/utils/typingLoopBackstop.d.ts.map +1 -1
- package/dist/utils/typingLoopBackstop.js +6 -5
- package/dist/utils/typingLoopBackstop.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/utils/clearThreadOutputQueues.d.ts +0 -44
- package/dist/utils/clearThreadOutputQueues.d.ts.map +0 -1
- package/dist/utils/clearThreadOutputQueues.js +0 -39
- package/dist/utils/clearThreadOutputQueues.js.map +0 -1
- package/dist/utils/groupFinalizePlan.d.ts +0 -36
- package/dist/utils/groupFinalizePlan.d.ts.map +0 -1
- package/dist/utils/groupFinalizePlan.js +0 -31
- package/dist/utils/groupFinalizePlan.js.map +0 -1
|
@@ -30,14 +30,25 @@
|
|
|
30
30
|
* The same launch settings carry the shared todo lists' `PostToolUse` hook
|
|
31
31
|
* (`todos/midTurn.ts`): it prints the session's inbox — the project board's
|
|
32
32
|
* changes — after a tool call, and nothing when there is none.
|
|
33
|
+
*
|
|
34
|
+
* A json-stream / per-turn launch also carries the skills restore: {@link skillsRestoreSlotCount} `SessionStart` hooks with
|
|
35
|
+
* the matcher `compact`, each printing one part of the skills the session had loaded (`hooks/claudeSkillsRestoreHook.ts`),
|
|
36
|
+
* chained so the parts land by number.
|
|
37
|
+
* Measured on Claude Code 2.1.322 (`-p`, stream-json): a `SessionStart` `compact` hook runs after EVERY compaction — the
|
|
38
|
+
* CLI's own mid-turn ones and a `/compact` turn — and what it gives as `additionalContext` is in the very next model request,
|
|
39
|
+
* the same turn's when the agent goes on alone; the CLI stores it in the transcript (`hook_additional_context`), so a
|
|
40
|
+
* resumed session (a stopped process, a restarted bot) still sends it. The tmux backend is frozen and gets none: a
|
|
41
|
+
* compaction there keeps asking the agent to load its skills again.
|
|
33
42
|
*/
|
|
34
43
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
44
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
45
|
};
|
|
37
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.claudeCompactHookSettingsFileName = void 0;
|
|
47
|
+
exports.skillsRestoreHookTimeoutSeconds = exports.claudeSkillsRestoreHookPath = exports.claudeSkillsRestoreHookSettingsFileNames = exports.claudeCompactHookSettingsFileName = void 0;
|
|
48
|
+
exports.getSkillsRestoreOrderDir = getSkillsRestoreOrderDir;
|
|
39
49
|
exports.getHookCompactionInstruction = getHookCompactionInstruction;
|
|
40
50
|
exports.buildPreCompactHookCommand = buildPreCompactHookCommand;
|
|
51
|
+
exports.buildSkillsRestoreHookCommands = buildSkillsRestoreHookCommands;
|
|
41
52
|
exports.buildClaudeLaunchHookSettings = buildClaudeLaunchHookSettings;
|
|
42
53
|
exports.prepareClaudeCompactHookFlags = prepareClaudeCompactHookFlags;
|
|
43
54
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -48,12 +59,32 @@ const tmuxExec_1 = require("./tmuxExec");
|
|
|
48
59
|
const claudeProfiles_1 = require("./claudeProfiles");
|
|
49
60
|
const claudeApiKeyHelper_1 = require("./claudeApiKeyHelper");
|
|
50
61
|
const midTurn_1 = require("../todos/midTurn");
|
|
62
|
+
const skillsRestore_1 = require("./skillsRestore");
|
|
51
63
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
64
|
+
* Names of the hook settings files inside `DATA_DIR`, one per kind of launch: ONE file shared by every session of that kind
|
|
65
|
+
* (its content is the same for all of them, and a session that outlives the bot must never find it deleted under it), and a
|
|
66
|
+
* file per kind, so two sessions starting at once never read each other's hooks. The tmux backend's file keeps its name and
|
|
67
|
+
* content (no skills restore); a json-stream launch takes the one that matches whether it loads the bot's skills.
|
|
55
68
|
*/
|
|
56
69
|
exports.claudeCompactHookSettingsFileName = 'claude-compact-hook.json';
|
|
70
|
+
exports.claudeSkillsRestoreHookSettingsFileNames = {
|
|
71
|
+
withBotSkills: 'claude-launch-hooks.json',
|
|
72
|
+
withoutBotSkills: 'claude-launch-hooks-without-bot-skills.json',
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Where the restore hook is: `dist/hooks/claudeSkillsRestoreHook.js`, beside this module's `dist/utils/`. Run by the bot's own
|
|
76
|
+
* `node` (written at every launch, as the todo hook's); the hook command checks the file first, so a launch from the sources
|
|
77
|
+
* (the test runner, where it is `.ts`) simply has no restore.
|
|
78
|
+
*/
|
|
79
|
+
exports.claudeSkillsRestoreHookPath = path_1.default.join(__dirname, '..', 'hooks', 'claudeSkillsRestoreHook.js');
|
|
80
|
+
/**
|
|
81
|
+
* @description The folder inside `DATA_DIR` where the restore's slots of one compaction leave their done-markers, so the parts
|
|
82
|
+
* land strictly by number (`hooks/claudeSkillsRestoreHook.ts`). Shared by every session: a marker is named after its
|
|
83
|
+
* compaction, and old ones are swept by the slots themselves.
|
|
84
|
+
*/
|
|
85
|
+
function getSkillsRestoreOrderDir(dataDir) {
|
|
86
|
+
return path_1.default.join(dataDir, 'skills-restore-order');
|
|
87
|
+
}
|
|
57
88
|
/**
|
|
58
89
|
* @description The instruction the hook adds to a compaction the bot did not
|
|
59
90
|
* issue: D3 + the resume guidance, with the self-review section while `/compact_self_review` is on for the session's topic
|
|
@@ -92,31 +123,63 @@ function buildPreCompactHookCommand(input) {
|
|
|
92
123
|
].join('; ');
|
|
93
124
|
}
|
|
94
125
|
/**
|
|
95
|
-
* @description The
|
|
126
|
+
* @description The shell commands of the restore's `SessionStart` hook slots: slot `i` (1-based) runs `nodePath hookPath i
|
|
127
|
+
* slotCount <unavailableSkillsDir or ''> orderDir` and prints part `i` of the restore, or nothing, in turn after slot `i - 1`
|
|
128
|
+
* (the chain's markers go to `orderDir`). The folders come after the numbers, an empty argument for none, so a hook of either
|
|
129
|
+
* age reads a command line of either age (an older one ignores the chain's folder; a newer one without it runs no chain). A
|
|
130
|
+
* missing hook file (a launch from the sources) prints nothing; every command reads its input whole (the CLI must never
|
|
131
|
+
* write into a closed pipe) and exits 0 — a hook failure must never stop the agent.
|
|
132
|
+
*/
|
|
133
|
+
function buildSkillsRestoreHookCommands(input) {
|
|
134
|
+
const hook = (0, tmuxExec_1.shellSingleQuote)(input.hookPath);
|
|
135
|
+
const folderArguments = `${(0, tmuxExec_1.shellSingleQuote)(input.unavailableSkillsDir ?? '')} ${(0, tmuxExec_1.shellSingleQuote)(input.orderDir)}`;
|
|
136
|
+
return Array.from({ length: input.slotCount }, (_unused, index) => [
|
|
137
|
+
`[ -f ${hook} ] || { cat > /dev/null; exit 0; }`,
|
|
138
|
+
`${(0, tmuxExec_1.shellSingleQuote)(input.nodePath)} ${hook} ${index + 1} ${input.slotCount} ${folderArguments}`,
|
|
139
|
+
'exit 0',
|
|
140
|
+
].join('; '));
|
|
141
|
+
}
|
|
142
|
+
/** The `SessionStart` source of a compaction, auto or manual: the matcher of the restore's hooks. */
|
|
143
|
+
const sessionStartCompactMatcher = 'compact';
|
|
144
|
+
/**
|
|
145
|
+
* How long the CLI lets one restore slot run, in seconds. The CLI holds the compaction — and so the agent — until its hooks
|
|
146
|
+
* end, and its default is far longer than this work needs (read one transcript epoch and a few files, then wait for the
|
|
147
|
+
* slots before it — the chain gives up by itself well inside this, `skillsRestoreSlotChainTimings`); a slot cut off prints
|
|
148
|
+
* nothing, which every slot already does on any failure.
|
|
149
|
+
*/
|
|
150
|
+
exports.skillsRestoreHookTimeoutSeconds = 30;
|
|
151
|
+
/**
|
|
152
|
+
* @description The `--settings` payload: the `PreCompact` command hook (auto AND manual compactions), the shared
|
|
96
153
|
* todo lists' `PostToolUse` inbox hook (every tool: the project board's changes reach a working agent with its next
|
|
97
|
-
* tool result, `todos/midTurn.ts`).
|
|
154
|
+
* tool result, `todos/midTurn.ts`) and, when there are any, the restore's `SessionStart` hooks for the `compact` source.
|
|
98
155
|
*/
|
|
99
156
|
function buildClaudeLaunchHookSettings(commands) {
|
|
100
|
-
|
|
101
|
-
hooks: {
|
|
102
|
-
|
|
103
|
-
PostToolUse: [{ hooks: [{ type: 'command', command: commands.postToolUse }] }],
|
|
104
|
-
},
|
|
157
|
+
const hooks = {
|
|
158
|
+
PreCompact: [{ hooks: [{ type: 'command', command: commands.preCompact }] }],
|
|
159
|
+
PostToolUse: [{ hooks: [{ type: 'command', command: commands.postToolUse }] }],
|
|
105
160
|
};
|
|
161
|
+
if (commands.sessionStartCompact.length > 0) {
|
|
162
|
+
hooks.SessionStart = [{
|
|
163
|
+
matcher: sessionStartCompactMatcher,
|
|
164
|
+
hooks: commands.sessionStartCompact.map((command) => ({ type: 'command', command, timeout: exports.skillsRestoreHookTimeoutSeconds })),
|
|
165
|
+
}];
|
|
166
|
+
}
|
|
167
|
+
return { hooks };
|
|
106
168
|
}
|
|
107
169
|
/**
|
|
108
170
|
* @description Write the launch settings file and return the `--settings <path>` argument pair for a Claude
|
|
109
171
|
* launch under `configDir` (the account profile's directory, `null` = `~/.claude`). Rewritten on every launch
|
|
110
172
|
* (atomic rename, so a concurrently starting session never reads a half-written file) so a changed guidance
|
|
111
|
-
* reaches the next session.
|
|
173
|
+
* reaches the next session. Each kind of launch ({@link ClaudeLaunchHookOptions}) has a file of its own.
|
|
112
174
|
*
|
|
113
175
|
* Only the LAST `--settings` a launch carries counts (probed on 2.1.304), so a profile that holds a pasted API key
|
|
114
|
-
* (`utils/claudeProfiles.ts`) gets ONE file of its own, in its directory: the
|
|
176
|
+
* (`utils/claudeProfiles.ts`) gets ONE file of its own per kind, in its directory: the hooks plus the `apiKeyHelper` that
|
|
115
177
|
* reads the key. Every other launch shares the hook file in `dataDir`. A write failure of the shared file returns
|
|
116
|
-
* `[]` and only logs (the
|
|
178
|
+
* `[]` and only logs (the hooks improve a summary, they must never stop an agent from starting); for a key profile
|
|
117
179
|
* the same settings go inline instead, so the account never loses its key to a full disk.
|
|
118
180
|
*/
|
|
119
|
-
function prepareClaudeCompactHookFlags(dataDir, configDir
|
|
181
|
+
function prepareClaudeCompactHookFlags(dataDir, configDir, options) {
|
|
182
|
+
const { skillsRestore } = options;
|
|
120
183
|
const hookSettings = buildClaudeLaunchHookSettings({
|
|
121
184
|
preCompact: buildPreCompactHookCommand({
|
|
122
185
|
instruction: getHookCompactionInstruction(true),
|
|
@@ -125,13 +188,29 @@ function prepareClaudeCompactHookFlags(dataDir, configDir = null) {
|
|
|
125
188
|
offFlagDir: (0, compactSelfReviewFlags_1.getClaudeCompactSelfReviewOffDir)(dataDir),
|
|
126
189
|
}),
|
|
127
190
|
postToolUse: (0, midTurn_1.buildTodoInboxHookCommand)((0, midTurn_1.getTodoInboxDir)(dataDir)),
|
|
191
|
+
sessionStartCompact: skillsRestore === null
|
|
192
|
+
? []
|
|
193
|
+
: buildSkillsRestoreHookCommands({
|
|
194
|
+
nodePath: process.execPath,
|
|
195
|
+
hookPath: exports.claudeSkillsRestoreHookPath,
|
|
196
|
+
slotCount: skillsRestore_1.skillsRestoreSlotCount,
|
|
197
|
+
unavailableSkillsDir: skillsRestore.unavailableSkillsDir,
|
|
198
|
+
orderDir: getSkillsRestoreOrderDir(dataDir),
|
|
199
|
+
}),
|
|
128
200
|
});
|
|
201
|
+
const isWithBotSkills = skillsRestore?.unavailableSkillsDir === null;
|
|
129
202
|
if (configDir !== null && (0, claudeProfiles_1.checkHasClaudeProfileApiKey)(configDir)) {
|
|
130
203
|
const settings = { ...hookSettings, ...(0, claudeApiKeyHelper_1.buildClaudeApiKeyHelperSettings)(configDir) };
|
|
131
|
-
const
|
|
204
|
+
const fileName = skillsRestore === null
|
|
205
|
+
? claudeProfiles_1.claudeProfileLaunchSettingsFileName
|
|
206
|
+
: claudeProfiles_1.claudeProfileSkillsRestoreSettingsFileNames[isWithBotSkills ? 'withBotSkills' : 'withoutBotSkills'];
|
|
207
|
+
const written = writeLaunchSettingsFile(configDir, path_1.default.join(configDir, fileName), settings);
|
|
132
208
|
return ['--settings', written ?? JSON.stringify(settings)];
|
|
133
209
|
}
|
|
134
|
-
const
|
|
210
|
+
const fileName = skillsRestore === null
|
|
211
|
+
? exports.claudeCompactHookSettingsFileName
|
|
212
|
+
: exports.claudeSkillsRestoreHookSettingsFileNames[isWithBotSkills ? 'withBotSkills' : 'withoutBotSkills'];
|
|
213
|
+
const written = writeLaunchSettingsFile(dataDir, path_1.default.join(dataDir, fileName), hookSettings);
|
|
135
214
|
return written === null ? [] : ['--settings', written];
|
|
136
215
|
}
|
|
137
216
|
/** Write `settings` to `settingsPath` atomically (`0600`); the path, or `null` when the write failed (logged). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeCompactHook.js","sourceRoot":"","sources":["../../src/utils/claudeCompactHook.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"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AAY,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;IACnE,IAAI,CAAC;QACH,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACrE,YAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,+BAA+B,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC;YAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -126,6 +126,14 @@ export declare const claudeConsoleLoginKeySource = "/login managed key";
|
|
|
126
126
|
export declare const claudeProfileApiKeyFileName = "charness-api-key";
|
|
127
127
|
/** The launch settings of a profile that holds a pasted key: the PreCompact hook AND the `apiKeyHelper` (one file — only the last `--settings` counts). */
|
|
128
128
|
export declare const claudeProfileLaunchSettingsFileName = "charness-settings.json";
|
|
129
|
+
/**
|
|
130
|
+
* The same, for a launch that carries the skills restore (json-stream, per-turn; `utils/claudeCompactHook.ts`): a file per
|
|
131
|
+
* kind, so a tmux launch and a json-stream one of the same profile starting together never read each other's hooks.
|
|
132
|
+
*/
|
|
133
|
+
export declare const claudeProfileSkillsRestoreSettingsFileNames: {
|
|
134
|
+
readonly withBotSkills: "charness-settings-skills-restore.json";
|
|
135
|
+
readonly withoutBotSkills: "charness-settings-skills-restore-without-bot-skills.json";
|
|
136
|
+
};
|
|
129
137
|
/** An Anthropic credential anywhere in a text (the trace preview redacts it). */
|
|
130
138
|
export declare const anthropicSecretInTextRe: RegExp;
|
|
131
139
|
/** Whether `text` (trimmed) is an Anthropic API key that can run Claude Code. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeProfiles.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,6DAA8D,CAAC;AACtG,eAAO,MAAM,kCAAkC,wBAAyB,CAAC;AAEzE,iGAAiG;AACjG,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAG7C,wHAAwH;AACxH,eAAO,MAAM,2BAA2B,UAAU,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,2GAA2G;AAC3G,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGpF;AAED,qEAAqE;AACrE,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,MAAqB,GAAG,MAAM,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CA6BlH;AAED;;;GAGG;AACH,wBAAgB,yBAAyB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AAM,GAAG,IAAI,GAAG,iBAAiB,CAMvF;AAID,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,UAAU,CAK3F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAQ7F;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM9E"}
|
|
@@ -54,7 +54,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
54
54
|
};
|
|
55
55
|
})();
|
|
56
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.claudeConfigDirVariableName = exports.anthropicSecretInTextRe = exports.claudeProfileLaunchSettingsFileName = exports.claudeProfileApiKeyFileName = exports.claudeConsoleLoginKeySource = exports.claudeAccountCallbackPrefix = exports.claudeProfileNameMaxLength = exports.claudeProfileOptionalSharedEntries = exports.claudeProfileSharedEntries = exports.claudeProfilesDirName = exports.defaultClaudeProfileName = void 0;
|
|
57
|
+
exports.claudeConfigDirVariableName = exports.anthropicSecretInTextRe = exports.claudeProfileSkillsRestoreSettingsFileNames = exports.claudeProfileLaunchSettingsFileName = exports.claudeProfileApiKeyFileName = exports.claudeConsoleLoginKeySource = exports.claudeAccountCallbackPrefix = exports.claudeProfileNameMaxLength = exports.claudeProfileOptionalSharedEntries = exports.claudeProfileSharedEntries = exports.claudeProfilesDirName = exports.defaultClaudeProfileName = void 0;
|
|
58
58
|
exports.checkIsValidClaudeProfileName = checkIsValidClaudeProfileName;
|
|
59
59
|
exports.normaliseClaudeProfileName = normaliseClaudeProfileName;
|
|
60
60
|
exports.resolveClaudeProfilesRoot = resolveClaudeProfilesRoot;
|
|
@@ -281,6 +281,14 @@ exports.claudeConsoleLoginKeySource = '/login managed key';
|
|
|
281
281
|
exports.claudeProfileApiKeyFileName = 'charness-api-key';
|
|
282
282
|
/** The launch settings of a profile that holds a pasted key: the PreCompact hook AND the `apiKeyHelper` (one file — only the last `--settings` counts). */
|
|
283
283
|
exports.claudeProfileLaunchSettingsFileName = 'charness-settings.json';
|
|
284
|
+
/**
|
|
285
|
+
* The same, for a launch that carries the skills restore (json-stream, per-turn; `utils/claudeCompactHook.ts`): a file per
|
|
286
|
+
* kind, so a tmux launch and a json-stream one of the same profile starting together never read each other's hooks.
|
|
287
|
+
*/
|
|
288
|
+
exports.claudeProfileSkillsRestoreSettingsFileNames = {
|
|
289
|
+
withBotSkills: 'charness-settings-skills-restore.json',
|
|
290
|
+
withoutBotSkills: 'charness-settings-skills-restore-without-bot-skills.json',
|
|
291
|
+
};
|
|
284
292
|
/** An Anthropic API key: `sk-ant-api03-…` (an admin key `sk-ant-admin…` or an OAuth token `sk-ant-oat…` cannot run Claude Code). */
|
|
285
293
|
const anthropicApiKeyRe = /^sk-ant-api\d{2}-[A-Za-z0-9_-]{20,250}$/;
|
|
286
294
|
/** Anything that starts like an Anthropic credential — deleted from the topic as a secret even when it is not a usable key. */
|
|
@@ -387,7 +395,9 @@ function writeClaudeProfileApiKey(configDir, apiKey) {
|
|
|
387
395
|
/** Drop a profile's pasted key (and the launch settings that point at it); a missing file is fine. */
|
|
388
396
|
function removeClaudeProfileApiKey(configDir) {
|
|
389
397
|
fs.rmSync(resolveClaudeProfileApiKeyFile(configDir), { force: true });
|
|
390
|
-
|
|
398
|
+
for (const fileName of [exports.claudeProfileLaunchSettingsFileName, ...Object.values(exports.claudeProfileSkillsRestoreSettingsFileNames)]) {
|
|
399
|
+
fs.rmSync(path.join(configDir, fileName), { force: true });
|
|
400
|
+
}
|
|
391
401
|
}
|
|
392
402
|
/**
|
|
393
403
|
* @description The stdout a failed `execFile` carries, `''` for anything else. `claude auth status --json`
|
|
@@ -1 +1 @@
|
|
|
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AC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,IAAmB,EAAE,KAAoB;IAClF,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAClD,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAAC,OAAe;IAC7D,iHAAiH;IACjH,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,uGAAuG,CAAC,CAAC;IACrI,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACnE,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Reads the part of a Claude transcript written since its previous compaction — what the skills restore
|
|
3
|
+
* (`utils/skillsRestore.ts`) needs at a compaction — BACKWARDS from the end, so a transcript of a hundred megabytes costs
|
|
4
|
+
* only its last epoch. Older epochs are not needed: what they loaded is carried by the records right after the previous
|
|
5
|
+
* boundary (Claude's own `invoked_skills` re-attach, the bot's previous restore).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @description The lines of `transcriptPath` after its LAST `compact_boundary` record (the whole file when there is none),
|
|
9
|
+
* oldest first, keeping only those that hold one of `wantedKeys` — matched on the RAW bytes, so a line that holds none is never
|
|
10
|
+
* decoded and the reader holds the lines that matter, not the epoch (every slot of the Claude restore runs this at once). A
|
|
11
|
+
* line is split only at newline bytes (never inside a UTF-8 character); a last line without a newline is kept as it is (a
|
|
12
|
+
* reader that parses it skips it if it is half written). `[]` for a file that cannot be read.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readClaudeTranscriptEpochLines(transcriptPath: string, wantedKeys: readonly string[]): string[];
|
|
15
|
+
//# sourceMappingURL=claudeTranscriptEpoch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeTranscriptEpoch.d.ts","sourceRoot":"","sources":["../../src/utils/claudeTranscriptEpoch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsBH;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CA0C9G"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description Reads the part of a Claude transcript written since its previous compaction — what the skills restore
|
|
4
|
+
* (`utils/skillsRestore.ts`) needs at a compaction — BACKWARDS from the end, so a transcript of a hundred megabytes costs
|
|
5
|
+
* only its last epoch. Older epochs are not needed: what they loaded is carried by the records right after the previous
|
|
6
|
+
* boundary (Claude's own `invoked_skills` re-attach, the bot's previous restore).
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.readClaudeTranscriptEpochLines = readClaudeTranscriptEpochLines;
|
|
43
|
+
const fs = __importStar(require("fs"));
|
|
44
|
+
const checkIsRecord_1 = require("./checkIsRecord");
|
|
45
|
+
/** How much of the file one read takes. */
|
|
46
|
+
const readChunkBytes = 1024 * 1024;
|
|
47
|
+
const newlineByte = 0x0a;
|
|
48
|
+
/** The key a line must carry to be a compaction boundary: checked on the raw bytes before anything is decoded. */
|
|
49
|
+
const compactBoundaryKey = Buffer.from('"compact_boundary"');
|
|
50
|
+
/** @description Whether the bytes of a transcript line are a compaction boundary record. */
|
|
51
|
+
function checkIsCompactBoundaryLine(lineBytes) {
|
|
52
|
+
if (lineBytes.indexOf(compactBoundaryKey) < 0)
|
|
53
|
+
return false;
|
|
54
|
+
try {
|
|
55
|
+
const record = JSON.parse(lineBytes.toString('utf8'));
|
|
56
|
+
return (0, checkIsRecord_1.checkIsRecord)(record) && record.type === 'system' && record.subtype === 'compact_boundary';
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @description The lines of `transcriptPath` after its LAST `compact_boundary` record (the whole file when there is none),
|
|
64
|
+
* oldest first, keeping only those that hold one of `wantedKeys` — matched on the RAW bytes, so a line that holds none is never
|
|
65
|
+
* decoded and the reader holds the lines that matter, not the epoch (every slot of the Claude restore runs this at once). A
|
|
66
|
+
* line is split only at newline bytes (never inside a UTF-8 character); a last line without a newline is kept as it is (a
|
|
67
|
+
* reader that parses it skips it if it is half written). `[]` for a file that cannot be read.
|
|
68
|
+
*/
|
|
69
|
+
function readClaudeTranscriptEpochLines(transcriptPath, wantedKeys) {
|
|
70
|
+
const wantedKeyBytes = wantedKeys.map((key) => Buffer.from(key));
|
|
71
|
+
let fd;
|
|
72
|
+
try {
|
|
73
|
+
fd = fs.openSync(transcriptPath, 'r');
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
const newestFirst = [];
|
|
79
|
+
try {
|
|
80
|
+
let position = fs.fstatSync(fd).size;
|
|
81
|
+
/** The bytes of a line whose start is in a chunk not read yet. */
|
|
82
|
+
let carry = Buffer.alloc(0);
|
|
83
|
+
const takeLine = (lineBytes) => {
|
|
84
|
+
if (checkIsCompactBoundaryLine(lineBytes))
|
|
85
|
+
return true;
|
|
86
|
+
if (lineBytes.length > 0 && wantedKeyBytes.some((key) => lineBytes.indexOf(key) >= 0))
|
|
87
|
+
newestFirst.push(lineBytes.toString('utf8'));
|
|
88
|
+
return false;
|
|
89
|
+
};
|
|
90
|
+
while (position > 0) {
|
|
91
|
+
const length = Math.min(readChunkBytes, position);
|
|
92
|
+
position -= length;
|
|
93
|
+
const chunk = Buffer.alloc(length);
|
|
94
|
+
fs.readSync(fd, chunk, 0, length, position);
|
|
95
|
+
let bytes = Buffer.concat([chunk, carry]);
|
|
96
|
+
let lineEnd = bytes.length;
|
|
97
|
+
for (let index = bytes.length - 1; index >= 0; index -= 1) {
|
|
98
|
+
if (bytes[index] !== newlineByte)
|
|
99
|
+
continue;
|
|
100
|
+
if (takeLine(bytes.subarray(index + 1, lineEnd)))
|
|
101
|
+
return newestFirst.reverse();
|
|
102
|
+
lineEnd = index;
|
|
103
|
+
}
|
|
104
|
+
bytes = bytes.subarray(0, lineEnd);
|
|
105
|
+
carry = Buffer.from(bytes);
|
|
106
|
+
}
|
|
107
|
+
if (carry.length > 0 && takeLine(carry))
|
|
108
|
+
return newestFirst.reverse();
|
|
109
|
+
return newestFirst.reverse();
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// A read that fails midway (the file truncated under the reader) keeps the newer lines it got: a restore of the skills
|
|
113
|
+
// those name beats none.
|
|
114
|
+
return newestFirst.reverse();
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
fs.closeSync(fd);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=claudeTranscriptEpoch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeTranscriptEpoch.js","sourceRoot":"","sources":["../../src/utils/claudeTranscriptEpoch.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,wEA0CC;AArED,uCAAyB;AACzB,mDAAgD;AAEhD,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AACnC,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,kHAAkH;AAClH,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAE7D,4FAA4F;AAC5F,SAAS,0BAA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AAO,EAAE,CAAC;QACtE,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,uHAAuH;QACvH,yBAAyB;QACzB,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Minimal shape of the bot's per-thread status coalescer that
|
|
3
|
+
* {@link clearStatusCoalescer} needs to drop. Mirrors the load-bearing
|
|
4
|
+
* fields of `bot.ts`'s `StatusCoalesceState`.
|
|
5
|
+
*/
|
|
6
|
+
export interface ClearableStatusCoalescer {
|
|
7
|
+
/** Latest status frame not yet sent. `null` = nothing pending. */
|
|
8
|
+
pendingText: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Armed timer that would resume a flush deferred during a 429 cooldown.
|
|
11
|
+
* `null` = none. Optional so older callers that don't track it still type.
|
|
12
|
+
*/
|
|
13
|
+
deferRetryTimer?: NodeJS.Timeout | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @description Drop a thread's not-yet-sent status frame when its session stops: a «🔧 tool» or «working…» frame queued before
|
|
17
|
+
* the stop must not appear after it. The frame already being sent (`flushStatusCoalescer` has taken its text) is at the API
|
|
18
|
+
* layer and is left alone. The agent's TEXT is not dropped here: a stop gives it one final attempt
|
|
19
|
+
* (`utils/groupOutputBacklog.ts` `startFinalGroupOutputAttempt`).
|
|
20
|
+
*
|
|
21
|
+
* Idempotent: clearing an already-empty coalescer is a no-op.
|
|
22
|
+
*/
|
|
23
|
+
export declare function clearStatusCoalescer(coalescer: ClearableStatusCoalescer | undefined): void;
|
|
24
|
+
//# sourceMappingURL=clearStatusCoalescer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearStatusCoalescer.d.ts","sourceRoot":"","sources":["../../src/utils/clearStatusCoalescer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,kEAAkE;IAClE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,wBAAwB,GAAG,SAAS,GAAG,IAAI,CAW1F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearStatusCoalescer = clearStatusCoalescer;
|
|
4
|
+
/**
|
|
5
|
+
* @description Drop a thread's not-yet-sent status frame when its session stops: a «🔧 tool» or «working…» frame queued before
|
|
6
|
+
* the stop must not appear after it. The frame already being sent (`flushStatusCoalescer` has taken its text) is at the API
|
|
7
|
+
* layer and is left alone. The agent's TEXT is not dropped here: a stop gives it one final attempt
|
|
8
|
+
* (`utils/groupOutputBacklog.ts` `startFinalGroupOutputAttempt`).
|
|
9
|
+
*
|
|
10
|
+
* Idempotent: clearing an already-empty coalescer is a no-op.
|
|
11
|
+
*/
|
|
12
|
+
function clearStatusCoalescer(coalescer) {
|
|
13
|
+
if (!coalescer)
|
|
14
|
+
return;
|
|
15
|
+
// Nulling `pendingText` makes the running flush loop (if any) exit on its
|
|
16
|
+
// next iteration without sending a stale frame. The coalescer can also
|
|
17
|
+
// hold a defer-retry timer armed during a 429 cooldown — cancel it too,
|
|
18
|
+
// otherwise it would fire into a stopped session.
|
|
19
|
+
coalescer.pendingText = null;
|
|
20
|
+
if (coalescer.deferRetryTimer) {
|
|
21
|
+
clearTimeout(coalescer.deferRetryTimer);
|
|
22
|
+
coalescer.deferRetryTimer = null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=clearStatusCoalescer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearStatusCoalescer.js","sourceRoot":"","sources":["../../src/utils/clearStatusCoalescer.ts"],"names":[],"mappings":";;AAuBA,oDAWC;AAnBD;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,SAA+C;IAClF,IAAI,CAAC,SAAS;QAAE,OAAO;IACvB,0EAA0E;IAC1E,uEAAuE;IACvE,wEAAwE;IACxE,kDAAkD;IAClD,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;IAC7B,IAAI,SAAS,CAAC,eAAe,EAAE,CAAC;QAC9B,YAAY,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QACxC,SAAS,CAAC,eAAe,GAAG,IAAI,CAAC;IACnC,CAAC;AACH,CAAC"}
|