cortex-sync 0.4.4 → 0.4.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.
Files changed (2) hide show
  1. package/dist/cli.js +21 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1343,7 +1343,6 @@ Make sure Claude Code CLI is installed and "claude" is in your PATH.`
1343
1343
  // src/commands/team/init.ts
1344
1344
  import { input as input3, confirm as confirm3, select as select2, password as password5 } from "@inquirer/prompts";
1345
1345
  import { writeFile as writeFile12, mkdir as mkdir11 } from "fs/promises";
1346
- import { randomUUID } from "crypto";
1347
1346
  import { join as join17 } from "path";
1348
1347
 
1349
1348
  // src/lib/team-repo.ts
@@ -1646,7 +1645,7 @@ Cloning ${repoUrl} \u2192 ~/.cortex/team/`);
1646
1645
  derived = deriveKey(teamPassphrase, repoUrl);
1647
1646
  }
1648
1647
  if (!identifyProject(process.cwd())) {
1649
- await writeProjectConfig({ projectId: randomUUID() });
1648
+ await writeProjectConfig({ projectId: repoUrl });
1650
1649
  }
1651
1650
  const count = await pushSessions(config.email, process.cwd(), derived);
1652
1651
  if (count > 0) {
@@ -1690,6 +1689,9 @@ async function teamPushCommand() {
1690
1689
  "utf-8"
1691
1690
  );
1692
1691
  if (shareSession) {
1692
+ if (!identifyProject(process.cwd())) {
1693
+ await writeProjectConfig({ projectId: repoUrl });
1694
+ }
1693
1695
  let derived;
1694
1696
  if (encryptSessions) {
1695
1697
  const teamPassphrase = await password6({
@@ -1835,6 +1837,7 @@ async function teamPullCommand() {
1835
1837
  // src/commands/install.ts
1836
1838
  import { readFile as readFile15 } from "fs/promises";
1837
1839
  import { join as join20 } from "path";
1840
+ import { password as password8 } from "@inquirer/prompts";
1838
1841
  async function installCommand(opts) {
1839
1842
  let config;
1840
1843
  try {
@@ -1873,8 +1876,22 @@ async function installCommand(opts) {
1873
1876
  console.warn(` \u26A0 Could not install ${pluginId}: ${e.message}`);
1874
1877
  }
1875
1878
  }
1876
- await writeProjectConfig({ repo: repoUrl });
1877
- console.log("\n\u2713 Team context installed. Restart Claude Code to activate new skills and plugins.");
1879
+ await writeProjectConfig({ repo: repoUrl, projectId: repoUrl });
1880
+ let derived;
1881
+ const { encryptSessions } = await readProjectConfig();
1882
+ if (encryptSessions) {
1883
+ const teamPassphrase = await password8({
1884
+ message: "Team passphrase (to decrypt sessions):",
1885
+ mask: "*",
1886
+ validate: (v) => v.length >= 12 || "Minimum 12 characters"
1887
+ });
1888
+ derived = deriveKey(teamPassphrase, repoUrl);
1889
+ }
1890
+ const sessionCount = await pullSessions(process.cwd(), derived);
1891
+ if (sessionCount > 0) {
1892
+ console.log(` + ${sessionCount} sessions installed`);
1893
+ }
1894
+ console.log("\n\u2713 Team context installed. Restart Claude Code to activate.");
1878
1895
  }
1879
1896
 
1880
1897
  // src/cli.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortex-sync",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Sync Claude Code sessions between machines with automatic path remapping and skill conversion",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",