ccprofiles-core 0.1.0 → 0.1.1
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/dist/bundle.js +2 -2
- package/dist/rcblock.js +2 -2
- package/dist/syncclient.js +1 -1
- package/dist/syncserver.js +2 -2
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -8,9 +8,9 @@ export function importBundle(buf) {
|
|
|
8
8
|
parsed = JSON.parse(gunzipSync(buf).toString('utf8'));
|
|
9
9
|
}
|
|
10
10
|
catch {
|
|
11
|
-
throw new Error('not a ccprofiles bundle (expected a file created by:
|
|
11
|
+
throw new Error('not a ccprofiles bundle (expected a file created by: ccprofiles export)');
|
|
12
12
|
}
|
|
13
13
|
if (parsed?.v !== 1 || typeof parsed.manifestYaml !== 'string')
|
|
14
|
-
throw new Error('not a ccprofiles bundle (expected a file created by:
|
|
14
|
+
throw new Error('not a ccprofiles bundle (expected a file created by: ccprofiles export)');
|
|
15
15
|
return parsed;
|
|
16
16
|
}
|
package/dist/rcblock.js
CHANGED
|
@@ -20,7 +20,7 @@ function renderPosix(pr, p) {
|
|
|
20
20
|
const lines = [`${pr.launcher}() {`];
|
|
21
21
|
for (const [k, v] of Object.entries(pr.env)) {
|
|
22
22
|
lines.push(v.startsWith(SECRET_PREFIX)
|
|
23
|
-
? ` export ${k}="$(
|
|
23
|
+
? ` export ${k}="$(ccprofiles secrets get ${v.slice(SECRET_PREFIX.length)})"`
|
|
24
24
|
: ` export ${k}="${escapePosix(v)}"`);
|
|
25
25
|
}
|
|
26
26
|
lines.push(` CLAUDE_CONFIG_DIR="${profileDirExpr(pr, p)}" claude "$@"`, '}');
|
|
@@ -30,7 +30,7 @@ function renderPwsh(pr, p) {
|
|
|
30
30
|
const lines = [`function ${pr.launcher} {`];
|
|
31
31
|
for (const [k, v] of Object.entries(pr.env)) {
|
|
32
32
|
lines.push(v.startsWith(SECRET_PREFIX)
|
|
33
|
-
? ` $env:${k} = (
|
|
33
|
+
? ` $env:${k} = (ccprofiles secrets get ${v.slice(SECRET_PREFIX.length)})`
|
|
34
34
|
: ` $env:${k} = "${escapePwsh(v)}"`);
|
|
35
35
|
}
|
|
36
36
|
lines.push(` $env:CLAUDE_CONFIG_DIR = "${profileDirExpr(pr, p)}"`, ' claude @args', '}');
|
package/dist/syncclient.js
CHANGED
|
@@ -9,7 +9,7 @@ async function post(host, port, path, payload) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
catch {
|
|
12
|
-
throw new Error(`cannot reach ${host}:${port} — is \`
|
|
12
|
+
throw new Error(`cannot reach ${host}:${port} — is \`ccprofiles serve\` running on the other device?`);
|
|
13
13
|
}
|
|
14
14
|
const data = await res.json();
|
|
15
15
|
if (!res.ok)
|
package/dist/syncserver.js
CHANGED
|
@@ -46,7 +46,7 @@ export async function startSyncServer(deps) {
|
|
|
46
46
|
return send(res, 400, { error: 'invalid request body' });
|
|
47
47
|
if (req.url === '/pair') {
|
|
48
48
|
if (locked)
|
|
49
|
-
return send(res, 429, { error: 'pairing locked after too many failed attempts — restart
|
|
49
|
+
return send(res, 429, { error: 'pairing locked after too many failed attempts — restart ccprofiles serve' });
|
|
50
50
|
const { privateKey, publicRaw } = handshakeKeys();
|
|
51
51
|
const salt = newSalt();
|
|
52
52
|
const key = deriveSharedKey(privateKey, payload.clientPub, salt);
|
|
@@ -56,7 +56,7 @@ export async function startSyncServer(deps) {
|
|
|
56
56
|
}
|
|
57
57
|
if (req.url === '/pair/confirm') {
|
|
58
58
|
if (locked)
|
|
59
|
-
return send(res, 429, { error: 'pairing locked after too many failed attempts — restart
|
|
59
|
+
return send(res, 429, { error: 'pairing locked after too many failed attempts — restart ccprofiles serve' });
|
|
60
60
|
const pending = typeof payload.handshakeId === 'string' ? handshakes.get(payload.handshakeId) : undefined;
|
|
61
61
|
if (!pending)
|
|
62
62
|
return send(res, 400, { error: 'no pending handshake (call /pair first)' });
|
package/package.json
CHANGED