Repository navigation
feat: run on hlang runtime 2.1 - #94
Merged
Merged
Conversation
- Upgrade @hlang-org/runtime to ^2.1.0. - A failure on a component's error port rejects the run it belongs to, instead of leaving it pending forever. - Each trigger port gets its own START component, so a run reaches only the port it names. - Port.receive passes unknown and Pipeline.run resolves with unknown: ports are connected at run time, so the caller narrows what it gets. Failing tests first: "rejects the run when a component throws", "rejects the run when a component fails asynchronously", "rejects only the run whose input failed", "keeps running after a failed run", "sends each run only to its own trigger". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent, StreamingAgent, RLMAgent and ToolInvoker narrow the unknown value on their in port with type guards and reject the run with a TypeError when it does not match. Handlers return their promise, so an asynchronous failure reaches the component's error port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update the docs (English and Chinese, with source hashes), the examples and the generated example and API pages for the hlang runtime 2.1 API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Closes #86.
What changes
hlang runtime 2.1 is typed without
anyand keeps messagesunknownby design ("a graph is wired at run time, so a node narrows what it receives"). AStack adopts that model instead of claiming payload types that nothing checks.core (
minor, breaking in beta)@hlang-org/runtime^1.1.1 → ^2.1.0.Port.receivecallbacks getunknown;Pipeline.run()resolves withunknown. The uncheckedreceive<T>/run<T>generics and the lastno-unnecessary-type-parametersdisable are gone.receivecallback, used to leavePipeline.run()pending forever (1.x rethrew the error asynchronously). The pipeline now listens on each component's error port (@node/error) and rejects the run: the run whose input is being delivered for a synchronous failure, otherwise the oldest run still waiting.messageswas also sent to the API as a prompt). Each trigger now has its own START node.components (
minor):Agent,StreamingAgent,RLMAgentandToolInvokernarrow theirinvalue with type guards and reject the run with aTypeErroron the wrong type. Handlers return their promise.ToolInvokerno longer turns invalid input into an empty result.integrations (
patch): thepromptandmessagesports check their input before calling the API.Docs (EN/ZH with source hashes), examples, generated API pages, the core README and the home page's live stack are updated.
hlang 2.1 features, and what AStack takes
freezeMessagesdispose/teardown,FlowObserver,slice,onErroronErroronly covers Writable/teardown failures, and AStack's END nodes only resolve. Add them when rate limiting, cancellation or tracing is asked for.close,flow.done)hlang 2.x does not provide typed ports, so
Component<In, Out>and compile-time connection checks from #86 are out of its scope.Tests written first
rejects the run when a component throws,rejects the run when a component fails asynchronously,rejects only the run whose input failed,keeps running after a failed run,sends each run only to its own trigger, and onerejects ... inputtest per component and provider port.Checks
pnpm verifypasses (core 24, components 110, integrations 39, tools 13 tests; coverage thresholds met).🤖 Generated with Claude Code