@femtomc/mu-agent 26.2.45 → 26.2.46

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":"default_prompts.d.ts","sourceRoot":"","sources":["../src/default_prompts.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAStD;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAO/E;AAED,eAAO,MAAM,mBAAmB,QAA+B,CAAC;AAMhE,eAAO,MAAM,2BAA2B,QAAkE,CAAC;AAC3G,eAAO,MAAM,qBAAqB,QAA4D,CAAC;AAC/F,eAAO,MAAM,8BAA8B,QAAqE,CAAC"}
1
+ {"version":3,"file":"default_prompts.d.ts","sourceRoot":"","sources":["../src/default_prompts.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAStD;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAO/E;AAED,eAAO,MAAM,mBAAmB,QAAqC,CAAC;AAMtE,eAAO,MAAM,2BAA2B,QAAkE,CAAC;AAC3G,eAAO,MAAM,qBAAqB,QAA4D,CAAC;AAC/F,eAAO,MAAM,8BAA8B,QAAqE,CAAC"}
@@ -30,10 +30,10 @@ export function appendSharedSoul(basePrompt, soulPrompt) {
30
30
  }
31
31
  return `${base}\n\n${soul}`;
32
32
  }
33
- export const DEFAULT_SOUL_PROMPT = loadBundledPrompt("soul.md");
34
- const BASE_ORCHESTRATOR_PROMPT = loadBundledPrompt("orchestrator.md");
35
- const BASE_WORKER_PROMPT = loadBundledPrompt("worker.md");
36
- const BASE_OPERATOR_SYSTEM_PROMPT = loadBundledPrompt("operator.md");
33
+ export const DEFAULT_SOUL_PROMPT = loadBundledPrompt("roles/soul.md");
34
+ const BASE_ORCHESTRATOR_PROMPT = loadBundledPrompt("roles/orchestrator.md");
35
+ const BASE_WORKER_PROMPT = loadBundledPrompt("roles/worker.md");
36
+ const BASE_OPERATOR_SYSTEM_PROMPT = loadBundledPrompt("roles/operator.md");
37
37
  export const DEFAULT_ORCHESTRATOR_PROMPT = appendSharedSoul(BASE_ORCHESTRATOR_PROMPT, DEFAULT_SOUL_PROMPT);
38
38
  export const DEFAULT_WORKER_PROMPT = appendSharedSoul(BASE_WORKER_PROMPT, DEFAULT_SOUL_PROMPT);
39
39
  export const DEFAULT_OPERATOR_SYSTEM_PROMPT = appendSharedSoul(BASE_OPERATOR_SYSTEM_PROMPT, DEFAULT_SOUL_PROMPT);
@@ -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;AAgjC7G,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,QAqPvD;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;AA2iC7G,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,QAiQvD;AAED,eAAe,uBAAuB,CAAC"}
@@ -8,7 +8,12 @@
8
8
  */
9
9
  import { StringEnum } from "@mariozechner/pi-ai";
10
10
  import { Type } from "@sinclair/typebox";
11
+ import { loadBundledPrompt } from "../default_prompts.js";
11
12
  import { fetchMuJson, fetchMuStatus, muServerUrl, textResult, toJsonText } from "./shared.js";
