Add AI provider and binding CLI support - #11
Open
cnluzhang wants to merge 2 commits into
Open
Conversation
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>
There was a problem hiding this comment.
Pull request overview
Adds namespace-scoped AI provider management and Wrangler AI binding support to the WDL CLI.
Changes:
- Adds
wdl aiprovider, 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()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wdl aicommands for provider metadata, credentials, and model discovery, and map Wrangler[ai]bindings into WDL deploy manifestsValidation
npm run format:checknpm run lintnpm run typechecknpm test(568 tests)npm audit --audit-level=moderatenpm pack --dry-runNotes
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.