@kortyx/hooks
v0.5.1
Published
Lifecycle hooks and extension points for Kortyx.
Maintainers
Readme
@kortyx/hooks
Lifecycle hooks and extension points for Kortyx.
Install
npm install @kortyx/hooksKey APIs
useReason(...)for model calls, optional schema-constrained interrupt flow, and structured output.useInterrupt(...)for explicit human-in-the-loop pauses.useStructuredData(...)for UI-friendly structured stream events.useNodeState(...)/useWorkflowState(...)for stateful node logic.
LangGraph Resume Behavior
Kortyx uses LangGraph as the execution engine. On resume, the node function is replayed from the top.
useReasonresumes from its internal checkpoint.- Code before
useReasonwill re-run unless guarded.
Workarounds:
- Keep nodes minimal and call
useReasonfirst. - Guard pre-
useReasonside effects withuseNodeState.
Documentation
- Runtime hooks:
apps/website/src/docs/v0/03-runtime/01-hooks.md - Interrupts/resume:
apps/website/src/docs/v0/03-runtime/02-interrupts-and-resume.md
License
Apache-2.0
