@rely-ai/caliber 1.31.0-dev.1774714653 → 1.31.0-dev.1774714792
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/bin.js +106 -72
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -499,102 +499,136 @@ User: "never use any in TypeScript, use unknown instead"
|
|
|
499
499
|
`;
|
|
500
500
|
}
|
|
501
501
|
function getSetupCaliberContent() {
|
|
502
|
-
const bin = resolveCaliber();
|
|
503
502
|
return `# Setup Caliber
|
|
504
503
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
504
|
+
Dynamic onboarding for Caliber \u2014 automatic AI agent context sync.
|
|
505
|
+
Run all diagnostic steps below on every invocation to determine what's already
|
|
506
|
+
set up and what still needs to be done.
|
|
508
507
|
|
|
509
508
|
## Instructions
|
|
510
509
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "hook-active" || echo "no-hook"
|
|
514
|
-
\`\`\`
|
|
515
|
-
|
|
516
|
-
2. If **hook-active**, tell the user: "Caliber is already set up on this repo.
|
|
517
|
-
Your agent configs update automatically on every commit." Then stop.
|
|
510
|
+
Run these checks in order. For each step, check the current state first,
|
|
511
|
+
then only act if something is missing.
|
|
518
512
|
|
|
519
|
-
|
|
520
|
-
or for your team?"
|
|
513
|
+
### Step 1: Check if Caliber is installed
|
|
521
514
|
|
|
522
|
-
|
|
515
|
+
\`\`\`bash
|
|
516
|
+
command -v caliber >/dev/null 2>&1 && caliber --version || echo "NOT_INSTALLED"
|
|
517
|
+
\`\`\`
|
|
523
518
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
519
|
+
- If a version prints \u2192 Caliber is installed. Move to Step 2.
|
|
520
|
+
- If NOT_INSTALLED \u2192 Tell the user: "Caliber isn't installed yet. I'll install it now."
|
|
521
|
+
Then run:
|
|
522
|
+
\`\`\`bash
|
|
523
|
+
npm install -g @rely-ai/caliber
|
|
524
|
+
\`\`\`
|
|
525
|
+
If npm fails (permissions, no Node, etc.), try:
|
|
526
|
+
\`\`\`bash
|
|
527
|
+
npx @rely-ai/caliber --version
|
|
528
|
+
\`\`\`
|
|
529
|
+
If npx works, use \`npx @rely-ai/caliber\` as the command prefix for all subsequent steps.
|
|
530
|
+
If both fail, tell the user: "Caliber requires Node.js >= 20. Install Node first, then run /setup-caliber again."
|
|
531
|
+
|
|
532
|
+
### Step 2: Check if pre-commit hook is installed
|
|
535
533
|
|
|
536
|
-
|
|
534
|
+
\`\`\`bash
|
|
535
|
+
grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "HOOK_ACTIVE" || echo "NO_HOOK"
|
|
536
|
+
\`\`\`
|
|
537
537
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
\`\`\`
|
|
544
|
-
c. Run a refresh:
|
|
545
|
-
\`\`\`bash
|
|
546
|
-
${bin} refresh
|
|
547
|
-
\`\`\`
|
|
548
|
-
d. Create the GitHub Action workflow for nightly sync. Write this file to
|
|
549
|
-
\`.github/workflows/caliber-sync.yml\`:
|
|
550
|
-
\`\`\`yaml
|
|
551
|
-
name: Caliber Sync
|
|
552
|
-
on:
|
|
553
|
-
schedule:
|
|
554
|
-
- cron: '0 3 * * 1-5'
|
|
555
|
-
pull_request:
|
|
556
|
-
types: [opened, synchronize]
|
|
557
|
-
workflow_dispatch:
|
|
558
|
-
jobs:
|
|
559
|
-
sync:
|
|
560
|
-
runs-on: ubuntu-latest
|
|
561
|
-
steps:
|
|
562
|
-
- uses: actions/checkout@v4
|
|
563
|
-
- uses: caliber-ai-org/ai-setup@v1
|
|
564
|
-
with:
|
|
565
|
-
mode: sync
|
|
566
|
-
auto-refresh: true
|
|
567
|
-
comment: true
|
|
568
|
-
github-token: \${{ secrets.GITHUB_TOKEN }}
|
|
569
|
-
env:
|
|
570
|
-
ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
571
|
-
\`\`\`
|
|
572
|
-
e. Tell the user: "Created the GitHub Action workflow. Add your ANTHROPIC_API_KEY
|
|
573
|
-
to your repo secrets (Settings \u2192 Secrets \u2192 Actions), then commit and push this
|
|
574
|
-
workflow file. From now on, every PR gets a Caliber sync check and configs
|
|
575
|
-
refresh nightly."
|
|
576
|
-
f. Offer to commit the workflow file and the updated configs.
|
|
538
|
+
- If HOOK_ACTIVE \u2192 Tell the user: "Pre-commit hook is active \u2014 configs sync on every commit." Move to Step 3.
|
|
539
|
+
- If NO_HOOK \u2192 Tell the user: "I'll install the pre-commit hook so your agent configs sync automatically on every commit."
|
|
540
|
+
\`\`\`bash
|
|
541
|
+
caliber hooks --install
|
|
542
|
+
\`\`\`
|
|
577
543
|
|
|
578
|
-
###
|
|
544
|
+
### Step 3: Check if agent configs exist
|
|
579
545
|
|
|
580
|
-
Install it first:
|
|
581
546
|
\`\`\`bash
|
|
582
|
-
|
|
547
|
+
echo "CLAUDE_MD=$([ -f CLAUDE.md ] && echo exists || echo missing)"
|
|
548
|
+
echo "CURSOR_RULES=$([ -d .cursor/rules ] && ls .cursor/rules/*.mdc 2>/dev/null | wc -l | tr -d ' ' || echo 0)"
|
|
549
|
+
echo "AGENTS_MD=$([ -f AGENTS.md ] && echo exists || echo missing)"
|
|
583
550
|
\`\`\`
|
|
584
|
-
|
|
551
|
+
|
|
552
|
+
- If configs exist \u2192 Tell the user which configs are present. Move to Step 4.
|
|
553
|
+
- If configs are missing \u2192 Tell the user: "No agent configs found. I'll generate them now."
|
|
554
|
+
\`\`\`bash
|
|
555
|
+
caliber init --auto-approve
|
|
556
|
+
\`\`\`
|
|
557
|
+
This generates CLAUDE.md, Cursor rules, AGENTS.md, and skills for all detected agents.
|
|
558
|
+
|
|
559
|
+
### Step 4: Check if configs are fresh
|
|
560
|
+
|
|
585
561
|
\`\`\`bash
|
|
586
|
-
|
|
562
|
+
caliber score --json --quiet 2>/dev/null | head -1
|
|
563
|
+
\`\`\`
|
|
564
|
+
|
|
565
|
+
- If score is 80+ \u2192 Tell the user: "Your configs are in good shape (score: X/100)."
|
|
566
|
+
- If score is below 80 \u2192 Tell the user: "Your configs could be improved (score: X/100). Want me to run a refresh?"
|
|
567
|
+
If yes:
|
|
568
|
+
\`\`\`bash
|
|
569
|
+
caliber refresh
|
|
570
|
+
\`\`\`
|
|
571
|
+
|
|
572
|
+
### Step 5: Ask about team setup
|
|
573
|
+
|
|
574
|
+
Ask the user: "Are you setting up for yourself only, or for your team too?"
|
|
575
|
+
|
|
576
|
+
- If **solo** \u2192 Tell the user the summary (see below) and stop.
|
|
577
|
+
- If **team** \u2192 Check if the GitHub Action already exists:
|
|
578
|
+
\`\`\`bash
|
|
579
|
+
[ -f .github/workflows/caliber-sync.yml ] && echo "ACTION_EXISTS" || echo "NO_ACTION"
|
|
580
|
+
\`\`\`
|
|
581
|
+
- If ACTION_EXISTS \u2192 Tell the user: "GitHub Action is already configured."
|
|
582
|
+
- If NO_ACTION \u2192 Tell the user: "I'll create a GitHub Action that syncs configs nightly and on every PR."
|
|
583
|
+
Write this file to \`.github/workflows/caliber-sync.yml\`:
|
|
584
|
+
\`\`\`yaml
|
|
585
|
+
name: Caliber Sync
|
|
586
|
+
on:
|
|
587
|
+
schedule:
|
|
588
|
+
- cron: '0 3 * * 1-5'
|
|
589
|
+
pull_request:
|
|
590
|
+
types: [opened, synchronize]
|
|
591
|
+
workflow_dispatch:
|
|
592
|
+
jobs:
|
|
593
|
+
sync:
|
|
594
|
+
runs-on: ubuntu-latest
|
|
595
|
+
steps:
|
|
596
|
+
- uses: actions/checkout@v4
|
|
597
|
+
- uses: caliber-ai-org/ai-setup@v1
|
|
598
|
+
with:
|
|
599
|
+
mode: sync
|
|
600
|
+
auto-refresh: true
|
|
601
|
+
comment: true
|
|
602
|
+
github-token: \${{ secrets.GITHUB_TOKEN }}
|
|
603
|
+
env:
|
|
604
|
+
ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
605
|
+
\`\`\`
|
|
606
|
+
Tell the user: "Add your ANTHROPIC_API_KEY to repo secrets (Settings \u2192 Secrets \u2192 Actions), then commit and push."
|
|
607
|
+
|
|
608
|
+
### Summary
|
|
609
|
+
|
|
610
|
+
After completing all steps, show the user what's configured:
|
|
611
|
+
|
|
612
|
+
\`\`\`
|
|
613
|
+
Caliber Setup Complete:
|
|
614
|
+
\u2713 Caliber installed (vX.X.X)
|
|
615
|
+
\u2713 Pre-commit hook \u2014 configs sync on every commit
|
|
616
|
+
\u2713 Agent configs \u2014 CLAUDE.md, Cursor rules, AGENTS.md
|
|
617
|
+
\u2713 Config score: X/100
|
|
618
|
+
\u2713 GitHub Action \u2014 nightly sync + PR checks (team only)
|
|
619
|
+
|
|
620
|
+
From now on, every commit keeps all your agent configs in sync automatically.
|
|
587
621
|
\`\`\`
|
|
588
622
|
|
|
589
623
|
## When to trigger
|
|
590
624
|
|
|
591
|
-
- When a developer first opens this project
|
|
625
|
+
- When a developer first opens this project
|
|
592
626
|
- When the user asks about keeping agent configs up to date
|
|
593
627
|
- When the user asks "how do I set up Caliber" or "what is Caliber"
|
|
628
|
+
- When the user sees a message saying "Run /setup-caliber to get set up"
|
|
594
629
|
|
|
595
630
|
## When NOT to trigger
|
|
596
631
|
|
|
597
|
-
- Hooks are already installed and working
|
|
598
632
|
- The user is in the middle of time-sensitive work
|
|
599
633
|
`;
|
|
600
634
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rely-ai/caliber",
|
|
3
|
-
"version": "1.31.0-dev.
|
|
3
|
+
"version": "1.31.0-dev.1774714792",
|
|
4
4
|
"description": "AI context infrastructure for coding agents — keeps CLAUDE.md, Cursor rules, and skills in sync as your codebase evolves",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|