@mono-agent/agent-app 0.1.0 → 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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { isAppCoreConfigError, loadAppCoreConfig, MONO_AGENT_APP_FIELD_GROUPS, resolveAppArtifactDir, resolveAppTraceHeartbeatMs, resolveAppTraceRegistryDir, resolveAppTraceSourceId, resolveAppTraceSourceLabel, resolveAppTraceStaleAfterMs, } from "./app-config.js";
2
- export type { AppTraceDefaults, MonoAgentAppConfigInput } from "./app-config.js";
1
+ export { consoleFieldGroup, isAppCoreConfigError, loadAppCoreConfig, MONO_AGENT_APP_FIELD_GROUPS, resolveAppArtifactDir, resolveAppConsoleSettings, resolveAppTraceHeartbeatMs, resolveAppTraceRegistryDir, resolveAppTraceSourceId, resolveAppTraceSourceLabel, resolveAppTraceStaleAfterMs, } from "./app-config.js";
2
+ export type { AppConsoleSettings, AppTraceDefaults, MonoAgentAppConfigInput } from "./app-config.js";
3
3
  export { createA2AChannelDriver, createCronChannelDriver, createOpenAIApiChannelDriver, createSlackChannelDriver, createTelegramChannelDriver, createWebhookChannelDriver, createWhatsAppChannelDriver, defaultChannelDrivers, } from "./channels.js";
4
4
  export type { A2AChannelOverrides, ChannelDriver, ChannelDriverOverrides, ChannelId, ChannelStartInput, ChannelStatus, CronChannelOverrides, MonoAgentAppLogger, OpenAIApiChannelOverrides, RunningChannel, SlackChannelOverrides, TelegramChannelOverrides, TelegramPollerLike, WebhookChannelOverrides, WhatsAppChannelOverrides, } from "./channels.js";
5
5
  export { startMonoAgentApp } from "./app.js";
@@ -8,5 +8,7 @@ export { initMonoAgentFolder } from "./init.js";
8
8
  export type { InitMonoAgentFolderOptions, InitMonoAgentFolderResult } from "./init.js";
9
9
  export { validateMonoAgentFolder } from "./doctor.js";
10
10
  export type { ValidateMonoAgentFolderOptions, ValidationReport, ValidationSection, ValidationStatus, } from "./doctor.js";
11
- export { parseCliArgs, runCli } from "./cli.js";
11
+ export { parseCliArgs, runCli, loadCliEnvFile } from "./cli.js";
12
+ export { COMPOSER_SKILL_NAME, installComposerSkill } from "./install-skill.js";
13
+ export type { InstallSkillOptions, InstallSkillResult, InstallSkillTarget } from "./install-skill.js";
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EACV,YAAY,EACZ,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC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,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- export { isAppCoreConfigError, loadAppCoreConfig, MONO_AGENT_APP_FIELD_GROUPS, resolveAppArtifactDir, resolveAppTraceHeartbeatMs, resolveAppTraceRegistryDir, resolveAppTraceSourceId, resolveAppTraceSourceLabel, resolveAppTraceStaleAfterMs, } from "./app-config.js";
1
+ export { consoleFieldGroup, isAppCoreConfigError, loadAppCoreConfig, MONO_AGENT_APP_FIELD_GROUPS, resolveAppArtifactDir, resolveAppConsoleSettings, resolveAppTraceHeartbeatMs, resolveAppTraceRegistryDir, resolveAppTraceSourceId, resolveAppTraceSourceLabel, resolveAppTraceStaleAfterMs, } from "./app-config.js";
2
2
  export { createA2AChannelDriver, createCronChannelDriver, createOpenAIApiChannelDriver, createSlackChannelDriver, createTelegramChannelDriver, createWebhookChannelDriver, createWhatsAppChannelDriver, defaultChannelDrivers, } from "./channels.js";
3
3
  export { startMonoAgentApp } from "./app.js";
4
4
  export { initMonoAgentFolder } from "./init.js";
5
5
  export { validateMonoAgentFolder } from "./doctor.js";
