-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagentversion.go
More file actions
52 lines (47 loc) · 2.41 KB
/
Copy pathagentversion.go
File metadata and controls
52 lines (47 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Package appx holds the single source of truth for which release of the
// appx-agent stack this appx build targets.
//
// appx consumes the agent stack only as published artifacts (see CLAUDE.md), and
// agent-server, agent-client and agent-protocol are versioned in lockstep by
// changesets — every appx-agent release bumps all three to the same number. So
// one version string pins the whole stack: the docker image appx supervises and
// the npm package its frontend bundles.
//
// That string lives in the AGENT_VERSION file rather than in this source file so
// the deploy shell scripts can read it too (they cannot import Go constants).
// This package embeds it, so the Go binary and the scripts cannot disagree.
//
// To move to a new agent release:
//
// 1. edit AGENT_VERSION
// 2. task agent:sync (rewrites web/package.json's range + the lockfile)
// 3. task test (fails if step 2 was skipped)
//
// The web/package.json range is the one copy that cannot be eliminated — npm
// resolves dependencies only from package.json — so
// TestAgentVersion_MatchesWebPackageJSON asserts it agrees with this file. Note
// that a bare `npm install` is NOT enough for step 2: it resolves within the
// existing caret range, so it would leave the frontend on the old version.
// `task agent:sync` uses `npm pkg set` to rewrite the range itself.
package appx
import (
_ "embed"
"strings"
)
// agentVersionFile is the raw contents of AGENT_VERSION, including its trailing
// newline. Embedding requires the file to sit beside this source file, which is
// why this package lives at the repo root: go:embed rejects parent-directory
// patterns like "../AGENT_VERSION".
//
//go:embed AGENT_VERSION
var agentVersionFile string
// AgentVersion is the pinned appx-agent release (e.g. "0.1.7"), shared by the
// agent-server image and the @appx-org/agent-client npm package.
var AgentVersion = strings.TrimSpace(agentVersionFile)
// AgentImageRepo is the public registry repository for the agent-server image.
// It is amd64-only, which is why container-mode deploys require an amd64 host.
const AgentImageRepo = "ghcr.io/appx-org/agent-server"
// AgentImage is the fully-qualified image reference appx pulls and supervises by
// default (e.g. "ghcr.io/appx-org/agent-server:0.1.7"). Deployments can override
// it with APPX_AGENT_IMAGE — a tag or a @sha256: digest — without editing code.
var AgentImage = AgentImageRepo + ":" + AgentVersion