From 2dd31de2c8adcec54c1d2155af9eaa9ecbfc4b49 Mon Sep 17 00:00:00 2001 From: Luke Melia Date: Thu, 9 Jul 2026 13:35:50 -0400 Subject: [PATCH 1/8] Rename host tool service layer: command-service and friends -> tool naming command-service becomes tool-service (ToolService, toolService injections), MessageCommand becomes MessageTool (message-tool.ts), command-auto-execute becomes tool-auto-execute, and the definition helpers move to tool-definitions.ts / skill-tools.ts (getUniqueValidToolDefinitions, getSkillSourceTools). Matrix-service and file-def-manager method names follow: uploadToolDefinitions, getUniqueToolDefinitions, sendToolResultEvent, updateSkillsAndToolsIfNeeded, queueEventForToolProcessing. Part of the command -> tool rename (CS-12040 / CS-11788). Co-Authored-By: Claude Fable 5 --- packages/base/skill-frontmatter-field.gts | 2 +- .../ai-assistant/message/aibot-message.gts | 10 +- .../components/ai-assistant/message/index.gts | 4 +- .../ai-assistant/skill-menu/skill-toggle.gts | 10 +- .../matrix/room-message-command.gts | 16 ++-- .../app/components/matrix/room-message.gts | 10 +- packages/host/app/components/matrix/room.gts | 24 ++--- .../components/operator-mode/code-editor.gts | 8 +- .../code-submode/module-inspector.gts | 8 +- .../playground/playground-panel.gts | 6 +- .../components/operator-mode/container.gts | 6 +- .../operator-mode/create-file-modal.gts | 6 +- .../operator-mode/create-listing-modal.gts | 6 +- .../components/operator-mode/detail-panel.gts | 6 +- .../operator-mode/error-display.gts | 7 +- .../components/operator-mode/host-submode.gts | 8 +- .../operator-mode/interact-submode.gts | 8 +- .../operator-mode/preview-panel/index.gts | 6 +- .../operator-mode/publish-realm-modal.gts | 6 +- .../send-error-to-ai-assistant.gts | 6 +- packages/host/app/lib/file-def-manager.ts | 10 +- .../app/lib/matrix-classes/message-builder.ts | 20 ++-- .../message-code-patch-result.ts | 4 +- .../{message-command.ts => message-tool.ts} | 8 +- .../host/app/lib/matrix-classes/message.ts | 14 +-- .../lib/{skill-commands.ts => skill-tools.ts} | 2 +- ...d-auto-execute.ts => tool-auto-execute.ts} | 8 +- ...and-definitions.ts => tool-definitions.ts} | 2 +- packages/host/app/resources/code-diff.ts | 6 +- packages/host/app/resources/room.ts | 10 +- .../services/ai-assistant-panel-service.ts | 10 +- .../host/app/services/matrix-sdk-loader.ts | 4 +- packages/host/app/services/matrix-service.ts | 40 ++++---- packages/host/app/services/store.ts | 4 +- .../{command-service.ts => tool-service.ts} | 32 +++---- .../host/app/templates/host-freestyle.gts | 6 +- packages/host/app/templates/index.gts | 7 +- packages/host/app/tools/check-correctness.ts | 8 +- .../app/tools/create-ai-assistant-room.ts | 10 +- .../host/app/tools/generate-readme-spec.ts | 8 +- packages/host/app/tools/migrate-skill.ts | 2 +- .../host/app/tools/one-shot-llm-request.ts | 10 +- .../host/app/tools/patch-card-instance.ts | 7 +- packages/host/app/tools/patch-code.ts | 6 +- .../app/tools/populate-with-sample-data.ts | 4 +- .../app/tools/send-ai-assistant-message.ts | 6 +- packages/host/app/tools/summarize-session.ts | 6 +- packages/host/app/tools/update-room-skills.ts | 10 +- .../tests/acceptance/code-patches-test.gts | 10 +- .../acceptance/code-submode/file-tree-test.ts | 4 +- packages/host/tests/helpers/index.gts | 2 +- .../host/tests/helpers/mock-matrix/_client.ts | 6 +- ...-field-to-card-definition-command-test.gts | 8 +- .../commands/apply-markdown-edit-test.gts | 2 +- .../apply-search-replace-block-test.gts | 64 ++++++------- .../commands/authed-fetch-test.gts | 8 +- .../commands/bot-registration-test.gts | 14 +-- .../commands/can-read-realm-test.gts | 8 +- .../commands/cancel-indexing-job-test.gts | 4 +- .../commands/check-correctness-test.gts | 32 +++---- .../check-domain-availability-test.gts | 4 +- .../commands/commands-calling-test.gts | 4 +- .../commands/copy-and-edit-test.gts | 28 +++--- .../integration/commands/copy-card-test.gts | 16 ++-- .../commands/copy-file-to-realm-test.gts | 18 ++-- .../integration/commands/copy-source-test.gts | 6 +- .../create-listing-pr-request-test.gts | 12 +-- .../integration/commands/create-spec-test.gts | 4 +- .../commands/evaluate-module-test.gts | 8 +- .../execute-atomic-operations-test.gts | 8 +- .../commands/fetch-card-json-test.gts | 4 +- .../commands/full-reindex-realm-test.gts | 12 +-- .../generate-example-cards-one-shot-test.gts | 4 +- .../get-available-realm-identifiers-test.gts | 4 +- .../get-catalog-realm-identifiers-test.gts | 4 +- .../get-default-writable-realm-test.gts | 8 +- .../commands/get-published-realms-test.gts | 4 +- .../get-realm-of-resource-identifier-test.gts | 8 +- .../commands/get-user-system-card-test.gts | 8 +- .../commands/instantiate-card-test.gts | 12 +-- .../invalidate-realm-identifiers-test.gts | 8 +- .../commands/invite-user-to-room-test.gts | 8 +- .../commands/migrate-skill-test.gts | 8 +- .../open-create-listing-modal-test.gts | 24 ++--- .../commands/open-workspace-test.gts | 4 +- .../integration/commands/patch-code-test.gts | 16 ++-- .../commands/patch-fields-test.gts | 94 +++++++++---------- .../commands/patch-instance-test.gts | 22 ++--- .../persist-module-inspector-view-test.gts | 4 +- .../commands/preview-format-test.gts | 2 +- .../commands/publish-realm-test.gts | 4 +- .../read-card-for-ai-assistant-test.gts | 6 +- .../read-file-for-ai-assistant-test.gts | 6 +- .../integration/commands/read-source-test.gts | 4 +- .../commands/read-text-file-test.gts | 6 +- .../commands/reindex-realm-test.gts | 16 ++-- .../commands/sanitize-module-list-test.gts | 12 +-- .../commands/schema-generation-test.gts | 2 +- .../commands/search-and-choose-test.gts | 4 +- .../commands/search-command-test.gts | 8 +- .../commands/search-google-images-test.gts | 16 ++-- .../send-ai-assistant-message-test.gts | 4 +- .../commands/send-bot-trigger-event-test.gts | 4 +- .../commands/send-request-via-proxy-test.gts | 56 +++++------ .../commands/set-user-system-card-test.gts | 12 +-- .../integration/commands/show-card-test.gts | 2 +- .../integration/commands/store-add-test.gts | 4 +- .../commands/summarize-session-test.gts | 24 ++--- .../commands/switch-submode-test.gts | 24 ++--- .../commands/sync-openrouter-models-test.gts | 6 +- .../commands/transform-cards-test.gts | 26 ++--- .../commands/unpublish-realm-test.gts | 4 +- .../commands/update-room-skills-test.gts | 18 ++-- .../commands/use-ai-assistant-test.gts | 34 +++---- .../commands/validate-realm-test.gts | 8 +- .../commands/write-binary-file-test.gts | 16 ++-- .../commands/write-text-file-test.gts | 36 +++---- .../ai-assistant-panel/commands-test.gts | 28 +++--- .../components/realm-field-test.gts | 4 +- .../tests/unit/is-markdown-skill-id-test.ts | 2 +- .../unit/lib/command-auto-execute-test.ts | 6 +- .../unit/lib/command-definitions-test.ts | 6 +- packages/matrix/tests/commands.spec.ts | 2 +- 123 files changed, 664 insertions(+), 701 deletions(-) rename packages/host/app/lib/matrix-classes/{message-command.ts => message-tool.ts} (92%) rename packages/host/app/lib/{skill-commands.ts => skill-tools.ts} (99%) rename packages/host/app/lib/{command-auto-execute.ts => tool-auto-execute.ts} (83%) rename packages/host/app/lib/{command-definitions.ts => tool-definitions.ts} (95%) rename packages/host/app/services/{command-service.ts => tool-service.ts} (97%) diff --git a/packages/base/skill-frontmatter-field.gts b/packages/base/skill-frontmatter-field.gts index 726fd330ba..9e39039dd9 100644 --- a/packages/base/skill-frontmatter-field.gts +++ b/packages/base/skill-frontmatter-field.gts @@ -24,7 +24,7 @@ export class SkillFrontmatterField extends FrontmatterField { // Legacy spelling of `tools`. Index rows extracted before the // command -> tool rename persist the value under a `commands` attribute; // this field lets those rows rehydrate without a reindex. Consumers read - // `tools` and fall back to this (see the host's `getSkillSourceCommands`). + // `tools` and fall back to this (see the host's `getSkillSourceTools`). // Remove once all realms have reindexed post-rename. @field commands = containsMany(ToolField); diff --git a/packages/host/app/components/ai-assistant/message/aibot-message.gts b/packages/host/app/components/ai-assistant/message/aibot-message.gts index 9123c7d1e9..e40731e475 100644 --- a/packages/host/app/components/ai-assistant/message/aibot-message.gts +++ b/packages/host/app/components/ai-assistant/message/aibot-message.gts @@ -31,8 +31,8 @@ import { parseSearchReplace } from '@cardstack/host/lib/search-replace-block-par import { getCodeDiffResultResource } from '@cardstack/host/resources/code-diff'; -import type CommandService from '@cardstack/host/services/command-service'; import type { MonacoSDK } from '@cardstack/host/services/monaco-service'; +import type ToolService from '@cardstack/host/services/tool-service'; import type { CodePatchStatus } from 'https://cardstack.com/base/matrix-event'; @@ -60,7 +60,7 @@ interface Signature { } export default class FormattedAiBotMessage extends Component { - @service declare private commandService: CommandService; + @service declare private toolService: ToolService; @cached private get reasoningHtml() { @@ -80,7 +80,7 @@ export default class FormattedAiBotMessage extends Component { }; private codePatchStatus = (codeData: CodeData) => { - return this.commandService.getCodePatchStatus(codeData); + return this.toolService.getCodePatchStatus(codeData); };