feat(artifact): add /artifacts slash command entry

Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
This commit is contained in:
claude-code-best
2026-06-20 16:57:59 +08:00
parent 388840a4b4
commit 6e6a7419f2
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import * as React from 'react';
import type { LocalJSXCommandOnDone } from 'src/types/command.js';
import type { ToolUseContext } from 'src/Tool.js';
import { ArtifactsMenu } from './ArtifactsMenu.js';
import { extractArtifacts } from './scanner.js';
export async function call(onDone: LocalJSXCommandOnDone, context: ToolUseContext): Promise<React.ReactNode> {
const messages = context.messages ?? [];
const artifacts = extractArtifacts(messages);
return <ArtifactsMenu artifacts={artifacts} onExit={onDone} />;
}

View File

@@ -0,0 +1,13 @@
import type { Command } from '../../commands.js'
const artifacts = {
type: 'local-jsx',
name: 'artifacts',
description:
'List HTML artifacts uploaded to cloud-artifacts in this session',
isEnabled: () => true,
userFacingName: () => 'Artifacts',
load: () => import('./artifacts.js'),
} satisfies Command
export default artifacts