copilot-operator 0.1.58 → 0.1.61

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 (66) hide show
  1. package/dist/src/api/operator.controller.js +89 -1
  2. package/dist/src/api/operator.service.js +276 -9
  3. package/dist/src/cli.js +4 -0
  4. package/dist/src/config/exportHome.js +78 -0
  5. package/dist/src/config/schema.js +38 -0
  6. package/dist/src/exec/authorizer.js +16 -4
  7. package/dist/src/exec/platforms.js +87 -0
  8. package/dist/src/orchestrator/leadRunner.js +22 -3
  9. package/dist/src/orchestrator/taskRunner.js +101 -13
  10. package/dist/src/plan/systemGuide.js +353 -36
  11. package/dist/src/protocol/parser.js +3 -2
  12. package/dist/src/protocol/replySchema.js +20 -2
  13. package/dist/src/queue/queue.js +113 -0
  14. package/dist/src/transport/copilotTransport.js +263 -131
  15. package/dist/src/transport/locators.js +119 -33
  16. package/dist/src/util/zip.js +80 -0
  17. package/dist/src/vcs/taskVcs.js +25 -1
  18. package/dist/web/404.html +2 -2
  19. package/dist/web/_next/static/VmnUW8Gr79dsc-Ifk8oGP/_buildManifest.js +1 -0
  20. package/dist/web/_next/static/chunks/1077.d84d3a09cffc08c0.js +1 -0
  21. package/dist/web/_next/static/chunks/1548.03db34ce36acd5d5.js +1 -0
  22. package/dist/web/_next/static/chunks/2163.56378b27583dfc24.js +1 -0
  23. package/dist/web/_next/static/chunks/4512-db21be6b8e4eabf4.js +1 -0
  24. package/dist/web/_next/static/chunks/714.5cc516832a5f44c9.js +1 -0
  25. package/dist/web/_next/static/chunks/7220.26bb7ae30c8a587a.js +1 -0
  26. package/dist/web/_next/static/chunks/7921-51a72190643f4b1a.js +1 -0
  27. package/dist/web/_next/static/chunks/8197-e2fcb43f38a2b4a7.js +1 -0
  28. package/dist/web/_next/static/chunks/8584.49c69cd6e77d2fd7.js +1 -0
  29. package/dist/web/_next/static/chunks/9067.7ae4ac6836a74d94.js +1 -0
  30. package/dist/web/_next/static/chunks/9747.5a244ec2d1b84d29.js +1 -0
  31. package/dist/web/_next/static/chunks/app/layout-f18945b2fe2c8719.js +1 -0
  32. package/dist/web/_next/static/chunks/app/{page-d83191667baa1077.js → page-9c0f8e27ab7c8677.js} +1 -1
  33. package/dist/web/_next/static/chunks/app/queue/page-7d853e6bcbbacf0d.js +1 -0
  34. package/dist/web/_next/static/chunks/app/settings/page-1833ace66fc9eb0e.js +1 -0
  35. package/dist/web/_next/static/chunks/app/system/page-3466496814a70b62.js +1 -0
  36. package/dist/web/_next/static/chunks/{webpack-4da26d364c22b773.js → webpack-047b9e390d242a45.js} +1 -1
  37. package/dist/web/_next/static/css/{ad8f9884b90fbe47.css → 975a0235944db79c.css} +1 -1
  38. package/dist/web/defaults.html +2 -2
  39. package/dist/web/defaults.txt +8 -8
  40. package/dist/web/index.html +3 -3
  41. package/dist/web/index.txt +9 -9
  42. package/dist/web/queue.html +14 -0
  43. package/dist/web/queue.txt +26 -0
  44. package/dist/web/settings.html +2 -2
  45. package/dist/web/settings.txt +9 -9
  46. package/dist/web/system.html +2 -2
  47. package/dist/web/system.txt +9 -9
  48. package/package.json +7 -2
  49. package/prompts/lead1.md +7 -1
  50. package/prompts/level1.md +31 -1
  51. package/dist/web/_next/static/chunks/1077.34c49edcb60b74b8.js +0 -1
  52. package/dist/web/_next/static/chunks/1548.2e00c25619517e57.js +0 -1
  53. package/dist/web/_next/static/chunks/2163.896e18423ed494d6.js +0 -1
  54. package/dist/web/_next/static/chunks/3134-b6a7bc1f267c39aa.js +0 -1
  55. package/dist/web/_next/static/chunks/4512-8bcb4b34f41115b4.js +0 -1
  56. package/dist/web/_next/static/chunks/714.97d7b448e3fcd1d0.js +0 -1
  57. package/dist/web/_next/static/chunks/7220.d4bbc9d12b9971fa.js +0 -1
  58. package/dist/web/_next/static/chunks/7921-03e96df8fc05c712.js +0 -1
  59. package/dist/web/_next/static/chunks/8584.502a04a441f41a6d.js +0 -1
  60. package/dist/web/_next/static/chunks/9067.6d2ab3fd6308b1be.js +0 -1
  61. package/dist/web/_next/static/chunks/9747.0430cf4a4e70a033.js +0 -1
  62. package/dist/web/_next/static/chunks/app/layout-9cd9b0b0587f4882.js +0 -1
  63. package/dist/web/_next/static/chunks/app/settings/page-832ed3149649b77a.js +0 -1
  64. package/dist/web/_next/static/chunks/app/system/page-176448acb2c8baa6.js +0 -1
  65. package/dist/web/_next/static/wjvJJpx5dfDucIRnV0mIG/_buildManifest.js +0 -1
  66. /package/dist/web/_next/static/{wjvJJpx5dfDucIRnV0mIG → VmnUW8Gr79dsc-Ifk8oGP}/_ssgManifest.js +0 -0
