oathbound 0.2.0 → 0.3.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/cli.ts +20 -12
- package/package.json +1 -1
package/cli.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { join, relative, dirname } from 'node:path';
|
|
|
11
11
|
import { tmpdir, homedir, platform } from 'node:os';
|
|
12
12
|
import { intro, outro, select, cancel, isCancel } from '@clack/prompts';
|
|
13
13
|
|
|
14
|
-
const VERSION = '0.
|
|
14
|
+
const VERSION = '0.3.1';
|
|
15
15
|
|
|
16
16
|
// --- Supabase ---
|
|
17
17
|
const SUPABASE_URL = 'https://mjnfqagwuewhgwbtrdgs.supabase.co';
|
|
@@ -27,6 +27,8 @@ const DIM = USE_COLOR ? '\x1b[2m' : '';
|
|
|
27
27
|
const BOLD = USE_COLOR ? '\x1b[1m' : '';
|
|
28
28
|
const RESET = USE_COLOR ? '\x1b[0m' : '';
|
|
29
29
|
|
|
30
|
+
const BRAND = `${TEAL}${BOLD}🛡️ oathbound${RESET}`;
|
|
31
|
+
|
|
30
32
|
// --- Types ---
|
|
31
33
|
interface SkillRow {
|
|
32
34
|
name: string;
|
|
@@ -229,9 +231,11 @@ function getCacheDir(): string {
|
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
function getPlatformBinaryName(): string {
|
|
232
|
-
const
|
|
234
|
+
const p = platform();
|
|
235
|
+
const os = p === 'win32' ? 'windows' : p === 'darwin' ? 'darwin' : 'linux';
|
|
233
236
|
const arch = process.arch === 'arm64' ? 'arm64' : 'x64';
|
|
234
|
-
|
|
237
|
+
const ext = p === 'win32' ? '.exe' : '';
|
|
238
|
+
return `oathbound-${os}-${arch}${ext}`;
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
function printUpdateBox(current: string, latest: string): void {
|
|
@@ -391,7 +395,7 @@ export function mergeClaudeSettings(): MergeResult {
|
|
|
391
395
|
|
|
392
396
|
// --- Init command ---
|
|
393
397
|
async function init(): Promise<void> {
|
|
394
|
-
intro(
|
|
398
|
+
intro(BRAND);
|
|
395
399
|
|
|
396
400
|
const enforcement = await select({
|
|
397
401
|
message: 'Choose an enforcement level:',
|
|
@@ -435,7 +439,7 @@ async function init(): Promise<void> {
|
|
|
435
439
|
break;
|
|
436
440
|
}
|
|
437
441
|
|
|
438
|
-
outro(`${
|
|
442
|
+
outro(`${BRAND} ${TEAL}configured (${level})${RESET}`);
|
|
439
443
|
}
|
|
440
444
|
|
|
441
445
|
// --- Session state file ---
|
|
@@ -541,6 +545,8 @@ async function verify(): Promise<void> {
|
|
|
541
545
|
const rejected: { name: string; reason: string }[] = [];
|
|
542
546
|
const warnings: { name: string; reason: string }[] = [];
|
|
543
547
|
|
|
548
|
+
process.stderr.write(`${BRAND} ${TEAL}verifying skills...${RESET}\n`);
|
|
549
|
+
|
|
544
550
|
for (const [name, localHash] of Object.entries(localHashes)) {
|
|
545
551
|
const registryHash = registryHashes.get(name);
|
|
546
552
|
if (!registryHash) {
|
|
@@ -689,7 +695,7 @@ async function pull(skillArg: string): Promise<void> {
|
|
|
689
695
|
const { namespace, name } = parsed;
|
|
690
696
|
const fullName = `${namespace}/${name}`;
|
|
691
697
|
|
|
692
|
-
console.log(`\n${TEAL}
|
|
698
|
+
console.log(`\n${BRAND} ${TEAL}↓ Pulling ${fullName}...${RESET}`);
|
|
693
699
|
|
|
694
700
|
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
|
|
695
701
|
|
|
@@ -768,14 +774,16 @@ if (subcommand === '--help' || subcommand === '-h') {
|
|
|
768
774
|
usage(0);
|
|
769
775
|
}
|
|
770
776
|
|
|
771
|
-
if (subcommand === '--version' || subcommand === '-v') {
|
|
772
|
-
console.log(`oathbound ${VERSION}`);
|
|
773
|
-
process.exit(0);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
777
|
// Fire-and-forget auto-update on every command except verify (hooks must be fast)
|
|
777
778
|
if (subcommand !== 'verify') {
|
|
778
|
-
checkForUpdate().catch(() => {});
|
|
779
|
+
const updatePromise = checkForUpdate().catch(() => {});
|
|
780
|
+
|
|
781
|
+
if (subcommand === '--version' || subcommand === '-v') {
|
|
782
|
+
// Wait for update check so the user sees the notification
|
|
783
|
+
await updatePromise;
|
|
784
|
+
console.log(`oathbound ${VERSION}`);
|
|
785
|
+
process.exit(0);
|
|
786
|
+
}
|
|
779
787
|
}
|
|
780
788
|
|
|
781
789
|
if (subcommand === 'init') {
|