charness 3.10.0 → 3.11.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +2 -1
  3. package/agent-plugin/skills/charness-manager/SKILL.md +6 -5
  4. package/dist/bot.d.ts.map +1 -1
  5. package/dist/bot.js +176 -135
  6. package/dist/bot.js.map +1 -1
  7. package/dist/connectors/telegram/commands/botCore.d.ts +1 -0
  8. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
  9. package/dist/connectors/telegram/commands/claudeAccounts.js +3 -3
  10. package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
  11. package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
  12. package/dist/connectors/telegram/commands/runners.js +11 -5
  13. package/dist/connectors/telegram/commands/runners.js.map +1 -1
  14. package/dist/connectors/telegram/foldedMessage.d.ts +24 -0
  15. package/dist/connectors/telegram/foldedMessage.d.ts.map +1 -0
  16. package/dist/connectors/telegram/foldedMessage.js +39 -0
  17. package/dist/connectors/telegram/foldedMessage.js.map +1 -0
  18. package/dist/connectors/telegram/inbound.d.ts +24 -1
  19. package/dist/connectors/telegram/inbound.d.ts.map +1 -1
  20. package/dist/connectors/telegram/inbound.js +77 -1
  21. package/dist/connectors/telegram/inbound.js.map +1 -1
  22. package/dist/connectors/telegram/renderAgentHtml.d.ts +15 -0
  23. package/dist/connectors/telegram/renderAgentHtml.d.ts.map +1 -1
  24. package/dist/connectors/telegram/renderAgentHtml.js +11 -1
  25. package/dist/connectors/telegram/renderAgentHtml.js.map +1 -1
  26. package/dist/connectors/telegram/unpinMessages.d.ts +12 -0
  27. package/dist/connectors/telegram/unpinMessages.d.ts.map +1 -0
  28. package/dist/connectors/telegram/unpinMessages.js +44 -0
  29. package/dist/connectors/telegram/unpinMessages.js.map +1 -0
  30. package/dist/i18n/de.d.ts.map +1 -1
  31. package/dist/i18n/de.js +11 -3
  32. package/dist/i18n/de.js.map +1 -1
  33. package/dist/i18n/en.d.ts.map +1 -1
  34. package/dist/i18n/en.js +11 -3
  35. package/dist/i18n/en.js.map +1 -1
  36. package/dist/i18n/es.d.ts.map +1 -1
  37. package/dist/i18n/es.js +11 -3
  38. package/dist/i18n/es.js.map +1 -1
  39. package/dist/i18n/fr.d.ts.map +1 -1
  40. package/dist/i18n/fr.js +11 -3
  41. package/dist/i18n/fr.js.map +1 -1
  42. package/dist/i18n/hi.d.ts.map +1 -1
  43. package/dist/i18n/hi.js +11 -3
  44. package/dist/i18n/hi.js.map +1 -1
  45. package/dist/i18n/ja.d.ts.map +1 -1
  46. package/dist/i18n/ja.js +11 -3
  47. package/dist/i18n/ja.js.map +1 -1
  48. package/dist/i18n/ka.d.ts.map +1 -1
  49. package/dist/i18n/ka.js +11 -3
  50. package/dist/i18n/ka.js.map +1 -1
  51. package/dist/i18n/pt.d.ts.map +1 -1
  52. package/dist/i18n/pt.js +11 -3
  53. package/dist/i18n/pt.js.map +1 -1
  54. package/dist/i18n/ru.d.ts.map +1 -1
  55. package/dist/i18n/ru.js +11 -3
  56. package/dist/i18n/ru.js.map +1 -1
  57. package/dist/i18n/uk.d.ts.map +1 -1
  58. package/dist/i18n/uk.js +11 -3
  59. package/dist/i18n/uk.js.map +1 -1
  60. package/dist/i18n/uz.d.ts.map +1 -1
  61. package/dist/i18n/uz.js +11 -3
  62. package/dist/i18n/uz.js.map +1 -1
  63. package/dist/i18n/zh.d.ts.map +1 -1
  64. package/dist/i18n/zh.js +11 -3
  65. package/dist/i18n/zh.js.map +1 -1
  66. package/dist/outputTrace.d.ts +6 -0
  67. package/dist/outputTrace.d.ts.map +1 -1
  68. package/dist/outputTrace.js +13 -0
  69. package/dist/outputTrace.js.map +1 -1
  70. package/dist/runnerUtility/guiAgentHeal.js +2 -2
  71. package/dist/runnerUtility/guiAgentHeal.js.map +1 -1
  72. package/dist/runnerUtility/isolatedCommand.d.ts +0 -2
  73. package/dist/runnerUtility/isolatedCommand.d.ts.map +1 -1
  74. package/dist/runnerUtility/isolatedCommand.js +4 -11
  75. package/dist/runnerUtility/isolatedCommand.js.map +1 -1
  76. package/dist/scheduler/checkRun.d.ts +9 -10
  77. package/dist/scheduler/checkRun.d.ts.map +1 -1
  78. package/dist/scheduler/checkRun.js +8 -16
  79. package/dist/scheduler/checkRun.js.map +1 -1
  80. package/dist/scheduler/checkStatus.d.ts +2 -5
  81. package/dist/scheduler/checkStatus.d.ts.map +1 -1
  82. package/dist/scheduler/checkStatus.js +6 -11
  83. package/dist/scheduler/checkStatus.js.map +1 -1
  84. package/dist/scheduler/delivery.d.ts +79 -37
  85. package/dist/scheduler/delivery.d.ts.map +1 -1
  86. package/dist/scheduler/delivery.js +117 -68
  87. package/dist/scheduler/delivery.js.map +1 -1
  88. package/dist/scheduler/mcpSurface.d.ts +6 -2
  89. package/dist/scheduler/mcpSurface.d.ts.map +1 -1
  90. package/dist/scheduler/mcpSurface.js +39 -15
  91. package/dist/scheduler/mcpSurface.js.map +1 -1
  92. package/dist/scheduler/recurrence.d.ts +32 -0
  93. package/dist/scheduler/recurrence.d.ts.map +1 -1
  94. package/dist/scheduler/recurrence.js +56 -18
  95. package/dist/scheduler/recurrence.js.map +1 -1
  96. package/dist/scheduler/scheduleText.d.ts +7 -0
  97. package/dist/scheduler/scheduleText.d.ts.map +1 -0
  98. package/dist/scheduler/scheduleText.js +55 -0
  99. package/dist/scheduler/scheduleText.js.map +1 -0
  100. package/dist/scheduler/store.d.ts +8 -2
  101. package/dist/scheduler/store.d.ts.map +1 -1
  102. package/dist/scheduler/store.js +25 -4
  103. package/dist/scheduler/store.js.map +1 -1
  104. package/dist/scheduler/types.d.ts +4 -10
  105. package/dist/scheduler/types.d.ts.map +1 -1
  106. package/dist/scheduler/workerWatch.d.ts +24 -9
  107. package/dist/scheduler/workerWatch.d.ts.map +1 -1
  108. package/dist/scheduler/workerWatch.js +29 -11
  109. package/dist/scheduler/workerWatch.js.map +1 -1
  110. package/dist/utils/claudeUsage.d.ts +3 -0
  111. package/dist/utils/claudeUsage.d.ts.map +1 -1
  112. package/dist/utils/claudeUsage.js +8 -1
  113. package/dist/utils/claudeUsage.js.map +1 -1
  114. package/dist/utils/claudeUsageRefresher.d.ts +27 -3
  115. package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
  116. package/dist/utils/claudeUsageRefresher.js +113 -14
  117. package/dist/utils/claudeUsageRefresher.js.map +1 -1
  118. package/dist/utils/forwardedMark.d.ts +54 -0
  119. package/dist/utils/forwardedMark.d.ts.map +1 -0
  120. package/dist/utils/forwardedMark.js +80 -0
  121. package/dist/utils/forwardedMark.js.map +1 -0
  122. package/dist/utils/limitHeldPrompts.d.ts +8 -2
  123. package/dist/utils/limitHeldPrompts.d.ts.map +1 -1
  124. package/dist/utils/limitHeldPrompts.js +11 -4
  125. package/dist/utils/limitHeldPrompts.js.map +1 -1
  126. package/dist/utils/messageContext.d.ts +54 -0
  127. package/dist/utils/messageContext.d.ts.map +1 -0
  128. package/dist/utils/messageContext.js +58 -0
  129. package/dist/utils/messageContext.js.map +1 -0
  130. package/dist/utils/openCodeUsage.d.ts +10 -3
  131. package/dist/utils/openCodeUsage.d.ts.map +1 -1
  132. package/dist/utils/openCodeUsage.js +19 -5
  133. package/dist/utils/openCodeUsage.js.map +1 -1
  134. package/dist/utils/replyQuote.d.ts +11 -26
  135. package/dist/utils/replyQuote.d.ts.map +1 -1
  136. package/dist/utils/replyQuote.js +9 -31
  137. package/dist/utils/replyQuote.js.map +1 -1
  138. package/dist/utils/stripControlCharacters.d.ts +8 -0
  139. package/dist/utils/stripControlCharacters.d.ts.map +1 -0
  140. package/dist/utils/stripControlCharacters.js +16 -0
  141. package/dist/utils/stripControlCharacters.js.map +1 -0
  142. package/dist/utils/telegramError.d.ts +6 -0
  143. package/dist/utils/telegramError.d.ts.map +1 -1
  144. package/dist/utils/telegramError.js +30 -0
  145. package/dist/utils/telegramError.js.map +1 -1
  146. package/dist/utils/topicRequest.d.ts +13 -0
  147. package/dist/utils/topicRequest.d.ts.map +1 -1
  148. package/dist/utils/topicRequest.js +10 -0
  149. package/dist/utils/topicRequest.js.map +1 -1
  150. package/dist/utils/usageRefreshBudget.d.ts.map +1 -1
  151. package/dist/utils/usageRefreshBudget.js +4 -10
  152. package/dist/utils/usageRefreshBudget.js.map +1 -1
  153. package/dist/utils/waitUpTo.d.ts +8 -0
  154. package/dist/utils/waitUpTo.d.ts.map +1 -0
  155. package/dist/utils/waitUpTo.js +20 -0
  156. package/dist/utils/waitUpTo.js.map +1 -0
  157. package/package.json +1 -1
