@deeplake/hivemind 0.7.46 → 0.7.47
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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +64 -0
- package/bundle/cli.js +17230 -4177
- package/codex/bundle/capture.js +185 -0
- package/codex/bundle/commands/auth-login.js +185 -0
- package/codex/bundle/graph-pull-worker.js +185 -0
- package/codex/bundle/pre-tool-use.js +185 -0
- package/codex/bundle/session-start-setup.js +185 -0
- package/codex/bundle/session-start.js +185 -0
- package/codex/bundle/shell/deeplake-shell.js +451 -3
- package/codex/bundle/skillify-worker.js +64 -0
- package/codex/bundle/stop.js +185 -0
- package/codex/skills/hivemind-goals/SKILL.md +157 -0
- package/cursor/bundle/capture.js +185 -0
- package/cursor/bundle/commands/auth-login.js +185 -0
- package/cursor/bundle/graph-pull-worker.js +185 -0
- package/cursor/bundle/pre-tool-use.js +185 -0
- package/cursor/bundle/session-end.js +16 -0
- package/cursor/bundle/session-start.js +596 -6
- package/cursor/bundle/shell/deeplake-shell.js +451 -3
- package/cursor/bundle/skillify-worker.js +64 -0
- package/hermes/bundle/capture.js +185 -0
- package/hermes/bundle/commands/auth-login.js +185 -0
- package/hermes/bundle/graph-pull-worker.js +185 -0
- package/hermes/bundle/pre-tool-use.js +185 -0
- package/hermes/bundle/session-end.js +16 -0
- package/hermes/bundle/session-start.js +596 -6
- package/hermes/bundle/shell/deeplake-shell.js +451 -3
- package/hermes/bundle/skillify-worker.js +64 -0
- package/mcp/bundle/server.js +185 -0
- package/openclaw/dist/chunks/{config-O5PDJQ7Y.js → config-FH6JYSJW.js} +16 -0
- package/openclaw/dist/index.js +262 -2
- package/openclaw/dist/skillify-worker.js +64 -0
- package/openclaw/openclaw.plugin.json +4 -2
- package/openclaw/package.json +1 -1
- package/openclaw/skills/hivemind-goals/SKILL.md +30 -0
- package/package.json +2 -1
package/mcp/bundle/server.js
CHANGED
|
@@ -23330,6 +23330,22 @@ function loadConfig() {
|
|
|
23330
23330
|
tableName: process.env.HIVEMIND_TABLE ?? "memory",
|
|
23331
23331
|
sessionsTableName: process.env.HIVEMIND_SESSIONS_TABLE ?? "sessions",
|
|
23332
23332
|
skillsTableName: process.env.HIVEMIND_SKILLS_TABLE ?? "skills",
|
|
23333
|
+
// Defaults match the table name written into the SQL — keep aligned
|
|
23334
|
+
// with RULES_COLUMNS / TASKS_COLUMNS / TASK_EVENTS_COLUMNS in
|
|
23335
|
+
// deeplake-schema.ts and with the e2e test-org override convention
|
|
23336
|
+
// (memory_test / sessions_test → goals_test, etc.) documented in
|
|
23337
|
+
// CLAUDE.md.
|
|
23338
|
+
rulesTableName: process.env.HIVEMIND_RULES_TABLE ?? "hivemind_rules",
|
|
23339
|
+
tasksTableName: process.env.HIVEMIND_TASKS_TABLE ?? "hivemind_tasks",
|
|
23340
|
+
taskEventsTableName: process.env.HIVEMIND_TASK_EVENTS_TABLE ?? "hivemind_task_events",
|
|
23341
|
+
// Goals + KPIs (refined design — VFS path classifier maps
|
|
23342
|
+
// memory/goal/<user>/<status>/<uuid>.md → hivemind_goals row
|
|
23343
|
+
// memory/kpi/<uuid>/<kpi_id>.md → hivemind_kpis row
|
|
23344
|
+
// See src/shell/deeplake-fs.ts for the translation logic and
|
|
23345
|
+
// GOALS_COLUMNS / KPIS_COLUMNS in deeplake-schema.ts for the
|
|
23346
|
+
// table shape.
|
|
23347
|
+
goalsTableName: process.env.HIVEMIND_GOALS_TABLE ?? "hivemind_goals",
|
|
23348
|
+
kpisTableName: process.env.HIVEMIND_KPIS_TABLE ?? "hivemind_kpis",
|
|
23333
23349
|
codebaseTableName: process.env.HIVEMIND_CODEBASE_TABLE ?? "codebase",
|
|
23334
23350
|
memoryPath: process.env.HIVEMIND_MEMORY_PATH ?? join3(home, ".deeplake", "memory")
|
|
23335
23351
|
};
|
|
@@ -23422,6 +23438,65 @@ var SKILLS_COLUMNS = Object.freeze([
|
|
|
23422
23438
|
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23423
23439
|
{ name: "updated_at", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
23424
23440
|
]);
|
|
23441
|
+
var RULES_COLUMNS = Object.freeze([
|
|
23442
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23443
|
+
{ name: "rule_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23444
|
+
{ name: "text", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23445
|
+
{ name: "scope", sql: "TEXT NOT NULL DEFAULT 'team'" },
|
|
23446
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'active'" },
|
|
23447
|
+
{ name: "assigned_by", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23448
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
23449
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23450
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
23451
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
23452
|
+
]);
|
|
23453
|
+
var TASKS_COLUMNS = Object.freeze([
|
|
23454
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23455
|
+
{ name: "task_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23456
|
+
{ name: "text", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23457
|
+
{ name: "scope", sql: "TEXT NOT NULL DEFAULT 'me'" },
|
|
23458
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'active'" },
|
|
23459
|
+
{ name: "assigned_to", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23460
|
+
{ name: "assigned_by", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23461
|
+
{ name: "kpis", sql: "JSONB" },
|
|
23462
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
23463
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23464
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
23465
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
23466
|
+
]);
|
|
23467
|
+
var TASK_EVENTS_COLUMNS = Object.freeze([
|
|
23468
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23469
|
+
{ name: "task_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23470
|
+
{ name: "task_version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
23471
|
+
{ name: "kpi_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23472
|
+
{ name: "value", sql: "BIGINT NOT NULL DEFAULT 0" },
|
|
23473
|
+
{ name: "note", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23474
|
+
{ name: "source", sql: "TEXT NOT NULL DEFAULT 'user'" },
|
|
23475
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23476
|
+
{ name: "ts", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23477
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
23478
|
+
]);
|
|
23479
|
+
var GOALS_COLUMNS = Object.freeze([
|
|
23480
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23481
|
+
{ name: "goal_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23482
|
+
{ name: "owner", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23483
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'opened'" },
|
|
23484
|
+
{ name: "content", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23485
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
23486
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23487
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
23488
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
23489
|
+
]);
|
|
23490
|
+
var KPIS_COLUMNS = Object.freeze([
|
|
23491
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23492
|
+
{ name: "goal_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23493
|
+
{ name: "kpi_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23494
|
+
{ name: "content", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23495
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
23496
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
23497
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
23498
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
23499
|
+
]);
|
|
23425
23500
|
function validateSchema(label, cols) {
|
|
23426
23501
|
const seen = /* @__PURE__ */ new Set();
|
|
23427
23502
|
for (const col of cols) {
|
|
@@ -23465,6 +23540,11 @@ var CODEBASE_COLUMNS = Object.freeze([
|
|
|
23465
23540
|
validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
|
|
23466
23541
|
validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
|
|
23467
23542
|
validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
|
|
23543
|
+
validateSchema("RULES_COLUMNS", RULES_COLUMNS);
|
|
23544
|
+
validateSchema("TASKS_COLUMNS", TASKS_COLUMNS);
|
|
23545
|
+
validateSchema("TASK_EVENTS_COLUMNS", TASK_EVENTS_COLUMNS);
|
|
23546
|
+
validateSchema("GOALS_COLUMNS", GOALS_COLUMNS);
|
|
23547
|
+
validateSchema("KPIS_COLUMNS", KPIS_COLUMNS);
|
|
23468
23548
|
validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
|
|
23469
23549
|
function buildCreateTableSql(tableName, cols) {
|
|
23470
23550
|
const safe = sqlIdent(tableName);
|
|
@@ -24043,6 +24123,111 @@ var DeeplakeApi = class {
|
|
|
24043
24123
|
await this.healSchema(safe, SKILLS_COLUMNS);
|
|
24044
24124
|
await this.ensureLookupIndex(safe, "project_key_name", `("project_key", "name")`);
|
|
24045
24125
|
}
|
|
24126
|
+
/**
|
|
24127
|
+
* Create the rules table.
|
|
24128
|
+
*
|
|
24129
|
+
* One row per rule version (same write pattern as skills): edits INSERT
|
|
24130
|
+
* a fresh row with version+1, reads pick latest per rule_id via
|
|
24131
|
+
* `ORDER BY version DESC LIMIT 1`. Sidesteps the Deeplake
|
|
24132
|
+
* UPDATE-coalescing quirk by never UPDATEing.
|
|
24133
|
+
*/
|
|
24134
|
+
async ensureRulesTable(name) {
|
|
24135
|
+
const safe = sqlIdent(name);
|
|
24136
|
+
const tables = await this.listTables();
|
|
24137
|
+
if (!tables.includes(safe)) {
|
|
24138
|
+
log3(`table "${safe}" not found, creating`);
|
|
24139
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, RULES_COLUMNS), safe);
|
|
24140
|
+
log3(`table "${safe}" created`);
|
|
24141
|
+
if (!tables.includes(safe))
|
|
24142
|
+
this._tablesCache = [...tables, safe];
|
|
24143
|
+
}
|
|
24144
|
+
await this.healSchema(safe, RULES_COLUMNS);
|
|
24145
|
+
await this.ensureLookupIndex(safe, "rule_id_version", `("rule_id", "version")`);
|
|
24146
|
+
}
|
|
24147
|
+
/**
|
|
24148
|
+
* Create the tasks table.
|
|
24149
|
+
*
|
|
24150
|
+
* Same write pattern as rules + skills. `kpis` is a nullable JSONB
|
|
24151
|
+
* column with the agent's KPI metadata; KPI current values come from
|
|
24152
|
+
* `task_events` (SUM(value)), not this snapshot.
|
|
24153
|
+
*/
|
|
24154
|
+
async ensureTasksTable(name) {
|
|
24155
|
+
const safe = sqlIdent(name);
|
|
24156
|
+
const tables = await this.listTables();
|
|
24157
|
+
if (!tables.includes(safe)) {
|
|
24158
|
+
log3(`table "${safe}" not found, creating`);
|
|
24159
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, TASKS_COLUMNS), safe);
|
|
24160
|
+
log3(`table "${safe}" created`);
|
|
24161
|
+
if (!tables.includes(safe))
|
|
24162
|
+
this._tablesCache = [...tables, safe];
|
|
24163
|
+
}
|
|
24164
|
+
await this.healSchema(safe, TASKS_COLUMNS);
|
|
24165
|
+
await this.ensureLookupIndex(safe, "task_id_version", `("task_id", "version")`);
|
|
24166
|
+
}
|
|
24167
|
+
/**
|
|
24168
|
+
* Create the task-events table.
|
|
24169
|
+
*
|
|
24170
|
+
* Append-only. Every INSERT is a fresh row; never UPDATE. KPI current
|
|
24171
|
+
* value is `SUM(value) WHERE task_id=? AND kpi_id=?`. Index on
|
|
24172
|
+
* (task_id, kpi_id) is the canonical aggregation key.
|
|
24173
|
+
*/
|
|
24174
|
+
async ensureTaskEventsTable(name) {
|
|
24175
|
+
const safe = sqlIdent(name);
|
|
24176
|
+
const tables = await this.listTables();
|
|
24177
|
+
if (!tables.includes(safe)) {
|
|
24178
|
+
log3(`table "${safe}" not found, creating`);
|
|
24179
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, TASK_EVENTS_COLUMNS), safe);
|
|
24180
|
+
log3(`table "${safe}" created`);
|
|
24181
|
+
if (!tables.includes(safe))
|
|
24182
|
+
this._tablesCache = [...tables, safe];
|
|
24183
|
+
}
|
|
24184
|
+
await this.healSchema(safe, TASK_EVENTS_COLUMNS);
|
|
24185
|
+
await this.ensureLookupIndex(safe, "task_id_kpi_id", `("task_id", "kpi_id")`);
|
|
24186
|
+
}
|
|
24187
|
+
/**
|
|
24188
|
+
* Create the goals table.
|
|
24189
|
+
*
|
|
24190
|
+
* Backed by the VFS path convention memory/goal/<owner>/<status>/<goal_id>.md.
|
|
24191
|
+
* INSERT-only version-bumped: rm and mv operations translate to fresh
|
|
24192
|
+
* v=N+1 rows (status flips for mv → closed; rm is the same soft-close).
|
|
24193
|
+
* The (goal_id, version) index lets the VFS dispatch a cheap latest-row
|
|
24194
|
+
* read on cat / Read of a single goal.
|
|
24195
|
+
*/
|
|
24196
|
+
async ensureGoalsTable(name) {
|
|
24197
|
+
const safe = sqlIdent(name);
|
|
24198
|
+
const tables = await this.listTables();
|
|
24199
|
+
if (!tables.includes(safe)) {
|
|
24200
|
+
log3(`table "${safe}" not found, creating`);
|
|
24201
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, GOALS_COLUMNS), safe);
|
|
24202
|
+
log3(`table "${safe}" created`);
|
|
24203
|
+
if (!tables.includes(safe))
|
|
24204
|
+
this._tablesCache = [...tables, safe];
|
|
24205
|
+
}
|
|
24206
|
+
await this.healSchema(safe, GOALS_COLUMNS);
|
|
24207
|
+
await this.ensureLookupIndex(safe, "goal_id_version", `("goal_id", "version")`);
|
|
24208
|
+
await this.ensureLookupIndex(safe, "owner_status", `("owner", "status")`);
|
|
24209
|
+
}
|
|
24210
|
+
/**
|
|
24211
|
+
* Create the kpis table.
|
|
24212
|
+
*
|
|
24213
|
+
* Backed by memory/kpi/<goal_id>/<kpi_id>.md. KPI rows do NOT carry
|
|
24214
|
+
* owner — ownership derives from the parent goal via logical join on
|
|
24215
|
+
* goal_id. INSERT-only version-bumped. (goal_id, kpi_id) index is the
|
|
24216
|
+
* canonical lookup the VFS uses on Read and Write.
|
|
24217
|
+
*/
|
|
24218
|
+
async ensureKpisTable(name) {
|
|
24219
|
+
const safe = sqlIdent(name);
|
|
24220
|
+
const tables = await this.listTables();
|
|
24221
|
+
if (!tables.includes(safe)) {
|
|
24222
|
+
log3(`table "${safe}" not found, creating`);
|
|
24223
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, KPIS_COLUMNS), safe);
|
|
24224
|
+
log3(`table "${safe}" created`);
|
|
24225
|
+
if (!tables.includes(safe))
|
|
24226
|
+
this._tablesCache = [...tables, safe];
|
|
24227
|
+
}
|
|
24228
|
+
await this.healSchema(safe, KPIS_COLUMNS);
|
|
24229
|
+
await this.ensureLookupIndex(safe, "goal_id_kpi_id", `("goal_id", "kpi_id")`);
|
|
24230
|
+
}
|
|
24046
24231
|
};
|
|
24047
24232
|
|
|
24048
24233
|
// dist/src/shell/grep-core.js
|
|
@@ -28,6 +28,22 @@ function loadConfig() {
|
|
|
28
28
|
tableName: "memory",
|
|
29
29
|
sessionsTableName: "sessions",
|
|
30
30
|
skillsTableName: process.env.HIVEMIND_SKILLS_TABLE ?? "skills",
|
|
31
|
+
// Defaults match the table name written into the SQL — keep aligned
|
|
32
|
+
// with RULES_COLUMNS / TASKS_COLUMNS / TASK_EVENTS_COLUMNS in
|
|
33
|
+
// deeplake-schema.ts and with the e2e test-org override convention
|
|
34
|
+
// (memory_test / sessions_test → goals_test, etc.) documented in
|
|
35
|
+
// CLAUDE.md.
|
|
36
|
+
rulesTableName: process.env.HIVEMIND_RULES_TABLE ?? "hivemind_rules",
|
|
37
|
+
tasksTableName: process.env.HIVEMIND_TASKS_TABLE ?? "hivemind_tasks",
|
|
38
|
+
taskEventsTableName: process.env.HIVEMIND_TASK_EVENTS_TABLE ?? "hivemind_task_events",
|
|
39
|
+
// Goals + KPIs (refined design — VFS path classifier maps
|
|
40
|
+
// memory/goal/<user>/<status>/<uuid>.md → hivemind_goals row
|
|
41
|
+
// memory/kpi/<uuid>/<kpi_id>.md → hivemind_kpis row
|
|
42
|
+
// See src/shell/deeplake-fs.ts for the translation logic and
|
|
43
|
+
// GOALS_COLUMNS / KPIS_COLUMNS in deeplake-schema.ts for the
|
|
44
|
+
// table shape.
|
|
45
|
+
goalsTableName: process.env.HIVEMIND_GOALS_TABLE ?? "hivemind_goals",
|
|
46
|
+
kpisTableName: process.env.HIVEMIND_KPIS_TABLE ?? "hivemind_kpis",
|
|
31
47
|
codebaseTableName: "codebase",
|
|
32
48
|
memoryPath: join(home, ".deeplake", "memory")
|
|
33
49
|
};
|
package/openclaw/dist/index.js
CHANGED
|
@@ -200,6 +200,65 @@ var SKILLS_COLUMNS = Object.freeze([
|
|
|
200
200
|
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
201
201
|
{ name: "updated_at", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
202
202
|
]);
|
|
203
|
+
var RULES_COLUMNS = Object.freeze([
|
|
204
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
205
|
+
{ name: "rule_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
206
|
+
{ name: "text", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
207
|
+
{ name: "scope", sql: "TEXT NOT NULL DEFAULT 'team'" },
|
|
208
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'active'" },
|
|
209
|
+
{ name: "assigned_by", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
210
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
211
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
212
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
213
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
214
|
+
]);
|
|
215
|
+
var TASKS_COLUMNS = Object.freeze([
|
|
216
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
217
|
+
{ name: "task_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
218
|
+
{ name: "text", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
219
|
+
{ name: "scope", sql: "TEXT NOT NULL DEFAULT 'me'" },
|
|
220
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'active'" },
|
|
221
|
+
{ name: "assigned_to", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
222
|
+
{ name: "assigned_by", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
223
|
+
{ name: "kpis", sql: "JSONB" },
|
|
224
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
225
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
226
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
227
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
228
|
+
]);
|
|
229
|
+
var TASK_EVENTS_COLUMNS = Object.freeze([
|
|
230
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
231
|
+
{ name: "task_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
232
|
+
{ name: "task_version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
233
|
+
{ name: "kpi_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
234
|
+
{ name: "value", sql: "BIGINT NOT NULL DEFAULT 0" },
|
|
235
|
+
{ name: "note", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
236
|
+
{ name: "source", sql: "TEXT NOT NULL DEFAULT 'user'" },
|
|
237
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
238
|
+
{ name: "ts", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
239
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
240
|
+
]);
|
|
241
|
+
var GOALS_COLUMNS = Object.freeze([
|
|
242
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
243
|
+
{ name: "goal_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
244
|
+
{ name: "owner", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
245
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'opened'" },
|
|
246
|
+
{ name: "content", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
247
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
248
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
249
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
250
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
251
|
+
]);
|
|
252
|
+
var KPIS_COLUMNS = Object.freeze([
|
|
253
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
254
|
+
{ name: "goal_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
255
|
+
{ name: "kpi_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
256
|
+
{ name: "content", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
257
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
258
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
259
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
260
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
261
|
+
]);
|
|
203
262
|
function validateSchema(label, cols) {
|
|
204
263
|
const seen = /* @__PURE__ */ new Set();
|
|
205
264
|
for (const col of cols) {
|
|
@@ -245,6 +304,11 @@ var CODEBASE_COLUMNS = Object.freeze([
|
|
|
245
304
|
validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
|
|
246
305
|
validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
|
|
247
306
|
validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
|
|
307
|
+
validateSchema("RULES_COLUMNS", RULES_COLUMNS);
|
|
308
|
+
validateSchema("TASKS_COLUMNS", TASKS_COLUMNS);
|
|
309
|
+
validateSchema("TASK_EVENTS_COLUMNS", TASK_EVENTS_COLUMNS);
|
|
310
|
+
validateSchema("GOALS_COLUMNS", GOALS_COLUMNS);
|
|
311
|
+
validateSchema("KPIS_COLUMNS", KPIS_COLUMNS);
|
|
248
312
|
validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
|
|
249
313
|
function buildCreateTableSql(tableName, cols) {
|
|
250
314
|
const safe = sqlIdent(tableName);
|
|
@@ -814,6 +878,106 @@ var DeeplakeApi = class {
|
|
|
814
878
|
await this.healSchema(safe, SKILLS_COLUMNS);
|
|
815
879
|
await this.ensureLookupIndex(safe, "project_key_name", `("project_key", "name")`);
|
|
816
880
|
}
|
|
881
|
+
/**
|
|
882
|
+
* Create the rules table.
|
|
883
|
+
*
|
|
884
|
+
* One row per rule version (same write pattern as skills): edits INSERT
|
|
885
|
+
* a fresh row with version+1, reads pick latest per rule_id via
|
|
886
|
+
* `ORDER BY version DESC LIMIT 1`. Sidesteps the Deeplake
|
|
887
|
+
* UPDATE-coalescing quirk by never UPDATEing.
|
|
888
|
+
*/
|
|
889
|
+
async ensureRulesTable(name) {
|
|
890
|
+
const safe = sqlIdent(name);
|
|
891
|
+
const tables = await this.listTables();
|
|
892
|
+
if (!tables.includes(safe)) {
|
|
893
|
+
log3(`table "${safe}" not found, creating`);
|
|
894
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, RULES_COLUMNS), safe);
|
|
895
|
+
log3(`table "${safe}" created`);
|
|
896
|
+
if (!tables.includes(safe)) this._tablesCache = [...tables, safe];
|
|
897
|
+
}
|
|
898
|
+
await this.healSchema(safe, RULES_COLUMNS);
|
|
899
|
+
await this.ensureLookupIndex(safe, "rule_id_version", `("rule_id", "version")`);
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Create the tasks table.
|
|
903
|
+
*
|
|
904
|
+
* Same write pattern as rules + skills. `kpis` is a nullable JSONB
|
|
905
|
+
* column with the agent's KPI metadata; KPI current values come from
|
|
906
|
+
* `task_events` (SUM(value)), not this snapshot.
|
|
907
|
+
*/
|
|
908
|
+
async ensureTasksTable(name) {
|
|
909
|
+
const safe = sqlIdent(name);
|
|
910
|
+
const tables = await this.listTables();
|
|
911
|
+
if (!tables.includes(safe)) {
|
|
912
|
+
log3(`table "${safe}" not found, creating`);
|
|
913
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, TASKS_COLUMNS), safe);
|
|
914
|
+
log3(`table "${safe}" created`);
|
|
915
|
+
if (!tables.includes(safe)) this._tablesCache = [...tables, safe];
|
|
916
|
+
}
|
|
917
|
+
await this.healSchema(safe, TASKS_COLUMNS);
|
|
918
|
+
await this.ensureLookupIndex(safe, "task_id_version", `("task_id", "version")`);
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Create the task-events table.
|
|
922
|
+
*
|
|
923
|
+
* Append-only. Every INSERT is a fresh row; never UPDATE. KPI current
|
|
924
|
+
* value is `SUM(value) WHERE task_id=? AND kpi_id=?`. Index on
|
|
925
|
+
* (task_id, kpi_id) is the canonical aggregation key.
|
|
926
|
+
*/
|
|
927
|
+
async ensureTaskEventsTable(name) {
|
|
928
|
+
const safe = sqlIdent(name);
|
|
929
|
+
const tables = await this.listTables();
|
|
930
|
+
if (!tables.includes(safe)) {
|
|
931
|
+
log3(`table "${safe}" not found, creating`);
|
|
932
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, TASK_EVENTS_COLUMNS), safe);
|
|
933
|
+
log3(`table "${safe}" created`);
|
|
934
|
+
if (!tables.includes(safe)) this._tablesCache = [...tables, safe];
|
|
935
|
+
}
|
|
936
|
+
await this.healSchema(safe, TASK_EVENTS_COLUMNS);
|
|
937
|
+
await this.ensureLookupIndex(safe, "task_id_kpi_id", `("task_id", "kpi_id")`);
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Create the goals table.
|
|
941
|
+
*
|
|
942
|
+
* Backed by the VFS path convention memory/goal/<owner>/<status>/<goal_id>.md.
|
|
943
|
+
* INSERT-only version-bumped: rm and mv operations translate to fresh
|
|
944
|
+
* v=N+1 rows (status flips for mv → closed; rm is the same soft-close).
|
|
945
|
+
* The (goal_id, version) index lets the VFS dispatch a cheap latest-row
|
|
946
|
+
* read on cat / Read of a single goal.
|
|
947
|
+
*/
|
|
948
|
+
async ensureGoalsTable(name) {
|
|
949
|
+
const safe = sqlIdent(name);
|
|
950
|
+
const tables = await this.listTables();
|
|
951
|
+
if (!tables.includes(safe)) {
|
|
952
|
+
log3(`table "${safe}" not found, creating`);
|
|
953
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, GOALS_COLUMNS), safe);
|
|
954
|
+
log3(`table "${safe}" created`);
|
|
955
|
+
if (!tables.includes(safe)) this._tablesCache = [...tables, safe];
|
|
956
|
+
}
|
|
957
|
+
await this.healSchema(safe, GOALS_COLUMNS);
|
|
958
|
+
await this.ensureLookupIndex(safe, "goal_id_version", `("goal_id", "version")`);
|
|
959
|
+
await this.ensureLookupIndex(safe, "owner_status", `("owner", "status")`);
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Create the kpis table.
|
|
963
|
+
*
|
|
964
|
+
* Backed by memory/kpi/<goal_id>/<kpi_id>.md. KPI rows do NOT carry
|
|
965
|
+
* owner — ownership derives from the parent goal via logical join on
|
|
966
|
+
* goal_id. INSERT-only version-bumped. (goal_id, kpi_id) index is the
|
|
967
|
+
* canonical lookup the VFS uses on Read and Write.
|
|
968
|
+
*/
|
|
969
|
+
async ensureKpisTable(name) {
|
|
970
|
+
const safe = sqlIdent(name);
|
|
971
|
+
const tables = await this.listTables();
|
|
972
|
+
if (!tables.includes(safe)) {
|
|
973
|
+
log3(`table "${safe}" not found, creating`);
|
|
974
|
+
await this.createTableWithRetry(buildCreateTableSql(safe, KPIS_COLUMNS), safe);
|
|
975
|
+
log3(`table "${safe}" created`);
|
|
976
|
+
if (!tables.includes(safe)) this._tablesCache = [...tables, safe];
|
|
977
|
+
}
|
|
978
|
+
await this.healSchema(safe, KPIS_COLUMNS);
|
|
979
|
+
await this.ensureLookupIndex(safe, "goal_id_kpi_id", `("goal_id", "kpi_id")`);
|
|
980
|
+
}
|
|
817
981
|
};
|
|
818
982
|
|
|
819
983
|
// src/shell/grep-core.ts
|
|
@@ -1573,7 +1737,7 @@ function loadCredsModule() {
|
|
|
1573
1737
|
return credsModulePromise;
|
|
1574
1738
|
}
|
|
1575
1739
|
function loadConfigModule() {
|
|
1576
|
-
if (!configModulePromise) configModulePromise = import("./chunks/config-
|
|
1740
|
+
if (!configModulePromise) configModulePromise = import("./chunks/config-FH6JYSJW.js");
|
|
1577
1741
|
return configModulePromise;
|
|
1578
1742
|
}
|
|
1579
1743
|
async function loadCredentials2() {
|
|
@@ -1629,7 +1793,7 @@ function extractLatestVersion(body) {
|
|
|
1629
1793
|
return typeof v === "string" && v.length > 0 ? v : null;
|
|
1630
1794
|
}
|
|
1631
1795
|
function getInstalledVersion() {
|
|
1632
|
-
return "0.7.
|
|
1796
|
+
return "0.7.47".length > 0 ? "0.7.47" : null;
|
|
1633
1797
|
}
|
|
1634
1798
|
function isNewer(latest, current) {
|
|
1635
1799
|
const parse = (v) => v.replace(/-.*$/, "").split(".").map(Number);
|
|
@@ -1729,6 +1893,8 @@ var api = null;
|
|
|
1729
1893
|
var sessionsTable = "sessions";
|
|
1730
1894
|
var memoryTable = "memory";
|
|
1731
1895
|
var skillsTable = "skills";
|
|
1896
|
+
var goalsTable = "hivemind_goals";
|
|
1897
|
+
var kpisTable = "hivemind_kpis";
|
|
1732
1898
|
var captureEnabled = true;
|
|
1733
1899
|
var capturedCounts = /* @__PURE__ */ new Map();
|
|
1734
1900
|
var fallbackSessionId = crypto.randomUUID();
|
|
@@ -1918,6 +2084,8 @@ async function getApi() {
|
|
|
1918
2084
|
sessionsTable = config.sessionsTableName;
|
|
1919
2085
|
memoryTable = config.tableName;
|
|
1920
2086
|
skillsTable = config.skillsTableName;
|
|
2087
|
+
goalsTable = config.goalsTableName;
|
|
2088
|
+
kpisTable = config.kpisTableName;
|
|
1921
2089
|
const candidate = new DeeplakeApi(config.token, config.apiUrl, config.orgId, config.workspaceId, config.tableName);
|
|
1922
2090
|
await candidate.ensureTable();
|
|
1923
2091
|
await candidate.ensureSessionsTable(sessionsTable);
|
|
@@ -2273,6 +2441,98 @@ ${body.slice(0, 500)}`;
|
|
|
2273
2441
|
}
|
|
2274
2442
|
}
|
|
2275
2443
|
});
|
|
2444
|
+
pluginApi.registerTool({
|
|
2445
|
+
name: "hivemind_goal_add",
|
|
2446
|
+
label: "Hivemind Goal Add",
|
|
2447
|
+
description: "Create a new Hivemind team goal. Persists to the org-shared hivemind_goals table \u2014 teammates see it on next SessionStart. Returns the generated goal_id. Use when the user wants to track a measurable objective or milestone.",
|
|
2448
|
+
parameters: {
|
|
2449
|
+
type: "object",
|
|
2450
|
+
additionalProperties: false,
|
|
2451
|
+
properties: {
|
|
2452
|
+
text: {
|
|
2453
|
+
type: "string",
|
|
2454
|
+
minLength: 1,
|
|
2455
|
+
description: "One-line goal description (e.g. 'ship the goals feature by Friday')."
|
|
2456
|
+
}
|
|
2457
|
+
},
|
|
2458
|
+
required: ["text"]
|
|
2459
|
+
},
|
|
2460
|
+
execute: async (_toolCallId, rawParams) => {
|
|
2461
|
+
const params = rawParams;
|
|
2462
|
+
const dl = await getApi();
|
|
2463
|
+
if (!dl) {
|
|
2464
|
+
return { content: [{ type: "text", text: "Not logged in. Run /hivemind_login first." }] };
|
|
2465
|
+
}
|
|
2466
|
+
try {
|
|
2467
|
+
const config2 = await loadConfig();
|
|
2468
|
+
const owner = config2?.userName ?? "unknown";
|
|
2469
|
+
await dl.ensureGoalsTable(goalsTable);
|
|
2470
|
+
const goalId = crypto.randomUUID();
|
|
2471
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
2472
|
+
const safe = goalsTable.replace(/[^A-Za-z0-9_]/g, "");
|
|
2473
|
+
await dl.query(
|
|
2474
|
+
`INSERT INTO "${safe}" (id, goal_id, owner, status, content, version, created_at, agent, plugin_version) VALUES ('${crypto.randomUUID()}', '${sqlStr(goalId)}', '${sqlStr(owner)}', 'opened', E'${sqlStr(params.text)}', 1, '${sqlStr(ts)}', 'openclaw', '')`
|
|
2475
|
+
);
|
|
2476
|
+
pluginApi.logger.info?.(`hivemind_goal_add \u2192 ${goalId}`);
|
|
2477
|
+
return { content: [{ type: "text", text: `Goal created.
|
|
2478
|
+
goal_id: ${goalId}
|
|
2479
|
+
owner: ${owner}
|
|
2480
|
+
status: opened
|
|
2481
|
+
text: ${params.text}` }], details: { goal_id: goalId } };
|
|
2482
|
+
} catch (err) {
|
|
2483
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2484
|
+
pluginApi.logger.error(`hivemind_goal_add failed: ${msg}`);
|
|
2485
|
+
return { content: [{ type: "text", text: `Goal add failed: ${msg}` }] };
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
});
|
|
2489
|
+
pluginApi.registerTool({
|
|
2490
|
+
name: "hivemind_kpi_add",
|
|
2491
|
+
label: "Hivemind KPI Add",
|
|
2492
|
+
description: "Add a measurable KPI to an existing Hivemind goal. Persists to the org-shared hivemind_kpis table. Only call after the user has explicitly asked for KPIs \u2014 do NOT auto-generate them.",
|
|
2493
|
+
parameters: {
|
|
2494
|
+
type: "object",
|
|
2495
|
+
additionalProperties: false,
|
|
2496
|
+
properties: {
|
|
2497
|
+
goal_id: { type: "string", minLength: 1, description: "Existing goal_id (UUID) returned by hivemind_goal_add." },
|
|
2498
|
+
kpi_id: { type: "string", minLength: 1, description: "Short slug for this KPI (e.g. 'k-prs')." },
|
|
2499
|
+
target: { type: "integer", minimum: 1, description: "Positive integer target." },
|
|
2500
|
+
unit: { type: "string", minLength: 1, description: "Unit label (e.g. 'count', 'PRs', 'lines')." },
|
|
2501
|
+
name: { type: "string", description: "Optional human-readable name. Defaults to kpi_id." }
|
|
2502
|
+
},
|
|
2503
|
+
required: ["goal_id", "kpi_id", "target", "unit"]
|
|
2504
|
+
},
|
|
2505
|
+
execute: async (_toolCallId, rawParams) => {
|
|
2506
|
+
const params = rawParams;
|
|
2507
|
+
const dl = await getApi();
|
|
2508
|
+
if (!dl) {
|
|
2509
|
+
return { content: [{ type: "text", text: "Not logged in. Run /hivemind_login first." }] };
|
|
2510
|
+
}
|
|
2511
|
+
try {
|
|
2512
|
+
await dl.ensureKpisTable(kpisTable);
|
|
2513
|
+
const name = params.name ?? params.kpi_id;
|
|
2514
|
+
const content = `${name}
|
|
2515
|
+
|
|
2516
|
+
- target: ${params.target}
|
|
2517
|
+
- current: 0
|
|
2518
|
+
- unit: ${params.unit}`;
|
|
2519
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
2520
|
+
const safe = kpisTable.replace(/[^A-Za-z0-9_]/g, "");
|
|
2521
|
+
await dl.query(
|
|
2522
|
+
`INSERT INTO "${safe}" (id, goal_id, kpi_id, content, version, created_at, agent, plugin_version) VALUES ('${crypto.randomUUID()}', '${sqlStr(params.goal_id)}', '${sqlStr(params.kpi_id)}', E'${sqlStr(content)}', 1, '${sqlStr(ts)}', 'openclaw', '')`
|
|
2523
|
+
);
|
|
2524
|
+
pluginApi.logger.info?.(`hivemind_kpi_add \u2192 ${params.goal_id}/${params.kpi_id}`);
|
|
2525
|
+
return { content: [{ type: "text", text: `KPI added.
|
|
2526
|
+
goal_id: ${params.goal_id}
|
|
2527
|
+
kpi_id: ${params.kpi_id}
|
|
2528
|
+
target: ${params.target} ${params.unit}` }] };
|
|
2529
|
+
} catch (err) {
|
|
2530
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2531
|
+
pluginApi.logger.error(`hivemind_kpi_add failed: ${msg}`);
|
|
2532
|
+
return { content: [{ type: "text", text: `KPI add failed: ${msg}` }] };
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
});
|
|
2276
2536
|
pluginApi.registerMemoryCorpusSupplement({
|
|
2277
2537
|
search: async ({ query, maxResults }) => {
|
|
2278
2538
|
const dl = await getApi();
|
|
@@ -379,6 +379,65 @@ var SKILLS_COLUMNS = Object.freeze([
|
|
|
379
379
|
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
380
380
|
{ name: "updated_at", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
381
381
|
]);
|
|
382
|
+
var RULES_COLUMNS = Object.freeze([
|
|
383
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
384
|
+
{ name: "rule_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
385
|
+
{ name: "text", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
386
|
+
{ name: "scope", sql: "TEXT NOT NULL DEFAULT 'team'" },
|
|
387
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'active'" },
|
|
388
|
+
{ name: "assigned_by", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
389
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
390
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
391
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
392
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
393
|
+
]);
|
|
394
|
+
var TASKS_COLUMNS = Object.freeze([
|
|
395
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
396
|
+
{ name: "task_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
397
|
+
{ name: "text", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
398
|
+
{ name: "scope", sql: "TEXT NOT NULL DEFAULT 'me'" },
|
|
399
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'active'" },
|
|
400
|
+
{ name: "assigned_to", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
401
|
+
{ name: "assigned_by", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
402
|
+
{ name: "kpis", sql: "JSONB" },
|
|
403
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
404
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
405
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
406
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
407
|
+
]);
|
|
408
|
+
var TASK_EVENTS_COLUMNS = Object.freeze([
|
|
409
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
410
|
+
{ name: "task_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
411
|
+
{ name: "task_version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
412
|
+
{ name: "kpi_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
413
|
+
{ name: "value", sql: "BIGINT NOT NULL DEFAULT 0" },
|
|
414
|
+
{ name: "note", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
415
|
+
{ name: "source", sql: "TEXT NOT NULL DEFAULT 'user'" },
|
|
416
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
417
|
+
{ name: "ts", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
418
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
419
|
+
]);
|
|
420
|
+
var GOALS_COLUMNS = Object.freeze([
|
|
421
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
422
|
+
{ name: "goal_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
423
|
+
{ name: "owner", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
424
|
+
{ name: "status", sql: "TEXT NOT NULL DEFAULT 'opened'" },
|
|
425
|
+
{ name: "content", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
426
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
427
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
428
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
429
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
430
|
+
]);
|
|
431
|
+
var KPIS_COLUMNS = Object.freeze([
|
|
432
|
+
{ name: "id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
433
|
+
{ name: "goal_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
434
|
+
{ name: "kpi_id", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
435
|
+
{ name: "content", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
436
|
+
{ name: "version", sql: "BIGINT NOT NULL DEFAULT 1" },
|
|
437
|
+
{ name: "created_at", sql: "TEXT NOT NULL DEFAULT ''" },
|
|
438
|
+
{ name: "agent", sql: "TEXT NOT NULL DEFAULT 'manual'" },
|
|
439
|
+
{ name: "plugin_version", sql: "TEXT NOT NULL DEFAULT ''" }
|
|
440
|
+
]);
|
|
382
441
|
function validateSchema(label, cols) {
|
|
383
442
|
const seen = /* @__PURE__ */ new Set();
|
|
384
443
|
for (const col of cols) {
|
|
@@ -422,6 +481,11 @@ var CODEBASE_COLUMNS = Object.freeze([
|
|
|
422
481
|
validateSchema("MEMORY_COLUMNS", MEMORY_COLUMNS);
|
|
423
482
|
validateSchema("SESSIONS_COLUMNS", SESSIONS_COLUMNS);
|
|
424
483
|
validateSchema("SKILLS_COLUMNS", SKILLS_COLUMNS);
|
|
484
|
+
validateSchema("RULES_COLUMNS", RULES_COLUMNS);
|
|
485
|
+
validateSchema("TASKS_COLUMNS", TASKS_COLUMNS);
|
|
486
|
+
validateSchema("TASK_EVENTS_COLUMNS", TASK_EVENTS_COLUMNS);
|
|
487
|
+
validateSchema("GOALS_COLUMNS", GOALS_COLUMNS);
|
|
488
|
+
validateSchema("KPIS_COLUMNS", KPIS_COLUMNS);
|
|
425
489
|
validateSchema("CODEBASE_COLUMNS", CODEBASE_COLUMNS);
|
|
426
490
|
function buildCreateTableSql(tableName, cols) {
|
|
427
491
|
const safe = sqlIdent(tableName);
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"tools": [
|
|
10
10
|
"hivemind_search",
|
|
11
11
|
"hivemind_read",
|
|
12
|
-
"hivemind_index"
|
|
12
|
+
"hivemind_index",
|
|
13
|
+
"hivemind_goal_add",
|
|
14
|
+
"hivemind_kpi_add"
|
|
13
15
|
],
|
|
14
16
|
"commands": [
|
|
15
17
|
"hivemind_login",
|
|
@@ -52,5 +54,5 @@
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
},
|
|
55
|
-
"version": "0.7.
|
|
57
|
+
"version": "0.7.47"
|
|
56
58
|
}
|