Distribute gitea-axi's ambient context via explicit user actions (ADRs 0009, 0013), with no postinstall script: - Bundle the Agent Skill markdown at skills/gitea-axi/SKILL.md (a minimal pointer, not a command reference) and ship it via package.json files. - Add `setup`, which installs the skill into ~/.claude/skills/ idempotently (installed/updated/unchanged). - Add `setup hooks`, which registers a SessionStart hook running the bare dashboard for Claude Code, Codex, and OpenCode via the SDK's installSessionStartHooks(), updating managed entries in place. - Shadow the SDK's built-in `update` so it fails with VALIDATION_ERROR and points at the npm update command, keeping the ten-code error list intact. Integration tests drive all three at the CLI seam against a temporary HOME; these commands make no Gitea API calls, so there is no live-Gitea e2e case.
14 lines
523 B
TypeScript
14 lines
523 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { runCliTest } from "./harness.js";
|
|
|
|
describe("update (shadowed self-update)", () => {
|
|
it("refuses to self-update: VALIDATION_ERROR, exit 2, npm help line, no SDK UPDATE_ERROR", async () => {
|
|
const { stdout, exitCode } = await runCliTest(["update"]);
|
|
|
|
expect(exitCode).toBe(2);
|
|
expect(stdout).toContain("code: VALIDATION_ERROR");
|
|
expect(stdout).toContain("npm install -g gitea-axi@latest");
|
|
expect(stdout).not.toContain("UPDATE_ERROR");
|
|
});
|
|
});
|