charness 3.12.0 → 3.13.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 (232) hide show
  1. package/.env.example +5 -0
  2. package/CHANGELOG.md +27 -0
  3. package/DEVELOPMENT.md +78 -15
  4. package/README.md +2 -1
  5. package/SETUP.md +65 -20
  6. package/agent-plugin/skills/charness-delegate-claude/SKILL.md +14 -5
  7. package/dist/accessControl.d.ts +43 -0
  8. package/dist/accessControl.d.ts.map +1 -1
  9. package/dist/accessControl.js +50 -1
  10. package/dist/accessControl.js.map +1 -1
  11. package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
  12. package/dist/adapters/claudeCliAdapter.js +9 -4
  13. package/dist/adapters/claudeCliAdapter.js.map +1 -1
  14. package/dist/adapters/claudeJsonStreamAdapter.js +1 -1
  15. package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
  16. package/dist/adapters/claudePlatformFlags.d.ts +4 -3
  17. package/dist/adapters/claudePlatformFlags.d.ts.map +1 -1
  18. package/dist/adapters/claudePlatformFlags.js +4 -3
  19. package/dist/adapters/claudePlatformFlags.js.map +1 -1
  20. package/dist/adapters/openCodeAdapter.d.ts +37 -13
  21. package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
  22. package/dist/adapters/openCodeAdapter.js +73 -41
  23. package/dist/adapters/openCodeAdapter.js.map +1 -1
  24. package/dist/adapters/terminalAdapter.d.ts.map +1 -1
  25. package/dist/adapters/terminalAdapter.js +5 -3
  26. package/dist/adapters/terminalAdapter.js.map +1 -1
  27. package/dist/agentLogin/agentLogin.d.ts.map +1 -1
  28. package/dist/agentLogin/agentLogin.js +2 -14
  29. package/dist/agentLogin/agentLogin.js.map +1 -1
  30. package/dist/bot.d.ts +12 -3
  31. package/dist/bot.d.ts.map +1 -1
  32. package/dist/bot.js +476 -133
  33. package/dist/bot.js.map +1 -1
  34. package/dist/cli/claudeProfiles.js +2 -2
  35. package/dist/cli/claudeProfiles.js.map +1 -1
  36. package/dist/connectors/jira/client.js +1 -1
  37. package/dist/connectors/jira/client.js.map +1 -1
  38. package/dist/connectors/jira/config.d.ts +7 -0
  39. package/dist/connectors/jira/config.d.ts.map +1 -1
  40. package/dist/connectors/jira/config.js +12 -1
  41. package/dist/connectors/jira/config.js.map +1 -1
  42. package/dist/connectors/jira/connector.d.ts +7 -0
  43. package/dist/connectors/jira/connector.d.ts.map +1 -1
  44. package/dist/connectors/jira/connector.js +20 -3
  45. package/dist/connectors/jira/connector.js.map +1 -1
  46. package/dist/connectors/jira/inbound.d.ts.map +1 -1
  47. package/dist/connectors/jira/inbound.js +4 -3
  48. package/dist/connectors/jira/inbound.js.map +1 -1
  49. package/dist/connectors/jira/issueBlocks.d.ts +1 -1
  50. package/dist/connectors/jira/trustedGroup.d.ts +21 -6
  51. package/dist/connectors/jira/trustedGroup.d.ts.map +1 -1
  52. package/dist/connectors/jira/trustedGroup.js +46 -6
  53. package/dist/connectors/jira/trustedGroup.js.map +1 -1
  54. package/dist/connectors/telegram/commands/botCore.d.ts +19 -2
  55. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
  56. package/dist/connectors/telegram/commands/compaction.d.ts +5 -3
  57. package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
  58. package/dist/connectors/telegram/commands/compaction.js +9 -6
  59. package/dist/connectors/telegram/commands/compaction.js.map +1 -1
  60. package/dist/connectors/telegram/commands/todo.d.ts.map +1 -1
  61. package/dist/connectors/telegram/commands/todo.js +2 -2
  62. package/dist/connectors/telegram/commands/todo.js.map +1 -1
  63. package/dist/connectors/telegram/commands/topicAccess.d.ts +30 -0
  64. package/dist/connectors/telegram/commands/topicAccess.d.ts.map +1 -0
  65. package/dist/connectors/telegram/commands/topicAccess.js +399 -0
  66. package/dist/connectors/telegram/commands/topicAccess.js.map +1 -0
  67. package/dist/connectors/telegram/inbound.d.ts +44 -7
  68. package/dist/connectors/telegram/inbound.d.ts.map +1 -1
  69. package/dist/connectors/telegram/inbound.js +142 -24
  70. package/dist/connectors/telegram/inbound.js.map +1 -1
  71. package/dist/i18n/de.d.ts.map +1 -1
  72. package/dist/i18n/de.js +68 -0
  73. package/dist/i18n/de.js.map +1 -1
  74. package/dist/i18n/en.d.ts.map +1 -1
  75. package/dist/i18n/en.js +68 -0
  76. package/dist/i18n/en.js.map +1 -1
  77. package/dist/i18n/es.d.ts.map +1 -1
  78. package/dist/i18n/es.js +68 -0
  79. package/dist/i18n/es.js.map +1 -1
  80. package/dist/i18n/fr.d.ts.map +1 -1
  81. package/dist/i18n/fr.js +68 -0
  82. package/dist/i18n/fr.js.map +1 -1
  83. package/dist/i18n/hi.d.ts.map +1 -1
  84. package/dist/i18n/hi.js +68 -0
  85. package/dist/i18n/hi.js.map +1 -1
  86. package/dist/i18n/ja.d.ts.map +1 -1
  87. package/dist/i18n/ja.js +68 -0
  88. package/dist/i18n/ja.js.map +1 -1
  89. package/dist/i18n/ka.d.ts.map +1 -1
  90. package/dist/i18n/ka.js +68 -0
  91. package/dist/i18n/ka.js.map +1 -1
  92. package/dist/i18n/pt.d.ts.map +1 -1
  93. package/dist/i18n/pt.js +68 -0
  94. package/dist/i18n/pt.js.map +1 -1
  95. package/dist/i18n/ru.d.ts.map +1 -1
  96. package/dist/i18n/ru.js +68 -0
  97. package/dist/i18n/ru.js.map +1 -1
  98. package/dist/i18n/uk.d.ts.map +1 -1
  99. package/dist/i18n/uk.js +68 -0
  100. package/dist/i18n/uk.js.map +1 -1
  101. package/dist/i18n/uz.d.ts.map +1 -1
  102. package/dist/i18n/uz.js +68 -0
  103. package/dist/i18n/uz.js.map +1 -1
  104. package/dist/i18n/zh.d.ts.map +1 -1
  105. package/dist/i18n/zh.js +68 -0
  106. package/dist/i18n/zh.js.map +1 -1
  107. package/dist/installManager.d.ts +37 -1
  108. package/dist/installManager.d.ts.map +1 -1
  109. package/dist/installManager.js +205 -14
  110. package/dist/installManager.js.map +1 -1
  111. package/dist/platform/commandRouter.d.ts +13 -1
  112. package/dist/platform/commandRouter.d.ts.map +1 -1
  113. package/dist/platform/commandRouter.js +14 -2
  114. package/dist/platform/commandRouter.js.map +1 -1
  115. package/dist/platform/inbound.d.ts +2 -0
  116. package/dist/platform/inbound.d.ts.map +1 -1
  117. package/dist/runners/runnerLock.d.ts +36 -1
  118. package/dist/runners/runnerLock.d.ts.map +1 -1
  119. package/dist/runners/runnerLock.js +94 -30
  120. package/dist/runners/runnerLock.js.map +1 -1
  121. package/dist/scheduler/checkRun.d.ts +0 -2
  122. package/dist/scheduler/checkRun.d.ts.map +1 -1
  123. package/dist/scheduler/checkRun.js +0 -10
  124. package/dist/scheduler/checkRun.js.map +1 -1
  125. package/dist/selfUpdate/bootRollback.d.ts.map +1 -1
  126. package/dist/selfUpdate/bootRollback.js +3 -2
  127. package/dist/selfUpdate/bootRollback.js.map +1 -1
  128. package/dist/selfUpdate/updateRuntime.d.ts.map +1 -1
  129. package/dist/selfUpdate/updateRuntime.js +6 -3
  130. package/dist/selfUpdate/updateRuntime.js.map +1 -1
  131. package/dist/state.d.ts +49 -0
  132. package/dist/state.d.ts.map +1 -1
  133. package/dist/state.js +112 -0
  134. package/dist/state.js.map +1 -1
  135. package/dist/threadContextPreamble.d.ts +15 -1
  136. package/dist/threadContextPreamble.d.ts.map +1 -1
  137. package/dist/threadContextPreamble.js +15 -3
  138. package/dist/threadContextPreamble.js.map +1 -1
  139. package/dist/threadRouting.d.ts +47 -4
  140. package/dist/threadRouting.d.ts.map +1 -1
  141. package/dist/threadRouting.js +31 -4
  142. package/dist/threadRouting.js.map +1 -1
  143. package/dist/todos/projects.d.ts +1 -1
  144. package/dist/todos/projects.d.ts.map +1 -1
  145. package/dist/todos/projects.js +3 -14
  146. package/dist/todos/projects.js.map +1 -1
  147. package/dist/topicTalkerMemory.d.ts +37 -0
  148. package/dist/topicTalkerMemory.d.ts.map +1 -0
  149. package/dist/topicTalkerMemory.js +61 -0
  150. package/dist/topicTalkerMemory.js.map +1 -0
  151. package/dist/topicTalkers.d.ts +123 -0
  152. package/dist/topicTalkers.d.ts.map +1 -0
  153. package/dist/topicTalkers.js +276 -0
  154. package/dist/topicTalkers.js.map +1 -0
  155. package/dist/types.d.ts +5 -4
  156. package/dist/types.d.ts.map +1 -1
  157. package/dist/utils/agentEnvironment.d.ts +23 -0
  158. package/dist/utils/agentEnvironment.d.ts.map +1 -1
  159. package/dist/utils/agentEnvironment.js +33 -1
  160. package/dist/utils/agentEnvironment.js.map +1 -1
  161. package/dist/utils/agentPlugin.d.ts +7 -2
  162. package/dist/utils/agentPlugin.d.ts.map +1 -1
  163. package/dist/utils/agentPlugin.js +11 -5
  164. package/dist/utils/agentPlugin.js.map +1 -1
  165. package/dist/utils/authorMark.d.ts +59 -0
  166. package/dist/utils/authorMark.d.ts.map +1 -0
  167. package/dist/utils/authorMark.js +86 -0
  168. package/dist/utils/authorMark.js.map +1 -0
  169. package/dist/utils/claudeLimitSwitch.d.ts +5 -1
  170. package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
  171. package/dist/utils/claudeLimitSwitch.js +6 -2
  172. package/dist/utils/claudeLimitSwitch.js.map +1 -1
  173. package/dist/utils/claudeProfileUsageLines.d.ts +1 -1
  174. package/dist/utils/claudeProfileUsageLines.js +3 -3
  175. package/dist/utils/claudeProfileUsageLines.js.map +1 -1
  176. package/dist/utils/claudeProfiles.d.ts +7 -0
  177. package/dist/utils/claudeProfiles.d.ts.map +1 -1
  178. package/dist/utils/claudeProfiles.js +15 -0
  179. package/dist/utils/claudeProfiles.js.map +1 -1
  180. package/dist/utils/claudeUsage.d.ts +56 -20
  181. package/dist/utils/claudeUsage.d.ts.map +1 -1
  182. package/dist/utils/claudeUsage.js +81 -38
  183. package/dist/utils/claudeUsage.js.map +1 -1
  184. package/dist/utils/fallbackChain.d.ts.map +1 -1
  185. package/dist/utils/fallbackChain.js +8 -4
  186. package/dist/utils/fallbackChain.js.map +1 -1
  187. package/dist/utils/folderGit.d.ts +9 -0
  188. package/dist/utils/folderGit.d.ts.map +1 -0
  189. package/dist/utils/folderGit.js +33 -0
  190. package/dist/utils/folderGit.js.map +1 -0
  191. package/dist/utils/forwardedMark.d.ts +8 -0
  192. package/dist/utils/forwardedMark.d.ts.map +1 -1
  193. package/dist/utils/forwardedMark.js +2 -0
  194. package/dist/utils/forwardedMark.js.map +1 -1
  195. package/dist/utils/jsonStreamHost.d.ts +2 -1
  196. package/dist/utils/jsonStreamHost.d.ts.map +1 -1
  197. package/dist/utils/jsonStreamHost.js +4 -2
  198. package/dist/utils/jsonStreamHost.js.map +1 -1
  199. package/dist/utils/messageContext.d.ts +22 -7
  200. package/dist/utils/messageContext.d.ts.map +1 -1
  201. package/dist/utils/messageContext.js +19 -5
  202. package/dist/utils/messageContext.js.map +1 -1
  203. package/dist/utils/personLabel.d.ts +13 -0
  204. package/dist/utils/personLabel.d.ts.map +1 -0
  205. package/dist/utils/personLabel.js +15 -0
  206. package/dist/utils/personLabel.js.map +1 -0
  207. package/dist/utils/replyQuote.d.ts +17 -3
  208. package/dist/utils/replyQuote.d.ts.map +1 -1
  209. package/dist/utils/replyQuote.js +25 -2
  210. package/dist/utils/replyQuote.js.map +1 -1
  211. package/dist/utils/talkerAccess.d.ts +9 -0
  212. package/dist/utils/talkerAccess.d.ts.map +1 -0
  213. package/dist/utils/talkerAccess.js +20 -0
  214. package/dist/utils/talkerAccess.js.map +1 -0
  215. package/dist/utils/tmuxExec.d.ts +20 -8
  216. package/dist/utils/tmuxExec.d.ts.map +1 -1
  217. package/dist/utils/tmuxExec.js +27 -7
  218. package/dist/utils/tmuxExec.js.map +1 -1
  219. package/dist/utils/topicAccessScreenPlan.d.ts +253 -0
  220. package/dist/utils/topicAccessScreenPlan.d.ts.map +1 -0
  221. package/dist/utils/topicAccessScreenPlan.js +287 -0
  222. package/dist/utils/topicAccessScreenPlan.js.map +1 -0
  223. package/dist/utils/topicLabel.d.ts +12 -0
  224. package/dist/utils/topicLabel.d.ts.map +1 -0
  225. package/dist/utils/topicLabel.js +12 -0
  226. package/dist/utils/topicLabel.js.map +1 -0
  227. package/dist/utils/topicRequest.d.ts +8 -5
  228. package/dist/utils/topicRequest.d.ts.map +1 -1
  229. package/dist/utils/topicRequest.js +9 -7
  230. package/dist/utils/topicRequest.js.map +1 -1
  231. package/npm-shrinkwrap.json +1003 -0
  232. package/package.json +4 -2
