alink-cli 0.12.5 → 0.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.mjs CHANGED
@@ -45970,11 +45970,21 @@ const issueAssetUrl = fn("AssetAccess.issueAssetUrl")(function* (input) {
45970
45970
  switch (input.resource._tag) {
45971
45971
  case "workspace-file": {
45972
45972
  if (!input.workspaceRoot) return yield* new AssetWorkspaceContextNotFoundError({ resource: input.resource });
45973
- const workspaceRoot = yield* workspacePaths.normalizeWorkspaceRoot(input.workspaceRoot).pipe(mapError((cause) => new AssetWorkspaceRootNormalizationError({
45973
+ let workspaceRoot = yield* workspacePaths.normalizeWorkspaceRoot(input.workspaceRoot).pipe(mapError((cause) => new AssetWorkspaceRootNormalizationError({
45974
45974
  resource: input.resource,
45975
45975
  cause
45976
45976
  })));
45977
- const relativePath = path.isAbsolute(input.resource.path) ? path.relative(workspaceRoot, input.resource.path) : input.resource.path;
45977
+ let relativePath = path.isAbsolute(input.resource.path) ? path.relative(workspaceRoot, input.resource.path) : input.resource.path;
45978
+ const isImage = isWorkspaceImagePreviewPath(input.resource.path);
45979
+ if (isImage) {
45980
+ const imagePath = yield* optionOnNotFound(fileSystem.realPath(path.resolve(workspaceRoot, input.resource.path))).pipe(mapError((cause) => new AssetWorkspaceAssetInspectionError({
45981
+ resource: input.resource,
45982
+ cause
45983
+ })));
45984
+ if (isNone(imagePath)) return yield* new AssetWorkspaceAssetNotFoundError({ resource: input.resource });
45985
+ workspaceRoot = path.dirname(imagePath.value);
45986
+ relativePath = path.basename(imagePath.value);
45987
+ }
45978
45988
  const resolved = yield* workspacePaths.resolveRelativePathWithinRoot({
45979
45989
  workspaceRoot,
45980
45990
  relativePath
@@ -45994,7 +46004,7 @@ const issueAssetUrl = fn("AssetAccess.issueAssetUrl")(function* (input) {
45994
46004
  resource: input.resource,
45995
46005
  cause
45996
46006
  })));
45997
- claims = isWorkspaceImagePreviewPath(resolved.relativePath) ? {
46007
+ claims = isImage ? {
45998
46008
  version: 1,
45999
46009
  kind: "workspace-file-exact",
46000
46010
  workspaceRoot: canonicalWorkspaceRoot,