@openez-graph/cli 0.2.1 → 0.3.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 CHANGED
@@ -17,7 +17,7 @@ openez index [path] # incremental index
17
17
  openez reindex [path] # full rebuild
18
18
  openez watch [path] # watch + auto-reindex on changes
19
19
  openez serve --mcp # start MCP server (auto-index + auto-sync)
20
- openez serve --web # start web dashboard API server (default port 17881)
20
+ openez serve --web # start web dashboard API server (default port 11368)
21
21
  openez serve --web --port 8080 # start web dashboard API server on custom port
22
22
  openez status [path] # show workspace status
23
23
  openez list # list registered workspaces
package/dist/cli.cjs CHANGED
@@ -319173,24 +319173,42 @@ function mapWorkspace2(ws) {
319173
319173
  updatedAt: new Date(ws.updatedAt)
319174
319174
  };
319175
319175
  }
319176
+ function resolveWebDist() {
319177
+ const sourceDist = import_node_path14.default.resolve(__dirname, "..", "dist");
319178
+ if ((0, import_node_fs11.existsSync)(import_node_path14.default.join(sourceDist, "index.html"))) return sourceDist;
319179
+ const cliDist = import_node_path14.default.resolve(__dirname, "web");
319180
+ if ((0, import_node_fs11.existsSync)(import_node_path14.default.join(cliDist, "index.html"))) return cliDist;
319181
+ return null;
319182
+ }
319176
319183
  function createWebServer() {
319184
+ const webDist = resolveWebDist();
319185
+ if (webDist) {
319186
+ app.use("/*", (0, import_serve_static.serveStatic)({ root: webDist, rewriteRequestPath: (p) => p }));
319187
+ app.get("*", (c) => {
319188
+ const indexPath = import_node_path14.default.join(webDist, "index.html");
319189
+ const index2 = (0, import_node_fs11.readFileSync)(indexPath, "utf-8");
319190
+ return c.html(index2);
319191
+ });
319192
+ }
319177
319193
  return app;
319178
319194
  }
