@vornrun/mcp 0.1.1 → 0.1.2-beta.1
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/index.js +82 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,6 +54,48 @@ var DEFAULT_WORKSPACE = {
|
|
|
54
54
|
order: 0
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
// ../server/src/default-workflows.ts
|
|
58
|
+
var DEFAULT_TASK_WORKFLOW_ID = "system:default-task-workflow";
|
|
59
|
+
function buildDefaultTaskWorkflow() {
|
|
60
|
+
const triggerConfig = {
|
|
61
|
+
triggerType: "taskStatusChanged",
|
|
62
|
+
fromStatus: "todo",
|
|
63
|
+
toStatus: "in_progress"
|
|
64
|
+
// projectFilter omitted → fires in every project
|
|
65
|
+
};
|
|
66
|
+
const launchConfig = {
|
|
67
|
+
agentType: "fromTask",
|
|
68
|
+
projectName: "",
|
|
69
|
+
projectPath: "",
|
|
70
|
+
headless: true
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
id: DEFAULT_TASK_WORKFLOW_ID,
|
|
74
|
+
name: "Default Task Workflow",
|
|
75
|
+
icon: "Play",
|
|
76
|
+
iconColor: "#10b981",
|
|
77
|
+
enabled: true,
|
|
78
|
+
workspaceId: "personal",
|
|
79
|
+
nodes: [
|
|
80
|
+
{
|
|
81
|
+
id: "trigger-1",
|
|
82
|
+
type: "trigger",
|
|
83
|
+
label: "When task moves to In Progress",
|
|
84
|
+
position: { x: 0, y: 0 },
|
|
85
|
+
config: triggerConfig
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "launch-1",
|
|
89
|
+
type: "launchAgent",
|
|
90
|
+
label: "Launch task agent",
|
|
91
|
+
position: { x: 0, y: 120 },
|
|
92
|
+
config: launchConfig
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
edges: [{ id: "e1", source: "trigger-1", target: "launch-1" }]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
57
99
|
// ../server/src/database.ts
|
|
58
100
|
var CONFIG_DIR = path.join(os.homedir(), ".vorn");
|
|
59
101
|
var DB_PATH = path.join(CONFIG_DIR, "vorn.db");
|
|
@@ -71,6 +113,7 @@ function initDatabase() {
|
|
|
71
113
|
db.pragma("journal_mode = WAL");
|
|
72
114
|
db.pragma("foreign_keys = ON");
|
|
73
115
|
createSchema();
|
|
116
|
+
seedSystemDefaults();
|
|
74
117
|
} catch (err) {
|
|
75
118
|
logger_default.error("[database] Failed to open database:", err);
|
|
76
119
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -85,6 +128,40 @@ function initDatabase() {
|
|
|
85
128
|
}
|
|
86
129
|
}
|
|
87
130
|
}
|
|
131
|
+
function seedSystemDefaults() {
|
|
132
|
+
const d = getDb();
|
|
133
|
+
const flagRow = d.prepare("SELECT value FROM defaults WHERE key = 'hasSeededDefaultTaskWorkflow'").get();
|
|
134
|
+
if (flagRow) {
|
|
135
|
+
try {
|
|
136
|
+
if (JSON.parse(flagRow.value) === true) return;
|
|
137
|
+
} catch {
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const existing = d.prepare("SELECT id FROM workflows WHERE id = ?").get(DEFAULT_TASK_WORKFLOW_ID);
|
|
141
|
+
if (!existing) {
|
|
142
|
+
const w = buildDefaultTaskWorkflow();
|
|
143
|
+
d.prepare(
|
|
144
|
+
`INSERT INTO workflows (id, name, icon, icon_color, nodes, edges, enabled, last_run_at, last_run_status, stagger_delay_ms, workspace_id)
|
|
145
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
|
146
|
+
).run(
|
|
147
|
+
w.id,
|
|
148
|
+
w.name,
|
|
149
|
+
w.icon,
|
|
150
|
+
w.iconColor,
|
|
151
|
+
JSON.stringify(w.nodes),
|
|
152
|
+
JSON.stringify(w.edges),
|
|
153
|
+
w.enabled ? 1 : 0,
|
|
154
|
+
w.lastRunAt ?? null,
|
|
155
|
+
w.lastRunStatus ?? null,
|
|
156
|
+
w.staggerDelayMs ?? null,
|
|
157
|
+
w.workspaceId ?? "personal"
|
|
158
|
+
);
|
|
159
|
+
logger_default.info(`[database] Seeded default task workflow (${DEFAULT_TASK_WORKFLOW_ID})`);
|
|
160
|
+
}
|
|
161
|
+
d.prepare(
|
|
162
|
+
"INSERT OR REPLACE INTO defaults (key, value) VALUES ('hasSeededDefaultTaskWorkflow', ?)"
|
|
163
|
+
).run(JSON.stringify(true));
|
|
164
|
+
}
|
|
88
165
|
function recoverCorruptDatabase() {
|
|
89
166
|
try {
|
|
90
167
|
db?.close();
|
|
@@ -110,6 +187,7 @@ function recoverCorruptDatabase() {
|
|
|
110
187
|
db.pragma("journal_mode = WAL");
|
|
111
188
|
db.pragma("foreign_keys = ON");
|
|
112
189
|
createSchema();
|
|
190
|
+
seedSystemDefaults();
|
|
113
191
|
logger_default.info("[database] Successfully created fresh database after corruption recovery");
|
|
114
192
|
} catch (freshErr) {
|
|
115
193
|
logger_default.error("[database] Failed to create fresh database after corruption:", freshErr);
|
|
@@ -586,6 +664,9 @@ function loadDefaults(d) {
|
|
|
586
664
|
},
|
|
587
665
|
...map.headlessRetentionMinutes !== void 0 && {
|
|
588
666
|
headlessRetentionMinutes: map.headlessRetentionMinutes
|
|
667
|
+
},
|
|
668
|
+
...map.hasSeededDefaultTaskWorkflow !== void 0 && {
|
|
669
|
+
hasSeededDefaultTaskWorkflow: map.hasSeededDefaultTaskWorkflow
|
|
589
670
|
}
|
|
590
671
|
};
|
|
591
672
|
}
|
|
@@ -2514,7 +2595,7 @@ console.warn = (...args) => _origError("[mcp:warn]", ...args);
|
|
|
2514
2595
|
console.error = (...args) => _origError("[mcp:error]", ...args);
|
|
2515
2596
|
async function main() {
|
|
2516
2597
|
configManager.init();
|
|
2517
|
-
const version = true ? "0.1.1" : createRequire(import.meta.url)("../package.json").version;
|
|
2598
|
+
const version = true ? "0.1.2-beta.1" : createRequire(import.meta.url)("../package.json").version;
|
|
2518
2599
|
const server = createMcpServer(version);
|
|
2519
2600
|
const transport = new StdioServerTransport();
|
|
2520
2601
|
await server.connect(transport);
|