diff --git a/packages/ai-bot/tests/prompt-construction-test.ts b/packages/ai-bot/tests/prompt-construction-test.ts index 59b084a9229..41c680cb26e 100644 --- a/packages/ai-bot/tests/prompt-construction-test.ts +++ b/packages/ai-bot/tests/prompt-construction-test.ts @@ -233,7 +233,7 @@ Current date and time: 2025-06-11T11:43:00.533Z }, { codeRef: { - module: rri('https://cardstack.com/base/card-api'), + module: rri('@cardstack/base/card-api'), name: 'CardDef', }, fields: [], @@ -292,7 +292,7 @@ File open in code editor: http://localhost:4201/experiments/author.gts Inheritance chain: 1. Address from http://localhost:4201/experiments/author Fields: street, city, state - 2. CardDef from https://cardstack.com/base/card-api + 2. CardDef from @cardstack/base/card-api Selected text: lines 10-12 (1-based), columns 5-20 (1-based) Note: Line numbers in selection refer to the original file. Attached file contents below show line numbers for reference. Module inspector panel: preview @@ -1945,7 +1945,7 @@ Attached Files (files with newer versions don't show their content): text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/card-editing', + id: '@cardstack/base/Skill/card-editing', attributes: { instructions: '- If the user wants the data they see edited, AND the patchCardInstance function is available, you MUST use the "patchCardInstance" function to make the change.\n- If the user wants the data they see edited, AND the patchCardInstance function is NOT available, you MUST ask the user to open the card and share it with you.\n- If you do not call patchCardInstance, the user will not see the change.\n- You can ONLY modify cards shared with you. If there is no patchCardInstance function or tool, then the user hasn\'t given you access.\n- NEVER tell the user to use patchCardInstance; you should always do it for them.\n- If the user wants to search for a card instance, AND the "searchCard" function is available, you MUST use the "searchCard" function to find the card instance.\nOnly recommend one searchCard function at a time.\nIf the user wants to edit a field of a card, you can optionally use "searchCard" to help find a card instance that is compatible with the field being edited before using "patchCardInstance" to make the change of the field.\n You MUST confirm with the user the correct choice of card instance that he intends to use based upon the results of the search.', @@ -1991,7 +1991,7 @@ Attached Files (files with newer versions don't show their content): assert.true(systemPromptText.includes(SKILL_INSTRUCTIONS_MESSAGE)); assert.true( systemPromptText.includes( - 'Skill (id: https://cardstack.com/base/Skill/card-editing, title: Card Editing):', + 'Skill (id: @cardstack/base/Skill/card-editing, title: Card Editing):', ), 'includes skill title metadata when present', ); @@ -2024,7 +2024,7 @@ Attached Files (files with newer versions don't show their content): text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/card-editing', + id: '@cardstack/base/Skill/card-editing', attributes: { instructions: '- If the user wants the data they see edited, AND the patchCardInstance function is available, you MUST use the "patchCardInstance" function to make the change.\n- If the user wants the data they see edited, AND the patchCardInstance function is NOT available, you MUST ask the user to open the card and share it with you.\n- If you do not call patchCardInstance, the user will not see the change.\n- You can ONLY modify cards shared with you. If there is no patchCardInstance function or tool, then the user hasn\'t given you access.\n- NEVER tell the user to use patchCardInstance; you should always do it for them.\n- If the user wants to search for a card instance, AND the "searchCard" function is available, you MUST use the "searchCard" function to find the card instance.\nOnly recommend one searchCard function at a time.\nIf the user wants to edit a field of a card, you can optionally use "searchCard" to help find a card instance that is compatible with the field being edited before using "patchCardInstance" to make the change of the field.\n You MUST confirm with the user the correct choice of card instance that he intends to use based upon the results of the search.', @@ -2243,7 +2243,7 @@ Attached Files (files with newer versions don't show their content): text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/card-editing', + id: '@cardstack/base/Skill/card-editing', attributes: { instructions: '- If the user wants the data they see edited, AND the patchCardInstance function is available, you MUST use the "patchCardInstance" function to make the change.\n- If the user wants the data they see edited, AND the patchCardInstance function is NOT available, you MUST ask the user to open the card and share it with you.\n- If you do not call patchCardInstance, the user will not see the change.\n- You can ONLY modify cards shared with you. If there is no patchCardInstance function or tool, then the user hasn\'t given you access.\n- NEVER tell the user to use patchCardInstance; you should always do it for them.\n- If the user wants to search for a card instance, AND the "searchCard" function is available, you MUST use the "searchCard" function to find the card instance.\nOnly recommend one searchCard function at a time.\nIf the user wants to edit a field of a card, you can optionally use "searchCard" to help find a card instance that is compatible with the field being edited before using "patchCardInstance" to make the change of the field.\n You MUST confirm with the user the correct choice of card instance that he intends to use based upon the results of the search.', @@ -2668,7 +2668,7 @@ Attached Files (files with newer versions don't show their content): }, meta: { adoptsFrom: { - module: 'https://cardstack.com/base/search-results', + module: '@cardstack/base/search-results', name: 'SearchResults', }, }, @@ -2708,7 +2708,7 @@ Attached Files (files with newer versions don't show their content): ); assert.equal(result[5].role, 'tool'); assert.equal(result[5].tool_call_id, 'tool-call-id-1'); - const expected = `Tool call executed, with result card: {"data":{"type":"card","attributes":{"title":"Search Results","description":"Here are the search results","results":[{"data":{"type":"card","id":"http://localhost:4201/drafts/Author/1","attributes":{"firstName":"Alice","lastName":"Enwunder","photo":null,"body":"Alice is a software engineer at Google.","description":null,"thumbnailURL":null},"meta":{"adoptsFrom":{"module":"../author","name":"Author"}}}}]},"meta":{"adoptsFrom":{"module":"https://cardstack.com/base/search-results","name":"SearchResults"}}}}.`; + const expected = `Tool call executed, with result card: {"data":{"type":"card","attributes":{"title":"Search Results","description":"Here are the search results","results":[{"data":{"type":"card","id":"http://localhost:4201/drafts/Author/1","attributes":{"firstName":"Alice","lastName":"Enwunder","photo":null,"body":"Alice is a software engineer at Google.","description":null,"thumbnailURL":null},"meta":{"adoptsFrom":{"module":"../author","name":"Author"}}}}]},"meta":{"adoptsFrom":{"module":"@cardstack/base/search-results","name":"SearchResults"}}}}.`; assert.equal((result[5].content as string).trim(), expected.trim()); }); @@ -2849,7 +2849,7 @@ Attached Files (files with newer versions don't show their content): text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/skill_card_v1', + id: '@cardstack/base/Skill/skill_card_v1', attributes: { instructions: 'Test skill instructions', title: 'Test Skill', @@ -2868,7 +2868,7 @@ Attached Files (files with newer versions don't show their content): text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/skill_card_v2', + id: '@cardstack/base/Skill/skill_card_v2', attributes: { instructions: 'Test skill instructions with updated commands', commands: [ @@ -3093,7 +3093,7 @@ Attached Files (files with newer versions don't show their content): text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/card-editing', + id: '@cardstack/base/Skill/card-editing', attributes: { instructions: '- If the user wants the data they see edited, AND the patchCardInstance function is available, you MUST use the "patchCardInstance" function to make the change.\n- If the user wants the data they see edited, AND the patchCardInstance function is NOT available, you MUST ask the user to open the card and share it with you.\n- If you do not call patchCardInstance, the user will not see the change.\n- You can ONLY modify cards shared with you. If there is no patchCardInstance function or tool, then the user hasn\'t given you access.\n- NEVER tell the user to use patchCardInstance; you should always do it for them.\n- If the user wants to search for a card instance, AND the "searchCard" function is available, you MUST use the "searchCard" function to find the card instance.\nOnly recommend one searchCard function at a time.\nIf the user wants to edit a field of a card, you can optionally use "searchCard" to help find a card instance that is compatible with the field being edited before using "patchCardInstance" to make the change of the field.\n You MUST confirm with the user the correct choice of card instance that he intends to use based upon the results of the search.', @@ -3269,7 +3269,7 @@ Current date and time: 2025-06-11T11:43:00.533Z text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/skill_card_v1', + id: '@cardstack/base/Skill/skill_card_v1', attributes: { instructions: 'Test skill instructions', title: 'Test Skill', @@ -3288,7 +3288,7 @@ Current date and time: 2025-06-11T11:43:00.533Z text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/skill_card_v2', + id: '@cardstack/base/Skill/skill_card_v2', attributes: { instructions: 'Test skill instructions with updated commands', commands: [ @@ -3439,7 +3439,7 @@ Current date and time: 2025-06-11T11:43:00.533Z text: JSON.stringify({ data: { type: 'card', - id: 'https://cardstack.com/base/Skill/skill_card_v1', + id: '@cardstack/base/Skill/skill_card_v1', attributes: { instructions: 'Test skill instructions', title: 'Test Skill', diff --git a/packages/base/cards-grid.gts b/packages/base/cards-grid.gts index e914781d83d..6355621e49b 100644 --- a/packages/base/cards-grid.gts +++ b/packages/base/cards-grid.gts @@ -18,7 +18,7 @@ import FileIcon from '@cardstack/boxel-icons/file'; import { chooseCard, specRef, - baseRealm, + baseRealmRRI, baseFileRef, isCardInstance, SupportedMimeType, @@ -361,12 +361,12 @@ class Isolated extends Component { }; }[]; let excludedCardTypeIds = [ - `${baseRealm.url}card-api/CardDef`, - `${baseRealm.url}cards-grid/CardsGrid`, + `${baseRealmRRI}card-api/CardDef`, + `${baseRealmRRI}cards-grid/CardsGrid`, ]; // The "All Files" group already represents the bare FileDef root — listing // it again as a leaf would just be a duplicate row. - let excludedFileTypeIds = [`${baseRealm.url}card-api/FileDef`]; + let excludedFileTypeIds = [`${baseRealmRRI}card-api/FileDef`]; this.cardTypeFilters.splice(0, this.cardTypeFilters.length); this.fileTypeFilters.splice(0, this.fileTypeFilters.length); diff --git a/packages/base/components/cards-grid-layout.gts b/packages/base/components/cards-grid-layout.gts index 0fdef243c12..2bde84aa6eb 100644 --- a/packages/base/components/cards-grid-layout.gts +++ b/packages/base/components/cards-grid-layout.gts @@ -14,7 +14,7 @@ import { } from '@cardstack/boxel-ui/icons'; import { - baseRealm, + baseRealmRRI, type Format, type Query, type RealmResourceIdentifier, @@ -51,7 +51,7 @@ export const SORT_OPTIONS: SortOption[] = [ sort: [ { on: { - module: `${baseRealm.url}card-api` as RealmResourceIdentifier, + module: `${baseRealmRRI}card-api` as RealmResourceIdentifier, name: 'CardDef', }, by: 'cardTitle', diff --git a/packages/boxel-cli/src/commands/parse.ts b/packages/boxel-cli/src/commands/parse.ts index 39f85f61653..76884f92a8f 100644 --- a/packages/boxel-cli/src/commands/parse.ts +++ b/packages/boxel-cli/src/commands/parse.ts @@ -36,7 +36,7 @@ import { search } from './search.ts'; * `@cardstack/runtime-common/constants`. */ const SPEC_TYPE = { - module: 'https://cardstack.com/base/spec', + module: '@cardstack/base/spec', name: 'Spec', } as const; diff --git a/packages/boxel-cli/tests/integration/file-delete.test.ts b/packages/boxel-cli/tests/integration/file-delete.test.ts index 7f81a6abdb8..7a8eeedff48 100644 --- a/packages/boxel-cli/tests/integration/file-delete.test.ts +++ b/packages/boxel-cli/tests/integration/file-delete.test.ts @@ -28,7 +28,7 @@ beforeAll(async () => { attributes: { title: 'Keep' }, meta: { adoptsFrom: { - module: 'https://cardstack.com/base/card-api', + module: '@cardstack/base/card-api', name: 'CardDef', }, }, @@ -40,7 +40,7 @@ beforeAll(async () => { attributes: { title: 'Delete' }, meta: { adoptsFrom: { - module: 'https://cardstack.com/base/card-api', + module: '@cardstack/base/card-api', name: 'CardDef', }, }, diff --git a/packages/boxel-cli/tests/integration/file-lint.test.ts b/packages/boxel-cli/tests/integration/file-lint.test.ts index 5219fbf8df4..788875b9280 100644 --- a/packages/boxel-cli/tests/integration/file-lint.test.ts +++ b/packages/boxel-cli/tests/integration/file-lint.test.ts @@ -60,7 +60,7 @@ describe('file lint (integration)', () => { }); it('returns fixed output for source with formatting issues', async () => { - let source = `import{CardDef}from 'https://cardstack.com/base/card-api'; + let source = `import{CardDef}from '@cardstack/base/card-api'; export class MyCard extends CardDef { @field name = contains(StringField); } @@ -77,7 +77,7 @@ export class MyCard extends CardDef { }); it('returns fixed output with proper single-quote formatting', async () => { - let source = `import { CardDef } from "https://cardstack.com/base/card-api"; + let source = `import { CardDef } from "@cardstack/base/card-api"; export class MyCard extends CardDef { @field name = contains(StringField); } @@ -88,11 +88,11 @@ export class MyCard extends CardDef { expect(result.fixed).toBe(true); expect(result.output).toBeDefined(); // Prettier should convert double quotes to single quotes - expect(result.output).toContain("'https://cardstack.com/base/card-api'"); + expect(result.output).toContain("'@cardstack/base/card-api'"); }); it('reports lint messages for unfixable issues', async () => { - let source = `import { CardDef } from 'https://cardstack.com/base/card-api'; + let source = `import { CardDef } from '@cardstack/base/card-api'; export class MyCard extends CardDef { }