@@ -11,19 +11,40 @@
11
11
  * injected, so the unit test drives it without the network, the file system or a `StateStore`.
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.claudeUsageOnDemandMaxAgeMs = exports.claudeUsageRefreshIntervalMs = void 0;
14
+ exports.claudeLaunchRefreshBudgetMs = exports.claudeUsagePollDeadlineMs = exports.claudeUsageOnDemandMaxAgeMs = exports.claudeUsageRefreshIntervalMs = void 0;
15
15
  exports.createClaudeUsageRefresher = createClaudeUsageRefresher;
16
16
  exports.refreshClaudeUsageForLaunch = refreshClaudeUsageForLaunch;
17
+ const waitUpTo_1 = require("./waitUpTo");
17
18
  const claudeUsage_1 = require("./claudeUsage");
18
19
  exports.claudeUsageRefreshIntervalMs = 10 * 60_000;
19
20
  /** A snapshot younger than this is served as is by the on-demand readers (`/account`, the MCP tool). */
20
21
  exports.claudeUsageOnDemandMaxAgeMs = 60_000;
22
+ /**
23
+ * The longest ONE poll (a profile's, or the OpenCode providers') may run before the refresher gives up on it. Above the
24
+ * fetch's own 15 s timeout, so a healthy abort is never cut short: it only fires when a poll outlives every timeout it has.
25
+ * Without it the poll in flight is shared by every caller (the timer, `/limits`, the `claude_profiles` tool), so ONE poll
26
+ * that never settles keeps all of them waiting for the rest of the process's life.
27
+ */
28
+ exports.claudeUsagePollDeadlineMs = 30_000;
29
+ /**
30
+ * The longest the `claude_profiles` answer waits for fresh figures. A poll is ~0.5 s (6 s at its slowest in the tool's
31
+ * history); past this the tool answers from the cached figures — each profile carries when they were read — and the refresh
32
+ * goes on in the background. Well under the 300 s after which the agent's own client drops a silent tool call.
33
+ */
34
+ exports.claudeLaunchRefreshBudgetMs = 10_000;
35
+ /** The stale mark a poll that was given up on leaves on its figures. */
36
+ const usagePollGaveUpReason = 'usage poll did not finish';
37
+ /** The key of the OpenCode providers' poll beside the profiles' (a profile is keyed by its name). */
38
+ const openCodePollLabel = 'OpenCode providers';
39
+ const millisecondsPerMinute = 60_000;
21
40
  function createClaudeUsageRefresher(deps) {
22
41
  const now = deps.now ?? (() => Date.now());
23
42
  const log = deps.log ?? ((line) => console.log(line));
43
+ const pollDeadlineMs = deps.pollDeadlineMs ?? exports.claudeUsagePollDeadlineMs;
44
+ const pendingPolls = new Map();
24
45
  let inFlight = null;
25
46
  let timer = null;
26
- async function pollProfile(profile) {
47
+ async function pollProfile(profile, signal) {
27
48
  const previous = deps.getSnapshot(profile.name);
28
49
  const token = deps.readToken(profile.configDir);
29
50
  if (token === null) {
@@ -38,7 +59,10 @@ function createClaudeUsageRefresher(deps) {
38
59
  }
39
60
  return;
40
61
  }
41
- const result = await deps.fetchUsage(token.accessToken);
62
+ const result = await deps.fetchUsage(token.accessToken, signal);
63
+ // The refresher gave up on this poll while it ran: a newer reading may have been stored since, so this one writes nothing.
64
+ if (signal.aborted)
65
+ return;
42
66
  if (!result.ok) {
43
67
  log(`[usage] ${profile.name}: usage poll failed (${result.error})`);
44
68
  deps.saveSnapshot(profile.name, (0, claudeUsage_1.markClaudeUsageSnapshotStale)(previous, result.error, now()));
@@ -46,6 +70,69 @@ function createClaudeUsageRefresher(deps) {
46
70
  }
47
71
  deps.saveSnapshot(profile.name, (0, claudeUsage_1.mergeClaudeUsageSnapshot)(previous, result.buckets, 'api', now()));
48
72
  }
73
+ /** Run a poll and log how it ended — whenever that is, so a failure after the deadline is seen too. Never rejects. */
74
+ async function runLoggingFailure(label, poll, signal) {
75
+ try {
76
+ await poll(signal);
77
+ return 'finished';
78
+ }
79
+ catch (e) {
80
+ log(`[usage] ${label}: usage poll threw: ${e instanceof Error ? e.message : String(e)}`);
81
+ return 'threw';
82
+ }
83
+ }
84
+ /**
85
+ * Run the poll of one target, waiting for it at most {@link claudeUsagePollDeadlineMs}. At the deadline the poll is given
86
+ * up on: its request is cancelled, `markStale` (told when the poll started) leaves a stale mark on the figures, and it is
87
+ * left pending until it finally settles — saving nothing, and logging when and how it ended — so a stuck target is not
88
+ * polled twice at once. A call for a target whose earlier poll was given up on returns at once, until that poll has been
89
+ * pending for a whole refresh interval: a poll the cancel cannot reach must not block its target for good, so the next
90
+ * call says so in one line and polls afresh (the old poll's cleanup leaves the new entry alone). A call for a target whose
91
+ * poll is still within its deadline joins it.
92
+ */
93
+ function runPoll(label, poll, markStale) {
94
+ const pending = pendingPolls.get(label);
95
+ if (pending) {
96
+ if (!pending.isAbandoned)
97
+ return pending.done;
98
+ const pendingForMs = now() - pending.startedAtMs;
99
+ if (pendingForMs < exports.claudeUsageRefreshIntervalMs)
100
+ return Promise.resolve();
101
+ log(`[usage] ${label}: the abandoned usage poll is still pending after ${Math.round(pendingForMs / millisecondsPerMinute)} min; polling afresh`);
102
+ }
103
+ const controller = new AbortController();
104
+ const startedAtMs = now();
105
+ const entry = { startedAtMs, isAbandoned: false, done: Promise.resolve() };
106
+ pendingPolls.set(label, entry);
107
+ const ended = runLoggingFailure(label, poll, controller.signal);
108
+ void ended.then((end) => {
109
+ if (pendingPolls.get(label) === entry)
110
+ pendingPolls.delete(label);
111
+ if (!entry.isAbandoned)
112
+ return;
113
+ const duration = `${((now() - startedAtMs) / 1000).toFixed(1)} s`;
114
+ log(`[usage] ${label}: the abandoned usage poll ${end === 'finished' ? `finished after ${duration}; its answer was dropped` : `failed after ${duration}`}`);
115
+ });
116
+ entry.done = (0, waitUpTo_1.waitUpTo)(ended.then(() => undefined), pollDeadlineMs).then((isSettled) => {
117
+ if (isSettled)
118
+ return;
119
+ entry.isAbandoned = true;
120
+ controller.abort();
121
+ markStale(startedAtMs);
122
+ log(`[usage] ${label}: usage poll did not finish within ${pollDeadlineMs / 1000} s; not waiting for it any more`);
123
+ });
124
+ return entry.done;
125
+ }
126
+ /** A reading stored since the poll began (a json-stream frame) is newer than anything the poll could have told: it stays as it is. */
127
+ function markProfileStale(name, pollStartedAtMs) {
128
+ const snapshot = deps.getSnapshot(name);
129
+ if (snapshot && Date.parse(snapshot.fetchedAt) > pollStartedAtMs)
130
+ return;
131
+ deps.saveSnapshot(name, (0, claudeUsage_1.markClaudeUsageSnapshotStale)(snapshot, usagePollGaveUpReason, now()));
132
+ }
133
+ function runProfilePoll(profile) {
134
+ return runPoll(profile.name, (signal) => pollProfile(profile, signal), (pollStartedAtMs) => markProfileStale(profile.name, pollStartedAtMs));
135
+ }
49
136
  function checkNeedsPoll(profile, maxAgeMs) {
50
137
  if (profile.loggedIn === false || profile.billing === 'api')
51
138
  return false;
@@ -61,13 +148,10 @@ function createClaudeUsageRefresher(deps) {
61
148
  return inFlight;
62
149
  inFlight = (async () => {
63
150
  const due = deps.listProfiles().filter((profile) => checkNeedsPoll(profile, options.maxAgeMs));
151
+ const refreshOpenCode = deps.refreshOpenCode;
64
152
  await Promise.all([
65
- ...due.map((profile) => pollProfile(profile).catch((e) => {
66
- log(`[usage] ${profile.name}: usage poll threw: ${e instanceof Error ? e.message : String(e)}`);
67
- })),
68
- deps.refreshOpenCode?.(options).catch((e) => {
69
- log(`[usage] OpenCode providers: usage poll threw: ${e instanceof Error ? e.message : String(e)}`);
70
- }),
153
+ ...due.map((profile) => runProfilePoll(profile)),
154
+ refreshOpenCode && runPoll(openCodePollLabel, (signal) => refreshOpenCode({ ...options, signal }), () => deps.markOpenCodeStale?.(usagePollGaveUpReason)),
71
155
  ]);
72
156
  })().finally(() => { inFlight = null; });
73
157
  return inFlight;
@@ -75,7 +159,7 @@ function createClaudeUsageRefresher(deps) {
75
159
  async function refreshOne(name) {
76
160
  const profile = deps.listProfiles().find((candidate) => candidate.name === name);
77
161
  if (profile && profile.billing !== 'api')
78
- await pollProfile(profile);
162
+ await runProfilePoll(profile);
79
163
  }
80
164
  function noteStreamWindows(name, windows) {
81
165
  const buckets = (0, claudeUsage_1.buildBucketsFromRateLimitWindows)(windows);
@@ -101,11 +185,26 @@ function createClaudeUsageRefresher(deps) {
101
185
  /**
102
186
  * @description The readings behind a launch pick (`claude_profiles`): when the session being resumed was STOPPED BY A
103
187
  * LIMIT, its account is re-read first, unconditionally — its cached figures may lag the limit that just hit — then every
104
- * other profile whose snapshot is older than `maxAgeMs`.
188
+ * other profile whose snapshot is older than `maxAgeMs`. Waits at most `budgetMs` ({@link claudeLaunchRefreshBudgetMs}) for the
189
+ * whole of it; past that it logs one line and returns, and the caller answers from the cached figures. The refresh is not
190
+ * cancelled: it finishes in the background.
105
191
  */
106
192
  async function refreshClaudeUsageForLaunch(refresher, options) {
107
- if (options.isStoppedByLimit && options.currentProfile !== null)
108
- await refresher.refreshOne(options.currentProfile);
109
- await refresher.refreshAll({ maxAgeMs: options.maxAgeMs });
193
+ const budgetMs = options.budgetMs ?? exports.claudeLaunchRefreshBudgetMs;
194
+ const log = options.log ?? ((line) => console.log(line));
195
+ const refresh = async () => {
196
+ try {
197
+ if (options.isStoppedByLimit && options.currentProfile !== null)
198
+ await refresher.refreshOne(options.currentProfile);
199
+ await refresher.refreshAll({ maxAgeMs: options.maxAgeMs });
200
+ }
201
+ catch (e) {
202
+ // Whenever it fails — inside the budget or long after it — the answer is the cached figures, and the failure is on record.
203
+ log(`[usage] claude_profiles: the usage refresh threw: ${e instanceof Error ? e.message : String(e)}`);
204
+ }
205
+ };
206
+ if (!(await (0, waitUpTo_1.waitUpTo)(refresh(), budgetMs))) {
207
+ log(`[usage] claude_profiles: the usage refresh did not finish within ${budgetMs / 1000} s; answering from the cached figures`);
208
+ }
110
209
  }
111
210
  //# sourceMappingURL=claudeUsageRefresher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claud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AAQ,EAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;QAC3C,GAAG,CAAC,oEAAoE,QAAQ,GAAG,IAAI,uCAAuC,CAAC,CAAC;IAClI,CAAC;AACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @description Pure helper for the forwarded-message mark — the agent-facing
3
+ * `[Forwarded message · from: … · originally sent: …]` line the bot glues ahead
4
+ * of a prompt when the operator FORWARDS a message into a bound, agent-active
5
+ * topic. Without it the agent reads the forwarded words as the operator's own
6
+ * (it once took two forwarded bot alerts, sent as examples, for a report).
7
+ *
8
+ * Plain English (agent-facing, NOT i18n) and folded ahead of the prompt by the
9
+ * same rule as the reply quote (`getPromptWithMessageContext`): a forwarded text,
10
+ * a caption, a voice note's transcript and a file announcement all carry it.
11
+ *
12
+ * The input is STRUCTURAL (no telegraf imports) so the helper is unit-testable;
13
+ * the bridge that reads a real telegraf message lives in the Telegram connector
14
+ * (`getTelegramForwardedMark`).
15
+ */
16
+ /** What the origin's name stands for, as it reads in the mark. */
17
+ declare const originKindLabels: {
18
+ readonly user: "user";
19
+ readonly hiddenUser: "hidden user";
20
+ readonly chat: "chat";
21
+ readonly channel: "channel";
22
+ };
23
+ /** The four kinds of origin Telegram reports for a forwarded message. */
24
+ export type ForwardedOriginKind = keyof typeof originKindLabels;
25
+ /**
26
+ * @description The origin of a forwarded message, distilled from a telegraf
27
+ * `forward_origin` by the Telegram connector.
28
+ */
29
+ export interface ForwardedMarkSource {
30
+ kind: ForwardedOriginKind;
31
+ /** The sender's display name, or the chat / channel title; empty when Telegram gave none. */
32
+ name: string;
33
+ /** A user's `@username`, when they have one. */
34
+ username?: string;
35
+ /** The post author's signature (a channel post, an anonymous group admin). */
36
+ signature?: string;
37
+ /** When the message was ORIGINALLY sent, unix seconds. */
38
+ originalSentAtSeconds?: number;
39
+ }
40
+ /**
41
+ * @description Who first wrote a forwarded message, as it reads in the mark and in the header of a reply to it:
42
+ * `channel "Ops Alerts"`, `user "Alice Smith" (@alice)`, `chat "Team room" (signed "Chief")`. A name is quoted, so
43
+ * the origin cannot be told apart from what it says.
44
+ */
45
+ export declare function describeForwardedOrigin(source: ForwardedMarkSource): string;
46
+ /**
47
+ * @description Render the mark, or `null` when the message was not forwarded.
48
+ * The original date is the instance-local ISO instant the `/timestamps` line
49
+ * uses, so the agent reads both on one clock; it is left out when Telegram gave
50
+ * no usable date.
51
+ */
52
+ export declare function buildForwardedMark(source: ForwardedMarkSource | undefined): string | null;
53
+ export {};
54
+ //# sourceMappingURL=forwardedMark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forwardedMark.d.ts","sourceRoot":"","sources":["../../src/utils/forwardedMark.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,kEAAkE;AAClE,QAAA,MAAM,gBAAgB;;;;;CAKZ,CAAC;AAEX,yEAAyE;AACzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAmBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAU3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CASzF"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /**
3
+ * @description Pure helper for the forwarded-message mark — the agent-facing
4
+ * `[Forwarded message · from: … · originally sent: …]` line the bot glues ahead
5
+ * of a prompt when the operator FORWARDS a message into a bound, agent-active
6
+ * topic. Without it the agent reads the forwarded words as the operator's own
7
+ * (it once took two forwarded bot alerts, sent as examples, for a report).
8
+ *
9
+ * Plain English (agent-facing, NOT i18n) and folded ahead of the prompt by the
10
+ * same rule as the reply quote (`getPromptWithMessageContext`): a forwarded text,
11
+ * a caption, a voice note's transcript and a file announcement all carry it.
12
+ *
13
+ * The input is STRUCTURAL (no telegraf imports) so the helper is unit-testable;
14
+ * the bridge that reads a real telegraf message lives in the Telegram connector
15
+ * (`getTelegramForwardedMark`).
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.describeForwardedOrigin = describeForwardedOrigin;
19
+ exports.buildForwardedMark = buildForwardedMark;
20
+ const isoTimestamp_1 = require("./isoTimestamp");
21
+ const stripControlCharacters_1 = require("./stripControlCharacters");
22
+ /** Header prefix of the mark — recognisable, agent-facing English. */
23
+ const forwardedMarkHeaderPrefix = '[Forwarded message · from: ';
24
+ /** Milliseconds in a second: Telegram dates are unix SECONDS, `formatIsoLocalOffset` takes ms. */
25
+ const millisecondsPerSecond = 1000;
26
+ /** What the origin's name stands for, as it reads in the mark. */
27
+ const originKindLabels = {
28
+ user: 'user',
29
+ hiddenUser: 'hidden user',
30
+ chat: 'chat',
31
+ channel: 'channel',
32
+ };
33
+ /** Fallback for an origin with no name at all. */
34
+ const unknownOriginName = 'unknown';
35
+ /**
36
+ * A third party's text (a sender's name, a chat's title, a post signature — all chosen by someone else) as ONE line
37
+ * that cannot take part in the mark's own syntax: control and bidirectional characters out, whitespace flattened, and the square brackets that
38
+ * close the header turned into parentheses.
39
+ */
40
+ function cleanThirdPartyText(value) {
41
+ return (0, stripControlCharacters_1.stripControlCharacters)(value).replace(/\s+/g, ' ').trim().replace(/\[/g, '(').replace(/\]/g, ')');
42
+ }
43
+ /** A cleaned text as a quoted token: what a stranger wrote reads as DATA, whatever it says (`"` and `\` are escaped). */
44
+ function quoteCleanText(cleanText) {
45
+ return JSON.stringify(cleanText);
46
+ }
47
+ /**
48
+ * @description Who first wrote a forwarded message, as it reads in the mark and in the header of a reply to it:
49
+ * `channel "Ops Alerts"`, `user "Alice Smith" (@alice)`, `chat "Team room" (signed "Chief")`. A name is quoted, so
50
+ * the origin cannot be told apart from what it says.
51
+ */
52
+ function describeForwardedOrigin(source) {
53
+ const cleanName = cleanThirdPartyText(source.name);
54
+ const name = cleanName ? quoteCleanText(cleanName) : unknownOriginName;
55
+ const cleanUsername = source.username ? cleanThirdPartyText(source.username) : '';
56
+ const cleanSignature = source.signature ? cleanThirdPartyText(source.signature) : '';
57
+ const details = [
58
+ ...(cleanUsername ? [`@${cleanUsername}`] : []),
59
+ ...(cleanSignature ? [`signed ${quoteCleanText(cleanSignature)}`] : []),
60
+ ];
61
+ return `${originKindLabels[source.kind]} ${name}${details.length > 0 ? ` (${details.join(', ')})` : ''}`;
62
+ }
63
+ /**
64
+ * @description Render the mark, or `null` when the message was not forwarded.
65
+ * The original date is the instance-local ISO instant the `/timestamps` line
66
+ * uses, so the agent reads both on one clock; it is left out when Telegram gave
67
+ * no usable date.
68
+ */
69
+ function buildForwardedMark(source) {
70
+ if (!source)
71
+ return null;
72
+ const parts = [
73
+ `${forwardedMarkHeaderPrefix}${describeForwardedOrigin(source)}`,
74
+ ...(source.originalSentAtSeconds && source.originalSentAtSeconds > 0
75
+ ? [`originally sent: ${(0, isoTimestamp_1.formatIsoLocalOffset)(source.originalSentAtSeconds * millisecondsPerSecond)}`]
76
+ : []),
77
+ ];
78
+ return `${parts.join(' · ')}]`;
79
+ }
80
+ //# sourceMappingURL=forwardedMark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forwardedMark.js","sourceRoot":"","sources":["../../src/utils/forwardedMark.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AA4DH,0DAUC;AAQD,gDASC;AArFD,iDAAsD;AACtD,qEAAkE;AAElE,sEAAsE;AACtE,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEhE,kGA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,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACxE,CAAC;IACF,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC3G,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,MAAuC;IACxE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,KAAK,GAAG;QACZ,GAAG,yBAAyB,GAAG,uBAAuB,CAAC,MAAM,CAAC,EAAE;QAChE,GAAG,CAAC,MAAM,CAAC,qBAAqB,IAAI,MAAM,CAAC,qBAAqB,GAAG,CAAC;YAClE,CAAC,CAAC,CAAC,oBAAoB,IAAA,mCAAoB,EAAC,MAAM,CAAC,qBAAqB,GAAG,qBAAqB,CAAC,EAAE,CAAC;YACpG,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;IACF,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AACjC,CAAC"}
@@ -9,6 +9,11 @@
9
9
  */
10
10
  /** Held per conversation at most; a scheduler firing all through a long wait must not flood the resume. */
11
11
  export declare const limitHeldPromptsMax = 10;
12
+ /**
13
+ * The line that opens the held prompts after a message's own text. The message may be a forwarded one, whose mark has no end: without a
14
+ * line of their own the scheduled runs below would read as the rest of the forwarded words.
15
+ */
16
+ export declare const heldPromptsHeader = "[Held over the usage-limit wait \u2014 not part of the message above]";
12
17
  /**
13
18
  * @name LimitHeldPrompt
14
19
  * @description A prompt held over a usage-limit wait. `text` is the prompt as it
@@ -32,8 +37,9 @@ export declare function getHeldPromptsWith(held: readonly LimitHeldPrompt[], pro
32
37
  };
33
38
  /**
34
39
  * @description The forwarded `text` with the held prompts after it, in arrival
35
- * order — one message, so nothing can slip between them. A held copy of `text`
36
- * itself is not repeated: it is being delivered right now.
40
+ * order — one message, so nothing can slip between them — under a line of their
41
+ * own ({@link heldPromptsHeader}), so they never read as part of `text`. A held
42
+ * copy of `text` itself is not repeated: it is being delivered right now.
37
43
  */
38
44
  export declare function getTextWithHeldPrompts(text: string, held: readonly LimitHeldPrompt[]): string;
39
45
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"limitHeldPrompts.d.ts","sourceRoot":"","sources":["../../src/utils/limitHeldPrompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2GAA2G;AAC3G,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAItC;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAOD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,eAAe,EAAE,EAChC,MAAM,EAAE,eAAe,GACtB;IAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAKnD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAE7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,GAAG,IAAI,CAElF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAI7C"}
1
+ {"version":3,"file":"limitHeldPrompts.d.ts","sourceRoot":"","sources":["../../src/utils/limitHeldPrompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2GAA2G;AAC3G,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAGtC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,0EAAqE,CAAC;AAEpG;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAOD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,eAAe,EAAE,EAChC,MAAM,EAAE,eAAe,GACtB;IAAE,IAAI,EAAE,eAAe,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAKnD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAG7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,GAAG,IAAI,CAElF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAI7C"}
@@ -9,7 +9,7 @@
9
9
  * share the hold through `postToSession`.
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.limitHeldPromptsMax = void 0;
12
+ exports.heldPromptsHeader = exports.limitHeldPromptsMax = void 0;
13
13
  exports.getHeldPromptsWith = getHeldPromptsWith;
14
14
  exports.getTextWithHeldPrompts = getTextWithHeldPrompts;
15
15
  exports.getHeldPromptsText = getHeldPromptsText;
@@ -18,6 +18,11 @@ exports.getLimitResumeMessage = getLimitResumeMessage;
18
18
  exports.limitHeldPromptsMax = 10;
19
19
  /** Between two prompts delivered as one: each carries its own header. */
20
20
  const heldPromptSeparator = '\n\n';
21
+ /**
22
+ * The line that opens the held prompts after a message's own text. The message may be a forwarded one, whose mark has no end: without a
23
+ * line of their own the scheduled runs below would read as the rest of the forwarded words.
24
+ */
25
+ exports.heldPromptsHeader = '[Held over the usage-limit wait — not part of the message above]';
21
26
  /** What a held prompt says when it is finally delivered. */
22
27
  function getDeliveredText(prompt) {
23
28
  return prompt.heldText ?? prompt.text;
@@ -37,11 +42,13 @@ function getHeldPromptsWith(held, prompt) {
37
42
  }
38
43
  /**
39
44
  * @description The forwarded `text` with the held prompts after it, in arrival
40
- * order — one message, so nothing can slip between them. A held copy of `text`
41
- * itself is not repeated: it is being delivered right now.
45
+ * order — one message, so nothing can slip between them — under a line of their
46
+ * own ({@link heldPromptsHeader}), so they never read as part of `text`. A held
47
+ * copy of `text` itself is not repeated: it is being delivered right now.
42
48
  */
43
49
  function getTextWithHeldPrompts(text, held) {
44
- return [text, ...held.filter((prompt) => prompt.text !== text).map(getDeliveredText)].join(heldPromptSeparator);
50
+ const heldTexts = held.filter((prompt) => prompt.text !== text).map(getDeliveredText);
51
+ return heldTexts.length === 0 ? text : [text, exports.heldPromptsHeader, ...heldTexts].join(heldPromptSeparator);
45
52
  }
46
53
  /**
47
54
  * @description The held prompts as one message, for a session that starts with
@@ -1 +1 @@
1
- {"version":3,"file":"limitHeldPrompts.js","sourceRoot":"","sources":["../../src/utils/limitHeldPrompts.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA8BH,gDAQC;AAOD,wDAEC;AAMD,gDAEC;AASD,sDAOC;AArED,2GAA2G;AAC9F,QAAA,mBAAmB,GAAG,EAAE,CAAC;AACtC,yEAAyE;AACzE,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAcnC,4DAA4D;AAC5D,SAAS,gBAAgB,CAAC,MAAuB;IAC/C,OAAO,MAAM,CA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,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACtF,OAAO,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,yBAAiB,EAAE,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC3G,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,IAAgC;IACjE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACvF,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,KAGrC;IACC,OAAO,KAAK,CAAC,oBAAoB,KAAK,SAAS;QAC7C,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,aAAa,EAAE,eAAe,EAAE,KAAK,EAAE;QACvD,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,oBAAoB,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;AAClE,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @description Pure helpers for the MESSAGE CONTEXT of a prompt — the agent-facing
3
+ * blocks the bot glues ahead of the operator's text because of how the Telegram
4
+ * message arrived: the reply-quote block (`replyQuote.ts`, the message it
5
+ * answers) and the forwarded mark (`forwardedMark.ts`, who first wrote it).
6
+ *
7
+ * The blocks ride the per-message body (like the `/timestamps` line), NOT the
8
+ * once-per-change preamble marker. One fold rule ({@link getPromptWithMessageContext})
9
+ * serves every route a prompt takes — the live forward (`forwardPromptToAgent`),
10
+ * the startup buffer, a file or album announcement — so a spoken or captioned
11
+ * message carries exactly what a typed one does.
12
+ */
13
+ /**
14
+ * @name MessageContext
15
+ * @description What a Telegram message carries besides its words: the `block` that leads the prompt (the reply quote,
16
+ * the forwarded mark) and whether the message was FORWARDED. A forwarded message is content and never control input:
17
+ * its text starting with `/` is not a slash command, a bare digit in it is not an answer, a phrase in it does not start
18
+ * an agent — see {@link checkIsSlashCommandPrompt}.
19
+ */
20
+ export interface MessageContext {
21
+ block: string;
22
+ isForwarded: boolean;
23
+ }
24
+ /**
25
+ * @description The blocks that apply to one message as one context block, in the
26
+ * order given, or `undefined` when none does.
27
+ */
28
+ export declare function joinMessageContextBlocks(blocks: ReadonlyArray<string | null | undefined>): string | undefined;
29
+ /**
30
+ * @description Whether `text` is a slash command for the agent (`/compact`, `/clear`…): a control token that no block,
31
+ * preamble or timestamp may be put ahead of. Never for a forwarded message, whose words are somebody else's: the mark
32
+ * ahead of them is exactly what makes them plain text.
33
+ */
34
+ export declare function checkIsSlashCommandPrompt(text: string, context: MessageContext | undefined): boolean;
35
+ /**
36
+ * @description Lead a prompt with its message-context block — the ONE folding
37
+ * rule, shared by the live forward (`forwardPromptToAgent`) and a prompt buffered
38
+ * behind a session start, whose replay forwards the buffered text as is: a reply
39
+ * or a forward made while the agent boots must reach it exactly like one made after.
40
+ *
41
+ * The prompt is returned unchanged when there is no context, or when it is not an
42
+ * agent prompt at all:
43
+ * - a slash command typed by the operator is a control token for the agent, which
44
+ * a block ahead of it would corrupt into plain text (a FORWARDED message is
45
+ * never one — {@link checkIsSlashCommandPrompt});
46
+ * - a terminal topic's input is a shell command line, and typed into a shell
47
+ * the block's `> ` lines run as redirections that overwrite a file named by
48
+ * the quote's first word. A message there never carries a block either.
49
+ */
50
+ export declare function getPromptWithMessageContext(prompt: string, options: {
51
+ context: MessageContext | undefined;
52
+ isShellInput: boolean;
53
+ }): string;
54
+ //# sourceMappingURL=messageContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageContext.d.ts","sourceRoot":"","sources":["../../src/utils/messageContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAG7G;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAEpG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,cAAc,GAAG,SAAS,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,GACtE,MAAM,CAIR"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * @description Pure helpers for the MESSAGE CONTEXT of a prompt — the agent-facing
4
+ * blocks the bot glues ahead of the operator's text because of how the Telegram
5
+ * message arrived: the reply-quote block (`replyQuote.ts`, the message it
6
+ * answers) and the forwarded mark (`forwardedMark.ts`, who first wrote it).
7
+ *
8
+ * The blocks ride the per-message body (like the `/timestamps` line), NOT the
9
+ * once-per-change preamble marker. One fold rule ({@link getPromptWithMessageContext})
10
+ * serves every route a prompt takes — the live forward (`forwardPromptToAgent`),
11
+ * the startup buffer, a file or album announcement — so a spoken or captioned
12
+ * message carries exactly what a typed one does.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.joinMessageContextBlocks = joinMessageContextBlocks;
16
+ exports.checkIsSlashCommandPrompt = checkIsSlashCommandPrompt;
17
+ exports.getPromptWithMessageContext = getPromptWithMessageContext;
18
+ const threadContextPreamble_1 = require("../threadContextPreamble");
19
+ /** Separator between the context blocks, and between them and the prompt they lead. */
20
+ const messageContextSeparator = '\n\n';
21
+ /**
22
+ * @description The blocks that apply to one message as one context block, in the
23
+ * order given, or `undefined` when none does.
24
+ */
25
+ function joinMessageContextBlocks(blocks) {
26
+ const present = blocks.filter((block) => !!block);
27
+ return present.length > 0 ? present.join(messageContextSeparator) : undefined;
28
+ }
29
+ /**
30
+ * @description Whether `text` is a slash command for the agent (`/compact`, `/clear`…): a control token that no block,
31
+ * preamble or timestamp may be put ahead of. Never for a forwarded message, whose words are somebody else's: the mark
32
+ * ahead of them is exactly what makes them plain text.
33
+ */
34
+ function checkIsSlashCommandPrompt(text, context) {
35
+ return context?.isForwarded !== true && (0, threadContextPreamble_1.checkShouldSkipPreambleForText)(text);
36
+ }
37
+ /**
38
+ * @description Lead a prompt with its message-context block — the ONE folding
39
+ * rule, shared by the live forward (`forwardPromptToAgent`) and a prompt buffered
40
+ * behind a session start, whose replay forwards the buffered text as is: a reply
41
+ * or a forward made while the agent boots must reach it exactly like one made after.
42
+ *
43
+ * The prompt is returned unchanged when there is no context, or when it is not an
44
+ * agent prompt at all:
45
+ * - a slash command typed by the operator is a control token for the agent, which
46
+ * a block ahead of it would corrupt into plain text (a FORWARDED message is
47
+ * never one — {@link checkIsSlashCommandPrompt});
48
+ * - a terminal topic's input is a shell command line, and typed into a shell
49
+ * the block's `> ` lines run as redirections that overwrite a file named by
50
+ * the quote's first word. A message there never carries a block either.
51
+ */
52
+ function getPromptWithMessageContext(prompt, options) {
53
+ const { context } = options;
54
+ if (!context || options.isShellInput || checkIsSlashCommandPrompt(prompt, context))
55
+ return prompt;
56
+ return `${context.block}${messageContextSeparator}${prompt}`;
57
+ }
58
+ //# sourceMappingURL=messageContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageContext.js","sourceRoot":"","sources":["../../src/utils/messageContext.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAuBH,4DAGC;AAOD,8DAEC;AAiBD,kEAOC;AAzDD,oEAA0E;AAE1E,uFAAuF;AACvF,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAcvC;;;GAGG;AACH,SAAgB,wBAAwB,CAAC,MAAgD;IACvF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChF,CAAC;AAED;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,IAAY,EAAE,OAAmC;IACzF,OAAO,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,IAAA,sDAA8B,EAAC,IAAI,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,2BAA2B,CACzC,MAAc,EACd,OAAuE;IAEvE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,YAAY,IAAI,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAC;QAAE,OAAO,MAAM,CAAC;IAClG,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,uBAAuB,GAAG,MAAM,EAAE,CAAC;AAC/D,CAAC"}
@@ -61,9 +61,10 @@ export declare function fetchChatGptUsage(credential: OpenCodeProviderCredential
61
61
  fetchImpl?: UsageFetchLike;
62
62
  timeoutMs?: number;
63
63
  nowMs?: number;
64
+ signal?: AbortSignal;
64
65
  }): Promise<ClaudeUsageFetchResult>;
65
- /** A provider's subscription usage reader: one poll with the stored credential. */
66
- export type OpenCodeUsageReader = (credential: OpenCodeProviderCredential) => Promise<ClaudeUsageFetchResult>;
66
+ /** A provider's subscription usage reader: one poll with the stored credential; `signal` cancels it. */
67
+ export type OpenCodeUsageReader = (credential: OpenCodeProviderCredential, signal?: AbortSignal) => Promise<ClaudeUsageFetchResult>;
67
68
  /** The subscription usage readers by provider id; a provider not here shows only its auth kind. */
68
69
  export declare const openCodeUsageReaders: Readonly<Record<string, OpenCodeUsageReader>>;
69
70
  export interface OpenCodeUsagePollerDeps {
@@ -77,10 +78,16 @@ export interface OpenCodeUsagePollerDeps {
77
78
  log?: (line: string) => void;
78
79
  }
79
80
  export interface OpenCodeUsagePoller {
80
- /** Poll every provider `auth.json` lists; with `maxAgeMs`, only the subscriptions whose snapshot is older (or stale). */
81
+ /**
82
+ * Poll every provider `auth.json` lists; with `maxAgeMs`, only the subscriptions whose snapshot is older (or stale). A poll
83
+ * whose `signal` was aborted saves nothing: its caller has given up on it, and its late answer must not overwrite a newer one.
84
+ */
81
85
  refreshAll: (options?: {
82
86
  maxAgeMs?: number;
87
+ signal?: AbortSignal;
83
88
  }) => Promise<void>;
89
+ /** Mark the stored figures of every subscription that has a reader stale with `reason` (the caller gave up on a poll); the figures and their age stay. */
90
+ markAllStale: (reason: string) => void;
84
91
  }
85
92
  /**
86
93
  * @description The poller of OpenCode providers' usage. For each provider in `auth.json`: an API key or an unknown record
@@ -1 +1 @@
1
- {"version":3,"file":"openCodeUsage.d.ts","sourceRoot":"","sources":["../../src/utils/openCodeUsage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAIL,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,oBAAoB,+CAA+C,CAAC;AAEjF,gEAAgE;AAChE,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,8GAA8G;AAC9G,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAKD;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE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