copilot-operator 0.1.63 → 0.1.66
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/dist/src/api/operator.controller.js +53 -3
- package/dist/src/api/operator.service.js +479 -57
- package/dist/src/exec/dangerous.js +12 -0
- package/dist/src/exec/runner.js +75 -2
- package/dist/src/exec/stepEnv.js +13 -2
- package/dist/src/orchestrator/taskRunner.js +12 -1
- package/dist/src/plan/kerrigan.js +63 -10
- package/dist/src/plan/systemGuide.js +202 -2
- package/dist/src/queue/queue.js +71 -4
- package/dist/src/queue/queueBranch.js +66 -0
- package/dist/src/session/compose.js +15 -0
- package/dist/src/session/store.js +4 -0
- package/dist/src/vcs/newBranch.js +241 -0
- package/dist/src/vcs/remoteAuth.js +119 -0
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1024-444e9060299d04ba.js +1 -0
- package/dist/web/_next/static/chunks/1077.b88b069535f7008e.js +1 -0
- package/dist/web/_next/static/chunks/1548.9e01803e48173ea9.js +1 -0
- package/dist/web/_next/static/chunks/2163.018cd5f719ae4b3d.js +1 -0
- package/dist/web/_next/static/chunks/6262-d074473db83ee798.js +1 -0
- package/dist/web/_next/static/chunks/714.281f68f85df26013.js +1 -0
- package/dist/web/_next/static/chunks/7220.3bd10a3e4e053e0c.js +1 -0
- package/dist/web/_next/static/chunks/7921-1c173d00d23b3589.js +1 -0
- package/dist/web/_next/static/chunks/8124-bb544c96a7c0e7e3.js +1 -0
- package/dist/web/_next/static/chunks/8584.c7cd52c2e7075bcb.js +1 -0
- package/dist/web/_next/static/chunks/9067.feaf894390db1a88.js +1 -0
- package/dist/web/_next/static/chunks/9747.7cee8a2d8301f25c.js +1 -0
- package/dist/web/_next/static/chunks/app/{layout-9201c637ca24b2c9.js → layout-5e0e7601702723bb.js} +1 -1
- package/dist/web/_next/static/chunks/app/page-95379244849623fc.js +1 -0
- package/dist/web/_next/static/chunks/app/queue/page-fb49cb2d3dc6d14c.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-38c956574db7c7a6.js → webpack-5ea108bc2e386c55.js} +1 -1
- package/dist/web/_next/static/css/a112074f3d1a8a07.css +1 -0
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +8 -8
- package/dist/web/index.html +3 -3
- package/dist/web/index.txt +9 -9
- package/dist/web/queue.html +2 -2
- package/dist/web/queue.txt +9 -9
- package/dist/web/settings.html +2 -2
- package/dist/web/settings.txt +9 -9
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +9 -9
- package/package.json +4 -2
- package/dist/web/_next/static/chunks/1077.155f883ebfb223ae.js +0 -1
- package/dist/web/_next/static/chunks/1548.52fe19b2bb6dbe66.js +0 -1
- package/dist/web/_next/static/chunks/2163.51278cbd88674f1a.js +0 -1
- package/dist/web/_next/static/chunks/714.a3555e6b7e5f4339.js +0 -1
- package/dist/web/_next/static/chunks/7220.a7dcaec140695190.js +0 -1
- package/dist/web/_next/static/chunks/7921-b7eba39a21993047.js +0 -1
- package/dist/web/_next/static/chunks/8124-5458b17433987fab.js +0 -1
- package/dist/web/_next/static/chunks/8584.baf85c4394dc04eb.js +0 -1
- package/dist/web/_next/static/chunks/9067.2d7665cd257d7b47.js +0 -1
- package/dist/web/_next/static/chunks/9747.66a374501673612f.js +0 -1
- package/dist/web/_next/static/chunks/app/page-03f129240e06a07c.js +0 -1
- package/dist/web/_next/static/chunks/app/queue/page-f86936d39121ade8.js +0 -1
- package/dist/web/_next/static/css/2f2419505403ce07.css +0 -1
- /package/dist/web/_next/static/{kxZRE1oIu_arurqhfP4mS → BbWvNQTsh3pH7ZN_RKR60}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{kxZRE1oIu_arurqhfP4mS → BbWvNQTsh3pH7ZN_RKR60}/_ssgManifest.js +0 -0
|
@@ -409,8 +409,8 @@ export const SYSTEM_GUIDE = [
|
|
|
409
409
|
kind: 'button',
|
|
410
410
|
en: 'Kerrigan',
|
|
411
411
|
bg: 'Кериган',
|
|
412
|
-
doesEn: 'Opens a menu with two ways to take Kerrigan away: a persona to give to a chat of your own (Copilot, ChatGPT, another), so it knows what copilot-operator is and helps you write a task for it. Optional: the chat here works without her.',
|
|
413
|
-
doesBg: 'Отваря меню с два начина да вземете Кериган: персона, която давате на чат по ваш избор (Copilot, ChatGPT или друг), за да знае какво е copilot-operator и да ви помогне да напишете задание за него. По желание: чатът тук работи и без нея.',
|
|
412
|
+
doesEn: 'Opens a menu with two ways to take Kerrigan away: a persona to give to a chat of your own (Copilot, ChatGPT, another), so it knows what copilot-operator is and helps you write a task for it. Optional: the chat here works without her. A skill chosen in "Skill" beside it goes with her text, its instructions whole — the same choice as "Skill" under the chat\'s box, each changing with the other.',
|
|
413
|
+
doesBg: 'Отваря меню с два начина да вземете Кериган: персона, която давате на чат по ваш избор (Copilot, ChatGPT или друг), за да знае какво е copilot-operator и да ви помогне да напишете задание за него. По желание: чатът тук работи и без нея. Skill, избран в „Skill“ до него, върви с текста ѝ, с инструкциите си изцяло — същият избор като „Skill“ под полето на чата, всеки се сменя с другия.',
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
416
|
key: 'kerrigan.save',
|
|
@@ -674,6 +674,94 @@ export const SYSTEM_GUIDE = [
|
|
|
674
674
|
doesEn: 'Beside the list: the next message starts a new conversation, in a new Copilot conversation with nothing of this one in it; this one stays in the list.',
|
|
675
675
|
doesBg: 'До списъка: следващото съобщение започва нов разговор, в нов разговор в Copilot без нищо от този; този остава в списъка. Неактивен, докато върви задача — докато не бъде спряна („Спри“) или прозорецът ѝ затворен, — и в нов чат, който още не е започнал; казва защо, когато го посочите.',
|
|
676
676
|
},
|
|
677
|
+
{
|
|
678
|
+
key: 'chat.rename',
|
|
679
|
+
kind: 'button',
|
|
680
|
+
en: 'Rename the conversation',
|
|
681
|
+
bg: 'Преименувай разговора',
|
|
682
|
+
doesEn: 'The ✎ beside the list, once a conversation is open: its name in a box where the list was, at any time, working or not. The conversation in Copilot keeps its own name, which is how the bot finds it again.',
|
|
683
|
+
doesBg: 'Знакът ✎ до списъка, когато е отворен разговор: името му в поле на мястото на списъка, по всяко време, докато работи или не. Разговорът в Copilot пази своето име, по което ботът го намира отново.',
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
key: 'nb.button',
|
|
687
|
+
kind: 'button',
|
|
688
|
+
en: '⎇ New branch from main',
|
|
689
|
+
bg: '⎇ Нов бранч от main',
|
|
690
|
+
doesEn: 'Under the chat\'s box, beside the skills: fetches the latest of the remote\'s main and opens a window to make a new local branch from it for the next task — not tracking main, so its work is never pushed there by mistake. If the remote asks for a password or a key\'s passphrase, Git opens its own window for it: the operator types it there, it goes straight to Git, the bot never reads it. Off while a task works, and where the folder is not a repository.',
|
|
691
|
+
doesBg: 'Под полето на чата, до skill-овете: взима последното от main на remote и отваря прозорец, в който от него се прави нов локален бранч за следващата задача — не следи main, така че работата му никога не отива там по грешка. Ако remote-ът поиска парола или паролата на ключ, Git отваря свой прозорец за нея: операторът я въвежда там, тя отива направо в Git, ботът никога не я чете. Неактивен, докато работи задача, и когато папката не е хранилище.',
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
key: 'nb.title',
|
|
695
|
+
kind: 'note',
|
|
696
|
+
en: 'New branch from main',
|
|
697
|
+
bg: 'Нов бранч от main',
|
|
698
|
+
doesEn: 'The window of that button: what the new branch starts from (the remote\'s main and its commit), the branch the folder is on now, the new branch\'s name to change, and what is not committed with the choice of what to do with it.',
|
|
699
|
+
doesBg: 'Прозорецът на този бутон: от какво започва новият бранч (main на remote и неговият commit), на кой бранч е папката сега, името на новия бранч, което може да се смени, и какво не е комитнато, с избор какво да стане с него.',
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
key: 'nb.name',
|
|
703
|
+
kind: 'field',
|
|
704
|
+
en: 'The new branch\'s name',
|
|
705
|
+
bg: 'Името на новия бранч',
|
|
706
|
+
doesEn: 'A free name is offered (task/<date>-<time>); any name git takes, not one in use.',
|
|
707
|
+
doesBg: 'Предлага се свободно име (task/<дата>-<час>); всяко име, което git приема и което не се ползва.',
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
key: 'nb.dirty',
|
|
711
|
+
kind: 'note',
|
|
712
|
+
en: 'Not committed: {n} file(s)',
|
|
713
|
+
bg: 'Некомитнато: {n} файл(а)',
|
|
714
|
+
doesEn: 'What is not committed, and the choice: take it to the new branch, as it is (refused by Git, with nothing moved, when the remote\'s main changed the same files — then putting it aside is chosen); or put it aside, kept whole as a commit on a branch of its own (cop/saved/…), and start clean. Nothing is ever deleted.',
|
|
715
|
+
doesBg: 'Какво не е комитнато и изборът: да се вземе в новия бранч, както е (Git отказва, без да мести нищо, ако main на remote е променил същите файлове — тогава се избира „настрана“); или да се остави настрана, пазено изцяло като commit в отделен бранч (cop/saved/…), и да се започне чисто. Нищо никога не се изтрива.',
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
key: 'nb.tryAgain',
|
|
719
|
+
kind: 'button',
|
|
720
|
+
en: 'Try again',
|
|
721
|
+
bg: 'Опитай отново',
|
|
722
|
+
doesEn: 'When the remote could not be fetched — a password not given, a network down: fetches again, and Git asks for the password again if it must. Beside it, the branch can be made from what was last fetched here.',
|
|
723
|
+
doesBg: 'Когато remote-ът не е могъл да бъде взет — непоставена парола, липса на мрежа: взима отново, и Git пак пита за паролата, ако трябва. До него бранчът може да се направи от последно взетото тук.',
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
key: 'nb.making',
|
|
727
|
+
kind: 'button',
|
|
728
|
+
en: 'Making the branch',
|
|
729
|
+
bg: 'Правя бранча',
|
|
730
|
+
doesEn: 'The button once pressed, its dots going round, until the branch is made: then the chat says where the folder is, and the next message starts a new conversation on the new branch.',
|
|
731
|
+
doesBg: 'Бутонът, след като е натиснат, с въртящи се точки, докато бранчът се направи: тогава чатът казва къде е папката, а следващото съобщение започва нов разговор на новия бранч.',
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
key: 'nb.cancel',
|
|
735
|
+
kind: 'button',
|
|
736
|
+
en: 'Cancel',
|
|
737
|
+
bg: 'Отказ',
|
|
738
|
+
doesEn: 'Closes the window; nothing is changed.',
|
|
739
|
+
doesBg: 'Затваря прозореца; нищо не се променя.',
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
key: 'chat.renameLabel',
|
|
743
|
+
kind: 'field',
|
|
744
|
+
en: 'The conversation\'s name',
|
|
745
|
+
bg: 'Името на разговора',
|
|
746
|
+
doesEn: 'The new name, up to 120 characters; Enter keeps it, Escape leaves it as it was.',
|
|
747
|
+
doesBg: 'Новото име, до 120 знака; Enter го запазва, Escape го оставя, както е било.',
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
key: 'chat.renameSave',
|
|
751
|
+
kind: 'button',
|
|
752
|
+
en: 'Save the name',
|
|
753
|
+
bg: 'Запиши името',
|
|
754
|
+
doesEn: 'The ✓ beside the name: keeps it, and the list shows it.',
|
|
755
|
+
doesBg: 'Знакът ✓ до името: запазва го и списъкът го показва.',
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
key: 'chat.renameCancel',
|
|
759
|
+
kind: 'button',
|
|
760
|
+
en: 'Cancel',
|
|
761
|
+
bg: 'Отказ',
|
|
762
|
+
doesEn: 'The ✕ beside the name: leaves it as it was.',
|
|
763
|
+
doesBg: 'Знакът ✕ до името: оставя го, както е било.',
|
|
764
|
+
},
|
|
677
765
|
{
|
|
678
766
|
key: 'chat.welcome',
|
|
679
767
|
kind: 'note',
|
|
@@ -794,6 +882,14 @@ export const SYSTEM_GUIDE = [
|
|
|
794
882
|
doesEn: 'While it works: stops it; the message in flight ends stopped and can be carried on. The Copilot window stays open for the next message.',
|
|
795
883
|
doesBg: 'Докато работи: спира го; текущото съобщение завършва спряно и може да продължи. Прозорецът на Copilot остава отворен за следващото съобщение.',
|
|
796
884
|
},
|
|
885
|
+
{
|
|
886
|
+
key: 'chat.stoppingNow',
|
|
887
|
+
kind: 'button',
|
|
888
|
+
en: 'Stopping',
|
|
889
|
+
bg: 'Спиране',
|
|
890
|
+
doesEn: '"Stop" once pressed: off, its dots going round ("Stopping." "Stopping.." "Stopping...") until the work has stopped — an answer Copilot is writing is waited for first.',
|
|
891
|
+
doesBg: '„Спри“, след като е натиснат: неактивен, с точки, които се сменят („Спиране.“ „Спиране..“ „Спиране...“), докато работата спре — отговор, който Copilot пише, първо се изчаква.',
|
|
892
|
+
},
|
|
797
893
|
{
|
|
798
894
|
key: 'chat.skill',
|
|
799
895
|
kind: 'select',
|
|
@@ -1446,6 +1542,78 @@ export const SYSTEM_GUIDE = [
|
|
|
1446
1542
|
en: 'Queue of tasks',
|
|
1447
1543
|
bg: 'Опашка от задачи',
|
|
1448
1544
|
controls: [
|
|
1545
|
+
{
|
|
1546
|
+
key: 'q.parkAfter',
|
|
1547
|
+
kind: 'field',
|
|
1548
|
+
en: 'When a task waits for you',
|
|
1549
|
+
bg: 'Когато задача чака вас',
|
|
1550
|
+
doesEn: 'Seconds a task of the queue waits for the operator — its plan to approve, a question, a command, a subtask cut off, a model to choose, a password Git asks for — before it is set aside (status "Waits for you") and the next task starts; 120 by default, 0 waits as long as it takes. What it waits for is kept, even when the program is closed.',
|
|
1551
|
+
doesBg: 'Секунди, през които задача от опашката чака оператора — план за одобрение, въпрос, команда, прекъсната подзадача, модел за избор, парола, която Git иска, — преди да бъде оставена настрана (състояние „Чака вас“) и да започне следващата; по подразбиране 120, 0 чака колкото трябва. Каквото чака, се пази, дори когато програмата бъде затворена.',
|
|
1552
|
+
},
|
|
1553
|
+
{
|
|
1554
|
+
key: 'q.parked',
|
|
1555
|
+
kind: 'note',
|
|
1556
|
+
en: 'Waits for you',
|
|
1557
|
+
bg: 'Чака вас',
|
|
1558
|
+
doesEn: 'The status of a task set aside while it waited for the operator: under it, its card with what it waits for, to answer now; it carries on from where it stopped at the queue\'s next turn.',
|
|
1559
|
+
doesBg: 'Състоянието на задача, оставена настрана, докато е чакала оператора: под нея е картата ѝ с това, което чака, за отговор сега; продължава оттам, където е спряла, при следващия ход на опашката.',
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
key: 'pk.approve',
|
|
1563
|
+
kind: 'button',
|
|
1564
|
+
en: 'Approve the plan',
|
|
1565
|
+
bg: 'Одобри плана',
|
|
1566
|
+
doesEn: 'On the card of a task set aside (in the queue, and under its message in its chat): approves its plan, with the note if one is written; the task carries on at the queue\'s next turn, after the task at work.',
|
|
1567
|
+
doesBg: 'На картата на оставена настрана задача (в опашката и под съобщението ѝ в чата ѝ): одобрява плана ѝ, с бележката, ако има такава; задачата продължава при следващия ход на опашката, след задачата, която работи.',
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
key: 'pk.revise',
|
|
1571
|
+
kind: 'button',
|
|
1572
|
+
en: 'Ask for another plan',
|
|
1573
|
+
bg: 'Поискай друг план',
|
|
1574
|
+
doesEn: 'Sends the plan back with the note, which says what to change; the task makes another plan first when it carries on.',
|
|
1575
|
+
doesBg: 'Връща плана с бележката, която казва какво да се промени; задачата първо прави нов план, когато продължи.',
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
key: 'pk.note',
|
|
1579
|
+
kind: 'field',
|
|
1580
|
+
en: 'A note with the plan (needed to ask for another)',
|
|
1581
|
+
bg: 'Бележка към плана (нужна, за да поискате друг)',
|
|
1582
|
+
doesEn: 'What goes with the approval, or what to change when asking for another plan.',
|
|
1583
|
+
doesBg: 'Какво върви с одобрението или какво да се промени, когато се иска друг план.',
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
key: 'pk.run',
|
|
1587
|
+
kind: 'button',
|
|
1588
|
+
en: 'Run it',
|
|
1589
|
+
bg: 'Изпълни я',
|
|
1590
|
+
doesEn: 'On a task set aside at a command: approves the command; when its chat sends it again, it runs without asking.',
|
|
1591
|
+
doesBg: 'На задача, оставена настрана при команда: одобрява командата; когато чатът ѝ я изпрати отново, тя се изпълнява без питане.',
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
key: 'pk.skip',
|
|
1595
|
+
kind: 'button',
|
|
1596
|
+
en: 'Skip it',
|
|
1597
|
+
bg: 'Пропусни я',
|
|
1598
|
+
doesEn: 'Does not approve the command; the chat is told to do without it.',
|
|
1599
|
+
doesBg: 'Не одобрява командата; на чата се казва да мине без нея.',
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
key: 'pk.resume',
|
|
1603
|
+
kind: 'button',
|
|
1604
|
+
en: 'Carry on — I am here',
|
|
1605
|
+
bg: 'Продължи — тук съм',
|
|
1606
|
+
doesEn: 'On a task set aside while it waited for a model to be chosen by hand or a password Git asked for: carries it on at the queue\'s next turn; it asks again, so be at the computer.',
|
|
1607
|
+
doesBg: 'На задача, оставена настрана, докато е чакала ръчен избор на модел или парола, която Git е поискал: продължава я при следващия ход на опашката; тя пита отново, затова бъдете на компютъра.',
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
key: 'pk.stop',
|
|
1611
|
+
kind: 'button',
|
|
1612
|
+
en: 'Stop this task',
|
|
1613
|
+
bg: 'Спри тази задача',
|
|
1614
|
+
doesEn: 'Leaves a task set aside stopped: it does not carry on; "Run again" starts it over.',
|
|
1615
|
+
doesBg: 'Оставя задача, оставена настрана, спряна: тя не продължава; „Пусни отново“ я започва отначало.',
|
|
1616
|
+
},
|
|
1449
1617
|
{
|
|
1450
1618
|
key: 'q.run',
|
|
1451
1619
|
kind: 'button',
|
|
@@ -1462,6 +1630,14 @@ export const SYSTEM_GUIDE = [
|
|
|
1462
1630
|
doesEn: 'Stops the task at work, as the chat\'s Stop does; the rest wait.',
|
|
1463
1631
|
doesBg: 'Спира задачата, която работи, както Спри в чата; останалите чакат.',
|
|
1464
1632
|
},
|
|
1633
|
+
{
|
|
1634
|
+
key: 'q.stopping',
|
|
1635
|
+
kind: 'button',
|
|
1636
|
+
en: 'Stopping the queue',
|
|
1637
|
+
bg: 'Спиране на опашката',
|
|
1638
|
+
doesEn: '"Stop the queue" once pressed, while its task at work is stopping: off, its dots going round, until that task has stopped.',
|
|
1639
|
+
doesBg: '„Спри опашката“, след като е натиснат, докато задачата ѝ спира: неактивен, с точки, които се сменят, докато задачата спре.',
|
|
1640
|
+
},
|
|
1465
1641
|
{
|
|
1466
1642
|
key: 'q.graph',
|
|
1467
1643
|
kind: 'note',
|
|
@@ -1541,6 +1717,14 @@ export const SYSTEM_GUIDE = [
|
|
|
1541
1717
|
doesEn: 'What the list and the picture call the task; empty, its first line.',
|
|
1542
1718
|
doesBg: 'Как списъкът и графиката наричат задачата; празно — първият ѝ ред.',
|
|
1543
1719
|
},
|
|
1720
|
+
{
|
|
1721
|
+
key: 'q.plan',
|
|
1722
|
+
kind: 'checkbox',
|
|
1723
|
+
en: 'Plan first',
|
|
1724
|
+
bg: 'Първо план',
|
|
1725
|
+
doesEn: 'The task\'s plan — the lead\'s, with two chats — is approved by the operator before anything changes; in the queue, a plan nobody approves in time is set aside with it, to approve or send back later.',
|
|
1726
|
+
doesBg: 'Планът на задачата — на ръководителя, при два чата — се одобрява от оператора, преди нещо да се промени; в опашката план, който никой не одобри навреме, се оставя настрана заедно със задачата, за да се одобри или върне по-късно.',
|
|
1727
|
+
},
|
|
1544
1728
|
{
|
|
1545
1729
|
key: 'q.lead',
|
|
1546
1730
|
kind: 'checkbox',
|
|
@@ -1661,6 +1845,22 @@ export const SYSTEM_GUIDE = [
|
|
|
1661
1845
|
doesEn: 'Puts the task at the end of the queue, waiting.',
|
|
1662
1846
|
doesBg: 'Слага задачата в края на опашката, да чака.',
|
|
1663
1847
|
},
|
|
1848
|
+
{
|
|
1849
|
+
key: 'q.addAfter',
|
|
1850
|
+
kind: 'button',
|
|
1851
|
+
en: 'Add, to start after it',
|
|
1852
|
+
bg: 'Добави, да започне след него',
|
|
1853
|
+
doesEn: 'In place of "Add to the queue" while a message sent from the chat is working (or the models are being read, or the sign-in is open) and the queue is not running: adds the task and starts the queue, whose first waiting task begins as soon as that work has ended. The line above the list says what is working.',
|
|
1854
|
+
doesBg: 'Вместо „Добави в опашката“, докато работи съобщение, пуснато от чата (или се четат моделите, или е отворено влизането), а опашката не върви: добавя задачата и пуска опашката, чиято първа чакаща задача започва веднага щом тази работа приключи. Редът над списъка казва какво работи.',
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
key: 'q.skill',
|
|
1858
|
+
kind: 'select',
|
|
1859
|
+
en: 'Skill',
|
|
1860
|
+
bg: 'Skill',
|
|
1861
|
+
doesEn: 'One of Settings\' skills — for every project or for the open folder — sent with the task as /its-name sends it in the chat; "+ Skills" beside it opens Settings at the skills.',
|
|
1862
|
+
doesBg: 'Един от skill-овете в Настройки — за всички проекти или за отворената папка — изпратен със задачата, както го изпраща /името-му в чата; „+ Skill-ове“ до него отваря Настройки при skill-овете.',
|
|
1863
|
+
},
|
|
1664
1864
|
],
|
|
1665
1865
|
},
|
|
1666
1866
|
],
|
package/dist/src/queue/queue.js
CHANGED
|
@@ -9,12 +9,27 @@
|
|
|
9
9
|
* task skipped for it — is skipped, and the queue goes on with the next one that does not;
|
|
10
10
|
* - a task works in the folder as it is, or on a new branch made from main. The server's main is fetched without a
|
|
11
11
|
* password or a key's passphrase, which nobody is there to type; when it cannot be, the local main is used, and the
|
|
12
|
-
* chat is told which it was
|
|
12
|
+
* chat is told which it was;
|
|
13
|
+
* - a task may carry one of Settings' skills, sent with it as the chat's box sends one (2026-10-25);
|
|
14
|
+
* - a task added while something else works — a message of the chat, sent there directly — starts after it
|
|
15
|
+
* (2026-10-25): the queue waits for the browser to be free before it takes the next task;
|
|
16
|
+
* - a task that waits for the operator longer than the queue allows — a plan to approve, a question, a command, a
|
|
17
|
+
* model to choose, a password — is set aside ("parked") with what it waits for kept, and the queue goes on with the
|
|
18
|
+
* next (2026-10-26). Answered later, it carries on from where it stopped, before the others waiting; the tasks that
|
|
19
|
+
* depend on it wait for it rather than being skipped. A task "on a new branch from main" has its branch made when it
|
|
20
|
+
* is added, brought up to the remote's main when it starts if nothing is on it yet.
|
|
13
21
|
*
|
|
14
22
|
* Kept as `data/queue.json` (see `OperatorService.queue`). This module is the part that needs no browser: the shape,
|
|
15
23
|
* the checks of an edit, and which task is next.
|
|
16
24
|
*/
|
|
17
25
|
import { branchExists } from '../vcs/git.js';
|
|
26
|
+
export const DEFAULT_PARK_AFTER_SEC = 120;
|
|
27
|
+
export const MAX_PARK_AFTER_SEC = 24 * 60 * 60;
|
|
28
|
+
/** How long a task waits for the operator before it is parked, in milliseconds; null: as long as it takes. */
|
|
29
|
+
export function parkAfterMs(q) {
|
|
30
|
+
const sec = typeof q.parkAfterSec === 'number' && Number.isFinite(q.parkAfterSec) ? Math.max(0, Math.min(MAX_PARK_AFTER_SEC, Math.round(q.parkAfterSec))) : DEFAULT_PARK_AFTER_SEC;
|
|
31
|
+
return sec === 0 ? null : sec * 1000;
|
|
32
|
+
}
|
|
18
33
|
export const MAX_QUEUE_ITEMS = 50;
|
|
19
34
|
export function emptyQueue() {
|
|
20
35
|
return { items: [], running: false, updatedAt: new Date().toISOString() };
|
|
@@ -51,12 +66,14 @@ export function checkItems(items, maxPromptChars) {
|
|
|
51
66
|
if (late)
|
|
52
67
|
return { problem: `Task ${n} depends on ${items.some((o) => o?.id === late) ? 'a task after it' : `"${late}", which is not in the queue`}: a task can depend only on tasks before it.` };
|
|
53
68
|
const branch = x.branch === 'main' ? 'main' : 'folder';
|
|
54
|
-
const status = typeof x.status === 'string' && ['waiting', 'running', 'done', 'failed', 'skipped', 'stopped'].includes(x.status) ? x.status : undefined;
|
|
69
|
+
const status = typeof x.status === 'string' && ['waiting', 'running', 'done', 'failed', 'skipped', 'stopped', 'parked'].includes(x.status) ? x.status : undefined;
|
|
55
70
|
const text = (v) => String(v ?? '').trim();
|
|
56
71
|
const name = text(x.name);
|
|
57
72
|
if (name.length > MAX_QUEUE_NAME)
|
|
58
73
|
return { problem: `The name of task ${n} is longer than ${MAX_QUEUE_NAME} characters.` };
|
|
59
74
|
const lead = x.lead === true;
|
|
75
|
+
// As typed after "/" in the chat, or as Settings list it: whether it is there is the server's to say.
|
|
76
|
+
const skill = text(x.skill).replace(/^\//, '').toLowerCase();
|
|
60
77
|
out.push({
|
|
61
78
|
id,
|
|
62
79
|
...(name ? { name } : {}),
|
|
@@ -69,6 +86,8 @@ export function checkItems(items, maxPromptChars) {
|
|
|
69
86
|
...(!lead && text(x.reviewModel) ? { reviewModel: text(x.reviewModel) } : {}),
|
|
70
87
|
...(lead ? { lead: true } : {}),
|
|
71
88
|
...(lead && text(x.workerModel) ? { workerModel: text(x.workerModel) } : {}),
|
|
89
|
+
...(skill ? { skill } : {}),
|
|
90
|
+
...(x.plan === true ? { plan: true } : {}),
|
|
72
91
|
...(status ? { status } : {}),
|
|
73
92
|
});
|
|
74
93
|
seen.add(id);
|
|
@@ -93,8 +112,17 @@ export function mergeItems(current, edited) {
|
|
|
93
112
|
return { ...x, status: 'waiting' };
|
|
94
113
|
const again = x.status === 'waiting' && was.status !== 'waiting';
|
|
95
114
|
const given = asGiven(x);
|
|
115
|
+
// "Run again" starts it over, on a branch made for it again when it is one of its own.
|
|
96
116
|
if (again)
|
|
97
117
|
return { ...given, status: 'waiting' };
|
|
118
|
+
// A parked task keeps what it waits for; its answer is given on its card, not by an edit of the list.
|
|
119
|
+
if (was.status === 'parked')
|
|
120
|
+
return { ...was, ...given, status: 'parked' };
|
|
121
|
+
// Where it works changed: the branch made for it no longer is its.
|
|
122
|
+
if (was.branch !== given.branch) {
|
|
123
|
+
const { branchName: _name, branchBase: _base, ...rest } = was;
|
|
124
|
+
return { ...rest, ...given, status: was.status };
|
|
125
|
+
}
|
|
98
126
|
// What the runs gave it stays; what the operator gives it is the edit's, a field left out of it gone.
|
|
99
127
|
const kept = { ...was };
|
|
100
128
|
for (const key of GIVEN)
|
|
@@ -104,7 +132,7 @@ export function mergeItems(current, edited) {
|
|
|
104
132
|
return { items };
|
|
105
133
|
}
|
|
106
134
|
/** What the operator gives a task, apart from what its runs give it. */
|
|
107
|
-
const GIVEN = ['id', 'name', 'prompt', 'model', 'dependsOn', 'branch', 'review', 'reviewModel', 'lead', 'workerModel'];
|
|
135
|
+
const GIVEN = ['id', 'name', 'prompt', 'model', 'dependsOn', 'branch', 'review', 'reviewModel', 'lead', 'workerModel', 'skill', 'plan'];
|
|
108
136
|
function asGiven(x) {
|
|
109
137
|
const out = {};
|
|
110
138
|
for (const key of GIVEN)
|
|
@@ -132,12 +160,20 @@ export function waitsByHand(item, copilot) {
|
|
|
132
160
|
*/
|
|
133
161
|
export function nextStep(items) {
|
|
134
162
|
const byId = new Map(items.map((x) => [x.id, x]));
|
|
163
|
+
// An answered parked task first (2026-10-26): it carries on from where it stopped, before the others waiting.
|
|
164
|
+
const resumed = items.find((x) => x.status === 'waiting' && x.resume);
|
|
165
|
+
if (resumed)
|
|
166
|
+
return { run: resumed };
|
|
135
167
|
for (const item of items) {
|
|
136
168
|
if (item.status !== 'waiting')
|
|
137
169
|
continue;
|
|
138
|
-
const
|
|
170
|
+
const needs = item.dependsOn.map((d) => byId.get(d));
|
|
171
|
+
const blocker = needs.find((d) => !d || d.status === 'failed' || d.status === 'skipped' || d.status === 'stopped');
|
|
139
172
|
if (blocker)
|
|
140
173
|
return { skip: item, because: blocker };
|
|
174
|
+
// One it needs is parked, or waits to carry on: this one waits for it, rather than being skipped.
|
|
175
|
+
if (needs.some((d) => d.status !== 'done'))
|
|
176
|
+
continue;
|
|
141
177
|
return { run: item };
|
|
142
178
|
}
|
|
143
179
|
return null;
|
|
@@ -158,3 +194,34 @@ export async function mainBranchOf(dir) {
|
|
|
158
194
|
return name;
|
|
159
195
|
return null;
|
|
160
196
|
}
|
|
197
|
+
/** What a parked task waits for, in the words the queue's page and its log use (2026-10-26). */
|
|
198
|
+
export const PARKED_WORDS = {
|
|
199
|
+
plan: 'its plan, to approve',
|
|
200
|
+
question: 'an answer to its question',
|
|
201
|
+
retry: 'what to do with a subtask that was cut off',
|
|
202
|
+
command: 'your word on a command',
|
|
203
|
+
model: 'the model, to be chosen by hand',
|
|
204
|
+
password: 'a password Git asked for',
|
|
205
|
+
};
|
|
206
|
+
/** The operator's answer to a parked task, held to what its card offered, or why it cannot be taken. */
|
|
207
|
+
export function parkedAnswerFrom(p, input) {
|
|
208
|
+
const text = (v) => (typeof v === 'string' ? v.trim() : '');
|
|
209
|
+
switch (p.kind) {
|
|
210
|
+
case 'plan':
|
|
211
|
+
if (input.decision === 'approve')
|
|
212
|
+
return { kind: 'plan', decision: 'approve', ...(text(input.note) ? { note: text(input.note) } : {}) };
|
|
213
|
+
if (input.decision === 'revise')
|
|
214
|
+
return text(input.note) ? { kind: 'plan', decision: 'revise', note: text(input.note) } : { problem: 'Say what to change in the plan.' };
|
|
215
|
+
return { problem: 'A plan is approved, or sent back for another.' };
|
|
216
|
+
case 'question':
|
|
217
|
+
return text(input.answer) ? { kind: 'question', answer: text(input.answer) } : { problem: 'Write the answer first.' };
|
|
218
|
+
case 'retry': {
|
|
219
|
+
const choices = p.approval.retry?.choices ?? [];
|
|
220
|
+
return typeof input.choice === 'string' && choices.includes(input.choice) ? { kind: 'retry', choice: input.choice } : { problem: `Choose one of: ${choices.join(', ')}.` };
|
|
221
|
+
}
|
|
222
|
+
case 'command':
|
|
223
|
+
return input.decision === 'run' || input.decision === 'skip' ? { kind: 'command', decision: input.decision } : { problem: 'A command is run or skipped.' };
|
|
224
|
+
default:
|
|
225
|
+
return { kind: 'resume' };
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A branch of its own for each task of the queue "on a new branch from main" (operator, 2026-10-26: "the branches are
|
|
3
|
+
* best made when the task is added to the queue, not when its turn comes; the bot knows which branch each chat works
|
|
4
|
+
* with, and changes to it when it goes from one task to another"). Made when the task is added — the operator is there
|
|
5
|
+
* to type a password if the remote asks for one, in Git's own window — at the remote's main as it is then; brought up
|
|
6
|
+
* to the remote's main when the task starts, if nothing has been done on it yet and the remote can be read without
|
|
7
|
+
* asking anybody. The run then works on it as an existing branch (`startFrom: 'existing-branch'`).
|
|
8
|
+
*/
|
|
9
|
+
import { branchNameFrom, freeBranchName, git, isAncestor } from '../vcs/git.js';
|
|
10
|
+
import { planNewBranch } from '../vcs/newBranch.js';
|
|
11
|
+
import { fetchAsOperator } from '../vcs/remoteAuth.js';
|
|
12
|
+
import { mainBranchOf } from './queue.js';
|
|
13
|
+
/** Fetches the remote's main once, through Git's window when it asks; for every branch made in one edit of the list. */
|
|
14
|
+
export async function branchStart(dir, askpass) {
|
|
15
|
+
const plan = await planNewBranch(dir, { fetch: true, askpass });
|
|
16
|
+
if (plan.ok && plan.targetCommit)
|
|
17
|
+
return { commit: plan.targetCommit, from: plan.target ?? 'origin/main', fetched: !!plan.fetched?.ok };
|
|
18
|
+
// No remote, or no main of it known: the local main, as a task "on a new branch from main" always had.
|
|
19
|
+
const local = await mainBranchOf(dir);
|
|
20
|
+
if (!local)
|
|
21
|
+
return { problem: plan.problem ?? `${dir} has no main (or master) branch to make a branch from` };
|
|
22
|
+
const commit = (await git(dir, ['rev-parse', '--verify', '--quiet', `refs/heads/${local}^{commit}`])).stdout;
|
|
23
|
+
return commit ? { commit, from: local, fetched: false } : { problem: `${local} could not be read` };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A free branch name for a task: `queue/<its id>-<its name>`, the name in Latin letters only — one typed at a prompt
|
|
27
|
+
* should not need another keyboard — and `-2` and on when it is taken.
|
|
28
|
+
*/
|
|
29
|
+
export async function queueBranchName(dir, id, title) {
|
|
30
|
+
const latin = title.normalize('NFKD').replace(/[^\x20-\x7e]/g, '').trim();
|
|
31
|
+
return await freeBranchName(dir, branchNameFrom([id, latin.slice(0, 40)], 'queue/'));
|
|
32
|
+
}
|
|
33
|
+
/** Makes the branch at `start`, not checked out: the folder is not touched. */
|
|
34
|
+
export async function makeQueueBranch(dir, id, title, start) {
|
|
35
|
+
const branch = await queueBranchName(dir, id, title);
|
|
36
|
+
const made = await git(dir, ['branch', '--no-track', branch, start.commit]);
|
|
37
|
+
if (!made.ok)
|
|
38
|
+
return { problem: (made.stderr || made.stdout || `the branch ${branch} could not be made`).split(/\r?\n/)[0] };
|
|
39
|
+
return { branch, base: start.commit };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* At the task's start: the branch brought up to the remote's main when nothing has been done on it yet — still at the
|
|
43
|
+
* commit it was made at — and the remote can be read without asking anybody (nobody may be there). Forward only.
|
|
44
|
+
*/
|
|
45
|
+
export async function refreshQueueBranch(dir, branch, base) {
|
|
46
|
+
const tip = (await git(dir, ['rev-parse', '--verify', '--quiet', `refs/heads/${branch}^{commit}`])).stdout;
|
|
47
|
+
if (!tip)
|
|
48
|
+
return { base, moved: false, detail: `there is no branch ${branch} any more` };
|
|
49
|
+
if (tip !== base)
|
|
50
|
+
return { base, moved: false, detail: 'work is on it already' };
|
|
51
|
+
const remotes = (await git(dir, ['remote'])).stdout.split(/\r?\n/).map((r) => r.trim()).filter(Boolean);
|
|
52
|
+
const remote = remotes.includes('origin') ? 'origin' : remotes[0];
|
|
53
|
+
if (!remote)
|
|
54
|
+
return { base, moved: false, detail: 'no remote' };
|
|
55
|
+
const fetched = await fetchAsOperator(dir, remote, { askpass: null, refspecs: [`+refs/heads/main:refs/remotes/${remote}/main`] });
|
|
56
|
+
if (!fetched.ok)
|
|
57
|
+
return { base, moved: false, detail: fetched.detail };
|
|
58
|
+
const latest = (await git(dir, ['rev-parse', '--verify', '--quiet', `refs/remotes/${remote}/main^{commit}`])).stdout;
|
|
59
|
+
if (!latest || latest === base)
|
|
60
|
+
return { base, moved: false };
|
|
61
|
+
if (!(await isAncestor(dir, base, latest)))
|
|
62
|
+
return { base, moved: false, detail: `${remote}/main went another way` };
|
|
63
|
+
const current = (await git(dir, ['symbolic-ref', '--quiet', '--short', 'HEAD'])).stdout;
|
|
64
|
+
const moved = current === branch ? await git(dir, ['merge', '--ff-only', '--quiet', latest]) : await git(dir, ['update-ref', '-m', `copilot-operator: ${branch} brought up to ${remote}/main`, `refs/heads/${branch}`, latest, base]);
|
|
65
|
+
return moved.ok ? { base: latest, moved: true } : { base, moved: false, detail: (moved.stderr || moved.stdout).split(/\r?\n/)[0] };
|
|
66
|
+
}
|
|
@@ -77,6 +77,15 @@ function level2Block(level2) {
|
|
|
77
77
|
* failed, that the files are as its work left them, and — after the bot stopped under it — which of
|
|
78
78
|
* the steps it had just asked for actually ran.
|
|
79
79
|
*/
|
|
80
|
+
/** What a task of the queue waited for when it was set aside, as the chat that carries it on is told it (2026-10-26). */
|
|
81
|
+
const PARKED_FOR = {
|
|
82
|
+
plan: 'for the operator to approve your plan',
|
|
83
|
+
question: 'for the operator\'s answer to a question',
|
|
84
|
+
retry: 'for the operator to say what to do with a subtask that was cut off',
|
|
85
|
+
command: 'for the operator\'s word on a command',
|
|
86
|
+
model: 'for the operator to choose the model by hand',
|
|
87
|
+
password: 'for a password Git asked for in its own window',
|
|
88
|
+
};
|
|
80
89
|
export function whyItStopped(c) {
|
|
81
90
|
if (c.how === 'failed')
|
|
82
91
|
return describeEnding(c.fromAttempt, c.ended, c.stoppedBecause);
|
|
@@ -86,6 +95,12 @@ export function whyItStopped(c) {
|
|
|
86
95
|
'crashed; nothing you did failed — and it has now started again. The files are as your work left them, and what had ' +
|
|
87
96
|
`changed is committed on this branch.${where}`.trimEnd());
|
|
88
97
|
}
|
|
98
|
+
if (c.how === 'parked') {
|
|
99
|
+
const what = c.parkedFor ? PARKED_FOR[c.parkedFor] : 'for the operator';
|
|
100
|
+
return (`It waited ${what}, and was set aside so that the queue's other tasks could run while nobody was there — not because ` +
|
|
101
|
+
'anything failed. The operator has answered now: the answer is below. The files are as you left them, and what had ' +
|
|
102
|
+
'changed is committed on this branch.');
|
|
103
|
+
}
|
|
89
104
|
if (c.how === 'stopped') {
|
|
90
105
|
const where = c.interruption ? `\n\n${describeInterruption(c.interruption).replace(/when the runner stopped/g, 'when it was stopped')}\n\n` : ' ';
|
|
91
106
|
return `It was stopped by the operator before it finished — not because anything failed. The files are as you left them.${where}`.trimEnd();
|
|
@@ -107,6 +107,8 @@ export const TASK_FIELD_ON_RERUN = {
|
|
|
107
107
|
leftovers: 'archived',
|
|
108
108
|
// The fault of the means an attempt ended on (2026-10-25) is that attempt's.
|
|
109
109
|
failure: 'archived',
|
|
110
|
+
// What an attempt waited for when the queue set it aside, and the answer, are that attempt's (2026-10-26).
|
|
111
|
+
parked: 'archived',
|
|
110
112
|
environment: 'archived',
|
|
111
113
|
handoff: 'archived',
|
|
112
114
|
plan: 'archived',
|
|
@@ -567,6 +569,7 @@ export class SessionStore {
|
|
|
567
569
|
runGroup: t.runGroup,
|
|
568
570
|
leftovers: t.leftovers,
|
|
569
571
|
failure: t.failure,
|
|
572
|
+
...(t.parked ? { parked: t.parked } : {}),
|
|
570
573
|
environment: t.environment,
|
|
571
574
|
status: t.status,
|
|
572
575
|
startedAt: t.startedAt,
|
|
@@ -652,6 +655,7 @@ export class SessionStore {
|
|
|
652
655
|
// left in place, the next attempt's list was added to this one's and read as its own.
|
|
653
656
|
t.leftovers = undefined;
|
|
654
657
|
t.failure = undefined;
|
|
658
|
+
t.parked = undefined;
|
|
655
659
|
t.environment = undefined;
|
|
656
660
|
// The branch of the finished attempt stays in the repository and stays on the record
|
|
657
661
|
// above; the next attempt gets its own, cut from the same commit this one started at.
|