sticky-note-cli 3.1.35 → 3.1.37
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 +14 -2
- package/package.json +1 -1
- package/sticky-server/.claude/settings.json +3 -0
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite-shm +0 -0
- package/sticky-server/.wrangler/state/v3/observability/miniflare-wobs-trace-store/a590acd76969f996ec6e4b599c3c09f58c283a76f2d61392b5d3046caf557602.sqlite-wal +0 -0
- package/templates/hooks/session-end.js +8 -1
package/bin/cli.js
CHANGED
|
@@ -615,7 +615,19 @@ async function cmdInit() {
|
|
|
615
615
|
// Read existing sticky-note-config.json for teammate flow (cloud URL pre-set via git)
|
|
616
616
|
const existingConfigPath = path.join(process.cwd(), ".sticky-note", "sticky-note-config.json");
|
|
617
617
|
const existingConfig = readJsonSafe(existingConfigPath, {});
|
|
618
|
-
|
|
618
|
+
// Also check .env.sticky as fallback — handles case where URL was set locally but never
|
|
619
|
+
// committed to the config (e.g. set up via wrangler deploy rather than `init --v3`)
|
|
620
|
+
let envStickyUrlFallback = "";
|
|
621
|
+
try {
|
|
622
|
+
const envStickyRaw = fs.readFileSync(path.join(process.cwd(), ".env.sticky"), "utf-8");
|
|
623
|
+
for (const line of envStickyRaw.split(/\r?\n/)) {
|
|
624
|
+
if (line.trim().startsWith("STICKY_URL=")) {
|
|
625
|
+
envStickyUrlFallback = line.trim().slice("STICKY_URL=".length).trim();
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
} catch (_) { /* no .env.sticky yet */ }
|
|
630
|
+
const configStickyUrl = existingConfig.sticky_url || envStickyUrlFallback || "";
|
|
619
631
|
|
|
620
632
|
// Auto-detect MCP servers and skills
|
|
621
633
|
print(" Scanning for existing configuration...");
|
|
@@ -984,7 +996,7 @@ async function cmdInit() {
|
|
|
984
996
|
existing.inject_token_budget = injectTokenBudgetResolved;
|
|
985
997
|
existing.hook_version = VERSION;
|
|
986
998
|
existing.min_version = bumpMinVersion(existing.min_version, VERSION);
|
|
987
|
-
if (cloudProvisionedUrl) existing.sticky_url = cloudProvisionedUrl;
|
|
999
|
+
if (cloudProvisionedUrl || configStickyUrl) existing.sticky_url = cloudProvisionedUrl || configStickyUrl;
|
|
988
1000
|
// Enable auto_push when cloud is configured (if not already explicitly set)
|
|
989
1001
|
if ((cloudProvisionedUrl || configStickyUrl) && existing.auto_push === false) {
|
|
990
1002
|
existing.auto_push = true;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1012,7 +1012,14 @@ async function main() {
|
|
|
1012
1012
|
const memory = loadJson(memoryPath, { version: "2", project: "", threads: [] });
|
|
1013
1013
|
if (cloud) {
|
|
1014
1014
|
const cloudThreads = await cloudReadThreads();
|
|
1015
|
-
if (cloudThreads)
|
|
1015
|
+
if (cloudThreads) {
|
|
1016
|
+
// Merge: use cloud as the source of truth for shared threads, but preserve
|
|
1017
|
+
// any local-only threads (e.g. the "open" thread session-start just created
|
|
1018
|
+
// and saved locally but didn't push to cloud yet).
|
|
1019
|
+
const cloudIds = new Set(cloudThreads.map((t) => t && t.id).filter(Boolean));
|
|
1020
|
+
const localOnly = (memory.threads || []).filter((t) => t && !cloudIds.has(t.id));
|
|
1021
|
+
memory.threads = [...cloudThreads, ...localOnly];
|
|
1022
|
+
}
|
|
1016
1023
|
}
|
|
1017
1024
|
const config = loadJson(getConfigPath(), { stale_days: 14 });
|
|
1018
1025
|
const staleDays = config.stale_days || 14;
|