Skip to content

Added Strands Agents sample#472

Merged
brianstrauch merged 8 commits into
mainfrom
strands-agents-sample
Jul 24, 2026
Merged

Added Strands Agents sample#472
brianstrauch merged 8 commits into
mainfrom
strands-agents-sample

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

What changed

Added a complete set of samples for the Temporal TypeScript SDK's Strands integration, mirroring the Python samples in samples-python/strands_plugin.

Features demonstrated:

  • Hello World — minimal TemporalAgent invocation
  • Tools — pure Strands tool() + workflow.activityAsTool for I/O
  • Human in the Loop — gate a tool call on human approval via BeforeToolCallEvent hook + event.interrupt()
  • Activity Interrupt — activity-thrown interrupt routed through StrandsFailureConverter
  • Hooks — AfterToolCallEvent with in-workflow and activity-dispatched callbacks
  • MCP — stdio MCP server via TemporalMCPClient
  • Structured Output — Zod schema constrained output
  • Streaming — model chunk forwarding via WorkflowStream
  • Continue as New — long-lived chat with history-aware continue-as-new

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brianstrauch
brianstrauch requested a review from a team as a code owner May 28, 2026 16:46
Wraps each Strands Agents sample with @@@SNIPSTART/@@@SNIPEND markers
(typescript-strands-* labels) so the TypeScript integration guide in the
documentation repo can pull snippets via snipsync.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
brianstrauch and others added 6 commits June 9, 2026 14:21
Switch @temporalio/strands-agents and @temporalio/workflow-streams from
local tgz references to published npm packages, and bump all @temporalio/*
deps from 1.17.2 to 1.21.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Regenerate pnpm-lock.yaml (was stale after the 1.21.1 dep bump, which
  failed CI's frozen-lockfile install)
- Add missing shared config files (.gitignore, .npmrc, .nvmrc,
  .post-create, .prettierignore, .prettierrc) that the sample was created
  without
- Run prettier over the sample source to satisfy format:check

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@strands-agents/sdk is ESM-only (every published version sets
"type": "module"), which the repo's nodenext tsconfig cannot consume from a
CommonJS sample. Under npm's flat node_modules this was masked, but pnpm's
strict layout (used in CI) surfaces it as a build failure, and CommonJS also
can't require() the SDK on Node 20.

Convert the sample to ESM, following the fetch-esm template:
- package.json: "type": "module"; run scripts via tsx (drop ts-node/nodemon);
  mocha runs under tsx; add @temporalio/common (was imported but undeclared)
- tsconfig.json: module esnext / moduleResolution node / noEmit
- worker.ts + tests: replace require.resolve/__dirname with import.meta.url
  (new src/mocha/workflows-path.ts helper for the test suite)
- rename .eslintrc.js -> .eslintrc.cjs (CommonJS config under type: module)
- exclude strands-agents from the shared tsconfig/eslintrc copies

Also patch @temporalio/strands-agents@1.21.1 via pnpm.packageExtensions: it
calls zod 4's z.toJSONSchema at runtime but only declares zod as a
devDependency, so pnpm's strict layout leaves it unresolvable. Declaring the
dependency links the correct zod v4 for that package only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread package.json
},
"@temporalio/strands-agents": {
"dependencies": {
"zod": "^4.0.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brianstrauch
brianstrauch merged commit 3f2dba1 into main Jul 24, 2026
13 checks passed
@brianstrauch
brianstrauch deleted the strands-agents-sample branch July 24, 2026 18:35
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