@@ -2,7 +2,8 @@
2
2
  /**
3
3
  * @description Pure helpers for the MESSAGE CONTEXT of a prompt — the agent-facing
4
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
5
+ * message arrived: the author mark (`authorMark.ts`, who wrote it when that is not the
6
+ * operator), the reply-quote block (`replyQuote.ts`, the message it
6
7
  * answers) and the forwarded mark (`forwardedMark.ts`, who first wrote it).
7
8
  *
8
9
  * The blocks ride the per-message body (like the `/timestamps` line), NOT the
@@ -13,9 +14,11 @@
13
14
  */
14
15
  Object.defineProperty(exports, "__esModule", { value: true });
15
16
  exports.joinMessageContextBlocks = joinMessageContextBlocks;
17
+ exports.checkIsForeignWords = checkIsForeignWords;
16
18
  exports.checkIsSlashCommandPrompt = checkIsSlashCommandPrompt;
17
19
  exports.getPromptWithMessageContext = getPromptWithMessageContext;
18
20
  const threadContextPreamble_1 = require("../threadContextPreamble");
21
+ const authorMark_1 = require("./authorMark");
19
22
  /** Separator between the context blocks, and between them and the prompt they lead. */
20
23
  const messageContextSeparator = '\n\n';
21
24
  /**
@@ -26,13 +29,22 @@ function joinMessageContextBlocks(blocks) {
26
29
  const present = blocks.filter((block) => !!block);
27
30
  return present.length > 0 ? present.join(messageContextSeparator) : undefined;
28
31
  }
32
+ /**
33
+ * @description Whether the words of a message are somebody else's: it was FORWARDED, or a person who is not the operator sent
34
+ * it. Such words are content, never control input — the ONE predicate every control guard asks (a slash command, a start
35
+ * phrase, a context wipe), so none of them can be missed for one kind of sender.
36
+ */
37
+ function checkIsForeignWords(context) {
38
+ return context?.isForwarded === true || context?.nonOperatorSender !== undefined;
39
+ }
29
40
  /**
30
41
  * @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.
42
+ * preamble or timestamp may be put ahead of. Never for foreign words ({@link checkIsForeignWords}): the mark ahead of
43
+ * them is exactly what makes them plain text. For a topic member's slash text this is a backstop — it is refused before it
44
+ * gets here, and one that did slip through reaches the agent marked, as plain words, never as the control token it would be unmarked.
33
45
  */
