cortex-sync 0.4.8 → 0.4.10
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/README.md +3 -1
- package/dist/cli.js +20 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm install -g cortex-sync
|
|
|
10
10
|
|
|
11
11
|
Works on **Linux**, **macOS**, and **Windows**. The `cortex` command is available immediately after install — no shell restart needed.
|
|
12
12
|
|
|
13
|
-

|
|
13
|
+

|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -58,6 +58,8 @@ Open any project on Machine B — Claude Code shows your full session history.
|
|
|
58
58
|
|
|
59
59
|
Share skills, CLAUDE.md, plugins, and chat sessions with your whole team through a shared GitHub repo.
|
|
60
60
|
|
|
61
|
+

|
|
62
|
+
|
|
61
63
|
### Tech Lead — one-time setup
|
|
62
64
|
|
|
63
65
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -1572,19 +1572,19 @@ async function copySessionsFromRepo(sessionsRoot, projectId, destDir, localCwd,
|
|
|
1572
1572
|
}
|
|
1573
1573
|
return count;
|
|
1574
1574
|
}
|
|
1575
|
-
async function pushSessions(email, cwd, derived) {
|
|
1576
|
-
const
|
|
1577
|
-
if (!
|
|
1575
|
+
async function pushSessions(email, cwd, derived, projectId) {
|
|
1576
|
+
const id = projectId ?? identifyProject(cwd)?.projectId;
|
|
1577
|
+
if (!id) return 0;
|
|
1578
1578
|
const srcDir = localSessionsDir(cwd);
|
|
1579
|
-
const destDir = teamSessionsDir(TEAM_DIR, email,
|
|
1579
|
+
const destDir = teamSessionsDir(TEAM_DIR, email, id);
|
|
1580
1580
|
return copySessionsToTeamDir(srcDir, destDir, derived);
|
|
1581
1581
|
}
|
|
1582
|
-
async function pullSessions(cwd, derived) {
|
|
1583
|
-
const
|
|
1584
|
-
if (!
|
|
1582
|
+
async function pullSessions(cwd, derived, projectId) {
|
|
1583
|
+
const id = projectId ?? identifyProject(cwd)?.projectId;
|
|
1584
|
+
if (!id) return 0;
|
|
1585
1585
|
const sessionsRoot = join16(TEAM_DIR, "sessions");
|
|
1586
1586
|
const destDir = localSessionsDir(cwd);
|
|
1587
|
-
return copySessionsFromRepo(sessionsRoot,
|
|
1587
|
+
return copySessionsFromRepo(sessionsRoot, id, destDir, cwd, derived);
|
|
1588
1588
|
}
|
|
1589
1589
|
|
|
1590
1590
|
// src/commands/team/init.ts
|
|
@@ -1644,10 +1644,7 @@ Cloning ${repoUrl} \u2192 ~/.cortex/team/`);
|
|
|
1644
1644
|
});
|
|
1645
1645
|
derived = deriveKey(teamPassphrase, repoUrl);
|
|
1646
1646
|
}
|
|
1647
|
-
|
|
1648
|
-
await writeProjectConfig({ projectId: repoUrl });
|
|
1649
|
-
}
|
|
1650
|
-
const count = await pushSessions(config.email, process.cwd(), derived);
|
|
1647
|
+
const count = await pushSessions(config.email, process.cwd(), derived, repoUrl);
|
|
1651
1648
|
if (count > 0) {
|
|
1652
1649
|
commitAndPush(repoUrl, token, `feat: share ${count} team sessions`);
|
|
1653
1650
|
console.log(` Uploaded ${count} sessions`);
|
|
@@ -1689,9 +1686,6 @@ async function teamPushCommand() {
|
|
|
1689
1686
|
"utf-8"
|
|
1690
1687
|
);
|
|
1691
1688
|
if (shareSession) {
|
|
1692
|
-
if (!identifyProject(process.cwd())) {
|
|
1693
|
-
await writeProjectConfig({ projectId: repoUrl });
|
|
1694
|
-
}
|
|
1695
1689
|
let derived;
|
|
1696
1690
|
if (encryptSessions) {
|
|
1697
1691
|
const teamPassphrase = await password6({
|
|
@@ -1701,7 +1695,7 @@ async function teamPushCommand() {
|
|
|
1701
1695
|
});
|
|
1702
1696
|
derived = deriveKey(teamPassphrase, repoUrl);
|
|
1703
1697
|
}
|
|
1704
|
-
const count = await pushSessions(config.email, process.cwd(), derived);
|
|
1698
|
+
const count = await pushSessions(config.email, process.cwd(), derived, repoUrl);
|
|
1705
1699
|
if (count > 0) console.log(` Uploaded ${count} sessions`);
|
|
1706
1700
|
}
|
|
1707
1701
|
commitAndPush(repoUrl, token, "chore: update team Claude Code context");
|
|
@@ -1876,18 +1870,18 @@ async function installCommand(opts) {
|
|
|
1876
1870
|
console.warn(` \u26A0 Could not install ${pluginId}: ${e.message}`);
|
|
1877
1871
|
}
|
|
1878
1872
|
}
|
|
1879
|
-
await writeProjectConfig({ repo: repoUrl
|
|
1880
|
-
let
|
|
1881
|
-
|
|
1882
|
-
if (encryptSessions) {
|
|
1873
|
+
await writeProjectConfig({ repo: repoUrl });
|
|
1874
|
+
let sessionCount = await pullSessions(process.cwd(), void 0, repoUrl);
|
|
1875
|
+
if (sessionCount === 0) {
|
|
1883
1876
|
const teamPassphrase = await password8({
|
|
1884
|
-
message: "Team passphrase (
|
|
1885
|
-
mask: "*"
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1877
|
+
message: "Team passphrase (leave empty if sessions are not encrypted):",
|
|
1878
|
+
mask: "*"
|
|
1879
|
+
}).catch(() => "");
|
|
1880
|
+
if (teamPassphrase.length >= 12) {
|
|
1881
|
+
const derived = deriveKey(teamPassphrase, repoUrl);
|
|
1882
|
+
sessionCount = await pullSessions(process.cwd(), derived, repoUrl);
|
|
1883
|
+
}
|
|
1889
1884
|
}
|
|
1890
|
-
const sessionCount = await pullSessions(process.cwd(), derived);
|
|
1891
1885
|
if (sessionCount > 0) {
|
|
1892
1886
|
console.log(` + ${sessionCount} sessions installed`);
|
|
1893
1887
|
}
|