6
- export { parseCliArgs, runCli } from "./cli.js";
6
+ export { parseCliArgs, runCli, loadCliEnvFile } from "./cli.js";
7
+ export { COMPOSER_SKILL_NAME, installComposerSkill } from "./install-skill.js";
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iB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"}
@@ -0,0 +1,21 @@
1
+ export type InstallSkillTarget = "claude" | "codex" | "both";
2
+ export interface InstallSkillOptions {
3
+ readonly target: InstallSkillTarget;
4
+ /** Overwrite an existing installed copy instead of refusing. */
5
+ readonly force: boolean;
6
+ /** Test injection; defaults to os.homedir(). */
7
+ readonly homeDir?: string;
8
+ /** Test injection; defaults to the skill bundled with this package. */
9
+ readonly sourceDir?: string;
10
+ }
11
+ export interface InstallSkillResult {
12
+ readonly installed: readonly string[];
13
+ }
14
+ export declare const COMPOSER_SKILL_NAME = "mono-agent-composer";
15
+ /**
16
+ * Copies the bundled mono-agent-composer skill into the harness skill folders
17
+ * (~/.claude/skills and/or ~/.codex/skills) so Claude Code and Codex can use
18
+ * it to compose new agents.
19
+ */
20
+ export declare function installComposerSkill(options: InstallSkillOptions): Promise<InstallSkillResult>;
21
+ //# sourceMappingURL=install-skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-skill.d.ts","sourceRoot":"","sources":["../src/install-skill.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAWzD;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsBpG"}
@@ -0,0 +1,52 @@
1
+ import { cp, stat } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ export const COMPOSER_SKILL_NAME = "mono-agent-composer";
6
+ // dist/install-skill.js and src/install-skill.ts both sit one level below the
7
+ // package root, so ../skills resolves to the bundled skills folder either way.
8
+ const BUNDLED_SKILL_DIR = fileURLToPath(new URL(`../skills/${COMPOSER_SKILL_NAME}`, import.meta.url));
9
+ const TARGET_HARNESS_DIRS = {
10
+ claude: ".claude",
11
+ codex: ".codex",
12
+ };
13
+ /**
14
+ * Copies the bundled mono-agent-composer skill into the harness skill folders
15
+ * (~/.claude/skills and/or ~/.codex/skills) so Claude Code and Codex can use
16
+ * it to compose new agents.
17
+ */
18
+ export async function installComposerSkill(options) {
19
+ const sourceDir = options.sourceDir ?? BUNDLED_SKILL_DIR;
20
+ await assertSkillSource(sourceDir);
21
+ const home = options.homeDir ?? homedir();
22
+ const targets = options.target === "both" ? ["claude", "codex"] : [options.target];
23
+ const destinations = targets.map((target) => join(home, TARGET_HARNESS_DIRS[target], "skills", COMPOSER_SKILL_NAME));
24
+ if (!options.force) {
25
+ for (const destination of destinations) {
26
+ if (await pathExists(destination)) {
27
+ throw new Error(`Destination ${destination} already exists. Re-run with --force to overwrite.`);
28
+ }
29
+ }
30
+ }
31
+ const installed = [];
32
+ for (const destination of destinations) {
33
+ await cp(sourceDir, destination, { recursive: true, force: true });
34
+ installed.push(destination);
35
+ }
36
+ return { installed };
37
+ }
38
+ async function assertSkillSource(sourceDir) {
39
+ if (!(await pathExists(join(sourceDir, "SKILL.md")))) {
40
+ throw new Error(`Bundled skill is missing SKILL.md at ${sourceDir}; the package looks broken.`);
41
+ }
42
+ }
43
+ async function pathExists(path) {
44
+ try {
45
+ await stat(path);
46
+ return true;
47
+ }
48
+ catch {
49
+ return false;
50
+ }
51
+ }
52
+ //# sourceMappingURL=install-skill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-skill.js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YACvC,IAAI,MAAM,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,eAAe,WAAW,oDAAoD,CAAC,CAAC;YAClG,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACnE,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,SAAiB;IAChD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,wCAAwC,SAAS,6BAA6B,CAAC,CAAC;IAClG,CAAC;AACH,CAAC;AAED,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.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Config-first mono-agent host: builds a responder and starts every configured communication channel, operator console, and traceability from one mono-agent.config.json.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -18,23 +18,24 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
+ "skills",
21
22
  "README.md"
22
23
  ],