34
46
  function checkIsSlashCommandPrompt(text, context) {
35
- return context?.isForwarded !== true && (0, threadContextPreamble_1.checkShouldSkipPreambleForText)(text);
47
+ return !checkIsForeignWords(context) && (0, threadContextPreamble_1.checkShouldSkipPreambleForText)(text);
36
48
  }
37
49
  /**
38
50
  * @description Lead a prompt with its message-context block — the ONE folding
@@ -53,6 +65,8 @@ function getPromptWithMessageContext(prompt, options) {
53
65
  const { context } = options;
54
66
  if (!context || options.isShellInput || checkIsSlashCommandPrompt(prompt, context))
55
67
  return prompt;
56
- return `${context.block}${messageContextSeparator}${prompt}`;
68
+ // A person other than the operator wrote these words: they must not hold a line that passes for one of the bot's headers.
69
+ const words = context.nonOperatorSender === undefined ? prompt : (0, authorMark_1.neutraliseHeaderLookalikes)(prompt);
70
+ return `${context.block}${messageContextSeparator}${words}`;
57
71
  }
58
72
  //# sourceMappingURL=messageContext.js.map
@@ -1 +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,CAA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AAC,OAAmC;IACrE,OAAO,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,OAAO,EAAE,iBAAiB,KAAK,SAAS,CAAC;AACnF,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,IAAY,EAAE,OAAmC;IACzF,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,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,0HAA0H;IAC1H,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,uCAA0B,EAAC,MAAM,CAAC,CAAC;IACpG,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,uBAAuB,GAAG,KAAK,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @description How a person is named to people in a topic message: `@alice (Alice Smith)` when they have a username,
3
+ * their name alone otherwise. Plain text — posted without a parse mode, so a name needs no escaping.
4
+ */
5
+ /** What the bot knows of a person for a label. */
6
+ export interface PersonLabelSource {
7
+ /** Without a leading `@`. */
8
+ username?: string;
9
+ name: string;
10
+ }
11
+ /** @description `@alice (Alice Smith)`, or `Alice Smith`; a username with no name reads as `@alice`. */
12
+ export declare function formatPersonLabel(person: PersonLabelSource): string;
13
+ //# sourceMappingURL=personLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personLabel.d.ts","sourceRoot":"","sources":["../../src/utils/personLabel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAInE"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * @description How a person is named to people in a topic message: `@alice (Alice Smith)` when they have a username,
4
+ * their name alone otherwise. Plain text — posted without a parse mode, so a name needs no escaping.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.formatPersonLabel = formatPersonLabel;
8
+ /** @description `@alice (Alice Smith)`, or `Alice Smith`; a username with no name reads as `@alice`. */
9
+ function formatPersonLabel(person) {
10
+ const name = person.name.trim();
11
+ if (!person.username)
12
+ return name;
13
+ return name ? `@${person.username} (${name})` : `@${person.username}`;
14
+ }
15
+ //# sourceMappingURL=personLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personLabel.js","sourceRoot":"","sources":["../../src/utils/personLabel.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAUH,8CAIC;AALD,wGAAwG;AACxG,SAAgB,iBAAiB,CAAC,MAAyB;IACzD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAClC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;AACxE,CAAC"}
@@ -14,12 +14,20 @@
14
14
  * unit-testable; the bridge that reads a real telegraf message lives in the
