@mono-agent/agent-app 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +7 -0
  2. package/dist/adapter-send-tools.d.ts +7 -7
  3. package/dist/adapter-send-tools.d.ts.map +1 -1
  4. package/dist/adapter-send-tools.js +59 -50
  5. package/dist/adapter-send-tools.js.map +1 -1
  6. package/dist/app.js +8 -8
  7. package/dist/app.js.map +1 -1
  8. package/dist/channels.js +3 -3
  9. package/dist/channels.js.map +1 -1
  10. package/dist/cli.d.ts +28 -10
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +287 -164
  13. package/dist/cli.js.map +1 -1
  14. package/dist/config-reference.js +4 -4
  15. package/dist/config-reference.js.map +1 -1
  16. package/dist/consumer-contract.d.ts.map +1 -1
  17. package/dist/consumer-contract.js +5 -3
  18. package/dist/consumer-contract.js.map +1 -1
  19. package/dist/doctor.d.ts.map +1 -1
  20. package/dist/doctor.js +131 -7
  21. package/dist/doctor.js.map +1 -1
  22. package/dist/init.d.ts +11 -22
  23. package/dist/init.d.ts.map +1 -1
  24. package/dist/init.js +25 -116
  25. package/dist/init.js.map +1 -1
  26. package/dist/interaction-bridge.d.ts +3 -3
  27. package/dist/interaction-bridge.d.ts.map +1 -1
  28. package/dist/memory-recall.d.ts +2 -2
  29. package/dist/memory-recall.d.ts.map +1 -1
  30. package/dist/memory-recall.js +3 -3
  31. package/dist/memory-recall.js.map +1 -1
  32. package/dist/modules/base.d.ts +25 -0
  33. package/dist/modules/base.d.ts.map +1 -0
  34. package/dist/{recipes → modules}/base.js +17 -11
  35. package/dist/modules/base.js.map +1 -0
  36. package/dist/modules/catalog.d.ts +12 -0
  37. package/dist/modules/catalog.d.ts.map +1 -0
  38. package/dist/modules/catalog.js +412 -0
  39. package/dist/modules/catalog.js.map +1 -0
  40. package/dist/modules/index.d.ts +8 -0
  41. package/dist/modules/index.d.ts.map +1 -0
  42. package/dist/modules/index.js +5 -0
  43. package/dist/modules/index.js.map +1 -0
  44. package/dist/modules/known-tools.d.ts +44 -0
  45. package/dist/modules/known-tools.d.ts.map +1 -0
  46. package/dist/modules/known-tools.js +88 -0
  47. package/dist/modules/known-tools.js.map +1 -0
  48. package/dist/modules/types.d.ts +73 -0
  49. package/dist/modules/types.d.ts.map +1 -0
  50. package/dist/{recipes → modules}/types.js +3 -3
  51. package/dist/{recipes → modules}/types.js.map +1 -1
  52. package/dist/posted-message-index.d.ts +2 -2
  53. package/dist/posted-message-index.js +2 -2
  54. package/dist/provider-setup.d.ts +44 -0
  55. package/dist/provider-setup.d.ts.map +1 -0
  56. package/dist/provider-setup.js +174 -0
  57. package/dist/provider-setup.js.map +1 -0
  58. package/dist/wizard/answers.d.ts +87 -0
  59. package/dist/wizard/answers.d.ts.map +1 -0
  60. package/dist/wizard/answers.js +244 -0
  61. package/dist/wizard/answers.js.map +1 -0
  62. package/dist/wizard/from-flags.d.ts +27 -0
  63. package/dist/wizard/from-flags.d.ts.map +1 -0
  64. package/dist/wizard/from-flags.js +45 -0
  65. package/dist/wizard/from-flags.js.map +1 -0
  66. package/dist/wizard/index.d.ts +11 -0
  67. package/dist/wizard/index.d.ts.map +1 -0
  68. package/dist/wizard/index.js +6 -0
  69. package/dist/wizard/index.js.map +1 -0
  70. package/dist/wizard/model-discovery.d.ts +35 -0
  71. package/dist/wizard/model-discovery.d.ts.map +1 -0
  72. package/dist/wizard/model-discovery.js +239 -0
  73. package/dist/wizard/model-discovery.js.map +1 -0
  74. package/dist/wizard/presets.d.ts +40 -0
  75. package/dist/wizard/presets.d.ts.map +1 -0
  76. package/dist/wizard/presets.js +85 -0
  77. package/dist/wizard/presets.js.map +1 -0
  78. package/dist/wizard/prompts.d.ts +55 -0
  79. package/dist/wizard/prompts.d.ts.map +1 -0
  80. package/dist/wizard/prompts.js +152 -0
  81. package/dist/wizard/prompts.js.map +1 -0
  82. package/dist/wizard/run.d.ts +20 -0
  83. package/dist/wizard/run.d.ts.map +1 -0
  84. package/dist/wizard/run.js +374 -0
  85. package/dist/wizard/run.js.map +1 -0
  86. package/package.json +17 -16
  87. package/schema/mono-agent.config.schema.json +5 -3
  88. package/skills/mono-agent-composer/SKILL.md +8 -8
  89. package/skills/mono-agent-composer/references/config-blueprint.md +7 -7
  90. package/skills/mono-agent-composer/references/discovery-questions.md +13 -10
  91. package/skills/mono-agent-composer/references/feature-coverage.md +12 -10
  92. package/skills/mono-agent-composer/references/package-map.md +7 -6
  93. package/skills/mono-agent-composer/references/playbooks.md +22 -22
  94. package/skills/mono-agent-composer/references/validation.md +3 -3
  95. package/dist/recipes/base.d.ts +0 -15
  96. package/dist/recipes/base.d.ts.map +0 -1
  97. package/dist/recipes/base.js.map +0 -1
  98. package/dist/recipes/catalog.d.ts +0 -4
  99. package/dist/recipes/catalog.d.ts.map +0 -1
  100. package/dist/recipes/catalog.js +0 -525
  101. package/dist/recipes/catalog.js.map +0 -1
  102. package/dist/recipes/index.d.ts +0 -11
  103. package/dist/recipes/index.d.ts.map +0 -1
  104. package/dist/recipes/index.js +0 -14
  105. package/dist/recipes/index.js.map +0 -1
  106. package/dist/recipes/types.d.ts +0 -70
  107. package/dist/recipes/types.d.ts.map +0 -1
  108. package/dist/setup.d.ts +0 -29
  109. package/dist/setup.d.ts.map +0 -1
  110. package/dist/setup.js +0 -97
  111. package/dist/setup.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ export { resolveModuleInputs } from "./types.js";