23
24
  "dependencies": {
24
- "@mono-agent/a2a-adapter": "0.1.0",
25
- "@mono-agent/agent-contracts": "0.1.0",
26
- "@mono-agent/agent-host": "0.1.0",
27
- "@mono-agent/config": "0.1.0",
28
- "@mono-agent/cron-adapter": "0.1.0",
29
- "@mono-agent/observability": "0.1.0",
30
- "@mono-agent/openai-api-adapter": "0.1.0",
31
- "@mono-agent/operator-console": "0.1.0",
32
- "@mono-agent/runtime-adapter": "0.1.0",
33
- "@mono-agent/settings": "0.1.0",
34
- "@mono-agent/slack-adapter": "0.1.0",
35
- "@mono-agent/telegram-adapter": "0.1.0",
36
- "@mono-agent/webhook-adapter": "0.1.0",
37
- "@mono-agent/whatsapp-adapter": "0.1.0"
25
+ "@mono-agent/a2a-adapter": "0.2.0",
26
+ "@mono-agent/agent-contracts": "0.2.0",
27
+ "@mono-agent/agent-host": "0.2.0",
28
+ "@mono-agent/config": "0.2.0",
29
+ "@mono-agent/cron-adapter": "0.2.0",
30
+ "@mono-agent/observability": "0.2.0",
31
+ "@mono-agent/openai-api-adapter": "0.2.0",
32
+ "@mono-agent/operator-console": "0.2.0",
33
+ "@mono-agent/runtime-adapter": "0.2.0",
34
+ "@mono-agent/settings": "0.2.0",
35
+ "@mono-agent/slack-adapter": "0.2.0",
36
+ "@mono-agent/telegram-adapter": "0.2.0",
37
+ "@mono-agent/webhook-adapter": "0.2.0",
38
+ "@mono-agent/whatsapp-adapter": "0.2.0"
38
39
  },
