sysmledgraph 0.7.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.
- package/README.md +71 -0
- package/dist/bin/cli.d.ts +6 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +61 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/src/cli/commands.d.ts +22 -0
- package/dist/src/cli/commands.d.ts.map +1 -0
- package/dist/src/cli/commands.js +87 -0
- package/dist/src/cli/commands.js.map +1 -0
- package/dist/src/discovery/find-sysml.d.ts +16 -0
- package/dist/src/discovery/find-sysml.d.ts.map +1 -0
- package/dist/src/discovery/find-sysml.js +30 -0
- package/dist/src/discovery/find-sysml.js.map +1 -0
- package/dist/src/discovery/load-order.d.ts +11 -0
- package/dist/src/discovery/load-order.d.ts.map +1 -0
- package/dist/src/discovery/load-order.js +85 -0
- package/dist/src/discovery/load-order.js.map +1 -0
- package/dist/src/graph/connection.d.ts +6 -0
- package/dist/src/graph/connection.d.ts.map +1 -0
- package/dist/src/graph/connection.js +7 -0
- package/dist/src/graph/connection.js.map +1 -0
- package/dist/src/graph/graph-store.d.ts +37 -0
- package/dist/src/graph/graph-store.d.ts.map +1 -0
- package/dist/src/graph/graph-store.js +108 -0
- package/dist/src/graph/graph-store.js.map +1 -0
- package/dist/src/graph/schema.d.ts +13 -0
- package/dist/src/graph/schema.d.ts.map +1 -0
- package/dist/src/graph/schema.js +21 -0
- package/dist/src/graph/schema.js.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +14 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/indexer/indexer.d.ts +20 -0
- package/dist/src/indexer/indexer.d.ts.map +1 -0
- package/dist/src/indexer/indexer.js +56 -0
- package/dist/src/indexer/indexer.js.map +1 -0
- package/dist/src/indexer/pipeline-phases.d.ts +8 -0
- package/dist/src/indexer/pipeline-phases.d.ts.map +1 -0
- package/dist/src/indexer/pipeline-phases.js +14 -0
- package/dist/src/indexer/pipeline-phases.js.map +1 -0
- package/dist/src/mcp/resources/context.d.ts +6 -0
- package/dist/src/mcp/resources/context.d.ts.map +1 -0
- package/dist/src/mcp/resources/context.js +45 -0
- package/dist/src/mcp/resources/context.js.map +1 -0
- package/dist/src/mcp/resources/schema.d.ts +6 -0
- package/dist/src/mcp/resources/schema.d.ts.map +1 -0
- package/dist/src/mcp/resources/schema.js +14 -0
- package/dist/src/mcp/resources/schema.js.map +1 -0
- package/dist/src/mcp/server.d.ts +8 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +175 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/tools/clean-index.d.ts +12 -0
- package/dist/src/mcp/tools/clean-index.d.ts.map +1 -0
- package/dist/src/mcp/tools/clean-index.js +22 -0
- package/dist/src/mcp/tools/clean-index.js.map +1 -0
- package/dist/src/mcp/tools/context.d.ts +14 -0
- package/dist/src/mcp/tools/context.d.ts.map +1 -0
- package/dist/src/mcp/tools/context.js +51 -0
- package/dist/src/mcp/tools/context.js.map +1 -0
- package/dist/src/mcp/tools/cypher.d.ts +13 -0
- package/dist/src/mcp/tools/cypher.d.ts.map +1 -0
- package/dist/src/mcp/tools/cypher.js +25 -0
- package/dist/src/mcp/tools/cypher.js.map +1 -0
- package/dist/src/mcp/tools/generate-map.d.ts +13 -0
- package/dist/src/mcp/tools/generate-map.d.ts.map +1 -0
- package/dist/src/mcp/tools/generate-map.js +96 -0
- package/dist/src/mcp/tools/generate-map.js.map +1 -0
- package/dist/src/mcp/tools/impact.d.ts +14 -0
- package/dist/src/mcp/tools/impact.d.ts.map +1 -0
- package/dist/src/mcp/tools/impact.js +47 -0
- package/dist/src/mcp/tools/impact.js.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts +14 -0
- package/dist/src/mcp/tools/index-db-graph.d.ts.map +1 -0
- package/dist/src/mcp/tools/index-db-graph.js +32 -0
- package/dist/src/mcp/tools/index-db-graph.js.map +1 -0
- package/dist/src/mcp/tools/list-indexed.d.ts +9 -0
- package/dist/src/mcp/tools/list-indexed.d.ts.map +1 -0
- package/dist/src/mcp/tools/list-indexed.js +14 -0
- package/dist/src/mcp/tools/list-indexed.js.map +1 -0
- package/dist/src/mcp/tools/query.d.ts +14 -0
- package/dist/src/mcp/tools/query.d.ts.map +1 -0
- package/dist/src/mcp/tools/query.js +47 -0
- package/dist/src/mcp/tools/query.js.map +1 -0
- package/dist/src/mcp/tools/rename.d.ts +19 -0
- package/dist/src/mcp/tools/rename.d.ts.map +1 -0
- package/dist/src/mcp/tools/rename.js +46 -0
- package/dist/src/mcp/tools/rename.js.map +1 -0
- package/dist/src/parser/lsp-client.d.ts +52 -0
- package/dist/src/parser/lsp-client.d.ts.map +1 -0
- package/dist/src/parser/lsp-client.js +230 -0
- package/dist/src/parser/lsp-client.js.map +1 -0
- package/dist/src/parser/lsp-server-path.d.ts +10 -0
- package/dist/src/parser/lsp-server-path.d.ts.map +1 -0
- package/dist/src/parser/lsp-server-path.js +29 -0
- package/dist/src/parser/lsp-server-path.js.map +1 -0
- package/dist/src/parser/symbols.d.ts +13 -0
- package/dist/src/parser/symbols.d.ts.map +1 -0
- package/dist/src/parser/symbols.js +150 -0
- package/dist/src/parser/symbols.js.map +1 -0
- package/dist/src/parser/sysml-mcp-client.d.ts +109 -0
- package/dist/src/parser/sysml-mcp-client.d.ts.map +1 -0
- package/dist/src/parser/sysml-mcp-client.js +185 -0
- package/dist/src/parser/sysml-mcp-client.js.map +1 -0
- package/dist/src/storage/clean.d.ts +15 -0
- package/dist/src/storage/clean.d.ts.map +1 -0
- package/dist/src/storage/clean.js +44 -0
- package/dist/src/storage/clean.js.map +1 -0
- package/dist/src/storage/list.d.ts +9 -0
- package/dist/src/storage/list.d.ts.map +1 -0
- package/dist/src/storage/list.js +12 -0
- package/dist/src/storage/list.js.map +1 -0
- package/dist/src/storage/location.d.ts +22 -0
- package/dist/src/storage/location.d.ts.map +1 -0
- package/dist/src/storage/location.js +36 -0
- package/dist/src/storage/location.js.map +1 -0
- package/dist/src/storage/registry.d.ts +14 -0
- package/dist/src/storage/registry.d.ts.map +1 -0
- package/dist/src/storage/registry.js +59 -0
- package/dist/src/storage/registry.js.map +1 -0
- package/dist/src/symbol-to-graph/mapping.d.ts +17 -0
- package/dist/src/symbol-to-graph/mapping.d.ts.map +1 -0
- package/dist/src/symbol-to-graph/mapping.js +102 -0
- package/dist/src/symbol-to-graph/mapping.js.map +1 -0
- package/dist/src/types.d.ts +40 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +35 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/worker/client.d.ts +21 -0
- package/dist/src/worker/client.d.ts.map +1 -0
- package/dist/src/worker/client.js +126 -0
- package/dist/src/worker/client.js.map +1 -0
- package/dist/src/worker/gateway.d.ts +79 -0
- package/dist/src/worker/gateway.d.ts.map +1 -0
- package/dist/src/worker/gateway.js +93 -0
- package/dist/src/worker/gateway.js.map +1 -0
- package/dist/src/worker/graph-worker.d.ts +7 -0
- package/dist/src/worker/graph-worker.d.ts.map +1 -0
- package/dist/src/worker/graph-worker.js +91 -0
- package/dist/src/worker/graph-worker.js.map +1 -0
- package/dist/src/worker/protocol.d.ts +21 -0
- package/dist/src/worker/protocol.d.ts.map +1 -0
- package/dist/src/worker/protocol.js +9 -0
- package/dist/src/worker/protocol.js.map +1 -0
- package/docs/INSTALL.md +16 -0
- package/docs/MCP_CLIENT_TEMPLATE_ANALYSIS.md +196 -0
- package/docs/MCP_INTERACTION_GUIDE.md +201 -0
- package/docs/MCP_SERVER_FOR_CURSOR.md +124 -0
- package/docs/PLAN.md +58 -0
- package/docs/PLAN_INDEPENDENT_LSP.md +145 -0
- package/docs/SKILL_DESIGN_PATTERNS.md +305 -0
- package/docs/TOOLS.md +317 -0
- package/lsp/README.md +41 -0
- package/lsp/node_modules/.bin/sysml-mcp +12 -0
- package/lsp/node_modules/.bin/sysml-mcp.cmd +9 -0
- package/lsp/node_modules/.bin/sysml-mcp.ps1 +16 -0
- package/lsp/node_modules/.package-lock.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/CHANGELOG.md +188 -0
- package/lsp/node_modules/sysml-v2-lsp/LICENSE +21 -0
- package/lsp/node_modules/sysml-v2-lsp/README.md +172 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/mcpServer.js +167 -0
- package/lsp/node_modules/sysml-v2-lsp/dist/server/server.js +142 -0
- package/lsp/node_modules/sysml-v2-lsp/index.cjs +23 -0
- package/lsp/node_modules/sysml-v2-lsp/package.json +131 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.project +17 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/.settings/org.eclipse.jdt.core.prefs +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/AnalysisTooling.sysml +34 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/SampledFunctions.sysml +119 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/StateSpaceRepresentation.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Analysis/TradeStudies.sysml +171 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CausationConnections.sysml +83 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Cause and Effect/CauseAndEffect.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/.project.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/ShapeItems.sysml +899 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Geometry/SpatialItems.sysml +168 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.meta.json +10 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ImageMetadata.sysml +78 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ModelingMetadata.sysml +143 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/ParametersOfInterestMetadata.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Metadata/RiskMetadata.sysml +100 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.meta.json +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/.project.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQ.sysml +42 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAcoustics.sysml +439 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQAtomicNuclear.sysml +2726 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQBase.sysml +206 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCharacteristicNumbers.sysml +1991 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQChemistryMolecular.sysml +1353 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQCondensedMatter.sysml +1223 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQElectromagnetism.sysml +2333 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQInformation.sysml +958 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQLight.sysml +1537 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQMechanics.sysml +1564 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQSpaceTime.sysml +1169 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/ISQThermodynamics.sysml +1256 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementRefCalculations.sysml +30 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/MeasurementReferences.sysml +526 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Quantities.sysml +107 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/QuantityCalculations.sysml +70 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SI.sysml +378 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/SIPrefixes.sysml +48 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/TensorCalculations.sysml +50 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/Time.sysml +274 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/USCustomaryUnits.sysml +260 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Quantities and Units/VectorCalculations.sysml +62 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.meta.json +8 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/DerivationConnections.sysml +63 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Domain Libraries/Requirement Derivation/RequirementDerivation.sysml +39 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.meta.json +9 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +11 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/Collections.kerml +147 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Data Type Library/VectorValues.kerml +64 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.meta.json +23 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BaseFunctions.kerml +80 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/BooleanFunctions.kerml +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/CollectionFunctions.kerml +68 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ComplexFunctions.kerml +47 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ControlFunctions.kerml +117 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/DataFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/IntegerFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NaturalFunctions.kerml +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/NumericalFunctions.kerml +43 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/OccurrenceFunctions.kerml +154 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RationalFunctions.kerml +49 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/RealFunctions.kerml +56 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/ScalarFunctions.kerml +33 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/SequenceFunctions.kerml +111 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/StringFunctions.kerml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/TrigFunctions.kerml +35 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Function Library/VectorFunctions.kerml +273 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.meta.json +22 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +15 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml +95 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Clocks.kerml +156 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/ControlPerformances.kerml +135 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/FeatureReferencingPerformances.kerml +190 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/KerML.kerml +483 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Links.kerml +67 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Metaobjects.kerml +58 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Objects.kerml +212 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Observation.kerml +161 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Occurrences.kerml +992 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Performances.kerml +293 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/SpatialFrames.kerml +197 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/StatePerformances.kerml +145 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Transfers.kerml +281 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/TransitionPerformances.kerml +66 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Kernel Libraries/Kernel Semantic Library/Triggers.kerml +188 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.meta.json +27 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/.project.json +19 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Actions.sysml +552 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Allocations.sysml +29 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/AnalysisCases.sysml +38 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Attributes.sysml +25 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Calculations.sysml +37 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Cases.sysml +71 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Connections.sysml +60 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Constraints.sysml +44 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Flows.sysml +126 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Interfaces.sysml +89 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Items.sysml +153 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Metadata.sysml +32 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Parts.sysml +81 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Ports.sysml +54 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Requirements.sysml +194 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/StandardViewDefinitions.sysml +123 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/States.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/SysML.sysml +539 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/UseCases.sysml +57 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/VerificationCases.sysml +103 -0
- package/lsp/node_modules/sysml-v2-lsp/sysml.library/Systems Library/Views.sysml +164 -0
- package/lsp/package-lock.json +30 -0
- package/lsp/package.json +15 -0
- package/lsp/test-server.mjs +120 -0
- package/package.json +61 -0
- package/scripts/access-sysml-mcp.mjs +45 -0
- package/scripts/check-sysml-v2-lsp-version.mjs +39 -0
- package/scripts/clean.mjs +14 -0
- package/scripts/compare-mcp-vs-lsp-symbols.mjs +76 -0
- package/scripts/debug-index.mjs +23 -0
- package/scripts/debug-lsp-symbols.mjs +62 -0
- package/scripts/deploy-skills.mjs +43 -0
- package/scripts/example-sysml-mcp.mjs +27 -0
- package/scripts/export-graph.mjs +80 -0
- package/scripts/generate-map.mjs +110 -0
- package/scripts/index-and-map.mjs +43 -0
- package/scripts/index-and-query.mjs +39 -0
- package/scripts/query-one.mjs +34 -0
- package/scripts/setup-lsp.mjs +36 -0
- package/scripts/test-lsp.mjs +55 -0
- package/scripts/test-mcp-debug.mjs +32 -0
- package/scripts/test-mcp-sysml.mjs +75 -0
- package/scripts/test-mcp-tools.mjs +185 -0
- package/scripts/test-sysml-mcp-from-node_modules.mjs +56 -0
- package/scripts/validate-sysml-file.mjs +69 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
standard library package VerificationCases {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines the base types for verification cases and related behavioral elements
|
|
5
|
+
* in the SysML language.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
private import Cases::Case;
|
|
9
|
+
private import Cases::cases;
|
|
10
|
+
private import Requirements::RequirementCheck;
|
|
11
|
+
private import ScalarValues::Boolean;
|
|
12
|
+
|
|
13
|
+
abstract verification def VerificationCase :> Case {
|
|
14
|
+
doc
|
|
15
|
+
/*
|
|
16
|
+
* VerificationCase is the most general class of performances of VerificationCaseDefinitions.
|
|
17
|
+
* VericationCase is the base class of all VerificationCaseDefinitions.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
ref verification self : VerificationCase :>> Case::self;
|
|
21
|
+
subject subj :>> Case::subj;
|
|
22
|
+
return verdict : VerdictKind :>> result;
|
|
23
|
+
|
|
24
|
+
objective obj :>> Case::obj {
|
|
25
|
+
subject subj = VerificationCase::subj;
|
|
26
|
+
|
|
27
|
+
requirement requirementVerifications : RequirementCheck[0..*] :> subrequirements {
|
|
28
|
+
doc
|
|
29
|
+
/*
|
|
30
|
+
* A record of the evaluations of the RequirementChecks of requirements being verified.
|
|
31
|
+
*/
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ref requirement requirementVerifications : RequirementCheck[0..*] = obj.requirementVerifications {
|
|
36
|
+
doc
|
|
37
|
+
/*
|
|
38
|
+
* Checks on whether the verifiedRequirements of the VerificationCase have been satisfied.
|
|
39
|
+
*/
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
abstract verification subVerificationCases : VerificationCase[0..*] :> verificationCases, subcases {
|
|
43
|
+
doc
|
|
44
|
+
/*
|
|
45
|
+
* The subcases of this VerificationCase that are VerificationCaseUsages.
|
|
46
|
+
*/
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
abstract verification verificationCases : VerificationCase[0..*] nonunique :> cases {
|
|
52
|
+
doc
|
|
53
|
+
/*
|
|
54
|
+
* verificationCases is the base feature of all VerificationCaseUsages.
|
|
55
|
+
*/
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
enum def VerdictKind {
|
|
59
|
+
doc
|
|
60
|
+
/*
|
|
61
|
+
* VerdictKind is an enumeration of the possible results of a VerificationCase.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
pass;
|
|
65
|
+
fail;
|
|
66
|
+
inconclusive;
|
|
67
|
+
error;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
calc def PassIf {
|
|
71
|
+
doc
|
|
72
|
+
/*
|
|
73
|
+
* PassIf returns a pass or fail VerdictKind depending on whether its argument is
|
|
74
|
+
* true or false.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
in attribute isPassing : Boolean;
|
|
78
|
+
return attribute verdict : VerdictKind = if isPassing? VerdictKind::pass else VerdictKind::fail;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
metadata def VerificationMethod {
|
|
82
|
+
doc
|
|
83
|
+
/*
|
|
84
|
+
* VerificationMethod can be used as metadata annotating a verification case or action.
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
attribute kind : VerificationMethodKind[1..*];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
enum def VerificationMethodKind {
|
|
91
|
+
doc
|
|
92
|
+
/*
|
|
93
|
+
* VerificationMethodKind is an enumeration of the standard methods by which verification
|
|
94
|
+
* can be carried out.
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
inspect;
|
|
98
|
+
analyze;
|
|
99
|
+
demo;
|
|
100
|
+
test;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
standard library package Views {
|
|
2
|
+
doc
|
|
3
|
+
/*
|
|
4
|
+
* This package defines the base types for views, viewpoints, renderings and related elements
|
|
5
|
+
* in the SysML language.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
private import Parts::Part;
|
|
9
|
+
private import Parts::parts;
|
|
10
|
+
private import Requirements::RequirementCheck;
|
|
11
|
+
private import Requirements::requirementChecks;
|
|
12
|
+
|
|
13
|
+
abstract view def View :> Part {
|
|
14
|
+
ref view :>> self : View;
|
|
15
|
+
|
|
16
|
+
abstract ref view subviews : View[0..*] :> views {
|
|
17
|
+
doc
|
|
18
|
+
/*
|
|
19
|
+
* Other Views that are used in the rendering of this View.
|
|
20
|
+
*/
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
abstract ref rendering viewRendering : Rendering[0..1] {
|
|
24
|
+
doc
|
|
25
|
+
/*
|
|
26
|
+
* The rendering of this View.
|
|
27
|
+
*/
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
viewpoint viewpointSatisfactions : ViewpointCheck[0..*] :> viewpointChecks, checkedConstraints {
|
|
31
|
+
doc
|
|
32
|
+
/*
|
|
33
|
+
* Checks that the View satisfies all required ViewpointUsages.
|
|
34
|
+
*/
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
satisfy requirement viewpointConformance by that {
|
|
38
|
+
doc
|
|
39
|
+
/*
|
|
40
|
+
* An assertion that all viewpointSatisfactions are true.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
require viewpointSatisfactions {
|
|
44
|
+
doc
|
|
45
|
+
/*
|
|
46
|
+
* The required ViewpointChecks.
|
|
47
|
+
*/
|
|
48
|
+
ref :>> ownedPerformances::this, subperformances::this default that.that;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
abstract viewpoint def ViewpointCheck :> RequirementCheck {
|
|
54
|
+
doc
|
|
55
|
+
/*
|
|
56
|
+
* ViewpointCheck is a RequirementCheck for checking if a View meets the concerns of viewpoint stakeholders.
|
|
57
|
+
* It is the base type of all ViewpointDefinitions.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
ref viewpoint :>> self : ViewpointCheck;
|
|
61
|
+
subject subj : View[1] :>> RequirementCheck::subj;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
abstract rendering def Rendering :> Part {
|
|
65
|
+
doc
|
|
66
|
+
/*
|
|
67
|
+
* Rendering is the base type of all RenderingDefinitions.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
ref rendering :>> self : Rendering;
|
|
71
|
+
|
|
72
|
+
abstract ref rendering subrenderings : Rendering[0..*] :> renderings {
|
|
73
|
+
doc
|
|
74
|
+
/*
|
|
75
|
+
* Other Renderings used to carry out this Rendering.
|
|
76
|
+
*/
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
rendering def TextualRendering :> Rendering {
|
|
81
|
+
doc
|
|
82
|
+
/*
|
|
83
|
+
* A TextualRendering is a Rendering of a View into a textual format.
|
|
84
|
+
*/
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
rendering def GraphicalRendering :> Rendering {
|
|
88
|
+
doc
|
|
89
|
+
/*
|
|
90
|
+
* A GraphicalRendering is a Rendering of a View into a Graphical format.
|
|
91
|
+
*/
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
rendering def TabularRendering :> Rendering {
|
|
95
|
+
doc
|
|
96
|
+
/*
|
|
97
|
+
* A TabularRendering is a Rendering of a View into a tabular format.
|
|
98
|
+
*/
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
abstract view views : View[0..*] nonunique :> parts {
|
|
102
|
+
doc
|
|
103
|
+
/*
|
|
104
|
+
* views is the base feature of all ViewUsages.
|
|
105
|
+
*/
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
abstract viewpoint viewpointChecks : ViewpointCheck[0..*] nonunique :> requirementChecks {
|
|
109
|
+
doc
|
|
110
|
+
/*
|
|
111
|
+
* viewpointChecks is the base feature of all ViewpointUsages.
|
|
112
|
+
*/
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
abstract rendering renderings : Rendering[0..*] nonunique :> parts {
|
|
116
|
+
doc
|
|
117
|
+
/*
|
|
118
|
+
* renderings is the base feature of all RenderingUsages.
|
|
119
|
+
*/
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
rendering asTextualNotation : TextualRendering[1] :> renderings {
|
|
123
|
+
doc
|
|
124
|
+
/*
|
|
125
|
+
* asTextualNotation renders a View into textual notation as defined in the
|
|
126
|
+
* KerML and SysML specifications.
|
|
127
|
+
*/
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
rendering asTreeDiagram : GraphicalRendering[1] :> renderings {
|
|
131
|
+
doc
|
|
132
|
+
/*
|
|
133
|
+
* asTreeDiagram renders a View as a tree diagram, using the
|
|
134
|
+
* graphical notation defined in the SysML specification.
|
|
135
|
+
*/
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
rendering asInterconnectionDiagram : GraphicalRendering[1] :> renderings {
|
|
139
|
+
doc
|
|
140
|
+
/*
|
|
141
|
+
* asInterconnectionDiagram renders a View as an interconnection
|
|
142
|
+
* diagram, using the graphical notation defined in the SysML specification.
|
|
143
|
+
*/
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
rendering asElementTable : TabularRendering[1] :> renderings {
|
|
147
|
+
doc
|
|
148
|
+
/*
|
|
149
|
+
* asElementTable renders a View as a table, with one row for each exposed
|
|
150
|
+
* Element and columns rendered by applying the columnViews in order to the
|
|
151
|
+
* Element in each row.
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
view columnView[0..*] ordered {
|
|
155
|
+
doc
|
|
156
|
+
/*
|
|
157
|
+
* The Views to be rendered in the column cells, in order, of each rows of the table.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
abstract ref rendering :>> viewRendering[0..1];
|
|
161
|
+
}
|
|
162
|
+
rendering :>> subrenderings[0..*] = columnView.viewRendering;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sysmledgraph-lsp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "sysmledgraph-lsp-server",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"hasInstallScript": true,
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"sysml-v2-lsp": "^0.7.0"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"node_modules/sysml-v2-lsp": {
|
|
16
|
+
"version": "0.7.0",
|
|
17
|
+
"resolved": "https://registry.npmjs.org/sysml-v2-lsp/-/sysml-v2-lsp-0.7.0.tgz",
|
|
18
|
+
"integrity": "sha512-cJ2JINpe7Ez1gyMO020gEokoTLmqRFv+KTcNqGq+10PI3mE0q74anHLxFzbrjIx2wRDeoacQcMg3v9XVkvuWHw==",
|
|
19
|
+
"hasInstallScript": true,
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bin": {
|
|
22
|
+
"sysml-mcp": "dist/server/mcpServer.js"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20",
|
|
26
|
+
"vscode": "^1.85.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/lsp/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sysmledgraph-lsp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Dedicated LSP server setup for SysML (sysml-v2-lsp). Run from here so the server has its own cwd and init.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "node node_modules/sysml-v2-lsp/dist/server/server.js",
|
|
9
|
+
"mcp": "node node_modules/sysml-v2-lsp/dist/server/mcpServer.js",
|
|
10
|
+
"postinstall": "node -e \"console.log('LSP server deps ready. Run: npm start (stdio) or use path in SYSMLLSP_SERVER_PATH')\""
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"sysml-v2-lsp": "^0.7.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Minimal test: spawn the LSP server in this folder and send initialize + documentSymbol.
|
|
4
|
+
* Run from lsp/: node test-server.mjs
|
|
5
|
+
*/
|
|
6
|
+
import { spawn } from 'child_process';
|
|
7
|
+
import { resolve } from 'path';
|
|
8
|
+
import { pathToFileURL } from 'url';
|
|
9
|
+
|
|
10
|
+
const serverPath = resolve(process.cwd(), 'node_modules/sysml-v2-lsp/dist/server/server.js');
|
|
11
|
+
const cwd = process.cwd();
|
|
12
|
+
|
|
13
|
+
function send(proc, body) {
|
|
14
|
+
const buf = Buffer.from(body, 'utf8');
|
|
15
|
+
proc.stdin?.write(`Content-Length: ${buf.length}\r\n\r\n`, 'utf8');
|
|
16
|
+
proc.stdin?.write(buf, 'utf8');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function createReader(proc) {
|
|
20
|
+
let buffer = '';
|
|
21
|
+
let contentLength = null;
|
|
22
|
+
let pending = null;
|
|
23
|
+
proc.stdout?.setEncoding('utf8');
|
|
24
|
+
proc.stdout?.on('data', (chunk) => {
|
|
25
|
+
buffer += chunk;
|
|
26
|
+
for (;;) {
|
|
27
|
+
if (contentLength === null) {
|
|
28
|
+
const idx = buffer.indexOf('\r\n\r\n');
|
|
29
|
+
if (idx === -1) break;
|
|
30
|
+
const m = buffer.slice(0, idx).match(/Content-Length:\s*(\d+)/i);
|
|
31
|
+
contentLength = m ? parseInt(m[1], 10) : 0;
|
|
32
|
+
buffer = buffer.slice(idx + 4);
|
|
33
|
+
}
|
|
34
|
+
if (contentLength !== null && buffer.length >= contentLength) {
|
|
35
|
+
const body = buffer.slice(0, contentLength);
|
|
36
|
+
buffer = buffer.slice(contentLength);
|
|
37
|
+
contentLength = null;
|
|
38
|
+
if (pending) {
|
|
39
|
+
pending.resolve(body);
|
|
40
|
+
pending = null;
|
|
41
|
+
}
|
|
42
|
+
} else break;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return () => new Promise((res, rej) => { pending = { resolve: res, reject: rej }; });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function request(proc, readNext, method, params, id) {
|
|
49
|
+
send(proc, JSON.stringify({ jsonrpc: '2.0', id, method, params }));
|
|
50
|
+
for (;;) {
|
|
51
|
+
const raw = await readNext();
|
|
52
|
+
const msg = JSON.parse(raw);
|
|
53
|
+
if (msg.id === id) {
|
|
54
|
+
if (msg.error) throw new Error(msg.error.message);
|
|
55
|
+
return msg.result;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function notify(proc, method, params) {
|
|
61
|
+
send(proc, JSON.stringify({ jsonrpc: '2.0', method, params }));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const sample = `package Sample {
|
|
65
|
+
part def Foo {
|
|
66
|
+
doc /* test */
|
|
67
|
+
}
|
|
68
|
+
}`;
|
|
69
|
+
|
|
70
|
+
console.log('Spawning server:', serverPath);
|
|
71
|
+
console.log('cwd:', cwd);
|
|
72
|
+
|
|
73
|
+
const proc = spawn(process.execPath, [serverPath, '--stdio'], {
|
|
74
|
+
cwd,
|
|
75
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
proc.stderr?.on('data', () => {}); // server logs to stderr; ignore for quiet run
|
|
79
|
+
|
|
80
|
+
const readNext = createReader(proc);
|
|
81
|
+
|
|
82
|
+
async function run() {
|
|
83
|
+
try {
|
|
84
|
+
const rootUri = pathToFileURL(resolve(cwd, '.')).href;
|
|
85
|
+
const init = await request(proc, readNext, 'initialize', {
|
|
86
|
+
processId: process.pid,
|
|
87
|
+
rootUri,
|
|
88
|
+
capabilities: { textDocument: { documentSymbol: { hierarchicalDocumentSymbolSupport: true } } },
|
|
89
|
+
workspaceFolders: [{ uri: rootUri, name: 'workspace' }],
|
|
90
|
+
}, 1);
|
|
91
|
+
console.log('Initialize result:', JSON.stringify(init, null, 2).slice(0, 500) + '...');
|
|
92
|
+
|
|
93
|
+
notify(proc, 'initialized', {});
|
|
94
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
95
|
+
|
|
96
|
+
const uri = pathToFileURL(resolve(cwd, 'sample.sysml')).href;
|
|
97
|
+
notify(proc, 'textDocument/didOpen', {
|
|
98
|
+
textDocument: { uri, languageId: 'sysml', version: 1, text: sample },
|
|
99
|
+
});
|
|
100
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
101
|
+
|
|
102
|
+
const symbols = await request(proc, readNext, 'textDocument/documentSymbol', { textDocument: { uri } }, 2);
|
|
103
|
+
console.log('documentSymbol count:', Array.isArray(symbols) ? symbols.length : (symbols ? 1 : 0));
|
|
104
|
+
if (Array.isArray(symbols) && symbols.length > 0) {
|
|
105
|
+
console.log('First symbol:', JSON.stringify(symbols[0], null, 2));
|
|
106
|
+
} else {
|
|
107
|
+
console.log('documentSymbol result:', JSON.stringify(symbols).slice(0, 300));
|
|
108
|
+
}
|
|
109
|
+
console.log('OK — server responded.');
|
|
110
|
+
} catch (e) {
|
|
111
|
+
throw e;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
run().catch((e) => {
|
|
116
|
+
console.error('Error:', e.message);
|
|
117
|
+
process.exitCode = 1;
|
|
118
|
+
}).finally(() => {
|
|
119
|
+
proc.kill('SIGTERM');
|
|
120
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sysmledgraph",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Path-only SysML indexer: knowledge graph (Kuzu), MCP server (query, context, impact, rename, cypher), CLI (analyze, list, clean)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/src/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"sysmledgraph": "dist/bin/cli.js",
|
|
9
|
+
"sysmledgraph-mcp": "dist/mcp/index.js"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=20"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
16
|
+
"commander": "^12.0.0",
|
|
17
|
+
"fast-glob": "^3.3.2",
|
|
18
|
+
"kuzu": "^0.11.3",
|
|
19
|
+
"zod": "^3.25.76"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20.10.0",
|
|
23
|
+
"sysml-v2-lsp": "^0.7.0",
|
|
24
|
+
"typescript": "^5.3.0",
|
|
25
|
+
"vitest": "^1.2.0"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"sysml",
|
|
29
|
+
"knowledge-graph",
|
|
30
|
+
"mcp",
|
|
31
|
+
"kuzu",
|
|
32
|
+
"indexer"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/chouswei/codebase-sysmledgraph.git"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"scripts",
|
|
42
|
+
"lsp",
|
|
43
|
+
"README.md",
|
|
44
|
+
"docs"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc",
|
|
48
|
+
"clean": "node scripts/clean.mjs",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"analyze": "node dist/bin/cli.js analyze",
|
|
52
|
+
"export-graph": "node scripts/export-graph.mjs",
|
|
53
|
+
"generate-map": "node scripts/generate-map.mjs",
|
|
54
|
+
"index-and-map": "node scripts/index-and-map.mjs",
|
|
55
|
+
"deploy-skills": "node scripts/deploy-skills.mjs",
|
|
56
|
+
"mcp": "node dist/mcp/index.js",
|
|
57
|
+
"check:sysml-lsp": "node scripts/check-sysml-v2-lsp-version.mjs",
|
|
58
|
+
"setup-lsp": "node scripts/setup-lsp.mjs",
|
|
59
|
+
"prepublishOnly": "npm run build"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Access sysml-v2-lsp MCP server from code (Content-Length client).
|
|
4
|
+
* Run from repo root after: npm run build
|
|
5
|
+
*
|
|
6
|
+
* node scripts/access-sysml-mcp.mjs
|
|
7
|
+
* node scripts/access-sysml-mcp.mjs --debug # log stdout/stderr
|
|
8
|
+
*
|
|
9
|
+
* See docs/MCP_INTERACTION_GUIDE.md for lifecycle and framing.
|
|
10
|
+
*/
|
|
11
|
+
import { createSysmlMcpClient } from '../dist/src/parser/sysml-mcp-client.js';
|
|
12
|
+
|
|
13
|
+
const debug = process.argv.includes('--debug');
|
|
14
|
+
const code = `package TestPkg {
|
|
15
|
+
requirement ReqOne {
|
|
16
|
+
doc /* req */ "Requirement one.";
|
|
17
|
+
}
|
|
18
|
+
}`;
|
|
19
|
+
const uri = 'file:///access-test.sysml';
|
|
20
|
+
|
|
21
|
+
async function main() {
|
|
22
|
+
const client = await createSysmlMcpClient({
|
|
23
|
+
initTimeout: 30000,
|
|
24
|
+
debug,
|
|
25
|
+
});
|
|
26
|
+
try {
|
|
27
|
+
const parseResult = await client.parse(code, uri);
|
|
28
|
+
console.log('parse:', JSON.stringify(parseResult, null, 2));
|
|
29
|
+
|
|
30
|
+
const validateResult = await client.validate(code, uri);
|
|
31
|
+
console.log('validate:', JSON.stringify(validateResult, null, 2));
|
|
32
|
+
|
|
33
|
+
const symbolsResult = await client.getSymbols(code, uri);
|
|
34
|
+
console.log('getSymbols count:', symbolsResult?.count ?? symbolsResult);
|
|
35
|
+
|
|
36
|
+
console.log('\nOK — sysml-v2-lsp MCP accessed from code.');
|
|
37
|
+
} finally {
|
|
38
|
+
client.close();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main().catch((err) => {
|
|
43
|
+
console.error('Error:', err.message);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Check installed sysml-v2-lsp version and MCP server path.
|
|
4
|
+
* Run from repo root: node scripts/check-sysml-v2-lsp-version.mjs
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, existsSync } from 'fs';
|
|
7
|
+
import { resolve, dirname } from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
|
|
10
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
|
+
const pkgPath = resolve(root, 'package.json');
|
|
12
|
+
const mcpPath = resolve(root, 'node_modules/sysml-v2-lsp/dist/server/mcpServer.js');
|
|
13
|
+
|
|
14
|
+
let version = null;
|
|
15
|
+
try {
|
|
16
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
17
|
+
const dep = pkg.devDependencies?.['sysml-v2-lsp'] ?? pkg.dependencies?.['sysml-v2-lsp'];
|
|
18
|
+
if (dep) version = dep;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error('Could not read package.json:', e.message);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const mcpExists = existsSync(mcpPath);
|
|
25
|
+
|
|
26
|
+
console.log('sysml-v2-lsp:');
|
|
27
|
+
console.log(' version (package.json):', version ?? '(not in dependencies)');
|
|
28
|
+
console.log(' MCP server path exists:', mcpExists ? 'yes' : 'no');
|
|
29
|
+
console.log(' path:', mcpPath);
|
|
30
|
+
|
|
31
|
+
if (!version) {
|
|
32
|
+
console.error('\nAdd "sysml-v2-lsp" to devDependencies in package.json.');
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
if (!mcpExists) {
|
|
36
|
+
console.error('\nRun: npm install');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
console.log('\nOK — sysml-v2-lsp is installed and MCP server path is present.');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** Remove build/output artifacts (dist/, etc.). */
|
|
3
|
+
import { rmSync, existsSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { cwd } from 'process';
|
|
6
|
+
|
|
7
|
+
const dirs = ['dist'];
|
|
8
|
+
for (const d of dirs) {
|
|
9
|
+
const full = join(cwd(), d);
|
|
10
|
+
if (existsSync(full)) {
|
|
11
|
+
rmSync(full, { recursive: true });
|
|
12
|
+
console.log('Removed', full);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Compare MCP getSymbols vs LSP documentSymbol for the same file.
|
|
4
|
+
* Writes results to compare-mcp-symbols.json and compare-lsp-symbols.json.
|
|
5
|
+
* Run from repo root after build: node scripts/compare-mcp-vs-lsp-symbols.mjs [file]
|
|
6
|
+
*/
|
|
7
|
+
import { readFile, writeFile } from 'fs/promises';
|
|
8
|
+
import { resolve } from 'path';
|
|
9
|
+
import { existsSync } from 'fs';
|
|
10
|
+
|
|
11
|
+
const pathArg = process.argv[2] || 'test/fixtures/sysml/sample.sysml';
|
|
12
|
+
const absPath = resolve(process.cwd(), pathArg);
|
|
13
|
+
if (!existsSync(absPath)) {
|
|
14
|
+
console.error('File not found:', absPath);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (!process.env.SYSMLLSP_SERVER_PATH) {
|
|
19
|
+
const lspPath = resolve(process.cwd(), 'lsp/node_modules/sysml-v2-lsp/dist/server/server.js');
|
|
20
|
+
const rootPath = resolve(process.cwd(), 'node_modules/sysml-v2-lsp/dist/server/server.js');
|
|
21
|
+
if (existsSync(lspPath)) process.env.SYSMLLSP_SERVER_PATH = lspPath;
|
|
22
|
+
else if (existsSync(rootPath)) process.env.SYSMLLSP_SERVER_PATH = rootPath;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const content = await readFile(absPath, 'utf-8');
|
|
26
|
+
const uri = `file:///${absPath.replace(/\\/g, '/')}`;
|
|
27
|
+
|
|
28
|
+
const out = { file: absPath, uri, contentLength: content.length, mcp: null, lsp: null, error: null };
|
|
29
|
+
|
|
30
|
+
// 1) MCP getSymbols
|
|
31
|
+
console.log('Calling MCP getSymbols...');
|
|
32
|
+
try {
|
|
33
|
+
const { createSysmlMcpClient, getMcpServerPath } = await import('../dist/src/parser/sysml-mcp-client.js');
|
|
34
|
+
const serverPath = getMcpServerPath();
|
|
35
|
+
if (serverPath) {
|
|
36
|
+
const client = await createSysmlMcpClient({ serverPath, initTimeout: 60000 });
|
|
37
|
+
try {
|
|
38
|
+
const result = await client.getSymbols(content, uri);
|
|
39
|
+
out.mcp = { count: result?.count ?? 0, symbols: result?.symbols ?? [], raw: result };
|
|
40
|
+
console.log('MCP symbols count:', out.mcp.count);
|
|
41
|
+
} finally {
|
|
42
|
+
client.close();
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
out.mcp = { error: 'getMcpServerPath() returned null' };
|
|
46
|
+
}
|
|
47
|
+
} catch (e) {
|
|
48
|
+
out.mcp = { error: String(e.message ?? e) };
|
|
49
|
+
console.log('MCP error:', out.mcp.error);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 2) LSP documentSymbol (raw request/response)
|
|
53
|
+
console.log('Calling LSP documentSymbol...');
|
|
54
|
+
try {
|
|
55
|
+
const { getDocumentSymbolsFromLsp, closeLspClient } = await import('../dist/src/parser/lsp-client.js');
|
|
56
|
+
const raw = await Promise.race([
|
|
57
|
+
getDocumentSymbolsFromLsp(absPath, content),
|
|
58
|
+
new Promise((_, rej) => setTimeout(() => rej(new Error('LSP timeout 25s')), 25000)),
|
|
59
|
+
]);
|
|
60
|
+
closeLspClient();
|
|
61
|
+
const arr = Array.isArray(raw) ? raw : (raw != null ? [raw] : []);
|
|
62
|
+
out.lsp = { count: arr.length, symbols: arr, rawType: raw === null ? 'null' : Array.isArray(raw) ? 'array' : typeof raw };
|
|
63
|
+
console.log('LSP symbols count:', out.lsp.count);
|
|
64
|
+
if (arr.length > 0 && arr[0]) {
|
|
65
|
+
console.log('LSP first symbol keys:', Object.keys(arr[0]));
|
|
66
|
+
console.log('LSP first detail:', arr[0].detail, 'kind:', arr[0].kind);
|
|
67
|
+
}
|
|
68
|
+
} catch (e) {
|
|
69
|
+
out.lsp = { error: String(e.message ?? e) };
|
|
70
|
+
console.log('LSP error:', out.lsp.error);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
await writeFile('compare-mcp-symbols.json', JSON.stringify(out.mcp, null, 2), 'utf-8');
|
|
74
|
+
await writeFile('compare-lsp-symbols.json', JSON.stringify(out.lsp, null, 2), 'utf-8');
|
|
75
|
+
console.log('\nWrote compare-mcp-symbols.json and compare-lsp-symbols.json');
|
|
76
|
+
console.log('Summary: MCP count =', out.mcp?.count ?? out.mcp?.error, ', LSP count =', out.lsp?.count ?? out.lsp?.error);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Debug: run discovery + load order for a path and print counts.
|
|
4
|
+
* Usage: node scripts/debug-index.mjs "c:\Projects\SystemDesign\sysml-v2-models\projects\sysmledgraph"
|
|
5
|
+
*/
|
|
6
|
+
import { findSysmlFiles } from '../dist/src/discovery/find-sysml.js';
|
|
7
|
+
import { applyLoadOrder } from '../dist/src/discovery/load-order.js';
|
|
8
|
+
|
|
9
|
+
const root = process.argv[2] || process.cwd();
|
|
10
|
+
const roots = [root];
|
|
11
|
+
|
|
12
|
+
const allFiles = await findSysmlFiles({ roots, includeKerml: true });
|
|
13
|
+
console.log('allFiles.length', allFiles.length);
|
|
14
|
+
if (allFiles.length > 0) console.log('first', allFiles[0]);
|
|
15
|
+
|
|
16
|
+
const norm = (p) => p.replace(/\\/g, '/').toLowerCase();
|
|
17
|
+
const rootNorm = norm(root);
|
|
18
|
+
const underRoot = allFiles.filter((f) => norm(f).startsWith(rootNorm));
|
|
19
|
+
console.log('underRoot.length', underRoot.length);
|
|
20
|
+
|
|
21
|
+
const ordered = await applyLoadOrder(root, underRoot);
|
|
22
|
+
console.log('ordered.length', ordered.length);
|
|
23
|
+
if (ordered.length > 0) console.log('first ordered', ordered[0]);
|