sticky-note-cli 3.1.8 → 3.1.9
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/bin/cli.js +0 -1
- package/package.json +1 -1
- package/templates/hooks/session-end.js +31 -0
package/bin/cli.js
CHANGED
|
@@ -3014,7 +3014,6 @@ function provisionCloudBackend() {
|
|
|
3014
3014
|
print(" [OK] KV namespace created");
|
|
3015
3015
|
} catch (err) {
|
|
3016
3016
|
if (err.message && err.message.includes("already exists")) {
|
|
3017
|
-
// Reuse the existing namespace
|
|
3018
3017
|
print(" [OK] KV namespace already exists — retrieving ID...");
|
|
3019
3018
|
try {
|
|
3020
3019
|
const listResult = execSync("wrangler kv namespace list", {
|
package/package.json
CHANGED
|
@@ -68,6 +68,8 @@ const {
|
|
|
68
68
|
clearInjectedSet,
|
|
69
69
|
normalizeSep,
|
|
70
70
|
useCloud,
|
|
71
|
+
getCloudConfig,
|
|
72
|
+
getProjectName,
|
|
71
73
|
cloudReadThreads,
|
|
72
74
|
cloudWriteThread,
|
|
73
75
|
cloudDeletePresence,
|
|
@@ -1055,6 +1057,35 @@ async function main() {
|
|
|
1055
1057
|
);
|
|
1056
1058
|
if (transcriptCaptured) existing.transcript_captured = true;
|
|
1057
1059
|
|
|
1060
|
+
// Push transcript to cloud if configured
|
|
1061
|
+
if (transcriptCaptured && useCloud()) {
|
|
1062
|
+
try {
|
|
1063
|
+
const transcriptFile = getTranscriptPath(existing.id);
|
|
1064
|
+
if (fs.existsSync(transcriptFile)) {
|
|
1065
|
+
const lines = fs.readFileSync(transcriptFile, "utf-8")
|
|
1066
|
+
.split(/\r?\n/).filter(l => l.trim());
|
|
1067
|
+
const entry = lines
|
|
1068
|
+
.map(l => { try { return JSON.parse(l); } catch (_) { return null; } })
|
|
1069
|
+
.filter(Boolean)
|
|
1070
|
+
.find(e => e.session_id === sessionId);
|
|
1071
|
+
if (entry) {
|
|
1072
|
+
const { url: stickyUrl, apiKey: stickyApiKey } = getCloudConfig();
|
|
1073
|
+
const projectName = getProjectName();
|
|
1074
|
+
const headers = {
|
|
1075
|
+
"Content-Type": "application/json",
|
|
1076
|
+
"X-Sticky-Project": projectName,
|
|
1077
|
+
};
|
|
1078
|
+
if (stickyApiKey) headers["X-Sticky-API-Key"] = stickyApiKey;
|
|
1079
|
+
fetch(`${stickyUrl}/transcripts/${existing.id}`, {
|
|
1080
|
+
method: "POST",
|
|
1081
|
+
headers,
|
|
1082
|
+
body: JSON.stringify(entry),
|
|
1083
|
+
}).catch(() => {}); // non-fatal
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
} catch (_) {} // transcript cloud sync is non-fatal
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1058
1089
|
// V2.5: Capture commit SHAs for attribution engine
|
|
1059
1090
|
const commitShas = getSessionCommitShas();
|
|
1060
1091
|
|