@mono-agent/agent-app 0.5.1 → 0.6.1
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 +7 -0
- package/dist/adapter-send-tools.d.ts +7 -7
- package/dist/adapter-send-tools.d.ts.map +1 -1
- package/dist/adapter-send-tools.js +59 -50
- package/dist/adapter-send-tools.js.map +1 -1
- package/dist/app.js +8 -8
- package/dist/app.js.map +1 -1
- package/dist/channels.js +3 -3
- package/dist/channels.js.map +1 -1
- package/dist/cli.d.ts +28 -10
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +287 -164
- package/dist/cli.js.map +1 -1
- package/dist/config-reference.js +4 -4
- package/dist/config-reference.js.map +1 -1
- package/dist/consumer-contract.d.ts.map +1 -1
- package/dist/consumer-contract.js +5 -3
- package/dist/consumer-contract.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +131 -7
- package/dist/doctor.js.map +1 -1
- package/dist/init.d.ts +11 -22
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +25 -116
- package/dist/init.js.map +1 -1
- package/dist/interaction-bridge.d.ts +3 -3
- package/dist/interaction-bridge.d.ts.map +1 -1
- package/dist/memory-recall.d.ts +2 -2
- package/dist/memory-recall.d.ts.map +1 -1
- package/dist/memory-recall.js +3 -3
- package/dist/memory-recall.js.map +1 -1
- package/dist/modules/base.d.ts +25 -0
- package/dist/modules/base.d.ts.map +1 -0
- package/dist/{recipes → modules}/base.js +17 -11
- package/dist/modules/base.js.map +1 -0
- package/dist/modules/catalog.d.ts +12 -0
- package/dist/modules/catalog.d.ts.map +1 -0
- package/dist/modules/catalog.js +412 -0
- package/dist/modules/catalog.js.map +1 -0
- package/dist/modules/index.d.ts +8 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +5 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/known-tools.d.ts +44 -0
- package/dist/modules/known-tools.d.ts.map +1 -0
- package/dist/modules/known-tools.js +88 -0
- package/dist/modules/known-tools.js.map +1 -0
- package/dist/modules/types.d.ts +73 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/{recipes → modules}/types.js +3 -3
- package/dist/{recipes → modules}/types.js.map +1 -1
- package/dist/posted-message-index.d.ts +2 -2
- package/dist/posted-message-index.js +2 -2
- package/dist/provider-setup.d.ts +44 -0
- package/dist/provider-setup.d.ts.map +1 -0
- package/dist/provider-setup.js +174 -0
- package/dist/provider-setup.js.map +1 -0
- package/dist/wizard/answers.d.ts +87 -0
- package/dist/wizard/answers.d.ts.map +1 -0
- package/dist/wizard/answers.js +244 -0
- package/dist/wizard/answers.js.map +1 -0
- package/dist/wizard/from-flags.d.ts +27 -0
- package/dist/wizard/from-flags.d.ts.map +1 -0
- package/dist/wizard/from-flags.js +45 -0
- package/dist/wizard/from-flags.js.map +1 -0
- package/dist/wizard/index.d.ts +11 -0
- package/dist/wizard/index.d.ts.map +1 -0
- package/dist/wizard/index.js +6 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/model-discovery.d.ts +35 -0
- package/dist/wizard/model-discovery.d.ts.map +1 -0
- package/dist/wizard/model-discovery.js +239 -0
- package/dist/wizard/model-discovery.js.map +1 -0
- package/dist/wizard/presets.d.ts +40 -0
- package/dist/wizard/presets.d.ts.map +1 -0
- package/dist/wizard/presets.js +85 -0
- package/dist/wizard/presets.js.map +1 -0
- package/dist/wizard/prompts.d.ts +55 -0
- package/dist/wizard/prompts.d.ts.map +1 -0
- package/dist/wizard/prompts.js +152 -0
- package/dist/wizard/prompts.js.map +1 -0
- package/dist/wizard/run.d.ts +20 -0
- package/dist/wizard/run.d.ts.map +1 -0
- package/dist/wizard/run.js +374 -0
- package/dist/wizard/run.js.map +1 -0
- package/package.json +17 -16
- package/schema/mono-agent.config.schema.json +5 -3
- package/skills/mono-agent-composer/SKILL.md +8 -8
- package/skills/mono-agent-composer/references/config-blueprint.md +7 -7
- package/skills/mono-agent-composer/references/discovery-questions.md +13 -10
- package/skills/mono-agent-composer/references/feature-coverage.md +12 -10
- package/skills/mono-agent-composer/references/package-map.md +7 -6
- package/skills/mono-agent-composer/references/playbooks.md +22 -22
- package/skills/mono-agent-composer/references/validation.md +3 -3
- package/dist/recipes/base.d.ts +0 -15
- package/dist/recipes/base.d.ts.map +0 -1
- package/dist/recipes/base.js.map +0 -1
- package/dist/recipes/catalog.d.ts +0 -4
- package/dist/recipes/catalog.d.ts.map +0 -1
- package/dist/recipes/catalog.js +0 -525
- package/dist/recipes/catalog.js.map +0 -1
- package/dist/recipes/index.d.ts +0 -11
- package/dist/recipes/index.d.ts.map +0 -1
- package/dist/recipes/index.js +0 -14
- package/dist/recipes/index.js.map +0 -1
- package/dist/recipes/types.d.ts +0 -70
- package/dist/recipes/types.d.ts.map +0 -1
- package/dist/setup.d.ts +0 -29
- package/dist/setup.d.ts.map +0 -1
- package/dist/setup.js +0 -97
- package/dist/setup.js.map +0 -1
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
2
|
+
import { basename, join } from "node:path";
|
|
3
|
+
import * as p from "@clack/prompts";
|
|
4
|
+
import { findModule } from "../modules/catalog.js";
|
|
5
|
+
import { ALLOW_ALL_TOOLS, BUILTIN_TOOL_NAMES, isAllowAllTools } from "../modules/known-tools.js";
|
|
6
|
+
import { planProviderSetup, providerSetupActionCommandLine } from "../provider-setup.js";
|
|
7
|
+
import { alwaysOnTools, composeWizardPlan, defaultAnswers, recommendedToolSelection, } from "./answers.js";
|
|
8
|
+
import { findPreset, presetAnswers } from "./presets.js";
|
|
9
|
+
import { channelSelectOptions, effortSelectOptions, guard, memorySelectOptions, modelSelectOptions, presetSelectOptions, toolMultiselectOptions, WizardCancelled, } from "./prompts.js";
|
|
10
|
+
import { discoverWizardModelCandidates, formatModelDiscoveryStatus } from "./model-discovery.js";
|
|
11
|
+
const LOCAL_PROVIDER_MODEL = /^pi:(?:ollama|lmstudio):/u;
|
|
12
|
+
const SANDBOXABLE_TOOLS = new Set(["Bash", "Write", "Edit"]);
|
|
13
|
+
/**
|
|
14
|
+
* The interactive `init` wizard: a colourful, step-by-step flow that COLLECTS a
|
|
15
|
+
* {@link WizardAnswers} and hands it back — it never writes anything. The caller
|
|
16
|
+
* (`runInit`) does the scaffold/validate/print. Ctrl-C at any prompt unwinds
|
|
17
|
+
* through {@link WizardCancelled} to a single clean `p.cancel`, so a cancelled
|
|
18
|
+
* wizard leaves the folder untouched.
|
|
19
|
+
*/
|
|
20
|
+
export async function runInitWizard(ctx) {
|
|
21
|
+
try {
|
|
22
|
+
const result = await collectAnswers(ctx);
|
|
23
|
+
return { status: "answers", answers: result.answers, runProviderSetup: result.runProviderSetup };
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if (error instanceof WizardCancelled) {
|
|
27
|
+
p.cancel("Cancelled — nothing was written.");
|
|
28
|
+
return { status: "cancelled" };
|
|
29
|
+
}
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** Walk the flow (preset or custom), returning the fully collected answers. */
|
|
34
|
+
async function collectAnswers(ctx) {
|
|
35
|
+
p.intro("mono-agent init — let's build your agent");
|
|
36
|
+
const choice = guard(await p.select({
|
|
37
|
+
message: "Start from…",
|
|
38
|
+
options: presetSelectOptions(),
|
|
39
|
+
initialValue: "__custom__",
|
|
40
|
+
}));
|
|
41
|
+
return choice === "__custom__"
|
|
42
|
+
? await collectCustom(ctx)
|
|
43
|
+
: await collectFromPreset(ctx, choice);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The full custom flow: model → effort → channels → memory → per-module inputs
|
|
47
|
+
* → tools → sandbox (only if code tools were chosen) → observability → summary.
|
|
48
|
+
*/
|
|
49
|
+
async function collectCustom(ctx) {
|
|
50
|
+
const draft = draftFrom(defaultAnswers());
|
|
51
|
+
// 1. Model.
|
|
52
|
+
const discovery = await discoverWizardModelCandidates();
|
|
53
|
+
p.note(formatModelDiscoveryStatus(discovery.statuses), "Model discovery");
|
|
54
|
+
const model = guard(await p.select({
|
|
55
|
+
message: "Which model?",
|
|
56
|
+
options: modelSelectOptions(discovery.candidates),
|
|
57
|
+
initialValue: "claude:claude-sonnet-4-6",
|
|
58
|
+
}));
|
|
59
|
+
draft.model = model === "__other__"
|
|
60
|
+
? guard(await p.text({
|
|
61
|
+
message: "Model reference",
|
|
62
|
+
placeholder: "pi:ollama:llama3.1:8b",
|
|
63
|
+
validate: (v) => (v ?? "").trim().length === 0
|
|
64
|
+
? "Enter a provider:model reference (e.g. pi:ollama:llama3.1:8b)"
|
|
65
|
+
: undefined,
|
|
66
|
+
}))
|
|
67
|
+
: model;
|
|
68
|
+
// Optional fallback chain.
|
|
69
|
+
if (guard(await p.confirm({ message: "Add fallback models?", initialValue: false }))) {
|
|
70
|
+
const raw = guard(await p.text({
|
|
71
|
+
message: "Fallback models (comma-separated)",
|
|
72
|
+
placeholder: "codex:gpt-5.5, pi:ollama:llama3.1:8b",
|
|
73
|
+
}));
|
|
74
|
+
draft.fallbackModels = splitCsv(raw);
|
|
75
|
+
}
|
|
76
|
+
const effort = guard(await p.select({
|
|
77
|
+
message: "Reasoning effort?",
|
|
78
|
+
options: effortSelectOptions(),
|
|
79
|
+
initialValue: "",
|
|
80
|
+
}));
|
|
81
|
+
draft.effort = effort.length === 0 ? undefined : effort;
|
|
82
|
+
// 2. Channels.
|
|
83
|
+
const channels = guard(await p.multiselect({
|
|
84
|
+
message: "How will you talk to this agent?",
|
|
85
|
+
options: channelSelectOptions(),
|
|
86
|
+
initialValues: ["channel:webhook"],
|
|
87
|
+
required: false,
|
|
88
|
+
}));
|
|
89
|
+
draft.channels = [...channels];
|
|
90
|
+
// 3. Memory (before per-module inputs so a memory module's inputs are prompted).
|
|
91
|
+
const memory = guard(await p.select({
|
|
92
|
+
message: "Should the agent remember across conversations?",
|
|
93
|
+
options: memorySelectOptions(),
|
|
94
|
+
initialValue: "",
|
|
95
|
+
}));
|
|
96
|
+
draft.memory = memory === "" ? undefined : memory;
|
|
97
|
+
// 4. Per-module (non-secret) inputs for the chosen channels + memory.
|
|
98
|
+
await promptModuleInputs(draft);
|
|
99
|
+
// 5. Tools.
|
|
100
|
+
await promptTools(draft);
|
|
101
|
+
// 6. Sandbox — only meaningful once shell/file tools are in play. Allow-all
|
|
102
|
+
// includes Bash/Write/Edit, so the sandbox question must still appear under it.
|
|
103
|
+
if (isAllowAllTools(draft.allowedTools) || draft.allowedTools.some((tool) => SANDBOXABLE_TOOLS.has(tool))) {
|
|
104
|
+
draft.sandbox = guard(await p.confirm({
|
|
105
|
+
message: "Sandbox shell/file tools? (native srt, localhost-only network, fails closed if srt is missing)",
|
|
106
|
+
initialValue: true,
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
// 7. Observability.
|
|
110
|
+
draft.observability = guard(await p.confirm({
|
|
111
|
+
message: "Export traces to Phoenix (best-effort OTLP, sensitive data excluded)?",
|
|
112
|
+
initialValue: false,
|
|
113
|
+
}));
|
|
114
|
+
// 8. Summary + final confirm.
|
|
115
|
+
const runProviderSetup = await confirmSummary(draft, ctx);
|
|
116
|
+
return { answers: toWizardAnswers(draft), runProviderSetup };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The preset flow: the preset fixes model/channels/memory/sandbox/observability,
|
|
120
|
+
* so we only prompt its per-module inputs, let the operator adjust tools, and
|
|
121
|
+
* confirm the summary.
|
|
122
|
+
*/
|
|
123
|
+
async function collectFromPreset(ctx, presetId) {
|
|
124
|
+
const preset = findPreset(presetId);
|
|
125
|
+
// presetSelectOptions only offers known ids; guard defensively regardless.
|
|
126
|
+
if (preset === undefined) {
|
|
127
|
+
throw new WizardCancelled();
|
|
128
|
+
}
|
|
129
|
+
p.log.step(`Preset: ${preset.title}`);
|
|
130
|
+
const draft = draftFrom(presetAnswers(preset));
|
|
131
|
+
await promptModuleInputs(draft);
|
|
132
|
+
await promptTools(draft);
|
|
133
|
+
const runProviderSetup = await confirmSummary(draft, ctx);
|
|
134
|
+
return { answers: toWizardAnswers(draft), runProviderSetup };
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Prompt every non-secret input of the selected channel + memory modules and store
|
|
138
|
+
* the answers into `draft.moduleInputs`. Secret inputs are never prompted — they
|
|
139
|
+
* only ever surface as `.env.example` placeholders.
|
|
140
|
+
*/
|
|
141
|
+
async function promptModuleInputs(draft) {
|
|
142
|
+
const moduleIds = [...draft.channels, ...(draft.memory === undefined ? [] : [draft.memory])];
|
|
143
|
+
for (const id of moduleIds) {
|
|
144
|
+
const module = findModule(id);
|
|
145
|
+
if (module === undefined) {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
for (const input of module.inputs) {
|
|
149
|
+
if (input.secret === true) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const answer = guard(await p.text({
|
|
153
|
+
message: `${module.title}: ${input.label}`,
|
|
154
|
+
placeholder: input.description,
|
|
155
|
+
...(input.default === undefined ? {} : { defaultValue: input.default }),
|
|
156
|
+
}));
|
|
157
|
+
const trimmed = answer.trim();
|
|
158
|
+
if (trimmed.length > 0) {
|
|
159
|
+
(draft.moduleInputs[module.id] ??= {})[input.id] = trimmed;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/** Short reasons annotating each always-on tool in the framing note. */
|
|
165
|
+
const ALWAYS_ON_TOOL_REASONS = {
|
|
166
|
+
MemoryRecall: "memory recall is on",
|
|
167
|
+
};
|
|
168
|
+
/** The always-on tool names annotated with their reason, e.g. `MemoryRecall (memory recall is on)`. */
|
|
169
|
+
function alwaysOnDisplay(alwaysOn) {
|
|
170
|
+
return alwaysOn.map((tool) => {
|
|
171
|
+
const reason = ALWAYS_ON_TOOL_REASONS[tool];
|
|
172
|
+
return reason === undefined ? tool : `${tool} (${reason})`;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The channel-contributed send/ask tools for the enabled channels (PascalCase),
|
|
177
|
+
* minus the channel-agnostic `AskUser` (surfaced on its own line). Reuses the
|
|
178
|
+
* multiselect option builder so the framing note can never drift from the picker.
|
|
179
|
+
*/
|
|
180
|
+
function channelSendTools(channels) {
|
|
181
|
+
return toolMultiselectOptions(channels)
|
|
182
|
+
.slice(BUILTIN_TOOL_NAMES.length)
|
|
183
|
+
.map((option) => option.value)
|
|
184
|
+
.filter((value) => value !== "AskUser");
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The three tool families, explained before the allow-all decision so the operator
|
|
188
|
+
* knows what "Allow all" turns on and what is unaffected by the choice:
|
|
189
|
+
* 1. Always on — auto-provisioned, NOT gated by this choice (e.g. MemoryRecall).
|
|
190
|
+
* 2. Built-ins — file/shell/web tools.
|
|
191
|
+
* 3. Channel tools — the send/ask tools that came with the channels you enabled,
|
|
192
|
+
* plus AskUser (ask the human, any channel).
|
|
193
|
+
*/
|
|
194
|
+
function toolSituationFraming(draft, alwaysOn) {
|
|
195
|
+
const sends = channelSendTools(draft.channels);
|
|
196
|
+
const channelLine = sends.length > 0
|
|
197
|
+
? `Channel tools (from the channels you enabled): ${sends.join(", ")}, plus AskUser (ask the human, any channel).`
|
|
198
|
+
: "Channel tools: AskUser (ask the human, any channel).";
|
|
199
|
+
return [
|
|
200
|
+
alwaysOn.length > 0
|
|
201
|
+
? `Always on (auto-provisioned, not affected by this choice): ${alwaysOnDisplay(alwaysOn).join(", ")}.`
|
|
202
|
+
: "Always on (auto-provisioned): none for this setup.",
|
|
203
|
+
"Built-ins: files (Read/Write/Edit/Glob/Grep), shell (Bash), web (WebFetch/WebSearch).",
|
|
204
|
+
channelLine,
|
|
205
|
+
'"Allow all" turns on every built-in and channel tool; you can turn specific tools off later via tools.disallowedTools.',
|
|
206
|
+
].join("\n");
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The tools step: frame the three tool families, then a single "Allow all tools?"
|
|
210
|
+
* confirm (default yes → `["*"]`). Choosing "No" drops into the specific-tool
|
|
211
|
+
* multiselect. Always-on tools (MemoryRecall/ReadSkill/MCP) are auto-provisioned and
|
|
212
|
+
* are surfaced only for clarity — never gated by this choice.
|
|
213
|
+
*/
|
|
214
|
+
async function promptTools(draft) {
|
|
215
|
+
const alwaysOn = alwaysOnTools(toWizardAnswers(draft));
|
|
216
|
+
p.note(toolSituationFraming(draft, alwaysOn), "Tools");
|
|
217
|
+
const allowAll = guard(await p.confirm({
|
|
218
|
+
message: "Allow all tools? (recommended — the model can use every built-in and your channels' tools)",
|
|
219
|
+
initialValue: true,
|
|
220
|
+
}));
|
|
221
|
+
if (allowAll) {
|
|
222
|
+
draft.allowedTools = [ALLOW_ALL_TOOLS];
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
await pickSpecificTools(draft);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The "choose specific tools" multiselect, pre-checking the recommended selection for
|
|
229
|
+
* the current capabilities. An empty selection loops back unless the operator confirms
|
|
230
|
+
* the chat-only warning. The final list is ordered by the option order so
|
|
231
|
+
* `tools.allowedTools` is deterministic regardless of toggle order.
|
|
232
|
+
*/
|
|
233
|
+
async function pickSpecificTools(draft) {
|
|
234
|
+
const options = toolMultiselectOptions(draft.channels);
|
|
235
|
+
const optionOrder = new Map(options.map((option, index) => [option.value, index]));
|
|
236
|
+
const recommended = recommendedToolSelection(toWizardAnswers(draft));
|
|
237
|
+
for (;;) {
|
|
238
|
+
const tools = guard(await p.multiselect({
|
|
239
|
+
message: "Which tools may the model call?",
|
|
240
|
+
options,
|
|
241
|
+
initialValues: [...recommended],
|
|
242
|
+
required: false,
|
|
243
|
+
}));
|
|
244
|
+
if (tools.length === 0) {
|
|
245
|
+
const proceed = guard(await p.confirm({
|
|
246
|
+
message: "⚠ Zero tools selected — the agent will be chat-only (cannot read files, run commands, or send proactively). Continue?",
|
|
247
|
+
initialValue: false,
|
|
248
|
+
}));
|
|
249
|
+
if (!proceed) {
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
draft.allowedTools = [...tools].sort((a, b) => (optionOrder.get(a) ?? 0) - (optionOrder.get(b) ?? 0));
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Render the compact plan summary and ask for the single write-time confirmation.
|
|
259
|
+
* Provider modules are implementation detail (auto-added for local models), so
|
|
260
|
+
* they are excluded from the user-facing capabilities line. A "no" cancels.
|
|
261
|
+
*/
|
|
262
|
+
async function confirmSummary(draft, ctx) {
|
|
263
|
+
if ([draft.model, ...draft.fallbackModels].some((model) => LOCAL_PROVIDER_MODEL.test(model))) {
|
|
264
|
+
p.note("A matching local provider block is added automatically.\nThe first turn may be slow while the model loads.", "Local model");
|
|
265
|
+
}
|
|
266
|
+
const answers = toWizardAnswers(draft);
|
|
267
|
+
const plan = composeWizardPlan(answers, {
|
|
268
|
+
dirBasename: basename(ctx.cwd),
|
|
269
|
+
skillsRootExists: await pathExists(join(ctx.cwd, "skills")),
|
|
270
|
+
});
|
|
271
|
+
const capabilities = plan.selectedModules
|
|
272
|
+
.filter((module) => module.kind !== "provider")
|
|
273
|
+
.map((module) => module.title);
|
|
274
|
+
const writes = ["mono-agent.config.json", "IDENTITY.md"];
|
|
275
|
+
if (plan.envExample !== undefined) {
|
|
276
|
+
writes.push(".env.example");
|
|
277
|
+
}
|
|
278
|
+
for (const file of plan.files) {
|
|
279
|
+
writes.push(file.path);
|
|
280
|
+
}
|
|
281
|
+
const secrets = plan.secrets.map((secret) => secret.envVar);
|
|
282
|
+
const toolsLine = isAllowAllTools(draft.allowedTools)
|
|
283
|
+
? "all tools"
|
|
284
|
+
: draft.allowedTools.length > 0
|
|
285
|
+
? draft.allowedTools.join(", ")
|
|
286
|
+
: "none (chat-only)";
|
|
287
|
+
const alwaysOn = alwaysOnTools(answers);
|
|
288
|
+
const lines = [
|
|
289
|
+
`Model: ${draft.model}${draft.fallbackModels.length > 0 ? ` (fallbacks: ${draft.fallbackModels.join(", ")})` : ""}`,
|
|
290
|
+
`Effort: ${draft.effort ?? "default"}`,
|
|
291
|
+
`Capabilities: ${capabilities.length > 0 ? capabilities.join(", ") : "none"}`,
|
|
292
|
+
`Tools: ${toolsLine}`,
|
|
293
|
+
...(alwaysOn.length > 0 ? [`Always on: ${alwaysOnDisplay(alwaysOn).join(", ")}`] : []),
|
|
294
|
+
`Writes: ${writes.join(", ")}`,
|
|
295
|
+
`Secrets: ${secrets.length > 0 ? `${secrets.join(", ")} → .env.example` : "none"}`,
|
|
296
|
+
];
|
|
297
|
+
p.note(lines.join("\n"), "Review");
|
|
298
|
+
const setupPlan = planProviderSetup({
|
|
299
|
+
modelRefs: [answers.model, ...answers.fallbackModels],
|
|
300
|
+
cwd: ctx.cwd,
|
|
301
|
+
...(typeof plan.configJson.providers?.piAuthPath === "string" ? { piAuthPath: plan.configJson.providers.piAuthPath } : {}),
|
|
302
|
+
});
|
|
303
|
+
let runProviderSetup = false;
|
|
304
|
+
if (setupPlan.actions.length > 0) {
|
|
305
|
+
p.note(setupPlan.actions
|
|
306
|
+
.map((action) => `${action.label}: ${providerSetupActionCommandLine(action)} (cwd: ${action.cwd})`)
|
|
307
|
+
.join("\n"), "Provider setup");
|
|
308
|
+
runProviderSetup = guard(await p.confirm({
|
|
309
|
+
message: "Run provider auth/preflight before writing files?",
|
|
310
|
+
initialValue: false,
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
if (!guard(await p.confirm({ message: "Write these files?", initialValue: true }))) {
|
|
314
|
+
throw new WizardCancelled();
|
|
315
|
+
}
|
|
316
|
+
return runProviderSetup;
|
|
317
|
+
}
|
|
318
|
+
/** Seed a mutable draft from immutable answers (defaults or a preset). */
|
|
319
|
+
function draftFrom(answers) {
|
|
320
|
+
const moduleInputs = {};
|
|
321
|
+
for (const [moduleId, values] of Object.entries(answers.moduleInputs)) {
|
|
322
|
+
const bag = {};
|
|
323
|
+
for (const [key, value] of Object.entries(values)) {
|
|
324
|
+
if (value !== undefined) {
|
|
325
|
+
bag[key] = value;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
moduleInputs[moduleId] = bag;
|
|
329
|
+
}
|
|
330
|
+
return {
|
|
331
|
+
model: answers.model,
|
|
332
|
+
fallbackModels: [...answers.fallbackModels],
|
|
333
|
+
effort: answers.effort,
|
|
334
|
+
channels: [...answers.channels],
|
|
335
|
+
memory: answers.memory,
|
|
336
|
+
sandbox: answers.sandbox,
|
|
337
|
+
observability: answers.observability,
|
|
338
|
+
allowedTools: [...answers.allowedTools],
|
|
339
|
+
moduleInputs,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Freeze a draft back into {@link WizardAnswers}. `memory` is omitted entirely when
|
|
344
|
+
* undefined (exactOptionalPropertyTypes: an optional key must be absent, not
|
|
345
|
+
* `undefined`).
|
|
346
|
+
*/
|
|
347
|
+
function toWizardAnswers(draft) {
|
|
348
|
+
return {
|
|
349
|
+
model: draft.model,
|
|
350
|
+
fallbackModels: [...draft.fallbackModels],
|
|
351
|
+
...(draft.effort === undefined ? {} : { effort: draft.effort }),
|
|
352
|
+
channels: [...draft.channels],
|
|
353
|
+
...(draft.memory === undefined ? {} : { memory: draft.memory }),
|
|
354
|
+
sandbox: draft.sandbox,
|
|
355
|
+
observability: draft.observability,
|
|
356
|
+
allowedTools: [...draft.allowedTools],
|
|
357
|
+
moduleInputs: draft.moduleInputs,
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
/** Split a comma-separated string into trimmed, non-empty entries. */
|
|
361
|
+
function splitCsv(value) {
|
|
362
|
+
return value.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
363
|
+
}
|
|
364
|
+
/** True when `path` exists (a local mirror of the CLI's private helper). */
|
|
365
|
+
async function pathExists(path) {
|
|
366
|
+
try {
|
|
367
|
+
await stat(path);
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/wizard/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,wBAAwB,GAEzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAwBjG,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AACzD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAO7D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAoB;IACtD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC;QACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,O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AC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACvE,CAAC;AAED,4EAA4E;AAC5E,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mono-agent/agent-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Config-first mono-agent host: builds a responder and starts every configured communication channel and traceability from one mono-agent.config.json.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -25,22 +25,23 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@clack/prompts": "^1.7.0",
|
|
28
29
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
29
|
-
"@mono-agent/agent-contracts": "0.
|
|
30
|
-
"@mono-agent/agent-harness": "0.
|
|
31
|
-
"@mono-agent/config": "0.
|
|
32
|
-
"@mono-agent/cron-adapter": "0.
|
|
33
|
-
"@mono-agent/operator-adapter": "0.
|
|
34
|
-
"@mono-agent/memory": "0.
|
|
35
|
-
"@mono-agent/memory-supermemory": "0.
|
|
36
|
-
"@mono-agent/observability": "0.
|
|
37
|
-
"@mono-agent/openai-api-adapter": "0.
|
|
38
|
-
"@mono-agent/runtime-adapter": "0.
|
|
39
|
-
"@mono-agent/session-web": "0.
|
|
40
|
-
"@mono-agent/slack-adapter": "0.
|
|
41
|
-
"@mono-agent/telegram-adapter": "0.
|
|
42
|
-
"@mono-agent/tui": "0.
|
|
43
|
-
"@mono-agent/webhook-adapter": "0.
|
|
30
|
+
"@mono-agent/agent-contracts": "0.6.1",
|
|
31
|
+
"@mono-agent/agent-harness": "0.6.1",
|
|
32
|
+
"@mono-agent/config": "0.6.1",
|
|
33
|
+
"@mono-agent/cron-adapter": "0.6.1",
|
|
34
|
+
"@mono-agent/operator-adapter": "0.6.1",
|
|
35
|
+
"@mono-agent/memory": "0.6.1",
|
|
36
|
+
"@mono-agent/memory-supermemory": "0.6.1",
|
|
37
|
+
"@mono-agent/observability": "0.6.1",
|
|
38
|
+
"@mono-agent/openai-api-adapter": "0.6.1",
|
|
39
|
+
"@mono-agent/runtime-adapter": "0.6.1",
|
|
40
|
+
"@mono-agent/session-web": "0.6.1",
|
|
41
|
+
"@mono-agent/slack-adapter": "0.6.1",
|
|
42
|
+
"@mono-agent/telegram-adapter": "0.6.1",
|
|
43
|
+
"@mono-agent/tui": "0.6.1",
|
|
44
|
+
"@mono-agent/webhook-adapter": "0.6.1",
|
|
44
45
|
"zod": "^4.4.3"
|
|
45
46
|
},
|
|
46
47
|
"publishConfig": {
|
|
@@ -482,7 +482,9 @@
|
|
|
482
482
|
"items": {
|
|
483
483
|
"type": "string"
|
|
484
484
|
},
|
|
485
|
-
"default": [
|
|
485
|
+
"default": [
|
|
486
|
+
"*"
|
|
487
|
+
]
|
|
486
488
|
},
|
|
487
489
|
"disallowedTools": {
|
|
488
490
|
"description": "Configures disallowedTools for the tools section.",
|
|
@@ -819,7 +821,7 @@
|
|
|
819
821
|
"additionalProperties": false,
|
|
820
822
|
"properties": {
|
|
821
823
|
"host": {
|
|
822
|
-
"description": "Loopback host for the app-owned
|
|
824
|
+
"description": "Loopback host for the app-owned AskUser/tool-progress bridge.",
|
|
823
825
|
"examples": [
|
|
824
826
|
"127.0.0.1"
|
|
825
827
|
],
|
|
@@ -841,7 +843,7 @@
|
|
|
841
843
|
"additionalProperties": false,
|
|
842
844
|
"properties": {
|
|
843
845
|
"timeoutMs": {
|
|
844
|
-
"description": "Maximum wait for one
|
|
846
|
+
"description": "Maximum wait for one AskUser question.",
|
|
845
847
|
"examples": [
|
|
846
848
|
600000
|
|
847
849
|
],
|
|
@@ -59,23 +59,23 @@ Everything below runs in the user's agent folder, not the workspace.
|
|
|
59
59
|
|
|
60
60
|
## Composition Flow
|
|
61
61
|
|
|
62
|
-
1. **Discover.** Read `references/discovery-questions.md` and resolve: runtime model + backup models, channels, identity/knowledge, skills, tools/MCP, memory strategy, sandbox, observability, and the acceptance smoke test. Then run `mono-agent
|
|
63
|
-
2. **Scaffold.** In the user's folder, prefer the
|
|
62
|
+
1. **Discover.** Read `references/discovery-questions.md` and resolve: runtime model + backup models, channels, identity/knowledge, skills, tools/MCP, memory strategy, sandbox, observability, and the acceptance smoke test. Then run `mono-agent presets list` (and `mono-agent presets show <id>`) for a saved answer-set matching the user's intent; `references/playbooks.md` is the prose companion. If a preset fits, use it as the starting shape. The six presets are `starter`, `telegram-assistant`, `telegram-supermemory`, `slack-bot`, `local-private`, and `code-sandbox`; shapes with no preset (an OpenAI-API gateway, cron digest, A2A provider, Phoenix-observed, or a full multi-channel build) are hand-assembled from the capability modules and playbooks.
|
|
63
|
+
2. **Scaffold.** In the user's folder, prefer the preset path when one fits — scaffold non-interactively with `--yes` (the composer is not the interactive `init` wizard):
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
mono-agent init --
|
|
67
|
-
mono-agent init --model <ref> [--fallback-models <csv>] [--memory lite|journal|bujo] # bare scaffold
|
|
66
|
+
mono-agent init --preset <id> --yes [--with slack,cron] [--effort high] [--auth] [--dry-run] # preset + .env.example + checklist
|
|
67
|
+
mono-agent init --model <ref> [--fallback-models <csv>] [--effort <level>] [--auth] [--memory lite|journal|bujo] # bare scaffold
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
Either writes a `mono-agent.config.json
|
|
70
|
+
Either writes a `mono-agent.config.json` (with `tools.allowedTools` pre-filled from the selected capabilities' recommended tools), an `IDENTITY.md` that references any knowledge files already present, and `.mono-agent/` working directories (presets also emit a `.env.example` and any extra files). `--effort` writes `runtime.effort`; `--auth` opts in to provider setup before writing files; `--dry-run` previews without writing or launching auth/preflight commands. It never overwrites existing files.
|
|
71
71
|
3. **Configure.** Edit `mono-agent.config.json` to match the discovery answers. Read `references/config-blueprint.md` for the full annotated config shape: every channel section, skills, MCP, memory, sandbox, and fallback models. Run `mono-agent config` to see the resolved configuration field-by-field with each value tagged `env` / `json` / `default` — the fastest way to confirm a value came from where you intended.
|
|
72
72
|
4. **Validate.**
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
mono-agent validate [--
|
|
75
|
+
mono-agent validate [--preset <id>] [--consumer <path>]
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Fix every `[error]` section. `[waiting]` channels are fine — they are simply not configured yet. With `--
|
|
78
|
+
Fix every `[error]` section. `[waiting]` channels are fine — they are simply not configured yet. Watch the **Tools & MCP** section: allow-all (the default) shows `All tools allowed`, an **explicit empty** `tools.allowedTools: []` reports `waiting` (the no-tools trap), and an unknown tool name in a specific allowlist is flagged with a "did you mean" hint. With `--preset`, the report also flags any capability the preset promised that is not yet live. Re-run until the report says the config is ready.
|
|
79
79
|
5. **Start and smoke.**
|
|
80
80
|
|
|
81
81
|
```bash
|
|
@@ -93,7 +93,7 @@ Config-first covers one responder served over any combination of the seven chann
|
|
|
93
93
|
- `references/discovery-questions.md` — the question sequence and which config keys each answer fills.
|
|
94
94
|
- `references/config-blueprint.md` — annotated `mono-agent.config.json` covering every section, plus the folder layout and programmatic escape hatch.
|
|
95
95
|
- `references/feature-coverage.md` — every framework feature mapped to config / CLI / code / dev-tooling coverage; the answer to "can the config do X?".
|
|
96
|
-
- `references/playbooks.md` — end-to-end recipes (persona → config block → `init`/`validate`/`start`/smoke). Check for a matching
|
|
96
|
+
- `references/playbooks.md` — end-to-end recipes (persona → config block → `init`/`validate`/`start`/smoke). Check for a matching preset or playbook before hand-assembling a config.
|
|
97
97
|
- `references/package-map.md` — which package owns what, for programmatic composition and troubleshooting.
|
|
98
98
|
- `references/validation.md` — validation commands and per-channel smoke tests; read before claiming the agent works.
|
|
99
99
|
|
|
@@ -103,10 +103,10 @@ my-agent/
|
|
|
103
103
|
"consolidation": { "enabled": true, "cron": "0 */2 * * *" } // default: every two hours
|
|
104
104
|
},
|
|
105
105
|
|
|
106
|
-
//
|
|
106
|
+
// Tool policy (allow-all by default) + MCP servers. Deny wins; overlap is rejected.
|
|
107
107
|
"tools": {
|
|
108
|
-
"allowedTools": ["
|
|
109
|
-
"disallowedTools": ["Bash"],
|
|
108
|
+
"allowedTools": ["*"], // omit or ["*"] = all tools; ["Read","Bash"] = just those; [] = none (chat-only)
|
|
109
|
+
"disallowedTools": ["Bash"], // deny wins even under allow-all; the escape hatch to subtract one tool
|
|
110
110
|
"mcpConfigPath": "./mcp.json" // stdio/sse/http servers; inlined for SDK runtimes
|
|
111
111
|
},
|
|
112
112
|
|
|
@@ -278,12 +278,12 @@ my-agent/
|
|
|
278
278
|
## Lifecycle
|
|
279
279
|
|
|
280
280
|
```bash
|
|
281
|
-
mono-agent
|
|
282
|
-
mono-agent
|
|
283
|
-
mono-agent init --
|
|
281
|
+
mono-agent presets list # saved answer-sets (id, risk, description)
|
|
282
|
+
mono-agent presets show <id> # generated config + .env.example + follow-up checklist
|
|
283
|
+
mono-agent init --preset <id> --yes [--with slack,cron] [--dry-run] # scaffold from a preset (non-interactive)
|
|
284
284
|
mono-agent init --model claude:claude-sonnet-4-6 --fallback-models pi:ollama:gemma4:31b [--memory lite|journal|bujo]
|
|
285
285
|
mono-agent config # resolved config field-by-field, each value tagged env/json/default
|
|
286
|
-
mono-agent validate [--
|
|
286
|
+
mono-agent validate [--preset <id>] [--consumer <path>] # per-section report; --preset also checks the preset's capabilities
|
|
287
287
|
mono-agent start # traceability + every configured channel
|
|
288
288
|
mono-agent restart # apply config edits (config is JSON-first; restart to re-apply)
|
|
289
289
|
mono-agent restart --force # restart AND purge persisted pi sessions (fresh start; durable memory kept)
|
|
@@ -10,14 +10,15 @@ Question:
|
|
|
10
10
|
Which model should drive the agent, and should any backups take over when the provider fails?
|
|
11
11
|
|
|
12
12
|
1. `claude:<model>` through SDK or CLI mode
|
|
13
|
-
2. `codex:<model>` through
|
|
14
|
-
3. `
|
|
15
|
-
4.
|
|
13
|
+
2. `pi:openai-codex:<model>` through SDK mode (preferred over direct Codex when Pi auth is configured)
|
|
14
|
+
3. `codex:<model>` through CLI mode (direct Codex fallback path)
|
|
15
|
+
4. `pi:<provider>:<model>` through SDK mode (OpenAI, Copilot, OpenRouter, OpenCode-through-Pi, local Ollama, LM Studio, ...)
|
|
16
|
+
5. A custom MonoRuntimeLike supplied programmatically (escape hatch)
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
Fills: `runtime.model`, `runtime.fallbackModels` (ordered backup references tried on retryable provider failures), `runtime.executionMode` (usually inferred), `runtime.effort`, `runtime.maxTurns`.
|
|
19
20
|
|
|
20
|
-
For local models also fill `providers.local` (e.g. an Ollama base URL plus model capabilities). Follow-up only if needed: continuous provider session per conversation (`runtime.session.mode: "continuous"`, default) versus stateless per-message.
|
|
21
|
+
The interactive `mono-agent init` wizard discovers Pi OpenAI-Codex auth, OpenCode models, Ollama models, and LM Studio's local server best-effort. It ranks discovered `pi:openai-codex:gpt-5.5` above direct `codex:gpt-5.5`, maps discovered OpenCode options to `pi:opencode-go:<model>` for setup/preflight, and auto-adds local provider modules when a primary or fallback model uses `pi:ollama:*` or `pi:lmstudio:*`. Direct `opencode:<provider>:<model>` refs are supported only as hand-authored runtime backend config; do not present them as a first-class composer or init wizard selection. For local models also fill `providers.local` (e.g. an Ollama or LM Studio base URL plus model capabilities). Follow-up only if needed: continuous provider session per conversation (`runtime.session.mode: "continuous"`, default) versus stateless per-message.
|
|
21
22
|
|
|
22
23
|
## 2. Channels Of Communication
|
|
23
24
|
|
|
@@ -66,15 +67,17 @@ Fills: `context.skillsRoot`, `context.selectedSkills`, optionally `context.skill
|
|
|
66
67
|
Question:
|
|
67
68
|
|
|
68
69
|
```text
|
|
69
|
-
What tools
|
|
70
|
+
What tools does the agent need?
|
|
70
71
|
|
|
71
|
-
1.
|
|
72
|
-
2.
|
|
73
|
-
3.
|
|
74
|
-
4.
|
|
72
|
+
1. Allow all tools (recommended — the default: every built-in + enabled channels' send tools)
|
|
73
|
+
2. Allow all, but deny a few by name (tools.disallowedTools)
|
|
74
|
+
3. A specific allowlist of built-in / channel tools
|
|
75
|
+
4. Chat-only, no tools (explicit tools.allowedTools: [])
|
|
76
|
+
|
|
77
|
+
Plus, independently: MCP servers from an mcp.json config file?
|
|
75
78
|
```
|
|
76
79
|
|
|
77
|
-
Fills: `tools.allowedTools`, `tools.disallowedTools` (denylist wins), `tools.mcpConfigPath`.
|
|
80
|
+
Fills: `tools.allowedTools`, `tools.disallowedTools` (denylist wins, even under allow-all), `tools.mcpConfigPath`. The default is allow-all (`["*"]`) — write that unless the user asks to narrow. Under allow-all the adapter-derived send tools (`SlackSendMessage` / `TelegramSendMessage` / …) are auto-available once the channel is enabled; only a **specific** allowlist needs their exact names added. Valid enabled Slack/Telegram adapter config and destination allowlists are required either way. On the pi-native runtime `disallowedTools` does not filter external MCP-server tools — to withhold one, don't declare its server.
|
|
78
81
|
|
|
79
82
|
## 6. Memory Strategy
|
|
80
83
|
|