2
+ export { baseConfig, DEFAULT_MODEL, memoryBlock, MODEL_INPUT } from "./base.js";
3
+ export { ADAPTER_SEND_TOOL_NAMES, ALLOW_ALL_TOOLS, BUILTIN_TOOL_NAMES, canonicalToolName, DEFAULT_SAFE_TOOLS, isAllowAllTools, isKnownToolName, isMcpToolName, LEGACY_TOOL_ALIASES, suggestToolName, } from "./known-tools.js";
4
+ export { CAPABILITY_MODULES, findModule, modulesByKind } from "./catalog.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhF,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The single source of truth for tool names, shared by the wizard, doctor, and
3
+ * tests. Names are exact and case-sensitive, verified against the runtime's
4
+ * `pi-bridge.js` (built-ins) and `adapter-send-tools.ts` (adapter send tools).
5
+ */
6
+ import { ALLOW_ALL_TOOLS } from "@mono-agent/config";
7
+ /** Re-export the allow-all sentinel so agent-app callers share one canonical value. */
8
+ export { ALLOW_ALL_TOOLS };
9
+ /** Built-in tools gated by `tools.allowedTools` (pi-bridge.js). */
10
+ export declare const BUILTIN_TOOL_NAMES: readonly ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "WebFetch", "WebSearch"];
11
+ /** Adapter send tools — require BOTH an `allowedTools` entry AND an enabled channel. */
12
+ export declare const ADAPTER_SEND_TOOL_NAMES: readonly ["SlackSendMessage", "TelegramSendMessage", "TelegramAskButtons", "TelegramSendFile", "AskUser"];
13
+ /**
14
+ * Old snake_case tool names accepted as INPUT aliases so existing fleet/user
15
+ * configs keep working after the PascalCase rename. Each maps to its canonical
16
+ * new name; `telegram_send_document`/`telegram_send_photo` both collapse to the
17
+ * single `TelegramSendFile` tool. The allow/deny matcher and doctor normalize
18
+ * through this map — the new PascalCase names are the only ones ever registered,
19
+ * emitted, or recommended.
20
+ */
21
+ export declare const LEGACY_TOOL_ALIASES: Record<string, string>;
22
+ /** The canonical new name for a tool, resolving a legacy snake_case alias if given. */
23
+ export declare function canonicalToolName(name: string): string;
24
+ /** Safe read-only default pre-checked for every new agent. */
25
+ export declare const DEFAULT_SAFE_TOOLS: readonly ["Read", "Glob", "Grep"];
26
+ export type BuiltinToolName = (typeof BUILTIN_TOOL_NAMES)[number];
27
+ export type AdapterSendToolName = (typeof ADAPTER_SEND_TOOL_NAMES)[number];
28
+ /**
29
+ * True when `name` is a built-in, an adapter send tool, or a canonical alias-value
30
+ * name (exact, case-sensitive match). Legacy snake_case alias KEYS are also accepted
31
+ * so an old config keeps validating cleanly through the rename.
32
+ */
33
+ export declare function isKnownToolName(name: string): boolean;
34
+ /** True when `list` contains the global allow-all sentinel (`"*"`). */
35
+ export declare function isAllowAllTools(list: readonly string[]): boolean;
36
+ /** True when `name` targets an MCP server tool (`mcp__…`) — cannot be validated offline. */
37
+ export declare function isMcpToolName(name: string): boolean;
38
+ /**
39
+ * The closest known tool name for a typo, case-insensitive (e.g. `read` → `Read`),
40
+ * else undefined. Used by doctor for "did you mean" hints. Matches
41
+ * case-insensitively against the known set (BUILTIN ∪ ADAPTER_SEND ∪ alias values).
42
+ */
43
+ export declare function suggestToolName(name: string): string | undefined;
44
+ //# sourceMappingURL=known-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"known-tools.d.ts","sourceRoot":"","sources":["../../src/modules/known-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,uFAAuF;AACvF,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,qFASrB,CAAC;AAEX,wFAAwF;AACxF,eAAO,MAAM,uBAAuB,2GAM1B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUtD,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,8DAA8D;AAC9D,eAAO,MAAM,kBAAkB,mCAAoC,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAa3E;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAEhE;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGhE"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The single source of truth for tool names, shared by the wizard, doctor, and
3
+ * tests. Names are exact and case-sensitive, verified against the runtime's
4
+ * `pi-bridge.js` (built-ins) and `adapter-send-tools.ts` (adapter send tools).
5
+ */
6
+ import { ALLOW_ALL_TOOLS } from "@mono-agent/config";
7
+ /** Re-export the allow-all sentinel so agent-app callers share one canonical value. */
8
+ export { ALLOW_ALL_TOOLS };
9
+ /** Built-in tools gated by `tools.allowedTools` (pi-bridge.js). */
10
+ export const BUILTIN_TOOL_NAMES = [
11
+ "Read",
12
+ "Write",
13
+ "Edit",
14
+ "Glob",
15
+ "Grep",
16
+ "Bash",
17
+ "WebFetch",
18
+ "WebSearch",
19
+ ];
20
+ /** Adapter send tools — require BOTH an `allowedTools` entry AND an enabled channel. */
21
+ export const ADAPTER_SEND_TOOL_NAMES = [
22
+ "SlackSendMessage",
23
+ "TelegramSendMessage",
24
+ "TelegramAskButtons",
25
+ "TelegramSendFile",
26
+ "AskUser",
27
+ ];
28
+ /**
29
+ * Old snake_case tool names accepted as INPUT aliases so existing fleet/user
30
+ * configs keep working after the PascalCase rename. Each maps to its canonical
31
+ * new name; `telegram_send_document`/`telegram_send_photo` both collapse to the
32
+ * single `TelegramSendFile` tool. The allow/deny matcher and doctor normalize
33
+ * through this map — the new PascalCase names are the only ones ever registered,
34
+ * emitted, or recommended.
35
+ */
36
+ export const LEGACY_TOOL_ALIASES = {
37
+ slack_send_message: "SlackSendMessage",
38
+ telegram_send_message: "TelegramSendMessage",
39
+ telegram_ask: "TelegramAskButtons",
40
+ telegram_send_document: "TelegramSendFile",
41
+ telegram_send_photo: "TelegramSendFile",
42
+ ask_user: "AskUser",
43
+ memory_recall: "MemoryRecall",
44
+ read_skill: "ReadSkill",
45
+ ask_collaborator: "AskCollaborator",
46
+ };
47
+ /** The canonical new name for a tool, resolving a legacy snake_case alias if given. */
48
+ export function canonicalToolName(name) {
49
+ return LEGACY_TOOL_ALIASES[name] ?? name;
50
+ }
51
+ /** Safe read-only default pre-checked for every new agent. */
52
+ export const DEFAULT_SAFE_TOOLS = ["Read", "Glob", "Grep"];
53
+ /**
54
+ * All offline-knowable tool names: built-ins, adapter send tools, AND the canonical
55
+ * PascalCase names that only exist as alias VALUES (`ReadSkill`, `AskCollaborator`,
56
+ * `MemoryRecall`). Folding in the alias values keeps the new
57
+ * canonical names at least as "known" as their deprecated snake_case spellings — a
58
+ * config listing `ReadSkill` must validate as cleanly as one listing `read_skill`.
59
+ */
60
+ const KNOWN_TOOL_NAMES = [
61
+ ...new Set([...BUILTIN_TOOL_NAMES, ...ADAPTER_SEND_TOOL_NAMES, ...Object.values(LEGACY_TOOL_ALIASES)]),
62
+ ];
63
+ /**
64
+ * True when `name` is a built-in, an adapter send tool, or a canonical alias-value
65
+ * name (exact, case-sensitive match). Legacy snake_case alias KEYS are also accepted
66
+ * so an old config keeps validating cleanly through the rename.
67
+ */
68
+ export function isKnownToolName(name) {
69
+ return name === ALLOW_ALL_TOOLS || KNOWN_TOOL_NAMES.includes(name) || name in LEGACY_TOOL_ALIASES;
70
+ }
71
+ /** True when `list` contains the global allow-all sentinel (`"*"`). */
72
+ export function isAllowAllTools(list) {
73
+ return list.includes(ALLOW_ALL_TOOLS);
74
+ }
75
+ /** True when `name` targets an MCP server tool (`mcp__…`) — cannot be validated offline. */
76
+ export function isMcpToolName(name) {
77
+ return name.startsWith("mcp__");
78
+ }
79
+ /**
80
+ * The closest known tool name for a typo, case-insensitive (e.g. `read` → `Read`),
81
+ * else undefined. Used by doctor for "did you mean" hints. Matches
82
+ * case-insensitively against the known set (BUILTIN ∪ ADAPTER_SEND ∪ alias values).
83
+ */
84
+ export function suggestToolName(name) {
85
+ const lowered = name.toLowerCase();
86
+ return KNOWN_TOOL_NAMES.find((known) => known.toLowerCase() === lowered);
87
+ }
88
+ //# sourceMappingURL=known-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"known-tools.js","sourceRoot":"","sources":["../../src/modules/known-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,uFAAuF;AACvF,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,mEAAmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,WAAW;CACH,CAAC;AAEX,wFAAwF;AACxF,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,SAAS;CACD,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,kBAAkB,EAAE,kBAAkB;IACtC,qBAAqB,EAAE,qBAAqB;IAC5C,YAAY,EAAE,oBAAoB;I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"}
@@ -0,0 +1,73 @@
1
+ import type { MonoAgentConfigJson } from "@mono-agent/config";
2
+ import type { ValidationStatus } from "../doctor.js";
3
+ /** The kind of capability a module contributes, used to group the wizard's steps. */
4
+ export type ModuleKind = "channel" | "memory" | "sandbox" | "observability" | "provider";
5
+ /**
6
+ * A value a module templates against. Non-secret inputs carry a default and may
7
+ * be overridden by the wizard/CLI; secret inputs are never written into JSON —
8
+ * they only emit a `.env.example` placeholder via {@link CapabilityModule.envExampleLines}.
9
+ * (Same shape as the old `RecipeInput`.)
10
+ */
11
+ export interface ModuleInput {
12
+ readonly id: string;
13
+ readonly label: string;
14
+ readonly description: string;
15
+ /** Default used when the wizard/CLI does not override the input. */
16
+ readonly default?: string;
17
+ /** Secret inputs are externalized to `.env.example`, never inlined in JSON. */
18
+ readonly secret?: boolean;
19
+ /** The `MONO_AGENT_*` env var a secret input maps to (for `.env.example`). */
20
+ readonly envVar?: string;
21
+ }
22
+ /** Resolved input values keyed by {@link ModuleInput.id}. */
23
+ export type ModuleInputValues = Readonly<Record<string, string | undefined>>;
24
+ /** An auxiliary file a module scaffolds beside the config (e.g. a cron job markdown). */
25
+ export interface GeneratedFile {
26
+ /** Path relative to the agent folder. */
27
+ readonly path: string;
28
+ readonly contents: string;
29
+ }
30
+ /**
31
+ * A capability a module promises once its secrets are filled in. The composer
32
+ * checks each expectation against the doctor report and reports the module as
33
+ * incomplete when a required section is not yet at the promised status.
34
+ */
35
+ export interface ModuleValidateExpectation {
36
+ /** Doctor section id: `runtime|memory|sandbox|tools|observability|channel:<driver>`. */
37
+ readonly sectionId: string;
38
+ /** The status the section must reach for the module to be considered live. */
39
+ readonly mustBe: ValidationStatus;
40
+ /** Human note explaining what to do if the expectation is unmet. */
41
+ readonly note?: string;
42
+ }
43
+ /**
44
+ * A composable capability: a partial config fragment plus the inputs, secrets,
45
+ * tools, and validate-expectations it owns. The composer spreads fragments onto
46
+ * a shared base skeleton — a module never writes secrets into the config and only
47
+ * emits JSON the existing loader already accepts.
48
+ */
49
+ export interface CapabilityModule {
50
+ /** `channel:telegram`, `memory:bujo`, `sandbox`, `observability:phoenix`, ... */
51
+ readonly id: string;
52
+ readonly kind: ModuleKind;
53
+ readonly title: string;
54
+ /** One-line wizard hint. */
55
+ readonly summary: string;
56
+ readonly riskLevel: "low" | "medium" | "high";
57
+ /** The `docs/playbooks/<file>` this module mirrors, parity-checked to exist. */
58
+ readonly playbook?: string;
59
+ readonly inputs: readonly ModuleInput[];
60
+ /** Partial config this module contributes; composed onto the base skeleton. */
61
+ readonly configFragment: (values: ModuleInputValues) => Partial<MonoAgentConfigJson> & Record<string, unknown>;
62
+ /** `.env.example` placeholder lines for this module's secrets (no trailing newline per line). */
63
+ readonly envExampleLines?: (values: ModuleInputValues) => readonly string[];
64
+ /** `allowedTools` entries this capability wants (pre-checked in the wizard tools step). */
65
+ readonly recommendedTools?: readonly string[];
66
+ /** Extra files to scaffold (cron job markdown, etc.). */
67
+ readonly files?: (values: ModuleInputValues) => readonly GeneratedFile[];
68
+ /** Capabilities the composer checks once secrets are supplied. */
69
+ readonly validateExpectations: readonly ModuleValidateExpectation[];
70
+ }
71
+ /** Resolve declared input defaults, then layer overrides on top. */
72
+ export declare function resolveModuleInputs(module: CapabilityModule, overrides?: ModuleInputValues): ModuleInputValues;
73
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/modules/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,GAAG,UAAU,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB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EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/G,iGAAiG;IACjG,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,SAAS,MAAM,EAAE,CAAC;IAC5E,2FAA2F;IAC3F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,yDAAyD;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,SAAS,aAAa,EAAE,CAAC;IACzE,kEAAkE;IAClE,QAAQ,CAAC,oBAAoB,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACrE;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,SAAS,GAAE,iBAAsB,GAChC,iBAAiB,CAYnB"}
@@ -1,7 +1,7 @@
1
- /** Resolve declared input defaults, then layer CLI overrides on top. */
2
- export function resolveRecipeInputs(recipe, overrides = {}) {
1
+ /** Resolve declared input defaults, then layer overrides on top. */
2
+ export function resolveModuleInputs(module, overrides = {}) {
3
3
  const values = {};
4
- for (const input of recipe.inputs) {
4
+ for (const input of module.inputs) {
5
5
  values[input.id] = overrides[input.id] ?? input.default;
6
6
  }
7
7
  // Preserve overrides that don't correspond to a declared input (forward-compat).
@@ -1 +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"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/modules/types.ts"],"names":[],"mappings":"AA8EA,oEAAoE;AACpE,MAAM,UAAU,mBAAmB,CACjC,MAAwB,EACxB,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"}
@@ -5,14 +5,14 @@
5
5
  *
6
6
  * Why this exists: a scheduled/proactive post (e.g. a daily digest) runs under a
7
7
  * synthetic conversationId (e.g. `scheduled-scan`) and posts via
8
- * `slack_send_message`, which registers no `slack:` conversation. When the user
8
+ * `SlackSendMessage`, which registers no `slack:` conversation. When the user
9
9
  * replies, the Slack adapter derives `slack:<channel>:<posted-ts>` — an id with no
10
10
  * history. This index closes that gap: the producer records `(channel, ts) →
11
11
  * producing conversationId`; the consumer (inbound dispatch) looks it up and
12
12
  * aliases the reply onto the producing conversation.
13
13
  *
14
14
  * Storage is an append-only JSONL file inside the run-artifact dir. Append-only
15
- * keeps cross-process writes safe: the `slack_send_message` child process and the
15
+ * keeps cross-process writes safe: the `SlackSendMessage` child process and the
16
16
  * adapter both only ever append (small `O_APPEND` writes are atomic), and only the
17
17
  * single adapter process compacts. A `.jsonl` file is ignored by the
18
18
  * `.summary.json` artifact scanners (see `seen-conversations.ts`), so it never
@@ -7,14 +7,14 @@ import { dirname, join } from "node:path";
7
7
  *
8
8
  * Why this exists: a scheduled/proactive post (e.g. a daily digest) runs under a
9
9
  * synthetic conversationId (e.g. `scheduled-scan`) and posts via
10
- * `slack_send_message`, which registers no `slack:` conversation. When the user
10
+ * `SlackSendMessage`, which registers no `slack:` conversation. When the user
11
11
  * replies, the Slack adapter derives `slack:<channel>:<posted-ts>` — an id with no
12
12
  * history. This index closes that gap: the producer records `(channel, ts) →
13
13
  * producing conversationId`; the consumer (inbound dispatch) looks it up and
14
14
  * aliases the reply onto the producing conversation.
15
15
  *
16
16
  * Storage is an append-only JSONL file inside the run-artifact dir. Append-only
17
- * keeps cross-process writes safe: the `slack_send_message` child process and the
17
+ * keeps cross-process writes safe: the `SlackSendMessage` child process and the
18
18
  * adapter both only ever append (small `O_APPEND` writes are atomic), and only the
19
19
  * single adapter process compacts. A `.jsonl` file is ignored by the
20
20
  * `.summary.json` artifact scanners (see `seen-conversations.ts`), so it never
@@ -0,0 +1,44 @@
1
+ import { spawn } from "node:child_process";
2
+ export type ProviderSetupKind = "auth" | "preflight";
3
+ export type ProviderSetupAction = {
4
+ readonly id: string;
5
+ readonly kind: ProviderSetupKind;
6
+ readonly label: string;
7
+ readonly modelRefs: readonly string[];
8
+ readonly command: readonly [string, ...string[]];
9
+ readonly cwd: string;
10
+ readonly detail: string;
11
+ } | {
12
+ readonly id: string;
13
+ readonly kind: ProviderSetupKind;
14
+ readonly label: string;
15
+ readonly modelRefs: readonly string[];
16
+ readonly url: string;
17
+ readonly cwd: string;
18
+ readonly detail: string;
19
+ };
20
+ export interface ProviderSetupPlan {
21
+ readonly actions: readonly ProviderSetupAction[];
22
+ }
23
+ export type ProviderSetupStatus = "ok" | "failed";
24
+ export interface ProviderSetupResult {
25
+ readonly action: ProviderSetupAction;
26
+ readonly status: ProviderSetupStatus;
27
+ readonly detail: string;
28
+ }
29
+ export interface PlanProviderSetupOptions {
30
+ readonly modelRefs: readonly string[];
31
+ readonly cwd: string;
32
+ readonly piAuthPath?: string;
33
+ }
34
+ export interface ExecuteProviderSetupOptions {
35
+ readonly spawn?: typeof spawn;
36
+ readonly fetch?: typeof fetch;
37
+ }
38
+ export declare function piLoginCommand(provider: string): readonly [string, ...string[]];
39
+ export declare function piLoginCommandLine(provider: string): string;
40
+ export declare function piAuthWorkingDirectory(piAuthPath: string | undefined, cwd?: string): string;
41
+ export declare function planProviderSetup(options: PlanProviderSetupOptions): ProviderSetupPlan;
42
+ export declare function providerSetupActionCommandLine(action: ProviderSetupAction): string;
43
+ export declare function executeProviderSetupPlan(plan: ProviderSetupPlan, options?: ExecuteProviderSetupOptions): Promise<ProviderSetupResult[]>;
44
+ //# sourceMappingURL=provider-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-setup.d.ts","sourceRoot":"","sources":["../src/provider-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAM3C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,WAAW,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,SAA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C,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAE/E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,SAAgB,GAAG,MAAM,CAElG;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CA0GtF;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAKlF;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,iBAAiB,EACvB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAYhC"}
@@ -0,0 +1,174 @@
1
+ import { spawn } from "node:child_process";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join, resolve } from "node:path";
4
+ import { modelReferenceKey, parseMonoRuntimeModelReference } from "@mono-agent/runtime-adapter";
5
+ const DEFAULT_PI_AUTH_PATH = join(homedir(), ".pi", "agent", "auth.json");
6
+ export function piLoginCommand(provider) {
7
+ return ["npx", "@earendil-works/pi-ai", "login", provider];
8
+ }
9
+ export function piLoginCommandLine(provider) {
10
+ return piLoginCommand(provider).join(" ");
11
+ }
12
+ export function piAuthWorkingDirectory(piAuthPath, cwd = process.cwd()) {
13
+ return dirname(piAuthPath === undefined ? DEFAULT_PI_AUTH_PATH : resolve(cwd, piAuthPath));
14
+ }
15
+ export function planProviderSetup(options) {
16
+ const piAuthPath = options.piAuthPath ?? DEFAULT_PI_AUTH_PATH;
17
+ const actionsById = new Map();
18
+ for (const raw of options.modelRefs) {
19
+ let ref;
20
+ try {
21
+ ref = parseMonoRuntimeModelReference(raw);
22
+ }
23
+ catch {
24
+ continue;
25
+ }
26
+ const refKey = modelReferenceKey(ref);
27
+ const add = (action) => {
28
+ const existing = actionsById.get(action.id);
29
+ if (existing === undefined) {
30
+ actionsById.set(action.id, action);
31
+ return;
32
+ }
33
+ actionsById.set(action.id, {
34
+ ...existing,
35
+ modelRefs: [...new Set([...existing.modelRefs, ...action.modelRefs])],
36
+ });
37
+ };
38
+ if (ref.sdk === "claude") {
39
+ add({
40
+ id: "claude-login",
41
+ kind: "auth",
42
+ label: "Claude login",
43
+ modelRefs: [refKey],
44
+ command: ["claude", "/login"],
45
+ cwd: options.cwd,
46
+ detail: "Runs the Claude Code login flow for Claude model references.",
47
+ });
48
+ continue;
49
+ }
50
+ if (ref.sdk === "codex") {
51
+ add({
52
+ id: "codex-login",
53
+ kind: "auth",
54
+ label: "Codex login",
55
+ modelRefs: [refKey],
56
+ command: ["codex", "login"],
57
+ cwd: options.cwd,
58
+ detail: "Runs the Codex login flow for direct Codex model references.",
59
+ });
60
+ continue;
61
+ }
62
+ if (ref.sdk !== "pi" || typeof ref.provider !== "string") {
63
+ continue;
64
+ }
65
+ if (ref.provider === "ollama") {
66
+ add({
67
+ id: "ollama-list",
68
+ kind: "preflight",
69
+ label: "Ollama model preflight",
70
+ modelRefs: [refKey],
71
+ command: ["ollama", "list"],
72
+ cwd: options.cwd,
73
+ detail: "Checks that the local Ollama server and CLI can list installed models.",
74
+ });
75
+ continue;
76
+ }
77
+ if (ref.provider === "lmstudio") {
78
+ add({
79
+ id: "lmstudio-models",
80
+ kind: "preflight",
81
+ label: "LM Studio model preflight",
82
+ modelRefs: [refKey],
83
+ url: "http://localhost:1234/v1/models",
84
+ cwd: options.cwd,
85
+ detail: "Checks that LM Studio's OpenAI-compatible local server exposes models.",
86
+ });
87
+ continue;
88
+ }
89
+ if (ref.provider === "opencode-go") {
90
+ add({
91
+ id: "opencode-models",
92
+ kind: "preflight",
93
+ label: "OpenCode model preflight",
94
+ modelRefs: [refKey],
95
+ command: ["opencode", "models", "--json"],
96
+ cwd: options.cwd,
97
+ detail: "Checks that OpenCode can list configured models.",
98
+ });
99
+ continue;
100
+ }
101
+ add({
102
+ id: `pi-login:${ref.provider}`,
103
+ kind: "auth",
104
+ label: `Pi login for ${ref.provider}`,
105
+ modelRefs: [refKey],
106
+ command: piLoginCommand(ref.provider),
107
+ cwd: piAuthWorkingDirectory(piAuthPath, options.cwd),
108
+ detail: `Runs Pi auth for provider \`${ref.provider}\` from the providers.piAuthPath directory.`,
109
+ });
110
+ }
111
+ return { actions: [...actionsById.values()] };
112
+ }
113
+ export function providerSetupActionCommandLine(action) {
114
+ if ("command" in action) {
115
+ return action.command.join(" ");
116
+ }
117
+ return `GET ${action.url}`;
118
+ }
119
+ export async function executeProviderSetupPlan(plan, options = {}) {
120
+ const results = [];
121
+ for (const action of plan.actions) {
122
+ const result = "command" in action
123
+ ? await runCommandAction(action, options.spawn ?? spawn)
124
+ : await runHttpAction(action, options.fetch ?? fetch);
125
+ results.push(result);
126
+ if (result.status === "failed") {
127
+ break;
128
+ }
129
+ }
130
+ return results;
131
+ }
132
+ async function runCommandAction(action, spawnImpl) {
133
+ const [file, ...args] = action.command;
134
+ return new Promise((resolve) => {
135
+ const child = spawnImpl(file, args, {
136
+ cwd: action.cwd,
137
+ env: process.env,
138
+ stdio: "inherit",
139
+ });
140
+ child.once("error", (error) => {
141
+ resolve({ action, status: "failed", detail: error.message });
142
+ });
143
+ child.once("close", (code, signal) => {
144
+ if (code === 0) {
145
+ resolve({ action, status: "ok", detail: `${providerSetupActionCommandLine(action)} exited 0.` });
146
+ return;
147
+ }
148
+ resolve({
149
+ action,
150
+ status: "failed",
151
+ detail: signal === null
152
+ ? `${providerSetupActionCommandLine(action)} exited ${code ?? "unknown"}.`
153
+ : `${providerSetupActionCommandLine(action)} terminated by ${signal}.`,
154
+ });
155
+ });
156
+ });
157
+ }
158
+ async function runHttpAction(action, fetchImpl) {
159
+ try {
160
+ const response = await fetchImpl(action.url);
161
+ if (response.ok) {
162
+ return { action, status: "ok", detail: `GET ${action.url} returned ${response.status}.` };
163
+ }
164
+ return { action, status: "failed", detail: `GET ${action.url} returned ${response.status}.` };
165
+ }
166
+ catch (error) {
167
+ return {
168
+ action,
169
+ status: "failed",
170
+ detail: error instanceof Error ? error.message : String(error),
171
+ };
172
+ }
173
+ }
174
+ //# sourceMappingURL=provider-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-setup.js","sourceRoot":"","sources":["../src/provider-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AA+ChG,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAE1E,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,CAAC,KAAK,EAAE,uBAAuB,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,UAA8B,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IACxF,OAAO,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IACjE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC9D,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+B,CAAC;IAE3D,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACpC,IAAI,G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AAC;AACL,CAAC;AAED,KAAK,UAAU,aAAa,CAC1B,MAA8D,EAC9D,SAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;YAChB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,MAAM,CAAC,GAAG,aAAa,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;QAC5F,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,MAAM,CAAC,GAAG,aAAa,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;IAChG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM;YACN,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type { MonoAgentConfigJson } from "@mono-agent/config";
2
+ import { type CapabilityModule, type GeneratedFile, type ModuleInputValues, type ModuleValidateExpectation } from "../modules/index.js";
3
+ /**
4
+ * The complete set of choices the wizard (or a preset) makes. This is the single
5
+ * input to {@link composeWizardPlan}: everything the composer needs to emit a full
6
+ * `mono-agent.config.json`, `.env.example`, and follow-up files is derived from it.
7
+ */
8
+ export interface WizardAnswers {
9
+ readonly model: string;
10
+ readonly fallbackModels: readonly string[];
11
+ /** Optional runtime reasoning effort (`runtime.effort`), omitted for default provider behavior. */
12
+ readonly effort?: string;
13
+ /** Channel module ids, e.g. `["channel:webhook","channel:telegram"]`. */
14
+ readonly channels: readonly string[];
15
+ /** Memory module id, or `undefined` for no memory section. */
16
+ readonly memory?: string;
17
+ readonly sandbox: boolean;
18
+ readonly observability: boolean;
19
+ /** Final tool selection written into `tools.allowedTools`. */
20
+ readonly allowedTools: readonly string[];
21
+ /** Per module id → non-secret input overrides. Secret inputs are stripped by the composer. */
22
+ readonly moduleInputs: Readonly<Record<string, ModuleInputValues>>;
23
+ }
24
+ /** Folder-derived context the base skeleton needs (not from wizard inputs). */
25
+ export interface ComposeContext {
26
+ readonly dirBasename: string;
27
+ readonly skillsRootExists: boolean;
28
+ }
29
+ /**
30
+ * One secret the composed agent still needs. The CLI prints the checklist as
31
+ * `- <label>: <description>` and points the operator at `<envVar>` in `.env`.
32
+ */
33
+ export interface SecretChecklistItem {
34
+ readonly moduleId: string;
35
+ readonly label: string;
36
+ readonly envVar: string;
37
+ readonly description: string;
38
+ }
39
+ /**
40
+ * The single artifact of config generation: the JSON to write (with `$schema`),
41
+ * the optional `.env.example`, follow-up files, the secret checklist, the selected
42
+ * modules, the validate expectations, and any authoring warnings.
43
+ */
44
+ export interface WizardPlan {
45
+ readonly configJson: MonoAgentConfigJson;
46
+ /** Joined module `envExampleLines` plus a trailing newline; `undefined` when none. */
47
+ readonly envExample?: string;
48
+ readonly files: readonly GeneratedFile[];
49
+ readonly secrets: readonly SecretChecklistItem[];
50
+ readonly selectedModules: readonly CapabilityModule[];
51
+ readonly validateExpectations: readonly ModuleValidateExpectation[];
52
+ readonly warnings: readonly string[];
53
+ }
54
+ /**
55
+ * The recommended `allowedTools` for these answers: the read-only safe defaults
56
+ * plus every selected module's `recommendedTools`, deduped and ordered by the
57
+ * canonical BUILTIN∪ADAPTER position. Deterministic — no Set-iteration reliance.
58
+ */
59
+ export declare function recommendedToolSelection(answers: WizardAnswers): readonly string[];
60
+ /**
61
+ * The tools this agent auto-provisions regardless of `tools.allowedTools` — the
62
+ * "always on" set the wizard surfaces so the operator understands they are NOT gated
63
+ * by the allow-list choice. Today that is `MemoryRecall` when the memory tier enables
64
+ * recall (journal/bujo/supermemory). `ReadSkill` (skills configured) and MCP-server
65
+ * tools are also always-on when present, but the basic wizard authors neither, so they
66
+ * never appear here.
67
+ */
68
+ export declare function alwaysOnTools(answers: WizardAnswers): readonly string[];
69
+ /**
70
+ * The wizard's starting answers with `overrides` shallow-merged on top. Unless an
71
+ * explicit `allowedTools` override is supplied, `allowedTools` defaults to allow-all
72
+ * (`["*"]`) — the single choke point that flips the silent scaffold, every preset, and
73
+ * every non-interactive `--flag` path to allow-all. An explicit override is preserved
74
+ * verbatim: `["*"]`, a specific list, or `[]` (the chat-only case).
75
+ */
76
+ export declare function defaultAnswers(overrides?: Partial<WizardAnswers>): WizardAnswers;
77
+ /** Overrides for one module: the shared model plus its non-secret input values. */
78
+ export declare function moduleOverrides(module: CapabilityModule, answers: WizardAnswers): Record<string, string | undefined>;
79
+ /**
80
+ * The single config-generation path: turn wizard answers into a complete
81
+ * `WizardPlan`. Fragments are composed onto the adapter-neutral base skeleton;
82
+ * secret inputs are stripped before any fragment runs, so a secret value can never
83
+ * reach the JSON. The composed default config is byte-equal to today's `init.ts`
84
+ * scaffold except `tools.allowedTools` (filled from the wizard's tools selection).
85
+ */
86
+ export declare function composeWizardPlan(answers: WizardAnswers, ctx: ComposeContext): WizardPlan;
87
+ //# sourceMappingURL=answers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"answers.d.ts","sourceRoot":"","sources":["../../src/wizard/answers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EAKL,KAAK,gBAAgB,EAIrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAE/B,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,mGAAmG;IACnG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAA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