@prmichaelsen/remember-mcp 2.5.0 → 2.5.2
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/AGENT.md +2 -2
- package/CHANGELOG.md +21 -0
- package/agent/commands/git.commit.md +511 -0
- package/agent/commands/git.init.md +513 -0
- package/agent/progress.yaml +83 -16
- package/agent/scripts/install.sh +31 -16
- package/agent/scripts/update.sh +32 -17
- package/agent/tasks/task-45-fix-publish-false-success-bug.md +114 -181
- package/dist/server-factory.js +66 -27
- package/dist/server.js +66 -27
- package/package.json +1 -1
- package/src/services/confirmation-token.service.ts +74 -30
package/dist/server.js
CHANGED
|
@@ -3283,33 +3283,72 @@ var ConfirmationTokenService = class {
|
|
|
3283
3283
|
* @returns Request ID and token
|
|
3284
3284
|
*/
|
|
3285
3285
|
async createRequest(userId, action, payload, targetCollection) {
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3286
|
+
try {
|
|
3287
|
+
const token = randomUUID();
|
|
3288
|
+
const now = /* @__PURE__ */ new Date();
|
|
3289
|
+
const expiresAt = new Date(now.getTime() + this.EXPIRY_MINUTES * 60 * 1e3);
|
|
3290
|
+
const request = {
|
|
3291
|
+
user_id: userId,
|
|
3292
|
+
token,
|
|
3293
|
+
action,
|
|
3294
|
+
target_collection: targetCollection,
|
|
3295
|
+
payload,
|
|
3296
|
+
created_at: now.toISOString(),
|
|
3297
|
+
expires_at: expiresAt.toISOString(),
|
|
3298
|
+
status: "pending"
|
|
3299
|
+
};
|
|
3300
|
+
const collectionPath = `users/${userId}/requests`;
|
|
3301
|
+
console.log("[ConfirmationTokenService] Creating request:", {
|
|
3302
|
+
userId,
|
|
3303
|
+
action,
|
|
3304
|
+
targetCollection,
|
|
3305
|
+
collectionPath,
|
|
3306
|
+
requestData: {
|
|
3307
|
+
token,
|
|
3308
|
+
action,
|
|
3309
|
+
payloadKeys: Object.keys(payload)
|
|
3310
|
+
}
|
|
3311
|
+
});
|
|
3312
|
+
console.log("[ConfirmationTokenService] Calling addDocument...");
|
|
3313
|
+
const docRef = await addDocument(collectionPath, request);
|
|
3314
|
+
console.log("[ConfirmationTokenService] addDocument returned:", {
|
|
3315
|
+
hasDocRef: !!docRef,
|
|
3316
|
+
hasId: !!docRef?.id,
|
|
3317
|
+
docRefId: docRef?.id
|
|
3318
|
+
});
|
|
3319
|
+
if (!docRef) {
|
|
3320
|
+
const error = new Error("Firestore addDocument returned null/undefined");
|
|
3321
|
+
console.error("[ConfirmationTokenService] CRITICAL: addDocument returned null", {
|
|
3322
|
+
userId,
|
|
3323
|
+
collectionPath
|
|
3324
|
+
});
|
|
3325
|
+
throw error;
|
|
3326
|
+
}
|
|
3327
|
+
if (!docRef.id) {
|
|
3328
|
+
const error = new Error("Firestore addDocument returned docRef without ID");
|
|
3329
|
+
console.error("[ConfirmationTokenService] CRITICAL: docRef has no ID", {
|
|
3330
|
+
userId,
|
|
3331
|
+
collectionPath,
|
|
3332
|
+
docRef
|
|
3333
|
+
});
|
|
3334
|
+
throw error;
|
|
3335
|
+
}
|
|
3336
|
+
console.log("[ConfirmationTokenService] Request created successfully:", {
|
|
3337
|
+
requestId: docRef.id,
|
|
3338
|
+
token,
|
|
3339
|
+
expiresAt: request.expires_at
|
|
3340
|
+
});
|
|
3341
|
+
return { requestId: docRef.id, token };
|
|
3342
|
+
} catch (error) {
|
|
3343
|
+
console.error("[ConfirmationTokenService] FAILED to create request:", {
|
|
3344
|
+
error: error instanceof Error ? error.message : String(error),
|
|
3345
|
+
stack: error instanceof Error ? error.stack : void 0,
|
|
3346
|
+
userId,
|
|
3347
|
+
action,
|
|
3348
|
+
collectionPath: `users/${userId}/requests`
|
|
3349
|
+
});
|
|
3350
|
+
throw error;
|
|
3351
|
+
}
|
|
3313
3352
|
}
|
|
3314
3353
|
/**
|
|
3315
3354
|
* Validate and retrieve a confirmation request
|
package/package.json
CHANGED
|
@@ -50,40 +50,84 @@ export class ConfirmationTokenService {
|
|
|
50
50
|
payload: any,
|
|
51
51
|
targetCollection?: string
|
|
52
52
|
): Promise<{ requestId: string; token: string }> {
|
|
53
|
-
|
|
53
|
+
try {
|
|
54
|
+
const token = randomUUID();
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
const now = new Date();
|
|
57
|
+
const expiresAt = new Date(now.getTime() + this.EXPIRY_MINUTES * 60 * 1000);
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
const request: ConfirmationRequest = {
|
|
60
|
+
user_id: userId,
|
|
61
|
+
token,
|
|
62
|
+
action,
|
|
63
|
+
target_collection: targetCollection,
|
|
64
|
+
payload,
|
|
65
|
+
created_at: now.toISOString(),
|
|
66
|
+
expires_at: expiresAt.toISOString(),
|
|
67
|
+
status: 'pending',
|
|
68
|
+
};
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
// Add document to Firestore (auto-generates ID)
|
|
71
|
+
const collectionPath = `users/${userId}/requests`;
|
|
72
|
+
console.log('[ConfirmationTokenService] Creating request:', {
|
|
73
|
+
userId,
|
|
74
|
+
action,
|
|
75
|
+
targetCollection,
|
|
76
|
+
collectionPath,
|
|
77
|
+
requestData: {
|
|
78
|
+
token,
|
|
79
|
+
action,
|
|
80
|
+
payloadKeys: Object.keys(payload),
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
console.log('[ConfirmationTokenService] Calling addDocument...');
|
|
85
|
+
const docRef = await addDocument(collectionPath, request);
|
|
86
|
+
console.log('[ConfirmationTokenService] addDocument returned:', {
|
|
87
|
+
hasDocRef: !!docRef,
|
|
88
|
+
hasId: !!docRef?.id,
|
|
89
|
+
docRefId: docRef?.id,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Validate docRef
|
|
93
|
+
if (!docRef) {
|
|
94
|
+
const error = new Error('Firestore addDocument returned null/undefined');
|
|
95
|
+
console.error('[ConfirmationTokenService] CRITICAL: addDocument returned null', {
|
|
96
|
+
userId,
|
|
97
|
+
collectionPath,
|
|
98
|
+
});
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!docRef.id) {
|
|
103
|
+
const error = new Error('Firestore addDocument returned docRef without ID');
|
|
104
|
+
console.error('[ConfirmationTokenService] CRITICAL: docRef has no ID', {
|
|
105
|
+
userId,
|
|
106
|
+
collectionPath,
|
|
107
|
+
docRef,
|
|
108
|
+
});
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
console.log('[ConfirmationTokenService] Request created successfully:', {
|
|
113
|
+
requestId: docRef.id,
|
|
114
|
+
token,
|
|
115
|
+
expiresAt: request.expires_at,
|
|
116
|
+
});
|
|
85
117
|
|
|
86
|
-
|
|
118
|
+
return { requestId: docRef.id, token };
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.error('[ConfirmationTokenService] FAILED to create request:', {
|
|
121
|
+
error: error instanceof Error ? error.message : String(error),
|
|
122
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
123
|
+
userId,
|
|
124
|
+
action,
|
|
125
|
+
collectionPath: `users/${userId}/requests`,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// Re-throw so caller (tool handler) can catch and return error response
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
87
131
|
}
|
|
88
132
|
|
|
89
133
|
/**
|