@goodandready/dsh-moa 0.2.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GooDAnDReaDY
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # @goodandready/dsh-moa
2
+
3
+ > **Mixture of Agents (MoA)** plugin for **DeepSeek Harness** adding the `/moa <prompt>` slash command.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ `dsh-moa` introduces the **Mixture of Agents** architecture to DeepSeek Harness, inspired by Hermes Agent and OpenClaw.
10
+
11
+ Instead of routing a complex problem to a single language model, `dsh-moa` executes a collaborative multi-phase pipeline:
12
+ 1. **Interactive Requirement Refinement (Adaptive):** For broad or underspecified prompts (e.g. `/moa build a calculator`), advisor models formulate clarifying options and the judge synthesizes a structured 2-4 question questionnaire before generating code.
13
+ 2. **Candidate Proposers (Advisors) & File Isolation:** Multiple independent models query the prompt concurrently to produce diverse, creative, and distinct solutions. Each candidate's generated files are isolated under `.moa/candidate-N/`.
14
+ 3. **Aggregator (Judge / Synthesizer) & Promotion:** A frontier reasoning model critically compares all candidate solutions, chooses the best implementation via a machine marker (`WINNER_CANDIDATE_INDEX: N`), and promotes the winner's files directly into the project root directory while cleaning up temporary sandboxes.
15
+ 4. **Live Canvas Integration:** If web files (HTML, JSX, etc.) are generated, `dsh-moa` automatically notifies `dsh-live-canvas` via its REST API, enabling instant 1-click visual previewing.
16
+ 5. **Token-Efficient Code Summarization:** Chat responses present clean architectural summaries, file listings, and interactive links without dumping thousands of lines of raw code into the chat history.
17
+ 6. **One-Shot Session Model Restoration:** The slash command operates strictly as a one-shot turn modifier. As soon as the synthesis completes (even on errors), the session automatically and cleanly reverts to the user's primary working model.
18
+
19
+ ---
20
+
21
+ ## Features
22
+
23
+ - **Slash Command Integration (`/moa`):** Built-in autocompletion in the DeepSeek Harness web composer via `inputTriggers`.
24
+ - **Adaptive Questionnaire Gate:** Detects broad requests and interactively asks clarifying questions with recommended answers.
25
+ - **Parallel Fan-out with Live Heartbeats:** Fast concurrent model evaluation with real-time progress indicators (`⏳ [Ns] Processing...`, per-model completion badges).
26
+ - **Disk-Level Workspace Isolation:** Candidates create real files on disk in temporary workspaces; the judge picks the winning candidate and promotes files to the workspace.
27
+ - **Live Canvas 1-Click Integration:** Automatically creates sandbox sessions in `@goodandready/dsh-live-canvas` for generated web applications.
28
+ - **Token-Saving Chat Output:** Strips voluminous raw code dumps in chat messages in favor of compact file listings and markdown summaries.
29
+ - **Advisory Context Isolation:** Tool dumps and bulky system prompts are stripped from candidate advisor context, preventing prompt bloat and "missing tools" refusals.
30
+ - **DSH Native Settings Card:** Collapsible plugin card under `Settings → Plugins → Mixture of Agents` built using native `--dsw-alias-*` theme tokens.
31
+ - **Named Presets:** Configure custom MoA presets such as `default`, `code-review`, or `deep-reasoning`.
32
+
33
+ ---
34
+
35
+ ## Usage
36
+
37
+ ### In Composer
38
+
39
+ Type `/moa` in the DeepSeek Harness chat input:
40
+
41
+ ```text
42
+ /moa explain the Raft consensus algorithm with state transitions
43
+ ```
44
+
45
+ Or target a specific configured preset:
46
+
47
+ ```text
48
+ /moa deep-reasoning analyze this concurrency bottleneck
49
+ ```
50
+
51
+ To build a project with real files:
52
+
53
+ ```text
54
+ /moa build an interactive scientific calculator in HTML/CSS/JS
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Configuration
60
+
61
+ In **Settings → Plugins → Mixture of Agents**:
62
+
63
+ | Field | Description | Default |
64
+ |---|---|---|
65
+ | **Default Preset** | Name of the default preset applied when no preset name is specified | `default` |
66
+ | **Proposer Models** | Array of `{ provider, model }` candidates queried in parallel | `deepseek:deepseek-chat`, `openai:gpt-4o` |
67
+ | **Aggregator Model** | Leading judge model synthesizing candidate responses | `anthropic:claude-3-7-sonnet` |
68
+ | **Reference Temperature** | Sampling temperature for proposer candidates | `0.6` |
69
+ | **Aggregator Temperature** | Sampling temperature for the synthesizer model | `0.4` |
70
+ | **Max Tokens** | Maximum tokens for generation | `4096` |
71
+
72
+ ---
73
+
74
+ ## Architecture
75
+
76
+ ```
77
+ +-------------------------------------------------------+
78
+ | User Input in DSH Composer |
79
+ | "/moa <complex problem prompt>" |
80
+ +-------------------------------------------------------+
81
+ |
82
+ v
83
+ +-------------------------------------------------------+
84
+ | Client Trigger (lib/client.js) |
85
+ | Autocomplete via inputTriggers, sends to agent |
86
+ +-------------------------------------------------------+
87
+ |
88
+ v
89
+ +-------------------------------------------------------+
90
+ | Host Interceptor (lib/index.js) |
91
+ | 1. Records initial session model (originalModel) |
92
+ | 2. Cleans context for advisory advisors |
93
+ +-------------------------------------------------------+
94
+ |
95
+ v
96
+ +-------------------------------------------------------+
97
+ | MoA Runner (lib/moa-runner.js) |
98
+ | 1. Evaluates broadness -> Questionnaire or Sandbox |
99
+ | 2. Parallel fan-out -> writes .moa/candidate-N/ |
100
+ | 3. Judge evaluation -> WINNER_CANDIDATE_INDEX |
101
+ | 4. File Promotion -> moves winner files to root |
102
+ | 5. Live Canvas API -> registers visual preview |
103
+ +-------------------------------------------------------+
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Testing
109
+
110
+ Run unit and contract test suite without network dependencies:
111
+
112
+ ```bash
113
+ node --test test/*.test.mjs
114
+ ```
115
+
116
+ ---
117
+
118
+ ## License
119
+
120
+ MIT © [GooDAnDReaDY](https://github.com/GooDAnDReaDY)
package/README.ru.md ADDED
@@ -0,0 +1,83 @@
1
+ # @goodandready/dsh-moa
2
+
3
+ > Плагин **Mixture of Agents (MoA)** для **DeepSeek Harness**, добавляющий слэш-команду `/moa <prompt>`.
4
+
5
+ ---
6
+
7
+ ## Обзор
8
+
9
+ `dsh-moa` реализует архитектуру **Mixture of Agents** в DeepSeek Harness по образцу передовых ансамблевых систем (Hermes Agent, OpenClaw).
10
+
11
+ Вместо отправки сложной инженерной или логической задачи одной модели, `dsh-moa` выполняет гибкий многофазный процесс:
12
+ 1. **Интерактивное уточнение требований (Адаптивный опросник):** При широких или неполных запросах (например, `/moa создай калькулятор`) советники формируют варианты реализации, а судья синтезирует компактный опросник из 2–4 вопросов с вариантами ответов до запуска написания кода.
13
+ 2. **Модели-кандидаты (Proposers / Advisors) и изолированные воркспейсы:** Несколько независимых моделей параллельно анализируют задачу и генерируют файлы в изолированных песочницах `.moa/candidate-N/`.
14
+ 3. **Модель-агрегатор (Judge / Synthesizer) и промоция файлов:** Мощная рассуждающая модель сопоставляет решения кандидатов, определяет победителя машинным маркером (`WINNER_CANDIDATE_INDEX: N`), переносит созданные файлы победителя напрямую в корень проекта и удаляет временные директории.
15
+ 4. **Интеграция с Live Canvas:** При создании веб-файлов (`index.html` и др.) плагин автоматически регистрирует их в сервисе `@goodandready/dsh-live-canvas` и предоставляет ссылки для мгновенного запуска предпросмотра в один клик.
16
+ 5. **Экономия токенов при выводе в чат:** Большие блоки исходного кода заменяются компактными плашками с описанием файлов, сохраняя контекст чата чистым и лаконичным.
17
+ 6. **One-Shot восстановление модели:** Команда `/moa` действует строго на один ход. Сразу после завершения ответа сессия автоматически и гарантированно возвращается к исходной рабочей модели.
18
+
19
+ ---
20
+
21
+ ## Возможности
22
+
23
+ - **Интеграция слэш-команды (`/moa`):** Автодополнение в поле ввода чата DeepSeek Harness через сервис `inputTriggers`.
24
+ - **Живые индикаторы прогресса (Heartbeats):** Отображение статуса в реальном времени (`⏳ [Ns] Идёт обработка...`, отметки о завершении генерации каждой моделью).
25
+ - **Дисковая изоляция кандидатов:** Реальное создание файлов на диске и перенос лучшего решения в корень проекта.
26
+ - **Интеграция с Live Canvas:** Автоматическое открытие созданных интерфейсов в плагине Live Canvas.
27
+ - **Параллельный опрос (Fan-out):** Конкурентное выполнение запросов с graceful degradation.
28
+ - **Изолированный контекст советников:** Очистка истории от системных промптов агента и дампов инструментов.
29
+ - **Нативная карточка настроек DSH:** Карточка в разделе «Настройки → Плагины → Mixture of Agents», использующая системные токены темы `--dsw-alias-*`.
30
+ - **Именованные пресеты:** Поддержка нескольких конфигураций моделей (`default`, `code-review`, `deep-reasoning`).
31
+
32
+ ---
33
+
34
+ ## Использование
35
+
36
+ В поле ввода чата DeepSeek Harness:
37
+
38
+ ```text
39
+ /moa напиши архитектуру распределённого кэша с защитой от dog-piling
40
+ ```
41
+
42
+ Или с указанием конкретного пресета:
43
+
44
+ ```text
45
+ /moa deep-reasoning найди скрытые гонки данных в этом алгоритме
46
+ ```
47
+
48
+ Создание проекта с реальными файлами:
49
+
50
+ ```text
51
+ /moa сделай интерактивный калькулятор на HTML, CSS и JS
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Настройки
57
+
58
+ В разделе **Настройки → Плагины → Mixture of Agents**:
59
+
60
+ | Параметр | Описание | По умолчанию |
61
+ |---|---|---|
62
+ | **Основной пресет** | Имя пресета по умолчанию при вызове `/moa <prompt>` | `default` |
63
+ | **Модели-кандидаты** | Массив `{ provider, model }`, опрашиваемых параллельно | `deepseek:deepseek-chat`, `openai:gpt-4o` |
64
+ | **Ведущая модель (судья)** | Модель-агрегатор, синтезирующая финальный ответ | `anthropic:claude-3-7-sonnet` |
65
+ | **Температура кандидатов** | Степень креативности кандидатов | `0.6` |
66
+ | **Температура судьи** | Степень точности синтезатора | `0.4` |
67
+ | **Максимум токенов** | Лимит длины ответа | `4096` |
68
+
69
+ ---
70
+
71
+ ## Тестирование
72
+
73
+ Запуск модульных и контрактных тестов:
74
+
75
+ ```bash
76
+ node --test test/*.test.mjs
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Лицензия
82
+
83
+ MIT © [GooDAnDReaDY](https://github.com/GooDAnDReaDY)
@@ -0,0 +1,4 @@
1
+ - insert:
2
+ - id: dsh-moa
3
+ name: '@goodandready/dsh-moa'
4
+ config: {}