15
15
  * Telegram connector (`getTelegramReplyQuoteBlock`).
16
16
  */
17
+ import { type NonOperatorAuthorKind } from './authorMark';
17
18
  /**
18
19
  * Max length of the quoted content folded into the prompt. A very long replied-to
19
20
  * message (e.g. a big agent answer) would otherwise dominate the prompt; we cap
20
21
  * it and mark the truncation so the agent knows the quote is partial.
21
22
  */
22
23
  export declare const replyQuoteMaxChars = 4000;
24
+ /**
25
+ * @name ReplyQuoteAuthorKind
26
+ * @description Who wrote the replied-to message, as far as the agent's trust goes: the `bot` itself (`from: assistant`), the
27
+ * `operator` (an admin or the owner: `from: user`), a `talker` of this topic, or `other` — anybody else (a member nobody
28
+ * allowed to talk to the agent, an anonymous admin, a channel).
29
+ */
30
+ export type ReplyQuoteAuthorKind = 'bot' | 'operator' | NonOperatorAuthorKind;
23
31
  /**
24
32
  * @description A file the replied-to message carries. A photo or a voice note
25
33
  * has no text to quote, so the quote names the file instead — and, while the bot
@@ -52,8 +60,12 @@ export interface ReplyQuoteSource {
52
60
  topicRootId?: number;
53
61
  /** Whether the replied-to message is a forum/service message (no real content). */
