Kanshō

Docs / Sandbox and code /

GeneratedFileCard

Card for a file the agent created or modified: filename, language, and content preview.

Preview

AuthForm.tsx

src/components/AuthForm.tsx

+82 lines3.1 KB
Ready

auth.ts

src/lib/auth.ts

+36 −4 lines1.4 KB
Modified

schema.prisma

prisma/schema.prisma

+14 lines2.8 KB
Ready

seed.ts

prisma/seed.ts

Generating

Variants

File list

AuthForm.tsx

src/components/AuthForm.tsx

+82 lines3.1 KB
Ready

auth.ts

src/lib/auth.ts

+36 −4 lines1.4 KB
Modified

schema.prisma

prisma/schema.prisma

+14 lines2.8 KB
Ready

seed.ts

prisma/seed.ts

Generating

Atoms

TabStrip

CodeRelevanceAnnotation

Agent editToken signing updated to use RS256kansho-agent

The agent replaced HS256 with RS256 and updated the secret to use a PEM key pair for better security posture.

    src/lib/auth.ts:9–12new SignJWT({ sub: userId })
    src/lib/auth.ts:16await jwtVerify(token, PUBLIC_KEY)
Failing testverifyJWT › rejects expired tokensvitest

Expected AuthError but received JWTExpired from the jose library. The error class needs to be caught and re-thrown.

    src/lib/auth.test.ts:34expect(() => verifyJWT(expired)).toThrow(AuthError)

Props

PropTypeDescription
name*stringDisplay file name including extension (e.g. 'AuthForm.tsx').
pathstringRelative path from the project root shown below the name.
sizestringHuman-readable file size (e.g. '4.2 KB').
deltastringLine count delta (e.g. '+48 lines').
status*"generating" | "ready" | "modified" | "failed" | "skipped"Current file status — controls the status pill.
messagestringShort message shown for failed or skipped states.
onOpen() => voidWhen provided, shows an open-in-editor button.
onDiff() => voidWhen provided, shows a diff button.
classNamestringAdditional class names for the root element.

* required.

Usage

import { GeneratedFileCard } from "@/components/sandbox/generated-file-card";

<GeneratedFileCard
  name="AuthForm.tsx"
  path="src/components/AuthForm.tsx"
  size="3.1 KB"
  delta="+82 lines"
  status="ready"
  onOpen={() => openFile("src/components/AuthForm.tsx")}
  onDiff={() => showDiff("src/components/AuthForm.tsx")}
/>