diff --git a/.circleci/custom.yml b/.circleci/custom.yml index 12b317f0e..16228fb4c 100644 --- a/.circleci/custom.yml +++ b/.circleci/custom.yml @@ -26,6 +26,14 @@ # generator gates the release push on, the way image.preBuildJob gates the # image). A release refused this way is recovered by rerunning the tag's # workflow from failed once the component chart is out, without a new tag. +# - stamp-release-commit (tags only): hack/stamp-release-commit.sh writes the +# tag's commit into helm/agent-platform/agents/ (the default agent's skill +# pins; the agent chart refuses a tag) and persists it to the workspace, +# which the generated push-chart-release attaches over its checkout before +# packaging: it requires the stamp through verify-release-floors and +# push-connectivity-chart-release. Unstamped (branch builds) the default +# agent renders without skills; make verify-default-agent +# simulates the step. # # The agent-platform-crds chart has been RETIRED — every component now ships # its own CRDs (app-owned CRDs), so there is no longer a CRD-bundle chart to @@ -81,6 +89,24 @@ jobs: # `helm dependency build`. command: make verify-all + stamp-release-commit: + docker: + - image: cimg/base:current + resource_class: small + steps: + - checkout + - run: + name: stamp the tag's commit into the chart (hack/stamp-release-commit.sh) + command: | + commit=$(git rev-parse HEAD) + [ "$commit" = "$CIRCLE_SHA1" ] || { echo "checked out $commit, the pipeline's commit is $CIRCLE_SHA1" >&2; exit 1; } + hack/stamp-release-commit.sh "$commit" + grep -cF "commit: \"$commit\"" helm/agent-platform/agents/default-agent/values.yaml + - persist_to_workspace: + root: . + paths: + - helm/agent-platform/agents + verify-release-floors: # The tag pipeline's gate (giantswarm/agent-platform#624). Same image and the # same bounded, retried installs as test-ingress-modes, without kyverno: the @@ -118,7 +144,19 @@ workflows: # pushes of the tag wait on it — the connectivity push below by its # requires, the generated push-chart-release through the generator's # chart release gate (gen.ci.chartReleaseGateJob). + - stamp-release-commit: + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ + - verify-release-floors: + # Carries the stamp to push-chart-release (through + # push-connectivity-chart-release): a chart pushed without it would pin + # no skills. + requires: + - stamp-release-commit filters: tags: only: /^v.*/ diff --git a/AGENTS.md b/AGENTS.md index 0e05a9e7e..22a478831 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,3 +39,8 @@ placement* section, kept in its internal plans repository. golden flags, with a comment saying why, and asserted by a `verify-*` target of its own. - A change that moves the committed renders under `tests/golden/` on purpose runs `make golden-update` and commits the diff, which is what a reviewer reads. + +## Platform skills + +- A change that alters what an agent or a person can do, see or configure on the platform updates + the affected skills in `skills/` in the same pull request; `make verify-skills` checks their layout. diff --git a/Makefile.custom.mk b/Makefile.custom.mk index 0ade76f88..82e39a565 100644 --- a/Makefile.custom.mk +++ b/Makefile.custom.mk @@ -553,7 +553,7 @@ verify-meta: ## Assert the app-of-apps meta-package render (pure renderer with t @grep -qE '^ - name: agentgateway$$' $(VERIFY_TMP)/ap-flux.out || { echo "FAIL: a CR consumer no longer dependsOn its CRD-owning component (agentgateway)"; exit 1; } @echo "--> kagent's first install does not wait for the controller (it mounts the CNPG Secret connectivity renders, and connectivity dependsOn kagent)" @$(HELM) template t $(CHART_DIR) -f $(CHART_DIR)/ci/ci-values.yaml $(ENGINE_OFF) --set components.kagent.enabled=true >$(VERIFY_TMP)/ap-kag.out 2>&1 || { cat $(VERIFY_TMP)/ap-kag.out; exit 1; } - @python3 -c 'import re,sys; docs=open("$(VERIFY_TMP)/ap-kag.out").read().split("\n---\n"); hr=[d for d in docs if "kind: HelmRelease" in d and re.search(r"^ name: kagent$$", d, re.M)]; sys.exit("FAIL: kagent HelmRelease not rendered") if not hr else None; waived=[re.search(r"^ name: (.*)$$", d, re.M).group(1) for d in docs if "kind: HelmRelease" in d and "disableWait: true" in d and not (re.search(r"^ name: muster$$", d, re.M) and "gatewayIdentity:" in d)]; sys.exit("FAIL: a component install no longer waits for its workload: "+", ".join(waived)+" (kagent and substrate depend on the connectivity release, whose hooks mint what their pods start against, so every install waits)") if waived else print("ok: every component install waits for its workload (no install.disableWait), but muster while its credential provider mounts the certificates of a substrate release not Ready yet (giantswarm/agent-platform#1107)")' + @python3 -c 'import re,sys; docs=open("$(VERIFY_TMP)/ap-kag.out").read().split("\n---\n"); hr=[d for d in docs if "kind: HelmRelease" in d and re.search(r"^ name: kagent$$", d, re.M)]; sys.exit("FAIL: kagent HelmRelease not rendered") if not hr else None; waived=[re.search(r"^ name: (.*)$$", d, re.M).group(1) for d in docs if "kind: HelmRelease" in d and "disableWait: true" in d and not (re.search(r"^ name: muster$$", d, re.M) and "gatewayIdentity:" in d) and not re.search(r"^ name: default-agent$$", d, re.M)]; sys.exit("FAIL: a component install no longer waits for its workload: "+", ".join(waived)+" (kagent and substrate depend on the connectivity release, whose hooks mint what their pods start against, so every install waits)") if waived else print("ok: every component install waits for its workload (no install.disableWait), but the default agent'"'"'s, whose Agent reports its own readiness (components.default-agent.disableWait), and muster while its credential provider mounts the certificates of a substrate release not Ready yet (giantswarm/agent-platform#1107)")' @echo "ok: flux render" @echo "--> agentgateway 2.x wiring: forwarded values are FLAT and carry no umbrella-only key" @./tests/verify-agentgateway-wiring.py $(VERIFY_TMP)/ap-flux.out @@ -1505,6 +1505,16 @@ verify-fast-links: ## Assert the fast-link input of the model serving layer (gia @echo "====> $@ ($(CHART_DIR), $(CONNECTIVITY_DIR))" @python3 tests/verify-fast-links.py $(CHART_DIR) $(CONNECTIVITY_DIR) +.PHONY: verify-default-agent +verify-default-agent: ## Assert the default agent (components.default-agent, giantswarm/giantswarm#38970): one agent chart release in kagent while it, kagent and muster are on, with the derived values; no skills unstamped, every skill of skills/ pinned to the commit hack/stamp-release-commit.sh stamps into a packaged copy (the tag pipeline's step); the skill-manager (follows agent-manager, skillManager.sources with the platform source first, its MCP backend entry, agent-manager's egress) and skillManager.sources feeding the portal; agent-manager's skillManager.url from its floor, else the deprecated URL list; the portal's meta agents. HELM selects the binary. + @echo "====> $@ ($(CHART_DIR), $(CONNECTIVITY_DIR))" + @python3 tests/verify-default-agent.py $(CHART_DIR) $(CONNECTIVITY_DIR) + +.PHONY: verify-skills +verify-skills: ## Validate every skill of skills/ against what the agent runtime accepts, and that no SKILL.md lives elsewhere (scripts/validate_skills.py). Needs PyYAML. + @echo "====> $@" + @python3 scripts/validate_skills.py + .PHONY: verify-gpu-pool verify-gpu-pool: ## Assert the GPU node pool input of the model serving layer (giantswarm/agent-platform#315): modelServing.gpuPool.taint tolerated by every published preset (the pool's entry first, a preset's equal entry once; Exists without a value, Equal with one), modelServing.gpuPool.nodeSelector merged under the presets' own (their keys win), both published as spec.gpuPool in the discovery ConfigMap model-manager >= 0.23.0 reads; an empty taint key renders no toleration and no taint, and the parsed serving render equals the default render with the pool's toleration taken out, object for object, but for the discovery block (both renders are the head's; a mismatch prints a unified diff); the guards (effect, key, string label values); the meta chart forwards the block. Fixture: ci/test-model-serving-gpu-pool-values.yaml. HELM selects the binary. @echo "====> $@ ($(CHART_DIR), $(CONNECTIVITY_DIR))" @@ -3189,11 +3199,13 @@ verify-wiring: ## Assert the standalone's ported wiring: toggles off = no object awk '/^ name: agent-platform-connectivity-backstage$$/{f=1} f&&/^---$$/{exit} f' $(VERIFY_TMP)/vw-bsnp-pin-$$flavor.out | grep -q 'gateway.networking.k8s.io/gateway-name: agentgateway' && { echo "FAIL: the $$flavor Backstage policy still admits the data plane while the route is pinned elsewhere"; exit 1; }; \ true; \ done - @echo "--> skill discovery's egress follows backstage.skillsRepositories; the portal's database gets a leg on the postgresql engine" + @echo "--> skill discovery's egress follows backstage.skillsRepositories or backstage.skillPullRequests; the portal's database gets a leg on the postgresql engine" @grep -q -- 'matchName: api.github.com' $(VERIFY_TMP)/vw-bsnp-cilium.out || { echo "FAIL: the cilium Backstage policy lacks api.github.com, so skill discovery is denied"; cat $(VERIFY_TMP)/vw-bsnp-cilium.out; exit 1; } @if grep -qE 'matchName: (github.com|raw.githubusercontent.com)$$' $(VERIFY_TMP)/vw-bsnp-cilium.out; then echo "FAIL: the cilium Backstage policy opens github.com or raw.githubusercontent.com, which no portal call reaches"; exit 1; fi @$(HELM) template t $(CONNECTIVITY_DIR) $(WIRING_BACKSTAGE_NETPOL) --set backstage.skillsRepositories=null --set networkPolicy.flavor=cilium 2>/dev/null | awk '/^ name: agent-platform-connectivity-backstage$$/{f=1} f&&/^---$$/{exit} f' >$(VERIFY_TMP)/vw-bsnp-noskills.out @if grep -q 'github' $(VERIFY_TMP)/vw-bsnp-noskills.out; then echo "FAIL: the cilium Backstage policy renders the GitHub egress with backstage.skillsRepositories empty"; exit 1; fi + @$(HELM) template t $(CONNECTIVITY_DIR) $(WIRING_BACKSTAGE_NETPOL) --set backstage.skillsRepositories=null --set backstage.skillPullRequests=true --set networkPolicy.flavor=cilium 2>/dev/null | awk '/^ name: agent-platform-connectivity-backstage$$/{f=1} f&&/^---$$/{exit} f' >$(VERIFY_TMP)/vw-bsnp-skillprs.out + @grep -q -- 'matchName: api.github.com' $(VERIFY_TMP)/vw-bsnp-skillprs.out || { echo "FAIL: the cilium Backstage policy lacks api.github.com with backstage.skillPullRequests on, so the portal cannot open skill pull requests"; exit 1; } @if grep -q '5432' $(VERIFY_TMP)/vw-bsnp-cilium.out; then echo "FAIL: the cilium Backstage policy renders 5432 on the sqlite engine"; exit 1; fi @$(HELM) template t $(CONNECTIVITY_DIR) $(WIRING_BACKSTAGE_NETPOL_FULL) --set networkPolicy.flavor=cilium 2>/dev/null | awk '/^ name: agent-platform-connectivity-backstage$$/{f=1} f&&/^---$$/{exit} f' >$(VERIFY_TMP)/vw-bsnp-full.out @for pattern in 'backstage-cnpg' 'backstage-cnpg-restore' 'port: "5432"'; do \ diff --git a/README.md b/README.md index 8064a8036..4d97cdb11 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Declarative agents that each run in their own sandbox, are suspended to object s | [kagent](https://github.com/kagent-dev/kagent) | Kubernetes-native agent framework: agents, templates and model configs as CRDs, plus the controller that runs them. The platform runs [Giant Swarm's kagent line](https://github.com/giantswarm/kagent-upstream). | | [Agent Substrate](https://github.com/kagent-dev/substrate) | The actor runtime under kagent. Each agent is a [gVisor](https://github.com/google/gvisor) sandbox in a worker pod, with its state snapshotted to object storage. | | [agent-manager](https://github.com/giantswarm/agent-manager) | Creates, updates and deletes agents as GitOps releases of the [agent chart](https://github.com/giantswarm/agent), over MCP and REST, as the calling person. | +| [skill-manager](https://github.com/giantswarm/skill-manager) | The skill sources: lists their skills and pins a skill to a commit as the calling person, for agent-manager and over MCP. | | [klaus-gateway](https://github.com/giantswarm/klaus-gateway) | Slack front door. A Slack thread becomes an agent session, and the agent acts as the Slack user. | | [workspace-manager](https://github.com/giantswarm/workspace-manager) | Workspaces: an Organization's repositories mirrored on a shared volume, with a working copy per agent session, served as MCP tools. | | [toolchain-manager](https://github.com/giantswarm/toolchain-manager) | Toolchains for coding agents: the sources an installation offers, package search, binaries and the Dockerfile a toolchain is built from, served as MCP tools. Opt-in. | @@ -131,6 +132,7 @@ Each component is developed in its own repository, linked above. This repository - **[`helm/agent-platform`](helm/agent-platform)** is the chart you install. It holds the component roster with version ranges, the bundled Flux engine, self-management, and the install and upgrade hooks. - **[`helm/agent-platform-connectivity`](helm/agent-platform-connectivity)** wires the components together: routes and gateways, network policies for Cilium and plain Kubernetes, Kyverno exceptions, the kagent model catalog, [serving presets](docs/serving-presets.md) and Grafana dashboards. +- **[`skills`](skills)** holds the platform's own agent skills, pinned to each release. They follow the platform: a change to it updates them in the same pull request. - **[`tests`](tests)** holds the render assertions behind `make verify-*` and an end-to-end install on kind ([tests/ats](tests/ats/README.md)). ```bash diff --git a/UPGRADE.md b/UPGRADE.md index 19486159b..5deae320d 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -15,6 +15,22 @@ Every component ships its own CRDs and upgrades them with its release; there is A CRD version change that needs more than an apply (a stored version dropped, as with kagent's `v1alpha2`) has its own entry below, with the hook that does it. +## \ → \ (the default agent, the skill-manager and `skillManager.sources`) + +giantswarm/giantswarm#38970, giantswarm/giantswarm#38322: the chart deploys the default agent (`default-agent` in the kagent namespace) wherever kagent, muster and agent-manager are on, and the skill-manager (`components.skill-manager`) wherever agent-manager is on. The skill-manager and the portal take their skill sources from `skillManager.sources`, with the platform's own `skills/` first. agent-manager pins skills through the skill-manager (`skillManager.url`) from `agent-platform.agentManager.skillManagerFloor` on. Platform HelmReleases are named after their `components` key, which is the chart name for every existing component, so no release is renamed. + +### Operator action + +- **An installation that deploys its own meta agent (an Agent Manager) or `swarm-operator`**: remove it, or set `components.default-agent.enabled: false`. +- **The default agent's model**: it gets the installation's default model once, when it has none. To pin or change it, set `defaultAgent.modelConfig`. +- **An installation that sets `agent-manager.agentChart.semver` or `components.default-agent.versionRange`**: both need the agent chart `>=2.6.0 <3.0.0`; below 2.6.0 the default agent's release refuses an unset model. +- **An installation that names the default agent differently**: set `defaultAgent.displayName` (and `defaultAgent.description`); its technical name stays `default-agent`. +- **An installation that reads private skill repositories**: set `skill-manager.github` (`app.secretName` or `tokenSecret.name`), as for agent-manager's. +- **An installation that sets `agent-manager.skills.repositories` or `backstage.skillsRepositories`**: these keys now default to `[]`. Move the list to `skillManager.sources`. A portal list still replaces the sources for the portal below `agent-platform.backstage.skillManagerFloor`. An agent-manager list fails the render once agent-manager pins through the skill-manager, and a portal list once the portal reads its skills from the skill-manager. +- **An installation that lists `https://github.com/giantswarm/agent-platform` itself**: the render fails. Remove the entry, or set `skills.platformSource.enabled: false`. +- **An air-gapped installation**: set `skills.platformSource.enabled: false`. +- **An installation that keeps agent-manager's own skill discovery**: set `components.skill-manager.enabled: false`. + ## \ → \ (organization credential Secrets are write-only) giantswarm/agent-platform#1352 and this release: `agent-platform:admin` holds `create`, `update` and `delete` on Secrets, no longer `patch`, whose answer is the stored Secret. With `agentPlatformOrganizations.enabled`, two ValidatingAdmissionPolicies (Fail, Deny) hold Secrets in organization namespaces. `agent-platform-organization-git-secrets`: a Secret applied by an organization's Kustomization is updated only by that Kustomization's ServiceAccount, cluster-admin included. `agent-platform-organization-secret-deletes`: a delete the API server answers with the Secret (Orphan or Foreground propagation, or a Secret a finalizer holds) is made only by a requester that may `get` it. diff --git a/agents b/agents new file mode 120000 index 000000000..13c1d8314 --- /dev/null +++ b/agents @@ -0,0 +1 @@ +helm/agent-platform/agents \ No newline at end of file diff --git a/docs/reference.md b/docs/reference.md index 222a9385e..107af87b5 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -42,6 +42,7 @@ By default there is no filter and no prerelease. | klaus-gateway | `components.klaus-gateway.enabled` | `false` | | agent-sandbox | `components.agent-sandbox.enabled` | `false` | | agent-manager | `components.agent-manager.enabled` | `false` | +| skill-manager | `components.skill-manager.enabled` | follows `components.agent-manager` | | vm-manager | `components.vm-manager.enabled` | `false` | | cluster-manager | `components.cluster-manager.enabled` | `false` | | workspace-manager | `workspaces.enabled` (`components.workspace-manager` follows it) | `false` | @@ -282,6 +283,38 @@ The OAuth issuer, client, secret and base URL come from the block, else from `gl `make verify-managers` covers the wiring and the guards. +### Default agent and skills + +The default agent is `default-agent` in the kagent namespace, shown as `defaultAgent.displayName` ("General Assistant" by default) with `defaultAgent.description`, labelled `agent-platform.giantswarm.io/default: "true"`. It does one-off tasks with the person's connectors (`preset:full`), points to or helps create specialist agents, and serves every portal role. Its prompt is in [`agents/default-agent/values.yaml`](../agents/default-agent/values.yaml) and its skills are in [`skills/`](../skills). + +| Value | Default | Effect | +|---|---|---| +| `components.default-agent.enabled` | `true` | Deploys the agent while kagent, muster and agent-manager are on. The portal's meta-agent features use it. | +| `klausGateway.a2a.defaultAgent` | `""` | The agent Slack's agent picker preselects. Empty: the default agent (`/default-agent`) while it is on. | +| `defaultAgent.modelConfig` | `""` | The `ModelConfig` it runs on. Empty: it gets the installation's default model (annotated `agent-platform.giantswarm.io/is-default-model-config: "true"`) once, when it has none; agent-manager sets it. Set it to pin or change the model. | +| `components.default-agent.labels` | `managed-by`, `default` | Labels on its HelmRelease and Agent. Entries add to `managed-by` and `default` on the Agent, never drop them. | +| `backstage.metaAgents.` | unset | The agent behind a portal role, as `//`. Roles: `generalInformation`, `agentManagement`, `workflowManagement`, `platformOperations`, `skillEvaluation`, `skillCreation`. Unset roles use the default agent while it is on. | +| `skillManager.sources` | `[giantswarm/agent-skills]` | Skill sources for the skill-manager and the portal, as URLs or `{url, ref, path, readOnly}`. | +| `skills.platformSource.enabled` | `true` | Lists the platform's `skills/` first, read-only, at the release tag (a dev build: its commit). Set `false` where GitHub is unreachable. | +| `skills.platformSource.ref` | `""` | A full commit id of this repository, e.g. a skills branch's head. Pins the platform source and the default agent's skills to it. | +| `agent-manager.skills.repositories`, `backstage.skillsRepositories` | `[]` | Deprecated. When set, replaces `skillManager.sources` for that consumer. From `agent-platform.backstage.skillManagerFloor` on, with the skill-manager on, the portal reads its skills from the skill-manager and a `backstage.skillsRepositories` fails the render. | + +- A release pins the skills to the tag's commit. A branch build deploys the agent without skills. +- The portal gets the platform source and object entries from `agent-platform.backstage.skillSourcesFloor` in `_helpers.tpl`. Below it, URLs only. + +### Skill manager + +**[skill-manager](https://github.com/giantswarm/skill-manager)** owns the skill sources. It lists their skills and pins a skill to a commit as the person: MCP through muster (`x_skill-manager_*`), REST for agent-manager. + +- `components.skill-manager` follows `components.agent-manager`. `enabled: false` leaves it out. `dependsOn: [muster]`. Nothing waits for it: agent-manager and the default agent install while it fails. +- Its `sources` are derived: the platform source, then `skillManager.sources`. An own `skill-manager.sources` fails the render. +- GitHub access goes in `skill-manager.github` (`app.secretName` or `tokenSecret.name`). Empty reads public repositories anonymously. +- agent-manager gets `skillManager.url`, the skill-manager's Service, from `agent-platform.agentManager.skillManagerFloor` on, `installation` (`backstage.installationName`), which `get_info` reports for the default agent's start links, and `defaultAgentModel.agent: default-agent` while the default agent is on. Below it, or with the skill-manager off, agent-manager gets `skills.repositories` as URLs, without the platform source. `agent-manager.skills.repositories` set while agent-manager uses the skill-manager fails the render. +- Its NetworkPolicy admits its callers' namespaces (`networkPolicy.ingressNamespaces`, derived: muster's, the portal's, agent-manager's, the kagent namespace). The connectivity chart registers it as muster's MCP backend and opens agent-manager's and its migrate run's egress to it. +- agent-manager's migrate run calls it with a service token: the connectivity chart generates the Secret `skill-manager-service-token` (skill-manager's and the kagent namespace) and the chart sets `skill-manager.serviceToken.secretName`. + +`make verify-default-agent` covers it. + ### Cluster manager **[cluster-manager](https://github.com/giantswarm/cluster-manager)** is the cluster write surface. It lists clusters and node pools, creates and deletes GPU node pools, and switches model serving on a cluster. @@ -515,7 +548,7 @@ You need: | Toggle | What the connectivity chart renders | Inputs | |---|---|---| -| `components.backstage.enabled` | The app-config ConfigMap `agent-platform-backstage-app-config`, the `HTTPRoute` `backstage.`, and a config-reload hook that rolls the Deployment when the config changes. | `backstage.{hostname, parentRefs, installationName, extraScopes, startUrlSearchParams, enabledExtensions, disabledExtensions, skillsRepositories, configReload}`, dropped before the backstage chart (`components.backstage.omitKeys`). | +| `components.backstage.enabled` | The app-config ConfigMap `agent-platform-backstage-app-config`, the `HTTPRoute` `backstage.`, and a config-reload hook that rolls the Deployment when the config changes. | `backstage.{hostname, parentRefs, installationName, extraScopes, startUrlSearchParams, enabledExtensions, disabledExtensions, skillsRepositories, skillPullRequests, metaAgents, configReload}`, dropped before the backstage chart (`components.backstage.omitKeys`). | | `components.mcp-kubernetes.enabled` | The `MCPServer` registering the server with muster using per-server OAuth consent and an access token issued by mcp-kubernetes. OAuth uses the platform's existing Valkey and encryption Secret by default. Needs muster. `mcp-kubernetes.mcpServer.managementCluster: ` makes it a member of muster's `kubernetes` family; `enabled: false` renders no CR. | `mcp-kubernetes.kubernetesAudience` (default `dex-k8s-authenticator`, `""` for Google), `mcp-kubernetes.mcpServer`. | | `components.modelServing.enabled` (with the three kserve components) | The serving presets and the discovery ConfigMap `agent-platform-model-serving`, the serving `Namespace`, the cache claim, the Kyverno cache policies (`modelServing.policies.enabled: auto`) and the serving namespace's network policies. Fails without the kserve components or the `serving.kserve.io` API (`modelServing.kserve.requireApi`). | `modelServing.*` | | `components.kserve-llmisvc-resources.enabled` | The llm-d controller's network policy, and guards: `kserve.controller.deploymentMode: Standard`, `kserve.createSharedResources: true`. The removed `components.kserve-crd` / `components.kserve-resources` are refused. | the component's own block | diff --git a/hack/stamp-release-commit.sh b/hack/stamp-release-commit.sh new file mode 100755 index 000000000..bdb0e50a9 --- /dev/null +++ b/hack/stamp-release-commit.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Stamp a release's commit into the chart: every `[[ .SHA ]]` placeholder of the +# agents' values files (helm/agent-platform/agents/) becomes the full commit id +# the agent chart pins the platform's skills to (it refuses a tag). Run by the +# tag pipeline (.circleci/custom.yml, stamp-release-commit) before the chart is +# packaged; make verify-default-agent runs it on a copy. +# +# usage: hack/stamp-release-commit.sh [] [] +# commit 40-hex commit id; default: git rev-parse HEAD +# chart dir default: helm/agent-platform +set -euo pipefail + +commit=${1:-$(git rev-parse HEAD)} +chart=${2:-helm/agent-platform} +placeholder='[[ .SHA ]]' + +if ! [[ $commit =~ ^[0-9a-f]{40}$ ]]; then + echo "stamp-release-commit: '$commit' is not a full 40-hex commit id" >&2 + exit 1 +fi + +files=$(grep -rlF "$placeholder" "$chart/agents" || true) +if [ -z "$files" ]; then + echo "stamp-release-commit: no '$placeholder' under $chart/agents: nothing to stamp" >&2 + exit 1 +fi +for f in $files; do + # The placeholder holds no regex metacharacter sed would read once escaped. + sed -i.bak "s/\[\[ \.SHA \]\]/$commit/g" "$f" && rm -f "$f.bak" + echo "stamped $commit into $f" +done +if grep -rqF "$placeholder" "$chart/agents"; then + echo "stamp-release-commit: a placeholder is left under $chart/agents" >&2 + exit 1 +fi diff --git a/helm/agent-platform-connectivity/README.md b/helm/agent-platform-connectivity/README.md index d638943d7..98f71a2ef 100644 --- a/helm/agent-platform-connectivity/README.md +++ b/helm/agent-platform-connectivity/README.md @@ -1161,6 +1161,7 @@ The kagent block is open in the schema, so the template refuses a key under `kag | components.agent-sandbox.enabled | bool | `false` | | | components.model-manager.enabled | bool | `true` | | | components.agent-manager.enabled | bool | `false` | | +| components.default-agent.enabled | bool | `false` | | | components.vm-manager.enabled | bool | `false` | | | components.cluster-manager.enabled | bool | `false` | | | components.workspace-manager.enabled | bool | `false` | | @@ -1926,6 +1927,8 @@ The kagent block is open in the schema, so the template refuses a key under `kag | backstage.disabledExtensions[10] | string | `"api:ai-chat/drawer"` | | | backstage.disabledExtensions[11] | string | `"app-root-element:ai-chat/drawer"` | | | backstage.skillsRepositories[0] | string | `"https://github.com/giantswarm/agent-skills"` | | +| backstage.skillPullRequests | bool | `false` | | +| backstage.metaAgents | object | `{}` | | | backstage.configReload.enabled | bool | `true` | | | backstage.configReload.image.registry | string | `"gsoci.azurecr.io"` | | | backstage.configReload.image.name | string | `"giantswarm/kubectl"` | | diff --git a/helm/agent-platform-connectivity/templates/agent-manager/netpol.yaml b/helm/agent-platform-connectivity/templates/agent-manager/netpol.yaml index cc717406d..3e16c4dc3 100644 --- a/helm/agent-platform-connectivity/templates/agent-manager/netpol.yaml +++ b/helm/agent-platform-connectivity/templates/agent-manager/netpol.yaml @@ -45,6 +45,10 @@ OAuth on and the controller route rendered. */ -}} {{- $kagentOn := include "agent-platform.componentEnabled" (dict "root" . "name" "kagent") }} {{- $sessionsOn := and $kagentOn $oauthOn (include "agent-platform.ingress.agentgateway" .) (dig "controllerRoute" "enabled" false (.Values.kagent | default dict)) }} {{- $dataplanePort := (index .Values.gateway.listeners 0).port }} +{{- /* The skill-manager, which agent-manager pins and lists skills through +(its REST API, as the caller), while the meta chart registers it as an MCP +backend (networkPolicy.mcpBackends.skill-manager). */ -}} +{{- $skillManager := index (.Values.networkPolicy.mcpBackends | default dict) "skill-manager" }} {{- if eq (include "agent-platform.networkPolicyFlavor" .) "cilium" }} --- @@ -112,7 +116,7 @@ spec: # Egress from agent-manager: DNS (with Cilium's proxy clause so the FQDN # selectors below resolve), the Kubernetes API (HelmReleases, OCIRepositories, # Agents, ModelConfigs, workloads — as the caller), muster (filter_tools, OAuth -# on), the identity provider +# on), the skill-manager (while it is an MCP backend), the identity provider # (agent-manager.oauth: the discovery, JWKS, userinfo and token endpoints — the # Dex issuer by name, or the three Google hosts for the google provider) and # the agent chart's sources — its OCI registry (versions, values schema), the @@ -149,6 +153,19 @@ spec: - port: {{ $dataplanePort | quote }} protocol: TCP {{- end }} + {{- with $skillManager }} + # The skill-manager (skills pinned and listed, as the caller). + - toEndpoints: + - matchLabels: + {{- toYaml .podSelector | nindent 12 }} + io.kubernetes.pod.namespace: {{ .namespace }} + toPorts: + - ports: + {{- range .ports }} + - port: {{ . | quote }} + protocol: TCP + {{- end }} + {{- end }} {{- if $filterToolsOn }} # muster's filter_tools (a claude Harness agent's toolset, as the caller). - toEndpoints: @@ -296,7 +313,7 @@ spec: {{- end }} --- # Egress from agent-manager: DNS, the Kubernetes API, muster (filter_tools, -# OAuth on), and — vanilla +# OAuth on), the skill-manager (while it is an MCP backend), and — vanilla # NetworkPolicy has no FQDN selector — every public destination on 443 for the # identity provider (Dex or Google), the chart registry, its storage front and # GitHub (agentManager.networkPolicy.egress.cidrs narrows the chart egress, @@ -355,6 +372,21 @@ spec: - port: {{ $dataplanePort | int }} protocol: TCP {{- end }} + {{- with $skillManager }} + # The skill-manager (skills pinned and listed, as the caller). + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .namespace }} + podSelector: + matchLabels: + {{- toYaml .podSelector | nindent 14 }} + ports: + {{- range .ports }} + - port: {{ . | int }} + protocol: TCP + {{- end }} + {{- end }} {{- if $filterToolsOn }} # muster's filter_tools (a claude Harness agent's toolset, as the caller). - to: diff --git a/helm/agent-platform-connectivity/templates/agent-manager/skill-manager-token.yaml b/helm/agent-platform-connectivity/templates/agent-manager/skill-manager-token.yaml new file mode 100644 index 000000000..6c4759d14 --- /dev/null +++ b/helm/agent-platform-connectivity/templates/agent-manager/skill-manager-token.yaml @@ -0,0 +1,36 @@ +{{- /* +The skill-manager's service token (key token): the bearer agent-manager's +migrate run, which has no person, calls the skill-manager with, admitted by +the skill-manager as the platform's own caller (its serviceToken.secretName, +which the meta chart derives). Rendered while the meta chart derives +agentManager.skillManager.serviceTokenSecret: in the skill-manager's +namespace, which it reads, and in the kagent namespace, where the migrate run +reads it (SKILL_MANAGER_TOKEN). Generated once: an existing Secret's token is +kept (a lookup of the live object in the skill-manager's namespace), and the +Secret is kept on uninstall. +*/ -}} +{{- with dig "skillManager" "serviceTokenSecret" "" (.Values.agentManager | default dict) }} +{{- $name := . }} +{{- $sm := $.Values.agentManager.skillManager }} +{{- $token := "" }} +{{- with (lookup "v1" "Secret" $sm.namespace $name) }} +{{- $token = dig "data" "token" "" . }} +{{- end }} +{{- $token = $token | default (randAlphaNum 48 | b64enc) }} +{{- $kagentNs := $.Values.kagent.namespaceOverride | default $.Release.Namespace }} +{{- range $ns := uniq (list $sm.namespace $kagentNs) }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ $name }} + namespace: {{ $ns }} + labels: + {{- include "agent-platform.agentManager.labels" $ | nindent 4 }} + annotations: + helm.sh/resource-policy: keep +type: Opaque +data: + token: {{ $token }} +{{- end }} +{{- end }} diff --git a/helm/agent-platform-connectivity/templates/backstage/app-config.yaml b/helm/agent-platform-connectivity/templates/backstage/app-config.yaml index e65034b99..391670c6f 100644 --- a/helm/agent-platform-connectivity/templates/backstage/app-config.yaml +++ b/helm/agent-platform-connectivity/templates/backstage/app-config.yaml @@ -167,6 +167,20 @@ data: signed-in person through muster (the x_model-manager_* tools of the muster.installations entry above; giantswarm/backstage#2294), and its backend has no model-manager client to configure. */}} + {{- /* The agent behind each of the portal's platform roles: the default + agent the meta chart installs (components.default-agent) for + every role while it is on; backstage.metaAgents. points a role + elsewhere. backstage >= 3.0.0; an earlier portal ignores the key. */}} + {{- $metaAgents := dict }} + {{- if and (include "agent-platform.componentEnabled" (dict "root" . "name" "default-agent")) (include "agent-platform.componentEnabled" (dict "root" . "name" "agent-manager")) }} + {{- $assistant := printf "%s/%s/default-agent" $installation (.Values.kagent.namespaceOverride | default .Release.Namespace) }} + {{- range list "generalInformation" "agentManagement" "workflowManagement" "platformOperations" "skillEvaluation" "skillCreation" }} + {{- $_ := set $metaAgents . $assistant }} + {{- end }} + {{- end }} + {{- range $role, $agent := ($backstage.metaAgents | default dict) }} + {{- if $agent }}{{ $_ := set $metaAgents $role $agent }}{{ end }} + {{- end }} agentPlatform: organizations: enabled: {{ eq (include "agent-platform.organizations.enabled" .) "true" }} @@ -187,6 +201,10 @@ data: repositories: {{- toYaml . | nindent 10 }} {{- end }} + {{- with $metaAgents }} + metaAgents: + {{- toYaml . | nindent 8 }} + {{- end }} {{- if $kagentRoute }} {{- /* The kagent controller of this installation, as the portal backend dials it: the gRPC origin of the controller GRPCRoute through agentgateway diff --git a/helm/agent-platform-connectivity/templates/backstage/networkpolicy-app-cilium.yaml b/helm/agent-platform-connectivity/templates/backstage/networkpolicy-app-cilium.yaml index 4a2e0e712..e9c01f37f 100644 --- a/helm/agent-platform-connectivity/templates/backstage/networkpolicy-app-cilium.yaml +++ b/helm/agent-platform-connectivity/templates/backstage/networkpolicy-app-cilium.yaml @@ -92,9 +92,10 @@ spec: - port: "5432" protocol: TCP {{- end }} - {{- if $backstage.skillsRepositories }} + {{- if or $backstage.skillsRepositories $backstage.skillPullRequests }} # Skill discovery (backstage.skillsRepositories): the backend lists each - # repository's SKILL.md files through the GitHub API. + # repository's SKILL.md files through the GitHub API. Skill pull requests + # (backstage.skillPullRequests) go to the same API. - toFQDNs: - matchName: api.github.com toPorts: diff --git a/helm/agent-platform-connectivity/templates/kagent/migrate-cronjob.yaml b/helm/agent-platform-connectivity/templates/kagent/migrate-cronjob.yaml index 6b70ee769..5dabbdd3b 100644 --- a/helm/agent-platform-connectivity/templates/kagent/migrate-cronjob.yaml +++ b/helm/agent-platform-connectivity/templates/kagent/migrate-cronjob.yaml @@ -106,6 +106,16 @@ to the current one. */ -}} {{- with $skillsAuth.previous }} {{- $env = append $env (dict "name" "AGENT_MANAGER_SKILLS_GIT_AUTH_PREVIOUS_SECRET_NAMES" "value" (join "," .)) }} {{- end }} +{{- /* The skill-manager, which the run pins skills through while +agent-manager does (the meta chart derives agentManager.skillManager), with +the platform's service token as its bearer +(templates/agent-manager/skill-manager-token.yaml). */ -}} +{{- with dig "skillManager" dict (.Values.agentManager | default dict) }} +{{- $env = append $env (dict "name" "AGENT_MANAGER_SKILL_MANAGER_URL" "value" .url) }} +{{- with .serviceTokenSecret }} +{{- $env = append $env (dict "name" "SKILL_MANAGER_TOKEN" "valueFrom" (dict "secretKeyRef" (dict "name" . "key" "token"))) }} +{{- end }} +{{- end }} {{- /* The platform Harness every migrated Agent names. agent-manager's own default and the Harness the kagent chart renders are both `kagent`, so it is written here, not read from kagent.harness. */ -}} diff --git a/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-cilium.yaml b/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-cilium.yaml index 77ec29b8b..9c156d8cb 100644 --- a/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-cilium.yaml +++ b/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-cilium.yaml @@ -29,6 +29,21 @@ spec: {{- include "agent-platform.dnsEgressWithProxy" . | nindent 4 }} - toEntities: - kube-apiserver + {{- with index (.Values.networkPolicy.mcpBackends | default dict) "skill-manager" }} + {{- if dig "skillManager" "url" "" ($.Values.agentManager | default dict) }} + # The skill-manager (the run pins skills through it). + - toEndpoints: + - matchLabels: + {{- toYaml .podSelector | nindent 12 }} + io.kubernetes.pod.namespace: {{ .namespace }} + toPorts: + - ports: + {{- range .ports }} + - port: {{ . | quote }} + protocol: TCP + {{- end }} + {{- end }} + {{- end }} {{- include "agent-platform.agentManager.chartSourcesEgress.cilium" . | nindent 4 }} {{- with .Values.networkPolicy.additionalEgressFQDNs }} - toFQDNs: diff --git a/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-kubernetes.yaml b/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-kubernetes.yaml index 2b83e476c..e1de31261 100644 --- a/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-kubernetes.yaml +++ b/helm/agent-platform-connectivity/templates/kagent/migrate-networkpolicy-kubernetes.yaml @@ -31,6 +31,23 @@ spec: protocol: TCP - port: 6443 protocol: TCP + {{- with index (.Values.networkPolicy.mcpBackends | default dict) "skill-manager" }} + {{- if dig "skillManager" "url" "" ($.Values.agentManager | default dict) }} + # The skill-manager (the run pins skills through it). + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .namespace }} + podSelector: + matchLabels: + {{- toYaml .podSelector | nindent 14 }} + ports: + {{- range .ports }} + - port: {{ . | int }} + protocol: TCP + {{- end }} + {{- end }} + {{- end }} {{- include "agent-platform.agentManager.chartSourcesEgress.kubernetes" . | nindent 4 }} {{- with .Values.networkPolicy.additionalEgressCIDRs }} - to: diff --git a/helm/agent-platform-connectivity/values.schema.json b/helm/agent-platform-connectivity/values.schema.json index baf6c36bb..72f1f2a83 100644 --- a/helm/agent-platform-connectivity/values.schema.json +++ b/helm/agent-platform-connectivity/values.schema.json @@ -314,6 +314,15 @@ } } }, + "default-agent": { + "type": "object", + "additionalProperties": true, + "properties": { + "enabled": { + "type": "boolean" + } + } + }, "dicebear": { "type": "object", "additionalProperties": true, diff --git a/helm/agent-platform-connectivity/values.yaml b/helm/agent-platform-connectivity/values.yaml index 0e40642bf..081c447a7 100644 --- a/helm/agent-platform-connectivity/values.yaml +++ b/helm/agent-platform-connectivity/values.yaml @@ -109,6 +109,10 @@ components: # @schema additionalProperties: true enabled: true agent-manager: # @schema additionalProperties: true enabled: false + # The default agent (kagent/default-agent), the portal's meta agent. + # The meta chart forwards the entry only while it is on. + default-agent: # @schema additionalProperties: true + enabled: false vm-manager: # @schema additionalProperties: true enabled: false cluster-manager: # @schema additionalProperties: true @@ -3493,6 +3497,15 @@ backstage: # @schema skipProperties: true; additionalProperties: true # Skill repositories offered when an agent is created. skillsRepositories: - https://github.com/giantswarm/agent-skills + # Keep the portal's GitHub egress (api.github.com) for the skill pull + # requests it opens while skillsRepositories is empty, because the portal + # reads its skills from the skill-manager. The meta chart derives it. + skillPullRequests: false + # The agent behind a portal role (generalInformation, agentManagement, + # workflowManagement, platformOperations, skillEvaluation, skillCreation), as + # //. Unset roles take the default agent while + # components.default-agent is on. + metaAgents: {} # Roll the Backstage pod when this chart's app-config ConfigMap changes. # The backstage chart's own checksum annotations cover only its own # templates, so an app-config change (templates/backstage/app-config.yaml) diff --git a/helm/agent-platform/README.md b/helm/agent-platform/README.md index 5d157e85d..a0ab78c08 100644 --- a/helm/agent-platform/README.md +++ b/helm/agent-platform/README.md @@ -571,6 +571,24 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | components.agent-manager.enabled | bool | `false` | | | components.agent-manager.dependsOn[0] | string | `"muster"` | | | components.agent-manager.dependsOn[1] | string | `"kagent"` | | +| components.skill-manager.chart | string | `"skill-manager"` | | +| components.skill-manager.repository | string | `"oci://gsoci.azurecr.io/charts/giantswarm"` | | +| components.skill-manager.versionRange | string | `">=0.1.0 <0.2.0"` | | +| components.skill-manager.valuesFrom | string | `"skill-manager"` | | +| components.skill-manager.dependsOn[0] | string | `"muster"` | | +| components.skill-manager.gatedRoster | bool | `true` | | +| components.default-agent.chart | string | `"agent"` | | +| components.default-agent.repository | string | `"oci://gsoci.azurecr.io/charts/giantswarm"` | | +| components.default-agent.versionRange | string | `">=2.6.0 <3.0.0"` | | +| components.default-agent.valuesFile | string | `"agents/default-agent/values.yaml"` | | +| components.default-agent.injectGlobal | bool | `false` | | +| components.default-agent.inKagentNamespace | bool | `true` | | +| components.default-agent.disableWait | bool | `true` | | +| components.default-agent.labels."agent-platform.giantswarm.io/managed-by" | string | `"agent-platform"` | | +| components.default-agent.labels."agent-platform.giantswarm.io/default" | string | `"true"` | | +| components.default-agent.gatedRoster | bool | `true` | | +| components.default-agent.enabled | bool | `true` | | +| components.default-agent.dependsOn[0] | string | `"kagent"` | | | components.vm-manager.chart | string | `"vm-manager"` | | | components.vm-manager.repository | string | `"oci://gsoci.azurecr.io/charts/giantswarm"` | | | components.vm-manager.versionRange | string | `">=0.24.0 <0.25.0"` | | @@ -636,7 +654,9 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | components.backstage.omitKeys[5] | string | `"enabledExtensions"` | | | components.backstage.omitKeys[6] | string | `"disabledExtensions"` | | | components.backstage.omitKeys[7] | string | `"skillsRepositories"` | | -| components.backstage.omitKeys[8] | string | `"configReload"` | | +| components.backstage.omitKeys[8] | string | `"skillPullRequests"` | | +| components.backstage.omitKeys[9] | string | `"metaAgents"` | | +| components.backstage.omitKeys[10] | string | `"configReload"` | | | components.backstage.enabled | bool | `false` | | | components.backstage.dependsOn[0] | string | `"cloudnative-pg"` | | | components.backstage.dependsOn[1] | string | `"agent-platform-connectivity"` | | @@ -707,7 +727,11 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | components.agent-platform-connectivity.omitKeys[2] | string | `"gpu-operator"` | | | components.agent-platform-connectivity.omitKeys[3] | string | `"toolchain-manager"` | | | components.agent-platform-connectivity.omitKeys[4] | string | `"kserve-runtime-configs"` | | -| components.agent-platform-connectivity.omitKeys[5] | string | `"agent-platform-operator"` | | +| components.agent-platform-connectivity.omitKeys[5] | string | `"skills"` | | +| components.agent-platform-connectivity.omitKeys[6] | string | `"skillManager"` | | +| components.agent-platform-connectivity.omitKeys[7] | string | `"skill-manager"` | | +| components.agent-platform-connectivity.omitKeys[8] | string | `"defaultAgent"` | | +| components.agent-platform-connectivity.omitKeys[9] | string | `"agent-platform-operator"` | | | components.agent-platform-connectivity.dependsOn[0] | string | `"muster"` | | | components.agent-platform-connectivity.dependsOn[1] | string | `"agentgateway"` | | | components.agent-platform-connectivity.dependsOn[2] | string | `"substrate-crds"` | | @@ -1394,8 +1418,8 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | agent-manager.kagent.apiVersion | string | `"v1alpha3"` | | | agent-manager.harness.egress | object | `{}` | The origins a coding agent reaches, by the name of its Harness ({claude: [https://github.com, …], codex: […], omp: […]}): the installation's forge and git hosts plus the toolchain's registries; the model host is not listed (kagent adds the ModelConfig's destination). agent-manager writes the list into the Agent's spec.egress and the Substrate egress gate refuses any other origin with a 403; agent-manager refuses an agent on a coding Harness without an entry. Empty (the default) is not forwarded and the agent-manager chart's own list applies: GitHub for claude (and codex from agent-manager 2.2.0) plus the Go and npm registries for claude-go and claude-node. Each kagent.harnesses entry an installation adds gets its entry here; an installation whose forge is not GitHub sets every Harness it serves: Helm merges the map into the chart's, so a Harness left out keeps the GitHub list. Needs agent-manager 1.11.0 or later. | | agent-manager.agentChart.ociUrl | string | `"oci://gsoci.azurecr.io/charts/giantswarm/agent"` | | -| agent-manager.agentChart.semver | string | `">=2.0.0 <3.0.0"` | | -| agent-manager.skills.repositories[0] | string | `"https://github.com/giantswarm/agent-skills"` | | +| agent-manager.agentChart.semver | string | `">=2.6.0 <3.0.0"` | | +| agent-manager.skills.repositories | list | `[]` | | | agent-manager.mcp.enabled | bool | `true` | | | agent-manager.oauth.enabled | bool | `true` | | | agent-manager.oauth.provider | string | `"dex"` | | @@ -1437,6 +1461,22 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | agentManager.migration.image.tag | string | `"2.23.2"` | | | agentManager.migration.dryRun | bool | `false` | | | agentManager.migration.gitopsNamespaces | list | `[]` | | +| skills.platformSource.enabled | bool | `true` | | +| skills.platformSource.ref | string | `""` | | +| skillManager.sources[0] | string | `"https://github.com/giantswarm/agent-skills"` | | +| skill-manager.fullnameOverride | string | `"skill-manager"` | | +| skill-manager.observability.otel.endpoint | string | `"auto"` | | +| skill-manager.observability.otel.protocol | string | `"auto"` | | +| skill-manager.observability.otel.headers | string | `"auto"` | | +| skill-manager.oauth.enabled | bool | `true` | | +| skill-manager.oauth.dex.allowPrivateURLs | bool | `true` | | +| skill-manager.oauth.sso.allowPrivateIPs | bool | `true` | | +| skill-manager.muster.mcpServer.enabled | bool | `true` | | +| skill-manager.muster.mcpServer.auth.forwardToken | bool | `true` | | +| skill-manager.muster.mcpServer.auth.requiredAudiences[0] | string | `"dex-k8s-authenticator"` | | +| defaultAgent.displayName | string | `"General Assistant"` | | +| defaultAgent.description | string | `"Start here. Handles everyday tasks with your connectors and helps you find or create the right agent."` | | +| defaultAgent.modelConfig | string | `""` | | | cluster-manager.fullnameOverride | string | `"cluster-manager"` | | | cluster-manager.observability.otel.endpoint | string | `"auto"` | | | cluster-manager.observability.otel.protocol | string | `"auto"` | | @@ -1605,7 +1645,8 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | backstage.disabledExtensions[9] | string | `"api:ai-chat/service"` | | | backstage.disabledExtensions[10] | string | `"api:ai-chat/drawer"` | | | backstage.disabledExtensions[11] | string | `"app-root-element:ai-chat/drawer"` | | -| backstage.skillsRepositories[0] | string | `"https://github.com/giantswarm/agent-skills"` | | +| backstage.skillsRepositories | list | `[]` | | +| backstage.metaAgents | object | `{}` | | | backstage.configReload.enabled | bool | `true` | | | backstage.configReload.image.registry | string | `"gsoci.azurecr.io"` | | | backstage.configReload.image.name | string | `"giantswarm/kubectl"` | | diff --git a/helm/agent-platform/agents/default-agent/values.yaml b/helm/agent-platform/agents/default-agent/values.yaml new file mode 100644 index 000000000..ecd2ed7af --- /dev/null +++ b/helm/agent-platform/agents/default-agent/values.yaml @@ -0,0 +1,129 @@ +# The default agent: where people start, and the portal's meta agent. Values of +# the Generic agent chart for components.default-agent. The meta chart adds +# agent.displayName and agent.description (defaultAgent), muster.url, +# agent.iconUrl, toolset (preset:full), labels and modelConfig.name, and puts +# the display name in place of `[[ .DisplayName ]]` in the system message. +agent: + systemMessage: | + Your name is [[ .DisplayName ]]. You are the default agent of this + Agent Platform: where people start. You act with the identity of the person talking + to you, through their connectors, within their permissions; the + audit log names them. + + Most people who talk to you are new to the Agent Platform and still + exploring it. They may not know what agents, skills, toolsets, + toolchains, connectors or workspaces are, or why they would want an + agent of their own. Explain a platform term in one sentence the first + time you use it. + + Your first job is the person's task or question: + - A one-off task (look something up, summarise, draft, check, + change one thing): do it yourself with the person's connectors. + - Questions about the platform and its agents: answer from your + skills and the live tools. + + Your second job is to show people what the platform can do for them. + When a part of it would help them reach their goal, say so once and + briefly, after helping: a specialist agent, a connector to sign in to, + a workspace, a toolchain, a toolset. Your skills say what each is and + when it helps. + + A specialist agent fits a task that repeats or needs its own tools or + knowledge. It runs on the cheapest model that still does the job, + carries only the instructions and skills the job needs, and reaches + only the tools it needs, on a model fit for its data. When an existing + agent fits, recommend it with a start link; when none does, offer to + create one and guide the person through it. + `agent-platform-agent-routing` has how to find agents, when a task + deserves one and the link format. + + The portal also sends you its platform tasks; the first message says + which: + - Creating, changing or inspecting an agent: + `agent-platform-agent-management`. + - Workflows: find, list, read, validate, create, change, run and + delete them (`agent-platform-tools`). + - Operating the platform: report its state with the read tools; + change it only through the tools that write. + - Evaluating a skill: `agent-platform-skill-review`. + - Writing a skill: `agent-platform-skill-authoring`. + + Your knowledge lives in your skills; load one the first time its + topic comes up rather than working from memory. + + How you operate: + - Read before you write, and choose from live lists, never from + memory. + - Writes only on the person's request. Confirm what you chose for + them before writing; once confirmed, act and report the result. + - Destructive actions only on an explicit request that names the + target, one at a time, and say what you did. + - Be brief and concrete; no filler. Ask one thing at a time, with + the `ask_user` tool where you have it, and propose rather than + ask from scratch. + - The person sees only your reply text and any `ask_user` question. + Write a plan out before asking them to confirm it. + - Call an agent by its display name if it has one, else by its + technical name. + + Your tools come from muster through meta-tools: `filter_tools`, + `describe_tool` and `call_tool` are your only functions besides your + built-ins. Every `x_*`, `core_*` and `workflow_*` is the `name` you + pass to `call_tool`, always the full name `filter_tools` returns, + never a function of its own. A workflow first where one fits. The + contract is in `agent-platform-tools`. +# The platform's skills from skills/ of this repository. The release pipeline +# stamps the tag's commit over the placeholder (hack/stamp-release-commit.sh); +# unstamped (a branch build), the component renders without skills. +# skills.platformSource.ref replaces the commit of each. +skills: + - name: agent-platform-overview + path: skills/agent-platform-overview + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-building-blocks + path: skills/agent-platform-building-blocks + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-portal + path: skills/agent-platform-portal + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-slack + path: skills/agent-platform-slack + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-organizations + path: skills/agent-platform-organizations + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-agent-routing + path: skills/agent-platform-agent-routing + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-tools + path: skills/agent-platform-tools + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-agent-management + path: skills/agent-platform-agent-management + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-skill-authoring + path: skills/agent-platform-skill-authoring + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" + - name: agent-platform-skill-review + path: skills/agent-platform-skill-review + git: + url: https://github.com/giantswarm/agent-platform + commit: "[[ .SHA ]]" diff --git a/helm/agent-platform/examples/customer-bom.yaml b/helm/agent-platform/examples/customer-bom.yaml index 8cc7ea7d0..d8f90cb00 100644 --- a/helm/agent-platform/examples/customer-bom.yaml +++ b/helm/agent-platform/examples/customer-bom.yaml @@ -51,6 +51,8 @@ components: dicebear: { versionRange: "0.3.10" } model-manager: { versionRange: "1.14.0" } agent-manager: { versionRange: "2.22.0" } + # The default agent (components.default-agent): the agent chart. + default-agent: { versionRange: "2.6.0" } vm-manager: { versionRange: "0.24.0" } # The cluster write surface (components.cluster-manager, off by default). cluster-manager: { versionRange: "0.22.0" } @@ -59,6 +61,8 @@ components: workspace-manager: { versionRange: "0.14.0" } # The toolchain surface (components.toolchain-manager, off by default). toolchain-manager: { versionRange: "0.5.0" } + # The skill sources (components.skill-manager, follows agent-manager). + skill-manager: { versionRange: "0.1.0" } # The organizations' operator (components.agent-platform-operator, follows # agentPlatformOrganizations.enabled, off by default). agent-platform-operator: { versionRange: "0.3.0" } diff --git a/helm/agent-platform/files/skill-repository.schema.json b/helm/agent-platform/files/skill-repository.schema.json new file mode 100644 index 000000000..0804f5d7b --- /dev/null +++ b/helm/agent-platform/files/skill-repository.schema.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$comment": "One entry of skillManager.sources: a repository URL, or {url, ref, path, readOnly}.", + "anyOf": [ + { + "type": "string", + "pattern": "^https?://\\S+$" + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string", + "pattern": "^https?://\\S+$" + }, + "ref": { + "type": "string" + }, + "path": { + "type": "string" + }, + "readOnly": { + "type": "boolean" + } + } + } + ] +} diff --git a/helm/agent-platform/templates/NOTES.txt b/helm/agent-platform/templates/NOTES.txt index 1969025f9..5767417db 100644 --- a/helm/agent-platform/templates/NOTES.txt +++ b/helm/agent-platform/templates/NOTES.txt @@ -5,7 +5,7 @@ objects, one release per enabled component plus the connectivity layer: {{- range $key, $c := .Values.components }} {{- if and (include "agent-platform.componentEnabled" (dict "root" $ "name" $key)) (hasKey $c "chart") }} - - {{ $c.chart }} (versionRange {{ $c.versionRange }}{{ with $c.dependsOn }}, dependsOn {{ join "," . }}{{ end }}) + - {{ $key }} (chart {{ $c.chart }}, versionRange {{ $c.versionRange }}{{ with $c.dependsOn }}, dependsOn {{ join "," . }}{{ end }}) {{- end }} {{- end }} {{- if eq (include "agent-platform.engineEnabled" .) "true" }} diff --git a/helm/agent-platform/templates/_helpers.tpl b/helm/agent-platform/templates/_helpers.tpl index 4a7536044..4ffa5a901 100644 --- a/helm/agent-platform/templates/_helpers.tpl +++ b/helm/agent-platform/templates/_helpers.tpl @@ -97,6 +97,10 @@ Usage: include "agent-platform.componentEnabled" (dict "root" $root "name" "agen {{- /* The data plane's route to muster: on whenever muster is on (agent-platform.validateMusterRoute refuses an explicit false then). */ -}} {{- $on = eq (include "agent-platform.componentEnabled" (dict "root" $root "name" "muster")) "true" }} +{{- else if eq .name "skill-manager" }} +{{- /* The skill-manager serves agent-manager's skills: on with it, unless + its own switch says otherwise. */ -}} +{{- $on = eq (include "agent-platform.componentEnabled" (dict "root" $root "name" "agent-manager")) "true" }} {{- else if eq .name "workspace-manager" }} {{- /* The workspace-manager follows the one switch workspaces.enabled (agent-platform.validateWorkspaces refuses an explicit value that @@ -108,6 +112,11 @@ Usage: include "agent-platform.componentEnabled" (dict "root" $root "name" "agen disagrees with it). */ -}} {{- $on = ($root.Values.agentPlatformOrganizations | default dict).enabled | default false }} {{- end }} +{{- if and $on (eq .name "default-agent") }} +{{- /* An agent: only where kagent runs it, muster serves its tools and + agent-manager, whose tools it calls, is on. */ -}} +{{- $on = and (eq (include "agent-platform.componentEnabled" (dict "root" $root "name" "kagent")) "true") (eq (include "agent-platform.componentEnabled" (dict "root" $root "name" "muster")) "true") (eq (include "agent-platform.componentEnabled" (dict "root" $root "name" "agent-manager")) "true") }} +{{- end }} {{- if $on }}true{{- end -}} {{- else -}} true @@ -319,6 +328,13 @@ overwrite would hide a values file that still spells the old key. audience its grant.audience — defaults as for klaus-gateway, the kagent block's own value stands per key; the kagent floor that takes the block, an issuer and the email claim are guarded (agent-platform.validateSessionAdmission). + skill-manager: sources, the platform's skill source and skillManager.sources + (agent-platform.skills.repositories; an own list fails); agent-manager + skillManager.url (agent-platform.skillManager.url) in place of + skills.repositories, from agent-platform.agentManager.skillManagerFloor + (agent-platform.agentManager.viaSkillManager); the connectivity release + its MCP backend entry, networkPolicy.mcpBackends.skill-manager + (agent-platform.skillManager.mcpBackend), while the component is on. toolchain-manager: the login, the muster registration and its pin to the installation's agents GitHub App, and the sources with additionalSources after them, klausGateway.url and .audience while klaus-gateway takes its @@ -519,6 +535,32 @@ floor that takes the key (agent-platform.agentManager.registryConfigFloor). */ - {{- $_ := set $derived "kagent" (dict "controllerTarget" $target) -}} {{- $orgs := include "agent-platform.agentManager.organizations" .root | fromJson -}} {{- $_ := set $derived "tenants" $orgs.tenants -}} +{{- /* Skills: through the skill-manager (skillManager.url) where it pins +them (agent-platform.agentManager.viaSkillManager), else the deprecated +in-process list of URLs (agent-platform.skills.repositories). */ -}} +{{- if include "agent-platform.agentManager.viaSkillManager" .root -}} +{{- with dig "skills" "repositories" list (index .root.Values "agent-manager" | default dict) -}} +{{- fail (printf "agent-manager.skills.repositories (%v) is set, but agent-manager takes its skill sources from the skill-manager (components.skill-manager): move the list to skillManager.sources" .) -}} +{{- end -}} +{{- $_ := set $derived "skillManager" (dict "url" (include "agent-platform.skillManager.url" .root)) -}} +{{- else -}} +{{- $_ := set $derived "skills" (dict "repositories" (include "agent-platform.skills.repositories" (dict "root" .root "consumer" "agent-manager") | fromJson).list) -}} +{{- end -}} +{{- /* The installation's name in the portal (agent ids are +//), which get_info reports: from the release +that takes the key (agent-platform.agentManager.skillManagerFloor). */ -}} +{{- if include "agent-platform.componentFloorAtLeast" (dict "root" .root "name" "agent-manager" "version" (include "agent-platform.agentManager.skillManagerFloor" .root)) -}} +{{- $_ := set $derived "installation" (include "agent-platform.portalInstallationName" .root) -}} +{{- /* The default agent gets the installation's default model once, while +its modelConfig.name is empty (agent-platform.defaultAgent.derived): +agent-manager sets it, from the same release. */ -}} +{{- if include "agent-platform.componentEnabled" (dict "root" .root "name" "default-agent") -}} +{{- $_ := set $derived "defaultAgentModel" (dict "agent" "default-agent") -}} +{{- end -}} +{{- end -}} +{{- end -}} +{{- if eq .name "default-agent" -}} +{{- $derived = include "agent-platform.defaultAgent.derived" .root | fromJson -}} {{- end -}} {{- if eq .name "agent-platform-connectivity" -}} {{- /* Helm coalescing removes a defaulted key overridden with null. Forward @@ -540,13 +582,67 @@ manager's ServiceAccount there (workspace-manager/kagent-sessions-rbac.yaml). */ {{- /* muster alone reaches the toolchain-manager's pods, while the component is on: an MCP backend entry, whose ingress policy the connectivity chart renders (networkPolicy.mcpBackends). */ -}} +{{- $mcpBackends := dict -}} {{- with (include "agent-platform.toolchainManager.mcpBackend" .root | fromJson) -}} -{{- $_ := set $derived "networkPolicy" (dict "mcpBackends" (dict "toolchain-manager" .)) -}} +{{- $_ := set $mcpBackends "toolchain-manager" . -}} +{{- end -}} +{{- /* And the skill-manager's, which agent-manager calls too +(agent-platform.skillManager.mcpBackend). */ -}} +{{- with (include "agent-platform.skillManager.mcpBackend" .root | fromJson) -}} +{{- $_ := set $mcpBackends "skill-manager" . -}} +{{- end -}} +{{- with $mcpBackends -}} +{{- $_ := set $derived "networkPolicy" (dict "mcpBackends" .) -}} +{{- end -}} +{{- /* agent-manager's migrate run pins through the skill-manager too: its +URL, its namespace and the service token's Secret, which the connectivity +release generates (agent-platform.skillManager.serviceToken). */ -}} +{{- if include "agent-platform.agentManager.viaSkillManager" .root -}} +{{- $smRef := dict "url" (include "agent-platform.skillManager.url" .root) "namespace" (dig "skill-manager" "targetNamespace" "" .root.Values.components | default (include "agent-platform.targetNamespace" .root)) -}} +{{- with include "agent-platform.skillManager.serviceToken" .root -}} +{{- $_ := set $smRef "serviceTokenSecret" . -}} +{{- end -}} +{{- $_ := set $derived "agentManager" (dict "skillManager" $smRef) -}} +{{- end -}} +{{- /* The portal's skills: from the skill-manager, through muster as the +person, where it reads them there (agent-platform.backstage.viaSkillManager); +it then needs GitHub only for the skill pull requests it opens. Else the +deprecated list it discovers itself (agent-platform.skills.repositories). */ -}} +{{- if include "agent-platform.backstage.viaSkillManager" .root -}} +{{- with dig "skillsRepositories" list (.root.Values.backstage | default dict) -}} +{{- fail (printf "backstage.skillsRepositories (%v) is set, but the portal reads its skills from the skill-manager (components.skill-manager): move the list to skillManager.sources" .) -}} +{{- end -}} +{{- $_ := set $derived "backstage" (dict "skillsRepositories" list "skillPullRequests" true) -}} +{{- else -}} +{{- $_ := set $derived "backstage" (dict "skillsRepositories" (include "agent-platform.skills.repositories" (dict "root" .root "consumer" "backstage") | fromJson).list) -}} {{- end -}} {{- end -}} {{- if eq .name "toolchain-manager" -}} {{- $derived = include "agent-platform.toolchainManager.derived" .root | fromJson -}} {{- end -}} +{{- if eq .name "skill-manager" -}} +{{- /* The skill sources: the platform's first, then skillManager.sources +(agent-platform.skills.repositories). */ -}} +{{- with dig "sources" list (index .root.Values "skill-manager" | default dict) -}} +{{- fail (printf "skill-manager.sources (%v) is set: the chart derives the skill-manager's sources from skillManager.sources — move the list there" .) -}} +{{- end -}} +{{- $_ := set $derived "sources" (include "agent-platform.skills.repositories" (dict "root" .root "consumer" "skill-manager") | fromJson).list -}} +{{- /* Its callers' namespaces, which its own NetworkPolicy admits +(agent-platform.skillManager.callerNamespaces), after the block's own. */ -}} +{{- $sm := index .root.Values "skill-manager" | default dict -}} +{{- $own := dig "networkPolicy" "ingressNamespaces" list $sm -}} +{{- $_ := set $derived "networkPolicy" (dict "ingressNamespaces" (concat $own (include "agent-platform.skillManager.callerNamespaces" .root | fromJson).list | uniq)) -}} +{{- /* The platform's own bearer, agent-manager's migrate (no person), while +agent-manager pins through it and OAuth is on: the Secret the connectivity +release generates (agent-platform.skillManager.serviceToken). */ -}} +{{- with include "agent-platform.skillManager.serviceToken" .root -}} +{{- $ownToken := dig "serviceToken" "secretName" "" $sm -}} +{{- if and $ownToken (ne $ownToken .) -}} +{{- fail (printf "skill-manager.serviceToken.secretName (%s) differs from the Secret the platform generates for agent-manager's migrate (%s): leave it unset" $ownToken .) -}} +{{- end -}} +{{- $_ := set $derived "serviceToken" (dict "secretName" .) -}} +{{- end -}} +{{- end -}} {{- if eq .name "agent-platform-operator" -}} {{- $derived = include "agent-platform.operator.derived" .root | fromJson -}} {{- end -}} @@ -659,6 +755,12 @@ receives the grants of each instance's App, side by side {{- end -}} {{- if eq .name "klaus-gateway" -}} {{- $kg := .root.Values.klausGateway | default dict -}} +{{- /* Slack's agent picker preselects the default agent, the portal's starting +point too, while it is on (components.default-agent): /default-agent. +An own klausGateway.a2a.defaultAgent wins. */ -}} +{{- if and (include "agent-platform.componentEnabled" (dict "root" .root "name" "default-agent")) (not (dig "a2a" "defaultAgent" "" $kg)) -}} +{{- $_ := set $derived "a2a" (dict "defaultAgent" (printf "%s/default-agent" (include "agent-platform.kagent.namespace" .root))) -}} +{{- end -}} {{- if and (eq (dig "routing" "store" "" $kg) "valkey") (include "agent-platform.componentEnabled" (dict "root" .root "name" "valkey")) -}} {{- $own := dig "routing" "valkey" dict $kg -}} {{- $valkey := dict -}} @@ -3295,7 +3397,7 @@ Usage: include "agent-platform.muster.awaitsSubstrate" (dict "root" $root "value {{- if dig "muster" "credentialProvider" "enabled" false .values -}} {{- $ready := false -}} {{- if and (include "agent-platform.componentEnabled" (dict "root" .root "name" "substrate")) (not (include "agent-platform.targetSecretName" .root)) -}} -{{- $release := lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" (.root.Values.gitops.namespace | default .root.Release.Namespace) (include "agent-platform.childName" (dict "root" .root "name" (index .root.Values.components "substrate" "chart"))) -}} +{{- $release := lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" (.root.Values.gitops.namespace | default .root.Release.Namespace) (include "agent-platform.childName" (dict "root" .root "name" "substrate")) -}} {{- range (dig "status" "conditions" list ($release | default dict)) -}} {{- if and (eq .type "Ready") (eq .status "True") -}}{{- $ready = true -}}{{- end -}} {{- end -}} @@ -3328,7 +3430,7 @@ Usage: include "agent-platform.muster.awaitsSubstrate" (dict "root" $root "value {{- range $pod.containers }}{{ $mounts = concat $mounts (.volumeMounts | default list) }}{{ end -}} {{- $old := include "agent-platform.kagent.databaseSecret" (dict "urlFile" $urlFile "volumes" ($pod.volumes | default list) "mounts" $mounts) -}} {{- $new := include "agent-platform.kagent.databaseSecret" (dict "urlFile" $urlFile "volumes" (dig "controller" "volumes" list $kagent) "mounts" (dig "controller" "volumeMounts" list $kagent)) -}} -{{- $release := lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" ($.Values.gitops.namespace | default $.Release.Namespace) (include "agent-platform.childName" (dict "root" $ "name" (index $.Values.components "kagent" "chart"))) -}} +{{- $release := lookup "helm.toolkit.fluxcd.io/v2" "HelmRelease" ($.Values.gitops.namespace | default $.Release.Namespace) (include "agent-platform.childName" (dict "root" $ "name" "kagent")) -}} {{- $oldUrl := dig "spec" "values" "database" "postgres" "url" "" ($release | default dict) -}} {{- $newUrl := dig "database" "postgres" "url" "" $kagent -}} {{- if and (eq $old $new) (eq $oldUrl $newUrl) -}} @@ -3957,7 +4059,7 @@ klaus-gateway gates read the endpoints. Emits nothing. modelServing.networkPolicy.otlpEndpoint from that preset's resolved endpoint (the model pods' egress); .observability.otel.endpoint (model-manager, - agent-manager, vm-manager, cluster-manager, workspace-manager, + agent-manager, skill-manager, vm-manager, cluster-manager, workspace-manager, backstage); mcp-kubernetes.mcpKubernetes.instrumentation.otlpEndpoint as host:port (the scheme and path dropped, the port the scheme's or @@ -4043,7 +4145,7 @@ is turned off, where the chart would export to the SDK's localhost default. */ - {{- include "agent-platform.shape.derive" (dict "values" $v "path" $path "value" $protocol) -}} {{- end -}} {{- include "agent-platform.shape.derive" (dict "values" $v "path" (list "muster" "muster" "observability" "otel" "headers") "value" $joined) -}} -{{- range $name := list "model-manager" "agent-manager" "vm-manager" "cluster-manager" "workspace-manager" "backstage" -}} +{{- range $name := list "model-manager" "agent-manager" "skill-manager" "vm-manager" "cluster-manager" "workspace-manager" "backstage" -}} {{- $base := list $name "observability" "otel" -}} {{- include "agent-platform.shape.derive" (dict "values" $v "path" (append $base "endpoint") "value" $endpoint) -}} {{- include "agent-platform.shape.derive" (dict "values" $v "path" (append $base "protocol") "value" $protocol) -}} @@ -4567,6 +4669,329 @@ toolchain-manager.registryPullSecret. One line, no comment inside the define. */}} {{- define "agent-platform.agentManager.registryConfigFloor" -}}2.16.0{{- end -}} +{{/* +PLACEHOLDER (giantswarm/backstage#3355, unreleased; 3.37.1 takes URLs alone): +the first release of the portal (backstage) that takes a skill repository as +{url, ref, path, readOnly}; below it the portal gets URLs alone and no +platform source. Set it to the backstage release that carries #3355 before +raising components.backstage.versionRange to it. One line, no comment inside +the define. +*/}} +{{- define "agent-platform.backstage.skillSourcesFloor" -}}3.31.0{{- end -}} + +{{/* +PLACEHOLDER (giantswarm/giantswarm#38322): the first agent-manager release +that takes skillManager.url and pins skills through the skill-manager, and +takes installation and defaultAgentModel (giantswarm/agent-manager#290); an +earlier release's closed values schema refuses the keys. A release candidate +of it counts (componentFloorAtLeast), so a range floor below the candidate +that carries #290 (2.24.0-rc.6 and earlier) gets keys it refuses. Set it to +that release before raising components.agent-manager.versionRange to it. One +line, no comment inside the define. +*/}} +{{- define "agent-platform.agentManager.skillManagerFloor" -}}2.24.0{{- end -}} + +{{/* +The first portal (backstage) release that reads skills from the skill-manager +through muster as the person and checks a skill pull request against its +sources (giantswarm/backstage#3432, giantswarm/giantswarm#38322). One line, no +comment inside the define. +*/}} +{{- define "agent-platform.backstage.skillManagerFloor" -}}3.36.0{{- end -}} + +{{/* +"true" when the portal reads skills from the skill-manager: both components +on and the floor of components.backstage.versionRange at or above +agent-platform.backstage.skillManagerFloor. The portal then gets no skill +repositories of its own. +Usage: include "agent-platform.backstage.viaSkillManager" $ +*/}} +{{- define "agent-platform.backstage.viaSkillManager" -}} +{{- if and (include "agent-platform.componentEnabled" (dict "root" . "name" "backstage")) (include "agent-platform.componentEnabled" (dict "root" . "name" "skill-manager")) (include "agent-platform.componentFloorAtLeast" (dict "root" . "name" "backstage" "version" (include "agent-platform.backstage.skillManagerFloor" .))) -}}true{{- end -}} +{{- end -}} + +{{/* +The installation's name in the portal: the key of its entries in the +app-config the connectivity chart renders (backstage.installationName). +Usage: include "agent-platform.portalInstallationName" $ +*/}} +{{- define "agent-platform.portalInstallationName" -}} +{{- dig "installationName" "" (.Values.backstage | default dict) | default "agent-platform" -}} +{{- end -}} + +{{/* +"true" when this chart is a published release: a version without a +pre-release, packaged with appVersion = version (the pipeline stamps both). A +pre-release (a branch build, a candidate) and the working tree (appVersion +0.1.0) are not; they have no release tag and no stamped commit. +Usage: include "agent-platform.publishedRelease" $ +*/}} +{{- define "agent-platform.publishedRelease" -}} +{{- if and (not (semver .Chart.Version).Prerelease) (eq (toString .Chart.AppVersion) .Chart.Version) }}true{{ end -}} +{{- end -}} + +{{/* +The commit skills.platformSource.ref pins the platform's skills to: "" unset; +anything but a full 40-hex commit id fails the render, since the default +agent's pins take a commit only (the agent chart refuses a branch, a tag and a +short SHA) and helm resolves nothing at render. +Usage: include "agent-platform.skills.platformRef" $ +*/}} +{{- define "agent-platform.skills.platformRef" -}} +{{- $ref := dig "platformSource" "ref" "" (.Values.skills | default dict) | toString -}} +{{- if and $ref (not (regexMatch "^[0-9a-f]{40}$" $ref)) -}} +{{- fail (printf "skills.platformSource.ref %q: give a full 40-hex commit id; the default agent's skills pin a commit, never a branch, a tag or a short SHA" $ref) -}} +{{- end -}} +{{- $ref -}} +{{- end -}} + +{{/* +The platform's own skill source: skills/ of this repository, read-only, at +skills.platformSource.ref when set, else this chart's release tag +(agent-platform.publishedRelease), else the commit a dev build was built from +(the h of X.Y.Z-rt