54
62
  isServiceMessage: boolean;
55
- /** Whether the replied-to message is the bot's own (`reply_to_message.from?.id === bot.botInfo.id`). */
56
- fromBot: boolean;
63
+ /** Who wrote the replied-to message ({@link ReplyQuoteAuthorKind}). */
64
+ authorKind: ReplyQuoteAuthorKind;
65
+ /** The author's display name, when {@link authorKind} is `talker` or `other` (the header names them). */
66
+ authorName?: string;
67
+ /** The author's @username, without `@`, when there is one. */
68
+ authorUsername?: string;
57
69
  /**
58
70
  * Who first wrote the replied-to message when it was itself FORWARDED into the topic (`describeForwardedOrigin`
59
71
  * of its `forward_origin`): `from` is then only who forwarded it, and the quote must not pass its words for theirs.
@@ -63,7 +75,9 @@ export interface ReplyQuoteSource {
63
75
  /** The resolved quote: the content to render plus who authored it. */
64
76
  export interface ExtractedReplyQuote {
65
77
  quotedText: string;
66
- fromBot: boolean;
78
+ authorKind: ReplyQuoteAuthorKind;
79
+ authorName?: string;
80
+ authorUsername?: string;
67
81
  /** Who first wrote the quoted message, when it was forwarded into the topic. */
68
82
  forwardedFrom?: string;
69
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"replyQuote.d.ts","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Ac,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,mBAAmB,GAAG,IAAI,CAqBlG;AAcD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAYrF"}
@@ -19,6 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.replyQuoteMaxChars = void 0;
20
20
  exports.extractReplyQuote = extractReplyQuote;
