Add tool-registry-incident-triage sample#463
Open
lex00 wants to merge 1 commit intotemporalio:mainfrom
Open
Conversation
Multi-step LLM activity demonstrating @temporalio/tool-registry end-to-end. agenticSession with heartbeat checkpointing, MCP HTTP integration via sidecar, human-in-the-loop via companion workflow, and a testable activity refactor (buildTriageRegistry + TriageDeps). Includes mocha tests using MockProvider with no API key required. Conventions followed: - src/ layout with src/mocha/*.test.ts (per hello-world template) - Standard package.json scripts (build, start, workflow, test, lint, format) - Added to .scripts/list-of-samples.json (alphabetical) - Added to root README API demos / Activity APIs section The dependency on @temporalio/tool-registry currently uses a file: path to the in-development sdk-typescript checkout, since the package isn't published yet. Swap to a version pin once it ships.
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.
Adds a new sample under
tool-registry-incident-triage/demonstrating@temporalio/tool-registryend-to-end.The example includes:
agenticSessionwith heartbeat checkpointing.buildTriageRegistry(alert, session, deps)returning{ registry, getResult }plus aTriageDepsinterface of I/O callables, so unit tests substitute fakes and drive the registry viaMockProvider.Mocha tests in
src/mocha/triage_activity.test.tsuseMockProviderand require no API key or running Temporal server. All 6 tests pass.Conventions followed:
src/layout withsrc/mocha/*.test.ts(perhello-worldtemplate).package.jsonscripts (build,start,workflow,test,lint,format)..scripts/list-of-samples.json(alphabetical).README.mdunder "Activity APIs and design patterns".Known transitional issue: the dependency on
@temporalio/tool-registrycurrently uses afile:path (file:../../sdk-typescript/packages/tool-registry) since the package isn't published yet. The sibling sdk-typescript PR (#2008) recently added apreparescript which causesnpm installto attempt a workspace-wide build that fails on unrelated worker-package issues. Workaround:npm install --ignore-scripts. Will switch to a published version pin once temporalio/sdk-typescript#2008 lands and the package publishes.Cross-references the SDK PR (temporalio/sdk-typescript#2008) which adds the
@temporalio/tool-registrypackage itself.