@@ -64,6 +64,14 @@ export const SYSTEM_GUIDE = [
64
64
  doesEn: 'Opens the chat, with the project\'s files beside it.',
65
65
  doesBg: 'Отваря чата, с файловете на проекта до него.',
66
66
  },
67
+ {
68
+ key: 'nav.queue',
69
+ kind: 'link',
70
+ en: 'Queue',
71
+ bg: 'Опашка',
72
+ doesEn: 'Opens the queue of tasks: written beforehand, run one after another, each in a new chat on its own model.',
73
+ doesBg: 'Отваря опашката от задачи: написани предварително, изпълнявани една след друга, всяка в нов чат със свой модел.',
74
+ },
67
75
  {
68
76
  key: 'nav.defaults',
69
77
  kind: 'link',
@@ -847,8 +855,8 @@ export const SYSTEM_GUIDE = [
847
855
  kind: 'select',
848
856
  en: 'The lead\'s model',
849
857
  bg: 'Моделът на ръководителя',
850
- doesEn: 'The worker works on the lead\'s model.',
851
- doesBg: 'Изпълнителят работи на модела на ръководителя.',
858
+ doesEn: 'With no model for the worker in Settings: the worker works on the lead\'s model. With one there, this entry reads "As in Settings (…)".',
859
+ doesBg: 'Когато в Настройки няма модел за изпълнителя: изпълнителят работи на модела на ръководителя. Когато има, този избор гласи „Както в Настройки (…)“.',
852
860
  },
853
861
  {
854
862
  key: 'chat.workModel',
@@ -914,6 +922,22 @@ export const SYSTEM_GUIDE = [
914
922
  doesEn: 'With two chats: a question only you can answer, from the lead, on a card in the conversation; the work waits for it.',
915
923
  doesBg: 'С два чата: въпрос, на който само вие можете да отговорите, от ръководителя, на карта в разговора; работата го чака.',
916
924
  },
925
+ {
926
+ key: 'chat.question',
927
+ kind: 'note',
928
+ en: 'The chat asks you',
929
+ bg: 'Чатът ви пита',
930
+ doesEn: 'A question from the chat itself (plan mode or the worker), on a card, with its answers to click — its recommended one first, highlighted — and a field for another. An answer marked "runs: …" has the bot run that command when it is chosen; nothing to type by hand.',
931
+ doesBg: 'Въпрос от самия чат (режим на плана или изпълнителя), на карта, с отговори за избор — препоръчаният първи, открояван — и поле за друг. Отговор с „изпълнява: …“ кара бота да пусне тази команда, когато бъде избран; нищо не се пише на ръка.',
932
+ },
933
+ {
934
+ key: 'chat.optionRecommended',
935
+ kind: 'button',
936
+ en: 'Recommended by the chat',
937
+ bg: 'Препоръчано от чата',
938
+ doesEn: 'The first answer on a question card, the one the chat recommends — and the one taken when Settings agree with what the bot proposes.',
939
+ doesBg: 'Първият отговор на карта с въпрос, който чатът препоръчва — и който се взема, когато Настройки се съгласяват с това, което предлага ботът.',
940
+ },
917
941
  {
918
942
  key: 'lead.answer',
919
943
  kind: 'field',
@@ -1354,6 +1378,189 @@ export const SYSTEM_GUIDE = [
1354
1378
  },
1355
1379
  ],
1356
1380
  },
1381
+ {
1382
+ route: '/queue',
1383
+ nameEn: 'Queue',
1384
+ nameBg: 'Опашка',
1385
+ purposeEn: 'Tasks written beforehand and run one after another while the operator is away, each in a new chat on its own model, in the folder as it is or on a new branch from main; a task may depend on earlier ones, and is skipped when one of them did not end done, while the others still run.',
1386
+ purposeBg: 'Задачи, написани предварително и изпълнявани една след друга, докато операторът го няма, всяка в нов чат със свой модел, в папката както е или на нов бранч от main; задача може да зависи от по-ранни и се прескача, ако някоя от тях не е завършила, а другите се изпълняват.',
1387
+ sections: [
1388
+ {
1389
+ headingKey: 'q.title',
1390
+ en: 'Queue of tasks',
1391
+ bg: 'Опашка от задачи',
1392
+ controls: [
1393
+ {
1394
+ key: 'q.run',
1395
+ kind: 'button',
1396
+ en: 'Run the queue',
1397
+ bg: 'Пусни опашката',
1398
+ doesEn: 'Runs the waiting tasks one after another, each in a new chat; it becomes "Stop the queue" while they run.',
1399
+ doesBg: 'Изпълнява чакащите задачи една след друга, всяка в нов чат; докато вървят, става „Спри опашката“.',
1400
+ },
1401
+ {
1402
+ key: 'q.stop',
1403
+ kind: 'button',
1404
+ en: 'Stop the queue',
1405
+ bg: 'Спри опашката',
1406
+ doesEn: 'Stops the task at work, as the chat\'s Stop does; the rest wait.',
1407
+ doesBg: 'Спира задачата, която работи, както Спри в чата; останалите чакат.',
1408
+ },
1409
+ {
1410
+ key: 'q.openChat',
1411
+ kind: 'link',
1412
+ en: 'Open the chat',
1413
+ bg: 'Отвори чата',
1414
+ doesEn: 'Opens the chat a task ran in.',
1415
+ doesBg: 'Отваря чата, в който е работила задачата.',
1416
+ },
1417
+ {
1418
+ key: 'q.again',
1419
+ kind: 'button',
1420
+ en: 'Run again',
1421
+ bg: 'Пусни отново',
1422
+ doesEn: 'Puts a task that ended back to wait, for the next run of the queue.',
1423
+ doesBg: 'Връща завършила задача да чака следващото пускане на опашката.',
1424
+ },
1425
+ {
1426
+ key: 'q.edit',
1427
+ kind: 'button',
1428
+ en: 'Edit',
1429
+ bg: 'Редактирай',
1430
+ doesEn: 'Opens a waiting task in the form below, to change it.',
1431
+ doesBg: 'Отваря чакаща задача във формата отдолу, за да се промени.',
1432
+ },
1433
+ {
1434
+ key: 'q.up',
1435
+ kind: 'button',
1436
+ en: 'Move up',
1437
+ bg: 'Нагоре',
1438
+ doesEn: 'The ↑ beside a task: it runs one place earlier. A task stays after the tasks it depends on.',
1439
+ doesBg: '↑ до задача: изпълнява се едно място по-рано. Задачата остава след задачите, от които зависи.',
1440
+ },
1441
+ {
1442
+ key: 'q.down',
1443
+ kind: 'button',
1444
+ en: 'Move down',
1445
+ bg: 'Надолу',
1446
+ doesEn: 'The ↓ beside a task: it runs one place later.',
1447
+ doesBg: '↓ до задача: изпълнява се едно място по-късно.',
1448
+ },
1449
+ {
1450
+ key: 'q.byHandLink',
1451
+ kind: 'link',
1452
+ en: 'Change it in Settings',
1453
+ bg: 'Променете го в Settings',
1454
+ doesEn: 'Shown when Settings choose the model by hand: opens "Model for the worker" there, to turn it off.',
1455
+ doesBg: 'Показва се, когато в Settings моделът се избира ръчно: отваря „Модел за изпълнителя“ там, за да се изключи.',
1456
+ },
1457
+ {
1458
+ key: 'q.remove',
1459
+ kind: 'button',
1460
+ en: 'Remove',
1461
+ bg: 'Махни',
1462
+ doesEn: 'Takes a task out of the queue; the tasks that depended on it no longer do.',
1463
+ doesBg: 'Маха задача от опашката; задачите, които са зависели от нея, вече не зависят.',
1464
+ },
1465
+ ],
1466
+ },
1467
+ {
1468
+ headingKey: 'q.addTitle',
1469
+ en: 'Add a task',
1470
+ bg: 'Добави задача',
1471
+ controls: [
1472
+ {
1473
+ key: 'q.editTitle',
1474
+ kind: 'note',
1475
+ en: 'Task {n}',
1476
+ bg: 'Задача {n}',
1477
+ doesEn: 'The form\'s heading while a task of the queue is edited, with its number.',
1478
+ doesBg: 'Заглавието на формата, докато се редактира задача от опашката, с номера ѝ.',
1479
+ },
1480
+ {
1481
+ key: 'q.prompt',
1482
+ kind: 'field',
1483
+ en: 'What the task is to do',
1484
+ bg: 'Какво трябва да направи задачата',
1485
+ doesEn: 'The task, as a message to the chat would say it; its first line is its name in the list.',
1486
+ doesBg: 'Задачата, както би я казало съобщение в чата; първият ѝ ред е името ѝ в списъка.',
1487
+ },
1488
+ {
1489
+ key: 'q.branchFolder',
1490
+ kind: 'select',
1491
+ en: 'The folder as it is',
1492
+ bg: 'Папката както е',
1493
+ doesEn: 'Of "Where it works": the task works on the branch the folder is on when it starts.',
1494
+ doesBg: 'От „Къде работи“: задачата работи на бранча, на който е папката, когато започне.',
1495
+ },
1496
+ {
1497
+ key: 'q.branchMain',
1498
+ kind: 'select',
1499
+ en: 'New branch from main',
1500
+ bg: 'Нов бранч от main',
1501
+ doesEn: 'Of "Where it works": a branch of its own made from main, where its work is committed.',
1502
+ doesBg: 'От „Къде работи“: свой бранч, направен от main, на който се commit-ва работата ѝ.',
1503
+ },
1504
+ {
1505
+ key: 'q.review',
1506
+ kind: 'checkbox',
1507
+ en: 'Review',
1508
+ bg: 'Рецензия',
1509
+ doesEn: 'A second conversation checks the task\'s work when it says it is done.',
1510
+ doesBg: 'Втори разговор проверява работата на задачата, когато тя каже, че е готова.',
1511
+ },
1512
+ {
1513
+ key: 'q.save',
1514
+ kind: 'button',
1515
+ en: 'Save',
1516
+ bg: 'Запиши',
1517
+ doesEn: 'Saves the task being edited.',
1518
+ doesBg: 'Записва редактираната задача.',
1519
+ },
1520
+ {
1521
+ key: 'q.cancel',
1522
+ kind: 'button',
1523
+ en: 'Cancel',
1524
+ bg: 'Отказ',
1525
+ doesEn: 'Leaves the task as it was and empties the form.',
1526
+ doesBg: 'Оставя задачата както е и изпразва формата.',
1527
+ },
1528
+ {
1529
+ key: 'q.model',
1530
+ kind: 'select',
1531
+ en: 'Model',
1532
+ bg: 'Модел',
1533
+ doesEn: 'The model the task\'s chat runs on, chosen by the bot; "Settings\' model" is "Model for the worker".',
1534
+ doesBg: 'Моделът, на който работи чатът на задачата, избиран от бота; „Моделът от Settings“ е „Модел за изпълнителя“.',
1535
+ },
1536
+ {
1537
+ key: 'q.branch',
1538
+ kind: 'select',
1539
+ en: 'Where it works',
1540
+ bg: 'Къде работи',
1541
+ doesEn: '"The folder as it is", or "New branch from main": a branch of its own from main, fetched from the server when that needs no password, else the local main.',
1542
+ doesBg: '„Папката както е“ или „Нов бранч от main“: свой бранч от main, взет от сървъра, ако това не иска парола, иначе от локалния main.',
1543
+ },
1544
+ {
1545
+ key: 'q.dependsOn',
1546
+ kind: 'checkbox',
1547
+ en: 'Depends on',
1548
+ bg: 'Зависи от',
1549
+ doesEn: 'The earlier tasks this one needs: when one of them fails, this one is skipped.',
1550
+ doesBg: 'По-ранните задачи, които тази изисква: ако някоя от тях се провали, тази се прескача.',
1551
+ },
1552
+ {
1553
+ key: 'q.add',
1554
+ kind: 'button',
1555
+ en: 'Add to the queue',
1556
+ bg: 'Добави в опашката',
1557
+ doesEn: 'Puts the task at the end of the queue, waiting.',
1558
+ doesBg: 'Слага задачата в края на опашката, да чака.',
1559
+ },
1560
+ ],
1561
+ },
1562
+ ],
1563
+ },
1357
1564
  {
1358
1565
  route: '/settings',
1359
1566
  nameEn: 'Settings',
@@ -1374,14 +1581,6 @@ export const SYSTEM_GUIDE = [
1374
1581
  doesEn: 'Everything on the page saves itself as it is changed.',
1375
1582
  doesBg: 'Всичко на страницата се запазва само, докато се променя.',
1376
1583
  },
1377
- {
1378
- key: 'def.saveAnyway',
1379
- kind: 'button',
1380
- en: 'Save',
1381
- bg: 'Запази',
1382
- doesEn: 'Saves what is already saved, for the comfort of pressing something.',
1383
- doesBg: 'Запазва вече запазеното — за спокойствие.',
1384
- },
1385
1584
  ],
1386
1585
  },