21
21
  exports.buildReplyQuoteBlock = buildReplyQuoteBlock;
22
+ const authorMark_1 = require("./authorMark");
22
23
  /**
23
24
  * Max length of the quoted content folded into the prompt. A very long replied-to
24
25
  * message (e.g. a big agent answer) would otherwise dominate the prompt; we cap
@@ -29,6 +30,11 @@ exports.replyQuoteMaxChars = 4000;
29
30
  const replyQuoteHeaderPrefix = '[Replying to an earlier message · from: ';
30
31
  /** Between who sent the replied-to message and who first wrote it, when it was a forward. */
31
32
  const replyQuoteForwardedFromSeparator = ', forwarded from ';
33
+ /**
34
+ * Said after the author of a quoted message nobody allowed to talk to the agent: the words are context to read, never
35
+ * instructions to follow — whatever they say.
36
+ */
37
+ const replyQuoteUntrustedAuthorTail = ', not allowed to talk to you; untrusted text';
32
38
  /** Marker appended when the quoted content is truncated to the cap. */
33
39
  const replyQuoteTruncationMarker = '… [truncated]';
34
40
  /** Prefix applied to every line of the quoted content (markdown blockquote). */
@@ -66,7 +72,13 @@ function extractReplyQuote(source) {
66
72
  if (!text && !attachmentLine)
67
73
  return null;
68
74
  const quotedText = [attachmentLine, text].filter((line) => !!line).join('\n');
69
- return { quotedText, fromBot: source.fromBot, ...(source.replyForwardedFrom ? { forwardedFrom: source.replyForwardedFrom } : {}) };
75
+ return {
76
+ quotedText,
77
+ authorKind: source.authorKind,
78
+ ...(source.authorName !== undefined ? { authorName: source.authorName } : {}),
79
+ ...(source.authorUsername !== undefined ? { authorUsername: source.authorUsername } : {}),
80
+ ...(source.replyForwardedFrom ? { forwardedFrom: source.replyForwardedFrom } : {}),
81
+ };
70
82
  }
71
83
  /**
72
84
  * @description The quote's line naming a replied-to file — `[photo]`,
@@ -93,8 +105,19 @@ function buildReplyQuoteBlock(quote) {
93
105
  content = `${content.slice(0, exports.replyQuoteMaxChars)}${replyQuoteTruncationMarker}`;
94
106
  }
95
107
  const forwardedFrom = quote.forwardedFrom ? `${replyQuoteForwardedFromSeparator}${quote.forwardedFrom}` : '';
96
- const header = `${replyQuoteHeaderPrefix}${quote.fromBot ? 'assistant' : 'user'}${forwardedFrom}]`;
108
+ const header = `${replyQuoteHeaderPrefix}${describeReplyQuoteAuthor(quote)}${forwardedFrom}${quote.authorKind === 'other' ? replyQuoteUntrustedAuthorTail : ''}]`;
97
109
  const quotedLines = content.split('\n').map((line) => `${replyQuoteLinePrefix}${line}`);
98
110
  return [header, ...quotedLines].join('\n');
99
111
  }
112
+ /**
113
+ * @description Who wrote the quoted message, as the header names them: `assistant` (the bot), `user` (the operator),
114
+ * `topic member "Alice Smith" (@alice)` or `group member "Bob" (@bob)`.
115
+ */
116
+ function describeReplyQuoteAuthor(quote) {
117
+ if (quote.authorKind === 'bot')
118
+ return 'assistant';
119
+ if (quote.authorKind === 'operator')
120
+ return 'user';
121
+ return (0, authorMark_1.describeMessageAuthor)(quote.authorKind, { name: quote.authorName ?? '', username: quote.authorUsername });
122
+ }
100
123
  //# sourceMappingURL=replyQuote.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"replyQuote.js","sourceRoot":"","sources":["../../src/utils/replyQuote.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAyFH,8CAeC;AAoBD,oDAYC;AAtID;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAEvC,gFAAgF;AAChF,MAAM,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ACnD,OAAO,IAAA,kCAAqB,EAAC,KAAK,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;AACnH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description The buttons a talker (a person an admin let talk to the agent in one topic) may tap. Everything else on a
