echoes-vault-opencode 0.0.4 → 0.0.5
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/index.ts +23 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -253,6 +253,17 @@ const ensureSkills = async (directory: string): Promise<void> => {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
const parseCommandFrontmatter = (cmd: string): { template: string; description?: string; agent?: string } => {
|
|
257
|
+
const match = cmd.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/)
|
|
258
|
+
if (!match) return { template: cmd }
|
|
259
|
+
const frontmatter: Record<string, string> = {}
|
|
260
|
+
for (const line of match[1].split("\n")) {
|
|
261
|
+
const [key, ...rest] = line.split(":")
|
|
262
|
+
if (key && rest.length) frontmatter[key.trim()] = rest.join(":").trim()
|
|
263
|
+
}
|
|
264
|
+
return { template: match[2], description: frontmatter.description, agent: frontmatter.agent }
|
|
265
|
+
}
|
|
266
|
+
|
|
256
267
|
export const OpenCodeEchoes: Plugin = async ({ directory }) => {
|
|
257
268
|
const paths = resolveVaultPaths(directory)
|
|
258
269
|
const indexFile = path.join(paths.vault, "index.md")
|
|
@@ -268,6 +279,18 @@ export const OpenCodeEchoes: Plugin = async ({ directory }) => {
|
|
|
268
279
|
await ensureSkills(directory)
|
|
269
280
|
|
|
270
281
|
return {
|
|
282
|
+
config: async (input) => {
|
|
283
|
+
const cmds: Record<string, string> = {
|
|
284
|
+
"echoes-init": ECHOES_INIT_COMMAND,
|
|
285
|
+
"echoes-resume": ECHOES_RESUME_COMMAND,
|
|
286
|
+
"echoes-save": ECHOES_SAVE_COMMAND,
|
|
287
|
+
}
|
|
288
|
+
input.command = input.command || {}
|
|
289
|
+
for (const [name, cmd] of Object.entries(cmds)) {
|
|
290
|
+
const { template, description, agent } = parseCommandFrontmatter(cmd)
|
|
291
|
+
input.command[name] = { template, description, agent }
|
|
292
|
+
}
|
|
293
|
+
},
|
|
271
294
|
tool: {
|
|
272
295
|
commit_memory_to_echoes_vault: tool({
|
|
273
296
|
description:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echoes-vault-opencode",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "EchoesVault — persistent memory plugin for OpenCode. Obsidian-style knowledge base with daily logs, encyclopedia pages, and session resumption.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|