@getmonoceros/workbench 1.22.2 → 1.23.1

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.
@@ -35,7 +35,7 @@ options:
35
35
  description: "Optional Bitbucket app password; only needed for twg's Bitbucket commands."
36
36
  surface: env
37
37
  feature:
38
- version: 1.0.0
38
+ version: 1.1.0
39
39
  persistentHomePaths: [.config/acli, .rovodev, .config/twg, .agents]
40
40
  vscodeExtensions: [Atlassian.atlascode]
41
41
  briefing:
@@ -159,11 +159,23 @@ TWG_LOGIN_INPUT
159
159
 
160
160
  # (Re-)install twg's agent skills. Canonical install lands in
161
161
  # /home/node/.agents/skills/twg (persisted via the feature's
162
- # persistentHomePaths); per-agent wrapper scripts go into agent-
163
- # specific home dirs (.claude/skills/twg, .codex/skills/twg, …)
164
- # and are regenerated on each apply when those tools are present.
162
+ # persistentHomePaths); .agents/skills-native agents (codex, cursor,
163
+ # gemini, copilot, …) read it directly. Agents with their own skills
164
+ # dir (claude .claude/skills, opencode .opencode/skills) need an
165
+ # explicit --agent flag, so we detect which AI CLIs are present in this
166
+ # container and pass the matching flags. This keeps the atlassian
167
+ # feature decoupled from the container's feature list — it reacts to
168
+ # whatever is actually installed. Idempotent: re-running just refreshes
169
+ # the wrappers.
165
170
  echo "[atlassian/twg] (re-)installing twg skills"
166
- twg skills install --global --yes
171
+ TWG_SKILL_AGENTS=()
172
+ if command -v claude >/dev/null 2>&1; then
173
+ TWG_SKILL_AGENTS+=(--agent claude)
174
+ fi
175
+ if command -v opencode >/dev/null 2>&1; then
176
+ TWG_SKILL_AGENTS+=(--agent opencode)
177
+ fi
178
+ twg skills install --global --yes "\${TWG_SKILL_AGENTS[@]}"
167
179
  EOF
168
180
  chmod 0755 "${HOOK}"
169
181
  echo "[atlassian/twg] post-create login hook installed"
@@ -0,0 +1,37 @@
1
+ id: opencode
2
+ name: opencode
3
+ category: feature
4
+ displayName: OpenCode
5
+ description: "sst's open-source, provider-agnostic AI coding agent (TUI). Model + provider key configurable; auth and session state persist across container rebuilds."
6
+ documentationURL: https://opencode.ai/docs/
7
+ options:
8
+ version:
9
+ type: string
10
+ default: latest
11
+ description: 'npm-style version spec for `opencode-ai` (`latest`, `^0.4`, `0.4.2`).'
12
+ surface: silent
13
+ model:
14
+ type: string
15
+ default: ''
16
+ description: 'Default model as `provider/model-id` (e.g. `anthropic/claude-sonnet-4-6`, `openai/gpt-4o-mini`). The provider is derived from the prefix before `/`. Empty: pick interactively on first run.'
17
+ surface: yml
18
+ apiToken:
19
+ type: string
20
+ default: ''
21
+ description: 'API key for the model provider (derived from `model`); written to `provider.<x>.options.apiKey` in opencode.json. Empty for `opencode auth login` on first run.'
22
+ surface: env
23
+ npm:
24
+ type: string
25
+ default: ''
26
+ description: 'Custom/local providers only (e.g. Ollama): the AI-SDK driver package, usually `@ai-sdk/openai-compatible`. Setting this switches `model` to custom-provider mode and builds a full provider block from `model` + `baseUrl`. Empty for hosted providers.'
27
+ surface: silent
28
+ baseUrl:
29
+ type: string
30
+ default: ''
31
+ description: 'Custom/local providers only: the endpoint URL, e.g. `http://ollama:11434/v1` (a service on the Docker network). Used together with `npm`.'
32
+ surface: silent
33
+ feature:
34
+ version: 1.0.0
35
+ persistentHomePaths: [.config/opencode, .local/share/opencode]
36
+ briefing:
37
+ - text: 'OpenCode (`opencode`) — open-source, provider-agnostic AI coding agent. Reads this AGENTS.md as project instructions. Model + provider key (when set in the yml) live in `~/.config/opencode/opencode.json`; otherwise authenticate once with `opencode auth login`.'
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+ # Monoceros devcontainer feature: opencode.
3
+ #
4
+ # Installs sst's OpenCode CLI globally via the npm registry (package
5
+ # `opencode-ai`). Model selection and the provider API key are NOT
6
+ # handled here — they are written to ~/.config/opencode/opencode.json
7
+ # at `monoceros apply` (see create/opencode-config.ts), so a change to
8
+ # the yml takes effect on the next apply instead of being frozen by the
9
+ # feature's cached image layer (ADR 0018). Auth/session state lives
10
+ # under ~/.config/opencode and ~/.local/share/opencode, both
11
+ # bind-mounted from the host so they survive apply rebuilds.
12
+
13
+ set -euo pipefail
14
+
15
+ VERSION="${VERSION:-latest}"
16
+
17
+ echo "[opencode] installing opencode-ai@${VERSION} (as node)"
18
+
19
+ # Install as the non-root `node` user, NOT root (this script runs as
20
+ # root). The base image's npm global prefix is owned by `node`, so
21
+ # installing as node leaves the package files node-owned — which is what
22
+ # lets OpenCode's runtime self-updater keep itself current between
23
+ # Monoceros `upgrade`s. Installing as root would freeze the version at
24
+ # build time with no-write-permission errors. Same rationale as the
25
+ # claude-code feature (ADR 0018).
26
+ runuser -u node -- bash -lc \
27
+ "npm install -g --no-audit --no-fund 'opencode-ai@${VERSION}'"
28
+
29
+ runuser -u node -- bash -lc 'opencode --version' >/dev/null 2>&1 || {
30
+ echo "[opencode] ERROR: install completed but \`opencode\` is not on PATH" >&2
31
+ exit 1
32
+ }
33
+
34
+ echo "[opencode] installed — model + provider key (if set in the yml) are written to ~/.config/opencode/opencode.json by \`monoceros apply\`; otherwise run \`opencode auth login\` once in the container"
35
+ echo "[opencode] done"