3
+ * button is the admins': a picker, a wizard, a setting. The set is closed — default-deny, like the commands — and holds only
4
+ * the taps that ANSWER the agent: an option of a question it put to the topic, and the same question asked again after a
5
+ * compaction.
6
+ */
7
+ /** @description Whether a button with this `callback_data` is one a talker may tap. */
8
+ export declare function checkIsTalkerCallback(callbackData: string | undefined): boolean;
9
+ //# sourceMappingURL=talkerAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"talkerAccess.d.ts","sourceRoot":"","sources":["../../src/utils/talkerAccess.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE/E"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /**
3
+ * @description The buttons a talker (a person an admin let talk to the agent in one topic) may tap. Everything else on a
4
+ * button is the admins': a picker, a wizard, a setting. The set is closed — default-deny, like the commands — and holds only
5
+ * the taps that ANSWER the agent: an option of a question it put to the topic, and the same question asked again after a
6
+ * compaction.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.checkIsTalkerCallback = checkIsTalkerCallback;
10
+ /**
11
+ * The callback data of the agent's own question buttons: `qa_<question>_<option>` (a question) and `reask_<option>` (asked again).
12
+ * `opt_<n>` (a Claude TUI selector) is NOT one: no code builds such a button any more, and its handler types a digit into whatever the
13
+ * TUI shows — an admin's dialog, a login picker.
14
+ */
15
+ const talkerCallbackPatterns = [/^qa_\d+_\d+$/, /^reask_\d+$/];
16
+ /** @description Whether a button with this `callback_data` is one a talker may tap. */
17
+ function checkIsTalkerCallback(callbackData) {
18
+ return callbackData !== undefined && talkerCallbackPatterns.some((pattern) => pattern.test(callbackData));
19
+ }
20
+ //# sourceMappingURL=talkerAccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"talkerAccess.js","sourceRoot":"","sources":["../../src/utils/talkerAccess.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAUH,sDAEC;AAVD;;;;GAIG;AACH,MAAM,sBAAsB,GAAsB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAElF,uFAAuF;AACvF,SAAgB,qBAAqB,CAAC,YAAgC;IACpE,OAAO,YAAY,KAAK,SAAS,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5G,CAAC"}
@@ -23,14 +23,20 @@ export declare function getTmuxPaneTarget(sessionName: string): string;
23
23
  */
24
24
  export declare function getTmuxBaseArgs(): string[];
25
25
  /**
26
- * @description The environment a tmux call runs with. On a PRIVATE server
27
- * (`TMUX_SOCKET_NAME`) only the agent allowlist plus where its socket lives
28
- * (R32): the call that starts the server hands it its global environment, which
29
- * every session inherits and any process on the server can read back — a
30
- * tracker instance's secrets must not be in it. The default server (a Telegram
31
- * instance) keeps the bot's own environment, as before.
32
- */
33
- export declare function getTmuxExecEnv(): NodeJS.ProcessEnv | undefined;
26
+ * @description The environment a tmux call runs with: the call that starts the server hands it its global environment,
27
+ * which every session inherits and any process on the server can read back (`show-environment -g`). On a PRIVATE server
28
+ * (`TMUX_SOCKET_NAME`) only the agent allowlist plus where its socket lives (R32) — a tracker instance's secrets must not
29
+ * be in it. The default server (a Telegram instance) gets the bot's environment without the bot's own secrets
30
+ * ({@link getChildProcessEnvironment}): the user's variables reach the agents, the bot token does not.
31
+ */
32
+ export declare function getTmuxExecEnv(): NodeJS.ProcessEnv;
33
+ /**
34
+ * @description Drop the bot's own secrets from the global environment of the tmux server the bot's agents run on, before
35
+ * an agent's session is made there: a server another process started — an older bot, a shell that exported the token —
36
+ * holds what that process had, and every new session would inherit it. Best-effort: with no server running there is
37
+ * nothing to drop (and nothing is started).
38
+ */
39
+ export declare function removeBotSecretsFromTmuxServer(): Promise<void>;
34
40
  /** Best-effort tmux call: returns stdout on success, empty string on any error. */
35
41
  export declare function tmuxAsync(...args: string[]): Promise<string>;
36
42
  /**
@@ -41,6 +47,12 @@ export declare function tmuxAsync(...args: string[]): Promise<string>;
41
47
  * error for the user.
42
48
  */
43
49
  export declare function tmuxOrThrowAsync(...args: string[]): Promise<string>;
