Skip to content

Update Roam API types from current docs - #66

Open
mdroidian wants to merge 6 commits into
mainfrom
codex/update-roam-api-types
Open

Update Roam API types from current docs#66
mdroidian wants to merge 6 commits into
mainfrom
codex/update-roam-api-types

Conversation

@mdroidian

@mdroidian mdroidian commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prepare roamjs-components 0.91.0 with Roam Alpha API and Extension API declarations aligned with the current developer documentation. This fixes missing API surfaces and incorrect argument/return types for extension consumers.

  • Add search, markdown import, comments, context menus, custom views, callouts, AI tools, and extension settings/slash-command types.
  • Require documented block/page write fields while preserving custom props on both blocks and pages. Model deletion results on namespaced methods and legacy aliases.
  • Correct sidebar input identifiers and response variants, pull-watch call forms, and conditional query/render options, including computed booleans.
  • Infer File, base64 metadata, or their union from file.get options. Allow synchronous asTokenUser callbacks to return write promises and document that writes must be issued before any await.
  • Add compile-only API contract and regression tests to CI alongside the existing React host unit tests.
  • Update the package and lockfile to 0.91.0 and add release notes while retaining the 0.90.0 React host changes.

Validation

  • npm run test:types
  • npm run test:unit — 2 passing tests
  • npm run build
  • npm run lint
  • git diff --check

Live verification on Roam API 1.1.5 used an authenticated DG Playwright test slot and a temporary developer extension receiving the real ExtensionAPI from Roam. Passed coverage:

  • Page/block props and writes, legacy aliases, reorder/move readback, comments, markdown creation, and existing/missing deletion results.
  • Sync/async/fast reads, search aliases, grouped/ungrouped queries, and pull-watch callbacks/removal.
  • Sidebar window variants and state operations, filter roundtrips, page-graph callbacks, custom main-window React views, and block rendering/unmounting.
  • Global and extension command-palette/slash UI invocation, slash insertion/context, all six context-menu registration/removal APIs, and block/page context-menu UI callbacks.
  • Extension settings JSON storage, invalid-key rejection, switch/input/select/button callbacks and persistence, and a rendered React settings row.
  • Async extension load/cleanup/unload, with automatic removal of settings, commands, slash entries, and namespaced AI tools.
  • AI tool discovery and direct JS invocation, input-schema rejection before handler execution, and asTokenUser preserving a synchronously issued write promise. This did not use an AI token.
  • Synthetic file upload, File/base64 retrieval variants, and deletion.

Temporary pages, comments, uploaded file, UI registrations and the developer extension were removed. Developer mode was restored to its original setting. Temporary-page and settings-panel screenshots were inspected. The initial smoke pass captured no page errors; later checks used explicit runtime/UI assertions rather than a comprehensive error-log gate.

Observed documentation differences: reorder/sidebar-add resolve to null in this build, while their declarations intentionally expose an unused void return; a command callback receives an unused null argument. No new consumer-facing type defect was demonstrated by this pass.

Not verified: authenticated AI token attribution/scope enforcement; semantic-search results (embeddings disabled); admin/read-only and multi-user permission cases; whole-graph/multiselect/drag-drop and every context-menu/rendering variant; persistent reload across browser restarts; other platforms; global undo/redo or removal of all watches. The full repository Playwright integration suite was not run. Committed API examples remain compile-only tests.

Documentation

Compared against the live Developer Hub, Roam Alpha API, and the roamdocs.fyi mirror, including the Extension API reference.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 3d83914b-42b3-4319-9245-21c97b4ad1fc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mdroidian mdroidian left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct links to the exact Roam documentation blocks used for these type additions.

Comment thread src/types/index.ts
Comment thread src/types/index.ts
Comment thread src/types/index.ts
Comment thread src/types/index.ts
Comment thread src/types/index.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18099292d2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts

@mdroidian mdroidian left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up documentation links for the contracts tightened after the independent audit.

Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/index.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3668acafd6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts

@mdroidian mdroidian left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh-context audit follow-up. Each corrected contract below includes a screenshot of the exact live Roam documentation block that informed the line.

Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts
Comment thread src/types/native.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d776fcbd72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts
@mdroidian
mdroidian force-pushed the codex/update-roam-api-types branch from d776fcb to b0b3d06 Compare August 24, 2026 20:19
@mdroidian

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0b3d067fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts
Comment thread src/types/native.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83fb4a0aca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts Outdated
@mdroidian

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83fb4a0aca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts
@mdroidian
mdroidian force-pushed the codex/update-roam-api-types branch from 83fb4a0 to d55ed6d Compare September 7, 2026 07:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T07:12:49.882124Z d55ed6d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d55ed6d849

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/types/native.ts
Comment on lines +884 to +885
"disable-hotkey"?: boolean;
"default-hotkey"?: string | string[];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep extension command hotkey options camel-cased

When an extension registers a command through extensionAPI.ui.commandPalette.addCommand using the previously supported defaultHotkey or disableHotkey properties, this change rejects the command as an excess-property error. The kebab-cased names belong to the raw window.roamAlphaAPI command shape; retain the camel-cased options on AddCommandOptions so existing extension consumers continue to compile.

Useful? React with 👍 / 👎.

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