@tuongaz/seeflow 0.1.82 → 0.1.83

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 (62) hide show
  1. package/dist/web/assets/{architectureDiagram-3BPJPVTR-C6jG13JR.js → architectureDiagram-3BPJPVTR-CHtgIZZ1.js} +1 -1
  2. package/dist/web/assets/{blockDiagram-GPEHLZMM-BCwHFzKE.js → blockDiagram-GPEHLZMM-D4zjpGBX.js} +1 -1
  3. package/dist/web/assets/{c4Diagram-AAUBKEIU-C5oIgyEj.js → c4Diagram-AAUBKEIU-zSpjD7ZC.js} +1 -1
  4. package/dist/web/assets/channel-CXa0j4Re.js +1 -0
  5. package/dist/web/assets/{chart-CUib8j1x.js → chart-D6WVIyqJ.js} +1 -1
  6. package/dist/web/assets/{chunk-2J33WTMH-pmw8bFhw.js → chunk-2J33WTMH-Cr7utMp9.js} +1 -1
  7. package/dist/web/assets/{chunk-4BX2VUAB-CMvX_m4h.js → chunk-4BX2VUAB-B6PCB6H4.js} +1 -1
  8. package/dist/web/assets/{chunk-55IACEB6-D44BQXvr.js → chunk-55IACEB6-D_PUAOtb.js} +1 -1
  9. package/dist/web/assets/{chunk-727SXJPM-DFEMoCvZ.js → chunk-727SXJPM-DTQLQ_nx.js} +1 -1
  10. package/dist/web/assets/{chunk-AQP2D5EJ-DDIMOnRk.js → chunk-AQP2D5EJ-OBgrFsDS.js} +1 -1
  11. package/dist/web/assets/{chunk-FMBD7UC4-LXLjZhT_.js → chunk-FMBD7UC4-Cqo28fuY.js} +1 -1
  12. package/dist/web/assets/{chunk-ND2GUHAM-C8IKIBCh.js → chunk-ND2GUHAM-DcquCeO4.js} +1 -1
  13. package/dist/web/assets/{chunk-QZHKN3VN-B0u1h0_j.js → chunk-QZHKN3VN-SKsRSBcC.js} +1 -1
  14. package/dist/web/assets/classDiagram-4FO5ZUOK-DGPggFxp.js +1 -0
  15. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-DGPggFxp.js +1 -0
  16. package/dist/web/assets/{code-block-Djnu184B.js → code-block-CQcwHam8.js} +1 -1
  17. package/dist/web/assets/{cose-bilkent-S5V4N54A-BUNO7CMC.js → cose-bilkent-S5V4N54A-Ds8DGArP.js} +1 -1
  18. package/dist/web/assets/{dagre-BM42HDAG-CdGFe41U.js → dagre-BM42HDAG-CqMyTq3c.js} +1 -1
  19. package/dist/web/assets/{diagram-2AECGRRQ-V2Y9lItI.js → diagram-2AECGRRQ-CWEIApTd.js} +1 -1
  20. package/dist/web/assets/{diagram-5GNKFQAL-CQ68SweE.js → diagram-5GNKFQAL-8TEzgir4.js} +1 -1
  21. package/dist/web/assets/{diagram-KO2AKTUF-DSbX7Of7.js → diagram-KO2AKTUF-UNKtOw9m.js} +1 -1
  22. package/dist/web/assets/{diagram-LMA3HP47-Cn2lxMxE.js → diagram-LMA3HP47-D6QoRbi6.js} +1 -1
  23. package/dist/web/assets/{diagram-OG6HWLK6-DxpRae3_.js → diagram-OG6HWLK6-CQqkl0nk.js} +1 -1
  24. package/dist/web/assets/{erDiagram-TEJ5UH35-CcNV8XGY.js → erDiagram-TEJ5UH35-Clv5A-5B.js} +1 -1
  25. package/dist/web/assets/{flowDiagram-I6XJVG4X-FzlTb7Kj.js → flowDiagram-I6XJVG4X-4hg7rn9v.js} +1 -1
  26. package/dist/web/assets/{ganttDiagram-6RSMTGT7-CsZsdpk8.js → ganttDiagram-6RSMTGT7-3PAgpAEA.js} +1 -1
  27. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-cwaeRxXC.js → gitGraphDiagram-PVQCEYII-D5g_5z1o.js} +1 -1
  28. package/dist/web/assets/{index-AGsIlqaG.js → index-CaE1zYAX.js} +5 -5
  29. package/dist/web/assets/{index.es-BLBZrQQg.js → index.es-Cgv8Vcjx.js} +1 -1
  30. package/dist/web/assets/{infoDiagram-5YYISTIA-BdoV8cwC.js → infoDiagram-5YYISTIA-BuFXAl4D.js} +1 -1
  31. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-DgF0aARl.js → ishikawaDiagram-YF4QCWOH-DOE-GUy-.js} +1 -1
  32. package/dist/web/assets/{journeyDiagram-JHISSGLW-CrR2wfa8.js → journeyDiagram-JHISSGLW-B5BXjJgy.js} +1 -1
  33. package/dist/web/assets/{jspdf.es.min-Dl965zni.js → jspdf.es.min-_GQ7N2xd.js} +3 -3
  34. package/dist/web/assets/{kanban-definition-UN3LZRKU-DsHEJCCs.js → kanban-definition-UN3LZRKU-DTLQ2kuG.js} +1 -1
  35. package/dist/web/assets/{linear-BN0LZNw-.js → linear-DCKgJuDe.js} +1 -1
  36. package/dist/web/assets/{markdown-NiIdJguA.js → markdown-DQ9_ZAvJ.js} +1 -1
  37. package/dist/web/assets/{mermaid.core-tY2raeE_.js → mermaid.core-Cf2CUPpR.js} +4 -4
  38. package/dist/web/assets/{mindmap-definition-RKZ34NQL-DxwAweLP.js → mindmap-definition-RKZ34NQL-CI-_BCCZ.js} +1 -1
  39. package/dist/web/assets/{pieDiagram-4H26LBE5-Bg9fR9kw.js → pieDiagram-4H26LBE5-BdTv4DaU.js} +1 -1
  40. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-BK1dS-rz.js → quadrantDiagram-W4KKPZXB-pqQ7pKT1.js} +1 -1
  41. package/dist/web/assets/{requirementDiagram-4Y6WPE33-DQYhYuTB.js → requirementDiagram-4Y6WPE33-CCP9fYhL.js} +1 -1
  42. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-CcR27WzM.js → sankeyDiagram-5OEKKPKP-CpMAd0Mj.js} +1 -1
  43. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-CgfAvO57.js → sequenceDiagram-3UESZ5HK-BWg19eGL.js} +1 -1
  44. package/dist/web/assets/{stateDiagram-AJRCARHV-DdU1AbEe.js → stateDiagram-AJRCARHV-BliITsKN.js} +1 -1
  45. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BCerI8Jf.js +1 -0
  46. package/dist/web/assets/{time-BfPOB-bQ.js → time-Dqs-aHL0.js} +1 -1
  47. package/dist/web/assets/{timeline-definition-PNZ67QCA-CYQkkhD-.js → timeline-definition-PNZ67QCA-Bk8P84Jg.js} +1 -1
  48. package/dist/web/assets/{vennDiagram-CIIHVFJN-CcmBbhR6.js → vennDiagram-CIIHVFJN-CMtXVM_H.js} +1 -1
  49. package/dist/web/assets/{wardley-L42UT6IY-CK4ciiRm.js → wardley-L42UT6IY-CHP-BfXr.js} +1 -1
  50. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-Do0eKBGx.js → wardleyDiagram-YWT4CUSO-DInIu6_2.js} +1 -1
  51. package/dist/web/assets/{xychartDiagram-2RQKCTM6-CSeQg6Oy.js → xychartDiagram-2RQKCTM6-B0gobaUy.js} +1 -1
  52. package/dist/web/index.html +1 -1
  53. package/package.json +1 -1
  54. package/src/api.ts +42 -1
  55. package/src/cli-manifest.ts +21 -4
  56. package/src/cli.ts +46 -3
  57. package/src/mcp.ts +60 -11
  58. package/src/schema-catalog.ts +23 -0
  59. package/dist/web/assets/channel-gvIm48Rt.js +0 -1
  60. package/dist/web/assets/classDiagram-4FO5ZUOK-eMNtcBZw.js +0 -1
  61. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-eMNtcBZw.js +0 -1
  62. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-CNXxJnrL.js +0 -1
