Skip to content

refactor: align with AD4M resolveLiteral API (companion to coasys/ad4m#842)#78

Open
HexaField wants to merge 1 commit into
coasys:devfrom
HexaField:refactor/typed-rdf-literals-and-fn-cleanup
Open

refactor: align with AD4M resolveLiteral API (companion to coasys/ad4m#842)#78
HexaField wants to merge 1 commit into
coasys:devfrom
HexaField:refactor/typed-rdf-literals-and-fn-cleanup

Conversation

@HexaField

Copy link
Copy Markdown
Contributor

Summary

Companion PR to coasys/ad4m#842 — updates the WE codebase to use the new resolveLiteral: boolean decorator property in place of the removed resolveLanguage: string.

Changes

Model decorators (7 files, 12 properties)

  • resolveLanguage: FILE_STORAGE_LANGUAGEresolveLiteral: false on all file-storage @Property decorators
  • Removed now-unused FILE_STORAGE_LANGUAGE imports from model files (Theme, Template, Space, ImageBlock, FileBlock, CollectionBlock, AudioBlock)
  • AgentProfile.ts was already deleted upstream — no changes needed

Runtime metadata reads (serialization.ts)

  • preUploadFileAssets(): detection changed from meta.resolveLanguage to meta.resolveLiteral === false; createExpression call now uses imported FILE_STORAGE_LANGUAGE constant directly (since resolveLiteral is boolean and doesn't carry the language address)
  • resolveExpressionAddresses(): same detection change for the read-side counterpart

Type definitions

  • ModelManifestProperty.resolveLanguage?: stringresolveLiteral?: boolean (AdamStore.tsx)
  • SHACL shape mapping updated to read p.resolveLiteral (perspectiveHelpers.ts)

Comments

  • Updated all references to "resolveLanguage" in comments/docs across serialization.ts, utils.ts, fileTransforms.ts, imageHelpers.ts, syncHelpers.ts

Notes

  • FILE_STORAGE_LANGUAGE constant remains exported from @we/models — it's still used by agentHelpers.ts (profile image uploads) and now by serialization.ts (block file-asset uploads)
  • Category 4 (.get().data.get()) was already correct in the codebase — no change needed

Test plan

  • Verify model decorators compile against updated @coasys/ad4m with resolveLiteral support
  • Test file upload flow (image/audio/file blocks) — confirm preUploadFileAssets correctly detects and uploads FileData
  • Test file resolution flow — confirm resolveExpressionAddresses correctly resolves CIDs to data URIs
  • Verify SHACL manifest generation picks up resolveLiteral from shapes

🤖 Generated with Claude Code

@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for coasys-we failed. Why did it fail? →

Name Link
🔨 Latest commit 4ffa620
🔍 Latest deploy log https://app.netlify.com/projects/coasys-we/deploys/6a319852b3625f00082082c3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant