@synth1s/cloak 2.1.0 → 2.2.0

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.
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ open-pull-requests-limit: 5
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ node-version: [18, 20]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: ${{ matrix.node-version }}
20
+ - run: npm ci
21
+ - run: node --test tests/*.test.js
22
+
23
+ audit:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - uses: actions/setup-node@v4
28
+ with:
29
+ node-version: 20
30
+ - run: npm audit --audit-level=high
@@ -0,0 +1,40 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: write
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: 20
18
+ registry-url: https://registry.npmjs.org
19
+
20
+ - run: npm ci
21
+ - run: node --test tests/*.test.js
22
+
23
+ - name: Set version from release tag
24
+ run: |
25
+ VERSION="${GITHUB_REF_NAME#v}"
26
+ npm version "$VERSION" --no-git-tag-version
27
+ echo "Publishing version $VERSION"
28
+
29
+ - name: Publish to npm
30
+ run: npm publish --access public --provenance
31
+ env:
32
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33
+
34
+ - name: Commit version bump
35
+ run: |
36
+ git config user.name "github-actions[bot]"
37
+ git config user.email "github-actions[bot]@users.noreply.github.com"
38
+ git add package.json package-lock.json
39
+ git commit -m "chore: bump version to ${GITHUB_REF_NAME#v} [skip ci]" || true
40
+ git push origin HEAD:master
@@ -0,0 +1,48 @@
1
+ # Contributing to @synth1s/cloak
2
+
3
+ Thanks for your interest in contributing!
4
+
5
+ ## Development
6
+
7
+ ```bash
8
+ git clone https://github.com/synth1s/cloak.git
9
+ cd cloak
10
+ npm install
11
+ npm test
12
+ ```
13
+
14
+ ## Methodology
15
+
16
+ This project follows **strict TDD**. Every change must follow:
17
+
18
+ 1. Write the test first (it must fail)
19
+ 2. Implement the minimum code to make it pass
20
+ 3. Refactor if needed
21
+
22
+ ## Running tests
23
+
24
+ ```bash
25
+ npm test # run all tests
26
+ node --test tests/ # same thing
27
+ ```
28
+
29
+ Tests use `node:test` (native Node.js test runner). No external test frameworks.
30
+
31
+ ## Code style
32
+
33
+ - Node.js ESM (`type: "module"`)
34
+ - All user-facing strings in `src/lib/messages.js`
35
+ - All paths in `src/lib/paths.js`
36
+ - One file per command in `src/commands/`
37
+ - stderr for errors/warnings, stdout for data/success
38
+
39
+ ## Pull requests
40
+
41
+ - One feature or fix per PR
42
+ - Include tests for new behavior
43
+ - Update documentation if the change affects user-facing behavior
44
+ - Run `npm test` before submitting
45
+
46
+ ## Security
47
+
48
+ See [SECURITY.md](SECURITY.md) for reporting vulnerabilities.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @synth1s/cloak
2
2
 
3
+ [![CI](https://github.com/synth1s/cloak/actions/workflows/ci.yml/badge.svg)](https://github.com/synth1s/cloak/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/@synth1s/cloak)](https://www.npmjs.com/package/@synth1s/cloak)
5
+ [![license](https://img.shields.io/npm/l/@synth1s/cloak)](LICENSE)
6
+
3
7
  > Cloak your Claude. Switch identities in seconds.
4
8
 
5
9
  Every developer wears a different cloak. One for work, one for personal projects, one for that freelance gig. **Cloak** lets you dress your Claude Code in the right identity — and switch between them without breaking a sweat.
package/SECURITY.md ADDED
@@ -0,0 +1,31 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you discover a security vulnerability in @synth1s/cloak, please report it responsibly.
6
+
7
+ **Do NOT open a public issue.** Instead, email:
8
+
9
+ **cloak@synth1s.com.br**
10
+
11
+ Include:
12
+ - Description of the vulnerability
13
+ - Steps to reproduce
14
+ - Potential impact
15
+
16
+ You will receive a response within 48 hours. Once confirmed, a fix will be released as a patch version and credited in the changelog (unless you prefer anonymity).
17
+
18
+ ## Scope
19
+
20
+ This policy covers:
21
+ - The `@synth1s/cloak` npm package
22
+ - The shell integration code emitted by `cloak init`
23
+ - File operations on `~/.cloak/` and shell rc files
24
+
25
+ ## Security Measures
26
+
27
+ - Account names are validated against `^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$` to prevent path traversal
28
+ - Credential files are created with restrictive permissions (0o700 dirs, 0o600 files)
29
+ - Shell eval output is quoted to prevent injection
30
+ - OAuth tokens are never read, logged, or transmitted — only copied as files
31
+ - `.bashrc` modifications include a backup (`.cloak-backup`) and a marker comment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synth1s/cloak",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Cloak your Claude. Switch identities in seconds.",
5
5
  "type": "module",
6
6
  "bin": {