319179
- var import_hono, import_cors, import_node_crypto3, import_node_fs10, import_node_path14, app, DEFAULT_INCLUDE_GLOBS, DEFAULT_EXCLUDE_GLOBS;
319195
+ var import_hono, import_cors, import_serve_static, import_node_crypto3, import_node_fs10, import_node_fs11, import_node_path14, app, DEFAULT_INCLUDE_GLOBS, DEFAULT_EXCLUDE_GLOBS;
319180
319196
  var init_server3 = __esm({
319181
319197
  "../web/src/server/index.ts"() {
319182
319198
  "use strict";
319183
319199
  import_hono = require("hono");
319184
319200
  import_cors = require("hono/cors");
319201
+ import_serve_static = require("@hono/node-server/serve-static");
319185
319202
  import_node_crypto3 = __toESM(require("crypto"), 1);
319186
319203
  import_node_fs10 = require("fs");
319204
+ import_node_fs11 = require("fs");
319187
319205
  import_node_path14 = __toESM(require("path"), 1);
319188
319206
  init_sqlite2();
319189
319207
  init_src3();
319190
319208
  init_src();
319191
319209
  app = new import_hono.Hono();
319192
319210
  app.use("/*", (0, import_cors.cors)({
319193
- origin: ["http://localhost:5173", "http://127.0.0.1:5173", "http://localhost:17881", "http://127.0.0.1:17881"],
319211
+ origin: ["http://localhost:5173", "http://127.0.0.1:5173", "http://localhost:11368", "http://127.0.0.1:11368"],
319194
319212
  credentials: true
319195
319213
  }));
319196
319214
  DEFAULT_INCLUDE_GLOBS = [
@@ -320489,11 +320507,11 @@ function getCodexConfigPath() {
320489
320507
  }
320490
320508
  async function setupCodex(rootPath) {
320491
320509
  const resolvedPath = import_node_path16.default.resolve(rootPath);
320492
- if (!import_node_fs11.default.existsSync(resolvedPath)) {
320510
+ if (!import_node_fs12.default.existsSync(resolvedPath)) {
320493
320511
  console.error(`Error: path does not exist: ${resolvedPath}`);
320494
320512
  process.exit(1);
320495
320513
  }
320496
- if (!import_node_fs11.default.statSync(resolvedPath).isDirectory()) {
320514
+ if (!import_node_fs12.default.statSync(resolvedPath).isDirectory()) {
320497
320515
  console.error(`Error: path is not a directory: ${resolvedPath}`);
320498
320516
  process.exit(1);
320499
320517
  }
@@ -320501,12 +320519,12 @@ async function setupCodex(rootPath) {
320501
320519
  const label = "openez";
320502
320520
  const configPath = getCodexConfigPath();
320503
320521
  const configDir = import_node_path16.default.dirname(configPath);
320504
- if (!import_node_fs11.default.existsSync(configDir)) {
320505
- import_node_fs11.default.mkdirSync(configDir, { recursive: true, mode: 493 });
320522
+ if (!import_node_fs12.default.existsSync(configDir)) {
320523
+ import_node_fs12.default.mkdirSync(configDir, { recursive: true, mode: 493 });
320506
320524
  }
320507
320525
  let config2 = {};
320508
- if (import_node_fs11.default.existsSync(configPath)) {
320509
- const raw = import_node_fs11.default.readFileSync(configPath, "utf-8");
320526
+ if (import_node_fs12.default.existsSync(configPath)) {
320527
+ const raw = import_node_fs12.default.readFileSync(configPath, "utf-8");
320510
320528
  try {
320511
320529
  config2 = parse3(raw);
320512
320530
  } catch {
@@ -320524,8 +320542,8 @@ async function setupCodex(rootPath) {
320524
320542
  };
320525
320543
  mcpServers[label] = entry;
320526
320544
  const output = stringify2(config2);
320527
- import_node_fs11.default.writeFileSync(configPath, output, "utf-8");
320528
- import_node_fs11.default.chmodSync(configPath, 420);
320545
+ import_node_fs12.default.writeFileSync(configPath, output, "utf-8");
320546
+ import_node_fs12.default.chmodSync(configPath, 420);
320529
320547
  console.log(`Codex MCP server configured: '${label}'`);
320530
320548
  console.log(" Mode: shared multi-workspace MCP");
320531
320549
  console.log(` Repo: ${repoRoot}`);
@@ -320533,11 +320551,11 @@ async function setupCodex(rootPath) {
320533
320551
  console.log("");
320534
320552
  console.log("Restart Codex or open a new session for the changes to take effect.");
320535
320553
  }
320536
- var import_node_fs11, import_node_os3, import_node_path16;
320554
+ var import_node_fs12, import_node_os3, import_node_path16;
320537
320555
  var init_setup_codex = __esm({
320538
320556
  "src/setup-codex.ts"() {
320539
320557
  "use strict";
320540
- import_node_fs11 = __toESM(require("fs"), 1);
320558
+ import_node_fs12 = __toESM(require("fs"), 1);
320541
320559
  import_node_os3 = __toESM(require("os"), 1);
320542
320560
  import_node_path16 = __toESM(require("path"), 1);
320543
320561
  init_resolve_cli();
@@ -320555,11 +320573,11 @@ function getClaudeConfigPath() {
320555
320573
  }
320556
320574
  async function setupClaude(rootPath) {
320557
320575
  const resolvedPath = import_node_path17.default.resolve(rootPath);
320558
- if (!import_node_fs12.default.existsSync(resolvedPath)) {
320576
+ if (!import_node_fs13.default.existsSync(resolvedPath)) {
320559
320577
  console.error(`Error: path does not exist: ${resolvedPath}`);
320560
320578
  process.exit(1);
320561
320579
  }
320562
- if (!import_node_fs12.default.statSync(resolvedPath).isDirectory()) {
320580
+ if (!import_node_fs13.default.statSync(resolvedPath).isDirectory()) {
320563
320581
  console.error(`Error: path is not a directory: ${resolvedPath}`);
320564
320582
  process.exit(1);
320565
320583
  }
@@ -320567,12 +320585,12 @@ async function setupClaude(rootPath) {
320567
320585
  const label = "openez";
320568
320586
  const configPath = getClaudeConfigPath();
320569
320587
  const configDir = import_node_path17.default.dirname(configPath);
320570
- if (!import_node_fs12.default.existsSync(configDir)) {
320571
- import_node_fs12.default.mkdirSync(configDir, { recursive: true, mode: 493 });
320588
+ if (!import_node_fs13.default.existsSync(configDir)) {
320589
+ import_node_fs13.default.mkdirSync(configDir, { recursive: true, mode: 493 });
320572
320590
  }
320573
320591
  let config2 = {};
320574
- if (import_node_fs12.default.existsSync(configPath)) {
320575
- const raw = import_node_fs12.default.readFileSync(configPath, "utf-8");
320592
+ if (import_node_fs13.default.existsSync(configPath)) {
320593
+ const raw = import_node_fs13.default.readFileSync(configPath, "utf-8");
320576
320594
  try {
320577
320595
  config2 = JSON.parse(raw);
320578
320596
  } catch {
@@ -320588,8 +320606,8 @@ async function setupClaude(rootPath) {
320588
320606
  args,
320589
320607
  startupTimeoutSec: 120
320590
320608
  };
320591
- import_node_fs12.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
320592
- import_node_fs12.default.chmodSync(configPath, 420);
320609
+ import_node_fs13.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
320610
+ import_node_fs13.default.chmodSync(configPath, 420);
320593
320611
  console.log(`Claude Code MCP server configured: '${label}'`);
320594
320612
  console.log(" Mode: shared multi-workspace MCP");
320595
320613
  console.log(` Repo: ${repoRoot}`);
@@ -320597,11 +320615,11 @@ async function setupClaude(rootPath) {
320597
320615
  console.log("");
320598
320616
  console.log("Restart Claude Code or open a new session for the changes to take effect.");
320599
320617
  }
320600
- var import_node_fs12, import_node_os4, import_node_path17;
320618
+ var import_node_fs13, import_node_os4, import_node_path17;
320601
320619
  var init_setup_claude = __esm({
320602
320620
  "src/setup-claude.ts"() {
320603
320621
  "use strict";
320604
- import_node_fs12 = __toESM(require("fs"), 1);
320622
+ import_node_fs13 = __toESM(require("fs"), 1);
320605
320623
  import_node_os4 = __toESM(require("os"), 1);
320606
320624
  import_node_path17 = __toESM(require("path"), 1);
320607
320625
  init_resolve_cli();
@@ -320618,11 +320636,11 @@ function getOpenCodeConfigPath() {
320618
320636
  }
320619
320637
  async function setupOpenCode(rootPath) {
320620
320638
  const resolvedPath = import_node_path18.default.resolve(rootPath);
320621
- if (!import_node_fs13.default.existsSync(resolvedPath)) {
320639
+ if (!import_node_fs14.default.existsSync(resolvedPath)) {
320622
320640
  console.error(`Error: path does not exist: ${resolvedPath}`);
320623
320641
  process.exit(1);
320624
320642
  }
320625
- if (!import_node_fs13.default.statSync(resolvedPath).isDirectory()) {
320643
+ if (!import_node_fs14.default.statSync(resolvedPath).isDirectory()) {
320626
320644
  console.error(`Error: path is not a directory: ${resolvedPath}`);
320627
320645
  process.exit(1);
320628
320646
  }
@@ -320630,12 +320648,12 @@ async function setupOpenCode(rootPath) {
320630
320648
  const label = "openez";
320631
320649
  const configPath = getOpenCodeConfigPath();
320632
320650
  const configDir = import_node_path18.default.dirname(configPath);
320633
- if (!import_node_fs13.default.existsSync(configDir)) {
320634
- import_node_fs13.default.mkdirSync(configDir, { recursive: true, mode: 493 });
320651
+ if (!import_node_fs14.default.existsSync(configDir)) {
320652
+ import_node_fs14.default.mkdirSync(configDir, { recursive: true, mode: 493 });
320635
320653
  }
320636
320654
  let config2 = {};
320637
- if (import_node_fs13.default.existsSync(configPath)) {
320638
- const raw = import_node_fs13.default.readFileSync(configPath, "utf-8");
320655
+ if (import_node_fs14.default.existsSync(configPath)) {
320656
+ const raw = import_node_fs14.default.readFileSync(configPath, "utf-8");
320639
320657
  try {
320640
320658
  config2 = JSON.parse(raw);
320641
320659
  } catch {
@@ -320650,8 +320668,8 @@ async function setupOpenCode(rootPath) {
320650
320668
  command,
320651
320669
  args
320652
320670
  };
320653
- import_node_fs13.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
320654
- import_node_fs13.default.chmodSync(configPath, 420);
320671
+ import_node_fs14.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
320672
+ import_node_fs14.default.chmodSync(configPath, 420);
320655
320673
  console.log(`OpenCode MCP server configured: '${label}'`);
320656
320674
  console.log(" Mode: shared multi-workspace MCP");
320657
320675
  console.log(` Repo: ${repoRoot}`);
@@ -320659,11 +320677,11 @@ async function setupOpenCode(rootPath) {
320659
320677
  console.log("");
320660
320678
  console.log("Restart OpenCode or open a new session for the changes to take effect.");
320661
320679
  }
320662
- var import_node_fs13, import_node_os5, import_node_path18;
320680
+ var import_node_fs14, import_node_os5, import_node_path18;
320663
320681
  var init_setup_opencode = __esm({
320664
320682
  "src/setup-opencode.ts"() {
320665
320683
  "use strict";
320666
- import_node_fs13 = __toESM(require("fs"), 1);
320684
+ import_node_fs14 = __toESM(require("fs"), 1);
320667
320685
  import_node_os5 = __toESM(require("os"), 1);
320668
320686
  import_node_path18 = __toESM(require("path"), 1);
320669
320687
  init_resolve_cli();
@@ -320671,7 +320689,7 @@ var init_setup_opencode = __esm({
320671
320689
  });
320672
320690
 
320673
320691
  // src/cli.ts
320674
- var import_node_fs14 = __toESM(require("fs"), 1);
320692
+ var import_node_fs15 = __toESM(require("fs"), 1);
320675
320693
  var import_node_path19 = __toESM(require("path"), 1);
320676
320694
  init_esm2();
320677
320695
 
@@ -320699,11 +320717,11 @@ var program2 = new Command();
320699
320717
  program2.name("openez").description("OpenEZ Graph - Local-first knowledge retrieval system").version("0.2.0");
320700
320718
  program2.command("init").description("Initialize a workspace at the given path and run initial index").argument("[path]", "path to the project directory", process.cwd()).option("--no-index", "skip initial indexing").action(async (targetPath, options) => {
320701
320719
  const resolvedPath = import_node_path19.default.resolve(targetPath);
320702
- if (!import_node_fs14.default.existsSync(resolvedPath)) {
320720
+ if (!import_node_fs15.default.existsSync(resolvedPath)) {
320703
320721
  console.error(`Error: path does not exist: ${resolvedPath}`);
320704
320722
  process.exit(1);
320705
320723
  }
320706
- if (!import_node_fs14.default.statSync(resolvedPath).isDirectory()) {
320724
+ if (!import_node_fs15.default.statSync(resolvedPath).isDirectory()) {
320707
320725
  console.error(`Error: path is not a directory: ${resolvedPath}`);
320708
320726
  process.exit(1);
320709
320727
  }
@@ -320790,20 +320808,19 @@ program2.command("watch").description("Watch files and re-index on changes").arg
320790
320808
  watcher.on("unlink", reindex);
320791
320809
  console.log(`Watching ${resolvedPath} for changes...`);
320792
320810
  });
320793
- program2.command("serve").description("Start the web dashboard or MCP server").option("--mcp", "run as MCP server instead of web").option("--web", "start the web dashboard API server").option("-p, --path <path>", "workspace path").option("--port <port>", "API server port (default: 17881)").action(async (options) => {
320811
+ program2.command("serve").description("Start the web dashboard or MCP server").option("--mcp", "run as MCP server instead of web").option("--web", "start the web dashboard API server").option("-p, --path <path>", "workspace path").option("--port <port>", "API server port (default: 11368)").action(async (options) => {
320794
320812
  if (options.mcp) {
320795
320813
  const { startMcpServer: startMcpServer2 } = await Promise.resolve().then(() => (init_mcp_bridge(), mcp_bridge_exports));
320796
320814
  await startMcpServer2(options.path ? import_node_path19.default.resolve(options.path) : void 0);
320797
320815
  } else if (options.web) {
320798
- const port = options.port ? Number(options.port) : Number(process.env.API_PORT ?? 17881);
320816
+ const port = options.port ? Number(options.port) : Number(process.env.API_PORT ?? 11368);
320799
320817
  process.env.API_PORT = String(port);
320800
320818
  const { serve } = await import("@hono/node-server");
320801
320819
  const { createWebServer: createWebServer2 } = await Promise.resolve().then(() => (init_web_server(), web_server_exports));
320802
320820
  const app2 = createWebServer2();
320803
320821
  serve({ fetch: app2.fetch, port }, (info) => {
320804
320822
  console.log(`OpenEZ Graph web dashboard:`);
320805
- console.log(` API: http://localhost:${info.port}`);
320806
- console.log(` Frontend: http://localhost:5173 (run 'pnpm dev:web' separately)`);
320823
+ console.log(` http://localhost:${info.port}`);
320807
320824
  console.log(` Press Ctrl+C to stop`);
320808
320825
  });
320809
320826
  } else {