@@ -20,14 +20,16 @@ import { TrackedMap } from 'tracked-built-ins';
20
20
import { v4 as uuidv4 } from 'uuid' ;
21
21
22
22
import {
23
- type LooseSingleCardDocument ,
24
- markdownToHtml ,
25
- splitStringIntoChunks ,
23
+ aiBotUsername ,
26
24
baseRealm ,
25
+ codeRefWithAbsoluteURL ,
26
+ getClass ,
27
27
LooseCardResource ,
28
+ markdownToHtml ,
28
29
ResolvedCodeRef ,
29
- aiBotUsername ,
30
- getClass ,
30
+ splitStringIntoChunks ,
31
+ type LooseSingleCardDocument ,
32
+ isUrlLike ,
31
33
} from '@cardstack/runtime-common' ;
32
34
33
35
import {
@@ -65,7 +67,11 @@ import { getRandomBackgroundURL, iconURLFor } from '@cardstack/host/lib/utils';
65
67
import { getMatrixProfile } from '@cardstack/host/resources/matrix-profile' ;
66
68
67
69
import type { Base64ImageField as Base64ImageFieldType } from 'https://cardstack.com/base/base64-image' ;
68
- import { BaseDef , type CardDef } from 'https://cardstack.com/base/card-api' ;
70
+ import type {
71
+ relativeTo ,
72
+ BaseDef ,
73
+ CardDef ,
74
+ } from 'https://cardstack.com/base/card-api' ;
69
75
import type * as CardAPI from 'https://cardstack.com/base/card-api' ;
70
76
import type * as FileAPI from 'https://cardstack.com/base/file-api' ;
71
77
import { type FileDef } from 'https://cardstack.com/base/file-api' ;
@@ -599,8 +605,12 @@ export default class MatrixService extends Service {
599
605
} [ ] = [ ] ;
600
606
const mappings = await basicMappings ( this . loaderService . loader ) ;
601
607
for ( let commandDef of commandDefinitions ) {
602
- const Command = await getClass (
608
+ let absoluteCodeRef = codeRefWithAbsoluteURL (
603
609
commandDef . codeRef ,
610
+ commandDef [ Symbol . for ( 'cardstack-relative-to' ) as typeof relativeTo ] ,
611
+ ) as ResolvedCodeRef ;
612
+ const Command = await getClass (
613
+ absoluteCodeRef ,
604
614
this . loaderService . loader ,
605
615
) ;
606
616
const command = new Command ( this . commandService . commandContext ) ;
0 commit comments