Updates to prompts

This commit is contained in:
Mario Zechner 2025-10-17 22:44:03 +02:00
parent ffc9be8867
commit 2a7ccf0fcb
15 changed files with 911 additions and 271 deletions

View file

@ -82,13 +82,14 @@ export class ChatPanel extends LitElement {
// Set up artifacts panel
this.artifactsPanel = new ArtifactsPanel();
this.artifactsPanel.agent = agent; // Pass agent for HTML artifact runtime providers
if (config?.sandboxUrlProvider) {
this.artifactsPanel.sandboxUrlProvider = config.sandboxUrlProvider;
}
// Register the standalone tool renderer (not the panel itself)
registerToolRenderer("artifacts", new ArtifactsToolRenderer(this.artifactsPanel));
// Runtime providers factory for attachments + artifacts access
// Runtime providers factory for REPL tools (read-write access)
const runtimeProvidersFactory = () => {
const attachments: Attachment[] = [];
for (const message of this.agent!.state.messages) {
@ -105,12 +106,11 @@ export class ChatPanel extends LitElement {
providers.push(new AttachmentsRuntimeProvider(attachments));
}
// Add artifacts provider (always available)
providers.push(new ArtifactsRuntimeProvider(this.artifactsPanel!, this.agent!));
// Add artifacts provider with read-write access (for REPL)
providers.push(new ArtifactsRuntimeProvider(this.artifactsPanel!, this.agent!, true));
return providers;
};
this.artifactsPanel.runtimeProvidersFactory = runtimeProvidersFactory;
this.artifactsPanel.onArtifactsChange = () => {
const count = this.artifactsPanel?.artifacts?.size ?? 0;