@extenshi/mcp 0.22.0 → 0.23.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.
@@ -39,13 +39,13 @@ export declare const feedbackFormPatchSchema: z.ZodObject<{
39
39
  choices: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
40
  multiple: z.ZodOptional<z.ZodBoolean>;
41
41
  }, "strip", z.ZodTypeAny, {
42
- kind: "text" | "choice";
42
+ kind: "choice" | "text";
43
43
  category: string;
44
44
  prompt: string;
45
45
  choices?: string[] | undefined;
46
46
  multiple?: boolean | undefined;
47
47
  }, {
48
- kind: "text" | "choice";
48
+ kind: "choice" | "text";
49
49
  category: string;
50
50
  prompt: string;
51
51
  choices?: string[] | undefined;
@@ -67,7 +67,7 @@ export declare const feedbackFormPatchSchema: z.ZodObject<{
67
67
  thankYouMessage?: string | undefined;
68
68
  }[] | undefined;
69
69
  categoryFollowups?: {
70
- kind: "text" | "choice";
70
+ kind: "choice" | "text";
71
71
  category: string;
72
72
  prompt: string;
73
73
  choices?: string[] | undefined;
@@ -89,7 +89,7 @@ export declare const feedbackFormPatchSchema: z.ZodObject<{
89
89
  thankYouMessage?: string | undefined;
90
90
  }[] | undefined;
91
91
  categoryFollowups?: {
92
- kind: "text" | "choice";
92
+ kind: "choice" | "text";
93
93
  category: string;
94
94
  prompt: string;
95
95
  choices?: string[] | undefined;
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ import path from 'node:path';
24
24
  import { FastMCP, UserError } from 'fastmcp';
25
25
  import { makeBff } from './bff.js';
26
26
  import { readBuildMapSummary } from './build-map-summary.js';
27
+ import { buildMapAgent } from './build-map-tools.js';
27
28
  import { loadConfig } from './config.js';
28
29
  import { instrumentMcpAnalytics } from './mcp-analytics.js';
29
30
  import { reportServerStarted } from './startup.js';
@@ -61,6 +62,8 @@ const stdioDeps = {
61
62
  getApiKey: () => cfg.apiKey ?? undefined,
62
63
  // The client starts this server in the project it works on; the map of that project is the author's.
63
64
  readBuildMap: (projectDir) => readBuildMapSummary(path.resolve(process.cwd(), projectDir ?? '.')),
65
+ // Reports, variants for the author and the map itself, written to the same state file the CLI writes.
66
+ buildMap: buildMapAgent(),
64
67
  };
65
68
  registerTools(server, stdioDeps);
66
69
  instrumentMcpAnalytics({ surface: 'mcp' });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAY,OAAO,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAEN,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,WAAW,GAEX,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAA;AAE7D,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;AAEvD,MAAM,GAAG,GAAG,UAAU,EAAE,CAAA;AAExB,0EAA0E;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AgF;AAChF,kEAAkE;AAClE,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAA;AAE9C,+EAA+E;AAC/E,kFAAkF;AAClF,mFAAmF;AACnF,sEAAsE;AACtE,oCAAoC;AACpC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AAE/B,8EAA8E;AAC9E,oEAAoE;AACpE,KAAK,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA"}
package/dist/tools.d.ts CHANGED
@@ -36,6 +36,7 @@
36
36
  import { type FastMCP, type FastMCPSessionAuth } from 'fastmcp';
37
37
  import type { Bff } from './bff.js';
38
38
  import type { BuildMapSummary } from './build-map-summary.js';
39
+ import type { BuildMapAgent } from './build-map-tools.js';
39
40
  export declare const KEY_PAGE = "https://dojo.extenshi.io/api-keys";
40
41
  export declare const SIGNUP_PAGE = "https://auth.extenshi.io/signup";
41
42
  export declare const BILLING_PAGE = "https://dojo.extenshi.io/billing";
@@ -130,6 +131,14 @@ export interface ToolDeps {
130
131
  * take `projectDir` and answer with `buildMap`. The hosted connector omits it.
131
132
  */
132
133
  readBuildMap?: (projectDir?: string) => Promise<BuildMapSummary>;
134
+ /**
135
+ * The agent side of the build map on THIS machine (plan phase 2): read the
136
+ * map, report a step, offer the author variants to choose from. Only the local
137
+ * stdio server has the author's files: with this, get_build_map,
138
+ * report_build_step and request_build_review are registered. The hosted
139
+ * connector omits it.
140
+ */
141
+ buildMap?: BuildMapAgent;
133
142
  }
134
143
  /** How long a project answer waits for the build map (a slow `git`, a hung server) before going without it. */
135
144
  export declare const BUILD_MAP_READ_MS = 3000;
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAUH,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,SAAS,CA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,CAAA;IAC1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAChE;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAA;CACxB;AAED,+GAA+G;AAC/G,eAAO,MAAM,iBAAiB,OAAQ,CAAA;AAuFtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,GAAE,MAA2B,GAAG,OAAO,CAGxF;AA+vBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CA2lEnE"}
package/dist/tools.js CHANGED
@@ -601,6 +601,26 @@ const TOOL_ANNOTATIONS = {
601
601
  destructiveHint: false,
602
602
  openWorldHint: true,
603
603
  },
604
+ get_build_map: {
605
+ title: 'Read the build map',
606
+ readOnlyHint: true,
607
+ idempotentHint: true,
608
+ openWorldHint: false,
609
+ },
610
+ report_build_step: {
611
+ title: 'Report a build step',
612
+ readOnlyHint: false,
613
+ destructiveHint: false,
614
+ idempotentHint: false,
615
+ openWorldHint: false,
616
+ },
617
+ request_build_review: {
618
+ title: 'Offer the author variants',
619
+ readOnlyHint: false,
620
+ destructiveHint: false,
621
+ idempotentHint: false,
622
+ openWorldHint: false,
623
+ },
604
624
  publish_extension: {
605
625
  title: 'Publish extension to stores',
606
626
  readOnlyHint: false,
@@ -2718,6 +2738,128 @@ export function registerTools(server, deps) {
2718
2738
  },
2719
2739
  });
2720
2740
  }
2741
+ // ── Build map (local files; no key; stdio only) ───────────────────────────────
2742
+ const buildMap = deps.buildMap;
2743
+ if (buildMap) {
2744
+ const stepParam = z
2745
+ .string()
2746
+ .min(1)
2747
+ .max(64)
2748
+ .describe('The build step id, as get_build_map lists them (iconConcepts, screenshots, listing, …).');
2749
+ const agentParam = z
2750
+ .string()
2751
+ .min(1)
2752
+ .max(60)
2753
+ .describe('Who works on the step, shown to the author on the map: a short label such as "icons agent".');
2754
+ const run = async (work) => {
2755
+ try {
2756
+ return JSON.stringify(await work(), null, 2);
2757
+ }
2758
+ catch (error) {
2759
+ throw new UserError(error.message);
2760
+ }
2761
+ };
2762
+ add({
2763
+ name: 'get_build_map',
2764
+ description: 'The author’s build map of the extension project in projectDir (npx @extenshi/cli map): progress, the steps ' +
2765
+ 'waiting on the author (needsYou), the steps that can start now (next, safe to run in parallel), who works on ' +
2766
+ 'what, every step with the task it is on, and the variants offered to the author with their answer ' +
2767
+ '(reviews: waiting, picked, or redo with what to change). One map per project, shared by every agent and git ' +
2768
+ 'worktree. While the author’s map runs, the answer carries the project facts; otherwise facts is false and ' +
2769
+ 'steps proven only by project files look not done. Free; local files only.',
2770
+ parameters: z.object({ projectDir: projectDirParam }),
2771
+ execute: async (args) => run(() => buildMap.getMap(args.projectDir)),
2772
+ });
2773
+ add({
2774
+ name: 'report_build_step',
2775
+ description: 'Report on a build map step as an agent. state: start (you are on it), progress (with progress 0–1), done ' +
2776
+ '(closes the current task, or `task`; `files` are hashed into the evidence journal as proof) or stop. A step ' +
2777
+ 'whose inputs are not done is refused while the author’s map runs. The author’s choice between variants is ' +
2778
+ 'not closed by `done`: pass `choice` (the variant id the author picked in the chat) or `redo` (what to change, ' +
2779
+ 'in the author’s words) to record the author’s answer. Never record a choice the author did not make. ' +
2780
+ 'Free; writes .extenshi/build-map.json in the project.',
2781
+ parameters: z.object({
2782
+ projectDir: projectDirParam,
2783
+ step: stepParam,
2784
+ agent: agentParam,
2785
+ state: z.enum(['start', 'progress', 'done', 'stop']).optional().describe('Default: done.'),
2786
+ task: z
2787
+ .number()
2788
+ .int()
2789
+ .min(0)
2790
+ .optional()
2791
+ .describe('The task `done` closes, counted from 0 (default: the current one).'),
2792
+ progress: z
2793
+ .number()
2794
+ .min(0)
2795
+ .max(1)
2796
+ .optional()
2797
+ .describe('How far the current task is (state progress).'),
2798
+ claim: z
2799
+ .string()
2800
+ .max(280)
2801
+ .optional()
2802
+ .describe('What the closed task produced, in one line (default: the task).'),
2803
+ note: z.string().max(280).optional(),
2804
+ files: z
2805
+ .array(z.string().min(1))
2806
+ .max(20)
2807
+ .optional()
2808
+ .describe('Files that show the task done, relative to projectDir: hashed, so the entry is checked.'),
2809
+ urls: z.array(z.string().url()).max(20).optional().describe('Pages that show the task done.'),
2810
+ choice: z
2811
+ .string()
2812
+ .min(1)
2813
+ .max(16)
2814
+ .optional()
2815
+ .describe('The variant id the author picked in the chat.'),
2816
+ redo: z
2817
+ .string()
2818
+ .min(1)
2819
+ .max(2000)
2820
+ .optional()
2821
+ .describe('What to change, in the author’s words: asks for another round.'),
2822
+ round: z
2823
+ .number()
2824
+ .int()
2825
+ .min(1)
2826
+ .optional()
2827
+ .describe('The round the author answered (refused if another one is open).'),
2828
+ }),
2829
+ execute: async (args) => {
2830
+ const { projectDir, ...input } = args;
2831
+ return run(() => buildMap.reportStep(projectDir, input));
2832
+ },
2833
+ });
2834
+ add({
2835
+ name: 'request_build_review',
2836
+ description: 'Offer the author variants to choose from on the build map: icon concepts (iconConcepts), screenshots ' +
2837
+ '(screenshots) or listing copy (listing). Each variant is a preview page or image inside the project (an ' +
2838
+ '`npx @extenshi/cli icon preview` page fits icons) or an https address; `image` adds a thumbnail. The step ' +
2839
+ 'waits on the author until they pick one or ask for another round. Returns the link to the step while the ' +
2840
+ 'map runs: give it to the author, then read the answer with get_build_map. Free; local files only.',
2841
+ parameters: z.object({
2842
+ projectDir: projectDirParam,
2843
+ step: stepParam,
2844
+ agent: agentParam,
2845
+ variants: z
2846
+ .array(z.object({
2847
+ label: z.string().min(1).max(80),
2848
+ preview: z
2849
+ .string()
2850
+ .min(1)
2851
+ .describe('A preview page or image inside the project, relative to projectDir, or an https address.'),
2852
+ image: z.string().min(1).optional().describe('A thumbnail image for the map, like preview.'),
2853
+ }))
2854
+ .min(1)
2855
+ .max(8),
2856
+ }),
2857
+ execute: async (args) => {
2858
+ const { projectDir, ...input } = args;
2859
+ return run(() => buildMap.requestReview(projectDir, input));
2860
+ },
2861
+ });
2862
+ }
2721
2863
  if (caps.has('publish')) {
2722
2864
  add({
2723
2865
  name: 'publish_extension',