13
+ const MESSAGING_SETUP_BRIEF_TEMPLATE = loadBundledPrompt("skills/messaging-setup-brief.md");
14
+ function interpolateTemplate(template, vars) {
15
+ return template.replace(/\{\{(\w+)\}\}/g, (_match, key) => vars[key] ?? `{{${key}}}`);
16
+ }
12
17
  const ADAPTERS = [
13
18
  {
14
19
  id: "slack",
@@ -755,32 +760,20 @@ function buildAgentSetupPrompt(opts) {
755
760
  const adapter = adapterById(opts.check.id);
756
761
  const normalizedBase = normalizePublicBaseUrl(opts.publicBaseUrl);
757
762
  const webhookUrl = normalizedBase ? `${normalizedBase}${opts.plan.route}` : opts.plan.webhook_url;
758
- return [
759
- `Help me set up ${adapter.name} messaging integration for mu control-plane.`,
760
- "Treat diagnostics below as authoritative and guide me step-by-step.",
761
- "",
762
- "[Live diagnostics]",
763
- `action: ${opts.action}`,
764
- `state: ${opts.check.state}`,
765
- `support: ${opts.check.support}`,
766
- `route: ${opts.plan.route}`,
767
- `expected webhook URL: ${webhookUrl ?? "(need public base URL)"}`,
768
- `missing required config fields: ${opts.check.missing.join(", ") || "(none)"}`,
769
- "",
770
- "[Provider setup checklist]",
771
- ...adapter.providerSetupSteps.map((step, index) => `${index + 1}. ${step}`),
772
- "",
773
- "[Current config field status]",
774
- ...adapterFieldStatusLines(adapter, opts.check),
775
- "",
776
- "[How you should respond]",
777
- "1) Ask for any missing values (secrets, public base URL, etc).",
778
- "2) Give exact provider-console steps and copy/paste commands.",
779
- `3) Finish with verification instructions using: /mu-setup verify ${adapter.id}${normalizedBase ? ` --public-base-url ${normalizedBase}` : ""}`,
780
- "",
781
- "[Guide snapshot]",
782
- opts.guide,
783
- ].join("\n");
763
+ const verifyFlag = normalizedBase ? ` --public-base-url ${normalizedBase}` : "";
764
+ return interpolateTemplate(MESSAGING_SETUP_BRIEF_TEMPLATE, {
765
+ adapter_name: adapter.name,
766
+ action: opts.action,
767
+ state: opts.check.state,
768
+ support: opts.check.support,
769
+ route: opts.plan.route,
770
+ webhook_url: webhookUrl ?? "(need public base URL)",
771
+ missing_fields: opts.check.missing.join(", ") || "(none)",
772
+ provider_steps: adapter.providerSetupSteps.map((step, index) => `${index + 1}. ${step}`).join("\n"),
773
+ field_status: adapterFieldStatusLines(adapter, opts.check).join("\n"),
774
+ verify_command: `/mu-setup verify ${adapter.id}${verifyFlag}`,
775
+ guide: opts.guide,
776
+ });
784
777
  }
785
778
  function dispatchSetupPromptToAgent(pi, ctx, prompt) {
786
779
  if (ctx.isIdle()) {
@@ -912,18 +905,30 @@ export function messagingSetupExtension(pi) {
912
905
  const { checks, runtime } = await collectChecksCached();
913
906
  return textResult(preflightSummary(checks, runtime), { checks, runtime });
914
907
  }
915
- case "guide": {
916
- const { checks, runtime } = await collectChecksCached();
917
- return textResult(setupGuide(checks, adapterId ?? undefined), { checks, runtime, adapter: adapterId });
918
- }
908
+ case "guide":
919
909
  case "plan": {
920
910
  const { checks, runtime } = await collectChecksCached();
921
- const plans = adapterId
922
- ? checks
923
- .filter((check) => check.id === adapterId)
924
- .map((check) => buildPlan(check, params.public_base_url))
925
- : checks.map((check) => buildPlan(check, params.public_base_url));
926
- return textResult(planSummary(plans), { plans, runtime, adapter: adapterId ?? null });
911
+ if (adapterId) {
912
+ const check = findCheckByAdapter(checks, adapterId);
913
+ if (!check) {
914
+ return textResult(`Unknown adapter: ${adapterId}`);
915
+ }
916
+ const plan = buildPlan(check, params.public_base_url);
917
+ const guide = guideForAdapter(check);
918
+ const brief = buildAgentSetupPrompt({
919
+ action: params.action,
920
+ check,
921
+ plan,
922
+ guide,
923
+ publicBaseUrl: params.public_base_url,
924
+ });
925
+ return textResult(brief, { checks, runtime, adapter: adapterId, plan });
926
+ }
927
+ if (params.action === "guide") {
928
+ return textResult(setupGuide(checks), { checks, runtime, adapter: null });
929
+ }
930
+ const plans = checks.map((check) => buildPlan(check, params.public_base_url));
931
+ return textResult(planSummary(plans), { plans, runtime, adapter: null });
927
932
  }
928
933
  case "apply": {
929
934
  if (!adapterId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.45",
3
+ "version": "26.2.46",
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.45",
26
+ "@femtomc/mu-core": "26.2.46",
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",
@@ -0,0 +1,24 @@
1
+ Help me set up {{adapter_name}} messaging integration for mu control-plane.
2
+ Treat diagnostics below as authoritative and guide me step-by-step.
3
+
4
+ [Live diagnostics]
5
+ action: {{action}}
6
+ state: {{state}}
7
+ support: {{support}}
8
+ route: {{route}}
9
+ expected webhook URL: {{webhook_url}}
10
+ missing required config fields: {{missing_fields}}
11
+
12
+ [Provider setup checklist]
13
+ {{provider_steps}}
14
+
15
+ [Current config field status]
16
+ {{field_status}}
17
+
18
+ [How you should respond]
19
+ 1) Ask for any missing values (secrets, public base URL, etc).
20
+ 2) Give exact provider-console steps and copy/paste commands.
21
+ 3) Finish with verification instructions using: {{verify_command}}
22
+
23
+ [Guide snapshot]
24
+ {{guide}}
File without changes
File without changes
File without changes