39
40
  "publishConfig": {
40
41
  "access": "public"
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: mono-agent-composer
3
+ description: Construct a working mono-agent in the current folder from one mono-agent.config.json — discover the desired runtime (with backup models), channels, skills, MCP servers, memory strategy, and sandbox, then init, validate, and start it with the mono-agent CLI. Use when a user wants to build, configure, or troubleshoot an agent built from @mono-agent packages.
4
+ ---
5
+
6
+ # Mono Agent Composer
7
+
8
+ Construct a working mono-agent in the user's current folder — empty or already holding knowledge — from one `mono-agent.config.json`. Discover what the user wants (runtime with backup models, communication channels incl. crons and webhooks, skills, MCP servers, memory strategy incl. semantic search, sandbox, operator console, observability), write the config, then make it run with the `mono-agent` CLI. No hand-written host code unless the user genuinely needs programmatic composition. `references/feature-coverage.md` maps every framework feature to a config key, CLI flag, or the programmatic escape hatch — consult it before declaring anything impossible or inventing keys.
9
+
10
+ ## Operating Rules
11
+
12
+ - The deliverable is a folder that works: `mono-agent.config.json` + `IDENTITY.md` (+ optional `skills/`, `mcp.json`), validated and started — not a tutorial.
13
+ - Start by discovering the intended agent product, not by naming packages.
14
+ - Ask one question at a time; skip anything the user already answered.
15
+ - Respect existing knowledge: if the folder has `AGENTS.md`, `CLAUDE.md`, `README.md`, or an existing `IDENTITY.md`, reference it from the identity instead of replacing it. Never overwrite existing files.
16
+ - Fail closed: no allowed tools, no memory writes, loopback-only network until the user opts in.
17
+ - Do not fake runtime success, silently broaden tool access, or hide provider/MCP failures. Backup models are configured failover (`runtime.fallbackModels`), never silent substitution.
18
+ - Secrets stay in env vars or the untracked config file; never commit tokens or `.env*` files.
19
+
20
+ ## Prerequisites
21
+
22
+ The `mono-agent` CLI ships with `@mono-agent/agent-app` on npm:
23
+
24
+ ```bash
25
+ npm install -g @mono-agent/agent-app # or: npx @mono-agent/agent-app …
26
+ ```
27
+
28
+ To run an unreleased build instead, use a clone of the mono-agent workspace:
29
+
30
+ ```bash
31
+ git clone <mono-agent-repo> ~/mono-agent && cd ~/mono-agent
32
+ corepack enable && pnpm install --frozen-lockfile && pnpm run build
33
+ alias mono-agent="node ~/mono-agent/packages/agent-app/dist/cli.js"
34
+ ```
35
+
36
+ Everything below runs in the user's agent folder, not the workspace.
37
+
38
+ ## Composition Flow
39
+
40
+ 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.
41
+ 2. **Scaffold.** In the user's folder run:
42
+
43
+ ```bash
44
+ mono-agent init --model <ref> [--fallback-models <csv>] [--memory markdown|journal]
45
+ ```
46
+
47
+ This writes a minimal `mono-agent.config.json` (webhook enabled as the zero-credential smoke channel), an `IDENTITY.md` that references any knowledge files already present, and `.mono-agent/` working directories. It never overwrites existing files.
48
+ 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.
49
+ 4. **Validate.**
50
+
51
+ ```bash
52
+ mono-agent validate
53
+ ```
54
+
55
+ Fix every `[error]` section. `[waiting]` channels are fine — they are simply not configured yet. Re-run until the report says the config is ready.
56
+ 5. **Start and smoke.**
57
+
58
+ ```bash
59
+ mono-agent start
60
+ ```
61
+
62
+ Then run the acceptance smoke test matching the chosen channel (see `references/validation.md`). The operator console URL printed at start lets the user edit config in the browser; saves re-apply live.
63
+
64
+ ## When Config Is Not Enough
65
+
66
+ Config-first covers one responder served over any combination of the seven channels (webhook, OpenAI-compatible API, Telegram, Slack, WhatsApp, A2A, cron) plus the operator console, sandbox, memory (markdown or journal with entity graph and optional semantic search), and traceability. Drop to programmatic composition only for: custom runtimes (`MonoRuntimeLike`, incl. the OpenAI Agents SDK), request-scoped runtime extensions, tool approval gates, structured output schemas, multi-agent orchestration (`@mono-agent/agent-orchestrator`), custom channel message texts, or bespoke transports — `references/feature-coverage.md` lists which features are config keys and which are code-only. Read `references/package-map.md` for the package boundaries, and start from `startMonoAgentApp({ drivers, runtime, ... })` or `@mono-agent/agent-host` rather than re-writing lifecycle glue. For eval suites over the composed agent, use `@mono-agent/agent-evals`.
67
+
68
+ ## Implementation References
69
+
70
+ - `references/discovery-questions.md` — the question sequence and which config keys each answer fills.
71
+ - `references/config-blueprint.md` — annotated `mono-agent.config.json` covering every section, plus the folder layout and programmatic escape hatch.
72
+ - `references/feature-coverage.md` — every framework feature mapped to config / CLI / code / dev-tooling coverage; the answer to "can the config do X?".
73
+ - `references/package-map.md` — which package owns what, for programmatic composition and troubleshooting.
74
+ - `references/validation.md` — validation commands and per-channel smoke tests; read before claiming the agent works.
75
+
76
+ ## Done Criteria
77
+
78
+ - `mono-agent validate` exits 0 in the user's folder.
79
+ - `mono-agent start` runs, and the chosen channel's smoke test passed with a real response from the configured runtime.
80
+ - The config file matches what the user asked for: model + backups, channels, skills, MCP, memory, sandbox.
81
+ - Existing knowledge files are referenced, not duplicated or overwritten.
82
+ - No secrets are committed.
@@ -0,0 +1,233 @@
1
+ # Config Blueprint
2
+
3
+ One `mono-agent.config.json` declares the whole agent. Paths are relative to the folder; every field also has a `MONO_AGENT_*` env var that overrides it (env > JSON > defaults). Omit a section to leave that capability off — every section except `runtime.model` and `context.identityPath` is optional. `references/feature-coverage.md` maps every framework feature to its config key; if a capability is not listed there, it needs the programmatic escape hatch.
4
+
5
+ ## Folder Layout
6
+
7
+ ```text
8
+ my-agent/
9
+ mono-agent.config.json # the single declaration below
10
+ IDENTITY.md # role, boundaries, references to existing knowledge
11
+ skills/ # optional: <skill-name>/SKILL.md per selected skill
12
+ mcp.json # optional: MCP server definitions
13
+ .env # optional: secrets; auto-loaded by the CLI, never committed
14
+ .mono-agent/
15
+ artifacts/ # JSONL run summaries + events
16
+ workspace/ # runtime working directory (if not ".")
17
+ memory/ # journal memory root (daily notes, graph.jsonl, index/)
18
+ whatsapp-auth/ # Baileys auth state (WhatsApp channel only)
19
+ trace-sources/ # traceability registry (if kept folder-local)
20
+ ```
21
+
22
+ ## Annotated Config
23
+
24
+ ```jsonc
25
+ {
26
+ // Runtime: primary model plus ordered backups tried on retryable provider
27
+ // failures (failover is reported in run results, never silent).
28
+ "runtime": {
29
+ "model": "claude:claude-sonnet-4-6", // claude:* | codex:* | pi:<provider>:<model>
30
+ "fallbackModels": ["pi:ollama:gemma4:31b"],
31
+ "executionMode": "sdk", // sdk | cli (default inferred from model)
32
+ "effort": "medium", // none|low|medium|high|xhigh|max
33
+ "permissionMode": "default", // default|plan|acceptEdits|bypassPermissions (CLI backends)
34
+ "reasoningSummary": "auto", // auto|concise|detailed|off|on
35
+ "maxTurns": 8, // 1-100
36
+ "workspace": ".",
37
+ "session": { "mode": "continuous", "idleTimeoutMs": 1800000 } // or "per-message"
38
+ },
39
+
40
+ // Local/self-hosted providers for pi:<provider>:<model> references.
41
+ "providers": {
42
+ "piAuthPath": "~/.pi/agent/auth.json", // Pi OAuth credentials (openai-codex, ...)
43
+ "local": [
44
+ {
45
+ "id": "ollama",
46
+ "type": "ollama", // ollama | lmstudio | openai_compat
47
+ "baseUrl": "http://localhost:11434",
48
+ "enabled": true,
49
+ "trustPublicUrl": false, // explicit opt-in for non-private URLs
50
+ "apiKeyEnv": "MY_PROVIDER_KEY", // or inline "apiKey" (untracked file only)
51
+ "models": [{ "name": "gemma4:31b", "capabilities": { "context_window": 32768 } }]
52
+ }
53
+ ]
54
+ },
55
+
56
+ // Identity, optional soul, and selected skills.
57
+ "context": {
58
+ "identityPath": "./IDENTITY.md",
59
+ "soulPath": "./SOUL.md",
60
+ "skillsRoot": "./skills",
61
+ "selectedSkills": ["research"], // exact names; no auto-selection
62
+ "skillMaxBytes": 48000 // per-skill byte cap (256-1,000,000)
63
+ },
64
+
65
+ // Memory strategy. Omit the section for no memory.
66
+ "memory": {
67
+ "mode": "journal", // markdown | journal
68
+ "path": "./.mono-agent/memory", // file for markdown, root dir for journal
69
+ "writeMode": "append-host-summary", // disabled | append-host-summary
70
+ "scope": "single-file", // markdown only: single-file | per-conversation
71
+ "maxBytes": 64000,
72
+ "tools": { "enabled": true, "allowJournalAppend": true }, // journal only: MCP recall tools
73
+ "graphPath": "./.mono-agent/memory/graph.jsonl", // journal only; this is the default
74
+ "embeddings": { // optional: semantic memory_search
75
+ "provider": "ollama", // ollama | openai
76
+ "model": "nomic-embed-text", // default per provider
77
+ "endpoint": "http://localhost:11434",
78
+ "apiKeyEnv": "OPENAI_API_KEY" // or inline "apiKey"; required for openai
79
+ }
80
+ },
81
+
82
+ // Fail-closed tool policy + MCP servers. Deny wins; overlap is rejected.
83
+ "tools": {
84
+ "allowedTools": ["Read", "Grep"], // built-ins: Read, Write, Edit, Glob, Grep, Bash, WebFetch, WebSearch
85
+ "disallowedTools": ["Bash"],
86
+ "mcpConfigPath": "./mcp.json" // stdio/sse/http servers; inlined for SDK runtimes
87
+ },
88
+
89
+ // Sandbox for runtime commands. Omit for no sandboxing.
90
+ "sandbox": {
91
+ "mode": "native", // native (srt-wrapped) | off
92
+ "network": { "mode": "none", "allowlist": [] }, // none|localhost|allowlist|all; *.suffix wildcards
93
+ "readableRoots": ["."], // relative entries resolve against the workspace
94
+ "writableRoots": ["."],
95
+ "denyWrite": [".env", ".env.*", ".git/config", ".git/hooks/**"], // these are the defaults
96
+ "fallback": "fail-closed", // fail-closed | unsafe-host-process
97
+ "unsafeAllowHostProcess": false // explicit opt-in required for the unsafe fallback
98
+ },
99
+
100
+ // Observability: JSONL artifacts + the trace-source registry dashboards read.
101
+ "artifacts": { "dir": "./.mono-agent/artifacts" },
102
+ "traceability": {
103
+ "registryDir": "./.mono-agent/trace-sources",
104
+ "sourceId": "my-agent",
105
+ "sourceLabel": "My Agent",
106
+ "heartbeatMs": 10000,
107
+ "staleAfterMs": 30000
108
+ },
109
+
110
+ // Local operator console (browser settings + traceability). On by default.
111
+ "console": {
112
+ "enabled": true,
113
+ "port": 0 // 0 or omitted picks a free loopback port
114
+ },
115
+
116
+ // ----- Channels: one section per channel; all independent. An unconfigured
117
+ // ----- channel reports waiting_for_config and never blocks the others.
118
+
119
+ "webhook": {
120
+ "enabled": true,
121
+ "host": "127.0.0.1", // loopback-only unless allowNonLoopback
122
+ "port": 0, // 0 picks a free port
123
+ "path": "/webhook/invoke",
124
+ "allowNonLoopback": false,
125
+ "defaultMode": "sync", // sync | async (202 + status URL polling)
126
+ "retentionMs": 300000, // async status retention
127
+ "maxStoredRequests": 100
128
+ },
129
+
130
+ "openaiApi": {
131
+ "enabled": true,
132
+ "host": "127.0.0.1",
133
+ "port": 4040,
134
+ "basePath": "/v1", // serves /v1/models + /v1/chat/completions (SSE)
135
+ "allowNonLoopback": false,
136
+ "modelId": "my-agent", // model id advertised to API clients
137
+ "apiKey": "..." // optional bearer required from clients
138
+ },
139
+
140
+ "telegram": {
141
+ "botToken": "...",
142
+ "allowedChatIds": ["123456789"], // or "allowAllChats": true
143
+ "allowAllChats": false
144
+ },
145
+
146
+ "slack": {
147
+ "botToken": "xoxb-...", // Socket Mode app
148
+ "appToken": "xapp-...",
149
+ "allowedChannelIds": ["C0123"], // or "allowAllChannels": true
150
+ "allowAllChannels": false,
151
+ "botUserIds": ["U0BOT"], // mention detection
152
+ "mentionTextAliases": ["@agent"],
153
+ "stripMentionText": true
154
+ },
155
+
156
+ "whatsapp": {
157
+ "allowedChatJids": ["123@s.whatsapp.net"], // or "allowAllChats": true
158
+ "allowAllChats": false,
159
+ "groupMode": "mention", // mention | any (group trigger rule)
160
+ "botJids": ["456@s.whatsapp.net"],
161
+ "mentionTextAliases": ["@agent"],
162
+ "stripMentionText": true
163
+ // Baileys auth state lives in .mono-agent/whatsapp-auth; the start log
164
+ // prints a QR code to scan on first login.
165
+ },
166
+
167
+ "a2a": {
168
+ "provider": {
169
+ "enabled": true,
170
+ "host": "127.0.0.1",
171
+ "port": 4201,
172
+ "publicBaseUrl": "https://agent.example.com", // Agent Card URL when fronted by a proxy
173
+ "allowNonLoopback": false,
174
+ "requireBearer": false,
175
+ "bearerToken": "..."
176
+ },
177
+ "agent": { "name": "My Agent", "description": "What it does.", "version": "0.1.0" },
178
+ "skill": { "id": "main", "name": "Main", "description": "Primary skill.", "tags": ["agent"] },
179
+ "consumer": { // settings for calling remote A2A agents
180
+ "remoteAgentUrls": ["http://127.0.0.1:4202"],
181
+ "defaultRemoteAgentUrl": "http://127.0.0.1:4202",
182
+ "bearerToken": "...",
183
+ "timeoutMs": 30000
184
+ // Consumed programmatically (createA2AConsumerResponder); the app's A2A
185
+ // channel runs the provider side.
186
+ }
187
+ },
188
+
189
+ "cron": {
190
+ "jobs": [
191
+ {
192
+ "id": "daily",
193
+ "enabled": true,
194
+ "expression": "0 9 * * *", // five-field cron
195
+ "timezone": "UTC", // IANA timezone
196
+ "prompt": "Post the morning summary.",
197
+ "conversationId": "cron-daily" // optional: share memory/history across ticks
198
+ }
199
+ ]
200
+ // Overlapping ticks of the same job are skipped, never queued.
201
+ }
202
+ }
203
+ ```
204
+
205
+ ## Lifecycle
206
+
207
+ ```bash
208
+ mono-agent init --model claude:claude-sonnet-4-6 --fallback-models pi:ollama:gemma4:31b [--memory markdown|journal]
209
+ mono-agent validate # per-section report incl. sandbox, console, every channel; exit 0 means ready
210
+ mono-agent start # console + traceability + every configured channel
211
+ mono-agent start --no-console # headless (or "console": { "enabled": false })
212
+ mono-agent start --port 4400 # fixed console port (or "console": { "port": 4400 })
213
+ ```
214
+
215
+ A `.env` file in the folder is loaded automatically (exported shell variables win); use `--env-file <path>` for an alternate file. `start` prints the operator console URL (config editing in the browser; saves re-apply live without restarting), the traceability source, and one status line per channel: `running` with its endpoint facts, `waiting_for_config` with the exact missing setting, `disabled`, or `failed` with the reason.
216
+
217
+ For a local terminal chat against the same config, `@mono-agent/tui` ships a `mono-agent-tui` bin: `mono-agent-tui --config ./mono-agent.config.json`.
218
+
219
+ ## Programmatic Escape Hatch
220
+
221
+ When config cannot express the host (custom runtime, request-scoped runtime extensions, custom channels, tool approval gates, structured output schemas), compose on the same package the CLI uses:
222
+
223
+ ```ts
224
+ import { startMonoAgentApp, defaultChannelDrivers } from "@mono-agent/agent-app";
225
+
226
+ const app = await startMonoAgentApp({
227
+ cwd: process.cwd(),
228
+ runtime: myCustomRuntime, // any MonoRuntimeLike (incl. createOpenAIAgentsRuntime)
229
+ drivers: [...defaultChannelDrivers(), myCustomDriver],
230
+ });
231
+ ```
232
+
233
+ For a bare responder without channels, use `@mono-agent/config` + `@mono-agent/agent-host` (`createConfiguredAgentResponder` — also takes `memory`, `historyStore`, `runtimeOptions`, `runtimeOptionsForRequest`). For multi-agent orchestration, add `@mono-agent/agent-orchestrator` (`createCollaboratorToolRuntimeExtension`) — see `references/package-map.md`. Channel message texts and stream tuning (welcome/help/error texts, edit debounce) are channel-driver overrides, not config keys.
@@ -0,0 +1,137 @@
1
+ # Discovery Questions
2
+
3
+ Use this sequence to fill `mono-agent.config.json` before running anything. Ask one question at a time. Skip questions whose answer is already explicit in the user's request. Each answer maps to concrete config keys.
4
+
5
+ ## 1. Runtime And Backup Models
6
+
7
+ Question:
8
+
9
+ ```text
10
+ Which model should drive the agent, and should any backups take over when the provider fails?
11
+
12
+ 1. `claude:<model>` through SDK or CLI mode
13
+ 2. `codex:<model>` through CLI mode
14
+ 3. `pi:<provider>:<model>` through SDK mode (OpenAI, Copilot, OpenRouter, local Ollama, ...)
15
+ 4. A custom MonoRuntimeLike supplied programmatically (escape hatch)
16
+ ```
17
+
18
+ Fills: `runtime.model`, `runtime.fallbackModels` (ordered backup references tried on retryable provider failures), `runtime.executionMode` (usually inferred), `runtime.effort`, `runtime.maxTurns`.
19
+
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
+
22
+ ## 2. Channels Of Communication
23
+
24
+ Question:
25
+
26
+ ```text
27
+ Where should people (or other agents) reach this agent? Pick every channel that applies:
28
+
29
+ 1. Webhook (HTTP POST, zero credentials — good first smoke test)
30
+ 2. OpenAI-compatible API (OpenWebUI and other API clients)
31
+ 3. Telegram
32
+ 4. Slack
33
+ 5. WhatsApp
34
+ 6. A2A (agent-to-agent provider/consumer)
35
+ 7. Cron (scheduled prompts, no inbound channel)
36
+ ```
37
+
38
+ Fills one config section per choice: `webhook`, `openaiApi`, `telegram`, `slack`, `whatsapp`, `a2a`, `cron`. Channels are independent: an unconfigured channel reports `waiting_for_config` and never blocks the others. For chat channels collect tokens and allowlists (chat IDs, channel IDs, JIDs). For HTTP channels collect host/port/path and whether non-loopback binding is allowed (default: loopback only).
39
+
40
+ ## 3. Identity And Existing Knowledge
41
+
42
+ Question:
43
+
44
+ ```text
45
+ What is this agent's role, and does this folder already contain knowledge it must respect?
46
+ ```
47
+
48
+ Fills: `context.identityPath` (default `./IDENTITY.md`), optional `context.soulPath`, `runtime.workspace`. `mono-agent init` detects `AGENTS.md`, `CLAUDE.md`, `README.md`, and `SOUL.md` and references them from the generated identity — keep those references rather than copying content.
49
+
50
+ ## 4. Skills
51
+
52
+ Question:
53
+
54
+ ```text
55
+ Should this agent load selected skills?
56
+
57
+ 1. Yes, from a `skills/` directory in this folder
58
+ 2. Yes, from an external skills directory
59
+ 3. No selected skills for the first pass
60
+ ```
61
+
62
+ Fills: `context.skillsRoot`, `context.selectedSkills`, optionally `context.skillMaxBytes` (per-skill byte cap, default 48000). Skill discovery loads immediate child directories only: `<skillsRoot>/<skill-name>/SKILL.md`. Skill files may carry YAML frontmatter (Claude Code style); the description is the first prose paragraph after it.
63
+
64
+ ## 5. Tools And MCP Servers
65
+
66
+ Question:
67
+
68
+ ```text
69
+ What tools or MCP servers does the agent actually need?
70
+
71
+ 1. No tools yet; fail closed (recommended)
72
+ 2. A small allowlist of built-in tools
73
+ 3. MCP servers from an mcp.json config file
74
+ 4. Both
75
+ ```
76
+
77
+ Fills: `tools.allowedTools`, `tools.disallowedTools` (denylist wins), `tools.mcpConfigPath`. Record exact tool names; do not broaden access as a convenience.
78
+
79
+ ## 6. Memory Strategy
80
+
81
+ Question:
82
+
83
+ ```text
84
+ Should the agent remember anything between conversations?
85
+
86
+ 1. No durable memory yet (recommended for first integration)
87
+ 2. Markdown memory file (read into context; optional host summaries appended)
88
+ 3. Journal memory (daily notes + entity graph, optional MCP recall tools)
89
+ 4. Journal memory with semantic search (adds an embedding index for memory_search)
90
+ ```
91
+
92
+ Fills: the `memory` section — `mode` (`markdown`/`journal`), `path`, `writeMode` (`disabled`/`append-host-summary`), `scope`, and for journal mode `tools.enabled` / `tools.allowJournalAppend` to give the runtime memory recall/append tools over MCP. The entity graph defaults to `<path>/graph.jsonl` (`memory.graphPath` to relocate). For semantic search fill `memory.embeddings`: `provider` (`ollama` with local `nomic-embed-text` — pull it first with `ollama pull nomic-embed-text` — or `openai` which requires `apiKey`/`apiKeyEnv`), optional `model`/`endpoint`. Without embeddings, `memory_search` falls back to keyword search.
93
+
94
+ ## 7. Sandbox
95
+
96
+ Question:
97
+
98
+ ```text
99
+ Should runtime commands run inside a sandbox?
100
+
101
+ 1. No sandbox for the first pass
102
+ 2. Native sandbox, no network (fail closed)
103
+ 3. Native sandbox with localhost or an explicit network allowlist
104
+ 4. Native sandbox with custom filesystem scopes (extra readable/writable roots)
105
+ ```
106
+
107
+ Fills: the `sandbox` section — `mode`, `network.mode` (`none`/`localhost`/`allowlist`/`all`), `network.allowlist`, `readableRoots`/`writableRoots` (relative entries resolve against the workspace; default: workspace only), `denyWrite` glob patterns (defaults already deny `.env*`, `.git/config`, `.git/hooks/**`), `fallback` (`fail-closed` recommended; `unsafe-host-process` only with explicit consent plus `unsafeAllowHostProcess: true`).
108
+
109
+ ## 8. Observability
110
+
111
+ Question:
112
+
113
+ ```text
114
+ Do you need browsable traceability or just local artifacts?
115
+
116
+ 1. JSONL artifacts and the operator console (recommended; console is on by default)
117
+ 2. JSONL artifacts and the console on a fixed port
118
+ 3. JSONL artifacts only (headless)
119
+ ```
120
+
121
+ Fills: `artifacts.dir`, `traceability.registryDir` / `sourceId` / `sourceLabel`, and the `console` section — `console.port` for a fixed loopback port, `console.enabled: false` (or `start --no-console`) for headless. Artifacts record runtime/tool/message events and summaries, not private chain-of-thought. For a local terminal chat instead of (or alongside) the browser console, mention `mono-agent-tui --config ./mono-agent.config.json`.
122
+
123
+ ## 9. Acceptance Smoke Test
124
+
125
+ Question:
126
+
127
+ ```text
128
+ What proves this agent works?
129
+
130
+ 1. A curl POST to the webhook invoke URL
131
+ 2. A curl to /v1/models and /v1/chat/completions
132
+ 3. A Telegram/Slack/WhatsApp message from an allowed sender
133
+ 4. An A2A message to the Agent Card URL
134
+ 5. A cron tick
135
+ ```
136
+
137
+ The answer decides which smoke from `references/validation.md` must pass before the work is done.