opcode-pg-memory 2.2.2 → 2.2.3
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 +45 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5058,12 +5058,54 @@ function createInitCommand() {
|
|
|
5058
5058
|
console.log("Created /pg-memory-init command");
|
|
5059
5059
|
return true;
|
|
5060
5060
|
}
|
|
5061
|
+
var PG_MEMORY_SYNC_COMMAND = `---
|
|
5062
|
+
description: Sync OpenCode sessions from SQLite to PostgreSQL
|
|
5063
|
+
---
|
|
5064
|
+
|
|
5065
|
+
# PG Memory Sync
|
|
5066
|
+
|
|
5067
|
+
Run this command to sync historical OpenCode sessions into the pg-memory database:
|
|
5068
|
+
|
|
5069
|
+
\`\`\`bash
|
|
5070
|
+
bunx opcode-pg-memory sync
|
|
5071
|
+
\`\`\`
|
|
5072
|
+
|
|
5073
|
+
This imports all historical OpenCode sessions into the pg-memory PostgreSQL database for future retrieval.
|
|
5074
|
+
`;
|
|
5075
|
+
function createSyncCommand() {
|
|
5076
|
+
mkdirSync(OPENCODE_COMMAND_DIR, { recursive: true });
|
|
5077
|
+
const syncPath = join(OPENCODE_COMMAND_DIR, "pg-memory-sync.md");
|
|
5078
|
+
writeFileSync(syncPath, PG_MEMORY_SYNC_COMMAND);
|
|
5079
|
+
console.log("Created /pg-memory-sync command");
|
|
5080
|
+
return true;
|
|
5081
|
+
}
|
|
5082
|
+
var PG_MEMORY_REFLECT_COMMAND = `---
|
|
5083
|
+
description: Reflect on current session to extract patterns and insights
|
|
5084
|
+
---
|
|
5085
|
+
|
|
5086
|
+
# PG Memory Reflect
|
|
5087
|
+
|
|
5088
|
+
Summarize and reflect on the current session to extract reusable patterns, lessons, and insights.
|
|
5089
|
+
|
|
5090
|
+
## Instructions
|
|
5091
|
+
|
|
5092
|
+
1. Determine the current session ID
|
|
5093
|
+
2. Call the \`hindsight_reflect\` MCP tool with the session ID
|
|
5094
|
+
3. Present the results in a clear format: error patterns, tool usage, success patterns, recommendations
|
|
5095
|
+
`;
|
|
5096
|
+
function createReflectCommand() {
|
|
5097
|
+
mkdirSync(OPENCODE_COMMAND_DIR, { recursive: true });
|
|
5098
|
+
const reflectPath = join(OPENCODE_COMMAND_DIR, "pg-memory-reflect.md");
|
|
5099
|
+
writeFileSync(reflectPath, PG_MEMORY_REFLECT_COMMAND);
|
|
5100
|
+
console.log("Created /pg-memory-reflect command");
|
|
5101
|
+
return true;
|
|
5102
|
+
}
|
|
5061
5103
|
function printHelp() {
|
|
5062
5104
|
console.log(`
|
|
5063
5105
|
pg-memory - PostgreSQL-backed long-term memory for OpenCode
|
|
5064
5106
|
|
|
5065
5107
|
Commands:
|
|
5066
|
-
install Register plugin and create
|
|
5108
|
+
install Register plugin and create commands
|
|
5067
5109
|
sync Sync OpenCode sessions from SQLite to PostgreSQL
|
|
5068
5110
|
|
|
5069
5111
|
Examples:
|
|
@@ -5101,6 +5143,8 @@ OpenCode PG Memory installer
|
|
|
5101
5143
|
createNewConfig();
|
|
5102
5144
|
}
|
|
5103
5145
|
createInitCommand();
|
|
5146
|
+
createSyncCommand();
|
|
5147
|
+
createReflectCommand();
|
|
5104
5148
|
console.log(`
|
|
5105
5149
|
Setup complete!`);
|
|
5106
5150
|
console.log(`
|
package/package.json
CHANGED