@mono-agent/agent-app 0.9.0 → 0.9.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/package.json +15 -15
- package/skills/mono-agent-composer/references/config-blueprint.md +7 -1
- package/skills/mono-agent-composer/references/discovery-questions.md +1 -1
- package/skills/mono-agent-composer/references/feature-coverage.md +2 -2
- package/skills/mono-agent-composer/references/playbooks.md +3 -3
- package/dist/notify-runtime.d.ts +0 -26
- package/dist/notify-runtime.d.ts.map +0 -1
- package/dist/notify-runtime.js +0 -27
- package/dist/notify-runtime.js.map +0 -1
- package/dist/notify-tool.d.ts +0 -51
- package/dist/notify-tool.d.ts.map +0 -1
- package/dist/notify-tool.js +0 -182
- package/dist/notify-tool.js.map +0 -1
- package/dist/recipes/base.d.ts +0 -15
- package/dist/recipes/base.d.ts.map +0 -1
- package/dist/recipes/base.js +0 -51
- 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/recipes/types.js +0 -15
- package/dist/recipes/types.js.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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mono-agent/agent-app",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.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",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"@clack/prompts": "^1.7.0",
|
|
33
33
|
"@earendil-works/pi-ai": "^0.80.5",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
|
-
"@mono-agent/agent-contracts": "0.9.
|
|
36
|
-
"@mono-agent/agent-harness": "0.9.
|
|
37
|
-
"@mono-agent/config": "0.9.
|
|
38
|
-
"@mono-agent/cron-adapter": "0.9.
|
|
39
|
-
"@mono-agent/operator-adapter": "0.9.
|
|
40
|
-
"@mono-agent/memory": "0.9.
|
|
41
|
-
"@mono-agent/observability": "0.9.
|
|
42
|
-
"@mono-agent/openai-api-adapter": "0.9.
|
|
43
|
-
"@mono-agent/runtime-adapter": "0.9.
|
|
44
|
-
"@mono-agent/session-web": "0.9.
|
|
45
|
-
"@mono-agent/slack-adapter": "0.9.
|
|
46
|
-
"@mono-agent/telegram-adapter": "0.9.
|
|
47
|
-
"@mono-agent/tui": "0.9.
|
|
48
|
-
"@mono-agent/webhook-adapter": "0.9.
|
|
35
|
+
"@mono-agent/agent-contracts": "0.9.1",
|
|
36
|
+
"@mono-agent/agent-harness": "0.9.1",
|
|
37
|
+
"@mono-agent/config": "0.9.1",
|
|
38
|
+
"@mono-agent/cron-adapter": "0.9.1",
|
|
39
|
+
"@mono-agent/operator-adapter": "0.9.1",
|
|
40
|
+
"@mono-agent/memory": "0.9.1",
|
|
41
|
+
"@mono-agent/observability": "0.9.1",
|
|
42
|
+
"@mono-agent/openai-api-adapter": "0.9.1",
|
|
43
|
+
"@mono-agent/runtime-adapter": "0.9.1",
|
|
44
|
+
"@mono-agent/session-web": "0.9.1",
|
|
45
|
+
"@mono-agent/slack-adapter": "0.9.1",
|
|
46
|
+
"@mono-agent/telegram-adapter": "0.9.1",
|
|
47
|
+
"@mono-agent/tui": "0.9.1",
|
|
48
|
+
"@mono-agent/webhook-adapter": "0.9.1",
|
|
49
49
|
"undici": "8.7.0",
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
@@ -243,7 +243,13 @@ my-agent/
|
|
|
243
243
|
"publicBaseUrl": "https://agent.example.com",
|
|
244
244
|
"allowNonLoopback": false,
|
|
245
245
|
"requireBearer": false,
|
|
246
|
-
"bearerToken": "..."
|
|
246
|
+
"bearerToken": "...",
|
|
247
|
+
"idempotency": { // optional; namespace explicitly enables the v1 extension
|
|
248
|
+
"namespace": "my-agent-production", // stable authenticated-principal boundary
|
|
249
|
+
"stateDir": ".mono-agent/a2a-my-agent", // optional derived owner-only path when omitted
|
|
250
|
+
"retentionMs": 2592000000, // full result replay horizon
|
|
251
|
+
"maxRecords": 10000 // permanent unique-key capacity
|
|
252
|
+
}
|
|
247
253
|
},
|
|
248
254
|
"agent": { "name": "My Agent", "description": "What it does.", "version": "0.1.0" },
|
|
249
255
|
"skill": { "id": "main", "name": "Main", "description": "Primary skill.", "tags": ["agent"] },
|
|
@@ -36,7 +36,7 @@ Where should people (or other agents) reach this agent? Pick every channel that
|
|
|
36
36
|
7. Cron (scheduled prompts, no inbound channel)
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Fills one config section per choice: built-in channels use `webhook`, `openaiApi`, `telegram`, `slack`, and `cron`; WhatsApp and A2A are external channel plugins under `channels.plugins[]` with package names `@mono-agent/whatsapp-adapter` and `@mono-agent/a2a-adapter`. 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
|
+
Fills one config section per choice: built-in channels use `webhook`, `openaiApi`, `telegram`, `slack`, and `cron`; WhatsApp and A2A are external channel plugins under `channels.plugins[]` with package names `@mono-agent/whatsapp-adapter` and `@mono-agent/a2a-adapter`. 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). For paid or otherwise non-repeatable A2A dispatches, also collect a reviewed stable `provider.idempotency.namespace` (the authenticated-principal boundary), retention horizon, and lifetime unique-key capacity; callers must supply an existing stable logical key rather than a fresh key per attempt.
|
|
40
40
|
|
|
41
41
|
## 3. Identity And Existing Knowledge
|
|
42
42
|
|
|
@@ -62,8 +62,8 @@ Every framework capability and how a composed agent reaches it. This table is th
|
|
|
62
62
|
| Slack (Socket Mode, channel allowlist, mention handling) | config | `slack` section |
|
|
63
63
|
| External channel plugins | config | `channels.plugins[]: { package, id?, label?, config? }`; package must export `createChannelDriver(options)` or a default driver factory |
|
|
64
64
|
| WhatsApp (Baileys, QR login, group mention/any triggers) | config | `channels.plugins[].package: "@mono-agent/whatsapp-adapter"` plus plugin `config.{enabled,allowedChatJids,allowAllChats,groupMode,botJids,mentionTextAliases,stripMentionText}` |
|
|
65
|
-
| A2A provider (Agent Card, JSON-RPC + REST, streaming, bearer) | config | `channels.plugins[].package: "@mono-agent/a2a-adapter"` plus plugin `config.provider
|
|
66
|
-
| A2A consumer settings (remote agent URLs, timeouts) | config + code | same A2A plugin entry's `config.consumer`; calls via `createA2AConsumerResponder` |
|
|
65
|
+
| A2A provider (Agent Card, JSON-RPC + REST, streaming, bearer, opt-in durable dispatch identity) | config | `channels.plugins[].package: "@mono-agent/a2a-adapter"` plus plugin `config.provider` (including `idempotency.{namespace,stateDir,retentionMs,maxRecords}`), `config.agent`, `config.skill`; `config.enabled` is canonical |
|
|
66
|
+
| A2A consumer settings (remote agent URLs, timeouts) and calls | config + code | same A2A plugin entry's `config.consumer`; calls via `sendA2AMessage({ idempotencyKey })` or `createA2AConsumerResponder({ idempotencyKeyForRequest })` |
|
|
67
67
|
| TUI stream endpoint (operator console transport) | config | `tui.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback |
|
|
68
68
|
| Live event relay (read-only run-event SSE for web) | config | `live.{enabled,host,port,basePath,allowNonLoopback,apiKey}`; default on, loopback |
|
|
69
69
|
| Cron jobs (five-field expressions, timezones, overlap skip) | config | `cron.jobs[]`, single-job `MONO_AGENT_CRON_*`, or one markdown file per job in `cron.dir` / `MONO_AGENT_CRON_DIR` (default `cron/`) |
|
|
@@ -127,7 +127,7 @@ Flow, check whether one of these fits and adapt it. Verify every key against
|
|
|
127
127
|
"id": "a2a",
|
|
128
128
|
"config": {
|
|
129
129
|
"enabled": true,
|
|
130
|
-
"provider": { "host": "127.0.0.1", "port": 4201, "requireBearer": true, "bearerToken": "..." },
|
|
130
|
+
"provider": { "host": "127.0.0.1", "port": 4201, "requireBearer": true, "bearerToken": "...", "idempotency": { "namespace": "research-production", "retentionMs": 2592000000, "maxRecords": 10000 } },
|
|
131
131
|
"agent": { "name": "Research Agent", "description": "Does research.", "version": "0.1.0" },
|
|
132
132
|
"skill": { "id": "research", "name": "Research", "description": "Web research", "tags": ["research"] },
|
|
133
133
|
"consumer": { "remoteAgentUrls": ["http://127.0.0.1:4201"], "defaultRemoteAgentUrl": "http://127.0.0.1:4201", "bearerToken": "...", "timeoutMs": 30000 }
|
|
@@ -136,8 +136,8 @@ Flow, check whether one of these fits and adapt it. Verify every key against
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
```
|
|
139
|
-
**Steps:** provider — `init`, add the `@mono-agent/a2a-adapter` plugin entry with `provider`/`agent`/`skill` + bearer
|
|
140
|
-
**Smoke:**
|
|
139
|
+
**Steps:** provider — `init`, add the `@mono-agent/a2a-adapter` plugin entry with `provider`/`agent`/`skill` + bearer; for paid/non-repeatable calls choose a reviewed stable `provider.idempotency.namespace`; `validate`, `start`, confirm the Agent Card is reachable. Consumer — set plugin `config.consumer` (or compose `createA2AConsumerResponder`), then pass the existing logical dispatch id through `idempotencyKey` / `idempotencyKeyForRequest` rather than generating one per attempt.
|
|
140
|
+
**Smoke:** repeat one keyed message to the provider's Agent Card URL with the bearer; confirm the same task/result is returned and the responder runs once.
|
|
141
141
|
|
|
142
142
|
## 8. Multi-agent orchestration (`AskCollaborator`) — code
|
|
143
143
|
**For:** a workflow designer composing specialist agents.
|
package/dist/notify-runtime.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type NotifyToolsServer } from "./notify-tool.js";
|
|
2
|
-
/**
|
|
3
|
-
* Per-request input the harness hands each runtime-options extension. We only
|
|
4
|
-
* need the request's metadata to decide whether this is a proactive trigger.
|
|
5
|
-
*/
|
|
6
|
-
interface NotifyRuntimeExtensionInput {
|
|
7
|
-
readonly request: {
|
|
8
|
-
readonly metadata?: Record<string, unknown> | undefined;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
interface NotifyRuntimeExtensionResult {
|
|
12
|
-
readonly runtimeOptions: {
|
|
13
|
-
readonly mcpServers?: Record<string, unknown>;
|
|
14
|
-
};
|
|
15
|
-
readonly cleanup: () => Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Runtime extension that exposes the `notify_conversation`/`list_notify_destinations`
|
|
19
|
-
* tools, but ONLY on proactive trigger turns — cron and webhook — identified by the
|
|
20
|
-
* request metadata (`metadata.cron`/`metadata.webhook`, robust regardless of how the
|
|
21
|
-
* turn's conversationId is scoped). Live channel turns (telegram/slack/etc.) never see
|
|
22
|
-
* these tools: a live turn is already in its conversation and just replies.
|
|
23
|
-
*/
|
|
24
|
-
export declare function createNotifyToolsRuntimeExtension(server: Pick<NotifyToolsServer, "url" | "token">): (input: NotifyRuntimeExtensionInput) => Promise<NotifyRuntimeExtensionResult>;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=notify-runtime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notify-runtime.d.ts","sourceRoot":"","sources":["../src/notify-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAExF;;;GAGG;AACH,UAAU,2BAA2B;IACnC,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;KAAE,CAAC;CAC/E;AAED,UAAU,4BAA4B;IACpC,QAAQ,CAAC,cAAc,EAAE;QAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAC3E,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAID;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,OAAO,CAAC,GAC/C,CAAC,KAAK,EAAE,2BAA2B,KAAK,OAAO,CAAC,4BAA4B,CAAC,CAa/E"}
|
package/dist/notify-runtime.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { NOTIFY_TOOLS_MCP_SERVER_NAME } from "./notify-tool.js";
|
|
2
|
-
const EMPTY = { runtimeOptions: {}, cleanup: async () => { } };
|
|
3
|
-
/**
|
|
4
|
-
* Runtime extension that exposes the `notify_conversation`/`list_notify_destinations`
|
|
5
|
-
* tools, but ONLY on proactive trigger turns — cron and webhook — identified by the
|
|
6
|
-
* request metadata (`metadata.cron`/`metadata.webhook`, robust regardless of how the
|
|
7
|
-
* turn's conversationId is scoped). Live channel turns (telegram/slack/etc.) never see
|
|
8
|
-
* these tools: a live turn is already in its conversation and just replies.
|
|
9
|
-
*/
|
|
10
|
-
export function createNotifyToolsRuntimeExtension(server) {
|
|
11
|
-
const entry = {
|
|
12
|
-
[NOTIFY_TOOLS_MCP_SERVER_NAME]: {
|
|
13
|
-
type: "http",
|
|
14
|
-
url: server.url,
|
|
15
|
-
headers: { Authorization: `Bearer ${server.token}` },
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
return async (input) => {
|
|
19
|
-
return isProactiveTrigger(input.request.metadata)
|
|
20
|
-
? { runtimeOptions: { mcpServers: entry }, cleanup: async () => { } }
|
|
21
|
-
: EMPTY;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function isProactiveTrigger(metadata) {
|
|
25
|
-
return metadata !== undefined && (metadata.cron !== undefined || metadata.webhook !== undefined);
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=notify-runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notify-runtime.js","sourceRoot":"","sources":["../src/notify-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAA0B,MAAM,kBAAkB,CAAC;AAexF,MAAM,KAAK,GAAiC,EAAE,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,MAAgD;IAEhD,MAAM,KAAK,GAAG;QACZ,CAAC,4BAA4B,CAAC,EAAE;YAC9B,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE;SACrD;KACF,CAAC;IACF,OAAO,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,OAAO,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC/C,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE;YACpE,CAAC,CAAC,KAAK,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,QAA6C;IACvE,OAAO,QAAQ,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;AACnG,CAAC"}
|
package/dist/notify-tool.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { MonoAgentAppLogger } from "./channels.js";
|
|
2
|
-
import type { NotifyDeliveryResult } from "./proactive-notify.js";
|
|
3
|
-
/**
|
|
4
|
-
* In-process MCP server that exposes the proactive-notification tools to the agent.
|
|
5
|
-
*
|
|
6
|
-
* Unlike `memory_recall`/the adapter send tools (stdio children that re-derive
|
|
7
|
-
* everything from config/disk), notification delivery has to run a real turn on a
|
|
8
|
-
* destination channel's LIVE session, so the handler must reach the app's running
|
|
9
|
-
* channel registry — which only exists in this process. We therefore host the
|
|
10
|
-
* tools over loopback HTTP (the one MCP transport the runtime's client supports
|
|
11
|
-
* for an in-process server) and close over app-supplied delivery/discovery hooks.
|
|
12
|
-
*
|
|
13
|
-
* Two tools, both intended for proactive cron/webhook turns (the runtime extension
|
|
14
|
-
* only injects this server for those):
|
|
15
|
-
* - `list_notify_destinations` — discover the conversations the agent may notify
|
|
16
|
-
* (answers "how do I get a conversationId?" when there is no triggering payload).
|
|
17
|
-
* - `notify_conversation` — deliver a message as a real turn into one of them.
|
|
18
|
-
*/
|
|
19
|
-
export declare const NOTIFY_TOOLS_MCP_SERVER_NAME = "mono-agent-notify";
|
|
20
|
-
/** A conversation the agent may proactively notify, surfaced to the model for discovery. */
|
|
21
|
-
export interface NotifyToolDestination {
|
|
22
|
-
/** Destination conversationId to pass to `notify_conversation`, e.g. `telegram:42`. */
|
|
23
|
-
readonly conversationId: string;
|
|
24
|
-
/** Owning channel id (telegram/slack). */
|
|
25
|
-
readonly channelId: string;
|
|
26
|
-
/** ISO timestamp of the most recent turn on this conversation, if known. */
|
|
27
|
-
readonly lastSeen?: string;
|
|
28
|
-
/** True when this is an allowlisted destination the agent has not yet conversed with. */
|
|
29
|
-
readonly fromAllowlist?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface NotifyToolsDeps {
|
|
32
|
-
/** Deliver `text` as a real turn into `conversationId` (allowlist-enforced by the owning channel). */
|
|
33
|
-
readonly deliver: (conversationId: string, text: string) => Promise<NotifyDeliveryResult>;
|
|
34
|
-
/** The conversations the agent may notify right now (seen + single-allowlist destinations). */
|
|
35
|
-
readonly listDestinations: () => Promise<readonly NotifyToolDestination[]>;
|
|
36
|
-
readonly logger?: MonoAgentAppLogger | undefined;
|
|
37
|
-
}
|
|
38
|
-
export interface NotifyToolsServer {
|
|
39
|
-
/** Loopback URL the runtime's MCP client connects to (`http://127.0.0.1:<port>/mcp`). */
|
|
40
|
-
readonly url: string;
|
|
41
|
-
/** Bearer token required on every request. */
|
|
42
|
-
readonly token: string;
|
|
43
|
-
close(): Promise<void>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Start the in-process notify MCP server on an ephemeral loopback port. Stateless:
|
|
47
|
-
* each request gets a fresh `McpServer`+transport (the tools are pure request/response),
|
|
48
|
-
* which sidesteps session bookkeeping and concurrent-trigger races.
|
|
49
|
-
*/
|
|
50
|
-
export declare function startNotifyToolsServer(deps: NotifyToolsDeps): Promise<NotifyToolsServer>;
|
|
51
|
-
//# sourceMappingURL=notify-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notify-tool.d.ts","sourceRoot":"","sources":["../src/notify-tool.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAEhE,4FAA4F;AAC5F,MAAM,WAAW,qBAAqB;IACpC,uFAAuF;IACvF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,sGAAsG;IACtG,QAAQ,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC1F,+FAA+F;IAC/F,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAAC;IAC3E,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,iBAAiB;IAChC,yFAAyF;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAID;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAgC9F"}
|
package/dist/notify-tool.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { createServer } from "node:http";
|
|
2
|
-
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
3
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
|
-
import * as z from "zod/v4";
|
|
6
|
-
/**
|
|
7
|
-
* In-process MCP server that exposes the proactive-notification tools to the agent.
|
|
8
|
-
*
|
|
9
|
-
* Unlike `memory_recall`/the adapter send tools (stdio children that re-derive
|
|
10
|
-
* everything from config/disk), notification delivery has to run a real turn on a
|
|
11
|
-
* destination channel's LIVE session, so the handler must reach the app's running
|
|
12
|
-
* channel registry — which only exists in this process. We therefore host the
|
|
13
|
-
* tools over loopback HTTP (the one MCP transport the runtime's client supports
|
|
14
|
-
* for an in-process server) and close over app-supplied delivery/discovery hooks.
|
|
15
|
-
*
|
|
16
|
-
* Two tools, both intended for proactive cron/webhook turns (the runtime extension
|
|
17
|
-
* only injects this server for those):
|
|
18
|
-
* - `list_notify_destinations` — discover the conversations the agent may notify
|
|
19
|
-
* (answers "how do I get a conversationId?" when there is no triggering payload).
|
|
20
|
-
* - `notify_conversation` — deliver a message as a real turn into one of them.
|
|
21
|
-
*/
|
|
22
|
-
export const NOTIFY_TOOLS_MCP_SERVER_NAME = "mono-agent-notify";
|
|
23
|
-
const MCP_PATH = "/mcp";
|
|
24
|
-
/**
|
|
25
|
-
* Start the in-process notify MCP server on an ephemeral loopback port. Stateless:
|
|
26
|
-
* each request gets a fresh `McpServer`+transport (the tools are pure request/response),
|
|
27
|
-
* which sidesteps session bookkeeping and concurrent-trigger races.
|
|
28
|
-
*/
|
|
29
|
-
export async function startNotifyToolsServer(deps) {
|
|
30
|
-
const token = randomBytes(24).toString("hex");
|
|
31
|
-
const expectedAuth = `Bearer ${token}`;
|
|
32
|
-
const httpServer = createServer((req, res) => {
|
|
33
|
-
void handleHttpRequest(req, res, expectedAuth, deps);
|
|
34
|
-
});
|
|
35
|
-
await new Promise((resolve, reject) => {
|
|
36
|
-
const onError = (error) => reject(error);
|
|
37
|
-
httpServer.once("error", onError);
|
|
38
|
-
httpServer.listen(0, "127.0.0.1", () => {
|
|
39
|
-
httpServer.removeListener("error", onError);
|
|
40
|
-
resolve();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
const address = httpServer.address();
|
|
44
|
-
if (address === null || typeof address === "string") {
|
|
45
|
-
httpServer.close();
|
|
46
|
-
throw new Error("notify tools server: failed to bind a loopback port.");
|
|
47
|
-
}
|
|
48
|
-
const url = `http://127.0.0.1:${address.port}${MCP_PATH}`;
|
|
49
|
-
return {
|
|
50
|
-
url,
|
|
51
|
-
token,
|
|
52
|
-
close: () => new Promise((resolve) => {
|
|
53
|
-
httpServer.close(() => resolve());
|
|
54
|
-
}),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
async function handleHttpRequest(req, res, expectedAuth, deps) {
|
|
58
|
-
if (!isAuthorized(req, expectedAuth)) {
|
|
59
|
-
res.writeHead(401, { "content-type": "application/json" });
|
|
60
|
-
res.end(JSON.stringify({ error: "unauthorized" }));
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (req.url?.split("?", 1)[0] !== MCP_PATH) {
|
|
64
|
-
res.writeHead(404, { "content-type": "application/json" });
|
|
65
|
-
res.end(JSON.stringify({ error: "not found" }));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
// Stateless: only POST carries JSON-RPC. The single tool round-trips are
|
|
69
|
-
// request/response, so reject the optional GET/DELETE session streams.
|
|
70
|
-
if (req.method !== "POST") {
|
|
71
|
-
res.writeHead(405, { "content-type": "application/json", allow: "POST" });
|
|
72
|
-
res.end(JSON.stringify({ error: "method not allowed" }));
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const server = buildMcpServer(deps);
|
|
76
|
-
// Stateless: omitting sessionIdGenerator runs the transport without session
|
|
77
|
-
// tracking, so a fresh server+transport per request is the correct pattern and
|
|
78
|
-
// concurrent triggers never share state.
|
|
79
|
-
const transport = new StreamableHTTPServerTransport({});
|
|
80
|
-
// Idempotent: with HTTP keep-alive the response can `finish` without firing
|
|
81
|
-
// `close`, so bind both and guard against a double-close leaking nothing.
|
|
82
|
-
let cleaned = false;
|
|
83
|
-
const cleanup = () => {
|
|
84
|
-
if (cleaned)
|
|
85
|
-
return;
|
|
86
|
-
cleaned = true;
|
|
87
|
-
void transport.close();
|
|
88
|
-
void server.close();
|
|
89
|
-
};
|
|
90
|
-
res.on("close", cleanup);
|
|
91
|
-
res.on("finish", cleanup);
|
|
92
|
-
try {
|
|
93
|
-
// The transport implements the SDK Transport interface at runtime; the cast
|
|
94
|
-
// bridges an exactOptionalPropertyTypes mismatch in the SDK's own typings.
|
|
95
|
-
await server.connect(transport);
|
|
96
|
-
await transport.handleRequest(req, res);
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
deps.logger?.error?.("notify tools server: request failed.", { reason: reasonOf(error) });
|
|
100
|
-
if (!res.headersSent) {
|
|
101
|
-
res.writeHead(500, { "content-type": "application/json" });
|
|
102
|
-
res.end(JSON.stringify({ error: "internal error" }));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function isAuthorized(req, expectedAuth) {
|
|
107
|
-
const header = req.headers.authorization;
|
|
108
|
-
if (typeof header !== "string") {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
const a = Buffer.from(header);
|
|
112
|
-
const b = Buffer.from(expectedAuth);
|
|
113
|
-
return a.length === b.length && timingSafeEqual(a, b);
|
|
114
|
-
}
|
|
115
|
-
function buildMcpServer(deps) {
|
|
116
|
-
const server = new McpServer({ name: "agent-notify-tools", version: "0.1.0" });
|
|
117
|
-
server.registerTool("list_notify_destinations", {
|
|
118
|
-
title: "List notification destinations",
|
|
119
|
-
description: "List the conversations you can proactively deliver a message to with notify_conversation. " +
|
|
120
|
-
"Use this when you have no triggering conversationId in hand (e.g. a scheduled/cron run) to " +
|
|
121
|
-
"discover where to reach the user. Each entry's `conversationId` is what notify_conversation " +
|
|
122
|
-
"expects — read its description for how delivery works (the destination turn's reply is what is sent).",
|
|
123
|
-
inputSchema: {},
|
|
124
|
-
}, async () => {
|
|
125
|
-
const destinations = await deps.listDestinations();
|
|
126
|
-
const lines = destinations.length === 0
|
|
127
|
-
? ["(no known destinations yet — the agent has not handled any push-channel conversation and no single allowlisted destination is configured)"]
|
|
128
|
-
: destinations.map((d) => `- ${d.conversationId}${d.lastSeen === undefined ? "" : ` (last active ${d.lastSeen})`}${d.fromAllowlist === true ? " (allowlisted, not yet used)" : ""}`);
|
|
129
|
-
return {
|
|
130
|
-
content: [{ type: "text", text: ["Conversations you can notify:", ...lines].join("\n") }],
|
|
131
|
-
structuredContent: { destinations },
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
server.registerTool("notify_conversation", {
|
|
135
|
-
title: "Notify a conversation",
|
|
136
|
-
description: "Proactively deliver a message into a conversation you are not currently handling. The message " +
|
|
137
|
-
"runs as a real turn on that conversation's own session and THAT TURN'S REPLY is what the user " +
|
|
138
|
-
"receives (so the user sees it natively and the conversation remembers it). Use this to follow up " +
|
|
139
|
-
"from a cron job or an inbound webhook callback.\n\n" +
|
|
140
|
-
"How `text` is delivered (read carefully — this is the #1 mistake):\n" +
|
|
141
|
-
"- `text` is the stimulus the destination conversation acts on; it is NOT posted verbatim. The " +
|
|
142
|
-
"destination agent reads `text` and composes the user-facing reply with its own context, and that " +
|
|
143
|
-
"reply is delivered automatically.\n" +
|
|
144
|
-
"- To deliver pre-composed or exact content (e.g. a digest), phrase `text` as an explicit reply " +
|
|
145
|
-
"instruction, e.g.: \"Reply with the text below exactly as written, adding nothing, and do not call " +
|
|
146
|
-
"any tools — your reply is delivered automatically:\\n\\n<your content>\".\n" +
|
|
147
|
-
"- The destination must NOT call its own send tools (e.g. slack_send_message) — its reply is already " +
|
|
148
|
-
"delivered, so sending again posts the message twice.\n\n" +
|
|
149
|
-
"How to choose `conversationId`:\n" +
|
|
150
|
-
"- Webhook/async callback: pass the `conversationId` carried in the triggering request payload.\n" +
|
|
151
|
-
"- Otherwise (e.g. a scheduled run): call list_notify_destinations first and pick from it.\n\n" +
|
|
152
|
-
"Delivery is bounded by the channel allowlist and may return delivered:false (e.g. unknown/disallowed " +
|
|
153
|
-
"id, channel offline). The call blocks until the destination turn replies, so keep that turn to a single " +
|
|
154
|
-
"reply — a turn that re-scans, recalls, or hunts for a send tool is slow and can hit the request timeout. " +
|
|
155
|
-
"If you receive delivered:false, do not assume it was also delivered some other way.",
|
|
156
|
-
inputSchema: {
|
|
157
|
-
conversationId: z
|
|
158
|
-
.string()
|
|
159
|
-
.min(1)
|
|
160
|
-
.describe("Destination conversationId, e.g. telegram:42 or slack:C123 (or slack:C123:1718.99 for a thread)."),
|
|
161
|
-
text: z
|
|
162
|
-
.string()
|
|
163
|
-
.min(1)
|
|
164
|
-
.describe("What to deliver. The destination conversation runs this as a turn and its reply is delivered; " +
|
|
165
|
-
"to deliver exact content, phrase this as a reply-verbatim, no-tools instruction (see the tool description)."),
|
|
166
|
-
},
|
|
167
|
-
}, async (args) => {
|
|
168
|
-
const result = await deps.deliver(args.conversationId, args.text);
|
|
169
|
-
const summary = result.delivered
|
|
170
|
-
? `Delivered to ${args.conversationId}.`
|
|
171
|
-
: `Not delivered to ${args.conversationId}${result.reason === undefined ? "" : `: ${result.reason}`}.`;
|
|
172
|
-
return {
|
|
173
|
-
content: [{ type: "text", text: summary }],
|
|
174
|
-
structuredContent: { delivered: result.delivered, ...(result.reason === undefined ? {} : { reason: result.reason }) },
|
|
175
|
-
};
|
|
176
|
-
});
|
|
177
|
-
return server;
|
|
178
|
-
}
|
|
179
|
-
function reasonOf(error) {
|
|
180
|
-
return error instanceof Error ? error.message : String(error);
|
|
181
|
-
}
|
|
182
|
-
//# sourceMappingURL=notify-tool.js.map
|
package/dist/notify-tool.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notify-tool.js","sourceRoot":"","sources":["../src/notify-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAK5B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AA8BhE,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAs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C,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;SACtH,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
package/dist/recipes/base.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { MonoAgentConfigJson } from "@mono-agent/config";
|
|
2
|
-
import type { RecipeInput, RecipeInputValues } from "./types.js";
|
|
3
|
-
export declare const DEFAULT_MODEL = "claude:claude-sonnet-4-6";
|
|
4
|
-
/** The model input every recipe shares; overridable from `--model`. */
|
|
5
|
-
export declare const MODEL_INPUT: RecipeInput;
|
|
6
|
-
/**
|
|
7
|
-
* The adapter-neutral skeleton every recipe extends: runtime model, identity,
|
|
8
|
-
* empty tool policy, local artifacts, and the trace registry. Recipes spread
|
|
9
|
-
* this and add their channel / memory / sandbox / observability blocks. Mirrors
|
|
10
|
-
* `init.ts`'s scaffold so a recipe-built folder matches a hand-init'd one.
|
|
11
|
-
*/
|
|
12
|
-
export declare function baseConfig(input: RecipeInputValues): MonoAgentConfigJson;
|
|
13
|
-
/** A `memory` block for the given tier, rooted at the standard memory path. */
|
|
14
|
-
export declare function memoryBlock(mode: "lite" | "journal" | "bujo"): NonNullable<MonoAgentConfigJson["memory"]>;
|
|
15
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/recipes/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEjE,eAAO,MAAM,aAAa,6BAA6B,CAAC;AAExD,uEAAuE;AACvE,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,mBAAmB,CA0BxE;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAChC,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAM5C"}
|
package/dist/recipes/base.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { monoAgentConfigWithSchema } from "../config-reference.js";
|
|
2
|
-
export const DEFAULT_MODEL = "claude:claude-sonnet-4-6";
|
|
3
|
-
/** The model input every recipe shares; overridable from `--model`. */
|
|
4
|
-
export const MODEL_INPUT = {
|
|
5
|
-
id: "model",
|
|
6
|
-
label: "Model",
|
|
7
|
-
description: "Primary runtime model reference, e.g. claude:claude-sonnet-4-6, codex:gpt-5.5, pi:ollama:gemma4:31b.",
|
|
8
|
-
default: DEFAULT_MODEL,
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The adapter-neutral skeleton every recipe extends: runtime model, identity,
|
|
12
|
-
* empty tool policy, local artifacts, and the trace registry. Recipes spread
|
|
13
|
-
* this and add their channel / memory / sandbox / observability blocks. Mirrors
|
|
14
|
-
* `init.ts`'s scaffold so a recipe-built folder matches a hand-init'd one.
|
|
15
|
-
*/
|
|
16
|
-
export function baseConfig(input) {
|
|
17
|
-
return monoAgentConfigWithSchema({
|
|
18
|
-
runtime: {
|
|
19
|
-
model: input.model ?? DEFAULT_MODEL,
|
|
20
|
-
workspace: ".",
|
|
21
|
-
},
|
|
22
|
-
context: {
|
|
23
|
-
identityPath: "./IDENTITY.md",
|
|
24
|
-
selectedSkills: [],
|
|
25
|
-
},
|
|
26
|
-
tools: {
|
|
27
|
-
allowedTools: [],
|
|
28
|
-
disallowedTools: [],
|
|
29
|
-
},
|
|
30
|
-
artifacts: {
|
|
31
|
-
dir: "./.mono-agent/artifacts",
|
|
32
|
-
retention: {
|
|
33
|
-
maxAgeDays: 365,
|
|
34
|
-
maxCount: 50000,
|
|
35
|
-
dryRun: false,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
traceability: {
|
|
39
|
-
registryDir: "./.mono-agent/trace-sources",
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/** A `memory` block for the given tier, rooted at the standard memory path. */
|
|
44
|
-
export function memoryBlock(mode) {
|
|
45
|
-
return {
|
|
46
|
-
mode,
|
|
47
|
-
path: "./.mono-agent/memory",
|
|
48
|
-
writeMode: mode === "bujo" ? "capture" : "append-host-summary",
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=base.js.map
|
package/dist/recipes/base.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/recipes/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAC;AAExD,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,sGAAsG;IACnH,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAwB;IACjD,OAAO,yBAAyB,CAAC;QAC/B,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,aAAa;YACnC,SAAS,EAAE,GAAG;SACf;QACD,OAAO,EAAE;YACP,YAAY,EAAE,eAAe;YAC7B,cAAc,EAAE,EAAE;SACnB;QACD,KAAK,EAAE;YACL,YAAY,EAAE,EAAE;YAChB,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