{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "axiom-logging",
  "type": "registry:block",
  "title": "Axiom Logging",
  "description": "Axiom structured event logger and server route for deployment smoke checks.",
  "dependencies": [
    "@axiomhq/js"
  ],
  "devDependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "apps/web/src/lib/axiom/logger.ts",
      "type": "registry:file",
      "target": "apps/web/src/lib/axiom/logger.ts",
      "content": "import \"server-only\";\n\nimport { Axiom } from \"@axiomhq/js\";\n\nconst axiom = new Axiom({ token: process.env.AXIOM_TOKEN });\n\nexport async function logAxiomEvent(event: Record<string, unknown>) {\n  if (!process.env.AXIOM_DATASET) throw new Error(\"AXIOM_DATASET is required\");\n  await axiom.ingest(process.env.AXIOM_DATASET, [{ ...event, timestamp: new Date().toISOString() }]);\n}\n"
    },
    {
      "path": "apps/web/src/app/api/providers/axiom/log/route.ts",
      "type": "registry:file",
      "target": "apps/web/src/app/api/providers/axiom/log/route.ts",
      "content": "import { NextResponse } from \"next/server\";\n\nimport { logAxiomEvent } from \"@/lib/axiom/logger\";\n\nexport async function POST() {\n  await logAxiomEvent({ event: \"stackfoundry.smoke\", source: \"registry\" });\n  return NextResponse.json({ ok: true });\n}\n"
    },
    {
      "path": "apps/web/src/app/(console)/admin/providers/axiom/page.tsx",
      "type": "registry:page",
      "target": "apps/web/src/app/(console)/admin/providers/axiom/page.tsx",
      "content": "const deployChecks = [\n  \"Create the provider project and add production env vars\",\n  \"Run the included smoke route after deploy\",\n  \"Document alerting, retries, and rollback behavior\",\n];\n\nexport default function AxiomLoggingPage() {\n  return (\n    <main className=\"flex flex-col gap-6 p-6\">\n      <div>\n        <h1 className=\"text-2xl font-semibold\">Axiom Logging</h1>\n        <p className=\"text-muted-foreground\">Structured logs for requests, jobs, webhooks, and operator actions.</p>\n      </div>\n      <div className=\"grid gap-3\">\n        {deployChecks.map((check) => (\n          <div key={check} className=\"rounded-lg border p-4 text-sm\">{check}</div>\n        ))}\n      </div>\n    </main>\n  );\n}\n"
    }
  ],
  "maintenanceSkills": [
    {
      "name": "axiom-logging",
      "target": ".stackfoundry/skills/axiom-logging/SKILL.md",
      "content": "---\nname: axiom-logging\ndescription: Maintain the Axiom Logging provider adapter module installed by StackFoundry.\n---\n\n# Axiom Logging Skill\n\n## Boundary\n\nThis block owns the Axiom Logging integration example only. Keep product-specific business logic outside the provider adapter until the app has chosen this provider.\n\n## Shared Skills\n\nWhen provider, framework, or database behavior changes, load the installed shared skill before editing implementation details:\n\n- `.stackfoundry/skills/axiom/SKILL.md` (source: `registry/skills/axiom/SKILL.md`)\n- `.stackfoundry/skills/nextjs/SKILL.md` (source: `registry/skills/nextjs/SKILL.md`)\n\nKeep this module skill focused on ownership, installed files, env vars, deployment checks, and module-specific invariants.\n\n## Source Files\n\n- `apps/web/src/lib/axiom/logger.ts`\n- `apps/web/src/app/api/providers/axiom/log/route.ts`\n- `apps/web/src/app/(console)/admin/providers/axiom/page.tsx`\n\n## Dependencies\n\n- `@axiomhq/js`\n\n## Environment\n\n- `AXIOM_TOKEN`\n- `AXIOM_DATASET`\n\n## Deployment Checks\n\n- Create the provider project/resource before deploying.\n- Add env vars to preview and production environments.\n- Run the included smoke route, task, worker, or helper after deploy.\n- Confirm logs do not include secrets, tokens, raw webhook payloads, or customer data.\n\n## Maintenance Rules\n\n- Keep SDK imports and examples aligned with current provider docs.\n- Keep secrets server-only and out of client components.\n- Update `module.json`, `docs.md`, and `tests/checklist.md` together when dependencies, env vars, or files change.\n- Prefer small provider adapters over coupling shared domain modules to one provider.\n"
    },
    {
      "name": "axiom",
      "target": ".stackfoundry/skills/axiom/SKILL.md",
      "content": "---\nname: axiom\ndescription: Axiom logging guidance for installed observability modules.\n---\n\n# Axiom Guidance\n\n## Installed Location\n\n- Installed target: `.stackfoundry/skills/axiom/SKILL.md`\n- Registry source: `registry/skills/axiom/SKILL.md`\n\nAgents maintaining an installed module should load this shared skill from the installed target when provider, framework, database, SDK, or platform behavior is involved. Keep provider-specific API details here instead of duplicating them inside module maintenance skills.\n\n- Keep ingest tokens server-only.\n- Document datasets and retention expectations.\n- Avoid logging secrets and private customer data.\n- Verify structured events in preview and production.\n"
    },
    {
      "name": "nextjs",
      "target": ".stackfoundry/skills/nextjs/SKILL.md",
      "content": "---\nname: nextjs\ndescription: Maintain Next.js App Router code installed by StackFoundry modules.\n---\n\n# Next.js Operating Instructions\n\n## Installed Location\n\n- Installed target: `.stackfoundry/skills/nextjs/SKILL.md`\n- Registry source: `registry/skills/nextjs/SKILL.md`\n\nAgents maintaining an installed module should load this shared skill from the installed target when provider, framework, database, SDK, or platform behavior is involved. Keep provider-specific API details here instead of duplicating them inside module maintenance skills.\n\n- Keep server-only data access out of Client Components.\n- Put route handlers under `app/api` and UI routes under the relevant App Router segment.\n- Prefer Server Components for data loading and add `\"use client\"` only for interactivity.\n- Keep public environment variables prefixed with `NEXT_PUBLIC_`; keep secrets server-only.\n- Re-run typecheck and build after changing route handlers, layouts, or shared app configuration.\n"
    }
  ],
  "envVars": {
    "AXIOM_TOKEN": "",
    "AXIOM_DATASET": ""
  },
  "docs": "# Axiom Logging Module\n\nAxiom structured event logger and server route for deployment smoke checks.\n\n## Official Docs\n\n- [Axiom Docs](https://axiom.co/docs)\n\n## Owns\n\n- `apps/web/src/lib/axiom/logger.ts`\n- `apps/web/src/app/api/providers/axiom/log/route.ts`\n- `apps/web/src/app/(console)/admin/providers/axiom/page.tsx`\n\n## Dependencies\n\n- `@axiomhq/js`\n\n## Environment\n\n- `AXIOM_TOKEN`\n- `AXIOM_DATASET`\n\n## Deployment Notes\n\n- Create the provider project/resource before deploying.\n- Add the listed environment variables to preview and production.\n- Smoke-test the included route or helper after deploy.\n- Keep provider secrets out of client components and logs.\n\n## Maintenance\n\n- Keep this module focused on the provider adapter boundary.\n- Update source examples when provider SDK APIs change.\n- Record production-specific retry, alerting, and rollback behavior before marking stable.\n",
  "meta": {
    "category": "observability",
    "env": [
      "AXIOM_TOKEN",
      "AXIOM_DATASET"
    ],
    "status": "ready",
    "maturity": "ready",
    "recommendedFor": []
  }
}
