Skip to content

feat: add Microsoft Designer as image provider (#6672) - #7609

Merged
diegosouzapw merged 3 commits into
release/v3.8.49from
feat/6672-microsoftdesigner-image-provider
Jul 17, 2026
Merged

diegosouzapw merged 3 commits into
release/v3.8.49from
feat/6672-microsoftdesigner-image-provider

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Closes #6672

What was built

Adds microsoft-designer-web — an unofficial, reverse-engineered Bearer-token web-session image provider (matches the existing chatgpt-web/copilot-web/copilot-m365-web "-web" provider category), reverse-engineered from the g4f MicrosoftDesigner.py provider reference (fetched and verified during #6672 triage).

  • Provider registration: microsoft-designer-web entry in WEB_COOKIE_PROVIDERS (src/shared/constants/providers/web-cookie.ts) and IMAGE_PROVIDERS (open-sse/config/imageRegistry.ts, new "designer-web" format), modeled on copilot-m365-web's access-token auth UX.
  • New handler (open-sse/handlers/imageGeneration/providers/designerWeb.ts): implements the submit-then-poll DallE.ashx?action=GetDallEImagesCogSci flow — Bearer access_token + ClientId/SessionId/UserId headers, form-encoded POST, poll until image_urls_thumbnail[].ImageUrl is populated (bounded by a timeout), wired into handleImageGeneration()'s format dispatch.
  • Public credential: the upstream ClientId header is a fixed, publicly-shared value every Designer browser session sends (not a secret) — routed through resolvePublicCred("microsoft_designer_client_id") per Hard Rule chore(ui): rebrand to OmniRoute #11, never as a string literal.
  • Credential UX: registered the token-based credential requirement in webSessionCredentials.ts so the provider-connect UI asks for the right field; connection validation falls back to the existing generic web-cookie session-ping validator (validateWebCookieProvider) — no dedicated validator needed.
  • File-size compliance: extracted the KIE image-model catalog into a co-located open-sse/config/providers/registry/kie/models.ts module (mirrors the existing lmarena/directModels.ts pattern) to keep imageRegistry.ts under the 800-line cap while adding the new provider entry (789 → 753 → 767 lines).
  • Docs: regenerated docs/reference/PROVIDER_REFERENCE.md (250 → 251 providers) and updated the plain-text provider counts in README.md, AGENTS.md, CLAUDE.md (anchors/badges/historical changelog mentions of "250" left untouched per the docs-counts gate's guidance).
  • Changelog: changelog.d/features/6672-microsoftdesigner-image-provider.md.

Validation gate (Hard Rule #18 — TDD)

tests/unit/microsoft-designer-web-6672.test.ts — 16 cases, all pass under node --import tsx/esm --test:

  • registry-entry shape assertions (WEB_COOKIE_PROVIDERS/IMAGE_PROVIDERS)
  • the resolvePublicCred() shape assertion required for any embedded public credential (Hard Rule chore(ui): rebrand to OmniRoute #11) — asserts the raw ClientId literal never appears in designerWeb.ts
  • pure helpers: mapDesignerWebImageSize, buildDesignerWebHeaders, buildDesignerWebFormBody, parseDesignerWebResponse
  • the handler's submit/poll/success/error/timeout paths driven against a mocked fetch (fetchImpl injection point) — no live Microsoft Designer session required
ℹ tests 16
ℹ pass 16
ℹ fail 0

Caveat: the exact upstream response shape (submit vs. poll, polling_response.polling_meta_data fields) has not been validated against a live Designer session — it follows the g4f reference as closely as possible without a live HAR capture. Flagging this explicitly per the plan-file's own risk note ("reference-implementation drift... needs a smoke test against a live Designer session before merge").

Gates run (all green)

  • npm run typecheck:core — clean
  • npm run typecheck:noimplicit:core — clean (pre-existing errors in combo.ts/usageTracking.ts/cliRuntime.ts unrelated to this change, confirmed against origin/release/v3.8.49)
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files> — 0 errors
  • node scripts/check/check-file-size.mjs — OK (143 frozen files, cap 800 for new files)
  • npm run check:complexity-ratchets — OK, both cyclomatic (2055 ≤ 2056 baseline) and cognitive (889 ≤ 890 baseline) — net improvement from the KIE-model extraction
  • npm run check:cycles — no cycles
  • node scripts/check/check-test-discovery.mjs — OK, new test file discovered by the test:unit collector
  • npm run check:any-budget:t11 — OK, no new any usage
  • node scripts/check/check-docs-counts-sync.mjs — STRICT provider-count check green (251)
  • node scripts/check/check-docs-sync.mjs — PASS
  • No top-level await added in any src//open-sse/ module

Not run: npm run test:coverage (shared-box constraint per instructions) — ran the new test file plus targeted adjacent suites (nanobanana-image-generation, chatgpt-web, trae-publiccred, publicCreds) instead, all green (102/102).

Adds `microsoft-designer-web` — an unofficial, reverse-engineered
Bearer-token web-session image provider, modeled on the existing
`chatgpt-web`/`copilot-m365-web` "-web" provider category.

- Registers the provider in WEB_COOKIE_PROVIDERS (src/shared/constants/
  providers/web-cookie.ts) and IMAGE_PROVIDERS (open-sse/config/
  imageRegistry.ts, new "designer-web" format).
- New handler open-sse/handlers/imageGeneration/providers/designerWeb.ts
  implements the submit-then-poll DallE.ashx flow (Bearer access_token +
  ClientId/SessionId/UserId headers -> form POST -> poll for
  image_urls_thumbnail), wired into handleImageGeneration()'s dispatch.
- The upstream ClientId header is a fixed, publicly-shared value (not a
  secret) — routed through resolvePublicCred() per Hard Rule #11, never
  as a string literal.
- Registers the token-based credential requirement in
  webSessionCredentials.ts so the provider-connect UI asks for the
  right field; connection validation falls back to the existing generic
  web-cookie session-ping validator (no dedicated validator needed).
- Extracted the KIE image-model catalog into a co-located
  open-sse/config/providers/registry/kie/models.ts module (mirrors the
  existing lmarena/directModels.ts pattern) to keep imageRegistry.ts
  under the file-size cap while adding the new provider entry.
- Regenerated docs/reference/PROVIDER_REFERENCE.md (250 -> 251
  providers) and updated the plain-text counts in README.md, AGENTS.md,
  CLAUDE.md.

Tests (tests/unit/microsoft-designer-web-6672.test.ts, 16 cases):
registry-entry shape assertions, the resolvePublicCred() shape
assertion (Hard Rule #11), and the pure header/form-body/response-
parsing helpers plus the handler's submit/poll/error/timeout paths
against a mocked fetch — no live Designer session required.

Reverse-engineered from the g4f MicrosoftDesigner.py provider reference
(researched during #6672 triage); the exact upstream response shape has
not been validated against a live Designer session, so the poll-loop
implementation follows the documented g4f contract as closely as
possible without a live capture.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

…microsoftdesigner-image-provider

# Conflicts:
#	AGENTS.md
#	CLAUDE.md
#	README.md
#	docs/reference/PROVIDER_REFERENCE.md
#	open-sse/config/imageRegistry.ts
#	open-sse/handlers/imageGeneration.ts
#	open-sse/utils/publicCreds.ts
@diegosouzapw
diegosouzapw merged commit 5bacb71 into release/v3.8.49 Jul 17, 2026
5 of 7 checks passed
@diegosouzapw
diegosouzapw deleted the feat/6672-microsoftdesigner-image-provider branch July 19, 2026 21:00
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 2, 2026
… (cheaper-inference#7609)

* feat(sse): add Microsoft Designer as image provider (cheaper-inference#6672)

Adds `microsoft-designer-web` — an unofficial, reverse-engineered
Bearer-token web-session image provider, modeled on the existing
`chatgpt-web`/`copilot-m365-web` "-web" provider category.

- Registers the provider in WEB_COOKIE_PROVIDERS (src/shared/constants/
  providers/web-cookie.ts) and IMAGE_PROVIDERS (open-sse/config/
  imageRegistry.ts, new "designer-web" format).
- New handler open-sse/handlers/imageGeneration/providers/designerWeb.ts
  implements the submit-then-poll DallE.ashx flow (Bearer access_token +
  ClientId/SessionId/UserId headers -> form POST -> poll for
  image_urls_thumbnail), wired into handleImageGeneration()'s dispatch.
- The upstream ClientId header is a fixed, publicly-shared value (not a
  secret) — routed through resolvePublicCred() per Hard Rule cheaper-inference#11, never
  as a string literal.
- Registers the token-based credential requirement in
  webSessionCredentials.ts so the provider-connect UI asks for the
  right field; connection validation falls back to the existing generic
  web-cookie session-ping validator (no dedicated validator needed).
- Extracted the KIE image-model catalog into a co-located
  open-sse/config/providers/registry/kie/models.ts module (mirrors the
  existing lmarena/directModels.ts pattern) to keep imageRegistry.ts
  under the file-size cap while adding the new provider entry.
- Regenerated docs/reference/PROVIDER_REFERENCE.md (250 -> 251
  providers) and updated the plain-text counts in README.md, AGENTS.md,
  CLAUDE.md.

Tests (tests/unit/microsoft-designer-web-6672.test.ts, 16 cases):
registry-entry shape assertions, the resolvePublicCred() shape
assertion (Hard Rule cheaper-inference#11), and the pure header/form-body/response-
parsing helpers plus the handler's submit/poll/error/timeout paths
against a mocked fetch — no live Designer session required.

Reverse-engineered from the g4f MicrosoftDesigner.py provider reference
(researched during cheaper-inference#6672 triage); the exact upstream response shape has
not been validated against a live Designer session, so the poll-loop
implementation follows the documented g4f contract as closely as
possible without a live capture.

* fix(providers): satisfy web-cookie executor contract + document designer-web env vars (cheaper-inference#6672)
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
… (cheaper-inference#7609)

* feat(sse): add Microsoft Designer as image provider (cheaper-inference#6672)

Adds `microsoft-designer-web` — an unofficial, reverse-engineered
Bearer-token web-session image provider, modeled on the existing
`chatgpt-web`/`copilot-m365-web` "-web" provider category.

- Registers the provider in WEB_COOKIE_PROVIDERS (src/shared/constants/
  providers/web-cookie.ts) and IMAGE_PROVIDERS (open-sse/config/
  imageRegistry.ts, new "designer-web" format).
- New handler open-sse/handlers/imageGeneration/providers/designerWeb.ts
  implements the submit-then-poll DallE.ashx flow (Bearer access_token +
  ClientId/SessionId/UserId headers -> form POST -> poll for
  image_urls_thumbnail), wired into handleImageGeneration()'s dispatch.
- The upstream ClientId header is a fixed, publicly-shared value (not a
  secret) — routed through resolvePublicCred() per Hard Rule cheaper-inference#11, never
  as a string literal.
- Registers the token-based credential requirement in
  webSessionCredentials.ts so the provider-connect UI asks for the
  right field; connection validation falls back to the existing generic
  web-cookie session-ping validator (no dedicated validator needed).
- Extracted the KIE image-model catalog into a co-located
  open-sse/config/providers/registry/kie/models.ts module (mirrors the
  existing lmarena/directModels.ts pattern) to keep imageRegistry.ts
  under the file-size cap while adding the new provider entry.
- Regenerated docs/reference/PROVIDER_REFERENCE.md (250 -> 251
  providers) and updated the plain-text counts in README.md, AGENTS.md,
  CLAUDE.md.

Tests (tests/unit/microsoft-designer-web-6672.test.ts, 16 cases):
registry-entry shape assertions, the resolvePublicCred() shape
assertion (Hard Rule cheaper-inference#11), and the pure header/form-body/response-
parsing helpers plus the handler's submit/poll/error/timeout paths
against a mocked fetch — no live Designer session required.

Reverse-engineered from the g4f MicrosoftDesigner.py provider reference
(researched during cheaper-inference#6672 triage); the exact upstream response shape has
not been validated against a live Designer session, so the poll-loop
implementation follows the documented g4f contract as closely as
possible without a live capture.

* fix(providers): satisfy web-cookie executor contract + document designer-web env vars (cheaper-inference#6672)
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.

feat(providers): add MicrosoftDesigner as image provider

1 participant