@mono-agent/agent-app 0.9.1 → 0.11.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/README.md +13 -1
- package/dist/app.js +4 -2
- package/dist/app.js.map +1 -1
- package/dist/background-runtime.d.ts +32 -0
- package/dist/background-runtime.d.ts.map +1 -1
- package/dist/background-runtime.js +396 -36
- package/dist/background-runtime.js.map +1 -1
- package/dist/background-snapshot-key.d.ts +2 -0
- package/dist/background-snapshot-key.d.ts.map +1 -1
- package/dist/background-snapshot-key.js +32 -1
- package/dist/background-snapshot-key.js.map +1 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +41 -12
- package/dist/channels.js.map +1 -1
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +61 -0
- package/dist/cli.js.map +1 -1
- package/dist/configured-agent.d.ts.map +1 -1
- package/dist/configured-agent.js +16 -6
- package/dist/configured-agent.js.map +1 -1
- package/dist/continuation-service.d.ts.map +1 -1
- package/dist/continuation-service.js +453 -32
- package/dist/continuation-service.js.map +1 -1
- package/dist/continuation-store.d.ts +41 -2
- package/dist/continuation-store.d.ts.map +1 -1
- package/dist/continuation-store.js +643 -33
- package/dist/continuation-store.js.map +1 -1
- package/dist/continuations.d.ts +29 -4
- package/dist/continuations.d.ts.map +1 -1
- package/dist/continuations.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +99 -10
- package/dist/doctor.js.map +1 -1
- package/dist/launchd.d.ts +2 -0
- package/dist/launchd.d.ts.map +1 -1
- package/dist/launchd.js +46 -17
- package/dist/launchd.js.map +1 -1
- package/dist/managed-runtime-packages.js +1 -1
- package/dist/managed-runtime-packages.js.map +1 -1
- package/dist/memory-command.d.ts +6 -0
- package/dist/memory-command.d.ts.map +1 -1
- package/dist/memory-command.js +363 -3
- package/dist/memory-command.js.map +1 -1
- package/dist/notify-runtime.d.ts +26 -0
- package/dist/notify-runtime.d.ts.map +1 -0
- package/dist/notify-runtime.js +27 -0
- package/dist/notify-runtime.js.map +1 -0
- package/dist/notify-tool.d.ts +51 -0
- package/dist/notify-tool.d.ts.map +1 -0
- package/dist/notify-tool.js +182 -0
- package/dist/notify-tool.js.map +1 -0
- package/dist/recipes/base.d.ts +15 -0
- package/dist/recipes/base.d.ts.map +1 -0
- package/dist/recipes/base.js +51 -0
- package/dist/recipes/base.js.map +1 -0
- package/dist/recipes/catalog.d.ts +4 -0
- package/dist/recipes/catalog.d.ts.map +1 -0
- package/dist/recipes/catalog.js +525 -0
- package/dist/recipes/catalog.js.map +1 -0
- package/dist/recipes/index.d.ts +11 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +14 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/recipes/types.d.ts +70 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +15 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/setup.d.ts +29 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +97 -0
- package/dist/setup.js.map +1 -0
- package/package.json +15 -15
- package/skills/mono-agent-composer/references/feature-coverage.md +2 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RECIPE_CATALOG } from "./catalog.js";
|
|
2
|
+
export { resolveRecipeInputs } from "./types.js";
|
|
3
|
+
export { RECIPE_CATALOG } from "./catalog.js";
|
|
4
|
+
/** id -> recipe, for O(1) lookup by the CLI. */
|
|
5
|
+
export const RECIPES = new Map(RECIPE_CATALOG.map((recipe) => [recipe.id, recipe]));
|
|
6
|
+
/** Look up a recipe by id, or undefined when unknown. */
|
|
7
|
+
export function findRecipe(id) {
|
|
8
|
+
return RECIPES.get(id);
|
|
9
|
+
}
|
|
10
|
+
/** Every recipe id, in catalog order. */
|
|
11
|
+
export function recipeIds() {
|
|
12
|
+
return RECIPE_CATALOG.map((recipe) => recipe.id);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/recipes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAAqC,IAAI,GAAG,CAC9D,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CACpD,CAAC;AAEF,yDAAyD;AACzD,MAAM,UAAU,UAAU,CAAC,EAAU;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,SAAS;IACvB,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { MonoAgentConfigJson } from "@mono-agent/config";
|
|
2
|
+
import type { ValidationStatus } from "../doctor.js";
|
|
3
|
+
/**
|
|
4
|
+
* A value the recipe templates against. Non-secret inputs carry a default and
|
|
5
|
+
* may be overridden from the CLI; secret inputs are never written into JSON —
|
|
6
|
+
* they only emit a `.env.example` placeholder via {@link AgentRecipe.envExample}.
|
|
7
|
+
*/
|
|
8
|
+
export interface RecipeInput {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly description: string;
|
|
12
|
+
/** Default used when the CLI does not override the input. */
|
|
13
|
+
readonly default?: string;
|
|
14
|
+
/** Secret inputs are externalized to `.env.example`, never inlined in JSON. */
|
|
15
|
+
readonly secret?: boolean;
|
|
16
|
+
/** The `MONO_AGENT_*` env var a secret input maps to (for `.env.example`). */
|
|
17
|
+
readonly envVar?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Resolved input values keyed by {@link RecipeInput.id}. */
|
|
20
|
+
export type RecipeInputValues = Readonly<Record<string, string | undefined>>;
|
|
21
|
+
/** An auxiliary file a recipe scaffolds beside the config (e.g. a cron job markdown). */
|
|
22
|
+
export interface GeneratedFile {
|
|
23
|
+
/** Path relative to the agent folder. */
|
|
24
|
+
readonly path: string;
|
|
25
|
+
readonly contents: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A capability the recipe promises once secrets are filled in. `mono-agent
|
|
29
|
+
* validate --recipe <id>` checks each expectation against the doctor report and
|
|
30
|
+
* reports "selected recipe incomplete" when a required section is not yet at the
|
|
31
|
+
* promised status (e.g. a channel still `waiting` on a token).
|
|
32
|
+
*/
|
|
33
|
+
export interface RecipeValidateExpectation {
|
|
34
|
+
/** Doctor section id, e.g. `runtime`, `memory`, `channel:telegram`. */
|
|
35
|
+
readonly sectionId: string;
|
|
36
|
+
/** The status the section must reach for the recipe to be considered live. */
|
|
37
|
+
readonly mustBe: ValidationStatus;
|
|
38
|
+
/** Human note explaining what to do if the expectation is unmet. */
|
|
39
|
+
readonly note?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A typed, testable blueprint that compiles to an ordinary
|
|
43
|
+
* `mono-agent.config.json` plus optional `.env.example` placeholders and
|
|
44
|
+
* follow-up files. Recipes never change runtime contracts — they only emit JSON
|
|
45
|
+
* the existing loader already accepts — and never write secrets into the config.
|
|
46
|
+
*/
|
|
47
|
+
export interface AgentRecipe {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly title: string;
|
|
50
|
+
readonly description: string;
|
|
51
|
+
readonly tags: readonly string[];
|
|
52
|
+
readonly riskLevel: "low" | "medium" | "high";
|
|
53
|
+
/**
|
|
54
|
+
* The `docs/playbooks/<playbook>.md` this recipe mirrors, parity-checked to
|
|
55
|
+
* exist. The composite "full" blueprints have no single playbook and omit it.
|
|
56
|
+
*/
|
|
57
|
+
readonly playbook?: string;
|
|
58
|
+
readonly inputs: readonly RecipeInput[];
|
|
59
|
+
/** Build the `mono-agent.config.json` contents from resolved inputs. */
|
|
60
|
+
readonly config: (input: RecipeInputValues) => MonoAgentConfigJson;
|
|
61
|
+
/** `.env.example` lines for the secrets this recipe needs (never in JSON). */
|
|
62
|
+
readonly envExample?: (input: RecipeInputValues) => string;
|
|
63
|
+
/** Extra files to scaffold (cron job markdown, etc.). */
|
|
64
|
+
readonly files?: (input: RecipeInputValues) => readonly GeneratedFile[];
|
|
65
|
+
/** Capabilities `validate --recipe` checks once secrets are supplied. */
|
|
66
|
+
readonly validateExpectations: readonly RecipeValidateExpectation[];
|
|
67
|
+
}
|
|
68
|
+
/** Resolve declared input defaults, then layer CLI overrides on top. */
|
|
69
|
+
export declare function resolveRecipeInputs(recipe: AgentRecipe, overrides?: RecipeInputValues): RecipeInputValues;
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/recipes/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;C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AAyE;IACzE,QAAQ,CAAC,oBAAoB,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACrE;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,SAAS,GAAE,iBAAsB,GAChC,iBAAiB,CAYnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Resolve declared input defaults, then layer CLI overrides on top. */
|
|
2
|
+
export function resolveRecipeInputs(recipe, overrides = {}) {
|
|
3
|
+
const values = {};
|
|
4
|
+
for (const input of recipe.inputs) {
|
|
5
|
+
values[input.id] = overrides[input.id] ?? input.default;
|
|
6
|
+
}
|
|
7
|
+
// Preserve overrides that don't correspond to a declared input (forward-compat).
|
|
8
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
9
|
+
if (!(key in values)) {
|
|
10
|
+
values[key] = value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return values;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/recipes/types.ts"],"names":[],"mappings":"AA0EA,wEAAwE;AACxE,MAAM,UAAU,mBAAmB,CACjC,MAAmB,EACnB,YAA+B,EAAE;IAEjC,MAAM,MAAM,GAAuC,EAAE,CAAC;IACtD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC;IAC1D,CAAC;IACD,iFAAiF;IACjF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WithChannel } from "./init.js";
|
|
2
|
+
import type { AgentRecipe, RecipeInputValues } from "./recipes/index.js";
|
|
3
|
+
export interface SetupPromptSource {
|
|
4
|
+
question(prompt: string): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export interface SecretChecklistItem {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly envVar?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CollectSetupOptions {
|
|
13
|
+
readonly prompt: SetupPromptSource;
|
|
14
|
+
readonly recipe?: AgentRecipe;
|
|
15
|
+
readonly model?: string;
|
|
16
|
+
readonly fallbackModels?: readonly string[];
|
|
17
|
+
readonly withChannels?: readonly WithChannel[];
|
|
18
|
+
readonly recipes?: readonly AgentRecipe[];
|
|
19
|
+
}
|
|
20
|
+
export interface CollectedSetupOptions {
|
|
21
|
+
readonly recipe: AgentRecipe;
|
|
22
|
+
readonly recipeInputs: RecipeInputValues;
|
|
23
|
+
readonly fallbackModels: readonly string[];
|
|
24
|
+
readonly withChannels: readonly WithChannel[];
|
|
25
|
+
readonly secrets: readonly SecretChecklistItem[];
|
|
26
|
+
}
|
|
27
|
+
export declare function collectSetupOptions(options: CollectSetupOptions): Promise<CollectedSetupOptions>;
|
|
28
|
+
export declare function renderSetupRecipeMenu(recipes?: readonly AgentRecipe[]): string;
|
|
29
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAe,MA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ANNELS } from "./init.js";
|
|
2
|
+
import { RECIPE_CATALOG } from "./recipes/index.js";
|
|
3
|
+
export async function collectSetupOptions(options) {
|
|
4
|
+
const recipes = options.recipes ?? RECIPE_CATALOG;
|
|
5
|
+
const recipe = options.recipe ?? await promptForRecipe(options.prompt, recipes);
|
|
6
|
+
const recipeInputs = {};
|
|
7
|
+
const secrets = [];
|
|
8
|
+
for (const input of recipe.inputs) {
|
|
9
|
+
if (input.secret === true) {
|
|
10
|
+
secrets.push(secretChecklistItem(input));
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const defaultValue = input.id === "model" && options.model !== undefined ? options.model : input.default;
|
|
14
|
+
const answer = await options.prompt.question(inputPrompt(input, defaultValue));
|
|
15
|
+
const value = answer.trim();
|
|
16
|
+
if (value.length > 0) {
|
|
17
|
+
recipeInputs[input.id] = value;
|
|
18
|
+
}
|
|
19
|
+
else if (defaultValue !== undefined) {
|
|
20
|
+
recipeInputs[input.id] = defaultValue;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const fallbackModels = await promptForFallbackModels(options.prompt, options.fallbackModels ?? []);
|
|
24
|
+
const withChannels = await promptForWithChannels(options.prompt, options.withChannels ?? []);
|
|
25
|
+
return { recipe, recipeInputs, fallbackModels, withChannels, secrets };
|
|
26
|
+
}
|
|
27
|
+
export function renderSetupRecipeMenu(recipes = RECIPE_CATALOG) {
|
|
28
|
+
return recipes
|
|
29
|
+
.map((recipe, index) => {
|
|
30
|
+
const tags = recipe.tags.length === 0 ? "" : ` (${recipe.tags.join(", ")})`;
|
|
31
|
+
return `${index + 1}. ${recipe.id} [risk: ${recipe.riskLevel}] - ${recipe.title}${tags}`;
|
|
32
|
+
})
|
|
33
|
+
.join("\n");
|
|
34
|
+
}
|
|
35
|
+
function inputPrompt(input, defaultValue) {
|
|
36
|
+
const suffix = defaultValue === undefined ? "" : ` [${defaultValue}]`;
|
|
37
|
+
return `${input.label}${suffix}\n${input.description}\n> `;
|
|
38
|
+
}
|
|
39
|
+
function secretChecklistItem(input) {
|
|
40
|
+
return {
|
|
41
|
+
id: input.id,
|
|
42
|
+
label: input.label,
|
|
43
|
+
description: input.description,
|
|
44
|
+
...(input.envVar === undefined ? {} : { envVar: input.envVar }),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function promptForRecipe(prompt, recipes) {
|
|
48
|
+
if (recipes.length === 0) {
|
|
49
|
+
throw new Error("No setup recipes are available.");
|
|
50
|
+
}
|
|
51
|
+
for (;;) {
|
|
52
|
+
const answer = await prompt.question(`Choose a recipe:\n${renderSetupRecipeMenu(recipes)}\nRecipe [1]: `);
|
|
53
|
+
const selected = parseRecipeChoice(answer, recipes);
|
|
54
|
+
if (selected !== undefined) {
|
|
55
|
+
return selected;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function parseRecipeChoice(answer, recipes) {
|
|
60
|
+
const value = answer.trim();
|
|
61
|
+
if (value.length === 0) {
|
|
62
|
+
return recipes[0];
|
|
63
|
+
}
|
|
64
|
+
const index = Number(value);
|
|
65
|
+
if (Number.isInteger(index) && index >= 1 && index <= recipes.length) {
|
|
66
|
+
return recipes[index - 1];
|
|
67
|
+
}
|
|
68
|
+
return recipes.find((recipe) => recipe.id === value);
|
|
69
|
+
}
|
|
70
|
+
async function promptForWithChannels(prompt, defaults) {
|
|
71
|
+
const defaultText = defaults.length === 0 ? "none" : defaults.join(",");
|
|
72
|
+
for (;;) {
|
|
73
|
+
const answer = await prompt.question(`Enable add-on channels (${WITH_CHANNELS.join(", ")}) [${defaultText}]: `);
|
|
74
|
+
const raw = answer.trim();
|
|
75
|
+
if (raw.length === 0) {
|
|
76
|
+
return defaults;
|
|
77
|
+
}
|
|
78
|
+
const parsed = raw.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
79
|
+
const invalid = parsed.filter((entry) => !WITH_CHANNELS.includes(entry));
|
|
80
|
+
if (invalid.length === 0) {
|
|
81
|
+
return parsed;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function promptForFallbackModels(prompt, defaults) {
|
|
86
|
+
const defaultText = defaults.length === 0 ? "none" : defaults.join(",");
|
|
87
|
+
const answer = await prompt.question(`Fallback models, comma-separated [${defaultText}]: `);
|
|
88
|
+
const raw = answer.trim();
|
|
89
|
+
if (raw.length === 0) {
|
|
90
|
+
return defaults;
|
|
91
|
+
}
|
|
92
|
+
if (raw.toLowerCase() === "none") {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
return raw.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0);
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA+BpD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAA4B;IACpE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC;IAClD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChF,MAAM,YAAY,GAAuC,EAAE,CAAC;IAC5D,MAAM,OAAO,GAA0B,EAAE,CAAC;IAE1C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;YACzC,SAAS;QACX,CAAC;QACD,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,KAAK,OAAO,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,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E,CAAC,CAAE,aAAmC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAChG,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,MAAuB,CAAC;QACjC,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,uBAAuB,CACpC,MAAyB,EACzB,QAA2B;IAE3B,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,qCAAqC,WAAW,KAAK,CAAC,CAAC;IAC5F,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACzF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mono-agent/agent-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
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.
|
|
36
|
-
"@mono-agent/agent-harness": "0.
|
|
37
|
-
"@mono-agent/config": "0.
|
|
38
|
-
"@mono-agent/cron-adapter": "0.
|
|
39
|
-
"@mono-agent/operator-adapter": "0.
|
|
40
|
-
"@mono-agent/memory": "0.
|
|
41
|
-
"@mono-agent/observability": "0.
|
|
42
|
-
"@mono-agent/openai-api-adapter": "0.
|
|
43
|
-
"@mono-agent/runtime-adapter": "0.
|
|
44
|
-
"@mono-agent/session-web": "0.
|
|
45
|
-
"@mono-agent/slack-adapter": "0.
|
|
46
|
-
"@mono-agent/telegram-adapter": "0.
|
|
47
|
-
"@mono-agent/tui": "0.
|
|
48
|
-
"@mono-agent/webhook-adapter": "0.
|
|
35
|
+
"@mono-agent/agent-contracts": "0.11.0",
|
|
36
|
+
"@mono-agent/agent-harness": "0.11.0",
|
|
37
|
+
"@mono-agent/config": "0.11.0",
|
|
38
|
+
"@mono-agent/cron-adapter": "0.11.0",
|
|
39
|
+
"@mono-agent/operator-adapter": "0.11.0",
|
|
40
|
+
"@mono-agent/memory": "0.11.0",
|
|
41
|
+
"@mono-agent/observability": "0.11.0",
|
|
42
|
+
"@mono-agent/openai-api-adapter": "0.11.0",
|
|
43
|
+
"@mono-agent/runtime-adapter": "0.11.0",
|
|
44
|
+
"@mono-agent/session-web": "0.11.0",
|
|
45
|
+
"@mono-agent/slack-adapter": "0.11.0",
|
|
46
|
+
"@mono-agent/telegram-adapter": "0.11.0",
|
|
47
|
+
"@mono-agent/tui": "0.11.0",
|
|
48
|
+
"@mono-agent/webhook-adapter": "0.11.0",
|
|
49
49
|
"undici": "8.7.0",
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
@@ -27,7 +27,7 @@ Every framework capability and how a composed agent reaches it. This table is th
|
|
|
27
27
|
| Selected skills from a skills root | config | `context.skillsRoot`, `context.selectedSkills` |
|
|
28
28
|
| Generated project configuration skills with progressive disclosure | config + cli | init selects `mono-agent-configure` + `mono-agent-memory` under `./skills` with `context.skillDisclosure: "index"`; drift: `mono-agent install-skill --project --check\|--update` |
|
|
29
29
|
| Per-skill byte cap | config | `context.skillMaxBytes` |
|
|
30
|
-
| Conversation history (
|
|
30
|
+
| Conversation history (owner-only durable store) | auto | 64 messages per exact conversation id independent of `runtime.maxTurns`; aggregate defaults 256 MiB / 10,000 conversations / 365 inactive days; staged atomic publication and post-commit pruning; custom store via code |
|
|
31
31
|
| Lite memory (FTS keyword recall + rapid-log capture; no external deps) | config | `memory.mode: "lite"`, `path`, `maxBytes`, `writeMode` |
|
|
32
32
|
| Journal memory (hybrid recall BM25+vector + salience decay; needs configured embeddings) | config | `memory.mode: "journal"`, `path`, `memory.embeddings.{provider,endpoint,model,dim,apiKeyEnv}` (`provider: "ollama" | "lmstudio" | "openai"`; exclusive, no cross-provider fallback) |
|
|
33
33
|
| BuJo memory (journal + LLM capture/reconcile ADD/UPDATE/SUPERSEDE/NOOP + entity graph + auto-scheduled consolidation; needs embeddings + an app-level `memory.llm`) | config | `memory.mode: "bujo"`, `path`; selected Ollama/LM Studio/OpenAI embeddings are independent from explicit `memory.llm` with `provider: "ollama"` (`model`, optional `endpoint`) or `provider: "agent-host"` (`model` is an SDK runtime model ref, optional `executionMode: "sdk"`) — see `docs/memory/index.md` |
|
|
@@ -45,6 +45,7 @@ Every framework capability and how a composed agent reaches it. This table is th
|
|
|
45
45
|
| Allow-all tool policy (omitted / `["*"]` = all tools; `[]` = none) | config | default `tools.allowedTools`; the harness no-policy safety net is `failClosedToolPolicy()` |
|
|
46
46
|
| Tool allow/deny lists (deny wins, even under allow-all; pi doesn't deny external MCP tools) | config | `tools.allowedTools`, `tools.disallowedTools` |
|
|
47
47
|
| MCP servers (stdio/sse/http) from a JSON file | config | `tools.mcpConfigPath` |
|
|
48
|
+
| Durable origin-bound continuations for trusted stdio/loopback-HTTP MCP services | config + auto | `tools.continuationServers` + `continuations.*`; interactive claims pin a bounded immutable origin snapshot before commit, exact rollover buckets are preserved, v3 state is restart-safe, and unavailable/legacy snapshots use a fixed zero-model fallback |
|
|
48
49
|
| Adapter-derived send tools for enabled Slack/Telegram adapters | config | auto-available under allow-all once the channel is enabled; a **specific** `tools.allowedTools` must include `SlackSendMessage` / `TelegramSendMessage`; valid `slack.*` / `telegram.*` config and existing adapter allowlists provide credentials and destination bounds |
|
|
49
50
|
| Sandbox on/off + srt engine (Pi-owned tools; direct Codex has its own sandbox, Claude/direct OpenCode reject native mono policy) | config | `sandbox.mode` |
|
|
50
51
|
| Network policy (none/localhost/allowlist/all) | config | `sandbox.network.{mode,allowlist}` |
|