Skip to content

docs: add TypeScript Plugin documentation based on PR #619#24

Open
github-actions[bot] wants to merge 2 commits into
mainfrom
agent-tasks/23
Open

docs: add TypeScript Plugin documentation based on PR #619#24
github-actions[bot] wants to merge 2 commits into
mainfrom
agent-tasks/23

Conversation

@github-actions
Copy link
Copy Markdown

Summary

This PR adds comprehensive TypeScript documentation for the Plugin system based on the API introduced in strands-agents/sdk-typescript#619.

Changes

New Files

  • src/content/docs/user-guide/concepts/plugins/index.ts - TypeScript snippet file with examples for:
    • Basic plugin structure with Plugin class
    • Hook registration using initAgent() and agent.addHook()
    • Tool provision using getTools() method
    • Plugin state management
    • Manual hook and tool registration patterns

Modified Files

  • plugins/index.mdx - Replaced all "Plugins are not yet available in TypeScript SDK" placeholders with actual TypeScript examples
  • plugins/steering.mdx - Added languages: [python] frontmatter to indicate steering is Python-only
  • agents/hooks.mdx - Updated HookProvider section to note TypeScript uses Plugin class instead

Key TypeScript Plugin Differences from Python

Feature Python TypeScript
Hook registration @hook decorator Manual agent.addHook() in initAgent()
Tool registration @tool decorator Return tools from getTools() method
HookProvider Available Not exported, use Plugin instead
Steering plugin Available Not yet available

Testing

  • npm run typecheck:snippets - TypeScript snippets compile
  • npm run build - Documentation builds successfully
  • npm run format:check - Code formatting passes
  • npm test - All tests pass

Resolves #23



- Create src/content/docs/user-guide/concepts/plugins/index.ts with TypeScript snippets
  for Plugin class API: initAgent(), getTools(), and hook registration patterns
- Update plugins/index.mdx to replace all TypeScript placeholders with actual examples
- Add separate 'How It Works Under the Hood' sections for Python/TypeScript workflows
- Update agents/hooks.mdx HookProvider section to note TypeScript uses Plugin instead
- Update plugins/steering.mdx with languages: [python] frontmatter for Python-only feature

The TypeScript Plugin API from PR strands-agents#619 includes:
- Plugin abstract base class with get name(), initAgent(agent), getTools()
- Manual hook registration via agent.addHook() in initAgent()
- No @hook or @tool decorators - use methods instead

Resolves #23
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7787f95
Status: ✅  Deploy successful!
Preview URL: https://56567a5f.docs-72e.pages.dev
Branch Preview URL: https://agent-tasks-23.docs-72e.pages.dev

View logs

@zastrowm zastrowm force-pushed the main branch 2 times, most recently from 760357f to e1f5910 Compare May 22, 2026 14:54
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.

Update docs for Plugins TypeScript

1 participant