kandev 0.1.6 → 0.2.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/dev.js +13 -2
- package/dist/run.js +15 -4
- package/dist/shared.js +11 -9
- package/dist/start.js +11 -10
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -13,9 +13,20 @@ const shared_1 = require("./shared");
|
|
|
13
13
|
const web_1 = require("./web");
|
|
14
14
|
async function runDev({ repoRoot, backendPort, webPort }) {
|
|
15
15
|
const ports = await (0, shared_1.pickPorts)(backendPort, webPort);
|
|
16
|
-
const
|
|
16
|
+
const dbPath = node_path_1.default.join(repoRoot, "apps", "backend", "kandev.db");
|
|
17
|
+
const backendEnv = (0, shared_1.buildBackendEnv)({
|
|
18
|
+
ports,
|
|
19
|
+
extra: { KANDEV_MOCK_AGENT: "true", KANDEV_DATABASE_PATH: dbPath },
|
|
20
|
+
});
|
|
17
21
|
const webEnv = (0, shared_1.buildWebEnv)({ ports, includeMcp: true, debug: true });
|
|
18
|
-
(
|
|
22
|
+
const logLevel = process.env.KANDEV_LOGGING_LEVEL?.trim() || process.env.KANDEV_LOG_LEVEL?.trim() || "info";
|
|
23
|
+
(0, shared_1.logStartupInfo)({
|
|
24
|
+
header: "dev mode: using local repo",
|
|
25
|
+
ports,
|
|
26
|
+
dbPath,
|
|
27
|
+
includeMcp: true,
|
|
28
|
+
logLevel,
|
|
29
|
+
});
|
|
19
30
|
const supervisor = (0, process_1.createProcessSupervisor)();
|
|
20
31
|
supervisor.attachSignalHandlers();
|
|
21
32
|
const backendProc = (0, node_child_process_1.spawn)("make", ["-C", node_path_1.default.join("apps", "backend"), "dev"], {
|
package/dist/run.js
CHANGED
|
@@ -75,16 +75,27 @@ async function prepareReleaseBundle({ version, backendPort, webPort, }) {
|
|
|
75
75
|
requestedVersion: version,
|
|
76
76
|
webPort: actualWebPort,
|
|
77
77
|
agentctlPort,
|
|
78
|
+
dbPath,
|
|
79
|
+
logLevel,
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
function launchReleaseApps(prepared) {
|
|
81
83
|
const releaseSource = prepared.requestedVersion
|
|
82
84
|
? `(requested: ${prepared.requestedVersion})`
|
|
83
85
|
: "(github latest)";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
(0, shared_1.logStartupInfo)({
|
|
87
|
+
header: `release: ${prepared.releaseTag} ${releaseSource}`,
|
|
88
|
+
ports: {
|
|
89
|
+
backendPort: Number(prepared.backendEnv.KANDEV_SERVER_PORT),
|
|
90
|
+
webPort: prepared.webPort,
|
|
91
|
+
agentctlPort: prepared.agentctlPort,
|
|
92
|
+
mcpPort: 0,
|
|
93
|
+
backendUrl: prepared.backendUrl,
|
|
94
|
+
mcpUrl: "",
|
|
95
|
+
},
|
|
96
|
+
dbPath: prepared.dbPath,
|
|
97
|
+
logLevel: prepared.logLevel,
|
|
98
|
+
});
|
|
88
99
|
const supervisor = (0, process_1.createProcessSupervisor)();
|
|
89
100
|
supervisor.attachSignalHandlers();
|
|
90
101
|
const backendProc = (0, node_child_process_1.spawn)(prepared.backendBin, [], {
|
package/dist/shared.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.pickPorts = pickPorts;
|
|
10
10
|
exports.buildBackendEnv = buildBackendEnv;
|
|
11
11
|
exports.buildWebEnv = buildWebEnv;
|
|
12
|
-
exports.
|
|
12
|
+
exports.logStartupInfo = logStartupInfo;
|
|
13
13
|
exports.attachBackendExitHandler = attachBackendExitHandler;
|
|
14
14
|
const constants_1 = require("./constants");
|
|
15
15
|
const ports_1 = require("./ports");
|
|
@@ -83,15 +83,11 @@ function buildWebEnv(options) {
|
|
|
83
83
|
return env;
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
* Logs
|
|
87
|
-
*
|
|
88
|
-
* @param mode - The launch mode name (e.g., "dev", "production", "release")
|
|
89
|
-
* @param modeDescription - Human-readable description of the mode
|
|
90
|
-
* @param ports - Port configuration to log
|
|
91
|
-
* @param includeMcp - Whether to log MCP-related ports
|
|
86
|
+
* Logs a unified startup info block to the console.
|
|
92
87
|
*/
|
|
93
|
-
function
|
|
94
|
-
|
|
88
|
+
function logStartupInfo(options) {
|
|
89
|
+
const { header, ports, dbPath, includeMcp = false, logLevel } = options;
|
|
90
|
+
console.log(`[kandev] ${header}`);
|
|
95
91
|
console.log("[kandev] backend port:", ports.backendPort);
|
|
96
92
|
console.log("[kandev] web port:", ports.webPort);
|
|
97
93
|
console.log("[kandev] agentctl port:", ports.agentctlPort);
|
|
@@ -99,6 +95,12 @@ function logPortConfig(mode, modeDescription, ports, includeMcp = false) {
|
|
|
99
95
|
console.log("[kandev] mcp port:", ports.mcpPort);
|
|
100
96
|
console.log("[kandev] mcp url:", ports.mcpUrl);
|
|
101
97
|
}
|
|
98
|
+
if (dbPath) {
|
|
99
|
+
console.log("[kandev] db path:", dbPath);
|
|
100
|
+
}
|
|
101
|
+
if (logLevel) {
|
|
102
|
+
console.log("[kandev] log level:", logLevel);
|
|
103
|
+
}
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
104
106
|
* Attaches a standardized exit handler to a backend process.
|
package/dist/start.js
CHANGED
|
@@ -75,15 +75,23 @@ async function runStart({ repoRoot, backendPort, webPort, verbose = false, debug
|
|
|
75
75
|
// Production mode: use warn log level for clean output unless verbose/debug
|
|
76
76
|
const showOutput = verbose || debug;
|
|
77
77
|
const dbPath = node_path_1.default.join(constants_1.DATA_DIR, "kandev.db");
|
|
78
|
+
const logLevel = debug ? "debug" : verbose ? "info" : "warn";
|
|
78
79
|
const backendEnv = (0, shared_1.buildBackendEnv)({
|
|
79
80
|
ports,
|
|
80
|
-
logLevel
|
|
81
|
+
logLevel,
|
|
81
82
|
extra: {
|
|
82
83
|
KANDEV_DATABASE_PATH: dbPath,
|
|
83
84
|
...(debug ? { KANDEV_DEBUG_AGENT_MESSAGES: "true" } : {}),
|
|
84
85
|
},
|
|
85
86
|
});
|
|
86
87
|
const webEnv = (0, shared_1.buildWebEnv)({ ports, includeMcp: true, production: true, debug });
|
|
88
|
+
(0, shared_1.logStartupInfo)({
|
|
89
|
+
header: "start mode: using local build",
|
|
90
|
+
ports,
|
|
91
|
+
dbPath,
|
|
92
|
+
includeMcp: true,
|
|
93
|
+
logLevel,
|
|
94
|
+
});
|
|
87
95
|
const supervisor = (0, process_1.createProcessSupervisor)();
|
|
88
96
|
supervisor.attachSignalHandlers();
|
|
89
97
|
// Start backend with piped stdio (quiet mode unless verbose/debug)
|
|
@@ -112,13 +120,6 @@ async function runStart({ repoRoot, backendPort, webPort, verbose = false, debug
|
|
|
112
120
|
label: "web",
|
|
113
121
|
quiet: !showOutput,
|
|
114
122
|
});
|
|
115
|
-
|
|
116
|
-
console.log(
|
|
117
|
-
console.log("[kandev] Server started successfully");
|
|
118
|
-
console.log("");
|
|
119
|
-
console.log(` Web: ${webUrl}`);
|
|
120
|
-
console.log(` API: ${ports.backendUrl}`);
|
|
121
|
-
console.log(` MCP: ${ports.mcpUrl}`);
|
|
122
|
-
console.log(` Database: ${dbPath}`);
|
|
123
|
-
console.log("");
|
|
123
|
+
console.log(`[kandev] backend ready at ${ports.backendUrl}`);
|
|
124
|
+
console.log(`[kandev] web ready at ${webUrl}`);
|
|
124
125
|
}
|