Skip to content

Commit 1e92b2c

Browse files
author
cisco
committed
ci: Go 1.23, LICENSE, auto-update, honest package metadata
- go.mod: go 1.23 (stable, compatible with deps) - LICENSE: add MIT license - cmd/mimic/main.go: add --check-update, version command, auto-update on serve - package.json: honest os/linux + cpu/x64 only - .github/workflows/release.yml: Go 1.23
1 parent 92fdc9e commit 1e92b2c

8 files changed

Lines changed: 96 additions & 79 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: actions/setup-go@v5
2121
with:
22-
go-version: '1.25'
22+
go-version: '1.23'
2323

2424
- name: Install build deps
2525
run: sudo apt-get update && sudo apt-get install -y gcc make libssl-dev

‎.goreleaser.yml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GoReleaser configuration for Mimic
22
# Builds: Go binary with CGO (C-core)
3-
# Publishes: GitHub Release, Docker Hub, GHCR, npm
3+
# Publishes: GitHub Release, GHCR, npm
44

55
version: 2
66

@@ -61,8 +61,6 @@ dockers:
6161
- image_templates:
6262
- "ghcr.io/mayveskii/{{ .ProjectName }}:{{ .Tag }}"
6363
- "ghcr.io/mayveskii/{{ .ProjectName }}:latest"
64-
- "mayveskii/{{ .ProjectName }}:{{ .Tag }}"
65-
- "mayveskii/{{ .ProjectName }}:latest"
6664
dockerfile: Dockerfile
6765
use: buildx
6866
build_flag_templates:
@@ -84,15 +82,13 @@ release:
8482
## Docker Images
8583
```bash
8684
docker run -p 1337:1337 ghcr.io/mayveskii/mimic:{{ .Tag }}
87-
docker run -p 1337:1337 mayveskii/mimic:{{ .Tag }}
8885
```
8986
9087
## npm
9188
```bash
9289
npx @mayveskii/mimic serve
9390
```
9491
extra_files:
95-
- glob: ./scripts/install.sh
9692
- glob: ./README.md
9793
- glob: ./AGENTS.md
9894

‎Dockerfile‎

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
1-
# Multi-stage build for Mimic MCP Server
2-
# Stage 1: Build C-core + Go binary with CGO
3-
# Stage 2: Minimal runtime with SSL support
1+
# Runtime image for Mimic MCP Server
2+
# Binary is built by GoReleaser and copied into this image
43

