@femtomc/mu-agent 26.2.45 → 26.2.47

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,QA+PvD;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,22 @@ 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
+ const notesBlock = opts.check.notes.length > 0 ? `[Notes]\n${opts.check.notes.map((n) => `- ${n}`).join("\n")}` : "";
765
+ return interpolateTemplate(MESSAGING_SETUP_BRIEF_TEMPLATE, {
766
+ adapter_name: adapter.name,
767
+ action: opts.action,
768
+ state: opts.check.state,
769
+ support: opts.check.support,
770
+ route: opts.plan.route,
771
+ webhook_url: webhookUrl ?? "(need public base URL)",
772
+ missing_fields: opts.check.missing.join(", ") || "(none)",
773
+ next_step: opts.check.next_step,
774
+ provider_steps: adapter.providerSetupSteps.map((step, index) => `${index + 1}. ${step}`).join("\n"),
775
+ field_status: adapterFieldStatusLines(adapter, opts.check).join("\n"),
776
+ notes: notesBlock,
777
+ verify_command: `/mu-setup verify ${adapter.id}${verifyFlag}`,
778
+ });
784
779
  }
785
780
  function dispatchSetupPromptToAgent(pi, ctx, prompt) {
786
781
  if (ctx.isIdle()) {
@@ -801,12 +796,10 @@ async function maybeDispatchAgentSetupBrief(opts) {
801
796
  if (!check)
802
797
  return false;
803
798
  const plan = buildPlan(check, opts.parsed.publicBaseUrl);
804
- const guide = guideForAdapter(check);
805
799
  const prompt = buildAgentSetupPrompt({
806
800
  action: opts.parsed.action,
807
801
  check,
808
802
  plan,
809
- guide,
810
803
  publicBaseUrl: opts.parsed.publicBaseUrl,
811
804
  });
812
805
  dispatchSetupPromptToAgent(opts.pi, opts.ctx, prompt);
@@ -912,18 +905,28 @@ 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 brief = buildAgentSetupPrompt({
918
+ action: params.action,
919
+ check,
920
+ plan,
921
+ publicBaseUrl: params.public_base_url,
922
+ });
923
+ return textResult(brief, { checks, runtime, adapter: adapterId, plan });
924
+ }
925
+ if (params.action === "guide") {
926
+ return textResult(setupGuide(checks), { checks, runtime, adapter: null });
927
+ }
928
+ const plans = checks.map((check) => buildPlan(check, params.public_base_url));
929
+ return textResult(planSummary(plans), { plans, runtime, adapter: null });
927
930
  }
928
931
  case "apply": {
929
932
  if (!adapterId) {
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
1
  {
2
- "name": "@femtomc/mu-agent",
3
- "version": "26.2.45",
4
- "description": "Shared agent runtime for mu chat, orchestration roles, and serve extensions.",
5
- "keywords": [
6
- "mu",
7
- "agent",
8
- "runtime",
9
- "chat",
10
- "extensions"
11
- ],
12
- "type": "module",
13
- "main": "./dist/index.js",
14
- "types": "./dist/index.d.ts",
15
- "exports": {
16
- ".": {
17
- "types": "./dist/index.d.ts",
18
- "default": "./dist/index.js"
19
- }
20
- },
21
- "files": [
22
- "dist/**",
23
- "prompts/**"
24
- ],
25
- "dependencies": {
26
- "@femtomc/mu-core": "26.2.45",
27
- "@mariozechner/pi-agent-core": "^0.52.12",
28
- "@mariozechner/pi-ai": "^0.52.12",
29
- "@mariozechner/pi-coding-agent": "^0.52.12",
30
- "@sinclair/typebox": "^0.34.0",
31
- "zod": "^4.1.9"
32
- }
2
+ "name": "@femtomc/mu-agent",
3
+ "version": "26.2.47",
4
+ "description": "Shared agent runtime for mu chat, orchestration roles, and serve extensions.",
5
+ "keywords": [
6
+ "mu",
7
+ "agent",
8
+ "runtime",
9
+ "chat",
10
+ "extensions"
11
+ ],
12
+ "type": "module",
13
+ "main": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist/**",
23
+ "prompts/**"
24
+ ],
25
+ "dependencies": {
26
+ "@femtomc/mu-core": "26.2.47",
27
+ "@mariozechner/pi-agent-core": "^0.52.12",
28
+ "@mariozechner/pi-ai": "^0.52.12",
29
+ "@mariozechner/pi-coding-agent": "^0.52.12",
30
+ "@sinclair/typebox": "^0.34.0",
31
+ "zod": "^4.1.9"
32
+ }
33
33
  }
@@ -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
+ next step: {{next_step}}
12
+
13
+ [Provider setup checklist]
14
+ {{provider_steps}}
15
+
16
+ [Current config field status]
17
+ {{field_status}}
18
+
19
+ {{notes}}
20
+
21
+ [How you should respond]
22
+ 1) Ask for any missing values (secrets, public base URL, etc).
23
+ 2) Give exact provider-console steps and copy/paste commands.
24
+ 3) Finish with verification instructions using: {{verify_command}}
File without changes
File without changes
File without changes