@codragraph/cli 2.1.6 → 2.2.0-rc.6

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 (72) hide show
  1. package/README.md +7 -7
  2. package/dist/cli/graphpack.d.ts +48 -0
  3. package/dist/cli/graphpack.js +217 -0
  4. package/dist/cli/index.js +72 -0
  5. package/dist/cli/tool.d.ts +1 -0
  6. package/dist/cli/tool.js +111 -2
  7. package/dist/core/graphpack/index.d.ts +14 -0
  8. package/dist/core/graphpack/index.js +474 -0
  9. package/dist/core/graphpack/types.d.ts +129 -0
  10. package/dist/core/graphpack/types.js +4 -0
  11. package/dist/core/semantic/relationships.d.ts +36 -0
  12. package/dist/core/semantic/relationships.js +261 -0
  13. package/dist/mcp/local/local-backend.js +42 -0
  14. package/dist/mcp/resources.js +125 -0
  15. package/dist/mcp/tools.js +105 -0
  16. package/dist/server/api.js +112 -0
  17. package/dist/web/assets/agent-CQNZQ-hg.js +1139 -0
  18. package/dist/web/assets/{architectureDiagram-UL44E2DR-DFSpa3Hb.js → architectureDiagram-UL44E2DR-B5_goS_i.js} +1 -1
  19. package/dist/web/assets/{blockDiagram-7IZFK4PR-DlFaxH1b.js → blockDiagram-7IZFK4PR-D7ZAlDyv.js} +1 -1
  20. package/dist/web/assets/{c4Diagram-Y2BXMSZH-BjJ_Yrim.js → c4Diagram-Y2BXMSZH-Djcgm_54.js} +1 -1
  21. package/dist/web/assets/{chunk-3SSMPTDK-KGZSzG3Y.js → chunk-3SSMPTDK-Cv2Zy2FO.js} +1 -1
  22. package/dist/web/assets/{chunk-6764PJDD-p1sGJgVm.js → chunk-6764PJDD-Cppb-jH-.js} +1 -1
  23. package/dist/web/assets/{chunk-AZZRMDJM-DIDkQA4V.js → chunk-AZZRMDJM-BHlLC7p3.js} +1 -1
  24. package/dist/web/assets/{chunk-JQRUD6KW-DAwg-yCU.js → chunk-JQRUD6KW-3F8Zg-1N.js} +1 -1
  25. package/dist/web/assets/{chunk-KRXBNO2N-ChVO_XdS.js → chunk-KRXBNO2N-C0mbN9a7.js} +1 -1
  26. package/dist/web/assets/{chunk-LCXTWHL2-DGYdb_Eh.js → chunk-LCXTWHL2-BoiuJpIF.js} +1 -1
  27. package/dist/web/assets/{chunk-LII3EMHJ-Bzh9SNgD.js → chunk-LII3EMHJ-Dqq0Qguw.js} +1 -1
  28. package/dist/web/assets/{chunk-RG4AUYOV-Bcl7U_IV.js → chunk-RG4AUYOV-Bl5F_gDs.js} +1 -1
  29. package/dist/web/assets/{chunk-T5OCTHI4-CZYMg5sc.js → chunk-T5OCTHI4-B2tIcggA.js} +1 -1
  30. package/dist/web/assets/{chunk-W44A43WB-REOI67PN.js → chunk-W44A43WB-BHe37iN7.js} +1 -1
  31. package/dist/web/assets/{chunk-ZXARS5L4-BfFdV1tf.js → chunk-ZXARS5L4-wcrIaQvY.js} +1 -1
  32. package/dist/web/assets/classDiagram-KGZ6W3CR-IbI6v_24.js +1 -0
  33. package/dist/web/assets/classDiagram-v2-72OJOZXJ-IbI6v_24.js +1 -0
  34. package/dist/web/assets/{cose-bilkent-UX7MHV2Q-D6vANJGG.js → cose-bilkent-UX7MHV2Q-BWr7v0Wr.js} +1 -1
  35. package/dist/web/assets/{dagre-ND4H6XIP-BiHe5Lal.js → dagre-ND4H6XIP-De5LIh1B.js} +1 -1
  36. package/dist/web/assets/{diagram-3NCE3AQN-CEutBCOW.js → diagram-3NCE3AQN-Dd22FSHy.js} +1 -1
  37. package/dist/web/assets/{diagram-GF46GFSD-CZns6HPQ.js → diagram-GF46GFSD-Cev3THY8.js} +1 -1
  38. package/dist/web/assets/{diagram-HNR7UZ2L-Vz8fE5of.js → diagram-HNR7UZ2L-D8Z8RQGs.js} +1 -1
  39. package/dist/web/assets/{diagram-QXG6HAR7-D60HKZ_y.js → diagram-QXG6HAR7-B8VOJOiE.js} +1 -1
  40. package/dist/web/assets/{diagram-WEQXMOUZ-vGAf1p3E.js → diagram-WEQXMOUZ-va1bLoMD.js} +1 -1
  41. package/dist/web/assets/{erDiagram-L5TCEMPS-DZaplJA6.js → erDiagram-L5TCEMPS-B3_9uAoP.js} +1 -1
  42. package/dist/web/assets/{flowDiagram-H6V6AXG4-BqUqeAsI.js → flowDiagram-H6V6AXG4-98m6maI1.js} +1 -1
  43. package/dist/web/assets/{ganttDiagram-JCBTUEKG-XEB6H-0G.js → ganttDiagram-JCBTUEKG-vE2nzETb.js} +1 -1
  44. package/dist/web/assets/{gitGraphDiagram-S2ZK5IYY-7G50u1Cd.js → gitGraphDiagram-S2ZK5IYY-DKc8uUg_.js} +1 -1
  45. package/dist/web/assets/index-BAhe1HSk.css +1 -0
  46. package/dist/web/assets/{index-B5WxtMpv.js → index-VTKdaklA.js} +230 -230
  47. package/dist/web/assets/{infoDiagram-3YFTVSEB-Cut_rzaf.js → infoDiagram-3YFTVSEB-DYP-Srzx.js} +1 -1
  48. package/dist/web/assets/{ishikawaDiagram-BNXS4ZKH-B4DGfGi3.js → ishikawaDiagram-BNXS4ZKH-QZnkpmmb.js} +1 -1
  49. package/dist/web/assets/{journeyDiagram-M6C3CM3L-BBFhsL3E.js → journeyDiagram-M6C3CM3L-B5ojIuqu.js} +1 -1
  50. package/dist/web/assets/{kanban-definition-75IXJCU3-DarGRyn3.js → kanban-definition-75IXJCU3-BJA8liRR.js} +1 -1
  51. package/dist/web/assets/{katex-K3KEBU37-W5XTYMhr.js → katex-K3KEBU37-DUqZiCRL.js} +1 -1
  52. package/dist/web/assets/{mindmap-definition-2TDM6QVE-BgeczIJM.js → mindmap-definition-2TDM6QVE-BQj5yylD.js} +1 -1
  53. package/dist/web/assets/{pieDiagram-CU6KROY3-Kkoo-Noq.js → pieDiagram-CU6KROY3-4eSrPiQz.js} +1 -1
  54. package/dist/web/assets/{quadrantDiagram-VICAPDV7-CDQFeRWN.js → quadrantDiagram-VICAPDV7-PzxN8j55.js} +1 -1
  55. package/dist/web/assets/{requirementDiagram-JXO7QTGE-Cz9-XnkA.js → requirementDiagram-JXO7QTGE-CtplTc5y.js} +1 -1
  56. package/dist/web/assets/{sankeyDiagram-URQDO5SZ-CU26z0n7.js → sankeyDiagram-URQDO5SZ-CoSgvkxv.js} +1 -1
  57. package/dist/web/assets/{sequenceDiagram-VS2MUI6T-OGK1FLOt.js → sequenceDiagram-VS2MUI6T-D7ygyXvJ.js} +1 -1
  58. package/dist/web/assets/{stateDiagram-7D4R322I-DJ9brq0U.js → stateDiagram-7D4R322I-v01gvwji.js} +1 -1
  59. package/dist/web/assets/stateDiagram-v2-36443NZ5-DFD2b8_x.js +1 -0
  60. package/dist/web/assets/{timeline-definition-O6YCAMPW-XZvnjqTT.js → timeline-definition-O6YCAMPW-CTI3M65J.js} +1 -1
  61. package/dist/web/assets/{vennDiagram-MWXL3ELB-CJUssEjA.js → vennDiagram-MWXL3ELB-RnB0XMP7.js} +1 -1
  62. package/dist/web/assets/{wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js → wardley-L42UT6IY-5TKZOOLJ-C-ZcgEBb.js} +1 -1
  63. package/dist/web/assets/{wardleyDiagram-CUQ6CDDI-C276iqrN.js → wardleyDiagram-CUQ6CDDI-EwRi4kwo.js} +1 -1
  64. package/dist/web/assets/{xychartDiagram-N2JHSOCM-B9-uCZyP.js → xychartDiagram-N2JHSOCM-DA38II6y.js} +1 -1
  65. package/dist/web/index.html +2 -2
  66. package/package.json +2 -2
  67. package/dist/web/assets/__vite-browser-external-BIHI7g3E.js +0 -1
  68. package/dist/web/assets/agent-DcdaQnmu.js +0 -1104
  69. package/dist/web/assets/classDiagram-KGZ6W3CR-B-qkKMYi.js +0 -1
  70. package/dist/web/assets/classDiagram-v2-72OJOZXJ-B-qkKMYi.js +0 -1
  71. package/dist/web/assets/index-CT0GtFLZ.css +0 -1
  72. package/dist/web/assets/stateDiagram-v2-36443NZ5-DhJ4Ky-7.js +0 -1
