Skip to content

Commit 8b3aaff

Browse files
committed
chore: release v1.4.3 - update docs, fix regex panic, improve offline mode
1 parent 11f4ba7 commit 8b3aaff

File tree

13 files changed

+141
-57
lines changed

13 files changed

+141
-57
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ jobs:
5656
- name: Build Desktop App
5757
if: matrix.os == 'macos-latest'
5858
run: wails build -platform darwin/universal
59+
60+
- name: Check Version Consistency
61+
if: matrix.os == 'ubuntu-latest'
62+
run: |
63+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
64+
CODE_VERSION=$(grep 'const Version =' cmd/root.go | cut -d '"' -f 2)
65+
if [ "$TAG_VERSION" != "$CODE_VERSION" ]; then
66+
echo "Error: Tag version ($TAG_VERSION) does not match code version ($CODE_VERSION)"
67+
exit 1
68+
fi
5969
6070
- name: Build Desktop App
6171
if: matrix.os != 'macos-latest'

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [1.4.1] - 2026-02-02
5+
## [1.4.3] - 2026-02-03
6+
7+
### Added
8+
- **Documentation**: Added Antigravity Awesome Skills to optional repositories.
9+
- **Offline**: Improved offline mode to properly short-circuit network requests in SkillHub client.
10+
11+
### Changed
12+
- **Serve**: Changed default port to `8125` to match documentation and prevent automation regressions.
13+
- **Security**: Reduced false positives for HTTP links in security scanner (only warns for non-localhost/non-private IPs).
14+
15+
## [1.4.2] - 2026-02-03
616

717
### Fixed
818
- **Documentation**: Fixed incorrect release badge and download links in README.md and README_zh.md (was pointing to wrong repository).

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ vet:
3636
go vet ./...
3737

3838
lint:
39-
golangci-lint run
39+
golangci-lint run ./...
4040

4141
install:
4242
go install

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ For specific needs, you can add these additional sources:
189189
| **NotebookLM** | `ask repo add PleasePrompto/notebooklm-skill` | Auto-upload to NotebookLM |
190190
| **AI DrawIO** | `ask repo add GBSOSS/ai-drawio` | Flowchart & diagram generation |
191191
| **PPT Skills** | `ask repo add op7418/NanoBanana-PPT-Skills` | Dynamic PPT generation |
192+
| **Antigravity** | `ask repo add sickn33/antigravity-awesome-skills` | Collection of 600+ skills for Claude Code & Cursor |
192193

193194

194195
## 🏗️ Architecture & Layout

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ ASK 默认内置了以下受信源:
184184
| **NotebookLM** | `ask repo add PleasePrompto/notebooklm-skill` | 自动上传到NotebookLM |
185185
| **AI DrawIO** | `ask repo add GBSOSS/ai-drawio` | 流程图自动生成 |
186186
| **PPT Skills** | `ask repo add op7418/NanoBanana-PPT-Skills` | 动态PPT生成 |
187+
| **Antigravity** | `ask repo add sickn33/antigravity-awesome-skills` | 600+ 个 Claude Code & Cursor 智能体技能合集 |
187188

188189

189190
## 🏗️ 架构与布局

cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Codex, etc.) with a familiar CLI experience, just like Homebrew or npm.`,
6161
}
6262

6363
// Version is the current version of the application
64-
const Version = "1.4.2"
64+
const Version = "1.4.3"
6565

6666
// Top-level aliases (Docker-style)
6767
var installRootCmd = &cobra.Command{
@@ -160,6 +160,7 @@ func initConfig() {
160160
if vid := rootCmd.PersistentFlags().Lookup("offline"); vid != nil && vid.Changed {
161161
if val, _ := rootCmd.PersistentFlags().GetBool("offline"); val {
162162
github.SetOffline(true)
163+
config.SetOffline(true)
163164
}
164165
}
165166
if cfgFile != "" {

cmd/serve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ func runServe(_ *cobra.Command, args []string) {
111111
func init() {
112112
rootCmd.AddCommand(serveCmd)
113113

114-
serveCmd.Flags().IntVarP(&servePort, "port", "p", 8080, "Port to run the server on")
114+
serveCmd.Flags().IntVarP(&servePort, "port", "p", 8125, "Port to run the server on")
115115
serveCmd.Flags().BoolVar(&noOpen, "no-open", false, "Don't open browser automatically")
116116
}

internal/cache/repos.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ func (c *ReposCache) HasRepo(repoName string) bool {
6161
return err == nil
6262
}
6363

64+
// IsStale checks if a repository's cache is older than the ttl
65+
func (c *ReposCache) IsStale(repoName string, ttl time.Duration) bool {
66+
infos, err := c.LoadIndex()
67+
if err != nil {
68+
return true
69+
}
70+
for _, info := range infos {
71+
if info.Name == repoName {
72+
return time.Since(info.LastSyncedAt) > ttl
73+
}
74+
}
75+
return true
76+
}
77+
6478
// CloneOrPull clones a repo if not exists, or pulls if exists
6579
func (c *ReposCache) CloneOrPull(repoURL, repoName string) error {
6680
repoPath := filepath.Join(c.baseDir, sanitizeRepoName(repoName))

internal/config/config.go

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ import (
99
"gopkg.in/yaml.v3"
1010
)
1111

12+
// OfflineMode indicates if the application is running in offline mode
13+
var OfflineMode bool
14+
15+
// SetOffline sets the offline mode
16+
func SetOffline(offline bool) {
17+
OfflineMode = offline
18+
}
19+
1220
// Repo represents a skill repository
1321
type Repo struct {
1422
Name string `yaml:"name"`
@@ -36,30 +44,33 @@ func DefaultToolTargets() []ToolTarget {
3644
// Add DETECTED agents only, not all possible ones.
3745
// This prevents showing clutter like "clawdbot" when not applicable.
3846
// We use the current working directory to detect.
39-
if cwd, err := os.Getwd(); err == nil {
40-
41-
// DetectExistingToolDirs returns ToolTarget structs created from DefaultToolTargets logic which was cyclical.
42-
// We need a helper that creates targets from detected dirs WITHOUT calling DefaultToolTargets.
43-
// Let's implement detection logic directly here or fix DetectExistingToolDirs.
44-
45-
// Implementation of direct detection to avoid cycle:
46-
for _, name := range GetSupportedAgentNames() {
47-
if agentType, ok := ResolveAgentType(name); ok {
48-
config := SupportedAgents[agentType]
49-
// Check if project dir exists
50-
// config.ProjectDir is like ".claude/skills"
51-
// We check if ".claude" exists
52-
agentRootDir := filepath.Dir(config.ProjectDir)
53-
if agentRootDir == "." {
54-
agentRootDir = config.ProjectDir
55-
}
56-
if _, err := os.Stat(filepath.Join(cwd, agentRootDir)); err == nil {
57-
// Found!
58-
targets = append(targets, ToolTarget{
59-
Name: name,
60-
SkillsDir: config.ProjectDir,
61-
Enabled: true,
62-
})
47+
48+
if !OfflineMode {
49+
if cwd, err := os.Getwd(); err == nil {
50+
51+
// DetectExistingToolDirs returns ToolTarget structs created from DefaultToolTargets logic which was cyclical.
52+
// We need a helper that creates targets from detected dirs WITHOUT calling DefaultToolTargets.
53+
// Let's implement detection logic directly here or fix DetectExistingToolDirs.
54+
55+
// Implementation of direct detection to avoid cycle:
56+
for _, name := range GetSupportedAgentNames() {
57+
if agentType, ok := ResolveAgentType(name); ok {
58+
config := SupportedAgents[agentType]
59+
// Check if project dir exists
60+
// config.ProjectDir is like ".claude/skills"
61+
// We check if ".claude" exists
62+
agentRootDir := filepath.Dir(config.ProjectDir)
63+
if agentRootDir == "." {
64+
agentRootDir = config.ProjectDir
65+
}
66+
if _, err := os.Stat(filepath.Join(cwd, agentRootDir)); err == nil {
67+
// Found!
68+
targets = append(targets, ToolTarget{
69+
Name: name,
70+
SkillsDir: config.ProjectDir,
71+
Enabled: true,
72+
})
73+
}
6374
}
6475
}
6576
}

internal/installer/installer.go

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/yeasy/ask/internal/filesystem"
1414
"github.com/yeasy/ask/internal/git"
1515
"github.com/yeasy/ask/internal/github"
16+
"github.com/yeasy/ask/internal/repository"
1617
"github.com/yeasy/ask/internal/skill"
1718
"github.com/yeasy/ask/internal/skillhub"
1819
"github.com/yeasy/ask/internal/ui"
@@ -69,8 +70,37 @@ func Install(input string, opts InstallOptions) error {
6970
repoName := parts[0]
7071
skillNamePart := parts[1]
7172

72-
reposCache, err := cache.NewReposCache()
73-
if err == nil && reposCache.HasRepo(repoName) {
73+
reposCache, _ := cache.NewReposCache()
74+
if reposCache.HasRepo(repoName) {
75+
// Check for staleness (24 hours)
76+
// Only refresh if NOT in offline mode
77+
if !github.OfflineMode && reposCache.IsStale(repoName, 24*time.Hour) {
78+
ui.Debug(fmt.Sprintf("Repo '%s' is stale, refreshing...", repoName))
79+
// We need to fetch the repo URL from config to refresh
80+
var refreshURL string
81+
if opts.Config != nil {
82+
for _, r := range opts.Config.Repos {
83+
if r.Name == repoName {
84+
refreshURL = r.URL
85+
break
86+
}
87+
}
88+
}
89+
// If URL found, trigger fetch (which pulls/syncs)
90+
if refreshURL != "" {
91+
// Use repository package to fetch/sync
92+
// Note: We need to import "github.com/yeasy/ask/internal/repository" if not already imported
93+
// It is imported as "github.com/yeasy/ask/internal/repository"
94+
// But we need to construct a Repo struct
95+
refreshRepo := config.Repo{Name: repoName, URL: refreshURL, Type: "dir"} // Type guess, but FetchSkills handles both kinda?
96+
// Actually repository.FetchSkills takes a Repo.
97+
// Let's use it.
98+
_, _ = repository.FetchSkills(refreshRepo)
99+
// Re-load cache after sync
100+
reposCache, _ = cache.NewReposCache()
101+
}
102+
}
103+
74104
// Repo exists in cache, check if skill exists in it
75105
skills, err := reposCache.ListSkills(repoName)
76106
if err == nil {

0 commit comments

Comments
 (0)