claude-memory-layer 1.0.16 → 1.0.17
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/memory/_index.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Generated automatically by MarkdownMirror.
|
|
4
4
|
|
|
5
5
|
- memory/.claude-plugin/commands/2026-02-25.md
|
|
6
|
+
- memory/agent_response/uncategorized/2026-02-26.md
|
|
6
7
|
- memory/default/uncategorized/2026-02-25.md
|
|
7
8
|
- memory/node_modules/abbrev/2026-02-25.md
|
|
8
9
|
- memory/node_modules/abort-controller/2026-02-25.md
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
## 2026-02-26T13:24:02.294Z | aff47d45-6a32-45d6-b584-15f4d93e2ff8
|
|
3
|
+
- type: agent_response
|
|
4
|
+
- session: f8003696-c17e-4e1d-819b-9502d73b9bd4
|
|
5
|
+
이제 문제를 파악했습니다. 현재 프롬프트에서 챗봇이 실제로 수행할 수 없는 기능(재고 확인, 쿠폰 적용, 배송 추적 등)도 제안 가능하도록 허용하고 있습니다.
|
|
6
|
+
|
|
7
|
+
챗봇의 실제 기능 목록을 기반으로 두 프롬프트 모두 개선하겠습니다.
|
|
8
|
+
|
|
9
|
+
먼저 **일반 프롬프트** (`_SYSTEM_PROMPT`)에 제한 사항을 추가합니다.
|
|
10
|
+
|
|
11
|
+
수정 완료했습니다. 변경 요약:
|
|
12
|
+
|
|
13
|
+
### 변경 사항 (`app/services/suggestion_service.py`)
|
|
14
|
+
|
|
15
|
+
**1. 일반 프롬프트 (`_SYSTEM_PROMPT`)에 추가:**
|
|
16
|
+
- "챗봇이 제공할 수 없는 기능" 섹션 신규 추가
|
|
17
|
+
- 재고/품절 확인, 쿠폰/할인코드, 주문/결제, 배송 추적, 교환/반품/환불, A/S/보증, 회원/포인트, 매장 정보
|
|
18
|
+
- 챗봇이 할 수 있는 기능 명시 (상품 검색, 가격 비교, 리뷰 분석, 방송 일정, 판매량 순위, 설명서 정보 등)
|
|
19
|
+
- 좋은 예시에서 '배송 가능 지역 알려줘' → '홈쇼핑 방송 일정 알려줘'로 교체
|
|
20
|
+
|
|
21
|
+
**2. PDID 프롬프트 (`_SYSTEM_PROMPT_PDID`) 변경:**
|
|
22
|
+
- 허용 유형에서 불가능한 항목 제거: 배송/교환/반품, 할인/프로모션, A/S, 색상/사이즈 옵션
|
|
23
|
+
- "챗봇이 제공할 수 없는 기능" 섹션 신규 추가 (재고, 쿠폰, 주문, 배송, 교환/반품, A/S, 회원, 색상/사이즈 옵션)
|
|
24
|
+
- 챗봇이 이 상품에 대해 할 수 있는 것 명시 (설명서 기반 정보, 리뷰 분석, 방송 일정)
|
|
25
|
+
|
|
26
|
+
이제 "각 색상·사이즈별 재고 가능 여부 확인해줘" 같은 제안이 생성되지 않습니다.
|
|
@@ -7,4 +7,10 @@ api/stats/retrieval-traces?limit=20
|
|
|
7
7
|
## 2026-02-26T12:50:53.044Z | 71b502de-eda8-4d54-a1f4-3ef06fd9edb3
|
|
8
8
|
- type: user_prompt
|
|
9
9
|
- session: 2f324dae-7d8f-4f67-842e-acf507b79c59
|
|
10
|
-
스키마 생성은 언제 하는거야?
|
|
10
|
+
스키마 생성은 언제 하는거야?
|
|
11
|
+
## 2026-02-26T13:24:02.278Z | dd9328f4-430f-49d7-b8ab-62f39cea6164
|
|
12
|
+
- type: user_prompt
|
|
13
|
+
- session: f8003696-c17e-4e1d-819b-9502d73b9bd4
|
|
14
|
+
suggested_actions 를 생성할때
|
|
15
|
+
"각 색상·사이즈별 재고 가능 여부 확인해줘"
|
|
16
|
+
같이 없는 기능은 생성하지 않도록 프롬프트 개선해줘
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface ClaudeSettings {
|
|
|
32
32
|
PostToolUse?: Array<{ matcher: string; hooks: Array<{ type: string; command: string }> }>;
|
|
33
33
|
SessionStart?: Array<{ matcher: string; hooks: Array<{ type: string; command: string }> }>;
|
|
34
34
|
Stop?: Array<{ matcher: string; hooks: Array<{ type: string; command: string }> }>;
|
|
35
|
+
SessionEnd?: Array<{ matcher: string; hooks: Array<{ type: string; command: string }> }>;
|
|
35
36
|
};
|
|
36
37
|
[key: string]: unknown;
|
|
37
38
|
}
|
|
@@ -79,30 +80,39 @@ function saveClaudeSettings(settings: ClaudeSettings): void {
|
|
|
79
80
|
fs.renameSync(tempPath, CLAUDE_SETTINGS_PATH);
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
const REQUIRED_HOOK_FILES = [
|
|
84
|
+
'user-prompt-submit.js',
|
|
85
|
+
'post-tool-use.js',
|
|
86
|
+
'session-start.js',
|
|
87
|
+
'stop.js',
|
|
88
|
+
'session-end.js'
|
|
89
|
+
] as const;
|
|
90
|
+
|
|
91
|
+
function hasHook(settings: ClaudeSettings, hookName: keyof NonNullable<ClaudeSettings['hooks']>, commandFragment: string): boolean {
|
|
92
|
+
const hookEntries = settings.hooks?.[hookName];
|
|
93
|
+
if (!hookEntries) return false;
|
|
94
|
+
return hookEntries.some((entry) => entry.hooks?.some((hook) => hook.command?.includes(commandFragment)));
|
|
95
|
+
}
|
|
96
|
+
|
|
82
97
|
function getHooksConfig(pluginPath: string): ClaudeSettings['hooks'] {
|
|
98
|
+
const makeHook = (fileName: string) => [
|
|
99
|
+
{
|
|
100
|
+
matcher: '',
|
|
101
|
+
hooks: [
|
|
102
|
+
{
|
|
103
|
+
type: 'command',
|
|
104
|
+
command: `node ${path.join(pluginPath, 'hooks', fileName)}`
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
|
|
83
110
|
return {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
type: 'command',
|
|
90
|
-
command: `node ${path.join(pluginPath, 'hooks', 'user-prompt-submit.js')}`
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
PostToolUse: [
|
|
96
|
-
{
|
|
97
|
-
matcher: '',
|
|
98
|
-
hooks: [
|
|
99
|
-
{
|
|
100
|
-
type: 'command',
|
|
101
|
-
command: `node ${path.join(pluginPath, 'hooks', 'post-tool-use.js')}`
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
]
|
|
111
|
+
SessionStart: makeHook('session-start.js'),
|
|
112
|
+
UserPromptSubmit: makeHook('user-prompt-submit.js'),
|
|
113
|
+
PostToolUse: makeHook('post-tool-use.js'),
|
|
114
|
+
Stop: makeHook('stop.js'),
|
|
115
|
+
SessionEnd: makeHook('session-end.js')
|
|
106
116
|
};
|
|
107
117
|
}
|
|
108
118
|
|
|
@@ -129,9 +139,12 @@ program
|
|
|
129
139
|
const pluginPath = options.path || getPluginPath();
|
|
130
140
|
|
|
131
141
|
// Verify hooks exist
|
|
132
|
-
const
|
|
133
|
-
|
|
142
|
+
const missingHooks = REQUIRED_HOOK_FILES.filter((file) =>
|
|
143
|
+
!fs.existsSync(path.join(pluginPath, 'hooks', file))
|
|
144
|
+
);
|
|
145
|
+
if (missingHooks.length > 0) {
|
|
134
146
|
console.error(`\n❌ Hook files not found at: ${pluginPath}`);
|
|
147
|
+
console.error(` Missing: ${missingHooks.join(', ')}`);
|
|
135
148
|
console.error(' Make sure you have built the plugin with "npm run build"');
|
|
136
149
|
process.exit(1);
|
|
137
150
|
}
|
|
@@ -151,8 +164,11 @@ program
|
|
|
151
164
|
|
|
152
165
|
console.log('\n✅ Claude Memory Layer installed!\n');
|
|
153
166
|
console.log('Hooks registered:');
|
|
167
|
+
console.log(' - SessionStart: Register session -> project mapping');
|
|
154
168
|
console.log(' - UserPromptSubmit: Memory retrieval on user input');
|
|
155
|
-
console.log(' - PostToolUse: Store tool observations
|
|
169
|
+
console.log(' - PostToolUse: Store tool observations');
|
|
170
|
+
console.log(' - Stop: Store assistant responses');
|
|
171
|
+
console.log(' - SessionEnd: Persist session summary\n');
|
|
156
172
|
console.log('Plugin path:', pluginPath);
|
|
157
173
|
console.log('\n⚠️ Restart Claude Code for changes to take effect.\n');
|
|
158
174
|
console.log('Commands:');
|
|
@@ -183,8 +199,11 @@ program
|
|
|
183
199
|
}
|
|
184
200
|
|
|
185
201
|
// Remove our hooks
|
|
202
|
+
delete settings.hooks.SessionStart;
|
|
186
203
|
delete settings.hooks.UserPromptSubmit;
|
|
187
204
|
delete settings.hooks.PostToolUse;
|
|
205
|
+
delete settings.hooks.Stop;
|
|
206
|
+
delete settings.hooks.SessionEnd;
|
|
188
207
|
|
|
189
208
|
// Clean up empty hooks object
|
|
190
209
|
if (Object.keys(settings.hooks).length === 0) {
|
|
@@ -219,19 +238,22 @@ program
|
|
|
219
238
|
console.log('\n🧠 Claude Memory Layer Status\n');
|
|
220
239
|
|
|
221
240
|
// Check hooks
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
);
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
);
|
|
241
|
+
const hasSessionStartHook = hasHook(settings, 'SessionStart', 'session-start');
|
|
242
|
+
const hasUserPromptHook = hasHook(settings, 'UserPromptSubmit', 'user-prompt-submit');
|
|
243
|
+
const hasPostToolHook = hasHook(settings, 'PostToolUse', 'post-tool-use');
|
|
244
|
+
const hasStopHook = hasHook(settings, 'Stop', 'stop');
|
|
245
|
+
const hasSessionEndHook = hasHook(settings, 'SessionEnd', 'session-end');
|
|
228
246
|
|
|
229
247
|
console.log('Hooks:');
|
|
248
|
+
console.log(` SessionStart: ${hasSessionStartHook ? '✅ Installed' : '❌ Not installed'}`);
|
|
230
249
|
console.log(` UserPromptSubmit: ${hasUserPromptHook ? '✅ Installed' : '❌ Not installed'}`);
|
|
231
250
|
console.log(` PostToolUse: ${hasPostToolHook ? '✅ Installed' : '❌ Not installed'}`);
|
|
251
|
+
console.log(` Stop: ${hasStopHook ? '✅ Installed' : '❌ Not installed'}`);
|
|
252
|
+
console.log(` SessionEnd: ${hasSessionEndHook ? '✅ Installed' : '❌ Not installed'}`);
|
|
232
253
|
|
|
233
254
|
// Check plugin files
|
|
234
|
-
const hooksExist =
|
|
255
|
+
const hooksExist = REQUIRED_HOOK_FILES
|
|
256
|
+
.every((file) => fs.existsSync(path.join(pluginPath, 'hooks', file)));
|
|
235
257
|
console.log(`\nPlugin files: ${hooksExist ? '✅ Found' : '❌ Not found'}`);
|
|
236
258
|
console.log(` Path: ${pluginPath}`);
|
|
237
259
|
|
|
@@ -239,7 +261,7 @@ program
|
|
|
239
261
|
const dashboardRunning = await isServerRunning(37777);
|
|
240
262
|
console.log(`\nDashboard: ${dashboardRunning ? '✅ Running at http://localhost:37777' : '⏹️ Not running'}`);
|
|
241
263
|
|
|
242
|
-
if (!hasUserPromptHook || !hasPostToolHook) {
|
|
264
|
+
if (!hasSessionStartHook || !hasUserPromptHook || !hasPostToolHook || !hasStopHook || !hasSessionEndHook) {
|
|
243
265
|
console.log('\n💡 Run "claude-memory-layer install" to set up hooks.\n');
|
|
244
266
|
} else {
|
|
245
267
|
console.log('\n✅ Plugin is fully installed and configured.\n');
|