openspecui 0.3.0 → 0.6.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/dist/cli.mjs +26 -25
- package/dist/index.mjs +1 -1
- package/dist/{open-CmiqsyCQ.mjs → open-BTGRjBxH.mjs} +12 -12
- package/dist/{src-D7s-EgJ2.mjs → src-IryZbu1Z.mjs} +2654 -874
- package/package.json +4 -1
- package/web/assets/index-CQhLNlQr.js +369 -0
- package/web/assets/index-D-0Lh1u9.css +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-DIHAzyX3.js +0 -332
- package/web/assets/index-DuIo-wPB.css +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as __commonJS, o as __toESM, t as startServer } from "./src-
|
|
2
|
+
import { a as __commonJS, o as __toESM, t as startServer } from "./src-IryZbu1Z.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { fileURLToPath } from "url";
|
|
5
5
|
import { basename, dirname, extname, join, normalize, relative, resolve } from "path";
|
|
6
|
-
import {
|
|
7
|
-
import { readFileSync
|
|
8
|
-
import {
|
|
6
|
+
import { dirname as dirname$1, join as join$1, resolve as resolve$1 } from "node:path";
|
|
7
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
8
|
+
import { readFileSync as readFileSync$1, readdirSync as readdirSync$1, statSync as statSync$1, writeFile } from "fs";
|
|
9
|
+
import { format, inspect } from "util";
|
|
9
10
|
import { fileURLToPath as fileURLToPath$1 } from "node:url";
|
|
10
11
|
import { notStrictEqual, strictEqual } from "assert";
|
|
11
|
-
import { format, inspect } from "util";
|
|
12
12
|
|
|
13
13
|
//#region ../../node_modules/.pnpm/cliui@9.0.1/node_modules/cliui/build/lib/index.js
|
|
14
14
|
const align = {
|
|
@@ -603,9 +603,9 @@ function ui(opts) {
|
|
|
603
603
|
function sync_default(start, callback) {
|
|
604
604
|
let dir = resolve(".", start);
|
|
605
605
|
let tmp;
|
|
606
|
-
if (!statSync(dir).isDirectory()) dir = dirname(dir);
|
|
606
|
+
if (!statSync$1(dir).isDirectory()) dir = dirname(dir);
|
|
607
607
|
while (true) {
|
|
608
|
-
tmp = callback(dir, readdirSync(dir));
|
|
608
|
+
tmp = callback(dir, readdirSync$1(dir));
|
|
609
609
|
if (tmp) return resolve(dir, tmp);
|
|
610
610
|
dir = dirname(tmp = dir);
|
|
611
611
|
if (tmp === dir) break;
|
|
@@ -1396,7 +1396,7 @@ const parser = new YargsParser({
|
|
|
1396
1396
|
resolve,
|
|
1397
1397
|
require: (path$1) => {
|
|
1398
1398
|
if (typeof require$1 !== "undefined") return require$1(path$1);
|
|
1399
|
-
else if (path$1.match(/\.json$/)) return JSON.parse(readFileSync(path$1, "utf8"));
|
|
1399
|
+
else if (path$1.match(/\.json$/)) return JSON.parse(readFileSync$1(path$1, "utf8"));
|
|
1400
1400
|
else throw Error("only .json config files are supported in ESM");
|
|
1401
1401
|
}
|
|
1402
1402
|
});
|
|
@@ -1434,14 +1434,14 @@ function getProcessArgvBin() {
|
|
|
1434
1434
|
//#region ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js
|
|
1435
1435
|
var node_default = {
|
|
1436
1436
|
fs: {
|
|
1437
|
-
readFileSync,
|
|
1437
|
+
readFileSync: readFileSync$1,
|
|
1438
1438
|
writeFile
|
|
1439
1439
|
},
|
|
1440
1440
|
format,
|
|
1441
1441
|
resolve,
|
|
1442
1442
|
exists: (file) => {
|
|
1443
1443
|
try {
|
|
1444
|
-
return statSync(file).isFile();
|
|
1444
|
+
return statSync$1(file).isFile();
|
|
1445
1445
|
} catch (err) {
|
|
1446
1446
|
return false;
|
|
1447
1447
|
}
|
|
@@ -1639,8 +1639,8 @@ var esm_default = {
|
|
|
1639
1639
|
nextTick: process.nextTick,
|
|
1640
1640
|
stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
|
|
1641
1641
|
},
|
|
1642
|
-
readFileSync
|
|
1643
|
-
readdirSync
|
|
1642
|
+
readFileSync,
|
|
1643
|
+
readdirSync,
|
|
1644
1644
|
require,
|
|
1645
1645
|
getCallerFile: () => {
|
|
1646
1646
|
const callerFile = (0, import_get_caller_file.default)(3);
|
|
@@ -3621,10 +3621,10 @@ var YargsInstance = class {
|
|
|
3621
3621
|
}
|
|
3622
3622
|
async getCompletion(args, done) {
|
|
3623
3623
|
argsert("<array> [function]", [args, done], arguments.length);
|
|
3624
|
-
if (!done) return new Promise((resolve$
|
|
3624
|
+
if (!done) return new Promise((resolve$2, reject) => {
|
|
3625
3625
|
__classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
|
|
3626
3626
|
if (err) reject(err);
|
|
3627
|
-
else resolve$
|
|
3627
|
+
else resolve$2(completions);
|
|
3628
3628
|
});
|
|
3629
3629
|
});
|
|
3630
3630
|
else return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done);
|
|
@@ -4510,16 +4510,18 @@ const __dirname = dirname$1(fileURLToPath$1(import.meta.url));
|
|
|
4510
4510
|
function getVersion() {
|
|
4511
4511
|
try {
|
|
4512
4512
|
const pkgPath = join$1(__dirname, "..", "package.json");
|
|
4513
|
-
return JSON.parse(readFileSync
|
|
4513
|
+
return JSON.parse(readFileSync(pkgPath, "utf-8")).version || "0.0.0";
|
|
4514
4514
|
} catch {
|
|
4515
4515
|
return "0.0.0";
|
|
4516
4516
|
}
|
|
4517
4517
|
}
|
|
4518
4518
|
async function main() {
|
|
4519
|
-
const
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4519
|
+
const originalCwd = process.env.INIT_CWD || process.cwd();
|
|
4520
|
+
const argv = await yargs_default(hideBin(process.argv)).scriptName("openspecui").usage("$0 [project-dir]", "Visual interface for spec-driven development", (yargs) => {
|
|
4521
|
+
return yargs.positional("project-dir", {
|
|
4522
|
+
describe: "Project directory containing openspec/",
|
|
4523
|
+
type: "string"
|
|
4524
|
+
});
|
|
4523
4525
|
}).option("port", {
|
|
4524
4526
|
alias: "p",
|
|
4525
4527
|
describe: "Port to run the server on",
|
|
@@ -4528,14 +4530,13 @@ async function main() {
|
|
|
4528
4530
|
}).option("dir", {
|
|
4529
4531
|
alias: "d",
|
|
4530
4532
|
describe: "Project directory containing openspec/",
|
|
4531
|
-
type: "string"
|
|
4532
|
-
default: process.cwd()
|
|
4533
|
+
type: "string"
|
|
4533
4534
|
}).option("open", {
|
|
4534
4535
|
describe: "Automatically open the browser",
|
|
4535
4536
|
type: "boolean",
|
|
4536
4537
|
default: true
|
|
4537
|
-
}).example("$0", "Start in current directory").example("$0 ./my-project", "Start with specific project").example("$0 -p 8080", "Start on custom port").example("$0 --no-open", "Start without opening browser").version(getVersion()).alias("v", "version").help().alias("h", "help").
|
|
4538
|
-
const projectDir = argv
|
|
4538
|
+
}).example("$0", "Start in current directory").example("$0 ./my-project", "Start with specific project").example("$0 -p 8080", "Start on custom port").example("$0 --dir=./my-project", "Start with specific project").example("$0 --no-open", "Start without opening browser").version(getVersion()).alias("v", "version").help().alias("h", "help").parse();
|
|
4539
|
+
const projectDir = resolve$1(originalCwd, argv["project-dir"] || argv.dir || ".");
|
|
4539
4540
|
console.log(`
|
|
4540
4541
|
┌─────────────────────────────────────────────┐
|
|
4541
4542
|
│ OpenSpec UI │
|
|
@@ -4543,7 +4544,6 @@ async function main() {
|
|
|
4543
4544
|
└─────────────────────────────────────────────┘
|
|
4544
4545
|
`);
|
|
4545
4546
|
console.log(`📁 Project: ${projectDir}`);
|
|
4546
|
-
console.log(`🔌 Port: ${argv.port}`);
|
|
4547
4547
|
console.log("");
|
|
4548
4548
|
try {
|
|
4549
4549
|
const server = await startServer({
|
|
@@ -4551,10 +4551,11 @@ async function main() {
|
|
|
4551
4551
|
port: argv.port,
|
|
4552
4552
|
open: argv.open
|
|
4553
4553
|
});
|
|
4554
|
+
if (server.port !== server.preferredPort) console.log(`⚠️ Port ${server.preferredPort} is in use, using ${server.port} instead`);
|
|
4554
4555
|
console.log(`✅ Server running at ${server.url}`);
|
|
4555
4556
|
console.log("");
|
|
4556
4557
|
if (argv.open) {
|
|
4557
|
-
await (await import("./open-
|
|
4558
|
+
await (await import("./open-BTGRjBxH.mjs")).default(server.url);
|
|
4558
4559
|
console.log("🌐 Browser opened");
|
|
4559
4560
|
}
|
|
4560
4561
|
console.log("");
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as ACPAgents, n as createServer, r as ProviderManager, t as startServer } from "./src-
|
|
1
|
+
import { i as ACPAgents, n as createServer, r as ProviderManager, t as startServer } from "./src-IryZbu1Z.mjs";
|
|
2
2
|
|
|
3
3
|
export { ACPAgents, ProviderManager, createServer, startServer };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
1
|
+
import fs, { constants } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import fs$1 from "node:fs";
|
|
4
|
+
import os from "node:os";
|
|
3
5
|
import { fileURLToPath } from "node:url";
|
|
4
6
|
import process from "node:process";
|
|
5
7
|
import { Buffer } from "node:buffer";
|
|
6
8
|
import { promisify } from "node:util";
|
|
7
9
|
import childProcess, { execFile } from "node:child_process";
|
|
8
|
-
import fs$1, { constants } from "node:fs/promises";
|
|
9
|
-
import os from "node:os";
|
|
10
10
|
|
|
11
11
|
//#region ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
12
12
|
let isDockerCached;
|
|
13
13
|
function hasDockerEnv() {
|
|
14
14
|
try {
|
|
15
|
-
fs.statSync("/.dockerenv");
|
|
15
|
+
fs$1.statSync("/.dockerenv");
|
|
16
16
|
return true;
|
|
17
17
|
} catch {
|
|
18
18
|
return false;
|
|
@@ -20,7 +20,7 @@ function hasDockerEnv() {
|
|
|
20
20
|
}
|
|
21
21
|
function hasDockerCGroup() {
|
|
22
22
|
try {
|
|
23
|
-
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
23
|
+
return fs$1.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
24
24
|
} catch {
|
|
25
25
|
return false;
|
|
26
26
|
}
|
|
@@ -35,7 +35,7 @@ function isDocker() {
|
|
|
35
35
|
let cachedResult;
|
|
36
36
|
const hasContainerEnv = () => {
|
|
37
37
|
try {
|
|
38
|
-
fs.statSync("/run/.containerenv");
|
|
38
|
+
fs$1.statSync("/run/.containerenv");
|
|
39
39
|
return true;
|
|
40
40
|
} catch {
|
|
41
41
|
return false;
|
|
@@ -55,7 +55,7 @@ const isWsl = () => {
|
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
try {
|
|
58
|
-
return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
58
|
+
return fs$1.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
59
59
|
} catch {
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
@@ -72,11 +72,11 @@ const wslDrivesMountPoint = (() => {
|
|
|
72
72
|
const configFilePath = "/etc/wsl.conf";
|
|
73
73
|
let isConfigFileExists = false;
|
|
74
74
|
try {
|
|
75
|
-
await fs
|
|
75
|
+
await fs.access(configFilePath, constants.F_OK);
|
|
76
76
|
isConfigFileExists = true;
|
|
77
77
|
} catch {}
|
|
78
78
|
if (!isConfigFileExists) return defaultMountPoint;
|
|
79
|
-
const configContent = await fs
|
|
79
|
+
const configContent = await fs.readFile(configFilePath, { encoding: "utf8" });
|
|
80
80
|
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
81
81
|
if (!configMountPoint) return defaultMountPoint;
|
|
82
82
|
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
@@ -389,7 +389,7 @@ const baseOpen = async (options) => {
|
|
|
389
389
|
const isBundled = !__dirname || __dirname === "/";
|
|
390
390
|
let exeLocalXdgOpen = false;
|
|
391
391
|
try {
|
|
392
|
-
await fs
|
|
392
|
+
await fs.access(localXdgOpenPath, constants.X_OK);
|
|
393
393
|
exeLocalXdgOpen = true;
|
|
394
394
|
} catch {}
|
|
395
395
|
command = process.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
@@ -403,14 +403,14 @@ const baseOpen = async (options) => {
|
|
|
403
403
|
if (platform === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
|
|
404
404
|
if (options.target) cliArguments.push(options.target);
|
|
405
405
|
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
406
|
-
if (options.wait) return new Promise((resolve, reject) => {
|
|
406
|
+
if (options.wait) return new Promise((resolve$1, reject) => {
|
|
407
407
|
subprocess.once("error", reject);
|
|
408
408
|
subprocess.once("close", (exitCode) => {
|
|
409
409
|
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
410
410
|
reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
|
|
411
411
|
return;
|
|
412
412
|
}
|
|
413
|
-
resolve(subprocess);
|
|
413
|
+
resolve$1(subprocess);
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
subprocess.unref();
|