MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / ManifestCard

Function ManifestCard

apps/vis/web/src/components/state/StateTab.tsx:162–204  ·  view source on GitHub ↗

Export-bundle provenance, shown above state.json for imported sessions.

({ meta }: { meta: ImportInfo })

Source from the content-addressed store, hash-verified

160
161/** Export-bundle provenance, shown above state.json for imported sessions. */
162function ManifestCard({ meta }: { meta: ImportInfo }) {
163 const m = meta.manifest;
164 const candidates: [string, string | undefined][] = [
165 ['original session', m?.sessionId],
166 ['kimi-code version', m?.kimiCodeVersion],
167 ['wire protocol', m?.wireProtocolVersion],
168 ['os', m?.os],
169 ['node', m?.nodejsVersion],
170 ['install source', m?.installSource],
171 ['workspace', m?.workspaceDir],
172 ['exported at', m?.exportedAt ? `${formatAbsoluteTime(Date.parse(m.exportedAt))} (${formatRelativeTime(Date.parse(m.exportedAt))})` : undefined],
173 ['first activity', m?.sessionFirstActivity ? formatAbsoluteTime(Date.parse(m.sessionFirstActivity)) : undefined],
174 ['last activity', m?.sessionLastActivity ? formatAbsoluteTime(Date.parse(m.sessionLastActivity)) : undefined],
175 ['imported at', `${formatAbsoluteTime(Date.parse(meta.importedAt))} (${formatRelativeTime(Date.parse(meta.importedAt))})`],
176 ['original file', meta.originalName ?? undefined],
177 ];
178 const rows = candidates
179 .filter((r): r is [string, string] => typeof r[1] === 'string' && r[1].length > 0)
180 .map(([label, value]) => ({ label, value }));
181
182 return (
183 <section className="mb-5 border border-[var(--color-cat-subagent)] bg-[color-mix(in_oklab,var(--color-cat-subagent)_8%,transparent)] p-3">
184 <div className="flex items-center gap-2">
185 <Pill tone="subagent" variant="outline">imported bundle</Pill>
186 <span className="font-mono text-[11px] uppercase tracking-[0.12em] text-fg-3">manifest</span>
187 <span className="ml-auto"><CopyButton value={JSON.stringify(meta, null, 2)} label="copy manifest" /></span>
188 </div>
189 <div className="mt-2 grid grid-cols-1 gap-x-6 gap-y-1 md:grid-cols-2">
190 {rows.map((r) => (
191 <div key={r.label} className="flex items-baseline gap-2 font-mono text-[11px]">
192 <span className="w-32 shrink-0 text-[10px] uppercase tracking-[0.1em] text-fg-3">{r.label}</span>
193 <span className="min-w-0 break-all text-fg-1">{r.value}</span>
194 </div>
195 ))}
196 </div>
197 {m === null ? (
198 <div className="mt-2 font-mono text-[11px] text-[var(--color-sev-warning)]">
199 manifest.json was missing or unreadable in this bundle
200 </div>
201 ) : null}
202 </section>
203 );
204}
205
206function TsValue({ ms, raw }: { ms: number | null; raw: string | undefined }) {
207 if (ms === null) {

Callers

nothing calls this directly

Calls 2

formatAbsoluteTimeFunction · 0.90
formatRelativeTimeFunction · 0.90

Tested by

no test coverage detected