Skip to content

Commit 6e6a741

Browse files
claude-code-bestglm-5.2
andcommitted
feat(artifact): add /artifacts slash command entry
Co-Authored-By: glm-5.2 <zai-org@claude-code-best.win>
1 parent 388840a commit 6e6a741

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import * as React from 'react';
2+
import type { LocalJSXCommandOnDone } from 'src/types/command.js';
3+
import type { ToolUseContext } from 'src/Tool.js';
4+
import { ArtifactsMenu } from './ArtifactsMenu.js';
5+
import { extractArtifacts } from './scanner.js';
6+
7+
export async function call(onDone: LocalJSXCommandOnDone, context: ToolUseContext): Promise<React.ReactNode> {
8+
const messages = context.messages ?? [];
9+
const artifacts = extractArtifacts(messages);
10+
return <ArtifactsMenu artifacts={artifacts} onExit={onDone} />;
11+
}

src/commands/artifacts/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { Command } from '../../commands.js'
2+
3+
const artifacts = {
4+
type: 'local-jsx',
5+
name: 'artifacts',
6+
description:
7+
'List HTML artifacts uploaded to cloud-artifacts in this session',
8+
isEnabled: () => true,
9+
userFacingName: () => 'Artifacts',
10+
load: () => import('./artifacts.js'),
11+
} satisfies Command
12+
13+
export default artifacts

0 commit comments

Comments
 (0)