package/src/mcp.ts CHANGED
@@ -29,7 +29,13 @@ import {
29
29
  flowBulkNonEmpty,
30
30
  } from './operations.ts';
31
31
  import type { Registry } from './registry.ts';
32
- import { getSchemaCategory, listSchemaCategories, schemaCategoryNames } from './schema-catalog.ts';
32
+ import {
33
+ getCategorySubschema,
34
+ getSchemaCategory,
35
+ listCategorySubnames,
36
+ listSchemaCategories,
37
+ schemaCategoryNames,
38
+ } from './schema-catalog.ts';
33
39
  import { ID_TYPES, MAX_ID_COUNT, generateIds, isIdType } from './short-id.ts';
34
40
  import type { FlowWatcher } from './watcher.ts';
35
41
 
@@ -280,13 +286,18 @@ const buildTools = (ops: Operations, ctx: ToolContext): McpTool[] => [
280
286
  name: 'seeflow_schema',
281
287
  description:
282
288
  'Get the SeeFlow flow.json / spec.json schemas. Call with no args for a ' +
283
- "category index; call with `name` for one category's full JSON Schemas. " +
284
- 'Use this to learn what a node, connector, action, component spec, or ' +
285
- 'flow envelope looks like before authoring writes. Categories: `flow`, ' +
286
- '`node` (13 flat variants rectangle/ellipse/sticky/text/database/server/' +
287
- 'user/queue/cloud/image/html/icon/component), `connector`, `action` ' +
288
- '(playAction/statusAction/resetAction/statusReport/componentAction), ' +
289
- "`componentSpec` (sidecar shape for type:'component' nodes), `style`.",
289
+ "category index; call with `name` for one category's full JSON Schemas; " +
290
+ 'call with `name` + `subname` for just one named schema within that ' +
291
+ "category (e.g. name='node', subname='component' just the component " +
292
+ "node variant; name='node', subname='rectangle' just the rectangle " +
293
+ "node variant; name='action', subname='playAction' → just the playAction " +
294
+ 'shape). Use this to learn what a node, connector, action, component ' +
295
+ 'spec, or flow envelope looks like before authoring writes. Categories: ' +
296
+ '`flow`, `node` (13 flat variants — rectangle/ellipse/sticky/text/' +
297
+ 'database/server/user/queue/cloud/image/html/icon/component), ' +
298
+ '`connector`, `action` (playAction/statusAction/resetAction/statusReport/' +
299
+ "componentAction), `componentSpec` (sidecar shape for type:'component' " +
300
+ 'nodes), `style`.',
290
301
  inputSchema: {
291
302
  type: 'object',
292
303
  properties: {
@@ -294,20 +305,58 @@ const buildTools = (ops: Operations, ctx: ToolContext): McpTool[] => [
294
305
  type: 'string',
295
306
  description: 'Optional category name. Omit for the index.',
296
307
  },
308
+ subname: {
309
+ type: 'string',
310
+ description:
311
+ 'Optional named schema within the category (requires `name`). For ' +
312
+ "name='node': rectangle, ellipse, sticky, text, database, server, " +
313
+ 'user, queue, cloud, image, html, icon, component. For ' +
314
+ "name='action': playAction, statusAction, resetAction, statusReport, " +
315
+ "componentAction. For name='componentSpec': componentSpec, " +
316
+ 'componentSpecElement.',
317
+ },
297
318
  },
298
319
  additionalProperties: false,
299
320
  },
300
321
  handler: async (args) => {
301
- const name =
322
+ const argObj =
302
323
  args && typeof args === 'object' && !Array.isArray(args)
303
- ? (args as { name?: unknown }).name
304
- : undefined;
324
+ ? (args as { name?: unknown; subname?: unknown })
325
+ : {};
326
+ const name = argObj.name;
327
+ const subname = argObj.subname;
305
328
  if (name === undefined || name === null || name === '') {
329
+ if (subname !== undefined && subname !== null && subname !== '') {
330
+ return errorResult('Invalid arguments: `subname` requires `name` to be set');
331
+ }
306
332
  return okResult({ categories: listSchemaCategories() });
307
333
  }
308
334
  if (typeof name !== 'string') {
309
335
  return errorResult('Invalid arguments: `name` must be a string when present');
310
336
  }
337
+ if (subname !== undefined && subname !== null && subname !== '') {
338
+ if (typeof subname !== 'string') {
339
+ return errorResult('Invalid arguments: `subname` must be a string when present');
340
+ }
341
+ const single = getCategorySubschema(name, subname);
342
+ if (single) {
343
+ return okResult({
344
+ name,
345
+ subname,
346
+ schemas: single.schemas,
347
+ notes: single.notes,
348
+ });
349
+ }
350
+ const availableSubs = listCategorySubnames(name);
351
+ if (availableSubs === null) {
352
+ return errorResult(
353
+ `unknown schema category: ${name} (available: ${schemaCategoryNames().join(', ')})`,
354
+ );
355
+ }
356
+ return errorResult(
357
+ `unknown schema subname: ${subname} in category ${name} (available: ${availableSubs.join(', ')})`,
358
+ );
359
+ }
311
360
  const payload = getSchemaCategory(name);
312
361
  if (!payload) {
313
362
  return errorResult(
@@ -151,3 +151,26 @@ export function getSchemaCategory(name: string): SchemaPayload | null {
151
151
  export function schemaCategoryNames(): string[] {
152
152
  return CATEGORIES.map((c) => c.name);
153
153
  }
154
+
155
+ // Drill into one named schema inside a category — e.g. ('node', 'rectangle')
156
+ // returns just the rectangle variant. The category-level notes ride along
157
+ // unchanged because they describe cross-variant invariants the caller still
158
+ // needs (image path prefix, scriptPath rooting, etc.). Returns null if either
159
+ // the category or the subname is unknown; callers use listCategorySubnames
160
+ // to build a helpful "available" list in that case.
161
+ export function getCategorySubschema(category: string, subname: string): SchemaPayload | null {
162
+ const payload = PAYLOADS[category];
163
+ if (!payload) return null;
164
+ const schema = payload.schemas[subname];
165
+ if (schema === undefined) return null;
166
+ return { schemas: { [subname]: schema }, notes: [...payload.notes] };
167
+ }
168
+
169
+ // Returns the subname keys (rectangle, ellipse, …) for a known category, or
170
+ // null if the category itself is unknown. Used to surface "available" lists
171
+ // on lookup failures so the error message is self-correcting.
172
+ export function listCategorySubnames(category: string): string[] | null {
173
+ const payload = PAYLOADS[category];
174
+ if (!payload) return null;
175
+ return Object.keys(payload.schemas);
176
+ }
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-tY2raeE_.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,a as s,c as e,C as t}from"./chunk-727SXJPM-DFEMoCvZ.js";import{a as i}from"./mermaid.core-tY2raeE_.js";import"./index-AGsIlqaG.js";import"./chunk-FMBD7UC4-LXLjZhT_.js";import"./chunk-ND2GUHAM-C8IKIBCh.js";import"./chunk-55IACEB6-D44BQXvr.js";import"./chunk-2J33WTMH-pmw8bFhw.js";import"./purify.es-CLGrRn1w.js";import"./step-CWvwoXpJ.js";var b={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{b as diagram};
@@ -1 +0,0 @@
1
- import{s as a,a as s,c as e,C as t}from"./chunk-727SXJPM-DFEMoCvZ.js";import{a as i}from"./mermaid.core-tY2raeE_.js";import"./index-AGsIlqaG.js";import"./chunk-FMBD7UC4-LXLjZhT_.js";import"./chunk-ND2GUHAM-C8IKIBCh.js";import"./chunk-55IACEB6-D44BQXvr.js";import"./chunk-2J33WTMH-pmw8bFhw.js";import"./purify.es-CLGrRn1w.js";import"./step-CWvwoXpJ.js";var b={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{b as diagram};
@@ -1 +0,0 @@
1
- import{b as r,a as e,s as a,S as s}from"./chunk-AQP2D5EJ-DDIMOnRk.js";import{a as i}from"./mermaid.core-tY2raeE_.js";import"./index-AGsIlqaG.js";import"./chunk-55IACEB6-D44BQXvr.js";import"./chunk-2J33WTMH-pmw8bFhw.js";import"./purify.es-CLGrRn1w.js";import"./step-CWvwoXpJ.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram};