@snoai/mem-claude 1.2.2 → 1.2.4

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/install.js CHANGED
@@ -71,17 +71,22 @@ function updateSettings(settings, programPath) {
71
71
  type: "command", command: codingSkinHookCommand(programPath, details.subcommand, "claude"),
72
72
  timeout: details.timeout,
73
73
  };
74
+ const emptiedByDuplicate = new Set();
74
75
  for (const group of groups) {
75
- group.hooks = group.hooks.map(current => {
76
+ group.hooks = group.hooks.flatMap(current => {
76
77
  if (!current.command || !isOwnedHookCommand(current.command, details.subcommand))
77
- return current;
78
+ return [current];
79
+ if (installed)
80
+ return [];
78
81
  installed = true;
79
- return hook;
82
+ return [hook];
80
83
  });
84
+ if (installed && group.hooks.length === 0)
85
+ emptiedByDuplicate.add(group);
81
86
  }
82
87
  if (!installed)
83
88
  groups.push({ hooks: [hook] });
84
- settings.hooks[event] = groups;
89
+ settings.hooks[event] = groups.filter(group => !emptiedByDuplicate.has(group));
85
90
  }
86
91
  settings.permissions ??= {};
87
92
  const allow = settings.permissions.allow ?? [];
@@ -80,6 +80,7 @@ export async function reportSessionActivity(cursor, input, hook, persist = async
80
80
  if (folded.payload) {
81
81
  const projectId = input.cwd ? detectProjectId(await workspaceRoot(input.cwd)) : undefined;
82
82
  appendObserveLedgerRows(getSnoProfileDir(), [{
83
+ agent_id: "claude-code",
83
84
  ts_ms: folded.payload.window_end_ms,
84
85
  ...(projectId === undefined ? {} : { project_id: projectId }),
85
86
  event_type: "session.activity",
@@ -91,6 +91,7 @@ export async function readSkillRuns(input) {
91
91
  const { skills, failed, last } = await scanTranscript(await readFile(transcriptPath, "utf8"), configDir);
92
92
  const projectId = input.cwd ? detectProjectId(await workspaceRoot(input.cwd)) : undefined;
93
93
  return skills.map((skill, index) => ({
94
+ agent_id: "claude-code",
94
95
  ts_ms: skill.ts,
95
96
  ...(projectId === undefined ? {} : { project_id: projectId }),
96
97
  event_type: "skill.run",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snoai/mem-claude",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": { "access": "public" },
6
6
  "repository": {