@shliamb/dsh-telegram-bot 0.2.3 → 0.2.4

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/README.md CHANGED
@@ -59,13 +59,13 @@ Adding a new bundle requires a Host restart. Chat sessions and bindings survive
59
59
  The repository also contains a ready-to-install archive:
60
60
 
61
61
  ```text
62
- dist/shliamb-dsh-telegram-bot-0.2.3.tgz
62
+ dist/shliamb-dsh-telegram-bot-0.2.4.tgz
63
63
  ```
64
64
 
65
65
  If the `dsh` CLI is on your `PATH`, run this from the repository root:
66
66
 
67
67
  ```bash
68
- dsh plugin --profile web add ./dist/shliamb-dsh-telegram-bot-0.2.3.tgz
68
+ dsh plugin --profile web add ./dist/shliamb-dsh-telegram-bot-0.2.4.tgz
69
69
  dsh web
70
70
  ```
71
71
 
@@ -73,7 +73,7 @@ If you run Harness from a source checkout, use `pnpm dsh` from that checkout and
73
73
 
74
74
  ```bash
75
75
  cd /path/to/deepseek-harness
76
- pnpm dsh plugin --profile web add /path/to/HarnessBot/dist/shliamb-dsh-telegram-bot-0.2.3.tgz
76
+ pnpm dsh plugin --profile web add /path/to/HarnessBot/dist/shliamb-dsh-telegram-bot-0.2.4.tgz
77
77
  pnpm dsh web
78
78
  ```
79
79
 
package/README.ru.md CHANGED
@@ -59,13 +59,13 @@ pnpm dsh web
59
59
  В репозитории также лежит готовый к установке архив:
60
60
 
61
61
  ```text
62
- dist/shliamb-dsh-telegram-bot-0.2.3.tgz
62
+ dist/shliamb-dsh-telegram-bot-0.2.4.tgz
63
63
  ```
64
64
 
65
65
  Если команда `dsh` доступна в `PATH`, выполните из корня репозитория:
66
66
 
67
67
  ```bash
68
- dsh plugin --profile web add ./dist/shliamb-dsh-telegram-bot-0.2.3.tgz
68
+ dsh plugin --profile web add ./dist/shliamb-dsh-telegram-bot-0.2.4.tgz
69
69
  dsh web
70
70
  ```
71
71
 
@@ -73,7 +73,7 @@ dsh web
73
73
 
74
74
  ```bash
75
75
  cd /path/to/deepseek-harness
76
- pnpm dsh plugin --profile web add /path/to/HarnessBot/dist/shliamb-dsh-telegram-bot-0.2.3.tgz
76
+ pnpm dsh plugin --profile web add /path/to/HarnessBot/dist/shliamb-dsh-telegram-bot-0.2.4.tgz
77
77
  pnpm dsh web
78
78
  ```
79
79
 
package/lib/index.js CHANGED
@@ -473,7 +473,7 @@ async function getBalance(runtime, locale, force = false) {
473
473
  }
474
474
  try {
475
475
  const result = await runtime.account.getBalance({
476
- version: '@shliamb/dsh-telegram-bot/0.2.3',
476
+ version: '@shliamb/dsh-telegram-bot/0.2.4',
477
477
  locale,
478
478
  timezoneOffsetSeconds: -new Date().getTimezoneOffset() * 60,
479
479
  });
@@ -941,18 +941,7 @@ async function askQuestion(runtime, chatId, sessionId, locale, question, questio
941
941
  pending.messageId = messageId;
942
942
  runtime.pendingQuestions.set(token, pending);
943
943
  runtime.pendingQuestionChats.set(chatId, token);
944
- if (runtime.progress.has(sessionId)) {
945
- await editProgress(runtime, sessionId, t(locale, 'questionWaiting'), false);
946
- }
947
- runtime.logger.info('question-shown', 'agent question sent to Telegram', {
948
- chatId,
949
- sessionId,
950
- questionId: question.id,
951
- index: questionIndex,
952
- total: questionTotal,
953
- multi: pending.multi,
954
- });
955
- return await new Promise(resolve => {
944
+ const answerPromise = new Promise(resolve => {
956
945
  let settled = false;
957
946
  let timer;
958
947
  const finish = (answer, outcome) => {
@@ -980,7 +969,21 @@ async function askQuestion(runtime, chatId, sessionId, locale, question, questio
980
969
  finishStep = finish;
981
970
  timer = setTimeout(() => finish(skip(), 'timeout'), Math.max(0, deadline - Date.now()));
982
971
  signal?.addEventListener('abort', () => finish(skip(), 'cancelled'), { once: true });
972
+ if (isAborted())
973
+ finish(skip(), 'cancelled');
974
+ });
975
+ if (runtime.progress.has(sessionId)) {
976
+ void editProgress(runtime, sessionId, t(locale, 'questionWaiting'), false);
977
+ }
978
+ runtime.logger.info('question-shown', 'agent question sent to Telegram', {
979
+ chatId,
980
+ sessionId,
981
+ questionId: question.id,
982
+ index: questionIndex,
983
+ total: questionTotal,
984
+ multi: pending.multi,
983
985
  });
986
+ return await answerPromise;
984
987
  }
985
988
  async function handleQuestion(runtime, request, next) {
986
989
  if (request.agent === undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shliamb/dsh-telegram-bot",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Telegram bridge for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",