-
Navigate to the SAP Notes page using the Playwright MCP tool:
- Use
browser_navigate to go to https://me.sap.com/notes/3437766
- Use
browser_wait_for to wait for Availability of Generative AI Models
- If the page shows a login screen, tell the user to log in to me.sap.com in the Playwright browser window and wait for their confirmation, then retry.
-
Extract the model tables (then close the browser tab when done):
- Read
scripts/extract-model-table.js and pass its contents as the function body to browser_evaluate.
- The script returns either
{ active: [...], retired: [...] } (success) or { error: '...' } (failure).
- If the result is an error or
result.active is empty, the session has expired — tell the user to log in to me.sap.com in the Playwright browser window and wait for their confirmation, then retry.
- On success, sync models into
scripts/sap-models.json:
- Remove duplicate scraped rows, keeping the latest version first: both tables include a
Version column.
When result.active or result.retired contains multiple rows for the same model name, compare their version strings and keep only the row with the latest version (use your judgment — versions may be date-like 2024-11-20, semantic 1.2, or arbitrary strings; pick the one a human would call newest).
Discard the older-versioned rows entirely.
- Status is determined by the latest version only: if the latest-versioned row of a model is active (not deprecated/retired), treat the model as active even if older-versioned rows are marked deprecated or retired.
Conversely, only treat a model as deprecated/retired when its latest version carries that status.
- For each de-duplicated model in
result.active: update the existing entry matched by model field (update all fields including version), or append it if not already present.
Clear the retired field (set to "") if it was previously set.
- For each de-duplicated model in
result.retired: if already present in sap-models.json, set retired: "yes" and update suggestedReplacement and version from result.retired. If not present at all, append a new entry with retired: "yes" and the fields from result.retired (set availableInOrchestration: "", deprecated: "", retirementDate: "").
- Do not remove any entries from
sap-models.json — retired models stay in the file with retired: "yes".
- If both
result.active and result.retired list a model (after per-table de-duplication), treat it as retired.
- After merging, verify no duplicate
model values exist in sap-models.json. If any remain, remove the older/less-complete entry and report the duplicate removal to the user.
- Close the browser tab using
browser_close to avoid stale session issues on future runs.
-
Patch model-types.ts by running the sync script:
pnpm tsx scripts/sync-model-types.ts
If the output ends with a ⚠ Skipped N model(s) warning, show the user the listed model names and their executableId values and ask whether they want to add a mapping.
If yes, add the appropriate entry to EXECUTABLE_ID_TO_TYPE in scripts/sync-model-types.ts and re-run the script before proceeding.
The script also checks which synced models are available in your landscape using the foundation-models API.
-
Sync the deprecated models table in docs-js/overview.mdx (SAP/ai-sdk repository):
a. Clone the SAP/ai-sdk repository into a temp directory:
DOCS_DIR=$(mktemp -d)
git clone --depth=1 https://github.com/SAP/ai-sdk "$DOCS_DIR"
b. Using the Edit tool, make the following targeted changes to $DOCS_DIR/docs-js/overview.mdx:
- Remove rows where the model has
retired: "yes" in sap-models.json — note removed models to the user.
Only list models that are still active (not retired) but deprecated (deprecated: "yes" or retirement date set in sap-models.json). Fully retired models must be removed from the table.
- Update the replacement cell of any existing row whose replacement differs from the script output.
If the replacement is not listed in
sap-models.json add it as <!-- MODEL_NAME --> in the cell so the user can decide how to handle it.
- Append rows for newly deprecated models (not yet in the table) to the bottom, one per line.
Preserve existing row order — new entries go at the end.
c. Use the Edit tool to replace the entire markdown table (header row through last data row) in $DOCS_DIR/docs-js/overview.mdx. Write rows without padding — lint:fix will normalize column widths.
d. Run install, lint fix, and build to verify:
cd "$DOCS_DIR" && npm ci && npm run lint:fix && npm run build
If any step fails, show the error to the user and stop.
e. Show the diff:
git -C "$DOCS_DIR" diff docs-js/overview.mdx
-
Check for deprecated model usage in the ai-sdk-js codebase:
- From
scripts/sap-models.json, collect names of all models where retired is "yes", deprecated is "yes", or a retirement date is set.
- Grep the repository for any of those model names (exclude
scripts/sap-models.json itself, packages/core/src/model-types.ts, OpenAPI specs and generated files like packages/*/src/client/**/*.ts).
- If matches are found, report them to the user so they can decide whether to update or remove those usages.
-
Show the ai-sdk-js diff to the user:
git diff packages/core/src/model-types.ts
If neither file changed, tell the user everything is already up to date and stop.
-
Ask the user if they want to open PRs with these changes.
-
If yes, create branches and open PRs — one per repository:
ai-sdk-js (model types):
git checkout -b model-types-update/$(date +%Y-%m-%d)
git add scripts/sap-models.json packages/core/src/model-types.ts
git commit -m "chore: sync model types from SAP Notes 3437766"
gh pr create --draft --base main --title "chore: Sync model types from SAP Notes" --body "Automated sync of model types from [SAP Notes 3437766](https://me.sap.com/notes/3437766).\n\n## Changes\n\nUpdated LiteralUnion type blocks in \`packages/core/src/model-types.ts\` to reflect current model availability.\n\n## Definition of Done\n- [ ] Model names are correct\n- [ ] Compilation passes\n- [ ] Release notes / Changeset updated if needed"
SAP/ai-sdk (docs), if docs-js/overview.mdx changed:
BRANCH="docs/update-deprecated-models-js-$(date +%Y-%m-%d)"
git -C "$DOCS_DIR" checkout -b "$BRANCH"
git -C "$DOCS_DIR" add docs-js/overview.mdx
git -C "$DOCS_DIR" commit -m "docs: update deprecated models table"
git -C "$DOCS_DIR" push origin "$BRANCH"
gh pr create --draft --repo SAP/ai-sdk --base main --head "$BRANCH" \
--title "docs: Update deprecated models table" \
--body "Sync of the deprecated models table in \`docs-js/overview.mdx\` from [SAP Notes 3437766](https://me.sap.com/notes/3437766).\n\n## Changes\n\n- Added newly deprecated models\n- Removed retired models (no longer listed in SAP Notes)\n- Updated replacement suggestions\n\n## Definition of Done\n- [ ] Table entries are correct\n- [ ] Retired models removed\n- [ ] Replacement suggestions accurate"