@haisto/opencode-mem 2.14.3-beta.3 → 2.14.3-beta.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.
@@ -142,6 +142,9 @@ export declare function handleGetUserProfile(userId?: string): Promise<ApiRespon
142
142
  export declare function handleGetProfileChangelog(profileId: string, limit?: number): Promise<ApiResponse<any[]>>;
143
143
  export declare function handleGetProfileSnapshot(changelogId: string): Promise<ApiResponse<any>>;
144
144
  export declare function handleRefreshProfile(userId?: string): Promise<ApiResponse<any>>;
145
+ export declare function handleDeleteProfilePreferences(body: any): Promise<ApiResponse<any>>;
146
+ export declare function handleDeleteProfilePatterns(body: any): Promise<ApiResponse<any>>;
147
+ export declare function handleDeleteProfileWorkflows(body: any): Promise<ApiResponse<any>>;
145
148
  export declare function handleDetectTagMigration(): Promise<ApiResponse<{
146
149
  needsMigration: boolean;
147
150
  count: number;
@@ -1 +1 @@
1
- {"version":3,"file":"api-handlers.d.ts","sourceRoot":"","sources":["../../src/services/api-handlers.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,UAAU,WAAW,CAAC,CAAC,GAAG,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;I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AAED,wBAAsB,wBAAwB,IAAI,OAAO,CACvD,WAAW,CAAC;IAAE,cAAc,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CACxD,CAeA;AAED,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAWD,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAE7F;AAED,wBAAsB,0BAA0B,CAC9C,SAAS,GAAE,MAAU,GACpB,OAAO,CAAC,WAAW,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CA6G9E"}
@@ -809,6 +809,57 @@ export async function handleRefreshProfile(userId) {
809
809
  return { success: false, error: String(error) };
810
810
  }
811
811
  }
812
+ export async function handleDeleteProfilePreferences(body) {
813
+ try {
814
+ const { profileId, indexes } = body;
815
+ if (!profileId)
816
+ return { success: false, error: "profileId is required" };
817
+ if (!Array.isArray(indexes) || indexes.length === 0) {
818
+ return { success: false, error: "indexes must be a non-empty array" };
819
+ }
820
+ const { userProfileManager } = await import("./user-profile/user-profile-manager.js");
821
+ userProfileManager.deletePreferences(profileId, indexes);
822
+ return { success: true, data: { message: `Deleted ${indexes.length} preference(s)` } };
823
+ }
824
+ catch (error) {
825
+ log("handleDeleteProfilePreferences: error", { error: String(error) });
826
+ return { success: false, error: String(error) };
827
+ }
828
+ }
829
+ export async function handleDeleteProfilePatterns(body) {
830
+ try {
831
+ const { profileId, indexes } = body;
832
+ if (!profileId)
833
+ return { success: false, error: "profileId is required" };
834
+ if (!Array.isArray(indexes) || indexes.length === 0) {
835
+ return { success: false, error: "indexes must be a non-empty array" };
836
+ }
837
+ const { userProfileManager } = await import("./user-profile/user-profile-manager.js");
838
+ userProfileManager.deletePatterns(profileId, indexes);
839
+ return { success: true, data: { message: `Deleted ${indexes.length} pattern(s)` } };
840
+ }
841
+ catch (error) {
842
+ log("handleDeleteProfilePatterns: error", { error: String(error) });
843
+ return { success: false, error: String(error) };
844
+ }
845
+ }
846
+ export async function handleDeleteProfileWorkflows(body) {
847
+ try {
848
+ const { profileId, indexes } = body;
849
+ if (!profileId)
850
+ return { success: false, error: "profileId is required" };
851
+ if (!Array.isArray(indexes) || indexes.length === 0) {
852
+ return { success: false, error: "indexes must be a non-empty array" };
853
+ }
854
+ const { userProfileManager } = await import("./user-profile/user-profile-manager.js");
855
+ userProfileManager.deleteWorkflows(profileId, indexes);
856
+ return { success: true, data: { message: `Deleted ${indexes.length} workflow(s)` } };
857
+ }
858
+ catch (error) {
859
+ log("handleDeleteProfileWorkflows: error", { error: String(error) });
860
+ return { success: false, error: String(error) };
861
+ }
862
+ }
812
863
  export async function handleDetectTagMigration() {
813
864
  try {
814
865
  const projectShards = shardManager.getAllShards("project", "");
@@ -7,6 +7,13 @@ export declare class UserProfileManager {
7
7
  getActiveProfile(userId: string): UserProfile | null;
8
8
  createProfile(userId: string, displayName: string, userName: string, userEmail: string, profileData: UserProfileData, promptsAnalyzed: number): string;
9
9
  updateProfile(profileId: string, profileData: UserProfileData, additionalPromptsAnalyzed: number, changeSummary: string): void;
10
+ /**
11
+ * Delete specific preferences by their array indices.
12
+ * Indices are sorted descending so splice doesn't shift unspliced indexes.
13
+ */
14
+ deletePreferences(profileId: string, indexes: number[]): void;
15
+ deletePatterns(profileId: string, indexes: number[]): void;
16
+ deleteWorkflows(profileId: string, indexes: number[]): void;
10
17
  private addChangelog;
11
18
  private cleanupOldChangelogs;
12
19
  getProfileChangelogs(profileId: string, limit?: number): UserProfileChangelog[];
@@ -1 +1 @@
1
- {"version":3,"file":"user-profile-manager.d.ts","sourceRoot":"","sources":["../../../src/services/user-profile/user-profile-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AASrF,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;;IAQhC,OAAO,CAAC,YAAY;IA0CpB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAapD,aAAa,CACX,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,eAAe,EAC5B,eAAe,EAAE,MAAM,GACtB,MAAM;IAoCT,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,eAAe,EAC5B,yBAAyB,EAAE,MAAM,EACjC,aAAa,EAAE,MAAM,GACpB,IAAI;IAmCP,OAAO,CAAC,YAAY;IAqBpB,OAAO,CAAC,oBAAoB;IAiB5B,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,oBAAoB,EAAE;IAYnF,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IA+F7C,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKtC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAOrD,oBAAoB,IAAI,WAAW,EAAE;IAMrC,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,cAAc;IAYtB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe;IAsG/F,OAAO,CAAC,WAAW;CAWpB;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
1
+ {"version":3,"file":"user-profile-manager.d.ts","sourceRoot":"","sources":["../../../src/services/user-prof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AAc;IAYtB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe;IAsG/F,OAAO,CAAC,WAAW;CAWpB;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -100,6 +100,49 @@ export class UserProfileManager {
100
100
  this.addChangelog(profileId, newVersion, "update", changeSummary, cleanedData);
101
101
  this.cleanupOldChangelogs(profileId);
102
102
  }
103
+ /**
104
+ * Delete specific preferences by their array indices.
105
+ * Indices are sorted descending so splice doesn't shift unspliced indexes.
106
+ */
107
+ deletePreferences(profileId, indexes) {
108
+ const profile = this.getProfileById(profileId);
109
+ if (!profile)
110
+ throw new Error(`Profile not found: ${profileId}`);
111
+ const data = JSON.parse(profile.profileData);
112
+ const sorted = [...indexes].sort((a, b) => b - a);
113
+ for (const idx of sorted) {
114
+ if (idx >= 0 && idx < data.preferences.length) {
115
+ data.preferences.splice(idx, 1);
116
+ }
117
+ }
118
+ this.updateProfile(profileId, data, 0, `Deleted ${indexes.length} preference(s)`);
119
+ }
120
+ deletePatterns(profileId, indexes) {
121
+ const profile = this.getProfileById(profileId);
122
+ if (!profile)
123
+ throw new Error(`Profile not found: ${profileId}`);
124
+ const data = JSON.parse(profile.profileData);
125
+ const sorted = [...indexes].sort((a, b) => b - a);
126
+ for (const idx of sorted) {
127
+ if (idx >= 0 && idx < data.patterns.length) {
128
+ data.patterns.splice(idx, 1);
129
+ }
130
+ }
131
+ this.updateProfile(profileId, data, 0, `Deleted ${indexes.length} pattern(s)`);
132
+ }
133
+ deleteWorkflows(profileId, indexes) {
134
+ const profile = this.getProfileById(profileId);
135
+ if (!profile)
136
+ throw new Error(`Profile not found: ${profileId}`);
137
+ const data = JSON.parse(profile.profileData);
138
+ const sorted = [...indexes].sort((a, b) => b - a);
139
+ for (const idx of sorted) {
140
+ if (idx >= 0 && idx < data.workflows.length) {
141
+ data.workflows.splice(idx, 1);
142
+ }
143
+ }
144
+ this.updateProfile(profileId, data, 0, `Deleted ${indexes.length} workflow(s)`);
145
+ }
103
146
  addChangelog(profileId, version, changeType, changeSummary, profileData) {
104
147
  const id = `changelog_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
105
148
  const now = Date.now();
@@ -1 +1 @@
1
- {"version":3,"file":"web-server.d.ts","sourceRoot":"","sources":["../../src/services/web-server.ts"],"names":[],"mappings":"AAiCA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,mBAAmB,CAA+B;IAC1D,OAAO,CAAC,kBAAkB,CAAsC;gBAEpD,MAAM,EAAE,eAAe;IAInC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YASd,MAAM;IAgCpB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,mBAAmB;YAOb,eAAe;IA+BvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B,SAAS,IAAI,OAAO;IAIpB,aAAa,IAAI,OAAO;IAIxB,MAAM,IAAI,MAAM;IAIV,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;YAchC,aAAa;IAuN3B,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,YAAY;CAWrB;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,CAIhF"}
1
+ {"version":3,"file":"web-server.d.ts","sourceRoot":"","sources":["../../src/services/web-server.ts"],"names":[],"mappings":"AAoCA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,mBAAmB,CAA+B;IAC1D,OAAO,CAAC,kBAAkB,CAAsC;gBAEpD,MAAM,EAAE,eAAe;IAInC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAIpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YASd,MAAM;IAgCpB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,mBAAmB;YAOb,eAAe;IA+BvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAY3B,SAAS,IAAI,OAAO;IAIpB,aAAa,IAAI,OAAO;IAIxB,MAAM,IAAI,MAAM;IAIV,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;YAchC,aAAa;IAyO3B,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,YAAY;CAWrB;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,CAIhF"}
@@ -2,7 +2,7 @@ import { readFileSync } from "node:fs";
2
2
  import { join, dirname } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { log } from "./logger.js";
5
- import { handleListTags, handleListMemories, handleAddMemory, handleDeleteMemory, handleBulkDelete, handleUpdateMemory, handleSearch, handleStats, handlePinMemory, handleUnpinMemory, handleRunCleanup, handleRunDeduplication, handleDetectMigration, handleRunMigration, handleDetectTagMigration, handleRunTagMigrationBatch, handleGetTagMigrationProgress, handleDeletePrompt, handleBulkDeletePrompts, handleGetUserProfile, handleGetProfileChangelog, handleGetProfileSnapshot, handleRefreshProfile, } from "./api-handlers.js";
5
+ import { handleListTags, handleListMemories, handleAddMemory, handleDeleteMemory, handleBulkDelete, handleUpdateMemory, handleSearch, handleStats, handlePinMemory, handleUnpinMemory, handleRunCleanup, handleRunDeduplication, handleDetectMigration, handleRunMigration, handleDetectTagMigration, handleRunTagMigrationBatch, handleGetTagMigrationProgress, handleDeletePrompt, handleBulkDeletePrompts, handleGetUserProfile, handleGetProfileChangelog, handleGetProfileSnapshot, handleRefreshProfile, handleDeleteProfilePreferences, handleDeleteProfilePatterns, handleDeleteProfileWorkflows, } from "./api-handlers.js";
6
6
  const __filename = fileURLToPath(import.meta.url);
7
7
  const __dirname = dirname(__filename);
8
8
  export class WebServer {
@@ -303,6 +303,21 @@ export class WebServer {
303
303
  const result = await handleRefreshProfile(userId);
304
304
  return this.jsonResponse(result);
305
305
  }
306
+ if (path === "/api/user-profile/preferences/delete" && method === "POST") {
307
+ const body = (await req.json());
308
+ const result = await handleDeleteProfilePreferences(body);
309
+ return this.jsonResponse(result);
310
+ }
311
+ if (path === "/api/user-profile/patterns/delete" && method === "POST") {
312
+ const body = (await req.json());
313
+ const result = await handleDeleteProfilePatterns(body);
314
+ return this.jsonResponse(result);
315
+ }
316
+ if (path === "/api/user-profile/workflows/delete" && method === "POST") {
317
+ const body = (await req.json());
318
+ const result = await handleDeleteProfileWorkflows(body);
319
+ return this.jsonResponse(result);
320
+ }
306
321
  return new Response("Not Found", { status: 404 });
307
322
  }
308
323
  catch (error) {
package/dist/web/app.js CHANGED
@@ -12,6 +12,9 @@ const state = {
12
12
  searchQuery: "",
13
13
  isSearching: false,
14
14
  selectedMemories: new Set(),
15
+ selectedPreferences: new Set(),
16
+ selectedPatterns: new Set(),
17
+ selectedWorkflows: new Set(),
15
18
  autoRefreshInterval: null,
16
19
  userProfile: null,
17
20
  };
@@ -951,12 +954,27 @@ function renderUserProfile() {
951
954
  preferences.length === 0
952
955
  ? `<p class="empty-text">${t("empty-preferences")}</p>`
953
956
  : `
957
+ ${
958
+ state.selectedPreferences.size > 0
959
+ ? `
960
+ <div class="pref-delete-bar">
961
+ <span class="pref-count">${t("text-selected", { count: state.selectedPreferences.size })}</span>
962
+ <span class="pref-bar-actions">
963
+ <button class="pref-bar-btn" data-action="select-all-prefs"><i data-lucide="check-square" class="icon-sm"></i> ${t("btn-select-all")}</button>
964
+ <button class="pref-bar-btn" data-action="deselect-all-prefs"><i data-lucide="square" class="icon-sm"></i> ${t("btn-deselect-all")}</button>
965
+ <button class="pref-bar-btn" data-action="delete-prefs">
966
+ <i data-lucide="trash-2" class="icon-sm"></i> ${t("pref-delete-selected")}
967
+ </button>
968
+ </span>
969
+ </div>`
970
+ : ""
971
+ }
954
972
  <div class="cards-grid">
955
973
  ${preferences
956
974
  .sort((a, b) => (b.confidence || 0) - (a.confidence || 0))
957
975
  .map(
958
- (p) => `
959
- <div class="compact-card preference-card">
976
+ (p, index) => `
977
+ <div class="compact-card preference-card ${state.selectedPreferences.has(index) ? "preference-selected" : ""}" data-index="${index}">
960
978
  <div class="card-top">
961
979
  <span class="category-tag">${escapeHtml(p.category || t("label-general"))}</span>
962
980
  <div class="confidence-ring" style="--p:${Math.round((p.confidence || 0) * 100)}">
@@ -992,11 +1010,26 @@ function renderUserProfile() {
992
1010
  patterns.length === 0
993
1011
  ? `<p class="empty-text">${t("empty-patterns")}</p>`
994
1012
  : `
1013
+ ${
1014
+ state.selectedPatterns.size > 0
1015
+ ? `
1016
+ <div class="pref-delete-bar">
1017
+ <span class="pref-count">${t("text-selected", { count: state.selectedPatterns.size })}</span>
1018
+ <span class="pref-bar-actions">
1019
+ <button class="pref-bar-btn" data-action="select-all-patterns"><i data-lucide="check-square" class="icon-sm"></i> ${t("btn-select-all")}</button>
1020
+ <button class="pref-bar-btn" data-action="deselect-all-patterns"><i data-lucide="square" class="icon-sm"></i> ${t("btn-deselect-all")}</button>
1021
+ <button class="pref-bar-btn" data-action="delete-patterns">
1022
+ <i data-lucide="trash-2" class="icon-sm"></i> ${t("pattern-delete-selected")}
1023
+ </button>
1024
+ </span>
1025
+ </div>`
1026
+ : ""
1027
+ }
995
1028
  <div class="cards-grid">
996
1029
  ${patterns
997
1030
  .map(
998
- (p) => `
999
- <div class="compact-card pattern-card">
1031
+ (p, index) => `
1032
+ <div class="compact-card pattern-card ${state.selectedPatterns.has(index) ? "pattern-selected" : ""}" data-index="${index}">
1000
1033
  <div class="card-top">
1001
1034
  <span class="category-tag">${escapeHtml(p.category || t("label-general"))}</span>
1002
1035
  </div>
@@ -1024,11 +1057,26 @@ function renderUserProfile() {
1024
1057
  workflows.length === 0
1025
1058
  ? `<p class="empty-text">${t("empty-workflows")}</p>`
1026
1059
  : `
1060
+ ${
1061
+ state.selectedWorkflows.size > 0
1062
+ ? `
1063
+ <div class="pref-delete-bar">
1064
+ <span class="pref-count">${t("text-selected", { count: state.selectedWorkflows.size })}</span>
1065
+ <span class="pref-bar-actions">
1066
+ <button class="pref-bar-btn" data-action="select-all-workflows"><i data-lucide="check-square" class="icon-sm"></i> ${t("btn-select-all")}</button>
1067
+ <button class="pref-bar-btn" data-action="deselect-all-workflows"><i data-lucide="square" class="icon-sm"></i> ${t("btn-deselect-all")}</button>
1068
+ <button class="pref-bar-btn" data-action="delete-workflows">
1069
+ <i data-lucide="trash-2" class="icon-sm"></i> ${t("workflow-delete-selected")}
1070
+ </button>
1071
+ </span>
1072
+ </div>`
1073
+ : ""
1074
+ }
1027
1075
  <div class="workflows-grid">
1028
1076
  ${workflows
1029
1077
  .map(
1030
- (w) => `
1031
- <div class="workflow-row">
1078
+ (w, index) => `
1079
+ <div class="workflow-row ${state.selectedWorkflows.has(index) ? "workflow-selected" : ""}" data-index="${index}">
1032
1080
  <div class="workflow-title">${escapeHtml(w.description || "")}</div>
1033
1081
  <div class="workflow-steps-horizontal">
1034
1082
  ${(w.steps || [])
@@ -1110,6 +1158,110 @@ async function refreshProfile() {
1110
1158
  }
1111
1159
  }
1112
1160
 
1161
+ function selectAllPreferences() {
1162
+ document.querySelectorAll(".preference-card[data-index]").forEach((card) => {
1163
+ state.selectedPreferences.add(parseInt(card.dataset.index));
1164
+ });
1165
+ renderUserProfile();
1166
+ }
1167
+
1168
+ function deselectAllPreferences() {
1169
+ state.selectedPreferences.clear();
1170
+ renderUserProfile();
1171
+ }
1172
+
1173
+ async function confirmDeletePreferences() {
1174
+ if (state.selectedPreferences.size === 0) return;
1175
+ if (!confirm(t("confirm-delete-prefs", { count: state.selectedPreferences.size }))) return;
1176
+
1177
+ const result = await fetchAPI("/api/user-profile/preferences/delete", {
1178
+ method: "POST",
1179
+ headers: { "Content-Type": "application/json" },
1180
+ body: JSON.stringify({
1181
+ profileId: state.userProfile.id,
1182
+ indexes: Array.from(state.selectedPreferences),
1183
+ }),
1184
+ });
1185
+
1186
+ if (result.success) {
1187
+ state.selectedPreferences.clear();
1188
+ showToast(t("toast-delete-prefs-success"), "success");
1189
+ await loadUserProfile();
1190
+ } else {
1191
+ showToast(result.error || t("toast-update-failed"), "error");
1192
+ }
1193
+ }
1194
+
1195
+ // --- Pattern selection & delete ---
1196
+ function selectAllPatterns() {
1197
+ document.querySelectorAll(".pattern-card[data-index]").forEach((card) => {
1198
+ state.selectedPatterns.add(parseInt(card.dataset.index));
1199
+ });
1200
+ renderUserProfile();
1201
+ }
1202
+
1203
+ function deselectAllPatterns() {
1204
+ state.selectedPatterns.clear();
1205
+ renderUserProfile();
1206
+ }
1207
+
1208
+ async function confirmDeletePatterns() {
1209
+ if (state.selectedPatterns.size === 0) return;
1210
+ if (!confirm(t("confirm-delete-patterns", { count: state.selectedPatterns.size }))) return;
1211
+
1212
+ const result = await fetchAPI("/api/user-profile/patterns/delete", {
1213
+ method: "POST",
1214
+ headers: { "Content-Type": "application/json" },
1215
+ body: JSON.stringify({
1216
+ profileId: state.userProfile.id,
1217
+ indexes: Array.from(state.selectedPatterns),
1218
+ }),
1219
+ });
1220
+
1221
+ if (result.success) {
1222
+ state.selectedPatterns.clear();
1223
+ showToast(t("toast-delete-patterns-success"), "success");
1224
+ await loadUserProfile();
1225
+ } else {
1226
+ showToast(result.error || t("toast-update-failed"), "error");
1227
+ }
1228
+ }
1229
+
1230
+ // --- Workflow selection & delete ---
1231
+ function selectAllWorkflows() {
1232
+ document.querySelectorAll(".workflow-row[data-index]").forEach((card) => {
1233
+ state.selectedWorkflows.add(parseInt(card.dataset.index));
1234
+ });
1235
+ renderUserProfile();
1236
+ }
1237
+
1238
+ function deselectAllWorkflows() {
1239
+ state.selectedWorkflows.clear();
1240
+ renderUserProfile();
1241
+ }
1242
+
1243
+ async function confirmDeleteWorkflows() {
1244
+ if (state.selectedWorkflows.size === 0) return;
1245
+ if (!confirm(t("confirm-delete-workflows", { count: state.selectedWorkflows.size }))) return;
1246
+
1247
+ const result = await fetchAPI("/api/user-profile/workflows/delete", {
1248
+ method: "POST",
1249
+ headers: { "Content-Type": "application/json" },
1250
+ body: JSON.stringify({
1251
+ profileId: state.userProfile.id,
1252
+ indexes: Array.from(state.selectedWorkflows),
1253
+ }),
1254
+ });
1255
+
1256
+ if (result.success) {
1257
+ state.selectedWorkflows.clear();
1258
+ showToast(t("toast-delete-workflows-success"), "success");
1259
+ await loadUserProfile();
1260
+ } else {
1261
+ showToast(result.error || t("toast-update-failed"), "error");
1262
+ }
1263
+ }
1264
+
1113
1265
  function switchView(view) {
1114
1266
  state.currentView = view;
1115
1267
 
@@ -1178,6 +1330,59 @@ document.addEventListener("DOMContentLoaded", async () => {
1178
1330
  document.getElementById("changelog-modal").classList.add("hidden");
1179
1331
  });
1180
1332
 
1333
+ // Event delegation for profile selection & delete (survives innerHTML replacement)
1334
+ document.getElementById("profile-content")?.addEventListener("click", (e) => {
1335
+ const prefCard = e.target.closest(".preference-card");
1336
+ if (prefCard && prefCard.dataset.index !== undefined) {
1337
+ const idx = parseInt(prefCard.dataset.index);
1338
+ if (state.selectedPreferences.has(idx)) {
1339
+ state.selectedPreferences.delete(idx);
1340
+ } else {
1341
+ state.selectedPreferences.add(idx);
1342
+ }
1343
+ renderUserProfile();
1344
+ return;
1345
+ }
1346
+
1347
+ const patternCard = e.target.closest(".pattern-card");
1348
+ if (patternCard && patternCard.dataset.index !== undefined) {
1349
+ const idx = parseInt(patternCard.dataset.index);
1350
+ if (state.selectedPatterns.has(idx)) {
1351
+ state.selectedPatterns.delete(idx);
1352
+ } else {
1353
+ state.selectedPatterns.add(idx);
1354
+ }
1355
+ renderUserProfile();
1356
+ return;
1357
+ }
1358
+
1359
+ const workflowRow = e.target.closest(".workflow-row");
1360
+ if (workflowRow && workflowRow.dataset.index !== undefined) {
1361
+ const idx = parseInt(workflowRow.dataset.index);
1362
+ if (state.selectedWorkflows.has(idx)) {
1363
+ state.selectedWorkflows.delete(idx);
1364
+ } else {
1365
+ state.selectedWorkflows.add(idx);
1366
+ }
1367
+ renderUserProfile();
1368
+ return;
1369
+ }
1370
+
1371
+ const actionBtn = e.target.closest("[data-action]");
1372
+ if (actionBtn) {
1373
+ const action = actionBtn.dataset.action;
1374
+ if (action === "select-all-prefs") selectAllPreferences();
1375
+ else if (action === "deselect-all-prefs") deselectAllPreferences();
1376
+ else if (action === "delete-prefs") confirmDeletePreferences();
1377
+ else if (action === "select-all-patterns") selectAllPatterns();
1378
+ else if (action === "deselect-all-patterns") deselectAllPatterns();
1379
+ else if (action === "delete-patterns") confirmDeletePatterns();
1380
+ else if (action === "select-all-workflows") selectAllWorkflows();
1381
+ else if (action === "deselect-all-workflows") deselectAllWorkflows();
1382
+ else if (action === "delete-workflows") confirmDeleteWorkflows();
1383
+ }
1384
+ });
1385
+
1181
1386
  document.getElementById("lang-toggle").addEventListener("click", () => {
1182
1387
  const newLang = getLanguage() === "en" ? "zh" : "en";
1183
1388
  setLanguage(newLang);
package/dist/web/i18n.js CHANGED
@@ -55,6 +55,19 @@ const translations = {
55
55
  "toast-delete-failed": "Failed to delete memory",
56
56
  "toast-update-success": "Memory updated successfully",
57
57
  "toast-update-failed": "Failed to update memory",
58
+ "pref-delete-selected": "Delete Selected",
59
+ "pref-no-selection": "Click a preference card to select it",
60
+ "confirm-delete-prefs": "Delete {count} selected preference(s)?",
61
+ "toast-delete-prefs-success": "Preferences deleted successfully",
62
+ "toast-delete-prefs-failed": "Failed to delete preferences",
63
+ "pattern-delete-selected": "Delete Selected",
64
+ "confirm-delete-patterns": "Delete {count} selected pattern(s)?",
65
+ "toast-delete-patterns-success": "Patterns deleted successfully",
66
+ "toast-delete-patterns-failed": "Failed to delete patterns",
67
+ "workflow-delete-selected": "Delete Selected",
68
+ "confirm-delete-workflows": "Delete {count} selected workflow(s)?",
69
+ "toast-delete-workflows-success": "Workflows deleted successfully",
70
+ "toast-delete-workflows-failed": "Failed to delete workflows",
58
71
  "toast-cleanup-success": "Cleanup completed successfully",
59
72
  "toast-cleanup-failed": "Cleanup failed",
60
73
  "toast-dedup-success": "Deduplication completed successfully",
@@ -180,6 +193,19 @@ const translations = {
180
193
  "toast-delete-failed": "删除记忆失败",
181
194
  "toast-update-success": "记忆更新成功",
182
195
  "toast-update-failed": "更新记忆失败",
196
+ "pref-delete-selected": "删除选中",
197
+ "pref-no-selection": "点击偏好卡片可选中",
198
+ "confirm-delete-prefs": "删除选中的 {count} 条偏好设置?",
199
+ "toast-delete-prefs-success": "偏好设置已删除",
200
+ "toast-delete-prefs-failed": "删除偏好设置失败",
201
+ "pattern-delete-selected": "删除选中",
202
+ "confirm-delete-patterns": "删除选中的 {count} 条行为模式?",
203
+ "toast-delete-patterns-success": "行为模式已删除",
204
+ "toast-delete-patterns-failed": "删除行为模式失败",
205
+ "workflow-delete-selected": "删除选中",
206
+ "confirm-delete-workflows": "删除选中的 {count} 条工作流程?",
207
+ "toast-delete-workflows-success": "工作流程已删除",
208
+ "toast-delete-workflows-failed": "删除工作流程失败",
183
209
  "toast-cleanup-success": "清理完成",
184
210
  "toast-cleanup-failed": "清理失败",
185
211
  "toast-dedup-success": "去重完成",
@@ -153,7 +153,7 @@ body {
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
- border: 1px solid var(--om-border-default);
156
+ border: 1px solid var(--om-accent-green);
157
157
  background: var(--om-bg-primary);
158
158
  color: var(--om-accent-green);
159
159
  text-decoration: none;
@@ -1787,3 +1787,125 @@ textarea:focus-visible {
1787
1787
  height: 20px;
1788
1788
  margin: 0;
1789
1789
  }
1790
+
1791
+ /* --- Preference selection & delete bar --- */
1792
+ .preference-card {
1793
+ cursor: pointer;
1794
+ user-select: none;
1795
+ }
1796
+
1797
+ .preference-card.preference-selected {
1798
+ border-color: var(--om-accent-blue);
1799
+ border-width: 2px;
1800
+ background: var(--om-blue-tint);
1801
+ box-shadow: 0 0 0 1px var(--om-blue-border-tint);
1802
+ }
1803
+
1804
+ .pref-delete-bar {
1805
+ display: flex;
1806
+ align-items: center;
1807
+ justify-content: space-between;
1808
+ padding: 10px 14px;
1809
+ margin-bottom: 12px;
1810
+ background: var(--om-danger-bg);
1811
+ border: 1px solid var(--om-accent-red);
1812
+ border-left: 3px solid var(--om-accent-red);
1813
+ font-size: 12px;
1814
+ }
1815
+
1816
+ .pref-delete-bar .pref-count {
1817
+ color: var(--om-accent-red);
1818
+ font-weight: bold;
1819
+ }
1820
+
1821
+ .pref-bar-actions {
1822
+ display: flex;
1823
+ align-items: center;
1824
+ gap: 6px;
1825
+ }
1826
+
1827
+ .pref-bar-btn {
1828
+ background: none;
1829
+ border: 1px solid var(--om-accent-red);
1830
+ color: var(--om-accent-red);
1831
+ font-size: 11px;
1832
+ padding: 4px 10px;
1833
+ cursor: pointer;
1834
+ font-family: inherit;
1835
+ display: inline-flex;
1836
+ align-items: center;
1837
+ gap: 4px;
1838
+ transition: all 0.15s;
1839
+ }
1840
+
1841
+ .pref-bar-btn:hover {
1842
+ background: var(--om-accent-red);
1843
+ color: var(--om-text-inverse);
1844
+ }
1845
+
1846
+ .pref-delete-bar .btn-danger {
1847
+ background: var(--om-accent-red);
1848
+ color: var(--om-text-inverse);
1849
+ border: none;
1850
+ padding: 6px 14px;
1851
+ font-size: 11px;
1852
+ cursor: pointer;
1853
+ display: inline-flex;
1854
+ align-items: center;
1855
+ gap: 6px;
1856
+ transition: background 0.2s;
1857
+ }
1858
+
1859
+ .pref-delete-bar .btn-danger:hover {
1860
+ background: var(--om-danger-bg);
1861
+ color: var(--om-accent-red);
1862
+ outline: 1px solid var(--om-accent-red);
1863
+ }
1864
+
1865
+ .pref-bar-actions {
1866
+ display: flex;
1867
+ align-items: center;
1868
+ gap: 6px;
1869
+ }
1870
+
1871
+ .pref-bar-btn {
1872
+ background: none;
1873
+ border: 1px solid var(--om-accent-red);
1874
+ color: var(--om-accent-red);
1875
+ font-size: 11px;
1876
+ padding: 4px 10px;
1877
+ cursor: pointer;
1878
+ font-family: inherit;
1879
+ transition: all 0.15s;
1880
+ }
1881
+
1882
+ .pref-bar-btn:hover {
1883
+ background: var(--om-accent-red);
1884
+ color: var(--om-text-inverse);
1885
+ }
1886
+
1887
+ /* --- Pattern selection & delete bar --- */
1888
+ .pattern-card {
1889
+ cursor: pointer;
1890
+ user-select: none;
1891
+ }
1892
+
1893
+ .pattern-card.pattern-selected {
1894
+ border-color: var(--om-accent-blue);
1895
+ border-width: 2px;
1896
+ background: var(--om-blue-tint);
1897
+ box-shadow: 0 0 0 1px var(--om-blue-border-tint);
1898
+ }
1899
+
1900
+ /* --- Workflow selection & delete bar --- */
1901
+ .workflow-row {
1902
+ cursor: pointer;
1903
+ user-select: none;
1904
+ }
1905
+
1906
+ .workflow-row.workflow-selected {
1907
+ border-color: var(--om-accent-blue);
1908
+ border-width: 2px;
1909
+ background: var(--om-blue-tint);
1910
+ box-shadow: 0 0 0 1px var(--om-blue-border-tint);
1911
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haisto/opencode-mem",
3
- "version": "2.14.3-beta.3",
3
+ "version": "2.14.3-beta.5",
4
4
  "description": "OpenCode plugin that gives coding agents persistent memory using local vector database",
5
5
  "type": "module",
6
6
  "main": "dist/plugin.js",