Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,27 +169,29 @@ jobs:
--build-arg COMMIT_SHA="$GITHUB_SHA" --build-arg VERSION="$version" .
node packages/apphost/scripts/image-smoke.mjs apphost:ci

- name: Image smoke - extension-probe on this kit, every part through up
- name: Image smoke - the probe extension on this kit, every part through up
env:
PROBE_REF: ${{ vars.PROBE_REF }}
run: |
set -euo pipefail
mkdir -p /tmp/pack
npm pack --workspaces --pack-destination /tmp/pack >/dev/null
# A PR runs against the extension-probe branch named as its head (or a non-default base), else
# A PR runs against the examples branch named as its head (or a non-default base), else
# the repo variable PROBE_REF (set while a kit change waits on a probe release), else master.
probe=https://github.com/agentage/extension-probe.git
probe=https://github.com/agentage/examples.git
branch="${PROBE_REF:-master}"
# The base counts only when it is another PR's branch: a PR on master falls to the variable.
base="${GITHUB_BASE_REF:-}"
if [ "$base" = "${{ github.event.repository.default_branch }}" ]; then base=""; fi
for ref in "$base" "${GITHUB_HEAD_REF:-}"; do
if [ -n "$ref" ] && git ls-remote --exit-code --heads "$probe" "$ref" >/dev/null; then branch="$ref"; fi
done
echo "extension-probe branch: $branch" >> "$GITHUB_STEP_SUMMARY"
echo "examples branch: $branch" >> "$GITHUB_STEP_SUMMARY"
git clone --depth 1 --branch "$branch" "$probe" /tmp/probe
mkdir -p /tmp/probe/.kit
cd /tmp/probe
dir=$(node "$GITHUB_WORKSPACE/scripts/probe-dir.mjs" /tmp/probe)
echo "PROBE_DIR=$dir" >> "$GITHUB_ENV"
mkdir -p "$dir/.kit"
cd "$dir"
# The probe's @agentage/* dependencies built here replace the registry copies.
tarballs=()
for tgz in /tmp/pack/agentage-*.tgz; do
Expand All @@ -207,7 +209,7 @@ jobs:
node node_modules/@agentage/extension/dist/tool/cli.js up

