charness 3.5.0 → 3.6.1
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 +38 -0
- package/DEVELOPMENT.md +12 -1
- package/README.md +16 -1
- package/SETUP.md +199 -1
- package/dist/adapters/adapterEventRouting.d.ts +2 -2
- package/dist/adapters/adapterEventRouting.d.ts.map +1 -1
- package/dist/adapters/adapterEventRouting.js +4 -3
- package/dist/adapters/adapterEventRouting.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +74 -5
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +188 -9
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/createAdapter.d.ts +12 -0
- package/dist/adapters/createAdapter.d.ts.map +1 -1
- package/dist/adapters/createAdapter.js +38 -2
- package/dist/adapters/createAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +5 -0
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +7 -0
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +299 -82
- package/dist/bot.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +2 -0
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +11 -5
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts +2 -0
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +2 -0
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/prompt.d.ts +4 -0
- package/dist/connectors/jira/prompt.d.ts.map +1 -1
- package/dist/connectors/jira/prompt.js +11 -2
- package/dist/connectors/jira/prompt.js.map +1 -1
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +39 -8
- package/dist/connectors/telegram/commands/compaction.js.map +1 -1
- package/dist/connectors/telegram/forumTopicCreated.d.ts +20 -0
- package/dist/connectors/telegram/forumTopicCreated.d.ts.map +1 -0
- package/dist/connectors/telegram/forumTopicCreated.js +16 -0
- package/dist/connectors/telegram/forumTopicCreated.js.map +1 -0
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +14 -0
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +14 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +14 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +14 -0
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +14 -0
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +14 -0
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +14 -0
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +14 -0
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +14 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +14 -0
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +14 -0
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +14 -0
- package/dist/i18n/zh.js.map +1 -1
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js.map +1 -1
- package/dist/rateLimiter.d.ts +6 -0
- package/dist/rateLimiter.d.ts.map +1 -1
- package/dist/rateLimiter.js +9 -0
- package/dist/rateLimiter.js.map +1 -1
- package/dist/requests/wakeUpEngine.d.ts +4 -0
- package/dist/requests/wakeUpEngine.d.ts.map +1 -1
- package/dist/requests/wakeUpEngine.js +3 -3
- package/dist/requests/wakeUpEngine.js.map +1 -1
- package/dist/requests/wakeUpRules.d.ts +2 -1
- package/dist/requests/wakeUpRules.d.ts.map +1 -1
- package/dist/requests/wakeUpRules.js +3 -2
- package/dist/requests/wakeUpRules.js.map +1 -1
- package/dist/scheduler/mcpSurface.js +1 -1
- package/dist/selfUpdate/updateMessages.d.ts +1 -1
- package/dist/selfUpdate/updateMessages.d.ts.map +1 -1
- package/dist/selfUpdate/updateMessages.js.map +1 -1
- package/dist/state.d.ts +36 -5
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +40 -7
- package/dist/state.js.map +1 -1
- package/dist/testTimings.d.ts +45 -0
- package/dist/testTimings.d.ts.map +1 -0
- package/dist/testTimings.js +89 -0
- package/dist/testTimings.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/adapterSwitchSessionIds.d.ts +5 -1
- package/dist/utils/adapterSwitchSessionIds.d.ts.map +1 -1
- package/dist/utils/adapterSwitchSessionIds.js +1 -1
- package/dist/utils/adapterSwitchSessionIds.js.map +1 -1
- package/dist/utils/adoptedToolList.d.ts +16 -21
- package/dist/utils/adoptedToolList.d.ts.map +1 -1
- package/dist/utils/adoptedToolList.js +18 -17
- package/dist/utils/adoptedToolList.js.map +1 -1
- package/dist/utils/claudeScheduledJobs.d.ts +49 -0
- package/dist/utils/claudeScheduledJobs.d.ts.map +1 -0
- package/dist/utils/claudeScheduledJobs.js +62 -0
- package/dist/utils/claudeScheduledJobs.js.map +1 -0
- package/dist/utils/claudeStreamJson.d.ts +31 -1
- package/dist/utils/claudeStreamJson.d.ts.map +1 -1
- package/dist/utils/claudeStreamJson.js +25 -8
- package/dist/utils/claudeStreamJson.js.map +1 -1
- package/dist/utils/compactOnIdle.d.ts +12 -0
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +15 -1
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/doctorLine.d.ts +13 -0
- package/dist/utils/doctorLine.d.ts.map +1 -0
- package/dist/utils/doctorLine.js +18 -0
- package/dist/utils/doctorLine.js.map +1 -0
- package/dist/utils/effortPickerPlan.d.ts +1 -2
- package/dist/utils/effortPickerPlan.d.ts.map +1 -1
- package/dist/utils/effortPickerPlan.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +19 -7
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +25 -11
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/jsonStreamPendingWork.d.ts +44 -0
- package/dist/utils/jsonStreamPendingWork.d.ts.map +1 -0
- package/dist/utils/jsonStreamPendingWork.js +48 -0
- package/dist/utils/jsonStreamPendingWork.js.map +1 -0
- package/dist/utils/lostWork.d.ts +117 -0
- package/dist/utils/lostWork.d.ts.map +1 -0
- package/dist/utils/lostWork.js +187 -0
- package/dist/utils/lostWork.js.map +1 -0
- package/dist/utils/nativeWindows.d.ts +29 -0
- package/dist/utils/nativeWindows.d.ts.map +1 -0
- package/dist/utils/nativeWindows.js +50 -0
- package/dist/utils/nativeWindows.js.map +1 -0
- package/dist/utils/updateScreenPlan.d.ts +1 -1
- package/dist/utils/updateScreenPlan.d.ts.map +1 -1
- package/dist/utils/updateScreenPlan.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonStreamHost.d.ts","sourceRoot":"","sources":["../../src/utils/jsonStreamHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EAAE,aAAa,EAA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Aa,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,GAAG,eAAe,CAE/E;AAED,kEAAkE;AAClE,MAAM,MAAM,kBAAkB;AAC5B,mBAAmB;AACjB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;AAClB,8EAA8E;GAC5E;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE;AAC1D;;;kBAGkB;GAChB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,kBAAkB,CASnG;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMnF;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAEnG;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAC7C,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,GAC/C,OAAO,CAAC,MAAM,CAAC,CAuBjB"}
|
|
@@ -59,7 +59,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
59
59
|
};
|
|
60
60
|
})();
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.claudeEffortFlag = exports.claudeModelFlag = exports.stderrTailMaxChars = exports.stdoutOversizeWarnBytes = exports.fifoWriteRetryDelayMs = exports.fifoWriteMaxRetries = exports.fifoOpenRetryDelayMs = exports.fifoOpenMaxTries = exports.pidKillWaitTimeoutMs = exports.pidExitPollIntervalMs = exports.pidExitWaitTimeoutMs = exports.pidFilePollIntervalMs = exports.pidFileWaitTimeoutMs = exports.wrapperCdFailExitCode = exports.jsonStreamTmuxPrefix = exports.jsonStreamRootDirName = void 0;
|
|
62
|
+
exports.claudeEffortFlag = exports.claudeModelFlag = exports.claudeSessionStateEventsVariableName = exports.stderrTailMaxChars = exports.stdoutOversizeWarnBytes = exports.fifoWriteRetryDelayMs = exports.fifoWriteMaxRetries = exports.fifoOpenRetryDelayMs = exports.fifoOpenMaxTries = exports.pidKillWaitTimeoutMs = exports.pidExitPollIntervalMs = exports.pidExitWaitTimeoutMs = exports.pidFilePollIntervalMs = exports.pidFileWaitTimeoutMs = exports.wrapperCdFailExitCode = exports.jsonStreamTmuxPrefix = exports.jsonStreamRootDirName = void 0;
|
|
63
63
|
exports.resolveJsonStreamRoot = resolveJsonStreamRoot;
|
|
64
64
|
exports.resolveJsonStreamSessionDir = resolveJsonStreamSessionDir;
|
|
65
65
|
exports.parseJsonStreamDirName = parseJsonStreamDirName;
|
|
@@ -174,6 +174,12 @@ function buildJsonStreamTmuxSessionName(key) {
|
|
|
174
174
|
function parseJsonStreamTmuxSessionName(name) {
|
|
175
175
|
return (0, tmuxSessionName_1.parseTmuxSessionName)(exports.jsonStreamTmuxPrefix, name);
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* The CLI's opt-in to `system/session_state_changed` frames: `running` marks a turn at its START (72 ms after a
|
|
179
|
+
* finished background task empties its list, measured on 2.1.310), not at its first output after the API round-trip.
|
|
180
|
+
* Set by every wrapper beside the environment it starts claude with (`utils/jsonStreamPendingWork.ts`).
|
|
181
|
+
*/
|
|
182
|
+
exports.claudeSessionStateEventsVariableName = 'CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS';
|
|
177
183
|
/**
|
|
178
184
|
* @description The `#!/bin/sh` host script (exact shape proven by the P1 probe
|
|
179
185
|
* `p1-probe2.mjs`): background claude with its stdio rerouted to the host files,
|
|
@@ -185,19 +191,19 @@ function parseJsonStreamTmuxSessionName(name) {
|
|
|
185
191
|
* (a tracker conversation, R32) claude gets exactly those variables instead —
|
|
186
192
|
* `env -i`, so nothing of the tmux server's environment reaches it (no API key
|
|
187
193
|
* either). A non-default Claude account profile adds `CLAUDE_CONFIG_DIR=<dir>` to
|
|
188
|
-
* either `env` form (`utils/claudeProfiles.ts`); the default profile adds nothing
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* ABSOLUTE (tmux server PATH differs).
|
|
194
|
+
* either `env` form (`utils/claudeProfiles.ts`); the default profile adds nothing.
|
|
195
|
+
* The variable sits in the process environment — not only in the CLI's own
|
|
196
|
+
* reading of it — so a child `claude` the agent starts inherits the same account.
|
|
197
|
+
* Both forms also set {@link claudeSessionStateEventsVariableName}. All embedded
|
|
198
|
+
* strings are single-quoted; `claudePath` must be ABSOLUTE (tmux server PATH differs).
|
|
194
199
|
*/
|
|
195
200
|
function buildWrapperScript(claudePath, args, workDir, paths, environment = null, configDir = null) {
|
|
196
201
|
const command = [claudePath, ...args].map(tmuxExec_1.shellSingleQuote).join(' ');
|
|
197
202
|
const configDirAssignment = configDir === null ? [] : [(0, tmuxExec_1.shellSingleQuote)(`${claudeProfiles_1.claudeConfigDirVariableName}=${configDir}`)];
|
|
203
|
+
const ownAssignments = [(0, tmuxExec_1.shellSingleQuote)(`${exports.claudeSessionStateEventsVariableName}=1`), ...configDirAssignment];
|
|
198
204
|
const envCommand = environment === null
|
|
199
|
-
? ['env', '-u', 'ANTHROPIC_API_KEY', ...
|
|
200
|
-
: ['env', '-i', ...Object.entries(environment).map(([name, value]) => (0, tmuxExec_1.shellSingleQuote)(`${name}=${value}`)), ...
|
|
205
|
+
? ['env', '-u', 'ANTHROPIC_API_KEY', ...ownAssignments].join(' ')
|
|
206
|
+
: ['env', '-i', ...Object.entries(environment).map(([name, value]) => (0, tmuxExec_1.shellSingleQuote)(`${name}=${value}`)), ...ownAssignments].join(' ');
|
|
201
207
|
return `#!/bin/sh
|
|
202
208
|
cd ${(0, tmuxExec_1.shellSingleQuote)(workDir)} || exit ${exports.wrapperCdFailExitCode}
|
|
203
209
|
${envCommand} ${command} \\
|
|
@@ -403,14 +409,22 @@ function readFileByteRange(filePath, startOffset, endOffset) {
|
|
|
403
409
|
*/
|
|
404
410
|
function resolveAdoptedTail(persistedTail, claudeSessionId, stdoutSizeBytes) {
|
|
405
411
|
if (persistedTail === null || persistedTail.sessionId !== claudeSessionId) {
|
|
406
|
-
return {
|
|
412
|
+
return {
|
|
413
|
+
startOffset: stdoutSizeBytes, backgroundTasks: [], isTurnInFlight: false, outstandingToolUseIds: [], claudeCodeVersion: null,
|
|
414
|
+
notificationTurnPendingSinceMs: null, lastTurnEndedAtMs: null, scheduledJobs: [], isConfigDirSwitchPending: false,
|
|
415
|
+
};
|
|
407
416
|
}
|
|
408
417
|
return {
|
|
409
418
|
startOffset: Math.min(persistedTail.offsetBytes, stdoutSizeBytes),
|
|
410
|
-
|
|
419
|
+
// A record written before the descriptions were kept has the ids alone.
|
|
420
|
+
backgroundTasks: persistedTail.backgroundTasks ?? (persistedTail.backgroundTaskIds ?? []).map((taskId) => ({ taskId, description: '' })),
|
|
411
421
|
isTurnInFlight: persistedTail.isTurnInFlight ?? false,
|
|
412
422
|
outstandingToolUseIds: persistedTail.outstandingToolUseIds ?? [],
|
|
413
423
|
claudeCodeVersion: persistedTail.claudeCodeVersion ?? null,
|
|
424
|
+
notificationTurnPendingSinceMs: persistedTail.notificationTurnPendingSinceMs ?? null,
|
|
425
|
+
lastTurnEndedAtMs: persistedTail.lastTurnEndedAtMs ?? null,
|
|
426
|
+
scheduledJobs: persistedTail.scheduledJobs ?? [],
|
|
427
|
+
isConfigDirSwitchPending: persistedTail.isConfigDirSwitchPending ?? false,
|
|
414
428
|
};
|
|
415
429
|
}
|
|
416
430
|
function createStdoutTailState(startOffsetBytes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonStreamHost.js","sourceRoot":"","sources":["../../src/utils/jsonStreamHost.ts"],"names":[],"mappings":";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IACH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The json-stream "working" judgement for the agent's OWN pending work between turns: a background task
|
|
3
|
+
* (background Bash / Monitor / sub-agent), the turn a finished task is about to start, a session-only `CronCreate` job.
|
|
4
|
+
* A stop kills every one of them with the process, so each counts as working (lifecycle plan L-D2) — but only for a
|
|
5
|
+
* bounded time, so a forgotten task cannot pin a process forever.
|
|
6
|
+
*
|
|
7
|
+
* Measured on the real CLI (2.1.310): a background task's end writes `task_notification`, then empties the
|
|
8
|
+
* background list, then starts the task's own turn, whose first output comes only after the API round-trip (1.3 s on
|
|
9
|
+
* a small context, 3–5 s on a large one). The gap read as idle once, and the idle check stopped the process right as
|
|
10
|
+
* the agent was being woken to read its task's result.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* How long a background task's notification holds the process for the turn it starts. The CLI starts that turn ~0.1 s
|
|
14
|
+
* after the notification; the grace only bounds a notification whose turn never shows (one folded into a running
|
|
15
|
+
* turn, a task stopped from inside a turn).
|
|
16
|
+
*/
|
|
17
|
+
export declare const notificationTurnGraceMs = 30000;
|
|
18
|
+
/**
|
|
19
|
+
* How long pending work (background tasks, scheduled jobs) holds the process after the conversation's LAST turn
|
|
20
|
+
* ended. Every turn resets it — a watchdog that re-arms itself keeps its process for as long as it keeps looping — so
|
|
21
|
+
* only a task nobody heard from in that time (a forgotten dev server, a `sleep infinity`) is let go.
|
|
22
|
+
*/
|
|
23
|
+
export declare const pendingWorkHoldDefaultMs: number;
|
|
24
|
+
/** @name PendingWorkInput @description The session state the pending-work judgement reads, with its clock. */
|
|
25
|
+
export interface PendingWorkInput {
|
|
26
|
+
now: number;
|
|
27
|
+
backgroundTaskCount: number;
|
|
28
|
+
scheduledJobCount: number;
|
|
29
|
+
/** When the conversation's last turn ended (the process start before its first turn). */
|
|
30
|
+
lastTurnEndedAt: number;
|
|
31
|
+
holdMs: number;
|
|
32
|
+
/** When a background task's notification announced its turn; `null` when none is pending. */
|
|
33
|
+
notificationTurnPendingSince: number | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @description The hold left for the pending background tasks / scheduled jobs: `null` when there are none, `0` once
|
|
37
|
+
* the hold is spent.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getPendingWorkHoldRemainingMs(input: PendingWorkInput): number | null;
|
|
40
|
+
/** @description Whether a background task's notification still announces a turn that has not shown yet (within the grace). */
|
|
41
|
+
export declare function checkIsNotificationTurnPending(input: Pick<PendingWorkInput, 'now' | 'notificationTurnPendingSince'>): boolean;
|
|
42
|
+
/** @description Whether the agent's own pending work must keep its process: tasks or jobs within the hold, or a task's turn on its way. */
|
|
43
|
+
export declare function checkHasPendingWork(input: PendingWorkInput): boolean;
|
|
44
|
+
//# sourceMappingURL=jsonStreamPendingWork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonStreamPendingWork.d.ts","sourceRoot":"","sources":["../../src/utils/jsonStreamPendingWork.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAqB,CAAC;AAG3D,8GAA8G;AAC9G,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yFAAyF;IACzF,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,6FAA6F;IAC7F,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAGpF;AAED,8HAA8H;AAC9H,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,8BAA8B,CAAC,GAAG,OAAO,CAE7H;AAED,2IAA2I;AAC3I,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAGpE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The json-stream "working" judgement for the agent's OWN pending work between turns: a background task
|
|
4
|
+
* (background Bash / Monitor / sub-agent), the turn a finished task is about to start, a session-only `CronCreate` job.
|
|
5
|
+
* A stop kills every one of them with the process, so each counts as working (lifecycle plan L-D2) — but only for a
|
|
6
|
+
* bounded time, so a forgotten task cannot pin a process forever.
|
|
7
|
+
*
|
|
8
|
+
* Measured on the real CLI (2.1.310): a background task's end writes `task_notification`, then empties the
|
|
9
|
+
* background list, then starts the task's own turn, whose first output comes only after the API round-trip (1.3 s on
|
|
10
|
+
* a small context, 3–5 s on a large one). The gap read as idle once, and the idle check stopped the process right as
|
|
11
|
+
* the agent was being woken to read its task's result.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.pendingWorkHoldDefaultMs = exports.notificationTurnGraceMs = void 0;
|
|
15
|
+
exports.getPendingWorkHoldRemainingMs = getPendingWorkHoldRemainingMs;
|
|
16
|
+
exports.checkIsNotificationTurnPending = checkIsNotificationTurnPending;
|
|
17
|
+
exports.checkHasPendingWork = checkHasPendingWork;
|
|
18
|
+
/**
|
|
19
|
+
* How long a background task's notification holds the process for the turn it starts. The CLI starts that turn ~0.1 s
|
|
20
|
+
* after the notification; the grace only bounds a notification whose turn never shows (one folded into a running
|
|
21
|
+
* turn, a task stopped from inside a turn).
|
|
22
|
+
*/
|
|
23
|
+
exports.notificationTurnGraceMs = 30_000;
|
|
24
|
+
/**
|
|
25
|
+
* How long pending work (background tasks, scheduled jobs) holds the process after the conversation's LAST turn
|
|
26
|
+
* ended. Every turn resets it — a watchdog that re-arms itself keeps its process for as long as it keeps looping — so
|
|
27
|
+
* only a task nobody heard from in that time (a forgotten dev server, a `sleep infinity`) is let go.
|
|
28
|
+
*/
|
|
29
|
+
exports.pendingWorkHoldDefaultMs = 6 * 60 * 60 * 1000;
|
|
30
|
+
/**
|
|
31
|
+
* @description The hold left for the pending background tasks / scheduled jobs: `null` when there are none, `0` once
|
|
32
|
+
* the hold is spent.
|
|
33
|
+
*/
|
|
34
|
+
function getPendingWorkHoldRemainingMs(input) {
|
|
35
|
+
if (input.backgroundTaskCount === 0 && input.scheduledJobCount === 0)
|
|
36
|
+
return null;
|
|
37
|
+
return Math.max(0, input.holdMs - (input.now - input.lastTurnEndedAt));
|
|
38
|
+
}
|
|
39
|
+
/** @description Whether a background task's notification still announces a turn that has not shown yet (within the grace). */
|
|
40
|
+
function checkIsNotificationTurnPending(input) {
|
|
41
|
+
return input.notificationTurnPendingSince !== null && input.now - input.notificationTurnPendingSince < exports.notificationTurnGraceMs;
|
|
42
|
+
}
|
|
43
|
+
/** @description Whether the agent's own pending work must keep its process: tasks or jobs within the hold, or a task's turn on its way. */
|
|
44
|
+
function checkHasPendingWork(input) {
|
|
45
|
+
const holdRemainingMs = getPendingWorkHoldRemainingMs(input);
|
|
46
|
+
return (holdRemainingMs !== null && holdRemainingMs > 0) || checkIsNotificationTurnPending(input);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=jsonStreamPendingWork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonStreamPendingWork.js","sourceRoot":"","sources":["../../src/utils/jsonStreamPendingWork.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAiCH,sEAGC;AAGD,wEAEC;AAGD,kDAGC;AA7CD;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAe3D;;;GAGG;AACH,SAAgB,6BAA6B,CAAC,KAAuB;IACnE,IAAI,KAAK,CAAC,mBAAmB,KAAK,CAAC,IAAI,KAAK,CAAC,iBAAiB,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,8HAA8H;AAC9H,SAAgB,8BAA8B,CAAC,KAAqE;IAClH,OAAO,KAAK,CAAC,4BAA4B,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,4BAA4B,GAAG,+BAAuB,CAAC;AACjI,CAAC;AAED,2IAA2I;AAC3I,SAAgB,mBAAmB,CAAC,KAAuB;IACzD,MAAM,eAAe,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAC7D,OAAO,CAAC,eAAe,KAAK,IAAI,IAAI,eAAe,GAAG,CAAC,CAAC,IAAI,8BAA8B,CAAC,KAAK,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The agent's own pending work that a json-stream process took with it when it ended anyway: a crash,
|
|
3
|
+
* a process found gone after a restart, a `/model` / `/effort` / account re-spawn, or the pending-work hold running
|
|
4
|
+
* out (`utils/jsonStreamPendingWork.ts`). Nothing else would ever tell the agent — a background task's result, its
|
|
5
|
+
* `CronCreate` jobs and a finished task it had not read yet are gone with the process, so the agent would keep waiting
|
|
6
|
+
* for a notification that never comes. The bot tells it once, in a short prompt, and the topic gets one plain line.
|
|
7
|
+
*
|
|
8
|
+
* A turn the bot itself cut off (a re-spawn, a backend switch) is lost work too: nothing else re-prompts it. A turn a
|
|
9
|
+
* crash cut off is the request core's: it re-posts and wakes an open request (R21). An explicit release (`/quit`,
|
|
10
|
+
* `/new`) drops the record — the person ended that conversation.
|
|
11
|
+
*/
|
|
12
|
+
import type { ClaudeBackgroundTask } from './claudeStreamJson';
|
|
13
|
+
import type { JsonStreamTailOffset } from '../types';
|
|
14
|
+
import type { Translate } from '../i18n';
|
|
15
|
+
/** @name LostWork @description What a process held when it ended: none of it survives the process. */
|
|
16
|
+
export interface LostWork {
|
|
17
|
+
backgroundTasks: ClaudeBackgroundTask[];
|
|
18
|
+
/** Session-only `CronCreate` jobs (one-shot jobs that already fired may still be counted). */
|
|
19
|
+
scheduledJobCount: number;
|
|
20
|
+
/** A background task had finished and its own turn — the agent reading the result — had not run yet. */
|
|
21
|
+
hasUnreadTaskResult: boolean;
|
|
22
|
+
/** The bot cut off the turn the agent was in the middle of (a re-spawn, a backend switch). */
|
|
23
|
+
wasTurnInFlight: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @name LostWorkReason
|
|
27
|
+
* @description Why the process ended with work pending:
|
|
28
|
+
* - `exited` — the CLI exited by itself (a crash, an OOM kill);
|
|
29
|
+
* - `foundDead` — the process was gone when the bot came back (a host reboot, a killed tmux server);
|
|
30
|
+
* - `restarted` — the bot re-spawned it for a model, effort or account change;
|
|
31
|
+
* - `holdExpired` — the idle stop after the pending-work hold ran out (no turn for that long);
|
|
32
|
+
* - `switched` — the conversation moved to another backend (a usage-limit fallback, the operator's switch).
|
|
33
|
+
*/
|
|
34
|
+
export type LostWorkReason = 'exited' | 'foundDead' | 'restarted' | 'holdExpired' | 'switched';
|
|
35
|
+
/** @name LostWorkRecord @description A loss the agent has not been told about yet (persisted in `state.json`). */
|
|
36
|
+
export interface LostWorkRecord extends LostWork {
|
|
37
|
+
reason: LostWorkReason;
|
|
38
|
+
lostAt: number;
|
|
39
|
+
/**
|
|
40
|
+
* The part of this loss the agent of the backend the conversation moved to was told about first (a backend switch
|
|
41
|
+
* tells both agents): the parked conversation's agent checks that part before it starts anything again. Only that
|
|
42
|
+
* part — a loss merged in later (the cut-off work of the side being left) is this agent's alone.
|
|
43
|
+
*/
|
|
44
|
+
otherAgentTold?: LostWork;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Within this long after an automatic resume, a second loss does not resume the conversation again: a process that
|
|
48
|
+
* keeps dying with work pending must not be restarted in a loop. The note then waits for the next message.
|
|
49
|
+
*/
|
|
50
|
+
export declare const lostWorkResumeCooldownMs: number;
|
|
51
|
+
/** @description Whether any work was lost. */
|
|
52
|
+
export declare function checkHasLostWork(lostWork: LostWork): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @description Whether the loss holds background work the operator is told was stopped by a switch: background tasks,
|
|
55
|
+
* scheduled jobs or a finished task's unread result — a cut-off turn alone is no background work.
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkHasLostBackgroundWork(lostWork: LostWork | null): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @description What a process that is GONE held, by its persisted tail record — read for a process found dead at
|
|
60
|
+
* boot. A process that ended while the bot watched left no pending work in its record ({@link getTailRecordWithoutPendingWork}).
|
|
61
|
+
* A record of another conversation holds nothing of this one, and neither does a record written before the pending work
|
|
62
|
+
* was tracked (its bare `backgroundTaskIds` were never cleared after a crash: they may be weeks old) — only a record that
|
|
63
|
+
* carries the hold's start or an announced turn speaks for a process that was alive with work pending.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getLostWorkFromTailRecord(tail: JsonStreamTailOffset | null, claudeSessionId: string): LostWork;
|
|
66
|
+
/** @description The tail record of a process whose pending work was handled (told, or released): the rest as it was. */
|
|
67
|
+
export declare function getTailRecordWithoutPendingWork(tail: JsonStreamTailOffset): JsonStreamTailOffset;
|
|
68
|
+
/**
|
|
69
|
+
* @name LostWorkPlan
|
|
70
|
+
* @description `isAutoResume`: the bot resumes the conversation now with the note as its prompt. Otherwise the note
|
|
71
|
+
* rides the next prompt, and `isResumedByNextMessage` says whether that is the person's next message waking a stopped
|
|
72
|
+
* process (`false`: the process is alive, or an armed limit wait resumes it — the note rides that prompt).
|
|
73
|
+
*/
|
|
74
|
+
export interface LostWorkPlan {
|
|
75
|
+
isAutoResume: boolean;
|
|
76
|
+
isResumedByNextMessage: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @description What the bot does about a loss. A spent hold means nobody heard from the work for hours: the agent is
|
|
80
|
+
* told on the next message, not woken (it would only re-arm the same forgotten task). An armed usage-limit wait has
|
|
81
|
+
* its own resume, whose nudge carries the note. A loss right after an automatic resume waits for a person. A
|
|
82
|
+
* conversation that answers only through a request (a tracker issue, `isRequestRequired`) is not resumed by a bare
|
|
83
|
+
* note it could not answer: the note rides its next request's prompt.
|
|
84
|
+
*/
|
|
85
|
+
export declare function getLostWorkPlan(input: {
|
|
86
|
+
reason: LostWorkReason;
|
|
87
|
+
isLimitWaitArmed: boolean;
|
|
88
|
+
msSinceLastAutoResume: number | null;
|
|
89
|
+
isRequestRequired: boolean;
|
|
90
|
+
}): LostWorkPlan;
|
|
91
|
+
/**
|
|
92
|
+
* @description The plan of a loss whose note waits for the next prompt — no automatic resume, or one that failed: the
|
|
93
|
+
* person's next message resumes a STOPPED process; a live one (a re-spawn, a switch) or an armed limit wait's own
|
|
94
|
+
* resume hears it with the next prompt it gets.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getHeldLostWorkPlan(input: {
|
|
97
|
+
reason: LostWorkReason;
|
|
98
|
+
isLimitWaitArmed: boolean;
|
|
99
|
+
}): LostWorkPlan;
|
|
100
|
+
/**
|
|
101
|
+
* @description The note the agent gets — as the automatic resume's prompt, or ahead of the next prompt. English with
|
|
102
|
+
* the baked reply-language directive (`replyLanguage` is the topic's language endonym).
|
|
103
|
+
*/
|
|
104
|
+
export declare function buildLostWorkNote(record: LostWorkRecord, replyLanguage: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* @description One loss from two: a loss the agent was not told about yet stays, and a newer one adds to it — the
|
|
107
|
+
* tasks by id, the larger job count, the reason and time of the newer loss. The parts another agent was told first
|
|
108
|
+
* merge only with each other, never with the rest.
|
|
109
|
+
*/
|
|
110
|
+
export declare function mergeLostWorkRecords(untold: LostWorkRecord | undefined, newer: LostWorkRecord): LostWorkRecord;
|
|
111
|
+
/**
|
|
112
|
+
* @description The ONE plain line a topic gets about a loss (never pinned: no action is needed from the person) —
|
|
113
|
+
* what ended, what was pending, and when the agent hears about it. `holdHours` names the pending-work hold for a
|
|
114
|
+
* `holdExpired` loss.
|
|
115
|
+
*/
|
|
116
|
+
export declare function formatLostWorkTopicLine(record: LostWorkRecord, plan: LostWorkPlan, holdHours: number, translate: Translate): string;
|
|
117
|
+
//# sourceMappingURL=lostWork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lostWork.d.ts","sourceRoot":"","sources":["../../src/utils/lostWork.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,sGAAsG;AACtG,MAAM,WAAW,QAAQ;IACvB,eAAe,EAAE,oBAAoB,EAAE,CAAC;IACxC,8FAA8F;IAC9F,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wGAAwG;IACxG,mBAAmB,EAAE,OAAO,CAAC;IAC7B,8FAA8F;IAC9F,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAE/F,kHAAkH;AAClH,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAiB,CAAC;AA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@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The agent's own pending work that a json-stream process took with it when it ended anyway: a crash,
|
|
4
|
+
* a process found gone after a restart, a `/model` / `/effort` / account re-spawn, or the pending-work hold running
|
|
5
|
+
* out (`utils/jsonStreamPendingWork.ts`). Nothing else would ever tell the agent — a background task's result, its
|
|
6
|
+
* `CronCreate` jobs and a finished task it had not read yet are gone with the process, so the agent would keep waiting
|
|
7
|
+
* for a notification that never comes. The bot tells it once, in a short prompt, and the topic gets one plain line.
|
|
8
|
+
*
|
|
9
|
+
* A turn the bot itself cut off (a re-spawn, a backend switch) is lost work too: nothing else re-prompts it. A turn a
|
|
10
|
+
* crash cut off is the request core's: it re-posts and wakes an open request (R21). An explicit release (`/quit`,
|
|
11
|
+
* `/new`) drops the record — the person ended that conversation.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.lostWorkResumeCooldownMs = void 0;
|
|
15
|
+
exports.checkHasLostWork = checkHasLostWork;
|
|
16
|
+
exports.checkHasLostBackgroundWork = checkHasLostBackgroundWork;
|
|
17
|
+
exports.getLostWorkFromTailRecord = getLostWorkFromTailRecord;
|
|
18
|
+
exports.getTailRecordWithoutPendingWork = getTailRecordWithoutPendingWork;
|
|
19
|
+
exports.getLostWorkPlan = getLostWorkPlan;
|
|
20
|
+
exports.getHeldLostWorkPlan = getHeldLostWorkPlan;
|
|
21
|
+
exports.buildLostWorkNote = buildLostWorkNote;
|
|
22
|
+
exports.mergeLostWorkRecords = mergeLostWorkRecords;
|
|
23
|
+
exports.formatLostWorkTopicLine = formatLostWorkTopicLine;
|
|
24
|
+
/**
|
|
25
|
+
* Within this long after an automatic resume, a second loss does not resume the conversation again: a process that
|
|
26
|
+
* keeps dying with work pending must not be restarted in a loop. The note then waits for the next message.
|
|
27
|
+
*/
|
|
28
|
+
exports.lostWorkResumeCooldownMs = 10 * 60 * 1000;
|
|
29
|
+
/** @description Whether any work was lost. */
|
|
30
|
+
function checkHasLostWork(lostWork) {
|
|
31
|
+
return lostWork.backgroundTasks.length > 0 || lostWork.scheduledJobCount > 0 || lostWork.hasUnreadTaskResult || lostWork.wasTurnInFlight;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @description Whether the loss holds background work the operator is told was stopped by a switch: background tasks,
|
|
35
|
+
* scheduled jobs or a finished task's unread result — a cut-off turn alone is no background work.
|
|
36
|
+
*/
|
|
37
|
+
function checkHasLostBackgroundWork(lostWork) {
|
|
38
|
+
return lostWork !== null && (lostWork.backgroundTasks.length > 0 || lostWork.scheduledJobCount > 0 || lostWork.hasUnreadTaskResult);
|
|
39
|
+
}
|
|
40
|
+
const noLostWork = { backgroundTasks: [], scheduledJobCount: 0, hasUnreadTaskResult: false, wasTurnInFlight: false };
|
|
41
|
+
/**
|
|
42
|
+
* @description What a process that is GONE held, by its persisted tail record — read for a process found dead at
|
|
43
|
+
* boot. A process that ended while the bot watched left no pending work in its record ({@link getTailRecordWithoutPendingWork}).
|
|
44
|
+
* A record of another conversation holds nothing of this one, and neither does a record written before the pending work
|
|
45
|
+
* was tracked (its bare `backgroundTaskIds` were never cleared after a crash: they may be weeks old) — only a record that
|
|
46
|
+
* carries the hold's start or an announced turn speaks for a process that was alive with work pending.
|
|
47
|
+
*/
|
|
48
|
+
function getLostWorkFromTailRecord(tail, claudeSessionId) {
|
|
49
|
+
if (tail === null || tail.sessionId !== claudeSessionId)
|
|
50
|
+
return noLostWork;
|
|
51
|
+
if (tail.lastTurnEndedAtMs === undefined && tail.notificationTurnPendingSinceMs === undefined)
|
|
52
|
+
return noLostWork;
|
|
53
|
+
return {
|
|
54
|
+
backgroundTasks: tail.backgroundTasks ?? [],
|
|
55
|
+
scheduledJobCount: tail.scheduledJobs?.length ?? 0,
|
|
56
|
+
// The bot was away: an announced turn that the record still holds never reached it.
|
|
57
|
+
hasUnreadTaskResult: tail.notificationTurnPendingSinceMs !== undefined,
|
|
58
|
+
// A turn in flight at a crash is the request core's (see the module).
|
|
59
|
+
wasTurnInFlight: false,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** @description The tail record of a process whose pending work was handled (told, or released): the rest as it was. */
|
|
63
|
+
function getTailRecordWithoutPendingWork(tail) {
|
|
64
|
+
const { backgroundTasks: _backgroundTasks, scheduledJobs: _scheduledJobs, notificationTurnPendingSinceMs: _notificationTurnPendingSinceMs, lastTurnEndedAtMs: _lastTurnEndedAtMs, ...rest } = tail;
|
|
65
|
+
return { ...rest, backgroundTaskIds: [] };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @description What the bot does about a loss. A spent hold means nobody heard from the work for hours: the agent is
|
|
69
|
+
* told on the next message, not woken (it would only re-arm the same forgotten task). An armed usage-limit wait has
|
|
70
|
+
* its own resume, whose nudge carries the note. A loss right after an automatic resume waits for a person. A
|
|
71
|
+
* conversation that answers only through a request (a tracker issue, `isRequestRequired`) is not resumed by a bare
|
|
72
|
+
* note it could not answer: the note rides its next request's prompt.
|
|
73
|
+
*/
|
|
74
|
+
function getLostWorkPlan(input) {
|
|
75
|
+
const isInCooldown = input.msSinceLastAutoResume !== null && input.msSinceLastAutoResume < exports.lostWorkResumeCooldownMs;
|
|
76
|
+
const isAutoResume = input.reason !== 'holdExpired' && input.reason !== 'switched' && !input.isLimitWaitArmed && !isInCooldown && !input.isRequestRequired;
|
|
77
|
+
return isAutoResume ? { isAutoResume: true, isResumedByNextMessage: false } : getHeldLostWorkPlan(input);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @description The plan of a loss whose note waits for the next prompt — no automatic resume, or one that failed: the
|
|
81
|
+
* person's next message resumes a STOPPED process; a live one (a re-spawn, a switch) or an armed limit wait's own
|
|
82
|
+
* resume hears it with the next prompt it gets.
|
|
83
|
+
*/
|
|
84
|
+
function getHeldLostWorkPlan(input) {
|
|
85
|
+
const isProcessAlive = input.reason === 'restarted' || input.reason === 'switched';
|
|
86
|
+
return { isAutoResume: false, isResumedByNextMessage: !isProcessAlive && !input.isLimitWaitArmed };
|
|
87
|
+
}
|
|
88
|
+
/** The agent-facing wording of each reason (English on purpose, like every agent-facing template). */
|
|
89
|
+
const lostWorkReasonTexts = {
|
|
90
|
+
exited: 'it exited unexpectedly',
|
|
91
|
+
foundDead: 'it was gone when the bot came back after a restart',
|
|
92
|
+
restarted: 'the bot restarted it for a model, effort or account change',
|
|
93
|
+
holdExpired: 'the bot stopped it after a long time without a turn',
|
|
94
|
+
switched: 'the conversation moved to another backend',
|
|
95
|
+
};
|
|
96
|
+
/** @description What was lost, as the agent reads it: the tasks by id and description, the jobs, the unread result. */
|
|
97
|
+
function describeLostWorkForAgent(lostWork) {
|
|
98
|
+
const parts = [];
|
|
99
|
+
if (lostWork.backgroundTasks.length > 0) {
|
|
100
|
+
const tasks = lostWork.backgroundTasks.map((task) => (task.description ? `${task.taskId} «${task.description}»` : task.taskId));
|
|
101
|
+
parts.push(`background tasks ${tasks.join(', ')}`);
|
|
102
|
+
}
|
|
103
|
+
if (lostWork.scheduledJobCount > 0)
|
|
104
|
+
parts.push(`${lostWork.scheduledJobCount} session-only CronCreate job(s)`);
|
|
105
|
+
if (lostWork.hasUnreadTaskResult)
|
|
106
|
+
parts.push('the result of a background task that had just finished, which you had not read');
|
|
107
|
+
if (lostWork.wasTurnInFlight)
|
|
108
|
+
parts.push('the turn you were in the middle of, which was cut off');
|
|
109
|
+
return parts.join('; ');
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @description The note the agent gets — as the automatic resume's prompt, or ahead of the next prompt. English with
|
|
113
|
+
* the baked reply-language directive (`replyLanguage` is the topic's language endonym).
|
|
114
|
+
*/
|
|
115
|
+
function buildLostWorkNote(record, replyLanguage) {
|
|
116
|
+
// Only what the other agent could have started again: its tasks and jobs, not a result or a cut-off turn.
|
|
117
|
+
const restartableTold = record.otherAgentTold
|
|
118
|
+
? { ...noLostWork, backgroundTasks: record.otherAgentTold.backgroundTasks, scheduledJobCount: record.otherAgentTold.scheduledJobCount }
|
|
119
|
+
: null;
|
|
120
|
+
return [
|
|
121
|
+
`[charness] This conversation's agent process ended while its own work was still pending (${lostWorkReasonTexts[record.reason]}): ${describeLostWorkForAgent(record)}.`,
|
|
122
|
+
'That work died with the process: no notification will ever arrive for it.',
|
|
123
|
+
...(restartableTold && checkHasLostWork(restartableTold)
|
|
124
|
+
? [`The agent this conversation moved to meanwhile was told first about ${describeLostWorkForAgent(restartableTold)}, and may have started some of it again: look before you start that twice.`]
|
|
125
|
+
: []),
|
|
126
|
+
`Check its state yourself (output files, processes, the repository), start again what is still needed — prefer the bot's schedule_* tools for anything that must survive a restart — and tell the user in one or two lines what happened, IN ${replyLanguage}.`,
|
|
127
|
+
].join('\n');
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @description One loss from two: a loss the agent was not told about yet stays, and a newer one adds to it — the
|
|
131
|
+
* tasks by id, the larger job count, the reason and time of the newer loss. The parts another agent was told first
|
|
132
|
+
* merge only with each other, never with the rest.
|
|
133
|
+
*/
|
|
134
|
+
function mergeLostWorkRecords(untold, newer) {
|
|
135
|
+
if (!untold)
|
|
136
|
+
return newer;
|
|
137
|
+
const otherAgentTold = untold.otherAgentTold && newer.otherAgentTold
|
|
138
|
+
? mergeLostWork(untold.otherAgentTold, newer.otherAgentTold)
|
|
139
|
+
: untold.otherAgentTold ?? newer.otherAgentTold;
|
|
140
|
+
return {
|
|
141
|
+
...mergeLostWork(untold, newer),
|
|
142
|
+
reason: newer.reason,
|
|
143
|
+
lostAt: newer.lostAt,
|
|
144
|
+
...(otherAgentTold ? { otherAgentTold } : {}),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** Two losses as one: the tasks by id, the larger job count, either flag. */
|
|
148
|
+
function mergeLostWork(older, newer) {
|
|
149
|
+
const tasksById = new Map(older.backgroundTasks.map((task) => [task.taskId, task]));
|
|
150
|
+
for (const task of newer.backgroundTasks)
|
|
151
|
+
tasksById.set(task.taskId, task);
|
|
152
|
+
return {
|
|
153
|
+
backgroundTasks: [...tasksById.values()],
|
|
154
|
+
scheduledJobCount: Math.max(older.scheduledJobCount, newer.scheduledJobCount),
|
|
155
|
+
hasUnreadTaskResult: older.hasUnreadTaskResult || newer.hasUnreadTaskResult,
|
|
156
|
+
wasTurnInFlight: older.wasTurnInFlight || newer.wasTurnInFlight,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/** How a background task is named in the topic line: its description, else its id. */
|
|
160
|
+
function getTopicTaskName(task) {
|
|
161
|
+
return task.description ? `«${task.description}»` : task.taskId;
|
|
162
|
+
}
|
|
163
|
+
/** The topic line's ending: resumed now, resumed by the person's next message, or told with the next prompt it gets. */
|
|
164
|
+
function getTopicLineKey(plan) {
|
|
165
|
+
if (plan.isAutoResume)
|
|
166
|
+
return 'lostWork.line.resumed';
|
|
167
|
+
return plan.isResumedByNextMessage ? 'lostWork.line.held' : 'lostWork.line.toldNext';
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @description The ONE plain line a topic gets about a loss (never pinned: no action is needed from the person) —
|
|
171
|
+
* what ended, what was pending, and when the agent hears about it. `holdHours` names the pending-work hold for a
|
|
172
|
+
* `holdExpired` loss.
|
|
173
|
+
*/
|
|
174
|
+
function formatLostWorkTopicLine(record, plan, holdHours, translate) {
|
|
175
|
+
const parts = [];
|
|
176
|
+
if (record.backgroundTasks.length > 0)
|
|
177
|
+
parts.push(translate('lostWork.work.tasks', { list: record.backgroundTasks.map(getTopicTaskName).join(', ') }));
|
|
178
|
+
if (record.scheduledJobCount > 0)
|
|
179
|
+
parts.push(translate('lostWork.work.jobs', { count: record.scheduledJobCount }));
|
|
180
|
+
if (record.hasUnreadTaskResult)
|
|
181
|
+
parts.push(translate('lostWork.work.unreadResult'));
|
|
182
|
+
if (record.wasTurnInFlight)
|
|
183
|
+
parts.push(translate('lostWork.work.turn'));
|
|
184
|
+
const reason = translate(`lostWork.reason.${record.reason}`, { hours: holdHours });
|
|
185
|
+
return translate(getTopicLineKey(plan), { reason, work: parts.join('; ') });
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=lostWork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lostWork.js","sourceRoot":"","sources":["../../src/utils/lostWork.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AA+CH,4CAEC;AAMD,gEAEC;AAWD,8DAWC;AAGD,0EAGC;AAoBD,0CASC;AAOD,kDAGC;AA4BD,8CAaC;AAOD,oDAWC;AA8BD,0DAQC;AArLD;;;GAGG;AACU,QAAA,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvD,8CAA8C;AAC9C,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,OAAO,QAAQ,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,iBAAiB,GAAG,CAAC,IAAI,QAAQ,CAAC,mBAAmB,IAAI,QAAQ,CAAC,eAAe,CAAC;AAC3I,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,QAAyB;IAClE,OAAO,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,iBAAiB,GAAG,CAAC,IAAI,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AACtI,CAAC;AAED,MAAM,UAAU,GAAa,EAAE,eAAe,EAAE,EAAE,EAAE,iBAAiB,EAAE,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AAE/H;;;;;;GAMG;AACH,SAAgB,yBAAyB,CAAC,IAAiC,EAAE,eAAuB;IAClG,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,SAAS,KAAK,eAAe;QAAE,OAAO,UAAU,CAAC;IAC3E,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS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AE,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACvJ,IAAI,MAAM,CAAC,iBAAiB,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;IACnH,IAAI,MAAM,CAAC,mBAAmB;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACpF,IAAI,MAAM,CAAC,eAAe;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,SAAS,CAAC,mBAAmB,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACnF,OAAO,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Translate } from '../i18n';
|
|
2
|
+
import type { DoctorLine } from './doctorLine';
|
|
3
|
+
/**
|
|
4
|
+
* Charness on native Windows (not inside WSL2) starts and serves, but part of it cannot work there: the Claude backends need
|
|
5
|
+
* tmux, a self-update cannot restart the process in place (no `process.execve`), hot mode refuses to start and the local
|
|
6
|
+
* speech engine's installer is POSIX-only. The bot says so instead of failing one feature at a time; WSL2 is the supported way.
|
|
7
|
+
*/
|
|
8
|
+
/** Where the WSL2 recipe lives, shown in the notice. */
|
|
9
|
+
export declare const nativeWindowsSetupUrl = "https://github.com/olosegres/charness/blob/main/SETUP.md#windows-wsl2";
|
|
10
|
+
/** @description Whether this process runs on native Windows. The platform is a parameter so tests need no Windows. */
|
|
11
|
+
export declare function checkIsNativeWindows(platform: typeof process.platform): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @description The "native Windows is limited" sentence in the active language, or `null` off Windows. One text serves the
|
|
14
|
+
* console, the General notice and `/doctor`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getNativeWindowsNotice(platform: typeof process.platform, translate: Translate): string | null;
|
|
17
|
+
/** @description The startup console line, or `null` off Windows. */
|
|
18
|
+
export declare function getNativeWindowsConsoleLine(platform: typeof process.platform, translate: Translate): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* @description The notice to post in General at boot, or `null`: once per cold start — a hot reload (the hot supervisor never
|
|
21
|
+
* runs on Windows, but a quick restart classifies the same way) stays silent.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getNativeWindowsGeneralNotice(input: {
|
|
24
|
+
platform: typeof process.platform;
|
|
25
|
+
isHotReload: boolean;
|
|
26
|
+
}, translate: Translate): string | null;
|
|
27
|
+
/** @description The `/doctor` line, or `null` off Windows. */
|
|
28
|
+
export declare function getNativeWindowsDoctorLine(platform: typeof process.platform, translate: Translate): DoctorLine | null;
|
|
29
|
+
//# sourceMappingURL=nativeWindows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeWindows.d.ts","sourceRoot":"","sources":["../../src/utils/nativeWindows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AAEH,wDAAwD;AACxD,eAAO,MAAM,qBAAqB,0EAA0E,CAAC;AAM7G,sHAAsH;AACtH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,GAAG,OAAO,CAE/E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAE7G;AAED,oEAAoE;AACpE,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAGlH;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE;IAAE,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,EAClE,SAAS,EAAE,SAAS,GACnB,MAAM,GAAG,IAAI,CAIf;AAED,8DAA8D;AAC9D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAGrH"}
|