sticky-note-cli 3.1.4 → 3.1.6
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 +27 -9
- package/package.json +2 -2
- package/templates/gitignore-additions.txt +1 -0
package/bin/cli.js
CHANGED
|
@@ -673,7 +673,7 @@ async function cmdInit() {
|
|
|
673
673
|
|
|
674
674
|
if (!cloudResult) {
|
|
675
675
|
// installed — now authenticate (opens browser, runs interactively)
|
|
676
|
-
// stdin is piped with "
|
|
676
|
+
// stdin is piped with "y\n" to auto-accept wrangler's post-login
|
|
677
677
|
// "install Cloudflare skills?" prompt, which can't be answered inside
|
|
678
678
|
// Claude Code's session. stdout/stderr are inherited so the browser
|
|
679
679
|
// URL and success message still appear in the terminal.
|
|
@@ -681,7 +681,7 @@ async function cmdInit() {
|
|
|
681
681
|
try {
|
|
682
682
|
execSync("wrangler login", {
|
|
683
683
|
stdio: ["pipe", "inherit", "inherit"],
|
|
684
|
-
input: "
|
|
684
|
+
input: "y\n",
|
|
685
685
|
encoding: "utf-8",
|
|
686
686
|
});
|
|
687
687
|
print("\n [OK] Logged in to Cloudflare");
|
|
@@ -2952,25 +2952,43 @@ function provisionCloudBackend() {
|
|
|
2952
2952
|
return { error: "sticky-server/worker.js not found. Make sure you have the full sticky-note package." };
|
|
2953
2953
|
}
|
|
2954
2954
|
|
|
2955
|
-
// Step 1: KV namespace
|
|
2955
|
+
// Step 1: KV namespace — create or reuse existing
|
|
2956
2956
|
print(" Step 1: Creating KV namespace...");
|
|
2957
|
-
let
|
|
2957
|
+
let namespaceId = null;
|
|
2958
2958
|
try {
|
|
2959
|
-
kvResult = execSync("wrangler kv
|
|
2959
|
+
const kvResult = execSync("wrangler kv namespace create STICKY_KV", {
|
|
2960
2960
|
cwd: serverDir,
|
|
2961
2961
|
encoding: "utf-8",
|
|
2962
2962
|
stdio: ["pipe", "pipe", "pipe"],
|
|
2963
2963
|
});
|
|
2964
|
+
const idMatch = kvResult.match(/id\s*=\s*"([^"]+)"/);
|
|
2965
|
+
if (idMatch) namespaceId = idMatch[1];
|
|
2964
2966
|
print(" [OK] KV namespace created");
|
|
2965
2967
|
} catch (err) {
|
|
2966
|
-
|
|
2968
|
+
if (err.message && err.message.includes("already exists")) {
|
|
2969
|
+
// Reuse the existing namespace
|
|
2970
|
+
print(" [OK] KV namespace already exists — retrieving ID...");
|
|
2971
|
+
try {
|
|
2972
|
+
const listResult = execSync("wrangler kv namespace list", {
|
|
2973
|
+
cwd: serverDir,
|
|
2974
|
+
encoding: "utf-8",
|
|
2975
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
2976
|
+
});
|
|
2977
|
+
const namespaces = JSON.parse(listResult);
|
|
2978
|
+
const existing = namespaces.find(ns => ns.title === "STICKY_KV");
|
|
2979
|
+
if (existing) namespaceId = existing.id;
|
|
2980
|
+
} catch (listErr) {
|
|
2981
|
+
return { error: "KV namespace exists but could not retrieve ID: " + (listErr.message || listErr) };
|
|
2982
|
+
}
|
|
2983
|
+
} else {
|
|
2984
|
+
return { error: "Failed to create KV namespace: " + (err.message || err) + "\n Make sure you're logged in: wrangler login" };
|
|
2985
|
+
}
|
|
2967
2986
|
}
|
|
2968
2987
|
|
|
2969
|
-
|
|
2970
|
-
if (idMatch) {
|
|
2988
|
+
if (namespaceId) {
|
|
2971
2989
|
const tomlPath = path.join(serverDir, "wrangler.toml");
|
|
2972
2990
|
let toml = fs.readFileSync(tomlPath, "utf-8");
|
|
2973
|
-
toml = toml.replace("PLACEHOLDER_KV_NAMESPACE_ID",
|
|
2991
|
+
toml = toml.replace("PLACEHOLDER_KV_NAMESPACE_ID", namespaceId);
|
|
2974
2992
|
fs.writeFileSync(tomlPath, toml);
|
|
2975
2993
|
print(" [OK] wrangler.toml updated with namespace ID");
|
|
2976
2994
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sticky-note-cli",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "Human-to-human handoff for AI coding assistants. Git-backed shared memory for Claude Code and Copilot CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"test": "node test/smoke.test.js"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"sticky-note-cli": "^3.1.
|
|
37
|
+
"sticky-note-cli": "^3.1.5"
|
|
38
38
|
}
|
|
39
39
|
}
|