50
+ /**
51
+ * @description Make the tmux session an agent or a terminal runs in (`newSessionArgs` begins with `new-session`): the
52
+ * server's global environment is cleared of the bot's own secrets first ({@link removeBotSecretsFromTmuxServer}), so
53
+ * the session cannot inherit them. Strict, like {@link tmuxOrThrowAsync}.
54
+ */
55
+ export declare function startAgentTmuxSession(...newSessionArgs: string[]): Promise<string>;
44
56
  /**
45
57
  * @description Reject `args` with NUL or other control characters before
46
58
  * passing to a backend. These are unsafe in shell-quoted contexts (the
@@ -1 +1 @@
1
- {"version":3,"file":"tmuxExec.d.ts","sourceRoot":"","sources":["../../src/utils/tmuxExec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,eAAO,MAAM,eAAe,+BAAsB,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAG1C;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,UAAU,GAAG,SAAS,CAI9D;AAED,mFAAmF;AACnF,wBAAsB,SAAS,CAAC,GAAG,IA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gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -5,8 +5,10 @@ exports.getTmuxSessionTarget = getTmuxSessionTarget;
5
5
  exports.getTmuxPaneTarget = getTmuxPaneTarget;
6
6
  exports.getTmuxBaseArgs = getTmuxBaseArgs;
7
7
  exports.getTmuxExecEnv = getTmuxExecEnv;
8
+ exports.removeBotSecretsFromTmuxServer = removeBotSecretsFromTmuxServer;
8
9
  exports.tmuxAsync = tmuxAsync;
9
10
  exports.tmuxOrThrowAsync = tmuxOrThrowAsync;
11
+ exports.startAgentTmuxSession = startAgentTmuxSession;
10
12
  exports.checkArgsAreSafe = checkArgsAreSafe;
11
13
  exports.shellSingleQuote = shellSingleQuote;
12
14
  const child_process_1 = require("child_process");
@@ -43,19 +45,28 @@ function getTmuxBaseArgs() {
43
45
  return socketName ? ['-L', socketName] : [];
44
46
  }
45
47
  /**
46
- * @description The environment a tmux call runs with. On a PRIVATE server
47
- * (`TMUX_SOCKET_NAME`) only the agent allowlist plus where its socket lives
48
- * (R32): the call that starts the server hands it its global environment, which
49
- * every session inherits and any process on the server can read back — a
50
- * tracker instance's secrets must not be in it. The default server (a Telegram
51
- * instance) keeps the bot's own environment, as before.
48
+ * @description The environment a tmux call runs with: the call that starts the server hands it its global environment,
49
+ * which every session inherits and any process on the server can read back (`show-environment -g`). On a PRIVATE server
50
+ * (`TMUX_SOCKET_NAME`) only the agent allowlist plus where its socket lives (R32) — a tracker instance's secrets must not
51
+ * be in it. The default server (a Telegram instance) gets the bot's environment without the bot's own secrets
52
+ * ({@link getChildProcessEnvironment}): the user's variables reach the agents, the bot token does not.
52
53
  */
53
54
  function getTmuxExecEnv() {
54
55
  if (!process.env.TMUX_SOCKET_NAME)
55
- return undefined;
56
+ return (0, agentEnvironment_1.getChildProcessEnvironment)();
56
57
  const socketDir = process.env.TMUX_TMPDIR;
57
58
  return { ...(0, agentEnvironment_1.getAgentEnvironment)(), ...(socketDir ? { TMUX_TMPDIR: socketDir } : {}) };
58
59
  }
60
+ /**
61
+ * @description Drop the bot's own secrets from the global environment of the tmux server the bot's agents run on, before
62
+ * an agent's session is made there: a server another process started — an older bot, a shell that exported the token —
63
+ * holds what that process had, and every new session would inherit it. Best-effort: with no server running there is
64
+ * nothing to drop (and nothing is started).
65
+ */
66
+ async function removeBotSecretsFromTmuxServer() {
67
+ for (const name of agentEnvironment_1.botSecretEnvironmentNames)
68
+ await tmuxAsync('set-environment', '-g', '-u', name);
69
+ }
59
70
  /** Best-effort tmux call: returns stdout on success, empty string on any error. */
60
71
  async function tmuxAsync(...args) {
61
72
  try {
@@ -85,6 +96,15 @@ async function tmuxOrThrowAsync(...args) {
85
96
  });
86
97
  return stdout.toString().trim();
87
98
  }
99
+ /**
100
+ * @description Make the tmux session an agent or a terminal runs in (`newSessionArgs` begins with `new-session`): the
101
+ * server's global environment is cleared of the bot's own secrets first ({@link removeBotSecretsFromTmuxServer}), so
102
+ * the session cannot inherit them. Strict, like {@link tmuxOrThrowAsync}.
103
+ */
104
+ async function startAgentTmuxSession(...newSessionArgs) {
105
+ await removeBotSecretsFromTmuxServer();
106
+ return tmuxOrThrowAsync(...newSessionArgs);
107
+ }
88
108
  /**
89
109
  * @description Reject `args` with NUL or other control characters before
90
110
  * passing to a backend. These are unsafe in shell-quoted contexts (the
@@ -1 +1 @@
1
- {"version":3,"file":"tmuxExec.js","sourceRoot":"","sources":["../../src/utils/tmuxExec.ts"],"names":[],"mappings":";;;AAYA,oDAEC;AAQD,8CAEC;AASD,0CAGC;AAUD,wCAIC;AAGD,8BAWC;AASD,4CAOC;AAQD,4CAEC;AAWD,4CAEC;AAvGD,iDAAyC;AACzC,+BAAiC;AACjC,yDAAyD;AAE5C,QAAA,eAAe,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,SAAgB,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