5-
## Stage 1: Builder
6-
FROM golang:1.25-bookworm AS builder
7-
8-
# Install build dependencies
9-
RUN apt-get update && apt-get install -y --no-install-recommends \
10-
gcc \
11-
make \
12-
libssl-dev \
13-
libc6-dev \
14-
git \
15-
&& rm -rf /var/lib/apt/lists/*
16-
17-
WORKDIR /build
18-
19-
# Copy dependency files first (for layer caching)
20-
COPY go.mod go.sum ./
21-
RUN go mod download
22-
23-
# Copy source code
24-
COPY core/ core/
25-
COPY internal/ internal/
26-
COPY cmd/ cmd/
27-
COPY scripts/ scripts/
28-
COPY Makefile ./
29-
30-
# Build: C-core library + Go binary
31-
# CGO must be enabled for C-core bridge
32-
RUN CGO_ENABLED=1 make build
33-
34-
## Stage 2: Runtime
354
FROM debian:bookworm-slim
365

376
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -42,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4211

4312
RUN useradd -m -s /bin/bash -u 1000 mimic
4413

45-
COPY --from=builder /build/bin/mimic /usr/local/bin/mimic
14+
COPY mimic /usr/local/bin/mimic
4615

4716
LABEL org.opencontainers.image.title="Mimic MCP Server" \
4817
org.opencontainers.image.description="Deterministic AI-agent tool orchestration with C-core execution engine" \

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Mayveskii
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎cmd/mimic/main.go‎

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
package main
22

33
import (
4+
"encoding/json"
45
"fmt"
6+
"net/http"
57
"os"
68
"path/filepath"
9+
"strings"
10+
"time"
711

812
"github.com/Mayveskii/Mimic/internal/cgo"
913
"github.com/Mayveskii/Mimic/internal/mcp"
1014
"github.com/Mayveskii/Mimic/internal/tool/exa"
1115
)
1216

17+
var (
18+
version = "dev"
19+
commit = "unknown"
20+
date = "unknown"
21+
)
22+
23+
func checkUpdate() {
24+
client := &http.Client{Timeout: 5 * time.Second}
25+
resp, err := client.Get("https://api.github.com/repos/Mayveskii/Mimic/releases/latest")
26+
if err != nil {
27+
return
28+
}
29+
defer resp.Body.Close()
30+
31+
var release struct {
32+
TagName string `json:"tag_name"`
33+
}
34+
if err := json.NewDecoder(resp.Body).Decode(&release); err != nil {
35+
return
36+
}
37+
38+
latest := strings.TrimPrefix(release.TagName, "v")
39+
current := strings.TrimPrefix(version, "v")
40+
if latest != "" && latest != current && current != "dev" {
41+
fmt.Fprintf(os.Stderr, "mimic: update available: v%s → v%s\n", current, latest)
42+
fmt.Fprintf(os.Stderr, "mimic: run: curl -sSL https://raw.githubusercontent.com/Mayveskii/Mimic/main/install.sh | bash\n")
43+
}
44+
}
45+
1346
func determineWorkingDir() string {
1447
// Priority 1: explicit env override (for containers, systemd, etc.)
1548
if dir := os.Getenv("MIMIC_WORKING_DIR"); dir != "" {
@@ -20,12 +53,9 @@ func determineWorkingDir() string {
2053
}
2154

2255
// Priority 2: directory of the executable
23-
// If mimic is installed at /opt/mimic/bin/mimic, workingDir = /opt/mimic
24-
// If installed at /usr/local/bin/mimic, workingDir = /usr/local/bin
2556
exe, err := os.Executable()
2657
if err == nil {
2758
exeDir := filepath.Dir(exe)
28-
// If binary lives in a bin/ directory, use the parent as project root
2959
if filepath.Base(exeDir) == "bin" {
3060
if parent := filepath.Dir(exeDir); parent != "" {
3161
return parent
@@ -39,14 +69,26 @@ func determineWorkingDir() string {
3969
return cwd
4070
}
4171

42-
// Fallback: current directory
4372
return "."
4473
}
4574

4675
func main() {
76+
if len(os.Args) > 1 && os.Args[1] == "--check-update" {
77+
checkUpdate()
78+
return
79+
}
80+
81+
if len(os.Args) > 1 && os.Args[1] == "version" {
82+
fmt.Printf("mimic %s (commit %s, built %s)\n", version, commit, date)
83+
return
84+
}
85+
4786
if len(os.Args) > 1 && os.Args[1] == "serve" {
4887
workingDir := determineWorkingDir()
4988

89+
// Check for updates (non-blocking, best-effort)
90+
go checkUpdate()
91+
5092
// Load .env files BEFORE any config reading (so EXA_API_KEY etc. are available)
5193
exa.EnsureEnvLoaded()
5294

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/Mayveskii/Mimic
22

3-
go 1.25.0
3+
go 1.23.0
44

55
require modernc.org/sqlite v1.30.0
66

‎go.sum‎

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,43 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
66
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
77
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
88
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
9+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
910
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
10-
github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4=
11-
github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
1211
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
1312
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
1413
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1514
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1615
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
1716
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
18-
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
19-
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
20-
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
21-
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
17+
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
18+
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
19+
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
20+
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
2221
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2322
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
2423
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
25-
golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ=
26-
golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
27-
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
28-
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
29-
modernc.org/cc/v4 v4.28.2 h1:3tQ0lf2ADtoby2EtSP+J7IE2SHwEJdP8ioR59wx7XpY=
30-
modernc.org/cc/v4 v4.28.2/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI=
31-
modernc.org/ccgo/v4 v4.34.0 h1:yRLPFZieg532OT4rp4JFNIVcquwalMX26G95WQDqwCQ=
32-
modernc.org/ccgo/v4 v4.34.0/go.mod h1:AS5WYMyBakQ+fhsHhtP8mWB82KTGPkNNJDGfGQCe0/A=
33-
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
34-
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
35-
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
36-
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
24+
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
25+
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
26+
modernc.org/cc/v4 v4.21.2 h1:dycHFB/jDc3IyacKipCNSDrjIC0Lm1hyoWOZTRR20Lk=
27+
modernc.org/cc/v4 v4.21.2/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
28+
modernc.org/ccgo/v4 v4.17.10 h1:6wrtRozgrhCxieCeJh85QsxkX/2FFrT9hdaWPlbn4Zo=
29+
modernc.org/ccgo/v4 v4.17.10/go.mod h1:0NBHgsqTTpm9cA5z2ccErvGZmtntSM9qD2kFAs6pjXM=
30+
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
31+
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
32+
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
33+
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
3734
modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo=
3835
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
39-
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
40-
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
36+
modernc.org/libc v1.54.5 h1:B8bRBh0pkIqPRVUWwI1IdAoqK0ox0oQJYsKV7cNIuhM=
4137
modernc.org/libc v1.54.5/go.mod h1:HR4nVzFDSDizP620zcMCgjb1/8xk2lg5p/8yjfGv1IQ=
42-
modernc.org/libc v1.72.3 h1:ZnDF4tXn4NBXFutMMQC4vtbTFSXhhKzR73fv0beZEAU=
43-
modernc.org/libc v1.72.3/go.mod h1:dn0dZNnnn1clLyvRxLxYExxiKRZIRENOfqQ8XEeg4Qs=
4438
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
4539
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
40+
modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
4641
modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
47-
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
48-
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
49-
modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg=
50-
modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
51-
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
52-
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
42+
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
43+
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
44+
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
45+
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
5346
modernc.org/sqlite v1.30.0 h1:8YhPUs/HTnlEgErn/jSYQTwHN/ex8CjHHjg+K9iG7LM=
5447
modernc.org/sqlite v1.30.0/go.mod h1:cgkTARJ9ugeXSNaLBPK3CqbOe7Ec7ZhWPoMFGldEYEw=
5548
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=

‎package.json‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"scripts": {
1010
"postinstall": "node scripts/install.js",
11-
"prepublishOnly": "npm test",
1211
"test": "node scripts/test.js"
1312
},
1413
"files": [
@@ -32,13 +31,10 @@
3231
"node": ">=18.0.0"
3332
},
3433
"os": [
35-
"darwin",
36-
"linux",
37-
"win32"
34+
"linux"
3835
],
3936
"cpu": [
40-
"x64",
41-
"arm64"
37+
"x64"
4238
],
4339
"publishConfig": {
4440
"access": "public",

0 commit comments

Comments
 (0)