A complete local service, a request to try, and paths to larger harness, voice, and worker applications.
This application starts a local HTTP API, accepts an Agent request, returns a response, and closes its Agent when the server drains. It is the final checkpoint of the support assistant tutorial.
import express from "express";import { Agent, openai } from "@agentium/core";import { createAgentRouter } from "@agentium/transport";const support = new Agent({ name: "support", model: openai(process.env.OPENAI_MODEL ?? "gpt-6.1-sol"), instructions: "Help customers with orders. Ask for an order ID when it is missing.",});const app = express();app.use(express.json({ limit: "1mb" }));app.use("/api", createAgentRouter({ registry: false, agents: { support }, security: { mode: "local" },}));const server = app.listen(3000, "127.0.0.1", () => { console.log("Support API: http://127.0.0.1:3000/api/agents/support/run");});let closing = false;function shutdown() { if (closing) return; closing = true; server.close((error) => { void support.close().catch(console.error); if (error) { console.error(error); process.exitCode = 1; } });}process.once("SIGINT", shutdown);process.once("SIGTERM", shutdown);
npx tsx support-server.ts
In another terminal:
curl --fail-with-body http://127.0.0.1:3000/api/agents/support/run \ -H 'Content-Type: application/json' \ -d '{"input":"Where is my order?"}'
The response should contain a completed result whose text asks for an order ID. Stop the server with Ctrl+C to drain HTTP connections and close the Agent.
This example intentionally binds to loopback with local transport mode. Before exposing a service, configure authenticated hosting, caller-scoped state, request limits, and the operational lifecycle. A localhost demo is not an authenticated multi-user deployment.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Agentium","colors":{"primary":"#2563EB","light":"#3B82F6","dark":"#1E40AF"},"logo":{"light":"https://mintcdn.com/xhipment/Ed5pO8kvbGYPhMpL/logo/light.svg?fit=max\u0026auto=format\u0026n=Ed5pO8kvbGYPhMpL\u0026q=85\u0026s=78e27fa90cb7eeca27547aec06e58eb6","dark":"https://mintcdn.com/xhipment/Ed5pO8kvbGYPhMpL/logo/dark.svg?fit=max\u0026auto=format\u0026n=Ed5pO8kvbGYPhMpL\u0026q=85\u0026s=abff624f5ecdb6247595c779b4f6a0d9"},"favicon":"https://mintcdn.com/xhipment/BEAHuQmH5n29YrcC/favicon.svg?fit=max\u0026auto=format\u0026n=BEAHuQmH5n29YrcC\u0026q=85\u0026s=3c0a399371709ca5b6222be8277d7154","navbar":{"links":[{"href":"https://github.com/agentiumOS/agentium","label":"GitHub"}]},"footer":{"socials":{"github":"https://github.com/agentiumOS/agentium"}},"banner":{"content":"Agentium 4.11.0 is available · [Release and upgrade guidance](/reference/releases).","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude","cursor"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/agentiumOS/agentium"},{"anchor":"npm","icon":"npm","href":"https://www.npmjs.com/org/agentium"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"xhipment","hasAudioNarration":false,"actualSubdomain":"xhipment","customDomains":["docs.agentium.in"],"gitSource":{"type":"github","owner":"agentiumos","repo":"agentium-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6adbe370139fbc8264ca035a","clientVersion":"0.0.4227","searchFilterCounts":[{"language":"default","tag":"Build","count":129},{"language":"default","tag":"Integrations","count":101},{"language":"default","tag":"Reference","count":87},{"language":"default","tag":"Package APIs","count":66},{"language":"default","tag":"Providers and services","count":61},{"language":"default","tag":"Data and capabilities","count":42},{"language":"default","tag":"@agentium/core","count":39},{"language":"default","tag":"Examples","count":37},{"language":"default","tag":"Toolkits","count":32},{"language":"default","tag":"Ship","count":29}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":".ag-explorer,.ag-directory{--ag-line: #dbe3ee;--ag-muted: #526179;--ag-panel: #f7f9fc;--ag-accent: #1d4ed8;color:#172033}.dark .ag-explorer,.dark .ag-directory{--ag-line: #283448;--ag-muted: #a2afc3;--ag-panel: #111a29;--ag-accent: #93b4ff;color:#e2e8f0}.ag-explorer{border:1px solid var(--ag-line);border-radius:16px;overflow:hidden;margin:24px 0}.ag-explorer button,.ag-directory button,.ag-directory input{font:inherit}.ag-explorer-top,.ag-explorer-bottom,.ag-step-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.ag-explorer-top{padding:18px 20px 10px}.ag-eyebrow{color:var(--ag-accent);font-size:12px;font-weight:650;letter-spacing:.08em;text-transform:uppercase}.ag-caption,.ag-explorer-bottom,.ag-step-heading span,.ag-directory-count{color:var(--ag-muted);font-size:12px}.ag-scenarios{display:flex;flex-wrap:wrap;gap:8px;padding:8px 20px 18px}.ag-scenarios button,.ag-filters button{padding:6px 12px;border:1px solid var(--ag-line);border-radius:8px;font-size:13px;background:transparent;color:inherit;cursor:pointer}.ag-scenarios button[aria-pressed=\"true\"],.ag-filters button[aria-pressed=\"true\"]{color:var(--ag-accent);border-color:var(--ag-accent);background:var(--ag-panel)}.ag-explorer .ag-step-list{display:flex;flex-wrap:wrap;gap:8px;padding:16px 20px;margin:0;list-style:none;border-top:1px solid var(--ag-line);background:var(--ag-panel)}.ag-step-list li{padding:0;margin:0}.ag-step-list button{display:flex;align-items:center;gap:7px;padding:6px 10px;border-radius:7px;font-size:12px;color:var(--ag-muted);cursor:pointer;background:transparent;border:1px solid transparent}.ag-step-list button[aria-current=\"step\"]{border-color:var(--ag-accent);color:var(--ag-accent)}.ag-step-list button span{font-size:11px;font-weight:600}.ag-step-detail{padding:20px;min-height:214px}.ag-step-detail p{font-size:14px;line-height:1.65;margin:12px 0;color:var(--ag-muted)}.ag-step-detail pre{padding:14px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7;background:var(--ag-panel);border-radius:8px;margin:0}.ag-explorer-bottom{padding:0 20px 16px}.ag-explorer-bottom button{padding:6px 10px;color:var(--ag-accent);background:transparent;border-radius:6px;cursor:pointer}.ag-explorer-bottom button:disabled{opacity:.4;cursor:default}.ag-explorer .ag-outcome{font-size:12px;line-height:1.7;color:var(--ag-muted);margin:0;padding:14px 20px;border-top:1px solid var(--ag-line)}.ag-directory label{display:block;font-weight:600;margin:20px 0 8px;font-size:14px}.ag-directory input{width:100%;border:1px solid var(--ag-line);border-radius:10px;padding:12px 14px;background:var(--ag-panel);color:inherit;font-size:14px}.ag-filters{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.ag-directory-grid{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:12px;margin:16px 0}.ag-directory .ag-integration{display:block;border:1px solid var(--ag-line);padding:18px;border-radius:10px;text-decoration:none;color:inherit}.ag-integration:hover{border-color:var(--ag-accent);background:var(--ag-panel)}.ag-integration strong{display:block;font-size:15px}.ag-integration small{display:block;color:var(--ag-accent);font-size:11px;margin-bottom:8px}.ag-directory .ag-integration p{color:var(--ag-muted);font-size:13px;line-height:1.6;margin:8px 0 0}.ag-explorer button:focus-visible,.ag-directory button:focus-visible,.ag-directory input:focus-visible,.ag-integration:focus-visible{outline:2px solid var(--ag-accent);outline-offset:3px}@media (max-width: 640px){.ag-directory-grid{grid-template-columns:1fr}.ag-explorer-top,.ag-step-heading{align-items:flex-start;flex-direction:column;gap:4px}.ag-step-detail{min-height:260px}.ag-step-list button{padding:7px}}.ag-explorer .ag-step-detail pre code{width:auto;min-width:0;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.ag-explorer .ag-step-detail pre,.ag-explorer .ag-step-detail pre code{color:inherit}"}]}
{"page":{"pagePath":"examples/end-to-end","slug":"/examples/end-to-end","pageMetadata":{"title":"Run an agent HTTP application","description":"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.","href":"/examples/end-to-end"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This application starts a local HTTP API, accepts an Agent request, returns a response, and closes its Agent when the server drains. It is the final checkpoint of the `,_jsx(_components.a,{href:`/learn/support-assistant`,children:`support assistant tutorial`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsxs(_components.p,{children:[`Use a supported `,_jsx(_components.a,{href:`/learn/installation`,children:`Node version`}),`, then:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -y`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` pkg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` type=module`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @agentium/core@4.11.0`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @agentium/transport@4.11.0`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` openai`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` express`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --save-dev`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tsx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` typescript`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @types/node`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @types/express`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OPENAI_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-key\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`start-the-application`,children:`Start the application`}),`\n`,_jsxs(_components.p,{children:[`Save as `,_jsx(_components.code,{children:`support-server.ts`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:`support-server.ts`,numberOfLines:`31`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`31`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` express`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"express\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Agent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`openai`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@agentium/core\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`createAgentRouter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@agentium/transport\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` support`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Agent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"support\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` openai`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`OPENAI_MODEL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ??`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"gpt-6.1-sol\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` instructions:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Help customers with orders. Ask for an order ID when it is missing.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` app`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` express`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`use`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`express`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`limit:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"1mb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`use`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/api\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createAgentRouter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` registry:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` agents:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`support`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` security:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`mode:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"local\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}));`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` server`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`listen`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"127.0.0.1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Support API: http://127.0.0.1:3000/api/agents/support/run\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` closing`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` shutdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`closing`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` closing`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` server`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` support`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`close`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`exitCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`once`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SIGINT\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`shutdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`once`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SIGTERM\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`shutdown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tsx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` support-server.ts`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`In another terminal:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --fail-with-body`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` http://127.0.0.1:3000/api/agents/support/run`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"input\":\"Where is my order?\"}'`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The response should contain a completed result whose text asks for an order ID. Stop the server with Ctrl+C to drain HTTP connections and close the Agent.`}),`\n`,_jsx(Heading,{level:`2`,id:`add-the-next-capability`,children:`Add the next capability`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Application`}),_jsx(_components.th,{children:`Complete path`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Ground the answer in order data`}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/learn/tools`,children:`Support tools`}),`, `,_jsx(_components.a,{href:`/learn/knowledge`,children:`knowledge`}),`, `,_jsx(_components.a,{href:`/learn/approval`,children:`approval`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Compose a reusable research runtime`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/examples/harness-research`,children:`Research harness`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Continue scoped conversations`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/examples/harness-sessions`,children:`Harness sessions`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Review project documents`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/examples/harness-workspace`,children:`Workspace harness`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Execute a background job`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/queue/overview`,children:`Queue quickstart`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Control an outbound phone call`}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/examples/telephony`,children:`Local call lifecycle`}),`, then `,_jsx(_components.a,{href:`/telephony/quickstart`,children:`carrier setup`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Connect audio and speech`}),_jsxs(_components.td,{children:[_jsx(_components.a,{href:`/voice/adapters`,children:`Voice adapters`}),`, `,_jsx(_components.a,{href:`/voice/streaming`,children:`streaming pipeline`})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`expose-it-to-users`,children:`Expose it to users`}),`\n`,_jsxs(_components.p,{children:[`This example intentionally binds to loopback with local transport mode. Before exposing a service, configure `,_jsx(_components.a,{href:`/transport/express#authenticated-hosting`,children:`authenticated hosting`}),`, caller-scoped state, request limits, and the `,_jsx(_components.a,{href:`/ship/operations`,children:`operational lifecycle`}),`. A localhost demo is not an authenticated multi-user deployment.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Run an agent HTTP application","description":"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.","href":"/examples/end-to-end"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"Start the application","slug":"start-the-application","depth":2,"children":[]},{"title":"Add the next capability","slug":"add-the-next-capability","depth":2,"children":[]},{"title":"Expose it to users","slug":"expose-it-to-users","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"xhipment","siteName":"Agentium","title":"Run an agent HTTP application - Agentium","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T22:45:17.253Z","originalFileLocation":"examples/end-to-end.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Agentium\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Run an agent HTTP application - Agentium\">\u003cmeta data-mint-head property=\"og:description\" content=\"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Agentium\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.agentium.in/examples/end-to-end\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://xhipment.mintlify.site/_mintlify/api/og/v2?division=Quality+%26+production\u0026amp;title=Run+an+agent+HTTP+application\u0026amp;description=A+complete+local+service%2C+a+request+to+try%2C+and+paths+to+larger+harness%2C+voice%2C+and+worker+applications.\u0026amp;theme=df32736373f0bac5d5601052\u0026amp;signature=3603d5e08d8443b0ba8cdcd950a7cc33254f4f3ebabe452a5e7d1c9b9a6627f9\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Run an agent HTTP application - Agentium\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://xhipment.mintlify.site/_mintlify/api/og/v2?division=Quality+%26+production\u0026amp;title=Run+an+agent+HTTP+application\u0026amp;description=A+complete+local+service%2C+a+request+to+try%2C+and+paths+to+larger+harness%2C+voice%2C+and+worker+applications.\u0026amp;theme=df32736373f0bac5d5601052\u0026amp;signature=3603d5e08d8443b0ba8cdcd950a7cc33254f4f3ebabe452a5e7d1c9b9a6627f9\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/xhipment/1FHI9CtiEmrb2QJH/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Agentium\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.agentium.in/examples/end-to-end\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/examples/end-to-end.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.agentium.in/#organization\",\"name\":\"Agentium\",\"url\":\"https://docs.agentium.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/xhipment/Ed5pO8kvbGYPhMpL/logo/light.svg?fit=max\u0026auto=format\u0026n=Ed5pO8kvbGYPhMpL\u0026q=85\u0026s=78e27fa90cb7eeca27547aec06e58eb6\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.agentium.in#website\",\"name\":\"Agentium\",\"url\":\"https://docs.agentium.in\",\"publisher\":{\"@id\":\"https://docs.agentium.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.agentium.in/examples/end-to-end#webpage\",\"url\":\"https://docs.agentium.in/examples/end-to-end\",\"name\":\"Run an agent HTTP application\",\"description\":\"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.\",\"dateModified\":\"2026-10-23T22:45:17.253Z\",\"isPartOf\":{\"@id\":\"https://docs.agentium.in#website\"},\"breadcrumb\":{\"@id\":\"https://docs.agentium.in/examples/end-to-end#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.agentium.in/examples/end-to-end#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Quality \u0026 production\",\"item\":\"https://docs.agentium.in/examples/eval\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run an agent HTTP application\",\"item\":\"https://docs.agentium.in/examples/end-to-end\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.agentium.in/examples/end-to-end#article\",\"headline\":\"Run an agent HTTP application\",\"name\":\"Run an agent HTTP application\",\"description\":\"A complete local service, a request to try, and paths to larger harness, voice, and worker applications.\",\"url\":\"https://docs.agentium.in/examples/end-to-end\",\"mainEntityOfPage\":{\"@id\":\"https://docs.agentium.in/examples/end-to-end#webpage\"},\"dateModified\":\"2026-10-23T22:45:17.253Z\",\"publisher\":{\"@id\":\"https://docs.agentium.in/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.agentium.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Agentium\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Agentium\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/examples/end-to-end.md","siteName":"Agentium","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/agentiumOS/agentium"},{"anchor":"npm","icon":"npm","href":"https://www.npmjs.com/org/agentium"}]},"tabs":[{"tab":"Start","pages":[{"title":"Start","href":""}]},{"tab":"Build","pages":[{"title":"Build","href":"/build/overview"}]},{"tab":"Examples","groups":[{"group":"Complete projects","pages":[{"title":"Examples and recipes","mode":"wide","href":"/examples/overview"},{"title":"Build a research harness","href":"/examples/harness-research"},{"title":"Continue a harness conversation","href":"/examples/harness-sessions"},{"title":"Review selected workspace files","href":"/examples/harness-workspace"},{"title":"Gate a workflow with approval","href":"/examples/harness-workflow"},{"title":"Run a graph and reuse its result","href":"/examples/execution-graph"},{"title":"Build a quality gate with traces","href":"/examples/quality-gate"},{"title":"Serve an API with owned sessions","href":"/examples/authenticated-api"},{"title":"Exercise a call intent lifecycle","href":"/examples/telephony"}]},{"group":"Agents \u0026 memory","expanded":false,"pages":[{"title":"Agent patterns","href":"/examples/agents"},{"title":"Conversation and memory patterns","href":"/examples/memory-sessions"},{"title":"Reviewed corrections and regression checks","sidebarTitle":"Corrections and learning","href":"/examples/self-learning"},{"title":"Skill examples","href":"/examples/skills"},{"title":"Handoff examples","href":"/examples/handoff"}]},{"group":"Models \u0026 Jev","expanded":false,"pages":[{"title":"Jev examples","href":"/examples/jev"},{"title":"Model selection and fallback patterns","href":"/examples/models"},{"title":"Provider setup directory","sidebarTitle":"Provider setup","href":"/examples/all-providers"}]},{"group":"Tools \u0026 knowledge","expanded":false,"pages":[{"title":"Tool and approval patterns","href":"/examples/tools-toolkits"},{"title":"Toolkit integration patterns","sidebarTitle":"Toolkit integrations","href":"/examples/toolkits-extended"},{"title":"MCP examples","href":"/examples/mcp"},{"title":"Retrieval and grounded-answer patterns","href":"/examples/knowledge-rag"},{"title":"Storage examples","href":"/examples/storage"}]},{"group":"Teams \u0026 jobs","expanded":false,"pages":[{"title":"Team coordination patterns","href":"/examples/teams"},{"title":"Workflow patterns","href":"/examples/workflows"},{"title":"Schedule examples","href":"/examples/scheduling"}]},{"group":"Deploy \u0026 devices","expanded":false,"pages":[{"title":"Transport \u0026 Deployment Examples","href":"/examples/transport-deploy"},{"title":"Voice and browser examples","href":"/examples/voice-browser"},{"title":"Edge and IoT examples","href":"/examples/edge-iot"},{"title":"Webhook examples","href":"/examples/webhooks"}]},{"group":"Quality \u0026 production","expanded":false,"pages":[{"title":"Evaluation patterns","href":"/examples/eval"},{"title":"Cost and tracing patterns","href":"/examples/cost-observability"},{"title":"Runtime control patterns","sidebarTitle":"Runtime controls","href":"/examples/advanced-features"},{"title":"Agent Lifecycle \u0026 Advanced","href":"/examples/agent-lifecycle"},{"title":"Authorization and guardrail recipes","href":"/examples/security-auth"},{"title":"Integration examples","href":"/examples/integrations"},{"title":"Production Features","description":"Examples for model resilience, agent reflection, multi-tenant, rate limiting, conversational testing, context compaction, and streaming progress","href":"/examples/production-features"},{"title":"Run an agent HTTP application","href":"/examples/end-to-end"}]}]},{"tab":"Ship","pages":[{"title":"Ship","href":"/ship/overview"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/overview"}]}]},"basePath":"","title":"Run an agent HTTP application - Agentium","deploymentId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","buildId":"dpl_vSEmv961Ncyvz1psVwgUnTXQMSYk","dynamics":["10e4515597"],"chunks":["BannerMarkdown-DnSAhvaM.js","dist-DIfYWxfm.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}