@work-graph/cli 0.2.1 → 0.2.2

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.
@@ -28,22 +28,21 @@ function resolveRuntimeModule(relativePath) {
28
28
  throw new Error(`Work Graph runtime module not found: ${relativePath}`);
29
29
  }
30
30
 
31
- const projectInitUrl = resolveRuntimeModule('src/workGraphProjectInit.mjs');
32
- const workspaceRegistryUrl = resolveRuntimeModule('src/workspaceRegistry.mjs');
33
- const backlogUiUrl = resolveRuntimeModule('src/workGraphBacklogUiServer.mjs');
34
- const engineRootUrl = resolveRuntimeModule('src/workGraphEngineRoot.mjs');
35
-
36
- const {
37
- defaultEngineRootFromCliModule,
38
- initWorkGraphProject,
39
- runWorkGraphDoctor,
40
- startProjectUiFromCwd,
41
- } = await import(projectInitUrl);
42
- const { registerWorkspace, setActiveWorkspace } = await import(workspaceRegistryUrl);
43
- const { startBacklogUiServer } = await import(backlogUiUrl);
44
- const { resolveEngineRoot } = await import(engineRootUrl);
45
-
46
- const devEngineRoot = defaultEngineRootFromCliModule(cliModuleUrl);
31
+ async function loadProjectInit() {
32
+ return import(resolveRuntimeModule('src/workGraphProjectInit.mjs'));
33
+ }
34
+
35
+ async function loadWorkspaceRegistry() {
36
+ return import(resolveRuntimeModule('src/workspaceRegistry.mjs'));
37
+ }
38
+
39
+ async function loadEngineRoot() {
40
+ return import(resolveRuntimeModule('src/workGraphEngineRoot.mjs'));
41
+ }
42
+
43
+ async function loadBacklogUi() {
44
+ return import(resolveRuntimeModule('src/workGraphBacklogUiServer.mjs'));
45
+ }
47
46
 
48
47
  function usage() {
49
48
  console.log(`Work Graph CLI
@@ -126,6 +125,8 @@ function parseArgs(argv) {
126
125
  }
127
126
 
128
127
  async function cmdInit(targetPath, flags) {
128
+ const { defaultEngineRootFromCliModule, initWorkGraphProject } = await loadProjectInit();
129
+ const devEngineRoot = defaultEngineRootFromCliModule(cliModuleUrl);
129
130
  const root = resolve(targetPath ?? process.cwd());
130
131
  const useLegacyEngine = Boolean(flags.engine || flags.legacyEngineConfig);
131
132
  const result = await initWorkGraphProject({
@@ -142,6 +143,7 @@ async function cmdInit(targetPath, flags) {
142
143
  });
143
144
 
144
145
  if (flags.registerHost) {
146
+ const { registerWorkspace, setActiveWorkspace } = await loadWorkspaceRegistry();
145
147
  const registry = await registerWorkspace({
146
148
  id: result.projectId,
147
149
  root: result.projectRoot,
@@ -158,6 +160,7 @@ async function cmdInit(targetPath, flags) {
158
160
  }
159
161
 
160
162
  async function cmdRegister(targetPath, flags) {
163
+ const { registerWorkspace } = await loadWorkspaceRegistry();
161
164
  const root = resolve(targetPath ?? process.cwd());
162
165
  const registry = await registerWorkspace({
163
166
  id: flags.id,
@@ -175,6 +178,7 @@ async function cmdRegister(targetPath, flags) {
175
178
  }
176
179
 
177
180
  async function cmdDoctor(targetPath) {
181
+ const { runWorkGraphDoctor } = await loadProjectInit();
178
182
  const cwd = resolve(targetPath ?? process.cwd());
179
183
  const report = await runWorkGraphDoctor({ cwd, cliModuleUrl });
180
184
  console.log(JSON.stringify(report, null, 2));
@@ -184,6 +188,8 @@ async function cmdDoctor(targetPath) {
184
188
  }
185
189
 
186
190
  async function cmdUi(targetPath, flags) {
191
+ const { defaultEngineRootFromCliModule, startProjectUiFromCwd } = await loadProjectInit();
192
+ const devEngineRoot = defaultEngineRootFromCliModule(cliModuleUrl);
187
193
  const cwd = resolve(targetPath ?? process.cwd());
188
194
 
189
195
  try {
@@ -194,6 +200,8 @@ async function cmdUi(targetPath, flags) {
194
200
  // fallback: запуск из репозитория движка (разработка WG)
195
201
  }
196
202
 
203
+ const { resolveEngineRoot } = await loadEngineRoot();
204
+ const { startBacklogUiServer } = await loadBacklogUi();
197
205
  const engineRoot = resolveEngineRoot({ cliModuleUrl }) ?? devEngineRoot;
198
206
  const { host, port } = await startBacklogUiServer({
199
207
  hostRoot: engineRoot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@work-graph/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Work Graph CLI — init project, doctor, start UI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,6 +30,7 @@
30
30
  "cli"
31
31
  ],
32
32
  "dependencies": {
33
+ "@dagrejs/dagre": "^3.0.0",
33
34
  "mermaid": "^11.15.0"
34
35
  },
35
36
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@work-graph/mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for Work Graph WorkItems",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@work-graph/cli": "^0.2.1",
19
+ "@work-graph/cli": "^0.2.2",
20
20
  "@modelcontextprotocol/sdk": "^1.29.0",
21
21
  "zod": "^3.25.76"
22
22
  },
@@ -20,8 +20,8 @@ export {
20
20
 
21
21
  const CONFIG_SCHEMA_V1 = 'workgraph.project.config.v1';
22
22
  const CONFIG_SCHEMA_V2 = 'workgraph.project.config.v2';
23
- const DEFAULT_CLI_VERSION = '0.2.1';
24
- const DEFAULT_MCP_VERSION = '0.2.1';
23
+ const DEFAULT_CLI_VERSION = '0.2.2';
24
+ const DEFAULT_MCP_VERSION = '0.2.2';
25
25
 
26
26
  const INDEX_STUB = `#Index<[
27
27
  WorkItems: