newtype-profile 1.0.39 → 1.0.41
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/index.js +3 -2
- package/dist/config/schema.d.ts +2 -0
- package/dist/features/builtin-commands/templates/memory-consolidate.d.ts +1 -0
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/memory-system/constants.d.ts +13 -0
- package/dist/hooks/memory-system/extractor.d.ts +15 -0
- package/dist/hooks/memory-system/index.d.ts +10 -0
- package/dist/hooks/memory-system/storage.d.ts +10 -0
- package/dist/hooks/memory-system/types.d.ts +16 -0
- package/dist/index.js +716 -192
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "newtype-profile",
|
|
2256
|
-
version: "1.0.
|
|
2256
|
+
version: "1.0.41",
|
|
2257
2257
|
description: "AI Agent Collaboration System for Content Creation - Based on oh-my-opencode",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -22223,7 +22223,8 @@ var HookNameSchema = exports_external.enum([
|
|
|
22223
22223
|
"auto-slash-command",
|
|
22224
22224
|
"edit-error-recovery",
|
|
22225
22225
|
"prometheus-md-only",
|
|
22226
|
-
"chief-orchestrator"
|
|
22226
|
+
"chief-orchestrator",
|
|
22227
|
+
"memory-system"
|
|
22227
22228
|
]);
|
|
22228
22229
|
var BuiltinCommandNameSchema = exports_external.enum([
|
|
22229
22230
|
"init-deep",
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export declare const HookNameSchema: z.ZodEnum<{
|
|
|
65
65
|
"edit-error-recovery": "edit-error-recovery";
|
|
66
66
|
"prometheus-md-only": "prometheus-md-only";
|
|
67
67
|
"chief-orchestrator": "chief-orchestrator";
|
|
68
|
+
"memory-system": "memory-system";
|
|
68
69
|
}>;
|
|
69
70
|
export declare const BuiltinCommandNameSchema: z.ZodEnum<{
|
|
70
71
|
"ralph-loop": "ralph-loop";
|
|
@@ -883,6 +884,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
883
884
|
"edit-error-recovery": "edit-error-recovery";
|
|
884
885
|
"prometheus-md-only": "prometheus-md-only";
|
|
885
886
|
"chief-orchestrator": "chief-orchestrator";
|
|
887
|
+
"memory-system": "memory-system";
|
|
886
888
|
}>>>;
|
|
887
889
|
disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
888
890
|
"ralph-loop": "ralph-loop";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MEMORY_CONSOLIDATE_TEMPLATE = "Consolidate daily memory logs into long-term memory.\n\n## USAGE\n\n`/memory-consolidate`\n\n## WHAT TO DO\n\nRead all files in `.opencode/memory/` directory and consolidate important information into `.opencode/MEMORY.md`.\n\n### Step 1: Read Daily Logs\n\nUse `glob` to find all memory files:\n```\nglob(\".opencode/memory/*.md\")\n```\n\nThen `read` each file to understand the contents.\n\n### Step 2: Extract Key Information\n\nFrom the daily logs, identify:\n1. **User Preferences** - Recurring patterns in how user likes things done\n2. **Important Decisions** - Choices made that affect future work\n3. **Project Milestones** - Significant completions or achievements\n4. **Recurring Problems** - Issues that came up multiple times and their solutions\n5. **Key Insights** - Valuable learnings worth preserving\n\n### Step 3: Update MEMORY.md\n\nRead existing `.opencode/MEMORY.md` (create if doesn't exist).\n\nAppend new consolidated information using this structure:\n\n```markdown\n## Consolidated: YYYY-MM-DD\n\n### User Preferences\n- [preference 1]\n- [preference 2]\n\n### Decisions Made\n- [decision with context]\n\n### Lessons Learned\n- [insight or lesson]\n\n---\n```\n\n### Step 4: Archive Processed Logs\n\nAfter consolidation, you may suggest to the user whether to:\n- Keep the daily logs for reference\n- Delete processed daily logs to save space\n\n## OUTPUT FORMAT\n\nAfter consolidation:\n```\n\u2705 Memory consolidated\n\n**Processed:** X daily log files\n**Extracted:**\n- Y user preferences\n- Z decisions\n- W insights\n\n**Updated:** .opencode/MEMORY.md\n\n\uD83D\uDCA1 Tip: Daily logs in .opencode/memory/ are preserved. \n Delete them manually if you want to save space.\n```\n\nIf no memory files found:\n```\n\uD83D\uDCED No memory files to consolidate\n\nMemory files are automatically created after conversations.\nCheck back after a few chat sessions.\n```\n\n## IMPORTANT\n\n- Never delete information from MEMORY.md, only append\n- Preserve existing structure and content\n- Be selective - only consolidate truly important information\n- Use user's language (Chinese/English) based on existing content\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandDefinition } from "../claude-code-command-loader";
|
|
2
|
-
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "switch" | "super-analyst" | "super-writer";
|
|
2
|
+
export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "switch" | "super-analyst" | "super-writer" | "memory-consolidate";
|
|
3
3
|
export interface BuiltinCommandConfig {
|
|
4
4
|
disabled_commands?: BuiltinCommandName[];
|
|
5
5
|
}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -27,3 +27,4 @@ export { createEditErrorRecoveryHook } from "./edit-error-recovery";
|
|
|
27
27
|
export { createPrometheusMdOnlyHook } from "./prometheus-md-only";
|
|
28
28
|
export { createTaskResumeInfoHook } from "./task-resume-info";
|
|
29
29
|
export { createChiefOrchestratorHook } from "./chief-orchestrator";
|
|
30
|
+
export { createMemorySystemHook } from "./memory-system";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "memory-system";
|
|
2
|
+
/** Minimum number of messages to trigger memory save */
|
|
3
|
+
export declare const MIN_MESSAGES_TO_SAVE = 4;
|
|
4
|
+
/** Memory storage directory relative to project root */
|
|
5
|
+
export declare const MEMORY_DIR = ".opencode/memory";
|
|
6
|
+
/** Long-term memory file */
|
|
7
|
+
export declare const MEMORY_FILE = ".opencode/MEMORY.md";
|
|
8
|
+
/** Grace period before saving (ms) - allows for quick follow-ups */
|
|
9
|
+
export declare const SAVE_GRACE_PERIOD_MS = 5000;
|
|
10
|
+
/** Maximum summary length per session (chars) */
|
|
11
|
+
export declare const MAX_SUMMARY_LENGTH = 2000;
|
|
12
|
+
/** Days after which daily logs are auto-archived to MEMORY.md */
|
|
13
|
+
export declare const ARCHIVE_AFTER_DAYS = 7;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MemoryEntry } from "./types";
|
|
2
|
+
interface MessagePart {
|
|
3
|
+
type: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
}
|
|
6
|
+
interface MessageInfo {
|
|
7
|
+
role: string;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
interface MessageWrapper {
|
|
11
|
+
info: MessageInfo;
|
|
12
|
+
parts: MessagePart[];
|
|
13
|
+
}
|
|
14
|
+
export declare function extractSessionSummary(sessionID: string, messages: MessageWrapper[]): MemoryEntry;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export declare function createMemorySystemHook(ctx: PluginInput): {
|
|
3
|
+
event: ({ event }: {
|
|
4
|
+
event: {
|
|
5
|
+
type: string;
|
|
6
|
+
properties?: unknown;
|
|
7
|
+
};
|
|
8
|
+
}) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export { HOOK_NAME } from "./constants";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MemoryEntry } from "./types";
|
|
2
|
+
export interface ArchiveResult {
|
|
3
|
+
archived: string[];
|
|
4
|
+
totalFiles: number;
|
|
5
|
+
needsArchive: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function checkArchiveNeeded(projectDir: string): ArchiveResult;
|
|
8
|
+
export declare function archiveOldMemories(projectDir: string): ArchiveResult;
|
|
9
|
+
export declare function appendMemoryEntry(projectDir: string, entry: MemoryEntry): boolean;
|
|
10
|
+
export declare function hasMemoryForSession(projectDir: string, sessionID: string): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface MemoryEntry {
|
|
2
|
+
sessionID: string;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
keyPoints: string[];
|
|
6
|
+
decisions?: string[];
|
|
7
|
+
todos?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface SessionState {
|
|
10
|
+
saved: boolean;
|
|
11
|
+
saveTimer?: ReturnType<typeof setTimeout>;
|
|
12
|
+
messageCount: number;
|
|
13
|
+
}
|
|
14
|
+
export interface MemorySystemState {
|
|
15
|
+
sessionStates: Map<string, SessionState>;
|
|
16
|
+
}
|