Skip to content

Add AI provider and binding CLI support - #11

Open
cnluzhang wants to merge 2 commits into
mainfrom
feat/ai-binding
Open

Add AI provider and binding CLI support#11
cnluzhang wants to merge 2 commits into
mainfrom
feat/ai-binding

Conversation

@cnluzhang

Copy link
Copy Markdown
Contributor

Summary

  • add wdl ai commands for provider metadata, credentials, and model discovery, and map Wrangler [ai] bindings into WDL deploy manifests
  • align CLI output and documentation with provider credential preservation, catalog lifecycle, WebSocket policy, and destructive deletion semantics
  • add focused unit and CLI integration coverage plus a packaged agent demo with bounded tool execution and fail-closed request validation

Validation

  • npm run format:check
  • npm run lint
  • npm run typecheck
  • npm test (568 tests)
  • npm audit --audit-level=moderate
  • npm pack --dry-run
  • manual boundary probe for eight completed tool rounds

Notes

The hosted/live integration and real provider inference were not run. The live fixture intentionally validates provider CRUD, credential preservation, and AI binding deployment without calling an upstream AI provider.

Parse Wrangler [ai] bindings, add namespace-scoped provider, credential, and model commands, ship an agent-ready Responses tool-loop example, and document deployment, credential rotation, OpenAI-compatible inference, streaming, and WebSocket usage without exposing provider credentials.

Signed-off-by: Lu Zhang <lu@wdl.dev>
Report whether provider updates preserve credentials.
Document AI lifecycle, environment, WebSocket, and deletion semantics.
Add CLI integration coverage and harden the packaged agent demo.

Signed-off-by: Lu Zhang <lu@wdl.dev>
@cnluzhang
cnluzhang marked this pull request as ready for review August 15, 2026 04:58
@cnluzhang
cnluzhang requested a balanced review from Copilot August 15, 2026 04:59

Copilot AI 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.

Pull request overview

Adds namespace-scoped AI provider management and Wrangler AI binding support to the WDL CLI.

Changes:

  • Adds wdl ai provider, credential, and model commands.
  • Maps [ai] bindings into deployment manifests.
  • Adds bilingual documentation, tests, and an AI agent example.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/cli-wrangler-config.test.js Tests AI environment resolution.
tests/unit/cli-wrangler-bindings.test.js Tests AI binding parsing.
tests/unit/cli-deploy.test.js Tests AI manifest generation.
tests/unit/cli-ai.test.js Tests AI CLI commands.
tests/integration/cli-live.test.js Adds live AI resource coverage.
templates/AGENTS.md Adds AI guidance.
README.md Documents AI support.
README-zh.md Adds Chinese AI overview.
lib/wrangler/config.js Recognizes and strips AI config.
lib/wrangler/bindings.js Parses AI bindings.
lib/wrangler-pack.js Emits AI manifest bindings.
GUIDE.md Adds complete AI guidance.
GUIDE-zh.md Adds Chinese AI guidance.
examples/ai-agent-demo/wrangler.toml Configures the AI example.
examples/ai-agent-demo/src/index.js Implements the agent loop.
examples/ai-agent-demo/provider.openai.json Defines example provider metadata.
examples/ai-agent-demo/package.json Defines example dependencies.
docs/README.md Indexes AI documentation.
docs/README-zh.md Indexes Chinese AI documentation.
docs/env-overrides.md Documents AI environment behavior.
docs/env-overrides-zh.md Adds Chinese environment guidance.
docs/deploy.md Adds AI deployment guidance.
docs/deploy-zh.md Adds Chinese deployment guidance.
docs/ai.md Adds the AI feature reference.
docs/ai-zh.md Adds the Chinese AI reference.
commands/ai.js Implements wdl ai.
CHANGELOG.md Records the new feature.
bin/wdl.js Registers the AI command.
.claude/skills/wdl-deploy/SKILL.md Adds agent-facing AI instructions.
.claude/rules/examples.md Registers the AI example.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +34 to +39
const args = JSON.parse(call.arguments);
const value = new Intl.DateTimeFormat("en-GB", {
dateStyle: "full",
timeStyle: "long",
timeZone: args.timezone,
}).format(new Date());
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.

2 participants