diff --git a/packages/ai-bot/tests/prompt-construction-test.ts b/packages/ai-bot/tests/prompt-construction-test.ts index a8a457be9f..9590786c9f 100644 --- a/packages/ai-bot/tests/prompt-construction-test.ts +++ b/packages/ai-bot/tests/prompt-construction-test.ts @@ -7343,7 +7343,7 @@ module('markdown skills', () => { }); }); -module('markdown skill commands', (hooks) => { +module('markdown skill tools', (hooks) => { let fakeMatrixClient: FakeMatrixClient; let mockResponses: Map; let originalFetch: any; diff --git a/packages/base/ai-app-generator.gts b/packages/base/ai-app-generator.gts index 42725144f6..5280bd76d1 100644 --- a/packages/base/ai-app-generator.gts +++ b/packages/base/ai-app-generator.gts @@ -49,12 +49,12 @@ export class AiAppGenerator extends CardDef { }; askAi = restartableTask(async () => { - let commandContext = this.args.context?.commandContext; - if (!commandContext) { + let toolContext = this.args.context?.toolContext; + if (!toolContext) { throw new Error('No command context found'); } - let command = new AskAiTool(commandContext); + let command = new AskAiTool(toolContext); await command.execute( new AskAiInput({ prompt: this.args.model.promptValue, diff --git a/packages/base/card-api.gts b/packages/base/card-api.gts index eac330aeba..30786ec08c 100644 --- a/packages/base/card-api.gts +++ b/packages/base/card-api.gts @@ -348,6 +348,10 @@ interface RelationshipOptions extends Options { } export interface CardContext { + toolContext?: ToolContext; + // Pre-rename spelling of `toolContext`. Realm content reads + // `@context.commandContext`; populated with the same value until no + // deployed content references it. commandContext?: ToolContext; cardComponentModifier?: typeof Modifier<{ Args: { @@ -3280,16 +3284,16 @@ export class Theme extends CardDef { [getMenuItems](params: GetMenuItemParams): MenuItemOptions[] { let menuItems = super[getMenuItems](params); - if (params.menuContext === 'interact' && params.commandContext && this.id) { + if (params.menuContext === 'interact' && params.toolContext && this.id) { menuItems = [ ...menuItems, { label: 'Copy and Edit', action: async () => { - if (!params.commandContext || !this.id) { + if (!params.toolContext || !this.id) { return; } - let cmd = new CopyAndEditTool(params.commandContext); + let cmd = new CopyAndEditTool(params.toolContext); await cmd.execute({ card: this, }); @@ -3300,7 +3304,7 @@ export class Theme extends CardDef { { label: 'Modify Theme via AI', action: async () => { - let cmd = new PatchThemeTool(params.commandContext); + let cmd = new PatchThemeTool(params.toolContext); await cmd.execute({ cardId: this.id as unknown as string, }); diff --git a/packages/base/commands/search-card-result.gts b/packages/base/commands/search-card-result.gts index c62267eb11..013f7ec7ce 100644 --- a/packages/base/commands/search-card-result.gts +++ b/packages/base/commands/search-card-result.gts @@ -181,7 +181,7 @@ class SearchCardsResultEmbeddedView extends Component< }