@femtomc/mu-agent 26.2.50 → 26.2.51

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.
@@ -1 +1 @@
1
- {"version":3,"file":"messaging-setup.d.ts","sourceRoot":"","sources":["../../src/extensions/messaging-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAA6C,MAAM,+BAA+B,CAAC;AAuiC7G,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,QA+PvD;AAED,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"messaging-setup.d.ts","sourceRoot":"","sources":["../../src/extensions/messaging-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAA6C,MAAM,+BAA+B,CAAC;AAwiC7G,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,QA0PvD;AAED,eAAe,uBAAuB,CAAC"}
@@ -763,6 +763,7 @@ function buildAgentSetupPrompt(opts) {
763
763
  const verifyFlag = normalizedBase ? ` --public-base-url ${normalizedBase}` : "";
764
764
  return interpolateTemplate(MESSAGING_SETUP_BRIEF_TEMPLATE, {
765
765
  adapter_name: adapter.name,
766
+ adapter_id: adapter.id,
766
767
  state: opts.check.state,
767
768
  config_path: opts.configPath ?? ".mu/config.json",
768
769
  route: opts.plan.route,
@@ -875,11 +876,14 @@ export function messagingSetupExtension(pi) {
875
876
  public_base_url: Type.Optional(Type.String({
876
877
  description: "Optional public base URL used to compute expected webhook endpoints (e.g. https://example.ngrok.app)",
877
878
  })),
879
+ fields: Type.Optional(Type.Record(Type.String(), Type.String(), {
880
+ description: "Config field overrides for apply action. Keys are field names (e.g. bot_token, webhook_secret), values are the secrets/tokens to write.",
881
+ })),
878
882
  });
879
883
  pi.registerTool({
880
884
  name: "mu_messaging_setup",
881
885
  label: "Messaging Setup",
882
- description: "Messaging setup workflow. Actions: check/preflight/guide/plan/apply/verify. Use plan -> apply -> verify.",
886
+ description: "Messaging setup workflow. Actions: check/preflight/guide/plan/apply/verify. For apply, pass field values via the fields parameter (e.g. fields={bot_token:'...', webhook_secret:'...'}).",
883
887
  parameters: SetupParams,
884
888
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
885
889
  const adapterId = params.adapter ? normalizeAdapterId(params.adapter) : null;
@@ -936,18 +940,14 @@ export function messagingSetupExtension(pi) {
936
940
  if (!check) {
937
941
  return textResult(`Unknown adapter: ${adapterId}`);
938
942
  }
939
- if (check.missing.length > 0) {
940
- return textResult(`Cannot apply ${adapterId}: missing required config fields (${check.missing.join(", ")}). Use /mu-setup apply ${adapterId} for guided input.`, { adapter: adapterId, missing_required_fields: check.missing });
941
- }
942
- if (!ctx.hasUI) {
943
- return textResult("Apply is blocked in non-interactive mode. Use `/mu-setup apply <adapter>` in an interactive `mu serve` session.", { adapter: adapterId, blocked: true });
944
- }
945
- const confirmed = await ctx.ui.confirm(`Apply ${adapterId} configuration?`, "This may write config and triggers control-plane reload.");
946
- if (!confirmed) {
947
- return textResult("Apply cancelled by user.", { adapter: adapterId, cancelled: true });
943
+ const overrides = params.fields ?? {};
944
+ const stillMissing = check.missing.filter((field) => !(field in overrides));
945
+ if (stillMissing.length > 0) {
946
+ return textResult(`Cannot apply ${adapterId}: missing required config fields (${stillMissing.join(", ")}). Pass them via the fields parameter or use /mu-setup apply ${adapterId} for guided input.`, { adapter: adapterId, missing_required_fields: stillMissing });
948
947
  }
949
948
  const outcome = await applyAdapterConfig({
950
949
  adapterId,
950
+ overrides,
951
951
  presence: runtime.configPresence,
952
952
  });
953
953
  if (!outcome.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.50",
3
+ "version": "26.2.51",
4
4
  "description": "Shared agent runtime for mu chat, orchestration roles, and serve extensions.",
5
5
  "keywords": [
6
6
  "mu",
@@ -23,7 +23,7 @@
23
23
  "prompts/**"
24
24
  ],
25
25
  "dependencies": {
26
- "@femtomc/mu-core": "26.2.50",
26
+ "@femtomc/mu-core": "26.2.51",
27
27
  "@mariozechner/pi-agent-core": "^0.52.12",
28
28
  "@mariozechner/pi-ai": "^0.52.12",
29
29
  "@mariozechner/pi-coding-agent": "^0.52.12",
@@ -1,4 +1,4 @@
1
- Set up {{adapter_name}} messaging for mu control-plane. You have Bash, Read, Write, and Edit tools — use them to do the setup yourself.
1
+ Set up {{adapter_name}} messaging for mu control-plane.
2
2
 
3
3
  [Diagnostics]
4
4
  state: {{state}}
@@ -16,7 +16,8 @@ missing fields: {{missing_fields}}
16
16
  [Instructions]
17
17
  1) Ask the user ONLY for values you cannot generate: secrets from external providers (e.g. bot tokens from @BotFather), public base URL.
18
18
  2) Generate values you CAN create yourself (e.g. webhook_secret — run `openssl rand -hex 32` via Bash).
19
- 3) Use your tools to write the config file directly, call provider APIs (curl via Bash), and complete setup end-to-end.
20
- 4) After setup, run {{verify_command}} to confirm everything works.
19
+ 3) Write config via mu_messaging_setup tool: call mu_messaging_setup(action="apply", adapter="{{adapter_id}}", fields={...}) with ALL missing field values. This writes config and reloads the control plane in one step.
20
+ 4) After config is applied, call provider APIs (e.g. Telegram setWebhook) via Bash/curl.
21
+ 5) Run {{verify_command}} to confirm everything works.
21
22
 
22
- Do NOT give the user copy-paste commands. Do the work yourself.
23
+ Do NOT give the user copy-paste commands or tutorials. Do the work yourself.