@seanyao/roll 2026.507.1 → 2026.507.3
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/bin/roll +35 -2
- package/package.json +1 -1
package/bin/roll
CHANGED
|
@@ -4,7 +4,7 @@ set -euo pipefail
|
|
|
4
4
|
# Roll — AI Agent Convention Manager
|
|
5
5
|
# Single source of truth for how all AI coding agents behave.
|
|
6
6
|
|
|
7
|
-
VERSION="2026.507.
|
|
7
|
+
VERSION="2026.507.3"
|
|
8
8
|
ROLL_HOME="${ROLL_HOME:-${HOME}/.roll}"
|
|
9
9
|
ROLL_CONFIG="${ROLL_HOME}/config.yaml"
|
|
10
10
|
ROLL_GLOBAL="${ROLL_HOME}/conventions/global"
|
|
@@ -49,13 +49,15 @@ canonical_dir() {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
# Return a human-readable name for an AI tool dir.
|
|
52
|
-
# Handles nested paths like ~/.openclaw/workspace → "openclaw".
|
|
52
|
+
# Handles nested paths like ~/.openclaw/workspace → "openclaw", ~/.pi/agent → "pi".
|
|
53
53
|
ai_tool_name() {
|
|
54
54
|
local dir="$1"
|
|
55
55
|
local bn
|
|
56
56
|
bn="$(basename "$dir" | sed 's/^\.//')"
|
|
57
57
|
if [[ "$bn" == "workspace" ]]; then
|
|
58
58
|
bn="$(basename "$(dirname "$dir")" | sed 's/^\.//')"
|
|
59
|
+
elif [[ "$bn" == "agent" || "$bn" == "workspace" ]]; then
|
|
60
|
+
bn="$(basename "$(dirname "$dir")" | sed 's/^\.//')"
|
|
59
61
|
fi
|
|
60
62
|
echo "$bn"
|
|
61
63
|
}
|
|
@@ -83,6 +85,11 @@ _is_ai_installed() {
|
|
|
83
85
|
[[ -x "$HOME/.opencode/bin/opencode" ]]
|
|
84
86
|
return
|
|
85
87
|
;;
|
|
88
|
+
agent)
|
|
89
|
+
if [[ "$(basename "$(dirname "$ai_dir")")" == ".pi" ]]; then
|
|
90
|
+
command -v pi &>/dev/null && return
|
|
91
|
+
fi
|
|
92
|
+
;;
|
|
86
93
|
esac
|
|
87
94
|
return 1
|
|
88
95
|
}
|
|
@@ -124,6 +131,8 @@ _ensure_config_entries() {
|
|
|
124
131
|
"ai_trae:~/.trae|user_rules.md|project_rules.md"
|
|
125
132
|
"ai_opencode:~/.config/opencode|AGENTS.md|AGENTS.md"
|
|
126
133
|
"ai_openclaw:~/.openclaw/workspace|AGENTS.md|AGENTS.md"
|
|
134
|
+
"ai_pi:~/.pi/agent|AGENTS.md|AGENTS.md"
|
|
135
|
+
"ai_deepseek:~/.deepseek|AGENTS.md|AGENTS.md"
|
|
127
136
|
)
|
|
128
137
|
|
|
129
138
|
local added=0
|
|
@@ -336,6 +345,8 @@ ai_cursor: ~/.cursor|.cursor-rules|.cursor-rules
|
|
|
336
345
|
ai_trae: ~/.trae|user_rules.md|project_rules.md
|
|
337
346
|
ai_opencode: ~/.config/opencode|AGENTS.md|AGENTS.md
|
|
338
347
|
ai_openclaw: ~/.openclaw/workspace|AGENTS.md|AGENTS.md
|
|
348
|
+
ai_pi: ~/.pi/agent|AGENTS.md|AGENTS.md
|
|
349
|
+
ai_deepseek: ~/.deepseek|AGENTS.md|AGENTS.md
|
|
339
350
|
|
|
340
351
|
# User preferences
|
|
341
352
|
default_language: zh
|
|
@@ -540,6 +551,26 @@ cmd_setup() {
|
|
|
540
551
|
# Thin wrapper: upgrade the npm-installed package, then re-sync via setup.
|
|
541
552
|
# Equivalent to: npm install -g @seanyao/roll@latest && roll setup
|
|
542
553
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
554
|
+
_check_installed_version_or_retry() {
|
|
555
|
+
local expected installed pkg_dir
|
|
556
|
+
expected="$(npm view @seanyao/roll version 2>/dev/null || true)"
|
|
557
|
+
pkg_dir="$(npm root -g 2>/dev/null || true)"
|
|
558
|
+
installed="$(grep "^VERSION=" "${pkg_dir}/@seanyao/roll/bin/roll" 2>/dev/null | sed 's/VERSION="\([^"]*\)"/\1/' || true)"
|
|
559
|
+
|
|
560
|
+
[[ -z "$expected" || -z "$installed" ]] && return 0
|
|
561
|
+
|
|
562
|
+
if [[ "$installed" != "$expected" ]]; then
|
|
563
|
+
warn "Version mismatch: installed ${installed}, expected ${expected} — CDN propagation lag, clearing cache and retrying... 版本不一致(已安装 ${installed},期望 ${expected}),疑似 CDN 未同步,清理缓存后重试..."
|
|
564
|
+
npm cache clean --force &>/dev/null || true
|
|
565
|
+
npm install -g @seanyao/roll@latest &>/dev/null || true
|
|
566
|
+
local after
|
|
567
|
+
after="$(grep "^VERSION=" "${pkg_dir}/@seanyao/roll/bin/roll" 2>/dev/null | sed 's/VERSION="\([^"]*\)"/\1/' || true)"
|
|
568
|
+
if [[ -n "$after" && "$after" != "$expected" ]]; then
|
|
569
|
+
warn "Still on ${after} after retry — registry may not have propagated yet, try again in a minute. 重试后仍为 ${after},注册表可能尚未同步,请稍后再试。"
|
|
570
|
+
fi
|
|
571
|
+
fi
|
|
572
|
+
}
|
|
573
|
+
|
|
543
574
|
cmd_update() {
|
|
544
575
|
info "Current version: roll v${VERSION} 当前版本: roll v${VERSION}"
|
|
545
576
|
info "Upgrading via npm... 正在通过 npm 升级..."
|
|
@@ -550,6 +581,8 @@ cmd_update() {
|
|
|
550
581
|
exit 1
|
|
551
582
|
fi
|
|
552
583
|
|
|
584
|
+
_check_installed_version_or_retry
|
|
585
|
+
|
|
553
586
|
echo ""
|
|
554
587
|
info "Re-syncing to AI tools... 正在重新同步到 AI 工具..."
|
|
555
588
|
echo ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanyao/roll",
|
|
3
|
-
"version": "2026.507.
|
|
3
|
+
"version": "2026.507.3",
|
|
4
4
|
"description": "Roll — Roll out features with AI agents",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "find tests/unit tests/integration -name '*.bats' | sort | xargs ./tests/helpers/bats-core/bin/bats"
|