@@ -758,6 +758,112 @@ export const createServer = async (port, host = '127.0.0.1', options = {}) => {
758
758
  // Lazy-imports the handler from codragraph-harness so the package
759
759
  // stays optional at runtime — same pattern as harness_run /
760
760
  // harness_swarm_run in local-backend.ts.
761
+ app.get('/api/graphpack/status', async (req, res) => {
762
+ try {
763
+ const entry = await resolveRepo(requestedRepo(req));
764
+ if (!entry) {
765
+ res.status(404).json({ error: 'Repository not found' });
766
+ return;
767
+ }
768
+ const { getGraphpackStatus } = await import('../core/graphpack/index.js');
769
+ const result = await getGraphpackStatus({
770
+ repoPath: entry.path,
771
+ storagePath: entry.storagePath,
772
+ strict: req.query.strict === 'true',
773
+ });
774
+ res.json(result);
775
+ }
776
+ catch (err) {
777
+ res.status(500).json({ error: err.message || 'graphpack status failed' });
778
+ }
779
+ });
780
+ app.get('/api/graphpack/lock', async (req, res) => {
781
+ try {
782
+ const entry = await resolveRepo(requestedRepo(req));
783
+ if (!entry) {
784
+ res.status(404).json({ error: 'Repository not found' });
785
+ return;
786
+ }
787
+ const { defaultLockPath, readGraphpackLock } = await import('../core/graphpack/index.js');
788
+ const lock = await readGraphpackLock(defaultLockPath(entry.path));
789
+ if (!lock) {
790
+ res.status(404).json({ error: 'No .codragraph/index.lock.json found' });
791
+ return;
792
+ }
793
+ res.json(lock);
794
+ }
795
+ catch (err) {
796
+ res.status(500).json({ error: err.message || 'graphpack lock failed' });
797
+ }
798
+ });
799
+ app.post('/api/graphpack/publish', async (req, res) => {
800
+ try {
801
+ const entry = await resolveRepo(requestedRepo(req));
802
+ if (!entry) {
803
+ res.status(404).json({ error: 'Repository not found' });
804
+ return;
805
+ }
806
+ const { publishGraphpack } = await import('../core/graphpack/index.js');
807
+ const body = (req.body ?? {});
808
+ const result = await publishGraphpack({
809
+ repoPath: entry.path,
810
+ storagePath: entry.storagePath,
811
+ repoName: typeof body.repo === 'string' ? body.repo : entry.name,
812
+ analyzerVersion: typeof body.analyzerVersion === 'string' ? body.analyzerVersion : 'http',
813
+ target: body.target === 'pr' ? 'pr' : 'main',
814
+ artifactDir: typeof body.artifactDir === 'string' ? body.artifactDir : undefined,
815
+ artifactUrl: typeof body.artifactUrl === 'string' ? body.artifactUrl : undefined,
816
+ baseSnapshotId: typeof body.baseSnapshotId === 'string' ? body.baseSnapshotId : undefined,
817
+ headSnapshotId: typeof body.headSnapshotId === 'string' ? body.headSnapshotId : undefined,
818
+ pullRequest: typeof body.pullRequest === 'string' ? body.pullRequest : undefined,
819
+ });
820
+ res.json(result);
821
+ }
822
+ catch (err) {
823
+ res.status(500).json({ error: err.message || 'graphpack publish failed' });
824
+ }
825
+ });
826
+ app.post('/api/graphpack/pull', async (req, res) => {
827
+ try {
828
+ const entry = await resolveRepo(requestedRepo(req));
829
+ if (!entry) {
830
+ res.status(404).json({ error: 'Repository not found' });
831
+ return;
832
+ }
833
+ const { pullGraphpack } = await import('../core/graphpack/index.js');
834
+ const body = (req.body ?? {});
835
+ const result = await pullGraphpack({
836
+ repoPath: entry.path,
837
+ storagePath: entry.storagePath,
838
+ artifactDir: typeof body.artifactDir === 'string' ? body.artifactDir : undefined,
839
+ });
840
+ res.json(result);
841
+ }
842
+ catch (err) {
843
+ res.status(500).json({ error: err.message || 'graphpack pull failed' });
844
+ }
845
+ });
846
+ app.get('/api/semantic/relationships', async (req, res) => {
847
+ try {
848
+ const entry = await resolveRepo(requestedRepo(req));
849
+ if (!entry) {
850
+ res.status(404).json({ error: 'Repository not found' });
851
+ return;
852
+ }
853
+ const { analyzeSemanticRelationships } = await import('../core/semantic/relationships.js');
854
+ const limit = typeof req.query.limit === 'string' ? Number.parseInt(req.query.limit, 10) : undefined;
855
+ const result = await analyzeSemanticRelationships({
856
+ storagePath: entry.storagePath,
857
+ limit: Number.isFinite(limit) ? limit : 1000,
858
+ llm: req.query.llm === 'true',
859
+ write: false,
860
+ });
861
+ res.json(result);
862
+ }
863
+ catch (err) {
864
+ res.status(500).json({ error: err.message || 'semantic relationships failed' });
865
+ }
866
+ });
761
867
  const importRecipeHandler = async (handlerName) => {
762
868
  const moduleId = '@codragraph/harness/mcp/handler';
763
869
  try {
@@ -785,6 +891,9 @@ export const createServer = async (port, host = '127.0.0.1', options = {}) => {
785
891
  recipe_store: path.join(entry.storagePath, 'recipes'),
786
892
  task_family: typeof req.query.task_family === 'string' ? req.query.task_family : undefined,
787
893
  snapshot_id: typeof req.query.snapshot_id === 'string' ? req.query.snapshot_id : undefined,
894
+ required_subgraph_signature: typeof req.query.required_subgraph_signature === 'string'
895
+ ? req.query.required_subgraph_signature
896
+ : undefined,
788
897
  limit: Number.isFinite(limitParam) ? limitParam : undefined,
789
898
  });
790
899
  res.json(result);
@@ -813,6 +922,9 @@ export const createServer = async (port, host = '127.0.0.1', options = {}) => {
813
922
  recipe_store: path.join(entry.storagePath, 'recipes'),
814
923
  task_family: taskFamily,
815
924
  snapshot_id: snapshotId,
925
+ required_subgraph_signature: typeof req.query.required_subgraph_signature === 'string'
926
+ ? req.query.required_subgraph_signature
927
+ : undefined,
816
928
  limit: typeof req.query.limit === 'string' ? Number.parseInt(req.query.limit, 10) : undefined,
817
929
  });
818
930
  res.json(result);