1387
1586
  {
@@ -1629,24 +1828,24 @@ export const SYSTEM_GUIDE = [
1629
1828
  },
1630
1829
  {
1631
1830
  headingKey: 'def.modelTitle',
1632
- en: 'Model for new conversations',
1633
- bg: 'Модел за новите разговори',
1831
+ en: 'Model for the worker',
1832
+ bg: 'Модел за изпълнителя',
1634
1833
  controls: [
1635
1834
  {
1636
1835
  key: 'def.modelField',
1637
1836
  kind: 'select',
1638
1837
  en: 'Model',
1639
1838
  bg: 'Модел',
1640
- doesEn: 'The model a new conversation starts on, unless one is chosen under the chat\'s box.',
1641
- doesBg: 'Моделът, с който започва нов разговор, освен ако под полето на чата не е избран друг.',
1839
+ doesEn: 'The model the worker starts on — the chat that does the work: the one chat, or the worker of two chats — unless one is chosen under the chat\'s box. The three model sections (worker, lead, review) are alike: this picker, "Clear", "Read the list from Copilot", when the list was read, and their own "by hand".',
1840
+ doesBg: 'Моделът, с който започва изпълнителят — чатът, който върши работата: единственият чат или изпълнителят при два чата, — освен ако под полето на чата не е избран друг. Трите секции за модел (изпълнител, ръководител, рецензия) са еднакви: това меню, „Изчисти“, „Прочети списъка от Copilot“, кога е прочетен списъкът и своето „ръчно“.',
1642
1841
  },
1643
1842
  {
1644
1843
  key: 'def.modelNone',
1645
1844
  kind: 'select',
1646
1845
  en: 'Leave the chat on whatever it is set to',
1647
1846
  bg: 'Остави чата на каквото е настроен',
1648
- doesEn: 'No model chosen here.',
1649
- doesBg: 'Тук не е избран модел.',
1847
+ doesEn: 'No model chosen here: the conversation stays on the model it is on.',
1848
+ doesBg: 'Тук не е избран модел: разговорът остава на модела, на който е.',
1650
1849
  },
1651
1850
  {
1652
1851
  key: 'proj.clear',
@@ -1661,16 +1860,39 @@ export const SYSTEM_GUIDE = [
1661
1860
  kind: 'button',
1662
1861
  en: 'Read the list from Copilot',
1663
1862
  bg: 'Прочети списъка от Copilot',
1664
- doesEn: 'Opens Copilot for a moment and reads the models its picker offers.',
1665
- doesBg: 'Отваря Copilot за момент и прочита моделите, които предлага изборът му.',
1863
+ doesEn: 'Opens Copilot for a moment and reads the models its picker offers; the three sections share the list.',
1864
+ doesBg: 'Отваря Copilot за момент и прочита моделите, които предлага изборът му; трите секции делят списъка.',
1666
1865
  },
1667
1866
  {
1668
1867
  key: 'def.manualModel',
1669
1868
  kind: 'checkbox',
1670
1869
  en: 'Choose the model by hand at the start of each run',
1671
1870
  bg: 'Избирай модела ръчно в началото на всяко пускане',
1672
- doesEn: 'Nothing is chosen for you: at the start of a run, and of a review, a card asks you to choose the model in the Copilot window and press "Ready".',
1673
- doesBg: 'Нищо не се избира вместо вас: в началото на пускане и на рецензия карта ви моли да изберете модела в прозореца на Copilot и да натиснете „Готово“.',
1871
+ doesEn: 'In each of the three sections, for that part: nothing is chosen for it; a card asks you to choose its model in the Copilot window and press "Ready". The lead\'s and the review\'s are as the worker\'s until set.',
1872
+ doesBg: 'Във всяка от трите секции, за съответната част: нищо не се избира за нея; карта ви моли да изберете модела ѝ в прозореца на Copilot и да натиснете „Готово“. Тези на ръководителя и на рецензията са като на изпълнителя, докато не се зададат.',
1873
+ },
1874
+ {
1875
+ key: 'def.saving',
1876
+ kind: 'note',
1877
+ en: 'Saving',
1878
+ bg: 'Запазване',
1879
+ doesEn: 'Under a section while it saves — after typing stops, a tick, a choice from a list — "Saving." "Saving.." "Saving...", round and round, for a second or two; nothing needs pressing.',
1880
+ doesBg: 'Под секция, докато се запазва — щом спре писането, при отметка, при избор от списък — „Запазване.“ „Запазване..“ „Запазване...“, отново и отново, за секунда-две; нищо не трябва да се натиска.',
1881
+ },
1882
+ ],
1883
+ },
1884
+ {
1885
+ headingKey: 'def.leadTitle',
1886
+ en: 'Model for the lead',
1887
+ bg: 'Модел за ръководителя',
1888
+ controls: [
1889
+ {
1890
+ key: 'def.leadTitle',
1891
+ kind: 'note',
1892
+ en: 'Model for the lead',
1893
+ bg: 'Модел за ръководителя',
1894
+ doesEn: 'The model the lead of two chats starts on, unless one is chosen under the chat\'s box; best a strong reasoning model. Its picker and buttons are those of the worker\'s section.',
1895
+ doesBg: 'Моделът, с който започва ръководителят при два чата, освен ако под полето на чата не е избран друг; най-добре силен модел за разсъждение. Менюто и бутоните му са като в секцията на изпълнителя.',
1674
1896
  },
1675
1897
  ],
1676
1898
  },
@@ -1680,28 +1902,83 @@ export const SYSTEM_GUIDE = [
1680
1902
  bg: 'Модел за рецензията',
1681
1903
  controls: [
1682
1904
  {
1683
- key: 'def.reviewField',
1684
- kind: 'select',
1685
- en: 'Review model',
1905
+ key: 'def.reviewTitle',
1906
+ kind: 'note',
1907
+ en: 'Model for the review',
1686
1908
  bg: 'Модел за рецензията',
1687
- doesEn: 'The model the review\'s conversation is put on: best a different, stronger one than the work\'s.',
1688
- doesBg: 'Моделът, на който се слага разговорът на рецензията: най-добре друг, по-силен от този на работата.',
1909
+ doesEn: 'The model the review\'s conversation is put on: best a different, stronger one than the worker\'s. Its picker and buttons are those of the worker\'s section.',
1910
+ doesBg: 'Моделът, на който се слага разговорът на рецензията: най-добре друг, по-силен от този на изпълнителя. Менюто и бутоните му са като в секцията на изпълнителя.',
1689
1911
  },
1912
+ ],
1913
+ },
1914
+ {
1915
+ headingKey: 'loc.title',
1916
+ en: "The model menu's locators",
1917
+ bg: 'Локатори на менюто за модели',
1918
+ controls: [
1690
1919
  {
1691
- key: 'def.reviewNone',
1692
- kind: 'select',
1693
- en: 'None chosen here',
1694
- bg: 'Не е избран тук',
1695
- doesEn: 'No model chosen for the review.',
1696
- doesBg: 'Не е избран модел за рецензията.',
1920
+ key: 'loc.howTitle',
1921
+ kind: 'disclosure',
1922
+ en: 'How to find a locator',
1923
+ bg: 'Как да намерите локатор',
1924
+ doesEn: 'Opens the steps: open Copilot\'s model menu in Edge, F12, Elements, Ctrl+F, try the locator until it finds 1 of 1, then put {$model_name} or {$provider_name} where the name is.',
1925
+ doesBg: 'Отваря стъпките: менюто за модели на Copilot в Edge, F12, Elements, Ctrl+F, локаторът се пробва, докато намери 1 of 1, после на мястото на името се слага {$model_name} или {$provider_name}.',
1697
1926
  },
1698
1927
  {
1699
- key: 'model.refresh',
1928
+ key: 'loc.button',
1929
+ kind: 'field',
1930
+ en: 'The model button',
1931
+ bg: 'Бутонът за модел',
1932
+ doesEn: 'How the bot finds the button that opens the model menu; empty is the default, button#gptModeSwitcher.',
1933
+ doesBg: 'Как ботът намира бутона, който отваря менюто за модели; празно е стойността по подразбиране, button#gptModeSwitcher.',
1934
+ },
1935
+ {
1936
+ key: 'loc.rows',
1937
+ kind: 'field',
1938
+ en: 'The rows of the menu',
1939
+ bg: 'Редовете на менюто',
1940
+ doesEn: 'The rows "Read the list from Copilot" reads the names of the models and the providers from.',
1941
+ doesBg: 'Редовете, от които „Прочети списъка от Copilot“ чете имената на моделите и на provider-ите.',
1942
+ },
1943
+ {
1944
+ key: 'loc.model',
1945
+ kind: 'field',
1946
+ en: 'A model of the main menu',
1947
+ bg: 'Модел от основното меню',
1948
+ doesEn: 'The template for a model of the main menu (Auto, Think deeper…), with {$model_name} where the name goes.',
1949
+ doesBg: 'Шаблонът за модел от основното меню (Auto, Think deeper…), с {$model_name} на мястото на името.',
1950
+ },
1951
+ {
1952
+ key: 'loc.provider',
1953
+ kind: 'field',
1954
+ en: 'A provider',
1955
+ bg: 'Provider',
1956
+ doesEn: 'The template for a provider\'s row that opens its own menu (Claude, GPT…), with {$provider_name} where the name goes.',
1957
+ doesBg: 'Шаблонът за реда на provider, който отваря свое меню (Claude, GPT…), с {$provider_name} на мястото на името.',
1958
+ },
1959
+ {
1960
+ key: 'loc.providerModel',
1961
+ kind: 'field',
1962
+ en: 'A model of a provider',
1963
+ bg: 'Модел от provider',
1964
+ doesEn: 'The template for a model in a provider\'s menu (Opus 5.5…), with {$model_name} where the name goes.',
1965
+ doesBg: 'Шаблонът за модел в менюто на provider (Opus 5.5…), с {$model_name} на мястото на името.',
1966
+ },
1967
+ {
1968
+ key: 'loc.default',
1700
1969
  kind: 'button',
1701
- en: 'Read the list from Copilot',
1702
- bg: 'Прочети списъка от Copilot',
1703
- doesEn: 'Reads the models from Copilot again.',
1704
- doesBg: 'Прочита моделите от Copilot отново.',
1970
+ en: 'Default',
1971
+ bg: 'По подразбиране',
1972
+ doesEn: 'Empties the field beside it: the default is used again.',
1973
+ doesBg: 'Изпразва полето до него: отново се ползва стойността по подразбиране.',
1974
+ },
1975
+ {
1976
+ key: 'loc.steps',
1977
+ kind: 'checkbox',
1978
+ en: 'Keep a picture of every step of choosing a model',
1979
+ bg: 'Пази снимка на всяка стъпка от избора на модел',
1980
+ doesEn: 'Keeps a picture of the page and the menu\'s HTML at every step of choosing a model, in the folders named under it; a failed choice keeps models-select-failed.* always.',
1981
+ doesBg: 'Пази снимка на страницата и HTML на менюто на всяка стъпка от избора на модел, в папките, посочени под него; неуспешен избор винаги пази models-select-failed.*.',
1705
1982
  },
1706
1983
  ],
1707
1984
  },
@@ -1918,6 +2195,30 @@ export const SYSTEM_GUIDE = [
1918
2195
  doesEn: 'Runs it without asking.',
1919
2196
  doesBg: 'Изпълнява я, без да пита.',
1920
2197
  },
2198
+ {
2199
+ key: 'exec.questions',
2200
+ kind: 'select',
2201
+ en: 'Questions from the bot',
2202
+ bg: 'Въпроси от бота',
2203
+ doesEn: 'What happens when the bot needs the operator\'s word: a command that reaches a platform with their access (Azure, AWS, GitHub, Jira, Vercel, Kubernetes, publishing a package…), and a question from the chat or the lead.',
2204
+ doesBg: 'Какво става, когато ботът има нужда от думата на оператора: команда, която достъпва платформа с неговия достъп (Azure, AWS, GitHub, Jira, Vercel, Kubernetes, публикуване на пакет…), и въпрос от чата или от ръководителя.',
2205
+ },
2206
+ {
2207
+ key: 'exec.questionsAsk',
2208
+ kind: 'select',
2209
+ en: 'Ask me',
2210
+ bg: 'Питай ме',
2211
+ doesEn: 'The default: such a command waits on a card in every run, one without asking too; a question waits on a card with its answers to click and a field for another.',
2212
+ doesBg: 'По подразбиране: такава команда чака на карта при всяко пускане, и без питане; въпросът чака на карта с отговори за избор и поле за друг.',
2213
+ },
2214
+ {
2215
+ key: 'exec.questionsAgree',
2216
+ kind: 'select',
2217
+ en: 'Agree with what the bot proposes',
2218
+ bg: 'Съгласявай се с това, което предлага ботът',
2219
+ doesEn: 'Such a command runs, and each question gets the answer the chat recommends — the first it gives; the conversation says so; chosen, it asks once to confirm.',
2220
+ doesBg: 'Такава команда се изпълнява, а всеки въпрос получава препоръчания от чата отговор — първия, който дава; разговорът го казва; при избор пита веднъж за потвърждение.',
2221
+ },
1921
2222
  ],
1922
2223
  },