- name: Image smoke - discovery is valid through the gateway, e2e (up already asserted each part's /health commit)
working-directory: /tmp/probe
working-directory: ${{ env.PROBE_DIR }}
run: |
set -euo pipefail
curl -sf http://localhost:4280/.well-known/agentage-extension.json > /tmp/discovery.json
Expand All @@ -216,7 +218,7 @@ jobs:
npm run test:e2e

- name: Image smoke - the kit caller route through the gateway (200 own scopes, 401, 403)
working-directory: /tmp/probe
working-directory: ${{ env.PROBE_DIR }}
run: |
set -euo pipefail
at=http://localhost:4280/api/probe/caller
Expand All @@ -229,7 +231,7 @@ jobs:

# The one container (C7): the image builds from this kit, starts healthy and serves the api.
- name: One container smoke - build --container, run it, the api answers
working-directory: /tmp/probe
working-directory: ${{ env.PROBE_DIR }}
run: |
set -euo pipefail
node node_modules/@agentage/extension/dist/tool/cli.js build --container
Expand All @@ -245,7 +247,7 @@ jobs:

- name: Container logs on failure
if: failure()
run: docker compose -f /tmp/probe/.agentage/compose.json logs --no-color --tail 80 || true
run: docker compose -f "$PROBE_DIR/.agentage/compose.json" logs --no-color --tail 80 || true

widget-screenshots:
name: Widget screenshots
Expand Down Expand Up @@ -305,13 +307,13 @@ jobs:
path: platform

# The same probe branch as the image smoke: head, a non-default base, vars.PROBE_REF, master.
- name: Pick the extension-probe branch
- name: Pick the examples branch
id: probe-ref
env:
PROBE_REF: ${{ vars.PROBE_REF }}
run: |
branch="${PROBE_REF:-master}"
probe=https://github.com/agentage/extension-probe.git
probe=https://github.com/agentage/examples.git
# The base counts only when it is another PR's branch: a PR on master falls to the variable.
base="${GITHUB_BASE_REF:-}"
if [ "$base" = "${{ github.event.repository.default_branch }}" ]; then base=""; fi
Expand All @@ -338,13 +340,17 @@ jobs:
echo "e2e branch: $branch" >> "$GITHUB_STEP_SUMMARY"
echo "branch=$branch" >> "$GITHUB_OUTPUT"

- name: Checkout agentage/extension-probe
- name: Checkout agentage/examples
uses: actions/checkout@v7
with:
repository: agentage/extension-probe
repository: agentage/examples
ref: ${{ steps.probe-ref.outputs.branch }}
path: probe

# extensions/probe when the checked-out ref has it, else the repo root.
- name: Find the probe folder
run: echo "PROBE_DIR=$(node platform/scripts/probe-dir.mjs "$PWD/probe")" >> "$GITHUB_ENV"

# agentage/e2e is private; the org PAT_TOKEN reads it. Dependabot runs get no secrets.
- name: Checkout agentage/e2e
if: github.actor != 'dependabot[bot]'
Expand All @@ -368,8 +374,8 @@ jobs:
run: |
npm ci --prefix platform
npm run build --prefix platform
npm pack --workspaces --prefix platform --pack-destination "$PWD/probe"
cd probe
npm pack --workspaces --prefix platform --pack-destination "$PROBE_DIR"
cd "$PROBE_DIR"
# No npm ci first: a probe that already pins the candidate version cannot fetch it from npm.
# Any other workspace package the probe names (identity) comes from this tree too, never npm.
tarballs=(./agentage-extension-*.tgz ./agentage-widget-*.tgz)
Expand All @@ -388,19 +394,17 @@ jobs:
npm run build

- name: agentage extension up
working-directory: probe
working-directory: ${{ env.PROBE_DIR }}
# The kit's own tool, not the agentage bin: the probe's @agentage/cli bundles the released kit.
run: node node_modules/@agentage/extension/dist/tool/cli.js up

- name: e2e gate on docker (agentage/e2e, probe gate docker)
if: github.actor != 'dependabot[bot]'
working-directory: e2e-suite
env:
PROBE_DIR: ${{ github.workspace }}/probe
run: |
npm ci
# The gate validates the discovery document and the record with the kit under test.
npm install --no-save ../probe/agentage-extension-*.tgz
npm install --no-save "$PROBE_DIR"/agentage-extension-*.tgz
# The version alone cannot tell the candidate from npm (both can be 0.13.0): the source can.
resolved=$(jq -r '.packages["node_modules/@agentage/extension"].resolved' node_modules/.package-lock.json)
echo "e2e validates with @agentage/extension $(jq -r .version node_modules/@agentage/extension/package.json) from $resolved"
Expand All @@ -418,5 +422,5 @@ jobs:

- name: agentage extension down
if: always()
working-directory: probe
working-directory: ${{ env.PROBE_DIR }}
run: node node_modules/@agentage/extension/dist/tool/cli.js down || true
2 changes: 1 addition & 1 deletion .repo-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ waive:
- id: ts-nodenext-ext
reason: "the only hits are JSON fixtures imported with { type: 'json' }; tsc enforces .js on every .ts import"
- id: cicd-no-npm-install
reason: 'the image smoke runs npm install ./.kit/kit.tgz in a throwaway extension-probe clone, so the image carries the packed kit; this repo installs with npm ci'
reason: 'the image smoke runs npm install ./.kit/kit.tgz in a throwaway probe clone, so the image carries the packed kit; this repo installs with npm ci'
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ Read the file named here before you read `src/` (`src/` = `packages/extension/sr
- `up` names its compose project per working copy; scripts reach it with
`-f .agentage/compose.json`, never `-p`. The ui CSP allows the dev issuer only when
`AGENTAGE_DEV_ISSUER` is set (only `up` sets it).
- CI's image smoke clones extension-probe master (or, on a PR, the probe branch of the same name
when one exists), installs the packed packages it uses and runs `up`: a probe change can turn
- CI's image smoke clones agentage/examples master (or, on a PR, the branch of the same name
when one exists), takes extensions/probe (the repo root when absent), installs the packed packages it uses and runs `up`: a probe change can turn
this CI red, and a kit change that breaks the probe never reaches npm.
- Public repo: no secrets, no internal hosts, no provider names, no roadmap in code or docs.
- Docs: sentences of 25 words or fewer, no em dash, no plan ids a reader cannot open.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function create(ctx: McpContext) {
- `worker`: jobs on a five-field cron. A job never runs twice at once.
- `cli`: one handler per command in `agentage.commands`.

[extension-probe](https://github.com/agentage/extension-probe) has every part kind.
[the probe extension](https://github.com/agentage/examples) has every part kind.

More: [docs/parts.md](docs/parts.md).

Expand Down Expand Up @@ -137,7 +137,7 @@ The same run builds the app host program image from `packages/apphost/Dockerfile
the release. A re-run records the image that it pushed before. It refuses a version tag with
another digest. The decision and the record are in `packages/apphost/scripts/image-release.mjs`.

Before that, CI builds [extension-probe](https://github.com/agentage/extension-probe) on the
Before that, CI builds [the probe extension](https://github.com/agentage/examples) on the
packed packages, runs `up`, and checks every part image and the served discovery document. A kit
change is proven in containers before it ships.

Expand Down
2 changes: 1 addition & 1 deletion docs/parts.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The app part is one root component in `src/app/index.tsx`, its default export. I
- `check` refuses an app part whose package.json does not declare `@agentage/design-system` `^0.20` (the kit app code imports it); `@agentage/extension` lists it as an optional peer.

The manifest is the `agentage` block of the extension's `package.json`. See
[extension-probe](https://github.com/agentage/extension-probe) for every part kind.
[the probe extension](https://github.com/agentage/examples) for every part kind.

## Store

Expand Down
11 changes: 11 additions & 0 deletions scripts/probe-dir.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { existsSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';

// examples keeps probe in extensions/probe since its folder layout; an older ref has it at the root.
export const probeDir = (checkout) => {
const nested = join(checkout, 'extensions', 'probe');
return existsSync(join(nested, 'package.json')) ? nested : checkout;
};

if (process.argv[1] === fileURLToPath(import.meta.url)) console.log(probeDir(process.argv[2]));
38 changes: 38 additions & 0 deletions scripts/probe-dir.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { execFileSync } from 'node:child_process';
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { probeDir } from './probe-dir.mjs';

const made = [];
const checkout = (nested) => {
const root = mkdtempSync(join(tmpdir(), 'probe-dir-'));
made.push(root);
writeFileSync(join(root, 'package.json'), '{}');
if (nested) {
mkdirSync(join(root, 'extensions', 'probe'), { recursive: true });
writeFileSync(join(root, 'extensions', 'probe', 'package.json'), '{}');
}
return root;
};

afterEach(() => made.splice(0).forEach((d) => rmSync(d, { recursive: true, force: true })));

describe('probeDir', () => {
it('takes the repo root when the probe is at the root', () => {
const root = checkout(false);
expect(probeDir(root)).toBe(root);
});

it('takes extensions/probe when that folder holds the probe', () => {
const root = checkout(true);
expect(probeDir(root)).toBe(join(root, 'extensions', 'probe'));
});

it('prints the folder when run as a script', () => {
const root = checkout(true);
const out = execFileSync('node', ['scripts/probe-dir.mjs', root], { encoding: 'utf8' });
expect(out.trim()).toBe(join(root, 'extensions', 'probe'));
});
});
6 changes: 5 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export default defineConfig({
// An in-process postgres boots in seconds when the whole suite runs at once (tests and hooks).
testTimeout: 30_000,
hookTimeout: 30_000,
include: ['packages/*/src/**/*.test.{ts,tsx}', 'packages/apphost/scripts/*.test.mjs'],
include: [
'packages/*/src/**/*.test.{ts,tsx}',
'packages/apphost/scripts/*.test.mjs',
'scripts/*.test.mjs',
],
globalSetup: ['packages/extension/src/test-support/pglite-template.ts'],
setupFiles: [
'packages/extension/src/test-support/cleanup.ts',
Expand Down
Loading