opencodekit 0.14.6 → 0.15.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/README.md +2 -2
- package/dist/index.js +100 -58
- package/dist/template/.opencode/.env.example +1 -0
- package/dist/template/.opencode/AGENTS.md +13 -24
- package/dist/template/.opencode/README.md +8 -119
- package/dist/template/.opencode/agent/explore.md +2 -3
- package/dist/template/.opencode/agent/general.md +56 -0
- package/dist/template/.opencode/agent/plan.md +54 -0
- package/dist/template/.opencode/agent/scout.md +15 -5
- package/dist/template/.opencode/command/analyze-project.md +2 -2
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/design-audit.md +4 -5
- package/dist/template/.opencode/command/design.md +4 -13
- package/dist/template/.opencode/command/generate-pattern.md +2 -9
- package/dist/template/.opencode/command/implement.md +4 -4
- package/dist/template/.opencode/command/init.md +1 -1
- package/dist/template/.opencode/command/new-feature.md +2 -3
- package/dist/template/.opencode/command/plan.md +1 -1
- package/dist/template/.opencode/command/pr.md +0 -1
- package/dist/template/.opencode/command/research.md +20 -6
- package/dist/template/.opencode/command/restore-image.md +1 -9
- package/dist/template/.opencode/command/revert-feature.md +1 -1
- package/dist/template/.opencode/command/review-codebase.md +4 -4
- package/dist/template/.opencode/command/status.md +1 -2
- package/dist/template/.opencode/command/summarize.md +1 -2
- package/dist/template/.opencode/command/triage.md +4 -32
- package/dist/template/.opencode/dcp.jsonc +68 -68
- package/dist/template/.opencode/memory/_templates/README.md +35 -0
- package/dist/template/.opencode/memory/_templates/project/architecture.md +60 -0
- package/dist/template/.opencode/memory/_templates/project/commands.md +72 -0
- package/dist/template/.opencode/memory/_templates/project/conventions.md +68 -0
- package/dist/template/.opencode/memory/_templates/project/gotchas.md +41 -0
- package/dist/template/.opencode/memory/beads-workflow.md +30 -29
- package/dist/template/.opencode/memory/project/architecture.md +31 -50
- package/dist/template/.opencode/memory/project/commands.md +41 -22
- package/dist/template/.opencode/memory/project/conventions.md +39 -177
- package/dist/template/.opencode/memory/project/gotchas.md +21 -177
- package/dist/template/.opencode/memory/user.example.md +5 -0
- package/dist/template/.opencode/opencode.json +644 -579
- package/dist/template/.opencode/package.json +18 -21
- package/dist/template/.opencode/plugin/compaction.ts +79 -85
- package/dist/template/.opencode/plugin/env-ctx.ts +19 -19
- package/dist/template/.opencode/plugin/lib/notify.ts +41 -45
- package/dist/template/.opencode/plugin/lsp.ts +197 -200
- package/dist/template/.opencode/plugin/memory.ts +14 -112
- package/dist/template/.opencode/plugin/package.json +5 -5
- package/dist/template/.opencode/plugin/sessions.ts +1 -1
- package/dist/template/.opencode/plugin/skill-mcp.ts +486 -521
- package/dist/template/.opencode/plugin/truncator.ts +47 -50
- package/dist/template/.opencode/plugin/tsconfig.json +14 -14
- package/dist/template/.opencode/skill/chrome-devtools/mcp.json +17 -17
- package/dist/template/.opencode/skill/condition-based-waiting/SKILL.md +17 -12
- package/dist/template/.opencode/skill/condition-based-waiting/example.ts +63 -69
- package/dist/template/.opencode/skill/defense-in-depth/SKILL.md +14 -8
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +14 -3
- package/dist/template/.opencode/skill/playwright/mcp.json +14 -14
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +21 -8
- package/dist/template/.opencode/skill/requesting-code-review/review.md +14 -0
- package/dist/template/.opencode/skill/root-cause-tracing/SKILL.md +18 -4
- package/dist/template/.opencode/skill/source-code-research/SKILL.md +9 -7
- package/dist/template/.opencode/skill/test-driven-development/SKILL.md +49 -32
- package/dist/template/.opencode/skill/testing-anti-patterns/SKILL.md +40 -22
- package/dist/template/.opencode/skill/testing-skills-with-subagents/SKILL.md +46 -26
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +117 -44
- package/dist/template/.opencode/skill/v0/SKILL.md +1 -7
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +27 -19
- package/dist/template/.opencode/skill/writing-skills/anthropic-best-practices.md +171 -148
- package/dist/template/.opencode/skill/writing-skills/persuasion-principles.md +39 -6
- package/dist/template/.opencode/tool/memory-read.ts +44 -56
- package/dist/template/.opencode/tool/memory-search.ts +8 -291
- package/dist/template/.opencode/tool/memory-update.ts +47 -51
- package/dist/template/.opencode/tool/observation.ts +6 -180
- package/dist/template/.opencode/tsconfig.json +19 -19
- package/package.json +19 -15
- package/dist/template/.opencode/.background-tasks.json +0 -114
- package/dist/template/.opencode/.ralph-state.json +0 -12
- package/dist/template/.opencode/agent/build.md +0 -327
- package/dist/template/.opencode/agent/ninja.md +0 -351
- package/dist/template/.opencode/agent/planner.md +0 -281
- package/dist/template/.opencode/agent/rush.md +0 -223
- package/dist/template/.opencode/memory/handoffs/README.md +0 -83
- package/dist/template/.opencode/memory/observations/.gitkeep +0 -0
- package/dist/template/.opencode/memory/observations/2026-01-09-pattern-ampcode-mcp-json-includetools-pattern.md +0 -42
- package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/0-0d25ba80-ba3b-4209-9046-b45d6093b4da.txn +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/1.manifest +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/data/1111100101010101011010004a9ef34df6b29f36a9a53a2892.lance +0 -0
- package/dist/template/.opencode/tool/ast-grep.ts +0 -245
- package/dist/template/.opencode/tool/background.ts +0 -509
- package/dist/template/.opencode/tool/bd-inbox.ts +0 -110
- package/dist/template/.opencode/tool/bd-msg.ts +0 -62
- package/dist/template/.opencode/tool/bd-release.ts +0 -71
- package/dist/template/.opencode/tool/bd-reserve.ts +0 -121
- package/dist/template/.opencode/tool/memory-embed.ts +0 -183
- package/dist/template/.opencode/tool/memory-index.ts +0 -769
- package/dist/template/.opencode/tool/repo-map.ts +0 -451
|
@@ -3,58 +3,54 @@ import path from "node:path";
|
|
|
3
3
|
import { tool } from "@opencode-ai/plugin";
|
|
4
4
|
|
|
5
5
|
export default tool({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
execute: async (args: { file: string; content: string; mode?: string }) => {
|
|
26
|
-
// Always write to project memory (.opencode/memory/)
|
|
27
|
-
const memoryDir = path.join(process.cwd(), ".opencode/memory");
|
|
6
|
+
description:
|
|
7
|
+
"Update memory files with new learnings, progress, or context. Appends or replaces content based on mode. Supports subdirectories for organization (e.g., 'research/opencode-sessions' creates .opencode/memory/research/opencode-sessions.md).",
|
|
8
|
+
args: {
|
|
9
|
+
file: tool.schema
|
|
10
|
+
.string()
|
|
11
|
+
.describe(
|
|
12
|
+
"Memory file to update: handoffs/YYYY-MM-DD-phase, research/YYYY-MM-DD-topic. Use _templates/ for reference only.",
|
|
13
|
+
),
|
|
14
|
+
content: tool.schema.string().describe("Content to write or append to the memory file"),
|
|
15
|
+
mode: tool.schema
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.default("replace")
|
|
19
|
+
.describe("Update mode: 'replace' (overwrite file) or 'append' (add to end)."),
|
|
20
|
+
},
|
|
21
|
+
execute: async (args: { file: string; content: string; mode?: string }) => {
|
|
22
|
+
// Always write to project memory (.opencode/memory/)
|
|
23
|
+
const memoryDir = path.join(process.cwd(), ".opencode/memory");
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
// Normalize file path: strip existing .md extension, handle subdirectories
|
|
26
|
+
const normalizedFile = args.file.replace(/\.md$/i, ""); // Remove .md if present
|
|
27
|
+
const filePath = path.join(memoryDir, `${normalizedFile}.md`);
|
|
28
|
+
const mode = args.mode || "replace";
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
try {
|
|
31
|
+
// Ensure parent directory exists (handles subdirectories)
|
|
32
|
+
const fileDir = path.dirname(filePath);
|
|
33
|
+
await fs.mkdir(fileDir, { recursive: true });
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
if (mode === "append") {
|
|
36
|
+
const timestamp = new Date().toISOString();
|
|
37
|
+
const appendContent = `\n\n---\n**Updated:** ${timestamp}\n\n${args.content}`;
|
|
38
|
+
await fs.appendFile(filePath, appendContent, "utf-8");
|
|
39
|
+
return `Successfully appended to ${normalizedFile}.md\n[Written to: ${filePath}]`;
|
|
40
|
+
}
|
|
41
|
+
// Replace mode - update timestamp
|
|
42
|
+
const timestamp = new Date().toISOString();
|
|
43
|
+
const updatedContent = args.content.replace(
|
|
44
|
+
/\*\*Last Updated:\*\* \[Timestamp\]/,
|
|
45
|
+
`**Last Updated:** ${timestamp}`,
|
|
46
|
+
);
|
|
47
|
+
await fs.writeFile(filePath, updatedContent, "utf-8");
|
|
48
|
+
return `Successfully updated ${normalizedFile}.md\n[Written to: ${filePath}]`;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
if (error instanceof Error) {
|
|
51
|
+
return `Error updating memory: ${error.message}`;
|
|
52
|
+
}
|
|
53
|
+
return "Unknown error updating memory file";
|
|
54
|
+
}
|
|
55
|
+
},
|
|
60
56
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import * as lancedb from "@lancedb/lancedb";
|
|
4
3
|
import { tool } from "@opencode-ai/plugin";
|
|
5
|
-
import { generateEmbedding } from "./memory-embed";
|
|
6
|
-
import { searchVectorStore } from "./memory-index";
|
|
7
4
|
|
|
8
5
|
// Observation types following claude-mem patterns
|
|
9
6
|
type ObservationType =
|
|
@@ -49,13 +46,6 @@ interface FileReference {
|
|
|
49
46
|
line?: number;
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
interface CodeLink {
|
|
53
|
-
name: string;
|
|
54
|
-
type: string;
|
|
55
|
-
file: string;
|
|
56
|
-
line: number;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
49
|
// Extract file references from observation content
|
|
60
50
|
function extractFileReferences(content: string): FileReference[] {
|
|
61
51
|
const refs: FileReference[] = [];
|
|
@@ -82,118 +72,6 @@ function extractFileReferences(content: string): FileReference[] {
|
|
|
82
72
|
return refs;
|
|
83
73
|
}
|
|
84
74
|
|
|
85
|
-
// Find related code definitions for an observation
|
|
86
|
-
async function findRelatedCode(
|
|
87
|
-
title: string,
|
|
88
|
-
content: string,
|
|
89
|
-
fileRefs: FileReference[],
|
|
90
|
-
): Promise<CodeLink[]> {
|
|
91
|
-
const links: CodeLink[] = [];
|
|
92
|
-
|
|
93
|
-
try {
|
|
94
|
-
// Search for code definitions related to the observation
|
|
95
|
-
const searchQuery = `${title} ${fileRefs.map((r) => r.file).join(" ")}`;
|
|
96
|
-
const results = await searchVectorStore(searchQuery, 5, "code");
|
|
97
|
-
|
|
98
|
-
for (const result of results) {
|
|
99
|
-
// Check if this code is in one of the referenced files
|
|
100
|
-
const isDirectRef = fileRefs.some(
|
|
101
|
-
(ref) =>
|
|
102
|
-
result.file_path.includes(ref.file) ||
|
|
103
|
-
ref.file.includes(result.file_path),
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
if (isDirectRef) {
|
|
107
|
-
links.push({
|
|
108
|
-
name: result.title.replace(/^(function|class|type|interface): /, ""),
|
|
109
|
-
type: result.title.split(":")[0] || "code",
|
|
110
|
-
file: result.file_path,
|
|
111
|
-
line: 0, // Would need to parse from result
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
} catch {
|
|
116
|
-
// Vector store might not have code indexed yet
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return links.slice(0, 5); // Limit to 5 links
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Vector store configuration
|
|
123
|
-
const VECTOR_DB_PATH = ".opencode/memory/vector_db";
|
|
124
|
-
const TABLE_NAME = "memories";
|
|
125
|
-
|
|
126
|
-
async function addToVectorStore(
|
|
127
|
-
filePath: string,
|
|
128
|
-
title: string,
|
|
129
|
-
content: string,
|
|
130
|
-
fileType: string,
|
|
131
|
-
): Promise<{ success: boolean; error?: string }> {
|
|
132
|
-
try {
|
|
133
|
-
const embeddingResult = await generateEmbedding(content.substring(0, 8000));
|
|
134
|
-
if (!embeddingResult) {
|
|
135
|
-
return { success: false, error: "Failed to generate embedding" };
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const dbPath = path.join(process.cwd(), VECTOR_DB_PATH);
|
|
139
|
-
await fs.mkdir(dbPath, { recursive: true });
|
|
140
|
-
|
|
141
|
-
const db = await lancedb.connect(dbPath);
|
|
142
|
-
const relativePath = path.relative(process.cwd(), filePath);
|
|
143
|
-
|
|
144
|
-
const document: Record<string, unknown> = {
|
|
145
|
-
id: relativePath.replace(/[\/\\]/g, "_"),
|
|
146
|
-
file_path: relativePath,
|
|
147
|
-
title,
|
|
148
|
-
content,
|
|
149
|
-
content_preview: content.substring(0, 500),
|
|
150
|
-
embedding: embeddingResult.embedding,
|
|
151
|
-
indexed_at: new Date().toISOString(),
|
|
152
|
-
file_type: fileType,
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
let table: lancedb.Table;
|
|
156
|
-
try {
|
|
157
|
-
table = await db.openTable(TABLE_NAME);
|
|
158
|
-
// Add to existing table
|
|
159
|
-
await table.add([document]);
|
|
160
|
-
} catch {
|
|
161
|
-
// Table doesn't exist, create it
|
|
162
|
-
await db.createTable(TABLE_NAME, [document]);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return { success: true };
|
|
166
|
-
} catch (err) {
|
|
167
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
168
|
-
return { success: false, error: msg };
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Check for potentially contradicting observations
|
|
173
|
-
async function findSimilarObservations(
|
|
174
|
-
title: string,
|
|
175
|
-
content: string,
|
|
176
|
-
concepts: string[],
|
|
177
|
-
): Promise<{ file: string; title: string; similarity: string }[]> {
|
|
178
|
-
try {
|
|
179
|
-
// Search for similar observations using semantic search
|
|
180
|
-
const searchQuery = `${title} ${concepts.join(" ")}`;
|
|
181
|
-
const similar = await searchVectorStore(searchQuery, 5, "observation");
|
|
182
|
-
|
|
183
|
-
// Filter to only observations with high similarity
|
|
184
|
-
return similar
|
|
185
|
-
.filter((doc) => doc.title !== title) // Exclude self
|
|
186
|
-
.slice(0, 3)
|
|
187
|
-
.map((doc) => ({
|
|
188
|
-
file: path.basename(doc.file_path),
|
|
189
|
-
title: doc.title,
|
|
190
|
-
similarity: "high",
|
|
191
|
-
}));
|
|
192
|
-
} catch {
|
|
193
|
-
return [];
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
75
|
export default tool({
|
|
198
76
|
description:
|
|
199
77
|
"Create a structured observation for future reference. Observations are categorized by type (decision, bugfix, feature, pattern, discovery, learning, warning) and stored in .opencode/memory/observations/.",
|
|
@@ -288,7 +166,7 @@ export default tool({
|
|
|
288
166
|
: [];
|
|
289
167
|
let files = args.files ? args.files.split(",").map((f) => f.trim()) : [];
|
|
290
168
|
|
|
291
|
-
// Auto-detect file references from content
|
|
169
|
+
// Auto-detect file references from content
|
|
292
170
|
const detectedRefs = extractFileReferences(args.content);
|
|
293
171
|
const detectedFiles = detectedRefs.map((r) => r.file);
|
|
294
172
|
|
|
@@ -296,24 +174,17 @@ export default tool({
|
|
|
296
174
|
const allFiles = [...new Set([...files, ...detectedFiles])];
|
|
297
175
|
files = allFiles;
|
|
298
176
|
|
|
299
|
-
//
|
|
300
|
-
const codeLinks = await findRelatedCode(
|
|
301
|
-
args.title,
|
|
302
|
-
args.content,
|
|
303
|
-
detectedRefs,
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
// Build observation content with YAML frontmatter for temporal tracking
|
|
177
|
+
// Build observation content with YAML frontmatter
|
|
307
178
|
const icon = TYPE_ICONS[obsType];
|
|
308
179
|
const confidenceIcon = CONFIDENCE_ICONS[confidence];
|
|
309
180
|
|
|
310
|
-
// YAML frontmatter for temporal validity
|
|
181
|
+
// YAML frontmatter for temporal validity
|
|
311
182
|
let observation = "---\n";
|
|
312
183
|
observation += `type: ${obsType}\n`;
|
|
313
184
|
observation += `created: ${now.toISOString()}\n`;
|
|
314
185
|
observation += `confidence: ${confidence}\n`;
|
|
315
|
-
observation += "valid_until: null\n";
|
|
316
|
-
observation += "superseded_by: null\n";
|
|
186
|
+
observation += "valid_until: null\n";
|
|
187
|
+
observation += "superseded_by: null\n";
|
|
317
188
|
if (args.supersedes) {
|
|
318
189
|
observation += `supersedes: ${args.supersedes}\n`;
|
|
319
190
|
}
|
|
@@ -326,14 +197,6 @@ export default tool({
|
|
|
326
197
|
if (files.length > 0) {
|
|
327
198
|
observation += `files: [${files.map((f) => `"${f}"`).join(", ")}]\n`;
|
|
328
199
|
}
|
|
329
|
-
if (codeLinks.length > 0) {
|
|
330
|
-
observation += "code_links:\n";
|
|
331
|
-
for (const link of codeLinks) {
|
|
332
|
-
observation += ` - name: "${link.name}"\n`;
|
|
333
|
-
observation += ` type: "${link.type}"\n`;
|
|
334
|
-
observation += ` file: "${link.file}"\n`;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
200
|
observation += "---\n\n";
|
|
338
201
|
|
|
339
202
|
// Content
|
|
@@ -349,20 +212,6 @@ export default tool({
|
|
|
349
212
|
// Write observation
|
|
350
213
|
await fs.writeFile(filePath, observation, "utf-8");
|
|
351
214
|
|
|
352
|
-
// Generate embedding and add to vector store
|
|
353
|
-
let embeddingStatus = "";
|
|
354
|
-
const vectorResult = await addToVectorStore(
|
|
355
|
-
filePath,
|
|
356
|
-
args.title,
|
|
357
|
-
observation,
|
|
358
|
-
"observation",
|
|
359
|
-
);
|
|
360
|
-
if (vectorResult.success) {
|
|
361
|
-
embeddingStatus = "\nEmbedding: ✓ Added to vector store";
|
|
362
|
-
} else {
|
|
363
|
-
embeddingStatus = `\nEmbedding: ⚠ ${vectorResult.error || "Failed"}`;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
215
|
// Handle supersedes - update old observation's superseded_by field
|
|
367
216
|
let supersedesStatus = "";
|
|
368
217
|
if (args.supersedes) {
|
|
@@ -385,23 +234,6 @@ export default tool({
|
|
|
385
234
|
|
|
386
235
|
let beadUpdate = "";
|
|
387
236
|
|
|
388
|
-
// Check for similar/potentially contradicting observations
|
|
389
|
-
let contradictionWarning = "";
|
|
390
|
-
const similarObs = await findSimilarObservations(
|
|
391
|
-
args.title,
|
|
392
|
-
args.content,
|
|
393
|
-
concepts,
|
|
394
|
-
);
|
|
395
|
-
if (similarObs.length > 0) {
|
|
396
|
-
contradictionWarning =
|
|
397
|
-
"\n\n⚠️ **Similar observations found** (potential contradictions):";
|
|
398
|
-
for (const obs of similarObs) {
|
|
399
|
-
contradictionWarning += `\n- ${obs.title} (\`${obs.file}\`)`;
|
|
400
|
-
}
|
|
401
|
-
contradictionWarning +=
|
|
402
|
-
"\n\nIf this supersedes an older observation, use `supersedes` arg to mark it.";
|
|
403
|
-
}
|
|
404
|
-
|
|
405
237
|
// Update bead notes if bead_id provided
|
|
406
238
|
if (args.bead_id) {
|
|
407
239
|
try {
|
|
@@ -421,19 +253,13 @@ export default tool({
|
|
|
421
253
|
}
|
|
422
254
|
}
|
|
423
255
|
|
|
424
|
-
// Build code links info
|
|
425
|
-
let codeLinksInfo = "";
|
|
426
|
-
if (codeLinks.length > 0) {
|
|
427
|
-
codeLinksInfo = `\nCode Links: ${codeLinks.map((l) => `${l.type}:${l.name}`).join(", ")}`;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
256
|
// Build auto-detected files info
|
|
431
257
|
let autoDetectedInfo = "";
|
|
432
258
|
if (detectedFiles.length > 0) {
|
|
433
259
|
autoDetectedInfo = `\nAuto-detected: ${detectedFiles.length} file reference(s)`;
|
|
434
260
|
}
|
|
435
261
|
|
|
436
|
-
return `✓ Observation saved: ${filename}\n\nType: ${icon} ${obsType}\nTitle: ${args.title}\nConfidence: ${confidenceIcon} ${confidence}\nConcepts: ${concepts.join(", ") || "none"}\nFiles: ${files.join(", ") || "none"}${
|
|
262
|
+
return `✓ Observation saved: ${filename}\n\nType: ${icon} ${obsType}\nTitle: ${args.title}\nConfidence: ${confidenceIcon} ${confidence}\nConcepts: ${concepts.join(", ") || "none"}\nFiles: ${files.join(", ") || "none"}${autoDetectedInfo}${supersedesStatus}${beadUpdate}\n\nPath: ${filePath}`;
|
|
437
263
|
} catch (error) {
|
|
438
264
|
if (error instanceof Error) {
|
|
439
265
|
return `Error saving observation: ${error.message}`;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"strict": false,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"outDir": "./dist",
|
|
13
|
+
"rootDir": "./",
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"types": ["node"]
|
|
18
|
+
},
|
|
19
|
+
"include": ["plugin/**/*.ts", "tool/**/*.ts", "agent/**/*.ts", "*.ts"],
|
|
20
|
+
"exclude": ["node_modules", "dist", "**/*.js", "**/*.test.ts"]
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencodekit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
5
|
-
"
|
|
5
|
+
"keywords": ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "OpenCodeKit",
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
10
|
"url": "git+https://github.com/opencodekit/opencodekit-template.git"
|
|
9
11
|
},
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public",
|
|
12
|
-
"registry": "https://registry.npmjs.org"
|
|
13
|
-
},
|
|
14
12
|
"bin": {
|
|
15
13
|
"ock": "dist/index.js"
|
|
16
14
|
},
|
|
17
15
|
"files": ["dist", "README.md"],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org"
|
|
20
|
+
},
|
|
18
21
|
"scripts": {
|
|
19
22
|
"dev": "bun run src/index.ts",
|
|
20
23
|
"build": "bun run build.ts && mkdir -p dist/template && rsync -av --exclude=node_modules --exclude=dist --exclude=.git --exclude=coverage --exclude=.next --exclude=.turbo --exclude=logs --exclude=package-lock.json .opencode/ dist/template/.opencode/",
|
|
@@ -23,14 +26,10 @@
|
|
|
23
26
|
"typecheck": "tsc --noEmit",
|
|
24
27
|
"test": "bun test",
|
|
25
28
|
"test:watch": "bun test --watch",
|
|
26
|
-
"lint": "
|
|
27
|
-
"lint:fix": "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"author": "OpenCodeKit",
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"engines": {
|
|
33
|
-
"bun": ">=1.3.2"
|
|
29
|
+
"lint": "oxlint .",
|
|
30
|
+
"lint:fix": "oxlint --fix .",
|
|
31
|
+
"format": "oxfmt",
|
|
32
|
+
"format:check": "oxfmt --check"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"@clack/prompts": "^0.7.0",
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"cli-table3": "^0.6.5",
|
|
43
42
|
"ora": "^9.0.0",
|
|
44
43
|
"picocolors": "^1.1.1",
|
|
45
|
-
"solid-js": "
|
|
44
|
+
"solid-js": "1.9.9",
|
|
46
45
|
"zod": "^3.25.76"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
@@ -50,7 +49,12 @@
|
|
|
50
49
|
"@biomejs/biome": "^1.9.4",
|
|
51
50
|
"@types/bun": "latest",
|
|
52
51
|
"@types/node": "^22.19.5",
|
|
52
|
+
"oxfmt": "^0.23.0",
|
|
53
|
+
"oxlint": "^1.38.0",
|
|
53
54
|
"typescript": "^5.9.3"
|
|
54
55
|
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"bun": ">=1.3.2"
|
|
58
|
+
},
|
|
55
59
|
"trustedDependencies": ["@beads/bd"]
|
|
56
60
|
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tasks": {
|
|
3
|
-
"bg_1767973877335_d2ihzd": {
|
|
4
|
-
"taskId": "bg_1767973877335_d2ihzd",
|
|
5
|
-
"sessionId": "ses_45c8b89a4ffeuq5BxBRQv4wrwd",
|
|
6
|
-
"agent": "explore",
|
|
7
|
-
"prompt": "Find all agent definitions in this project. List the file paths and agent names.",
|
|
8
|
-
"started": 1767973890766,
|
|
9
|
-
"status": "cancelled"
|
|
10
|
-
},
|
|
11
|
-
"bg_1767973898236_s7kyjm": {
|
|
12
|
-
"taskId": "bg_1767973898236_s7kyjm",
|
|
13
|
-
"sessionId": "ses_45c8b37ffffeIMMtZrHruaRN7A",
|
|
14
|
-
"agent": "scout",
|
|
15
|
-
"prompt": "What is the latest version of @opencode-ai/sdk and what are its main features?",
|
|
16
|
-
"started": 1767973936815,
|
|
17
|
-
"status": "completed"
|
|
18
|
-
},
|
|
19
|
-
"bg_1767974743680_ppd6p1": {
|
|
20
|
-
"taskId": "bg_1767974743680_ppd6p1",
|
|
21
|
-
"sessionId": "ses_45c7e517bffeagStJem1UDrHNf",
|
|
22
|
-
"agent": "explore",
|
|
23
|
-
"prompt": "Find all TypeScript files in the .opencode/tool directory and list them.",
|
|
24
|
-
"started": 1767974756797,
|
|
25
|
-
"status": "completed",
|
|
26
|
-
"beadId": "opencodekit-template-ag8",
|
|
27
|
-
"autoCloseBead": true
|
|
28
|
-
},
|
|
29
|
-
"bg_1767974825480_mlpk5z": {
|
|
30
|
-
"taskId": "bg_1767974825480_mlpk5z",
|
|
31
|
-
"sessionId": "ses_45c7d11efffe9LnnUp1W2C7GiI",
|
|
32
|
-
"agent": "explore",
|
|
33
|
-
"prompt": "List all files in .opencode/agent directory",
|
|
34
|
-
"started": 1767974843970,
|
|
35
|
-
"status": "completed",
|
|
36
|
-
"beadId": "opencodekit-template-3k0",
|
|
37
|
-
"autoCloseBead": true
|
|
38
|
-
},
|
|
39
|
-
"bg_1767975003390_y1pliv": {
|
|
40
|
-
"taskId": "bg_1767975003390_y1pliv",
|
|
41
|
-
"sessionId": "ses_45c7a5afffferx20SjJEy782Ap",
|
|
42
|
-
"agent": "explore",
|
|
43
|
-
"prompt": "Count the number of markdown files in .opencode/command directory",
|
|
44
|
-
"started": 1767975020306,
|
|
45
|
-
"status": "completed",
|
|
46
|
-
"beadId": "opencodekit-template-0ch",
|
|
47
|
-
"autoCloseBead": true
|
|
48
|
-
},
|
|
49
|
-
"bg_1767975064912_8nvlh7": {
|
|
50
|
-
"taskId": "bg_1767975064912_8nvlh7",
|
|
51
|
-
"sessionId": "ses_45c796aa9ffeYEhEzxybXEuOfO",
|
|
52
|
-
"agent": "explore",
|
|
53
|
-
"prompt": "List files in .opencode/agent directory",
|
|
54
|
-
"started": 1767975078449,
|
|
55
|
-
"status": "completed",
|
|
56
|
-
"beadId": "opencodekit-template-ryg",
|
|
57
|
-
"autoCloseBead": true
|
|
58
|
-
},
|
|
59
|
-
"bg_1767982850780_sdkoc4": {
|
|
60
|
-
"taskId": "bg_1767982850780_sdkoc4",
|
|
61
|
-
"sessionId": "ses_45c029d22ffe7cWSSebxdvxIgL",
|
|
62
|
-
"agent": "explore",
|
|
63
|
-
"prompt": "Find all TypeScript files in the src/commands directory and list what each command does. This is a test of agent delegation.",
|
|
64
|
-
"started": 1767982870771,
|
|
65
|
-
"status": "completed"
|
|
66
|
-
},
|
|
67
|
-
"bg_1767984165033_jyv9bd": {
|
|
68
|
-
"taskId": "bg_1767984165033_jyv9bd",
|
|
69
|
-
"sessionId": "ses_45bee8f51ffeJ6B5L7AMik624S",
|
|
70
|
-
"parentSessionId": "ses_45c0ae526ffeQlmBlscyZMZALt",
|
|
71
|
-
"agent": "explore",
|
|
72
|
-
"prompt": "List all TypeScript files in .opencode/tool/ directory and briefly describe what each tool does. This is a test of sub-session linking.",
|
|
73
|
-
"started": 1767984193526,
|
|
74
|
-
"status": "completed"
|
|
75
|
-
},
|
|
76
|
-
"bg_1767984696916_qi0xa9": {
|
|
77
|
-
"taskId": "bg_1767984696916_qi0xa9",
|
|
78
|
-
"sessionId": "ses_45be671a7ffeXRL43PHImPBtCh",
|
|
79
|
-
"parentSessionId": "ses_45c0ae526ffeQlmBlscyZMZALt",
|
|
80
|
-
"agent": "explore",
|
|
81
|
-
"prompt": "Find all files in src/commands/ and list their exports. This is a test of the updated background tool.",
|
|
82
|
-
"started": 1767984719380,
|
|
83
|
-
"status": "completed",
|
|
84
|
-
"beadId": "bd-test-123"
|
|
85
|
-
},
|
|
86
|
-
"bg_1767985457040_uo3le4": {
|
|
87
|
-
"taskId": "bg_1767985457040_uo3le4",
|
|
88
|
-
"sessionId": "ses_45bdad86bffeZNUcXDi1wrSwxb",
|
|
89
|
-
"parentSessionId": "ses_45c0ae526ffeQlmBlscyZMZALt",
|
|
90
|
-
"agent": "explore",
|
|
91
|
-
"prompt": "List files in src/ directory. Quick test.",
|
|
92
|
-
"started": 1767985471066,
|
|
93
|
-
"status": "failed"
|
|
94
|
-
},
|
|
95
|
-
"bg_1768055221950_w4qq7h": {
|
|
96
|
-
"taskId": "bg_1768055221950_w4qq7h",
|
|
97
|
-
"pid": 63439,
|
|
98
|
-
"outputFile": ".opencode/.background-output/bg_1768055221950_w4qq7h.txt",
|
|
99
|
-
"agent": "scout",
|
|
100
|
-
"prompt": "Research best practices for Bun CLI tools. Return a brief 3-5 bullet point summary.",
|
|
101
|
-
"started": 1768055221953,
|
|
102
|
-
"status": "running"
|
|
103
|
-
},
|
|
104
|
-
"bg_1768055221957_ahsl80": {
|
|
105
|
-
"taskId": "bg_1768055221957_ahsl80",
|
|
106
|
-
"pid": 63440,
|
|
107
|
-
"outputFile": ".opencode/.background-output/bg_1768055221957_ahsl80.txt",
|
|
108
|
-
"agent": "explore",
|
|
109
|
-
"prompt": "Find all TypeScript files in src/commands/ and list their main exported functions. Return a brief summary.",
|
|
110
|
-
"started": 1768055221958,
|
|
111
|
-
"status": "running"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|