charness 4.0.1 → 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 +14 -0
- package/DEVELOPMENT.md +2 -1
- 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
|
@@ -42,12 +42,28 @@
|
|
|
42
42
|
* therefore leaves the resume guidance out of its instruction when the folder's
|
|
43
43
|
* instance has the CURRENT plugin ({@link checkHasOpenCodeCompactPlugin} over
|
|
44
44
|
* `GET /config`), and keeps it otherwise.
|
|
45
|
+
*
|
|
46
|
+
* The same plugin gives a session its skills back after every compaction (plan `2026-11-12-skills-reload-after-compaction`,
|
|
47
|
+
* S4): nothing reloads a skill there by itself, so the summary used to drop its text entirely. Its
|
|
48
|
+
* `experimental.chat.messages.transform` hook runs before every model request of the session's loop (measured on the fork
|
|
49
|
+
* build: the overflow compaction's synthetic "Continue…" request, the first request after a manual compaction and after a
|
|
50
|
+
* server restart all carried the part it added) and over the in-memory list only — nothing it adds is stored, sent over SSE
|
|
51
|
+
* or shown. Once the list holds a finished summary it adds ONE synthetic text part, the restore ({@link
|
|
52
|
+
* buildOpenCodeCompactPluginSource}), to the compaction's own user message — right before the summary, a fixed place, so
|
|
53
|
+
* every later request starts the same and the prompt cache holds. Within one turn the fork converts a message once and
|
|
54
|
+
* reuses that while the message IDS stay an unchanged prefix (`appendOnlyModelMessages`, verified in the fork's
|
|
55
|
+
* `session/prompt.ts`: the snapshot starts over only on a compaction, a sub-task and an overflow): a restore rebuilt in the
|
|
56
|
+
* same turn — the lookups of the first one did not answer in time — would never reach the provider. So the message the part
|
|
57
|
+
* rides on carries an id tagged with the restore's revision (in memory only; the provider never sees message ids): a new
|
|
58
|
+
* text, a new id, a fresh conversion; the same text, the same id, the same prefix. The compaction's own request runs the hook too, but
|
|
59
|
+
* the fork hides the earlier summaries from it (measured on the first and on a second compaction), so it holds none and is
|
|
60
|
+
* left as it is.
|
|
45
61
|
*/
|
|
46
62
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
63
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
64
|
};
|
|
49
65
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.openCodeCompactPluginFileName = exports.openCodeAncestryLookupTimeoutMs = exports.legacyOpenCodeCompactPluginId = exports.legacyOpenCodeCompactPluginFileName = exports.openCodeCompactPluginId = void 0;
|
|
66
|
+
exports.openCodeCompactPluginFileName = exports.openCodeHistoryLookupTimeoutMs = exports.openCodeAncestryLookupTimeoutMs = exports.legacyOpenCodeCompactPluginId = exports.legacyOpenCodeCompactPluginFileName = exports.openCodeCompactPluginId = void 0;
|
|
51
67
|
exports.getOpenCodeCompactPluginContext = getOpenCodeCompactPluginContext;
|
|
52
68
|
exports.buildOpenCodeCompactPluginSource = buildOpenCodeCompactPluginSource;
|
|
53
69
|
exports.getOpenCodeCompactPluginFileName = getOpenCodeCompactPluginFileName;
|
|
@@ -61,6 +77,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
61
77
|
const os_1 = __importDefault(require("os"));
|
|
62
78
|
const path_1 = __importDefault(require("path"));
|
|
63
79
|
const compactOnIdle_1 = require("./compactOnIdle");
|
|
80
|
+
const skillsRestore_1 = require("./skillsRestore");
|
|
64
81
|
const compactSelfReviewFlags_1 = require("./compactSelfReviewFlags");
|
|
65
82
|
const legacyNames_1 = require("../legacyNames");
|
|
66
83
|
/** OpenCode requires a path plugin to export an id. */
|
|
@@ -100,6 +117,31 @@ const maxSessionAncestryDepth = 8;
|
|
|
100
117
|
* time means ON, like one that fails: the section is asked for, as before the switch.
|
|
101
118
|
*/
|
|
102
119
|
exports.openCodeAncestryLookupTimeoutMs = 2000;
|
|
120
|
+
/** The id of the part the restore adds: one per message, so a list the hook sees twice never gets two. */
|
|
121
|
+
const skillsRestorePartId = 'prt_charness_skills_restore';
|
|
122
|
+
/** How many sessions' restores a plugin instance keeps (one per summary): a long-lived server must not grow without end. */
|
|
123
|
+
const maxCachedSkillsRestores = 64;
|
|
124
|
+
/**
|
|
125
|
+
* How long the restore waits for the session's stored history: longer than the other lookups, since a long session's whole
|
|
126
|
+
* history is a big answer and the read runs once per compaction (a whole restore is kept for the summary's later requests).
|
|
127
|
+
*/
|
|
128
|
+
exports.openCodeHistoryLookupTimeoutMs = 10_000;
|
|
129
|
+
/**
|
|
130
|
+
* The functions of the restore the plugin carries as source (`toString()`): the bot's own, written self-contained so that
|
|
131
|
+
* the plugin and the bot can never disagree on the block, the skills or the words. `__name` is a no-op stand-in for the
|
|
132
|
+
* helper the test runner's transform injects into function bodies; the built `dist/` needs none. Their text is the COMPILED
|
|
133
|
+
* one, so the plugin's source — and its hashed file name — follows the compiler: a process run through `tsx` names another
|
|
134
|
+
* file than the built bot (a test that hands the built bot a plugin name takes it from `dist/`).
|
|
135
|
+
*/
|
|
136
|
+
const embeddedSkillsRestoreFunctions = [
|
|
137
|
+
compactOnIdle_1.readSkillsBlockLineName,
|
|
138
|
+
compactOnIdle_1.parseSkillsBlock,
|
|
139
|
+
skillsRestore_1.getOpenCodeLoadedSkills,
|
|
140
|
+
skillsRestore_1.planOpenCodeSkillsRestore,
|
|
141
|
+
skillsRestore_1.renderSkillsRestoreList,
|
|
142
|
+
skillsRestore_1.renderSkillsRestoreSection,
|
|
143
|
+
skillsRestore_1.buildSkillsRestoreText,
|
|
144
|
+
];
|
|
103
145
|
/**
|
|
104
146
|
* @description The plugin module source: a v1 plugin (`default` export with `id` + `server`). Before a compaction it looks for
|
|
105
147
|
* the flag the bot keeps for the session (`utils/compactSelfReviewFlags.ts`): present ⇒ `/compact_self_review` is off for the
|
|
@@ -111,6 +153,18 @@ exports.openCodeAncestryLookupTimeoutMs = 2000;
|
|
|
111
153
|
* {@link maxSessionAncestryDepth} levels: a topic's sub-agents follow the topic. A folder with no flag in it at all costs no
|
|
112
154
|
* request. A session id that is not a plain id, a lookup that fails or is not answered within
|
|
113
155
|
* {@link openCodeAncestryLookupTimeoutMs}, or any read failure means ON: the section is asked for, as before the switch.
|
|
156
|
+
*
|
|
157
|
+
* Before every model request (`experimental.chat.messages.transform`) it gives the skills back once the list holds a finished
|
|
158
|
+
* summary: the skills of the session's stored history (`client.session.messages`, every compaction so far) and of the
|
|
159
|
+
* summary's block, the server's current text of each (`GET /skill`; the plugin's client is the v1 SDK, which has no method for
|
|
160
|
+
* it, so the request goes through its inner client, which carries the folder and the password — measured on the fork build),
|
|
161
|
+
* a skill whose call is already after the summary only named, a name only the block holds (with the history known) given a
|
|
162
|
+
* "load it" line. A restore whose lookups both answered is kept for the summary, so every later request gets the same text;
|
|
163
|
+
* one that is not whole (a lookup failed or timed out) serves its request only, is logged to the server log once per summary,
|
|
164
|
+
* and the next request asks again. The history waits up to {@link openCodeHistoryLookupTimeoutMs}, the skill list up to
|
|
165
|
+
* {@link openCodeAncestryLookupTimeoutMs}: a history that does not come is replaced by the calls the list itself holds, a
|
|
166
|
+
* skill list that does not come leaves "load it with the skill tool" lines. Should the SDK's inner client be gone, the skill
|
|
167
|
+
* list is fetched from the server directly (logged once). Nothing ever throws out of it or holds the request longer.
|
|
114
168
|
*/
|
|
115
169
|
function buildOpenCodeCompactPluginSource(input) {
|
|
116
170
|
return [
|
|
@@ -149,12 +203,149 @@ function buildOpenCodeCompactPluginSource(input) {
|
|
|
149
203
|
' }',
|
|
150
204
|
' return false;',
|
|
151
205
|
'};',
|
|
206
|
+
// The skills restore: the bot's own functions, then the hook's glue.
|
|
207
|
+
'const __name = (target) => target;',
|
|
208
|
+
...embeddedSkillsRestoreFunctions.map((restoreFunction) => restoreFunction.toString()),
|
|
209
|
+
`const restoreTexts = ${JSON.stringify(skillsRestore_1.skillsRestoreTexts)};`,
|
|
210
|
+
`const restoreToolName = ${JSON.stringify(skillsRestore_1.openCodeSkillToolName)};`,
|
|
211
|
+
`const skillsBlockMarkers = ${JSON.stringify({ start: compactOnIdle_1.compactionSkillsBlockStartMarker, end: compactOnIdle_1.compactionSkillsBlockEndMarker, maxNameLength: compactOnIdle_1.compactionSkillsBlockMaxNameLength })};`,
|
|
212
|
+
`const restorePartId = ${JSON.stringify(skillsRestorePartId)};`,
|
|
213
|
+
`const maxCachedRestores = ${maxCachedSkillsRestores};`,
|
|
214
|
+
`const historyLookupTimeoutMs = ${exports.openCodeHistoryLookupTimeoutMs};`,
|
|
215
|
+
'const restoreCache = new Map();',
|
|
216
|
+
'const loggedFallbackKeys = new Set();',
|
|
217
|
+
'let isInnerClientMissingLogged = false;',
|
|
218
|
+
// A server answer, or a rejection when it does not come in time (the timer is always cleared; a late answer is ignored).
|
|
219
|
+
'const askServer = async (request, timeoutMs) => {',
|
|
220
|
+
' let timer;',
|
|
221
|
+
' try {',
|
|
222
|
+
' const timeout = new Promise((_resolve, reject) => { timer = setTimeout(() => reject(new Error("the server did not answer in time")), timeoutMs); });',
|
|
223
|
+
' return await Promise.race([request(), timeout]);',
|
|
224
|
+
' } finally {',
|
|
225
|
+
' clearTimeout(timer);',
|
|
226
|
+
' }',
|
|
227
|
+
'};',
|
|
228
|
+
'const logToServer = (client, message) => {',
|
|
229
|
+
' try { Promise.resolve(client?.app?.log?.({ body: { service: "charness-compaction", level: "info", message } })).catch(() => {}); } catch {}',
|
|
230
|
+
'};',
|
|
231
|
+
'const readHistory = async (client, sessionID) => {',
|
|
232
|
+
' try {',
|
|
233
|
+
' const answer = await askServer(() => client.session.messages({ path: { id: sessionID } }), historyLookupTimeoutMs);',
|
|
234
|
+
' return Array.isArray(answer?.data) ? answer.data : null;',
|
|
235
|
+
' } catch { return null; }',
|
|
236
|
+
'};',
|
|
237
|
+
// The server itself, asked the way its own client asks it: the folder, and the password the server was started with.
|
|
238
|
+
'const fetchSkillsDirectly = async (pluginContext) => {',
|
|
239
|
+
' const url = new URL("/skill", pluginContext.serverUrl);',
|
|
240
|
+
' if (typeof pluginContext.directory === "string") url.searchParams.set("directory", pluginContext.directory);',
|
|
241
|
+
' const password = process.env.OPENCODE_SERVER_PASSWORD;',
|
|
242
|
+
' const headers = password ? { Authorization: `Basic ${Buffer.from(`${process.env.OPENCODE_SERVER_USERNAME || "opencode"}:${password}`).toString("base64")}` } : {};',
|
|
243
|
+
' const response = await fetch(url, { headers });',
|
|
244
|
+
' if (!response.ok) throw new Error(`GET /skill answered ${response.status}`);',
|
|
245
|
+
' return { data: await response.json() };',
|
|
246
|
+
'};',
|
|
247
|
+
'const readAvailableSkills = async (pluginContext) => {',
|
|
248
|
+
' const client = pluginContext?.client;',
|
|
249
|
+
' const hasInnerClient = typeof client?._client?.get === "function";',
|
|
250
|
+
' if (!hasInnerClient && !isInnerClientMissingLogged) {',
|
|
251
|
+
' isInnerClientMissingLogged = true;',
|
|
252
|
+
' logToServer(client, "skills restore: the plugin client has no inner client for GET /skill (an SDK change?); asking the server directly");',
|
|
253
|
+
' }',
|
|
254
|
+
' try {',
|
|
255
|
+
' const answer = await askServer(() => (hasInnerClient ? client._client.get({ url: "/skill" }) : fetchSkillsDirectly(pluginContext)), lookupTimeoutMs);',
|
|
256
|
+
' if (!Array.isArray(answer?.data)) return null;',
|
|
257
|
+
' return answer.data.filter((skill) => typeof skill?.name === "string" && typeof skill.location === "string" && typeof skill.content === "string");',
|
|
258
|
+
' } catch { return null; }',
|
|
259
|
+
'};',
|
|
260
|
+
// A summary whose block and the session's history disagree is worth a line in the server log (the model forgot or mangled a
|
|
261
|
+
// name, or listed skills it could load); the restore goes by the history then.
|
|
262
|
+
'const logBlockMismatch = (client, sessionID, blockNames, loaded) => {',
|
|
263
|
+
' if (loaded === null || blockNames.length === 0) return;',
|
|
264
|
+
' const blockOnly = blockNames.filter((name) => !loaded.some((mention) => mention.name === name));',
|
|
265
|
+
' const historyOnly = loaded.map((mention) => mention.name).filter((name) => !blockNames.includes(name));',
|
|
266
|
+
' if (blockOnly.length === 0 && historyOnly.length === 0) return;',
|
|
267
|
+
' logToServer(client, `skills restore of ${sessionID}: the summary block names [${blockOnly.join(", ")}] the history does not show, the history shows [${historyOnly.join(", ")}] the block leaves out`);',
|
|
268
|
+
'};',
|
|
269
|
+
'const findFinishedSummaryIndex = (messages) => {',
|
|
270
|
+
' for (let index = messages.length - 1; index >= 0; index -= 1) {',
|
|
271
|
+
' const info = messages[index]?.info;',
|
|
272
|
+
' if (info?.role === "assistant" && info.summary === true && info.finish && !info.error) return index;',
|
|
273
|
+
' }',
|
|
274
|
+
' return -1;',
|
|
275
|
+
'};',
|
|
276
|
+
// The restore and whether it is whole: both lookups answered. Only a whole one is kept for the summary's later requests.
|
|
277
|
+
'const buildRestore = async (pluginContext, messages, summaryIndex) => {',
|
|
278
|
+
' const client = pluginContext?.client;',
|
|
279
|
+
' const summary = messages[summaryIndex];',
|
|
280
|
+
' const sessionID = summary.info.sessionID;',
|
|
281
|
+
' const summaryText = (summary.parts ?? []).filter((part) => part?.type === "text" && typeof part.text === "string").map((part) => part.text).join("\\n");',
|
|
282
|
+
' const blockNames = parseSkillsBlock(summaryText, skillsBlockMarkers.start, skillsBlockMarkers.end, skillsBlockMarkers.maxNameLength) ?? [];',
|
|
283
|
+
' const inContextNames = getOpenCodeLoadedSkills(messages.slice(summaryIndex + 1)).map((mention) => mention.name);',
|
|
284
|
+
' const [history, available] = await Promise.all([readHistory(client, sessionID), readAvailableSkills(pluginContext)]);',
|
|
285
|
+
' const loaded = getOpenCodeLoadedSkills(history ?? messages);',
|
|
286
|
+
' const isWhole = history !== null && available !== null;',
|
|
287
|
+
' const cacheKey = `${sessionID}:${summary.info.id}`;',
|
|
288
|
+
// A summary whose lookups recovered no longer needs its fallback mark; the marks are bounded like the cache.
|
|
289
|
+
' if (isWhole) {',
|
|
290
|
+
' loggedFallbackKeys.delete(cacheKey);',
|
|
291
|
+
' logBlockMismatch(client, sessionID, blockNames, loaded);',
|
|
292
|
+
' } else if (!loggedFallbackKeys.has(cacheKey)) {',
|
|
293
|
+
' loggedFallbackKeys.add(cacheKey);',
|
|
294
|
+
' if (loggedFallbackKeys.size > maxCachedRestores) loggedFallbackKeys.delete(loggedFallbackKeys.values().next().value);',
|
|
295
|
+
' const missing = [history === null ? "the history" : null, available === null ? "the skill list" : null].filter(Boolean).join(" and ");',
|
|
296
|
+
' logToServer(client, `skills restore of ${sessionID}: ${missing} did not answer; this request gets what is known, the next one asks again`);',
|
|
297
|
+
' }',
|
|
298
|
+
' const entries = planOpenCodeSkillsRestore({ loaded, blockNames, inContextNames, available, isHistoryKnown: history !== null });',
|
|
299
|
+
' return { text: buildSkillsRestoreText(entries, restoreTexts, restoreToolName), isWhole };',
|
|
300
|
+
'};',
|
|
301
|
+
// A short, stable revision of a restore text (FNV-1a): the same text, the same revision.
|
|
302
|
+
'const getRestoreRevision = (text) => {',
|
|
303
|
+
' let hash = 0x811c9dc5;',
|
|
304
|
+
' for (let index = 0; index < text.length; index += 1) {',
|
|
305
|
+
' hash ^= text.charCodeAt(index);',
|
|
306
|
+
' hash = Math.imul(hash, 0x01000193);',
|
|
307
|
+
' }',
|
|
308
|
+
' return (hash >>> 0).toString(16).padStart(8, "0");',
|
|
309
|
+
'};',
|
|
310
|
+
'const restoreSkills = async (pluginContext, messages) => {',
|
|
311
|
+
' if (!Array.isArray(messages)) return;',
|
|
312
|
+
' const summaryIndex = findFinishedSummaryIndex(messages);',
|
|
313
|
+
' if (summaryIndex < 0) return;',
|
|
314
|
+
' const summary = messages[summaryIndex];',
|
|
315
|
+
' const targetIndex = messages.findIndex((message) => message?.info?.role === "user" && message.info.id === summary.info.parentID);',
|
|
316
|
+
' const target = messages[targetIndex];',
|
|
317
|
+
' if (!target || !Array.isArray(target.parts) || target.parts.some((part) => part?.id === restorePartId)) return;',
|
|
318
|
+
' const cacheKey = `${summary.info.sessionID}:${summary.info.id}`;',
|
|
319
|
+
' let text = restoreCache.get(cacheKey);',
|
|
320
|
+
' if (text === undefined) {',
|
|
321
|
+
' const restore = await buildRestore(pluginContext, messages, summaryIndex);',
|
|
322
|
+
' text = restore.text;',
|
|
323
|
+
' if (restore.isWhole) {',
|
|
324
|
+
' restoreCache.set(cacheKey, text);',
|
|
325
|
+
' if (restoreCache.size > maxCachedRestores) restoreCache.delete(restoreCache.keys().next().value);',
|
|
326
|
+
' }',
|
|
327
|
+
' }',
|
|
328
|
+
' if (text === "") return;',
|
|
329
|
+
// A COPY of the compaction's message, its id tagged with the restore's revision: the fork keeps a turn's conversion and
|
|
330
|
+
// reuses it while the message ids stay an unchanged prefix, so a restore rebuilt in the same turn (a lookup that answered
|
|
331
|
+
// late) must change an id to reach the provider; the same restore keeps the same id (and the prompt cache). A copy, so the
|
|
332
|
+
// message object the loop may hold elsewhere keeps its stored id.
|
|
333
|
+
' const revisedID = `${target.info.id}_charness_skills_${getRestoreRevision(text)}`;',
|
|
334
|
+
' messages[targetIndex] = {',
|
|
335
|
+
' ...target,',
|
|
336
|
+
' info: { ...target.info, id: revisedID },',
|
|
337
|
+
' parts: [...target.parts, { id: restorePartId, sessionID: summary.info.sessionID, messageID: revisedID, type: "text", synthetic: true, text }],',
|
|
338
|
+
' };',
|
|
339
|
+
'};',
|
|
152
340
|
'export default {',
|
|
153
341
|
` id: ${JSON.stringify(exports.openCodeCompactPluginId)},`,
|
|
154
342
|
' server: async (pluginContext) => ({',
|
|
155
343
|
' "experimental.session.compacting": async (input, output) => {',
|
|
156
344
|
' output.context.push((await checkIsSelfReviewOff(pluginContext?.client, input?.sessionID)) ? contextWithoutInstructionGaps : context);',
|
|
157
345
|
' },',
|
|
346
|
+
' "experimental.chat.messages.transform": async (_input, output) => {',
|
|
347
|
+
' try { await restoreSkills(pluginContext, output?.messages); } catch {}',
|
|
348
|
+
' },',
|
|
158
349
|
' }),',
|
|
159
350
|
'};',
|
|
160
351
|
'',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openCodeCompactPlugin.js","sourceRoot":"","sources":["../../src/utils/openCodeCompactPlugin.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"openCodeCompactPlugin.js","sourceRoot":"","sources":["../../src/utils/openCodeCompactPlugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;;;;;;AAoDH,0EAEC;AAsED,4EAwLC;AAeD,4EAGC;AAMD,wEAGC;AAUD,sEAMC;AAcD,gEAMC;AAMD,4EAKC;AA+DD,oE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iC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC;gBAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;YAC7D,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IACD,oCAAoC,CAAC,SAAS,CAAC,CAAC;IAChD,OAAO,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description What the bot puts back into an agent's context after a compaction so that the skills it had loaded keep
|
|
3
|
+
* applying — the owner's guarantee that a compaction never leaves an agent without the procedures it was following (plan
|
|
4
|
+
* `2026-11-12-skills-reload-after-compaction`, S2). Pure: no file is read here; the Claude hook
|
|
5
|
+
* (`hooks/claudeSkillsRestoreHook.ts`) reads the transcript and the skill files and hands them in, and the OpenCode plugin
|
|
6
|
+
* (`openCodeCompactPlugin.ts`) embeds the self-contained renderers below.
|
|
7
|
+
*
|
|
8
|
+
* skills = what the records show was loaded (newest first) ∪ what the summary's block names (OpenCode)
|
|
9
|
+
* resolve = each skill's CURRENT text, or "not available now", or "load it with the tool"
|
|
10
|
+
* payload = {@link skillsRestoreHeader}, the list (every skill, with where its text is), then each restored skill whole
|
|
11
|
+
*
|
|
12
|
+
* Claude: the transcript records, read back to the previous compaction — a skill loaded with the Skill tool or a slash
|
|
13
|
+
* command (its `Base directory for this skill: <dir>` message), Claude's own re-attach of the previous compaction
|
|
14
|
+
* (`invoked_skills`, which carries older epochs) and the bot's previous restore (which carries what Claude's re-attach
|
|
15
|
+
* dropped). Every skill comes back whole, also one Claude may re-attach itself ({@link planClaudeSkillsRestore} says why).
|
|
16
|
+
* OpenCode: a skill whose call is already after the summary is only named.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* What opens the context the bot's hook (Claude, `hooks/claudeSkillsRestoreHook.ts`) and plugin (OpenCode,
|
|
20
|
+
* `openCodeCompactPlugin.ts`) add after a compaction. Agent-facing only: the summary the person may see never names it.
|
|
21
|
+
*/
|
|
22
|
+
export declare const skillsRestoreHeader = "[Charness: skills restored after compaction]";
|
|
23
|
+
/** How a skill comes back. */
|
|
24
|
+
export type SkillsRestoreStatus = 'text' | 'inContext' | 'unavailable' | 'loadWithTool';
|
|
25
|
+
/** One skill of the restore: its name, where its text is, and that text when the restore carries it. */
|
|
26
|
+
export interface SkillsRestoreEntry {
|
|
27
|
+
name: string;
|
|
28
|
+
status: SkillsRestoreStatus;
|
|
29
|
+
/** The folder of its `SKILL.md`, when known: relative paths in the skill resolve from it. */
|
|
30
|
+
baseDir: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The full path of the `SKILL.md` its text is read from, when known (Claude: `<baseDir>/SKILL.md`; OpenCode: the location
|
|
33
|
+
* the server reports) — the file an agent told to change the skill must edit.
|
|
34
|
+
*/
|
|
35
|
+
skillFile: string | null;
|
|
36
|
+
/** The skill's current text (frontmatter stripped), for {@link SkillsRestoreStatus} `text` only. */
|
|
37
|
+
body: string | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The agent-facing wording of the restore (English: an agent reads it, whatever the topic's language). One object, so the
|
|
41
|
+
* OpenCode plugin can carry it as JSON into the self-contained renderers it embeds.
|
|
42
|
+
*/
|
|
43
|
+
export interface SkillsRestoreTexts {
|
|
44
|
+
header: string;
|
|
45
|
+
/** A part's place among the parts: `{i}` of `{n}`. */
|
|
46
|
+
partLabel: string;
|
|
47
|
+
intro: string;
|
|
48
|
+
/** Added to the intro when the restore comes in more than one part. */
|
|
49
|
+
multiPartNote: string;
|
|
50
|
+
listHeading: string;
|
|
51
|
+
listContinuedHeading: string;
|
|
52
|
+
statuses: Record<SkillsRestoreStatus, string>;
|
|
53
|
+
/** After a list line whose skill file is known. */
|
|
54
|
+
skillFileSuffix: string;
|
|
55
|
+
/** After a list line that knows only the folder (and in the restores written before the skill file was named). */
|
|
56
|
+
baseDirSuffix: string;
|
|
57
|
+
sectionHeading: string;
|
|
58
|
+
sectionContinued: string;
|
|
59
|
+
baseDirLine: string;
|
|
60
|
+
skillFileLine: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The words of the restore. `{tool}` is the backend's skill tool (`Skill` / `skill`), `{dir}` a base directory, `{file}` the
|
|
64
|
+
* full path of a skill's `SKILL.md`, `{name}` a skill, `{i}` / `{n}` a part's number and the count, `{previous}` the part a
|
|
65
|
+
* long skill continues from.
|
|
66
|
+
*/
|
|
67
|
+
export declare const skillsRestoreTexts: SkillsRestoreTexts;
|
|
68
|
+
/** The file a Claude skill's text is in, inside its base directory. */
|
|
69
|
+
export declare const claudeSkillFileName = "SKILL.md";
|
|
70
|
+
/** The name of the skill tool of each backend, as the restore tells the agent to use it. */
|
|
71
|
+
export declare const claudeSkillToolName = "Skill";
|
|
72
|
+
export declare const openCodeSkillToolName = "skill";
|
|
73
|
+
/**
|
|
74
|
+
* @description The lines of the restore's list — the intro and every skill with where its text is — before any skill text.
|
|
75
|
+
* A skill's line ends with its skill file when known (the file to edit), else with its folder. Self-contained (it reads
|
|
76
|
+
* nothing outside its parameters): the OpenCode plugin embeds its source.
|
|
77
|
+
*/
|
|
78
|
+
export declare function renderSkillsRestoreList(entries: readonly SkillsRestoreEntry[], texts: SkillsRestoreTexts, toolName: string): string[];
|
|
79
|
+
/**
|
|
80
|
+
* @description The lines of one restored skill: its heading, its base directory (the line Claude's own skill message opens
|
|
81
|
+
* with, so relative paths in the skill resolve as they did), right under it the full path of its skill file (so an agent told
|
|
82
|
+
* to change the skill edits the right file), and its text. Self-contained, as {@link renderSkillsRestoreList}.
|
|
83
|
+
*/
|
|
84
|
+
export declare function renderSkillsRestoreSection(entry: SkillsRestoreEntry, texts: SkillsRestoreTexts): string[];
|
|
85
|
+
/**
|
|
86
|
+
* @description The whole restore as ONE text (OpenCode: no size limit, one part): the header, the list, then every skill
|
|
87
|
+
* whose status is `text`, whole. `''` when there is no skill — nothing is added at all. Self-contained (it calls only the
|
|
88
|
+
* two renderers above), as the plugin embeds it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildSkillsRestoreText(entries: readonly SkillsRestoreEntry[], texts: SkillsRestoreTexts, toolName: string): string;
|
|
91
|
+
/**
|
|
92
|
+
* How many `SessionStart` hook slots carry the Claude restore, and how long each part may be. Claude Code caps what ONE hook
|
|
93
|
+
* adds at 10,000 characters (a longer one becomes a file and a 2,000-character preview); several hooks of one event each
|
|
94
|
+
* get their own cap. Measured on Claude Code 2.1.322 (`-p`, stream-json, a manual `/compact`): 24 slots of 9,500 characters
|
|
95
|
+
* each, all full, reached the next model request whole — 228,000 characters, no preview, no total cap (the parts arrive in
|
|
96
|
+
* the order the hooks finished, not by slot number: hence the part labels). A slot with nothing to say prints nothing and
|
|
97
|
+
* costs nothing.
|
|
98
|
+
*/
|
|
99
|
+
export declare const skillsRestoreSlotCount = 24;
|
|
100
|
+
export declare const skillsRestorePartMaxChars = 9500;
|
|
101
|
+
/**
|
|
102
|
+
* @description The Claude restore as the parts its `SessionStart` hook slots print, each at most `partMaxChars` long, label
|
|
103
|
+
* included. Every restored skill goes in WHOLE, newest first; one that would no longer fit into `slotCount` parts gets the
|
|
104
|
+
* "load it with the tool" line instead (the newer skills are kept first). `[]` when there is no skill.
|
|
105
|
+
*/
|
|
106
|
+
export declare function buildClaudeSkillsRestoreParts(entries: readonly SkillsRestoreEntry[], texts: SkillsRestoreTexts, slotCount: number, partMaxChars: number): string[];
|
|
107
|
+
/** The line Claude's own skill message opens with (and the content of its re-attach). */
|
|
108
|
+
export declare const claudeSkillBaseDirPrefix = "Base directory for this skill: ";
|
|
109
|
+
/** One load of a skill the transcript shows: its name and its folder. */
|
|
110
|
+
export interface ClaudeSkillLoad {
|
|
111
|
+
name: string;
|
|
112
|
+
baseDir: string;
|
|
113
|
+
}
|
|
114
|
+
/** A skill the bot's previous restore named. */
|
|
115
|
+
export interface RestoredSkillMention {
|
|
116
|
+
name: string;
|
|
117
|
+
baseDir: string | null;
|
|
118
|
+
}
|
|
119
|
+
/** What the records since the previous compaction show about the skills. */
|
|
120
|
+
export interface ClaudeEpochSkills {
|
|
121
|
+
/** Loads since the previous compaction (Skill tool or slash command), newest first, one per skill. */
|
|
122
|
+
loads: ClaudeSkillLoad[];
|
|
123
|
+
/** Claude's own re-attach at the previous compaction (`invoked_skills`), in its order (newest first). */
|
|
124
|
+
reattached: ClaudeSkillLoad[];
|
|
125
|
+
/** The bot's previous restore, in its order. */
|
|
126
|
+
previousRestore: RestoredSkillMention[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The keys a transcript line must carry to matter to {@link collectClaudeEpochSkills} — checked on the raw line before
|
|
130
|
+
* `JSON.parse`, as a transcript can be a hundred megabytes and almost none of it is about skills.
|
|
131
|
+
*/
|
|
132
|
+
export declare const claudeSkillRecordKeys: readonly string[];
|
|
133
|
+
/** @description Whether a raw transcript line can matter to {@link collectClaudeEpochSkills}. */
|
|
134
|
+
export declare function checkIsClaudeSkillRecordLine(line: string): boolean;
|
|
135
|
+
/** @description The folder a skill message names in its first line, or `null` when the text is no skill message. */
|
|
136
|
+
export declare function readSkillMessageBaseDir(text: string): string | null;
|
|
137
|
+
/**
|
|
138
|
+
* @description The skills named by the list of a restore the bot wrote earlier ({@link renderSkillsRestoreList}), from the
|
|
139
|
+
* texts the hook gave (`hook_additional_context`): every `- <name>: …` line under the list's heading, with its base directory
|
|
140
|
+
* when the line gives one — the folder of its skill file (the current wording), or the folder itself (the wording of the
|
|
141
|
+
* restores written before the skill file was named). Lines of a skill's text never count — they come after the list. `[]`
|
|
142
|
+
* for texts that hold no restore of ours.
|
|
143
|
+
*/
|
|
144
|
+
export declare function parseSkillsRestoreList(contextTexts: readonly string[], texts?: SkillsRestoreTexts): RestoredSkillMention[];
|
|
145
|
+
/**
|
|
146
|
+
* @description Read the skills out of the transcript lines since the previous compaction (oldest first, as in the file).
|
|
147
|
+
* A load is the skill message the CLI writes after a SUCCESSFUL load — `isMeta`, opening `Base directory for this skill:
|
|
148
|
+
* <dir>` — so a failed Skill call (no such message) counts for nothing. Its name: the Skill tool's `skill` input of the call
|
|
149
|
+
* the message answers (`sourceToolUseID`), else the slash command the message follows (`<command-name>/name</command-name>`
|
|
150
|
+
* in the record its `parentUuid` names — measured on Claude Code 2.1.322), else the folder's name. A sub-agent's records
|
|
151
|
+
* (`isSidechain`) and lines that are no records are skipped.
|
|
152
|
+
*/
|
|
153
|
+
export declare function collectClaudeEpochSkills(epochLines: readonly string[]): ClaudeEpochSkills;
|
|
154
|
+
/** @description A `SKILL.md`'s body as the CLI loads it: the frontmatter (between the first two `---` lines) and the blank lines after it dropped. */
|
|
155
|
+
export declare function stripSkillFrontmatter(fileText: string): string;
|
|
156
|
+
/** How the hook reads a skill's file now. */
|
|
157
|
+
export interface SkillFolderReader {
|
|
158
|
+
/** The text of the skill file at `skillFile` (a full path), or `null` when it is gone or unreadable. */
|
|
159
|
+
readSkillFile(skillFile: string): string | null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @description The Claude restore's entries, newest first: every skill this epoch loaded, Claude's previous re-attach carried
|
|
163
|
+
* and the bot's previous restore named. A skill whose folder is inside `unavailableDir` (the bot's own skills, when this
|
|
164
|
+
* process was started without them) or whose `SKILL.md` is gone is "not available now"; a name with no known folder gets the
|
|
165
|
+
* "load it with the tool" line; EVERY other skill comes back with its CURRENT text.
|
|
166
|
+
*
|
|
167
|
+
* Also a skill Claude Code's own re-attach may carry whole. Measured on ONE process of Claude Code 2.1.322, that re-attach
|
|
168
|
+
* keeps a skill's message whole up to 20,000 characters and about 100,000 in all, newest first. But a process started with
|
|
169
|
+
* `--resume` — every per-turn turn, every json-stream process after an idle stop or a bot restart — re-attaches NONE of the
|
|
170
|
+
* skills an earlier process loaded: measured by the live probe's resume case on 2026-11-13 (the installed Claude Code,
|
|
171
|
+
* 2.1.323, the default account): skills loaded, the process stopped, `--resume`, `/compact` — its `invoked_skills` held []
|
|
172
|
+
* of [live-small, live-big]. A skill only named here would be lost until the next compaction while the agent is told not to
|
|
173
|
+
* load it; giving every one costs a second copy of a short skill only in a process that loaded it itself, once per
|
|
174
|
+
* compaction.
|
|
175
|
+
*/
|
|
176
|
+
export declare function planClaudeSkillsRestore(epoch: ClaudeEpochSkills, folders: SkillFolderReader, unavailableDir: string | null): SkillsRestoreEntry[];
|
|
177
|
+
/** One part of an OpenCode message, as far as the restore reads it: a `skill` tool call and how it ended. */
|
|
178
|
+
export interface OpenCodeRestorePart {
|
|
179
|
+
type?: string;
|
|
180
|
+
tool?: string;
|
|
181
|
+
state?: {
|
|
182
|
+
status?: string;
|
|
183
|
+
input?: {
|
|
184
|
+
name?: string;
|
|
185
|
+
};
|
|
186
|
+
metadata?: {
|
|
187
|
+
name?: string;
|
|
188
|
+
dir?: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/** One message of an OpenCode session (the server's `{info, parts}`), as far as the restore reads it. */
|
|
193
|
+
export interface OpenCodeRestoreMessage {
|
|
194
|
+
info?: {
|
|
195
|
+
role?: string;
|
|
196
|
+
};
|
|
197
|
+
parts?: OpenCodeRestorePart[];
|
|
198
|
+
}
|
|
199
|
+
/** A skill the OpenCode server offers now (`GET /skill`): its name, the full path of its `SKILL.md`, its body. */
|
|
200
|
+
export interface OpenCodeAvailableSkill {
|
|
201
|
+
name: string;
|
|
202
|
+
location: string;
|
|
203
|
+
content: string;
|
|
204
|
+
}
|
|
205
|
+
/** A skill a session loaded: its name and folder (when the call recorded it). */
|
|
206
|
+
export interface LoadedSkillMention {
|
|
207
|
+
name: string;
|
|
208
|
+
baseDir: string | null;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @description The skills an OpenCode session loaded, newest first, one per name: every COMPLETED `skill` tool call in
|
|
212
|
+
* `messages` (a failed one loaded nothing), named by the call's own record (`metadata.name`, else its input) with the folder
|
|
213
|
+
* it recorded. Self-contained (it reads nothing outside its parameters): the OpenCode plugin embeds its source.
|
|
214
|
+
*/
|
|
215
|
+
export declare function getOpenCodeLoadedSkills(messages: readonly OpenCodeRestoreMessage[]): LoadedSkillMention[];
|
|
216
|
+
/**
|
|
217
|
+
* @description The OpenCode restore's entries: the skills the history shows loaded (newest first), then the ones only the
|
|
218
|
+
* summary's block names. A skill whose call is already in what the model sees after the summary (the compaction's retained
|
|
219
|
+
* tail, or loaded again since) is only named; one the server offers now comes back with its CURRENT text; one it does not
|
|
220
|
+
* offer is "not available now"; with no answer from the server (`available` `null`) every other skill gets the "load it with
|
|
221
|
+
* the tool" line.
|
|
222
|
+
*
|
|
223
|
+
* A name ONLY the block holds gets its text only while the history is unknown (`isHistoryKnown` false: the block is then the
|
|
224
|
+
* best record there is); with the history known it gets the "load it with the tool" line — the history shows every completed
|
|
225
|
+
* skill call, so a block-only name is most likely the model listing the skills it COULD load, and each would put 10–25 KB into
|
|
226
|
+
* every request of the epoch. Self-contained, as {@link getOpenCodeLoadedSkills}.
|
|
227
|
+
*/
|
|
228
|
+
export declare function planOpenCodeSkillsRestore(input: {
|
|
229
|
+
loaded: readonly LoadedSkillMention[];
|
|
230
|
+
blockNames: readonly string[];
|
|
231
|
+
inContextNames: readonly string[];
|
|
232
|
+
available: readonly OpenCodeAvailableSkill[] | null;
|
|
233
|
+
isHistoryKnown: boolean;
|
|
234
|
+
}): SkillsRestoreEntry[];
|
|
235
|
+
//# sourceMappingURL=skillsRestore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillsRestore.d.ts","sourceRoot":"","sources":["../../src/utils/skillsRestore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iDAAiD,CAAC;AAElF,8BAA8B;AAC9B,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa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