<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chao Yang</title>
    <description>The latest articles on DEV Community by Chao Yang (@chaoyangnz).</description>
    <link>https://dev.to/chaoyangnz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F186411%2F2cd7bb46-1ec0-4ca6-9f52-c92817f8dfb5.png</url>
      <title>DEV Community: Chao Yang</title>
      <link>https://dev.to/chaoyangnz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chaoyangnz"/>
    <language>en</language>
    <item>
      <title>Harngine: an execution framework for TypeScript agent applications</title>
      <dc:creator>Chao Yang</dc:creator>
      <pubDate>Fri, 13 Nov 2026 07:44:54 +0000</pubDate>
      <link>https://dev.to/chaoyangnz/harngine-an-execution-framework-for-typescript-agent-applications-4p77</link>
      <guid>https://dev.to/chaoyangnz/harngine-an-execution-framework-for-typescript-agent-applications-4p77</guid>
      <description>&lt;p&gt;I'm building &lt;a href="https://github.com/neucine/harngine" rel="noopener noreferrer"&gt;Harngine&lt;/a&gt;, a TypeScript execution framework for agent applications. A model can answer a turn or propose a tool call, but an application also needs to decide which calls are allowed, when to wait for a person, how to continue after a restart, and how to explain what ran. Harngine provides the runtime for that work.&lt;/p&gt;

&lt;p&gt;An application defines &lt;strong&gt;Agents&lt;/strong&gt;, &lt;strong&gt;Workflows&lt;/strong&gt;, and &lt;strong&gt;Tools&lt;/strong&gt;, then starts &lt;strong&gt;Work&lt;/strong&gt;. Harngine persists the execution and its history. The application still owns its UI, users, domain rules, and definition of success. Model adapters handle provider transport; Tool adapters connect external systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five concepts
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;What it represents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Agent&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A reusable definition directed by a model. The application controls the Tools it can see.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Workflow&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A reusable definition directed by TypeScript code. It makes orchestration and waits explicit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Tool&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A typed boundary to an operation. Harngine validates and authorizes a Call before execution.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Work&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One execution of an objective, with an ID, status, Calls, interactions, result, and inspection history.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Session&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Optional continuity across several separate Work executions.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An Agent or Workflow defines &lt;em&gt;how&lt;/em&gt; a task can run. Work records &lt;em&gt;this particular run&lt;/em&gt;. That distinction matters when a process restarts or a developer needs to inspect a decision afterward.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Harngine handles
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Execution and recovery.&lt;/strong&gt; Work has a stable identity and persisted state. Workflows use named durable operations, so completed steps can be recognized when execution resumes. A task can wait for a timer or a person without losing its place.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool boundaries.&lt;/strong&gt; Tools declare input and output schemas. Harngine validates Calls, checks authority and approval policy, records attempts, and supports cancellation. Model output proposing a Tool does not by itself grant permission to execute it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Human decisions.&lt;/strong&gt; A Workflow or Agent can wait for a question or approval. The interaction and its outcome become part of the Work history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inspection.&lt;/strong&gt; Applications can examine context, model responses, decisions, Tool activity, interactions, and results. This gives developers more than a final answer when they need to understand behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Continuity.&lt;/strong&gt; Sessions can carry conversation across multiple objectives, while each objective remains separate Work. This is useful for an assistant that works with a person over time.&lt;/p&gt;

&lt;p&gt;Harngine currently runs as an embedded Node.js runtime backed by SQLite. One application process owns a runtime directory at a time, and active Work needs its original Agent and Tool revisions to continue after a restart. Harngine does not choose the product's UI or business policy. External writes still need an idempotency or reconciliation strategy appropriate to the target system; persisted Work does not make an external effect happen exactly once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it fits
&lt;/h2&gt;

&lt;p&gt;Harngine can support coding assistants, support processes, research tools, and persistent interactive applications. The repository includes examples of different shapes, from a small Workflow to larger applications. They are ways to use the framework, rather than its limits.&lt;/p&gt;

&lt;p&gt;Version 0.1.0 is available on npm and requires Node.js 24.21 or later in the 24.x line. The public API may change before v1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install harngine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start with the &lt;a href="https://github.com/neucine/harngine" rel="noopener noreferrer"&gt;source and examples&lt;/a&gt; or read the &lt;a href="https://github.com/neucine/harngine/blob/main/docs/guide.md" rel="noopener noreferrer"&gt;framework guide&lt;/a&gt;. The &lt;a href="https://github.com/neucine/harngine/tree/main/examples/quickstart" rel="noopener noreferrer"&gt;small recovery example&lt;/a&gt; shows a typed Tool call and a durable timer without requiring a model account.&lt;/p&gt;

&lt;p&gt;For a brief visual introduction, watch the &lt;a href="https://youtu.be/upyXdDo2EPY" rel="noopener noreferrer"&gt;Harngine framework video&lt;/a&gt;. It includes two example applications after the framework overview.&lt;/p&gt;

&lt;p&gt;I'm interested in the execution problems other builders encounter. Where do your agent applications need more control or visibility: recovery, Tool authority, human approval, or the history of a run?&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>ai</category>
      <category>opensource</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