1923
2224
  ],
@@ -1966,6 +2267,22 @@ export const SYSTEM_GUIDE = [
1966
2267
  doesEn: 'Under "This machine": the latest lines the bot\'s console printed, with their times, as a text file — what to ask for when something went wrong and nothing on the pages says why.',
1967
2268
  doesBg: 'Под „Тази машина“: последните редове, отпечатани от конзолата на бота, с часовете им, като текстов файл — това се иска, когато нещо се е объркало и нищо по страниците не казва защо.',
1968
2269
  },
2270
+ {
2271
+ key: 'sys.export',
2272
+ kind: 'note',
2273
+ en: 'Export everything the bot keeps',
2274
+ bg: 'Експорт на всичко, което ботът пази',
2275
+ doesEn: 'Under "This machine": one .zip of the bot\'s folder — settings, conversations, skills, level 2 templates, logs — with a checkbox for every run\'s records too; the API\'s key and the Edge profile (the Microsoft 365 sign-in) are never in it, and its manifest.json says so.',
2276
+ doesBg: 'Под „Тази машина“: един .zip на папката на бота — настройки, разговори, skill-ове, шаблони за ниво 2, дневници — с отметка и за записите на всички изпълнения; ключът на API-то и профилът в Edge (входът в Microsoft 365) никога не влизат, и manifest.json го казва.',
2277
+ },
2278
+ {
2279
+ key: 'sys.exportButton',
2280
+ kind: 'link',
2281
+ en: 'Export (.zip)',
2282
+ bg: 'Експорт (.zip)',
2283
+ doesEn: 'Downloads that .zip, named copilot-operator-export-<date>-<time>.zip.',
2284
+ doesBg: 'Сваля този .zip с име copilot-operator-export-<дата>-<час>.zip.',
2285
+ },
1969
2286
  {
1970
2287
  key: 'sys.home',
1971
2288
  kind: 'note',
@@ -181,6 +181,7 @@ const FORMAT_EXAMPLE = [
181
181
  '```',
182
182
  'or, to end: {"status": "done", "summary": "several sentences on what was done and what it shows"}',
183
183
  'or {"status": "blocked", "summary": "…", "tried": ["first approach", "second approach"], "needed": "what would unblock it"}',
184
+ 'or, to ask the operator: {"status": "ask", "question": "…", "options": [{"answer": "your recommended one", "run": "a command the runner runs if it is chosen"}, {"answer": "another"}]}',
184
185
  ].join('\n');
185
186
  export function parseReply(markdown, opts) {
186
187
  const candidates = findJsonCandidates(markdown);
@@ -232,8 +233,8 @@ export function parseReply(markdown, opts) {
232
233
  // model that writes "Край" under an explanation of why it cannot finish has ended the
233
234
  // task, not completed it, and reading that as `done` would file a failure as a success.
234
235
  const blocked = reply.status === 'blocked';
235
- // A plan waits for its approval: the stop word in it does not end the task.
236
- const plan = reply.status === 'plan';
236
+ // A plan waits for its approval, a question for its answer: the stop word in either does not end the task.
237
+ const plan = reply.status === 'plan' || reply.status === 'ask';
237
238
  return {
238
239
  ok: true,
239
240
  reply: { ...reply, steps },
@@ -105,6 +105,16 @@ export const PlanSchema = z.object({
105
105
  verification: z.string().trim().min(1, 'plan.verification must say how you will show the result works.'),
106
106
  risks: z.string().optional(),
107
107
  });
108
+ /**
109
+ * One answer to a question the chat puts to the operator (operator, 2026-10-23: "answers to click, not only a text field;
110
+ * and when the chat proposes a command for the user to run by hand, a button behind it, and the bot runs it"): what
111
+ * the operator clicks, and a command the runner runs when it is chosen. A bare string is the answer alone.
112
+ */
113
+ export const OptionSchema = z.preprocess((v) => (typeof v === 'string' ? { answer: v } : v), z.object({
114
+ answer: z.string().trim().min(1),
115
+ run: z.string().trim().min(1).optional(),
116
+ shell: ShellSchema.optional(),
117
+ }));
108
118
  export const ReplySchema = z
109
119
  .object({
110
120
  /**
@@ -124,9 +134,13 @@ export const ReplySchema = z
124
134
  * `plan` — in plan mode only: here is the plan, made from what I read; no steps with it, and no change
125
135
  * made yet. See `PlanSchema`.
126
136
  */
127
- status: z.enum(['continue', 'done', 'blocked', 'plan']),
137
+ status: z.enum(['continue', 'done', 'blocked', 'plan', 'ask']),
128
138
  /** Required when `status` is `plan`. */
129
139
  plan: PlanSchema.optional(),
140
+ /** `ask` — a question only the operator can answer (2026-10-23): the question, why, and the answers to click. */
141
+ question: z.string().optional(),
142
+ why: z.string().optional(),
143
+ options: z.array(OptionSchema).default([]),
130
144
  steps: z.array(StepSchema).default([]),
131
145
  notes: z.string().optional(),
132
146
  /**
@@ -158,8 +172,12 @@ export const ReplySchema = z
158
172
  'Send at least one step, or set status to "done" or "blocked".',
159
173
  })
160
174
  .refine((r) => r.status === 'continue' || r.steps.length === 0, {
161
- message: 'status "done", "blocked" and "plan" cannot carry steps: "done" and "blocked" end the task, and "plan" waits for the plan to be approved. ' +
175
+ message: 'status "done", "blocked", "plan" and "ask" cannot carry steps: "done" and "blocked" end the task, "plan" waits for the plan to be approved and "ask" for the operator\'s answer (a command for an answer goes in its "run"). ' +
162
176
  'Send the steps with status "continue".',
177
+ })
178
+ .refine((r) => r.status !== 'ask' || ((r.question ?? '').trim().length >= 5 && r.options.length >= 2), {
179
+ message: 'status "ask" requires a "question" for the operator and at least two "options", your recommended one first: ' +
180
+ '[{ "answer": "what the operator clicks" }, { "answer": "...", "run": "a command the runner runs if this is chosen" }].',
163
181
  })
164
182
  .refine((r) => r.status !== 'plan' || !!r.plan, {
165
183
  message: 'status "plan" requires a "plan" object: { "existing": what is already there, "approach": how, "steps": [the stages], ' +