clikit-plugin 0.2.8 → 0.2.10
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.js +1 -1
- package/dist/index.js +125 -54
- package/dist/tools/beads-memory-sync.d.ts +1 -1
- package/dist/tools/beads-memory-sync.d.ts.map +1 -1
- package/dist/tools/context-summary.d.ts +1 -1
- package/dist/tools/context-summary.d.ts.map +1 -1
- package/dist/tools/memory.d.ts +6 -6
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/observation.d.ts +1 -1
- package/dist/tools/observation.d.ts.map +1 -1
- package/dist/tools/quick-research.d.ts +1 -1
- package/dist/tools/quick-research.d.ts.map +1 -1
- package/dist/tools/swarm.d.ts +1 -1
- package/dist/tools/swarm.d.ts.map +1 -1
- package/memory/handoffs/2026-02-15-complete-fix.md +140 -0
- package/package.json +1 -1
- package/src/agents/index.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as fs from "fs";
|
|
|
6
6
|
import * as path from "path";
|
|
7
7
|
import * as os from "os";
|
|
8
8
|
var PLUGIN_NAME = "clikit-plugin";
|
|
9
|
-
var VERSION = "0.2.
|
|
9
|
+
var VERSION = "0.2.10";
|
|
10
10
|
function getRealHome() {
|
|
11
11
|
if (process.env.SNAP_REAL_HOME) {
|
|
12
12
|
return process.env.SNAP_REAL_HOME;
|
package/dist/index.js
CHANGED
|
@@ -3495,8 +3495,7 @@ var require_gray_matter = __commonJS((exports, module) => {
|
|
|
3495
3495
|
var import_gray_matter = __toESM(require_gray_matter(), 1);
|
|
3496
3496
|
import * as fs from "fs";
|
|
3497
3497
|
import * as path from "path";
|
|
3498
|
-
var
|
|
3499
|
-
var AGENTS_DIR = __dirname;
|
|
3498
|
+
var AGENTS_DIR = import.meta.dir;
|
|
3500
3499
|
function parseAgentMarkdown(filePath) {
|
|
3501
3500
|
try {
|
|
3502
3501
|
const content = fs.readFileSync(filePath, "utf-8");
|
|
@@ -3549,8 +3548,7 @@ function getBuiltinAgents() {
|
|
|
3549
3548
|
var import_gray_matter2 = __toESM(require_gray_matter(), 1);
|
|
3550
3549
|
import * as fs2 from "fs";
|
|
3551
3550
|
import * as path2 from "path";
|
|
3552
|
-
var
|
|
3553
|
-
var COMMANDS_DIR = path2.join(__dirname, "../../command");
|
|
3551
|
+
var COMMANDS_DIR = path2.join(import.meta.dir, "../../command");
|
|
3554
3552
|
function parseCommandMarkdown(filePath) {
|
|
3555
3553
|
try {
|
|
3556
3554
|
const content = fs2.readFileSync(filePath, "utf-8");
|
|
@@ -4791,8 +4789,7 @@ var RITUAL_FILE = path8.join(process.cwd(), ".opencode", "memory", "ritual-state
|
|
|
4791
4789
|
var import_gray_matter3 = __toESM(require_gray_matter(), 1);
|
|
4792
4790
|
import * as fs8 from "fs";
|
|
4793
4791
|
import * as path9 from "path";
|
|
4794
|
-
var
|
|
4795
|
-
var SKILLS_DIR = path9.join(__dirname, "..", "..", "skill");
|
|
4792
|
+
var SKILLS_DIR = path9.join(import.meta.dir, "../../skill");
|
|
4796
4793
|
function getBuiltinSkills() {
|
|
4797
4794
|
const skills = {};
|
|
4798
4795
|
if (!fs8.existsSync(SKILLS_DIR)) {
|
|
@@ -4913,11 +4910,18 @@ function memoryRead(relativePath) {
|
|
|
4913
4910
|
return fs9.readFileSync(fullPath, "utf-8");
|
|
4914
4911
|
}
|
|
4915
4912
|
function memorySearch(params) {
|
|
4913
|
+
if (!params || typeof params !== "object") {
|
|
4914
|
+
return [];
|
|
4915
|
+
}
|
|
4916
|
+
const p = params;
|
|
4917
|
+
if (!p.query || typeof p.query !== "string") {
|
|
4918
|
+
return [];
|
|
4919
|
+
}
|
|
4916
4920
|
const db = getDb();
|
|
4917
|
-
const limit =
|
|
4921
|
+
const limit = p.limit || 10;
|
|
4918
4922
|
let sql;
|
|
4919
4923
|
let args;
|
|
4920
|
-
if (
|
|
4924
|
+
if (p.type) {
|
|
4921
4925
|
sql = `
|
|
4922
4926
|
SELECT o.id, o.type, o.narrative, o.confidence, o.created_at
|
|
4923
4927
|
FROM observations o
|
|
@@ -4926,7 +4930,7 @@ function memorySearch(params) {
|
|
|
4926
4930
|
ORDER BY o.confidence DESC, o.created_at DESC
|
|
4927
4931
|
LIMIT ?
|
|
4928
4932
|
`;
|
|
4929
|
-
args = [
|
|
4933
|
+
args = [p.query, p.type, limit];
|
|
4930
4934
|
} else {
|
|
4931
4935
|
sql = `
|
|
4932
4936
|
SELECT o.id, o.type, o.narrative, o.confidence, o.created_at
|
|
@@ -4936,12 +4940,15 @@ function memorySearch(params) {
|
|
|
4936
4940
|
ORDER BY o.confidence DESC, o.created_at DESC
|
|
4937
4941
|
LIMIT ?
|
|
4938
4942
|
`;
|
|
4939
|
-
args = [
|
|
4943
|
+
args = [p.query, limit];
|
|
4940
4944
|
}
|
|
4941
4945
|
const rows = db.prepare(sql).all(...args);
|
|
4942
4946
|
return rows;
|
|
4943
4947
|
}
|
|
4944
4948
|
function memoryGet(ids) {
|
|
4949
|
+
if (typeof ids !== "string" || !ids) {
|
|
4950
|
+
return [];
|
|
4951
|
+
}
|
|
4945
4952
|
const db = getDb();
|
|
4946
4953
|
const idList = ids.split(",").map((id) => parseInt(id.trim(), 10));
|
|
4947
4954
|
const placeholders = idList.map(() => "?").join(",");
|
|
@@ -4955,9 +4962,16 @@ function memoryGet(ids) {
|
|
|
4955
4962
|
}));
|
|
4956
4963
|
}
|
|
4957
4964
|
function memoryTimeline(params) {
|
|
4965
|
+
if (!params || typeof params !== "object") {
|
|
4966
|
+
return [];
|
|
4967
|
+
}
|
|
4968
|
+
const p = params;
|
|
4969
|
+
if (typeof p.id !== "number") {
|
|
4970
|
+
return [];
|
|
4971
|
+
}
|
|
4958
4972
|
const db = getDb();
|
|
4959
|
-
const before =
|
|
4960
|
-
const after =
|
|
4973
|
+
const before = p.before || 3;
|
|
4974
|
+
const after = p.after || 3;
|
|
4961
4975
|
const sql = `
|
|
4962
4976
|
SELECT * FROM (
|
|
4963
4977
|
SELECT * FROM observations WHERE id < ? ORDER BY id DESC LIMIT ?
|
|
@@ -4967,7 +4981,7 @@ function memoryTimeline(params) {
|
|
|
4967
4981
|
SELECT * FROM observations WHERE id > ? ORDER BY id ASC LIMIT ?
|
|
4968
4982
|
) ORDER BY id ASC
|
|
4969
4983
|
`;
|
|
4970
|
-
const rows = db.prepare(sql).all(
|
|
4984
|
+
const rows = db.prepare(sql).all(p.id, before, p.id, p.id, after);
|
|
4971
4985
|
return rows.map((row) => ({
|
|
4972
4986
|
...row,
|
|
4973
4987
|
facts: JSON.parse(row.facts || "[]"),
|
|
@@ -4976,17 +4990,31 @@ function memoryTimeline(params) {
|
|
|
4976
4990
|
}));
|
|
4977
4991
|
}
|
|
4978
4992
|
function memoryUpdate(params) {
|
|
4993
|
+
if (!params || typeof params !== "object") {
|
|
4994
|
+
return null;
|
|
4995
|
+
}
|
|
4996
|
+
const p = params;
|
|
4997
|
+
if (!p.type || !p.narrative) {
|
|
4998
|
+
return null;
|
|
4999
|
+
}
|
|
4979
5000
|
const db = getDb();
|
|
4980
5001
|
const sql = `
|
|
4981
5002
|
INSERT INTO observations (type, narrative, facts, confidence, files_read, files_modified, expires_at)
|
|
4982
5003
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
4983
5004
|
`;
|
|
4984
|
-
const result = db.prepare(sql).run(
|
|
5005
|
+
const result = db.prepare(sql).run(p.type, p.narrative, JSON.stringify(p.facts || []), p.confidence || 1, JSON.stringify(p.files_read || []), JSON.stringify(p.files_modified || []), p.expires_at || null);
|
|
4985
5006
|
return { id: result.lastInsertRowid };
|
|
4986
5007
|
}
|
|
4987
5008
|
function memoryAdmin(params) {
|
|
5009
|
+
if (!params || typeof params !== "object") {
|
|
5010
|
+
return { operation: "unknown", success: false, details: { error: "Invalid params" } };
|
|
5011
|
+
}
|
|
5012
|
+
const p = params;
|
|
5013
|
+
if (!p.operation) {
|
|
5014
|
+
return { operation: "unknown", success: false, details: { error: "Missing operation" } };
|
|
5015
|
+
}
|
|
4988
5016
|
const db = getDb();
|
|
4989
|
-
switch (
|
|
5017
|
+
switch (p.operation) {
|
|
4990
5018
|
case "status": {
|
|
4991
5019
|
const count = db.prepare("SELECT COUNT(*) as count FROM observations").get();
|
|
4992
5020
|
const types = db.prepare("SELECT type, COUNT(*) as count FROM observations GROUP BY type").all();
|
|
@@ -4997,9 +5025,9 @@ function memoryAdmin(params) {
|
|
|
4997
5025
|
};
|
|
4998
5026
|
}
|
|
4999
5027
|
case "archive": {
|
|
5000
|
-
const days =
|
|
5028
|
+
const days = p.older_than_days || 90;
|
|
5001
5029
|
const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString();
|
|
5002
|
-
if (
|
|
5030
|
+
if (p.dry_run) {
|
|
5003
5031
|
const count = db.prepare("SELECT COUNT(*) as count FROM observations WHERE created_at < ?").get(cutoff);
|
|
5004
5032
|
return {
|
|
5005
5033
|
operation: "archive",
|
|
@@ -5041,7 +5069,7 @@ function memoryAdmin(params) {
|
|
|
5041
5069
|
}
|
|
5042
5070
|
default:
|
|
5043
5071
|
return {
|
|
5044
|
-
operation:
|
|
5072
|
+
operation: p.operation || "unknown",
|
|
5045
5073
|
success: false,
|
|
5046
5074
|
details: { error: "Unknown operation" }
|
|
5047
5075
|
};
|
|
@@ -5089,22 +5117,29 @@ function getDb2() {
|
|
|
5089
5117
|
return db;
|
|
5090
5118
|
}
|
|
5091
5119
|
function createObservation(params) {
|
|
5120
|
+
if (!params || typeof params !== "object") {
|
|
5121
|
+
return null;
|
|
5122
|
+
}
|
|
5123
|
+
const p = params;
|
|
5124
|
+
if (!p.type || !p.narrative) {
|
|
5125
|
+
return null;
|
|
5126
|
+
}
|
|
5092
5127
|
const db = getDb2();
|
|
5093
5128
|
const sql = `
|
|
5094
5129
|
INSERT INTO observations (type, narrative, facts, confidence, files_read, files_modified, concepts, bead_id, expires_at)
|
|
5095
5130
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
5096
5131
|
`;
|
|
5097
|
-
const result = db.prepare(sql).run(
|
|
5132
|
+
const result = db.prepare(sql).run(p.type, p.narrative, JSON.stringify(p.facts || []), p.confidence || 1, JSON.stringify(p.files_read || []), JSON.stringify(p.files_modified || []), JSON.stringify(p.concepts || []), p.bead_id || null, p.expires_at || null);
|
|
5098
5133
|
return {
|
|
5099
5134
|
id: result.lastInsertRowid,
|
|
5100
|
-
type:
|
|
5101
|
-
narrative:
|
|
5102
|
-
facts:
|
|
5103
|
-
confidence:
|
|
5104
|
-
files_read:
|
|
5105
|
-
files_modified:
|
|
5106
|
-
concepts:
|
|
5107
|
-
bead_id:
|
|
5135
|
+
type: p.type,
|
|
5136
|
+
narrative: p.narrative,
|
|
5137
|
+
facts: p.facts || [],
|
|
5138
|
+
confidence: p.confidence || 1,
|
|
5139
|
+
files_read: p.files_read || [],
|
|
5140
|
+
files_modified: p.files_modified || [],
|
|
5141
|
+
concepts: p.concepts || [],
|
|
5142
|
+
bead_id: p.bead_id,
|
|
5108
5143
|
created_at: new Date().toISOString()
|
|
5109
5144
|
};
|
|
5110
5145
|
}
|
|
@@ -5150,17 +5185,21 @@ var swarmState = {
|
|
|
5150
5185
|
parallelism: 3
|
|
5151
5186
|
};
|
|
5152
5187
|
function swarm(params) {
|
|
5153
|
-
|
|
5188
|
+
if (!params || typeof params !== "object") {
|
|
5189
|
+
return { planId: "none", tasks: [], parallelism: 3, estimatedTime: "0m" };
|
|
5190
|
+
}
|
|
5191
|
+
const p = params;
|
|
5192
|
+
switch (p.operation) {
|
|
5154
5193
|
case "plan":
|
|
5155
|
-
return swarmPlan(
|
|
5194
|
+
return swarmPlan(p);
|
|
5156
5195
|
case "monitor":
|
|
5157
|
-
return swarmMonitor(
|
|
5196
|
+
return swarmMonitor(p);
|
|
5158
5197
|
case "delegate":
|
|
5159
|
-
return swarmDelegate(
|
|
5198
|
+
return swarmDelegate(p);
|
|
5160
5199
|
case "abort":
|
|
5161
|
-
return swarmAbort(
|
|
5200
|
+
return swarmAbort(p);
|
|
5162
5201
|
default:
|
|
5163
|
-
|
|
5202
|
+
return { planId: "none", tasks: [], parallelism: 3, estimatedTime: "0m" };
|
|
5164
5203
|
}
|
|
5165
5204
|
}
|
|
5166
5205
|
function swarmPlan(params) {
|
|
@@ -5304,20 +5343,27 @@ function getBeadsDb() {
|
|
|
5304
5343
|
return new Database3(beadsDbPath);
|
|
5305
5344
|
}
|
|
5306
5345
|
function beadsMemorySync(params) {
|
|
5307
|
-
|
|
5346
|
+
if (!params || typeof params !== "object") {
|
|
5347
|
+
return { success: false, operation: "unknown", details: {} };
|
|
5348
|
+
}
|
|
5349
|
+
const p = params;
|
|
5350
|
+
if (!p.operation) {
|
|
5351
|
+
return { success: false, operation: "unknown", details: {} };
|
|
5352
|
+
}
|
|
5353
|
+
switch (p.operation) {
|
|
5308
5354
|
case "sync_to_memory":
|
|
5309
5355
|
return syncTasksToMemory();
|
|
5310
5356
|
case "sync_from_memory":
|
|
5311
5357
|
return syncMemoryToTasks();
|
|
5312
5358
|
case "link":
|
|
5313
|
-
if (!
|
|
5359
|
+
if (!p.beadId || !p.observationId) {
|
|
5314
5360
|
return { success: false, operation: "link", details: {} };
|
|
5315
5361
|
}
|
|
5316
|
-
return linkObservationToTask(
|
|
5362
|
+
return linkObservationToTask(p.observationId, p.beadId);
|
|
5317
5363
|
case "status":
|
|
5318
5364
|
return getSyncStatus();
|
|
5319
5365
|
default:
|
|
5320
|
-
return { success: false, operation:
|
|
5366
|
+
return { success: false, operation: p.operation, details: {} };
|
|
5321
5367
|
}
|
|
5322
5368
|
}
|
|
5323
5369
|
function syncTasksToMemory() {
|
|
@@ -5400,26 +5446,39 @@ function getSyncStatus() {
|
|
|
5400
5446
|
}
|
|
5401
5447
|
// src/tools/quick-research.ts
|
|
5402
5448
|
function quickResearch(params) {
|
|
5403
|
-
|
|
5404
|
-
|
|
5449
|
+
if (!params || typeof params !== "object") {
|
|
5450
|
+
return {
|
|
5451
|
+
query: "",
|
|
5452
|
+
suggestion: "Invalid params provided"
|
|
5453
|
+
};
|
|
5454
|
+
}
|
|
5455
|
+
const p = params;
|
|
5456
|
+
if (!p.query || typeof p.query !== "string") {
|
|
5457
|
+
return {
|
|
5458
|
+
query: "",
|
|
5459
|
+
suggestion: "Missing query parameter"
|
|
5460
|
+
};
|
|
5461
|
+
}
|
|
5462
|
+
const sources = p.sources || ["memory", "context7", "github"];
|
|
5463
|
+
const limit = p.limit || 5;
|
|
5405
5464
|
let memoryResults;
|
|
5406
5465
|
let context7Hint;
|
|
5407
5466
|
let githubHint;
|
|
5408
5467
|
if (sources.includes("memory")) {
|
|
5409
5468
|
try {
|
|
5410
|
-
memoryResults = memorySearch({ query:
|
|
5469
|
+
memoryResults = memorySearch({ query: p.query, limit });
|
|
5411
5470
|
} catch {}
|
|
5412
5471
|
}
|
|
5413
5472
|
if (sources.includes("context7")) {
|
|
5414
|
-
context7Hint = `Use context7 MCP tool: context7_resolve-library-id({ libraryName: "${
|
|
5473
|
+
context7Hint = `Use context7 MCP tool: context7_resolve-library-id({ libraryName: "${p.query}" }) then context7_query-docs()`;
|
|
5415
5474
|
}
|
|
5416
5475
|
if (sources.includes("github")) {
|
|
5417
|
-
const langHint =
|
|
5418
|
-
githubHint = `Use gh-grep MCP tool: gh-grep_searchGitHub({ query: "${
|
|
5476
|
+
const langHint = p.language ? ` language:${p.language}` : "";
|
|
5477
|
+
githubHint = `Use gh-grep MCP tool: gh-grep_searchGitHub({ query: "${p.query}${langHint}" })`;
|
|
5419
5478
|
}
|
|
5420
|
-
const suggestion = buildSuggestion(
|
|
5479
|
+
const suggestion = buildSuggestion(p.query, memoryResults, sources);
|
|
5421
5480
|
return {
|
|
5422
|
-
query:
|
|
5481
|
+
query: p.query,
|
|
5423
5482
|
memory: memoryResults,
|
|
5424
5483
|
context7Hint,
|
|
5425
5484
|
githubHint,
|
|
@@ -5453,10 +5512,7 @@ function getMemoryDb2() {
|
|
|
5453
5512
|
if (!fs12.existsSync(MEMORY_DIR4)) {
|
|
5454
5513
|
fs12.mkdirSync(MEMORY_DIR4, { recursive: true });
|
|
5455
5514
|
}
|
|
5456
|
-
|
|
5457
|
-
}
|
|
5458
|
-
function contextSummary(params = {}) {
|
|
5459
|
-
const db = getMemoryDb2();
|
|
5515
|
+
const db = new Database4(MEMORY_DB4);
|
|
5460
5516
|
db.run(`
|
|
5461
5517
|
CREATE TABLE IF NOT EXISTS observations (
|
|
5462
5518
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -5468,16 +5524,31 @@ function contextSummary(params = {}) {
|
|
|
5468
5524
|
files_modified TEXT DEFAULT '[]',
|
|
5469
5525
|
concepts TEXT DEFAULT '[]',
|
|
5470
5526
|
bead_id TEXT,
|
|
5471
|
-
created_at TEXT DEFAULT CURRENT_TIMESTAMP
|
|
5527
|
+
created_at TEXT DEFAULT CURRENT_TIMESTAMP,
|
|
5528
|
+
expires_at TEXT
|
|
5472
5529
|
)
|
|
5473
5530
|
`);
|
|
5531
|
+
try {
|
|
5532
|
+
db.exec(`ALTER TABLE observations ADD COLUMN concepts TEXT DEFAULT '[]'`);
|
|
5533
|
+
} catch {}
|
|
5534
|
+
try {
|
|
5535
|
+
db.exec(`ALTER TABLE observations ADD COLUMN bead_id TEXT`);
|
|
5536
|
+
} catch {}
|
|
5537
|
+
try {
|
|
5538
|
+
db.exec(`ALTER TABLE observations ADD COLUMN expires_at TEXT`);
|
|
5539
|
+
} catch {}
|
|
5540
|
+
return db;
|
|
5541
|
+
}
|
|
5542
|
+
function contextSummary(params = {}) {
|
|
5543
|
+
const p = params && typeof params === "object" ? params : {};
|
|
5544
|
+
const db = getMemoryDb2();
|
|
5474
5545
|
let whereClause = "1=1";
|
|
5475
5546
|
const args = [];
|
|
5476
|
-
if (
|
|
5547
|
+
if (p.scope === "bead" && p.beadId) {
|
|
5477
5548
|
whereClause = "bead_id = ?";
|
|
5478
|
-
args.push(
|
|
5549
|
+
args.push(p.beadId);
|
|
5479
5550
|
}
|
|
5480
|
-
if (
|
|
5551
|
+
if (p.scope === "session") {
|
|
5481
5552
|
whereClause = "created_at > datetime('now', '-1 day')";
|
|
5482
5553
|
}
|
|
5483
5554
|
const observations = db.query(`
|
|
@@ -5502,7 +5573,7 @@ function contextSummary(params = {}) {
|
|
|
5502
5573
|
modified.forEach((f) => allFilesModified.add(f));
|
|
5503
5574
|
} catch {}
|
|
5504
5575
|
}
|
|
5505
|
-
const summary = buildSummary(sections,
|
|
5576
|
+
const summary = buildSummary(sections, p.maxTokens || 2000);
|
|
5506
5577
|
const tokenEstimate = Math.ceil(summary.length / 4);
|
|
5507
5578
|
return {
|
|
5508
5579
|
summary,
|
|
@@ -13,5 +13,5 @@ export interface BeadsMemorySyncResult {
|
|
|
13
13
|
activeTasks?: number;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export declare function beadsMemorySync(params:
|
|
16
|
+
export declare function beadsMemorySync(params: unknown): BeadsMemorySyncResult;
|
|
17
17
|
//# sourceMappingURL=beads-memory-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beads-memory-sync.d.ts","sourceRoot":"","sources":["../../src/tools/beads-memory-sync.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,MAAM,GAAG,QAAQ,CAAC;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAyCD,wBAAgB,eAAe,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"beads-memory-sync.d.ts","sourceRoot":"","sources":["../../src/tools/beads-memory-sync.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,MAAM,GAAG,QAAQ,CAAC;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAyCD,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,qBAAqB,CAwBtE"}
|
|
@@ -17,5 +17,5 @@ export interface ContextSummaryResult {
|
|
|
17
17
|
};
|
|
18
18
|
tokenEstimate: number;
|
|
19
19
|
}
|
|
20
|
-
export declare function contextSummary(params?:
|
|
20
|
+
export declare function contextSummary(params?: unknown): ContextSummaryResult;
|
|
21
21
|
//# sourceMappingURL=context-summary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-summary.d.ts","sourceRoot":"","sources":["../../src/tools/context-summary.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"context-summary.d.ts","sourceRoot":"","sources":["../../src/tools/context-summary.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;CACvB;AAgCD,wBAAgB,cAAc,CAAC,MAAM,GAAE,OAAY,GAAG,oBAAoB,CA0EzE"}
|
package/dist/tools/memory.d.ts
CHANGED
|
@@ -22,14 +22,14 @@ export interface MemorySearchResult {
|
|
|
22
22
|
confidence: number;
|
|
23
23
|
created_at: string;
|
|
24
24
|
}
|
|
25
|
-
export declare function memorySearch(params:
|
|
26
|
-
export declare function memoryGet(ids:
|
|
25
|
+
export declare function memorySearch(params: unknown): MemorySearchResult[];
|
|
26
|
+
export declare function memoryGet(ids: unknown): MemoryObservation[];
|
|
27
27
|
export interface MemoryTimelineParams {
|
|
28
28
|
id: number;
|
|
29
29
|
before?: number;
|
|
30
30
|
after?: number;
|
|
31
31
|
}
|
|
32
|
-
export declare function memoryTimeline(params:
|
|
32
|
+
export declare function memoryTimeline(params: unknown): MemoryObservation[];
|
|
33
33
|
export interface MemoryUpdateParams {
|
|
34
34
|
type: string;
|
|
35
35
|
narrative: string;
|
|
@@ -39,9 +39,9 @@ export interface MemoryUpdateParams {
|
|
|
39
39
|
files_modified?: string[];
|
|
40
40
|
expires_at?: string;
|
|
41
41
|
}
|
|
42
|
-
export declare function memoryUpdate(params:
|
|
42
|
+
export declare function memoryUpdate(params: unknown): {
|
|
43
43
|
id: number;
|
|
44
|
-
};
|
|
44
|
+
} | null;
|
|
45
45
|
export interface MemoryAdminParams {
|
|
46
46
|
operation: "status" | "archive" | "checkpoint" | "vacuum" | "migrate";
|
|
47
47
|
older_than_days?: number;
|
|
@@ -52,5 +52,5 @@ export interface MemoryAdminResult {
|
|
|
52
52
|
success: boolean;
|
|
53
53
|
details: Record<string, unknown>;
|
|
54
54
|
}
|
|
55
|
-
export declare function memoryAdmin(params:
|
|
55
|
+
export declare function memoryAdmin(params: unknown): MemoryAdminResult;
|
|
56
56
|
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA2DD,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAA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ED,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,EAAE,CAkB3D;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,EAAE,CAmCnE;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA2BnE;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,CA8E9D"}
|
|
@@ -21,7 +21,7 @@ export interface ObservationResult {
|
|
|
21
21
|
bead_id?: string;
|
|
22
22
|
created_at: string;
|
|
23
23
|
}
|
|
24
|
-
export declare function createObservation(params:
|
|
24
|
+
export declare function createObservation(params: unknown): ObservationResult | null;
|
|
25
25
|
export declare function getObservationsByType(type: string, limit?: number): ObservationResult[];
|
|
26
26
|
export declare function getObservationsByBead(beadId: string): ObservationResult[];
|
|
27
27
|
export declare function linkObservations(observationId: number, concept: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../../src/tools/observation.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAsCD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../../src/tools/observation.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAsCD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CA2C3E;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,iBAAiB,EAAE,CAanF;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAazE;AAED,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAY7E"}
|
|
@@ -12,5 +12,5 @@ export interface QuickResearchResult {
|
|
|
12
12
|
githubHint?: string;
|
|
13
13
|
suggestion: string;
|
|
14
14
|
}
|
|
15
|
-
export declare function quickResearch(params:
|
|
15
|
+
export declare function quickResearch(params: unknown): QuickResearchResult;
|
|
16
16
|
//# sourceMappingURL=quick-research.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-research.d.ts","sourceRoot":"","sources":["../../src/tools/quick-research.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"quick-research.d.ts","sourceRoot":"","sources":["../../src/tools/quick-research.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,mBAAmB,CAgDlE"}
|
package/dist/tools/swarm.d.ts
CHANGED
|
@@ -53,5 +53,5 @@ export interface SwarmAbortResult {
|
|
|
53
53
|
reason: string;
|
|
54
54
|
}
|
|
55
55
|
export type SwarmResult = SwarmPlanResult | SwarmMonitorResult | SwarmDelegateResult | SwarmAbortResult;
|
|
56
|
-
export declare function swarm(params:
|
|
56
|
+
export declare function swarm(params: unknown): SwarmResult;
|
|
57
57
|
//# sourceMappingURL=swarm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../../src/tools/swarm.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAExG,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IA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AW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAcxG,wBAAgB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CAkBlD"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
date: 2026-02-15
|
|
3
|
+
phase: implementing
|
|
4
|
+
branch: main
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Handoff: CliKit Complete Type Guard & SQLite Fix
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Status Summary
|
|
12
|
+
|
|
13
|
+
CliKit plugin v0.2.1 → v0.2.9 published with comprehensive type guards across all hooks and tools. Fixed SQLite schema migration issues, removed backup logic, and added defensive programming patterns throughout the codebase. Plugin should now handle all edge cases where OpenCode passes unexpected data types.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Version History
|
|
18
|
+
|
|
19
|
+
| Version | Fix |
|
|
20
|
+
|---------|-----|
|
|
21
|
+
| 0.2.1 | Type guards in hooks (truncator, security-check, compaction) |
|
|
22
|
+
| 0.2.2 | Abort on JSON parse error |
|
|
23
|
+
| 0.2.3 | Fix JSONC comment stripping breaking URLs |
|
|
24
|
+
| 0.2.4 | Remove backup logic, fix `todos.filter` error |
|
|
25
|
+
| 0.2.5 | Fix `path.join` error - guards for projectDir/cwd params |
|
|
26
|
+
| 0.2.6 | Fix `text.toLowerCase` error in subagent-question-blocker |
|
|
27
|
+
| 0.2.7 | Fix remaining type guards (git-guard, swarm-enforcer) |
|
|
28
|
+
| 0.2.8 | SQLite migration - add missing columns |
|
|
29
|
+
| 0.2.9 | Type guards for ALL tool functions |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Task Status
|
|
34
|
+
|
|
35
|
+
### ✅ Completed
|
|
36
|
+
- [x] Fix installer to MERGE with existing opencode.json
|
|
37
|
+
- [x] Remove backup creation from cli.ts
|
|
38
|
+
- [x] Add type guards to all hooks (14 hooks)
|
|
39
|
+
- [x] Add type guards to all tools (6 tool files)
|
|
40
|
+
- [x] Fix SQLite schema migration with ALTER TABLE
|
|
41
|
+
- [x] Publish v0.2.1 → v0.2.9 to npm
|
|
42
|
+
|
|
43
|
+
### 📋 Not Started
|
|
44
|
+
- [ ] Test: `opencode` starts without errors
|
|
45
|
+
- [ ] Test: Plugin loads correctly after fresh install
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Files Modified (22 files)
|
|
50
|
+
|
|
51
|
+
| File | Changes |
|
|
52
|
+
|------|---------|
|
|
53
|
+
| `package.json` | v0.2.9 |
|
|
54
|
+
| `cli.ts` | Removed backup, fixed JSONC parsing |
|
|
55
|
+
| `config.ts` | Type guard for loadCliKitConfig |
|
|
56
|
+
| `index.ts` | Array.isArray for todos |
|
|
57
|
+
| `hooks/auto-format.ts` | Type guards for filePath, projectDir |
|
|
58
|
+
| `hooks/comment-checker.ts` | Type guard for content |
|
|
59
|
+
| `hooks/compaction.ts` | Type guards for projectDir, raw content |
|
|
60
|
+
| `hooks/env-context.ts` | Type guard for cwd |
|
|
61
|
+
| `hooks/git-guard.ts` | Type guard for command |
|
|
62
|
+
| `hooks/security-check.ts` | Type guard for content |
|
|
63
|
+
| `hooks/session-notification.ts` | Type guards for sessionId, error |
|
|
64
|
+
| `hooks/subagent-question-blocker.ts` | Type guards for text, toolName |
|
|
65
|
+
| `hooks/swarm-enforcer.ts` | Type guards for filePath, toolName |
|
|
66
|
+
| `hooks/todo-enforcer.ts` | Type guard for todos array |
|
|
67
|
+
| `hooks/truncator.ts` | Type guard for content |
|
|
68
|
+
| `hooks/typecheck-gate.ts` | Type guards for filePath, projectDir, output |
|
|
69
|
+
| `tools/observation.ts` | Type guard + SQLite migration |
|
|
70
|
+
| `tools/memory.ts` | Type guards + SQLite migration |
|
|
71
|
+
| `tools/beads-memory-sync.ts` | Type guard + SQLite migration |
|
|
72
|
+
| `tools/context-summary.ts` | Type guard + SQLite migration |
|
|
73
|
+
| `tools/quick-research.ts` | Type guard for params |
|
|
74
|
+
| `tools/swarm.ts` | Type guard for params |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Git State
|
|
79
|
+
|
|
80
|
+
- **Branch:** `main`
|
|
81
|
+
- **Last commit:** `31b200c` - Update README with simplified installation
|
|
82
|
+
- **Uncommitted changes:** 22 modified files, 5 handoff files
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Known Issues
|
|
87
|
+
|
|
88
|
+
None - all reported runtime errors have been addressed with type guards.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Next Steps
|
|
93
|
+
|
|
94
|
+
1. [ ] User test: `rm -rf ~/.cache/opencode/node_modules/clikit-plugin`
|
|
95
|
+
2. [ ] User test: `bun x clikit-plugin@latest install`
|
|
96
|
+
3. [ ] User test: `opencode` - should start without errors
|
|
97
|
+
4. [ ] If errors persist, check error message and add appropriate type guard
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Context for Resumption
|
|
102
|
+
|
|
103
|
+
### Type Guard Pattern Used Throughout
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
export function myFunc(params: unknown): Result | null {
|
|
107
|
+
if (!params || typeof params !== "object") {
|
|
108
|
+
return defaultResult;
|
|
109
|
+
}
|
|
110
|
+
const p = params as Partial<Params>;
|
|
111
|
+
if (!p.requiredField) {
|
|
112
|
+
return defaultResult;
|
|
113
|
+
}
|
|
114
|
+
// ... rest of function
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### SQLite Migration Pattern
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
// Create table with all columns
|
|
122
|
+
db.exec(`CREATE TABLE IF NOT EXISTS observations (...)`);
|
|
123
|
+
|
|
124
|
+
// Migration: add missing columns if they don't exist
|
|
125
|
+
try { db.exec(`ALTER TABLE observations ADD COLUMN new_col TEXT`); } catch {}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Key Files to Review
|
|
129
|
+
- `.opencode/src/hooks/*.ts` — All hooks have type guards
|
|
130
|
+
- `.opencode/src/tools/*.ts` — All tools have type guards + SQLite migration
|
|
131
|
+
- `.opencode/src/cli.ts` — Installer logic, JSONC parsing
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Resume Command
|
|
136
|
+
|
|
137
|
+
To resume, use `/resume` and it will:
|
|
138
|
+
1. Load this handoff
|
|
139
|
+
2. Check for new runtime errors
|
|
140
|
+
3. Propose adding appropriate type guards if needed
|
package/package.json
CHANGED
package/src/agents/index.ts
CHANGED