[{"data":1,"prerenderedAt":7142},["ShallowReactive",2],{"site-navigation-englishPages":3,"page-englishPages-/en/document/ai-agent/advanced/middleware":2880,"surround-englishPages-/en/document/ai-agent/advanced/middleware":7137},{"collection":4,"items":5},"englishPages",[6],{"title":7,"path":8,"stem":9,"children":10,"page":49},"En","/en","en",[11],{"title":12,"path":13,"stem":14,"children":15,"page":49},"Document","/en/document","en/document",[16,50,111,138,190,242,282,313,328,363,402,429,462,497,524,547,571,603,639,670,701,732,769,801,837,866,901,937,973,1013,1083,1171,1203,1233,1265,1293,1369,1409,1441,1480,1517,1549,1581,1678,1765,1838,1896,2038,2092,2131,2200,2253,2326,2397,2437,2495,2557,2615,2670,2737,2783,2830],{"title":17,"path":18,"stem":19,"children":20,"page":49},"HTML5","/en/document/html5","en/document/01.html5",[21],{"title":22,"path":23,"stem":24,"children":25,"icon":48},"Guide","/en/document/html5/guide","en/document/01.html5/01.guide/01.index",[26,28,32,36,40,44],{"title":27,"path":23,"stem":24},"Getting Started with HTML",{"title":29,"path":30,"stem":31},"Common HTML Tags Explained","/en/document/html5/guide/tag","en/document/01.html5/01.guide/02.tag",{"title":33,"path":34,"stem":35},"Layout and Semantic Tags","/en/document/html5/guide/layout","en/document/01.html5/01.guide/03.layout",{"title":37,"path":38,"stem":39},"Forms and User Input","/en/document/html5/guide/form","en/document/01.html5/01.guide/04.form",{"title":41,"path":42,"stem":43},"Multimedia and HTML5 Features","/en/document/html5/guide/html5","en/document/01.html5/01.guide/05.html5",{"title":45,"path":46,"stem":47},"Web Standards and HTML Coding Guidelines","/en/document/html5/guide/web","en/document/01.html5/01.guide/06.web","i-lucide-code",false,{"title":51,"path":52,"stem":53,"children":54,"page":49},"CSS3","/en/document/css","en/document/02.css",[55,73,98],{"title":22,"path":56,"stem":57,"children":58,"icon":49},"/en/document/css/guide","en/document/02.css/01.guide/01.index",[59,61,65,69],{"title":60,"path":56,"stem":57},"Getting Started with CSS",{"title":62,"path":63,"stem":64},"Text and Box Styles","/en/document/css/guide/styles","en/document/02.css/01.guide/02.styles",{"title":66,"path":67,"stem":68},"Selectors and Specificity","/en/document/css/guide/selected","en/document/02.css/01.guide/03.selected",{"title":70,"path":71,"stem":72},"Understanding the Box Model","/en/document/css/guide/box","en/document/02.css/01.guide/04.box",{"title":74,"icon":49,"path":75,"stem":76,"children":77,"page":49},"Layout","/en/document/css/layout","en/document/02.css/02.layout",[78,82,86,90,94],{"title":79,"path":80,"stem":81},"Three Approaches to Web Layout","/en/document/css/layout/policy","en/document/02.css/02.layout/01.policy",{"title":83,"path":84,"stem":85},"CSS Positioning Explained","/en/document/css/layout/position","en/document/02.css/02.layout/02.position",{"title":87,"path":88,"stem":89},"Getting Started with Flexbox","/en/document/css/layout/flex","en/document/02.css/02.layout/03.flex",{"title":91,"path":92,"stem":93},"Getting Started with CSS Grid","/en/document/css/layout/grid","en/document/02.css/02.layout/04.grid",{"title":95,"path":96,"stem":97},"A Guide to Responsive Design","/en/document/css/layout/relative","en/document/02.css/02.layout/05.relative",{"title":99,"icon":49,"path":100,"stem":101,"children":102,"page":49},"Practical Techniques","/en/document/css/skill","en/document/02.css/03.skill",[103,107],{"title":104,"path":105,"stem":106},"CSS Animations Explained","/en/document/css/skill/animation","en/document/02.css/03.skill/01.animation",{"title":108,"path":109,"stem":110},"Practical CSS Techniques","/en/document/css/skill/skill","en/document/02.css/03.skill/02.skill",{"title":112,"path":113,"stem":114,"children":115,"page":49},"Git","/en/document/git","en/document/03.git",[116],{"title":22,"path":117,"stem":118,"children":119,"icon":49},"/en/document/git/guide","en/document/03.git/01.guide/01.index",[120,122,126,130,134],{"title":121,"path":117,"stem":118},"Getting Started with Git",{"title":123,"path":124,"stem":125},"Installing Git and Making Your First Commit","/en/document/git/guide/install","en/document/03.git/01.guide/02.install",{"title":127,"path":128,"stem":129},"Common Git Commands","/en/document/git/guide/command","en/document/03.git/01.guide/03.command",{"title":131,"path":132,"stem":133},"Git Branch Management","/en/document/git/guide/branch","en/document/03.git/01.guide/04.branch",{"title":135,"path":136,"stem":137},"Hosting and Managing Code with GitHub","/en/document/git/guide/github","en/document/03.git/01.guide/05.github",{"title":139,"path":140,"stem":141,"children":142,"page":49},"JavaScript basics","/en/document/js-base","en/document/04.js-base",[143,173],{"title":22,"path":144,"stem":145,"children":146,"icon":48},"/en/document/js-base/guide","en/document/04.js-base/01.guide/01.index",[147,149,153,157,161,165,169],{"title":148,"path":144,"stem":145},"Getting Started with JavaScript",{"title":150,"path":151,"stem":152},"Understanding Variables and Data Types","/en/document/js-base/guide/variable","en/document/04.js-base/01.guide/02.variable",{"title":154,"path":155,"stem":156},"JavaScript Operators Explained","/en/document/js-base/guide/operator","en/document/04.js-base/01.guide/03.operator",{"title":158,"path":159,"stem":160},"Conditional Statements and Loops","/en/document/js-base/guide/flow","en/document/04.js-base/01.guide/04.flow",{"title":162,"path":163,"stem":164},"Understanding JavaScript Functions","/en/document/js-base/guide/function","en/document/04.js-base/01.guide/05.function",{"title":166,"path":167,"stem":168},"Creating and Working with Objects and Arrays","/en/document/js-base/guide/object","en/document/04.js-base/01.guide/06.object",{"title":170,"path":171,"stem":172},"Working with Math and Date","/en/document/js-base/guide/math","en/document/04.js-base/01.guide/07.math",{"title":174,"icon":48,"path":175,"stem":176,"children":177,"page":49},"Browser","/en/document/js-base/browser","en/document/04.js-base/02.browser",[178,182,186],{"title":179,"path":180,"stem":181},"Getting Started with DOM Manipulation","/en/document/js-base/browser/dom","en/document/04.js-base/02.browser/01.dom",{"title":183,"path":184,"stem":185},"Browser Object Model Basics","/en/document/js-base/browser/bom","en/document/04.js-base/02.browser/02.bom",{"title":187,"path":188,"stem":189},"JavaScript Event Handling","/en/document/js-base/browser/event","en/document/04.js-base/02.browser/03.event",{"title":191,"path":192,"stem":193,"children":194,"page":49},"Advanced JavaScript","/en/document/js-advanced","en/document/05.js-advanced",[195,213,230],{"title":196,"path":197,"stem":198,"children":199},"How Does JavaScript Run?","/en/document/js-advanced/guide","en/document/05.js-advanced/01.guide/01.index",[200,201,205,209],{"title":196,"path":197,"stem":198},{"title":202,"path":203,"stem":204},"Understanding Functions and Scope","/en/document/js-advanced/guide/function","en/document/05.js-advanced/01.guide/02.function",{"title":206,"path":207,"stem":208},"Understanding this in JavaScript","/en/document/js-advanced/guide/this","en/document/05.js-advanced/01.guide/03.this",{"title":210,"path":211,"stem":212},"Shallow and Deep Copies","/en/document/js-advanced/guide/copy","en/document/05.js-advanced/01.guide/04.copy",{"title":214,"path":215,"stem":216,"children":217,"page":49},"Program","/en/document/js-advanced/program","en/document/05.js-advanced/02.program",[218,222,226],{"title":219,"path":220,"stem":221},"Object-Oriented Programming (OOP)","/en/document/js-advanced/program/object","en/document/05.js-advanced/02.program/01.object",{"title":223,"path":224,"stem":225},"Introduction to Functional Programming","/en/document/js-advanced/program/fp","en/document/05.js-advanced/02.program/02.fp",{"title":227,"path":228,"stem":229},"Debouncing and Throttling","/en/document/js-advanced/program/debounce","en/document/05.js-advanced/02.program/03.debounce",{"title":174,"path":231,"stem":232,"children":233,"page":49},"/en/document/js-advanced/browser","en/document/05.js-advanced/03.browser",[234,238],{"title":235,"path":236,"stem":237},"Browser Caching","/en/document/js-advanced/browser/cache","en/document/05.js-advanced/03.browser/01.cache",{"title":239,"path":240,"stem":241},"Understanding Browser Storage","/en/document/js-advanced/browser/storage","en/document/05.js-advanced/03.browser/02.storage",{"title":243,"path":244,"stem":245,"children":246,"page":49},"ECMAScript 2015","/en/document/es6","en/document/06.es6",[247],{"title":248,"path":249,"stem":250,"children":251,"icon":48},"JavaScript Internals","/en/document/es6/guide","en/document/06.es6/01.guide/01.index",[252,254,258,262,266,270,274,278],{"title":253,"path":249,"stem":250},"Getting Started with ES6",{"title":255,"path":256,"stem":257},"Variable Declarations with let and const","/en/document/es6/guide/const","en/document/06.es6/01.guide/02.const",{"title":259,"path":260,"stem":261},"Arrow Function Syntax and Behavior","/en/document/es6/guide/arrow","en/document/06.es6/01.guide/03.arrow",{"title":263,"path":264,"stem":265},"New Features for Strings, Objects, and Arrays","/en/document/es6/guide/enhance","en/document/06.es6/01.guide/04.enhance",{"title":267,"path":268,"stem":269},"Working with Map and Set","/en/document/es6/guide/set","en/document/06.es6/01.guide/05.set",{"title":271,"path":272,"stem":273},"Managing Asynchronous Operations with Promises","/en/document/es6/guide/promise","en/document/06.es6/01.guide/06.promise",{"title":275,"path":276,"stem":277},"Understanding ES Module Syntax","/en/document/es6/guide/esm","en/document/06.es6/01.guide/07.esm",{"title":279,"path":280,"stem":281},"Defining Classes and Using Inheritance","/en/document/es6/guide/class","en/document/06.es6/01.guide/08.class",{"title":283,"path":284,"stem":285,"children":286,"page":49},"Data Structures and Algorithms","/en/document/js-algorithms","en/document/07.js-algorithms",[287],{"title":22,"path":288,"stem":289,"children":290,"icon":48},"/en/document/js-algorithms/guide","en/document/07.js-algorithms/01.guide/01.index",[291,293,297,301,305,309],{"title":292,"path":288,"stem":289},"What Are Data Structures and Algorithms?",{"title":294,"path":295,"stem":296},"Time and Space Complexity","/en/document/js-algorithms/guide/complexity","en/document/07.js-algorithms/01.guide/02.complexity",{"title":298,"path":299,"stem":300},"Data Structures","/en/document/js-algorithms/guide/structure","en/document/07.js-algorithms/01.guide/03.structure",{"title":302,"path":303,"stem":304},"Algorithms","/en/document/js-algorithms/guide/algorithms","en/document/07.js-algorithms/01.guide/04.algorithms",{"title":306,"path":307,"stem":308},"Algorithmic Techniques","/en/document/js-algorithms/guide/heuristic","en/document/07.js-algorithms/01.guide/05.heuristic",{"title":310,"path":311,"stem":312},"Depth-First and Breadth-First Search","/en/document/js-algorithms/guide/search","en/document/07.js-algorithms/01.guide/06.search",{"title":314,"path":315,"stem":316,"children":317,"page":49},"Frontend Tooling","/en/document/automation","en/document/08.automation",[318],{"title":22,"path":319,"stem":320,"children":321,"icon":48},"/en/document/automation/guide","en/document/08.automation/01.guide/01.index",[322,324],{"title":323,"path":319,"stem":320},"What Is Front-End Engineering?",{"title":325,"path":326,"stem":327},"Set Up a Front-End Project","/en/document/automation/guide/start","en/document/08.automation/01.guide/02.start",{"title":329,"path":330,"stem":331,"children":332,"page":49},"Webpack","/en/document/webpack","en/document/09.webpack",[333],{"title":22,"path":334,"stem":335,"children":336,"icon":48},"/en/document/webpack/guide","en/document/09.webpack/01.guide/01.index",[337,339,343,347,351,355,359],{"title":338,"path":334,"stem":335},"Introduction to webpack",{"title":340,"path":341,"stem":342},"Set up a webpack project","/en/document/webpack/guide/start","en/document/09.webpack/01.guide/02.start",{"title":344,"path":345,"stem":346},"Loaders","/en/document/webpack/guide/loader","en/document/09.webpack/01.guide/03.loader",{"title":348,"path":349,"stem":350},"Plugins","/en/document/webpack/guide/plugin","en/document/09.webpack/01.guide/04.plugin",{"title":352,"path":353,"stem":354},"HMR and development mode","/en/document/webpack/guide/dev","en/document/09.webpack/01.guide/05.dev",{"title":356,"path":357,"stem":358},"Performance optimization","/en/document/webpack/guide/optimize","en/document/09.webpack/01.guide/06.optimize",{"title":360,"path":361,"stem":362},"Build for production with webpack","/en/document/webpack/guide/production","en/document/09.webpack/01.guide/07.production",{"title":364,"path":365,"stem":366,"children":367,"page":49},"Sass","/en/document/scss","en/document/10.scss",[368],{"title":369,"path":370,"stem":371,"children":372},"What is SCSS?","/en/document/scss/guide","en/document/10.scss/01.guide/01.index",[373,374,378,382,386,390,394,398],{"title":369,"path":370,"stem":371},{"title":375,"path":376,"stem":377},"SCSS syntax basics","/en/document/scss/guide/syntax","en/document/10.scss/01.guide/02.syntax",{"title":379,"path":380,"stem":381},"Starting an SCSS project","/en/document/scss/guide/start","en/document/10.scss/01.guide/03.start",{"title":383,"path":384,"stem":385},"Importing SCSS modules","/en/document/scss/guide/import","en/document/10.scss/01.guide/04.import",{"title":387,"path":388,"stem":389},"Mixins and functions","/en/document/scss/guide/mixin","en/document/10.scss/01.guide/05.mixin",{"title":391,"path":392,"stem":393},"SCSS extension and placeholders","/en/document/scss/guide/extend","en/document/10.scss/01.guide/06.extend",{"title":395,"path":396,"stem":397},"SCSS flow control and logic","/en/document/scss/guide/flow","en/document/10.scss/01.guide/07.flow",{"title":399,"path":400,"stem":401},"SCSS built-in functions","/en/document/scss/guide/function","en/document/10.scss/01.guide/08.function",{"title":403,"path":404,"stem":405,"children":406,"page":49},"ESLint","/en/document/eslint","en/document/11.eslint",[407],{"title":22,"path":408,"stem":409,"children":410,"icon":48},"/en/document/eslint/guide","en/document/11.eslint/01.guide/01.index",[411,413,417,421,425],{"title":412,"path":408,"stem":409},"What Is ESLint?",{"title":414,"path":415,"stem":416},"Installing and Running ESLint","/en/document/eslint/guide/install","en/document/11.eslint/01.guide/02.install",{"title":418,"path":419,"stem":420},"Introduction to ESLint Rules","/en/document/eslint/guide/rule","en/document/11.eslint/01.guide/03.rule",{"title":422,"path":423,"stem":424},"Integrating ESLint with Webpack","/en/document/eslint/guide/webpack","en/document/11.eslint/01.guide/04.webpack",{"title":426,"path":427,"stem":428},"Using Plugins and Extends","/en/document/eslint/guide/plugins","en/document/11.eslint/01.guide/05.plugins",{"title":430,"path":431,"stem":432,"children":433,"page":49},"Axios","/en/document/axios","en/document/12.axios",[434,444],{"title":22,"path":435,"stem":436,"children":437,"icon":48},"/en/document/axios/guide","en/document/12.axios/01.guide/01.index",[438,440],{"title":439,"path":435,"stem":436},"HTTP and Network Requests",{"title":441,"path":442,"stem":443},"Making Requests with JavaScript","/en/document/axios/guide/get","en/document/12.axios/01.guide/02.get",{"title":430,"path":445,"stem":446,"children":447,"icon":48},"/en/document/axios/axios","en/document/12.axios/02.axios/01.index",[448,450,454,458],{"title":449,"path":445,"stem":446},"Getting Started with Axios",{"title":451,"path":452,"stem":453},"Making Requests with Axios","/en/document/axios/axios/start","en/document/12.axios/02.axios/02.start",{"title":455,"path":456,"stem":457},"Advanced Axios Techniques","/en/document/axios/axios/advenced","en/document/12.axios/02.axios/03.advenced",{"title":459,"path":460,"stem":461},"Resolving CORS Issues","/en/document/axios/axios/cors","en/document/12.axios/02.axios/04.cors",{"title":463,"path":464,"stem":465,"children":466,"page":49},"TypeScript","/en/document/typescript","en/document/13.typescript",[467],{"title":22,"path":468,"stem":469,"children":470,"icon":48},"/en/document/typescript/guide","en/document/13.typescript/01.guide/01.index",[471,473,477,481,485,489,493],{"title":472,"path":468,"stem":469},"Introduction to TypeScript",{"title":474,"path":475,"stem":476},"Type System Basics","/en/document/typescript/guide/base","en/document/13.typescript/01.guide/02.base",{"title":478,"path":479,"stem":480},"Combining Types and Using Type Guards","/en/document/typescript/guide/compose","en/document/13.typescript/01.guide/03.compose",{"title":482,"path":483,"stem":484},"Classes and Object-Oriented Programming","/en/document/typescript/guide/class","en/document/13.typescript/01.guide/04.class",{"title":486,"path":487,"stem":488},"Generics and Type Reuse","/en/document/typescript/guide/generic","en/document/13.typescript/01.guide/05.generic",{"title":490,"path":491,"stem":492},"Advanced Project Configuration in Practice","/en/document/typescript/guide/config","en/document/13.typescript/01.guide/06.config",{"title":494,"path":495,"stem":496},"Third-Party Library Types and Declarations","/en/document/typescript/guide/declare","en/document/13.typescript/01.guide/07.declare",{"title":498,"path":499,"stem":500,"children":501,"page":49},"Vue 2","/en/document/vue2","en/document/14.vue2",[502],{"title":22,"path":503,"stem":504,"children":505,"icon":48},"/en/document/vue2/guide","en/document/14.vue2/01.guide/01.index",[506,508,512,516,520],{"title":507,"path":503,"stem":504},"Getting Started with Vue 2",{"title":509,"path":510,"stem":511},"Template Syntax and Directives","/en/document/vue2/guide/directive","en/document/14.vue2/01.guide/02.directive",{"title":513,"path":514,"stem":515},"Component-Based Development Basics","/en/document/vue2/guide/component","en/document/14.vue2/01.guide/03.component",{"title":517,"path":518,"stem":519},"Computed Properties and Watchers","/en/document/vue2/guide/reactive","en/document/14.vue2/01.guide/04.reactive",{"title":521,"path":522,"stem":523},"Understanding Lifecycle Hooks","/en/document/vue2/guide/hooks","en/document/14.vue2/01.guide/05.hooks",{"title":525,"path":526,"stem":527,"children":528,"page":49},"Vue Router","/en/document/router","en/document/15.router",[529],{"title":525,"path":530,"stem":531,"children":532,"icon":48},"/en/document/router/guide","en/document/15.router/01.guide/01.index",[533,535,539,543],{"title":534,"path":530,"stem":531},"Getting Started with Vue Router",{"title":536,"path":537,"stem":538},"Core Routing Features Explained","/en/document/router/guide/routing","en/document/15.router/01.guide/02.routing",{"title":540,"path":541,"stem":542},"Navigation Guards and Route Metadata","/en/document/router/guide/hook","en/document/15.router/01.guide/03.hook",{"title":544,"path":545,"stem":546},"Route Optimization and Lazy Loading","/en/document/router/guide/optimize","en/document/15.router/01.guide/04.optimize",{"title":548,"path":549,"stem":550,"children":551,"page":49},"Vuex","/en/document/vuex","en/document/16.vuex",[552],{"title":553,"path":554,"stem":555,"children":556,"icon":48},"Vuex State Management","/en/document/vuex/guide","en/document/16.vuex/01.guide/01.index",[557,559,563,567],{"title":558,"path":554,"stem":555},"Why Use Vuex?",{"title":560,"path":561,"stem":562},"Getting Started with Vuex","/en/document/vuex/guide/start","en/document/16.vuex/01.guide/02.start",{"title":564,"path":565,"stem":566},"Understanding Vuex Core Features","/en/document/vuex/guide/core","en/document/16.vuex/01.guide/03.core",{"title":568,"path":569,"stem":570},"Modules and Advanced Usage","/en/document/vuex/guide/module","en/document/16.vuex/01.guide/04.module",{"title":572,"path":573,"stem":574,"children":575,"page":49},"Element UI","/en/document/element-ui","en/document/17.element-ui",[576],{"title":577,"path":578,"stem":579,"children":580,"icon":48},"Element UI Component Library","/en/document/element-ui/guide","en/document/17.element-ui/01.guide/01.index",[581,583,587,591,595,599],{"title":582,"path":578,"stem":579},"Getting Started with Element UI",{"title":584,"path":585,"stem":586},"Common Components","/en/document/element-ui/guide/quickstart","en/document/17.element-ui/01.guide/02.quickstart",{"title":588,"path":589,"stem":590},"Layout and Structure","/en/document/element-ui/guide/layout","en/document/17.element-ui/01.guide/03.layout",{"title":592,"path":593,"stem":594},"Custom Component Styles","/en/document/element-ui/guide/style","en/document/17.element-ui/01.guide/04.style",{"title":596,"path":597,"stem":598},"Wrapping and Reusing Components","/en/document/element-ui/guide/component","en/document/17.element-ui/01.guide/05.component",{"title":600,"path":601,"stem":602},"Theme Colors and Dark Mode","/en/document/element-ui/guide/theme","en/document/17.element-ui/01.guide/06.theme",{"title":604,"path":605,"stem":606,"children":607,"page":49},"Vue 3","/en/document/vue3","en/document/18.vue3",[608],{"title":609,"path":610,"stem":611,"children":612,"icon":48},"Vue3","/en/document/vue3/guide","en/document/18.vue3/01.guide/01.index",[613,615,619,623,627,631,635],{"title":614,"path":610,"stem":611},"Vue 3 Overview and Ecosystem Updates",{"title":616,"path":617,"stem":618},"Getting Started with the Composition API","/en/document/vue3/guide/composition","en/document/18.vue3/01.guide/02.composition",{"title":620,"path":621,"stem":622},"Reusing Composition API Logic","/en/document/vue3/guide/composable","en/document/18.vue3/01.guide/03.composable",{"title":624,"path":625,"stem":626},"Template Syntax and New Features","/en/document/vue3/guide/features","en/document/18.vue3/01.guide/04.features",{"title":628,"path":629,"stem":630},"TypeScript Support","/en/document/vue3/guide/typescript","en/document/18.vue3/01.guide/05.typescript",{"title":632,"path":633,"stem":634},"Reactivity Internals and Advanced APIs","/en/document/vue3/guide/reactive","en/document/18.vue3/01.guide/06.reactive",{"title":636,"path":637,"stem":638},"Vue Router 4 in Practice","/en/document/vue3/guide/vue-router","en/document/18.vue3/01.guide/07.vue-router",{"title":640,"path":641,"stem":642,"children":643,"page":49},"Pinia","/en/document/pinia","en/document/19.pinia",[644],{"title":645,"path":646,"stem":647,"children":648},"Introduction and Installation","/en/document/pinia/guide","en/document/19.pinia/01.guide/01.index",[649,650,654,658,662,666],{"title":645,"path":646,"stem":647},{"title":651,"path":652,"stem":653},"Store Essentials","/en/document/pinia/guide/store","en/document/19.pinia/01.guide/02.store",{"title":655,"path":656,"stem":657},"Using Stores in Components","/en/document/pinia/guide/usage","en/document/19.pinia/01.guide/03.usage",{"title":659,"path":660,"stem":661},"Updating State and Reactivity","/en/document/pinia/guide/state","en/document/19.pinia/01.guide/04.state",{"title":663,"path":664,"stem":665},"Actions and Async Operations","/en/document/pinia/guide/action","en/document/19.pinia/01.guide/05.action",{"title":667,"path":668,"stem":669},"Composition, TypeScript, and Plugins","/en/document/pinia/guide/advanced","en/document/19.pinia/01.guide/06.advanced",{"title":671,"path":672,"stem":673,"children":674,"page":49},"Vite","/en/document/vite","en/document/20.vite",[675],{"title":671,"path":676,"stem":677,"children":678,"icon":48},"/en/document/vite/guide","en/document/20.vite/01.guide/01.index",[679,681,685,689,693,697],{"title":680,"path":676,"stem":677},"Introduction to Vite and Installation",{"title":682,"path":683,"stem":684},"Basic Configuration","/en/document/vite/guide/config","en/document/20.vite/01.guide/02.config",{"title":686,"path":687,"stem":688},"Common Plugins","/en/document/vite/guide/plugins","en/document/20.vite/01.guide/03.plugins",{"title":690,"path":691,"stem":692},"Environment Variables and Modes","/en/document/vite/guide/env","en/document/20.vite/01.guide/04.env",{"title":694,"path":695,"stem":696},"Dependency Pre-bundling","/en/document/vite/guide/optimize-deps","en/document/20.vite/01.guide/05.optimize-deps",{"title":698,"path":699,"stem":700},"Build and Deployment","/en/document/vite/guide/build-deploy","en/document/20.vite/01.guide/06.build-deploy",{"title":702,"path":703,"stem":704,"children":705,"page":49},"Nuxt.js","/en/document/nuxt","en/document/21.nuxt",[706],{"title":702,"path":707,"stem":708,"children":709,"icon":48},"/en/document/nuxt/guide","en/document/21.nuxt/01.guide/01.index",[710,712,716,720,724,728],{"title":711,"path":707,"stem":708},"Introduction to Nuxt.js and Installation",{"title":713,"path":714,"stem":715},"Directory Conventions and Auto-imports","/en/document/nuxt/guide/directory-and-auto-imports","en/document/21.nuxt/01.guide/02.directory-and-auto-imports",{"title":717,"path":718,"stem":719},"File-based Routing and Navigation","/en/document/nuxt/guide/routing","en/document/21.nuxt/01.guide/03.routing",{"title":721,"path":722,"stem":723},"Data Fetching","/en/document/nuxt/guide/data-fetching","en/document/21.nuxt/01.guide/04.data-fetching",{"title":725,"path":726,"stem":727},"State Management","/en/document/nuxt/guide/state-management","en/document/21.nuxt/01.guide/05.state-management",{"title":729,"path":730,"stem":731},"Configuration and Deployment","/en/document/nuxt/guide/config-and-deploy","en/document/21.nuxt/01.guide/06.config-and-deploy",{"title":733,"path":734,"stem":735,"children":736,"page":49},"npm","/en/document/npm","en/document/22.npm",[737],{"title":738,"path":739,"stem":740,"children":741,"icon":768},"NPM","/en/document/npm/guide","en/document/22.npm/01.guide/01.index",[742,744,748,752,756,760,764],{"title":743,"path":739,"stem":740},"Getting started with NPM",{"title":745,"path":746,"stem":747},"Understanding package.json","/en/document/npm/guide/package-json","en/document/22.npm/01.guide/02.package-json",{"title":749,"path":750,"stem":751},"Installation and versions","/en/document/npm/guide/install-commands","en/document/22.npm/01.guide/03.install-commands",{"title":753,"path":754,"stem":755},"scripts and npx","/en/document/npm/guide/scripts-and-npx","en/document/22.npm/01.guide/04.scripts-and-npx",{"title":757,"path":758,"stem":759},"Publishing and registry mirrors","/en/document/npm/guide/publish-and-registry","en/document/22.npm/01.guide/05.publish-and-registry",{"title":761,"path":762,"stem":763},"Lockfiles and cleanup","/en/document/npm/guide/lock-and-clean","en/document/22.npm/01.guide/06.lock-and-clean",{"title":765,"path":766,"stem":767},"Yarn and pnpm","/en/document/npm/guide/yarn-and-pnpm","en/document/22.npm/01.guide/07.yarn-and-pnpm","i-simple-icons-npm",{"title":770,"icon":771,"path":772,"stem":773,"children":774,"page":49},"Handlebars","i-simple-icons-handlebarsdotjs","/en/document/handlebars","en/document/23.handlebars",[775],{"title":776,"path":777,"stem":778,"children":779},"Introduction to Handlebars","/en/document/handlebars/guide","en/document/23.handlebars/01.guide/01.index",[780,781,785,789,793,797],{"title":776,"path":777,"stem":778},{"title":782,"path":783,"stem":784},"Basic syntax","/en/document/handlebars/guide/syntax","en/document/23.handlebars/01.guide/02.syntax",{"title":786,"path":787,"stem":788},"Built-in helpers","/en/document/handlebars/guide/builtins","en/document/23.handlebars/01.guide/03.builtins",{"title":790,"path":791,"stem":792},"Template reuse","/en/document/handlebars/guide/partials","en/document/23.handlebars/01.guide/04.partials",{"title":794,"path":795,"stem":796},"Custom helpers","/en/document/handlebars/guide/helpers","en/document/23.handlebars/01.guide/05.helpers",{"title":798,"path":799,"stem":800},"Precompilation and runtime","/en/document/handlebars/guide/runtime","en/document/23.handlebars/01.guide/06.runtime",{"title":802,"icon":803,"path":804,"stem":805,"children":806,"page":49},"Plop","i-simple-icons-nodedotjs","/en/document/plop","en/document/24.plop",[807],{"title":808,"path":809,"stem":810,"children":811},"Introduction to Plop","/en/document/plop/guide","en/document/24.plop/01.guide/01.index",[812,813,817,821,825,829,833],{"title":808,"path":809,"stem":810},{"title":814,"path":815,"stem":816},"Your First Generator","/en/document/plop/guide/plopfile","en/document/24.plop/01.guide/02.plopfile",{"title":818,"path":819,"stem":820},"Interactive Prompts","/en/document/plop/guide/prompts","en/document/24.plop/01.guide/03.prompts",{"title":822,"path":823,"stem":824},"Core Actions","/en/document/plop/guide/actions","en/document/24.plop/01.guide/04.actions",{"title":826,"path":827,"stem":828},"Organizing Template Files","/en/document/plop/guide/templates","en/document/24.plop/01.guide/05.templates",{"title":830,"path":831,"stem":832},"Custom Helpers","/en/document/plop/guide/helpers","en/document/24.plop/01.guide/06.helpers",{"title":834,"path":835,"stem":836},"Building a Component Generator","/en/document/plop/guide/practice","en/document/24.plop/01.guide/07.practice",{"title":838,"path":839,"stem":840,"children":841,"page":49},"Rollup","/en/document/rollup","en/document/25.rollup",[842],{"title":843,"path":844,"stem":845,"children":846},"Introduction to Rollup","/en/document/rollup/guide","en/document/25.rollup/01.guide/01.index",[847,848,851,855,858,862],{"title":843,"path":844,"stem":845},{"title":682,"path":849,"stem":850},"/en/document/rollup/guide/config","en/document/25.rollup/01.guide/02.config",{"title":852,"path":853,"stem":854},"Output Formats","/en/document/rollup/guide/formats","en/document/25.rollup/01.guide/03.formats",{"title":686,"path":856,"stem":857},"/en/document/rollup/guide/plugins","en/document/25.rollup/01.guide/04.plugins",{"title":859,"path":860,"stem":861},"Tree Shaking","/en/document/rollup/guide/tree-shaking","en/document/25.rollup/01.guide/05.tree-shaking",{"title":863,"path":864,"stem":865},"Building a Utility Library","/en/document/rollup/guide/library","en/document/25.rollup/01.guide/06.library",{"title":867,"path":868,"stem":869,"children":870,"page":49},"Snabbdom","/en/document/snabbdom","en/document/26.snabbdom",[871],{"title":872,"path":873,"stem":874,"children":875},"Introduction to Snabbdom","/en/document/snabbdom/guide","en/document/26.snabbdom/01.guide/01.index",[876,877,881,885,889,893,897],{"title":872,"path":873,"stem":874},{"title":878,"path":879,"stem":880},"The h function","/en/document/snabbdom/guide/h","en/document/26.snabbdom/01.guide/02.h",{"title":882,"path":883,"stem":884},"Modules","/en/document/snabbdom/guide/modules","en/document/26.snabbdom/01.guide/03.modules",{"title":886,"path":887,"stem":888},"Rendering and updates with patch","/en/document/snabbdom/guide/patch","en/document/26.snabbdom/01.guide/04.patch",{"title":890,"path":891,"stem":892},"The role of keys","/en/document/snabbdom/guide/key","en/document/26.snabbdom/01.guide/05.key",{"title":894,"path":895,"stem":896},"How diffing works","/en/document/snabbdom/guide/diff","en/document/26.snabbdom/01.guide/06.diff",{"title":898,"path":899,"stem":900},"Build a miniature virtual DOM","/en/document/snabbdom/guide/practice","en/document/26.snabbdom/01.guide/07.practice",{"title":902,"icon":903,"path":904,"stem":905,"children":906,"page":49},"Vercel","i-simple-icons-vercel","/en/document/vercel","en/document/27.vercel",[907],{"title":908,"path":909,"stem":910,"children":911},"Introduction to Vercel","/en/document/vercel/guide","en/document/27.vercel/01.guide/01.index",[912,913,917,921,925,929,933],{"title":908,"path":909,"stem":910},{"title":914,"path":915,"stem":916},"Vercel CLI","/en/document/vercel/guide/cli","en/document/27.vercel/01.guide/02.cli",{"title":918,"path":919,"stem":920},"Settings and Environment Variables","/en/document/vercel/guide/settings","en/document/27.vercel/01.guide/03.settings",{"title":922,"path":923,"stem":924},"Previews and Rollbacks","/en/document/vercel/guide/preview","en/document/27.vercel/01.guide/04.preview",{"title":926,"path":927,"stem":928},"Custom Domains","/en/document/vercel/guide/domain","en/document/27.vercel/01.guide/05.domain",{"title":930,"path":931,"stem":932},"vercel.json Configuration","/en/document/vercel/guide/vercel-json","en/document/27.vercel/01.guide/06.vercel-json",{"title":934,"path":935,"stem":936},"Serverless Functions","/en/document/vercel/guide/serverless","en/document/27.vercel/01.guide/07.serverless",{"title":938,"icon":939,"path":940,"stem":941,"children":942,"page":49},"ECharts","i-simple-icons-apacheecharts","/en/document/echarts","en/document/28.echarts",[943],{"title":944,"path":945,"stem":946,"children":947},"Introduction to ECharts","/en/document/echarts/guide","en/document/28.echarts/01.guide/01.index",[948,949,953,957,961,965,969],{"title":944,"path":945,"stem":946},{"title":950,"path":951,"stem":952},"Core configuration options","/en/document/echarts/guide/option","en/document/28.echarts/01.guide/02.option",{"title":954,"path":955,"stem":956},"Common chart types","/en/document/echarts/guide/charts","en/document/28.echarts/01.guide/03.charts",{"title":958,"path":959,"stem":960},"Styles and themes","/en/document/echarts/guide/style","en/document/28.echarts/01.guide/04.style",{"title":962,"path":963,"stem":964},"Interactions and events","/en/document/echarts/guide/interaction","en/document/28.echarts/01.guide/05.interaction",{"title":966,"path":967,"stem":968},"Dynamic data","/en/document/echarts/guide/data","en/document/28.echarts/01.guide/06.data",{"title":970,"path":971,"stem":972},"Vue 3 in practice","/en/document/echarts/guide/vue","en/document/28.echarts/01.guide/07.vue",{"title":974,"icon":975,"path":976,"stem":977,"children":978,"page":49},"D3","i-simple-icons-d3dotjs","/en/document/d3","en/document/29.d3",[979],{"title":980,"path":981,"stem":982,"children":983},"Introduction to D3","/en/document/d3/guide","en/document/29.d3/01.guide/01.index",[984,985,989,993,997,1001,1005,1009],{"title":980,"path":981,"stem":982},{"title":986,"path":987,"stem":988},"Selections and data binding","/en/document/d3/guide/selection","en/document/29.d3/01.guide/02.selection",{"title":990,"path":991,"stem":992},"Scales","/en/document/d3/guide/scale","en/document/29.d3/01.guide/03.scale",{"title":994,"path":995,"stem":996},"Axes","/en/document/d3/guide/axis","en/document/29.d3/01.guide/04.axis",{"title":998,"path":999,"stem":1000},"Shape generators","/en/document/d3/guide/shape","en/document/29.d3/01.guide/05.shape",{"title":1002,"path":1003,"stem":1004},"Transitions","/en/document/d3/guide/transition","en/document/29.d3/01.guide/06.transition",{"title":1006,"path":1007,"stem":1008},"Interaction and zooming","/en/document/d3/guide/interaction","en/document/29.d3/01.guide/07.interaction",{"title":1010,"path":1011,"stem":1012},"D3 with Vue 3","/en/document/d3/guide/vue","en/document/29.d3/01.guide/08.vue",{"title":1014,"icon":1015,"path":1016,"stem":1017,"children":1018,"page":49},"Three.js","i-simple-icons-threedotjs","/en/document/threejs","en/document/30.threejs",[1019,1033,1055,1073],{"title":1020,"path":1021,"stem":1022,"children":1023,"icon":1015},"Three.js Basics","/en/document/threejs/basics","en/document/30.threejs/01.basics/01.index",[1024,1025,1029],{"title":1020,"path":1021,"stem":1022},{"title":1026,"path":1027,"stem":1028},"Object Transforms","/en/document/threejs/basics/transform","en/document/30.threejs/01.basics/02.transform",{"title":1030,"path":1031,"stem":1032},"Cameras and Views","/en/document/threejs/basics/camera-controls","en/document/30.threejs/01.basics/03.camera-controls",{"title":1034,"icon":1035,"path":1036,"stem":1037,"children":1038,"page":49},"Creating and Organizing 3D Scenes","i-lucide-boxes","/en/document/threejs/scene","en/document/30.threejs/02.scene",[1039,1043,1047,1051],{"title":1040,"path":1041,"stem":1042},"Geometry and Mesh","/en/document/threejs/scene/geometry","en/document/30.threejs/02.scene/04.geometry",{"title":1044,"path":1045,"stem":1046},"Materials and Lights","/en/document/threejs/scene/material-light","en/document/30.threejs/02.scene/05.material-light",{"title":1048,"path":1049,"stem":1050},"Textures and Color Spaces","/en/document/threejs/scene/texture","en/document/30.threejs/02.scene/06.texture",{"title":1052,"path":1053,"stem":1054},"Scene Graphs and Objects","/en/document/threejs/scene/scene-graph","en/document/30.threejs/02.scene/07.scene-graph",{"title":1056,"icon":1057,"path":1058,"stem":1059,"children":1060,"page":49},"Models, Animation, and Interaction","i-lucide-orbit","/en/document/threejs/model-interaction","en/document/30.threejs/03.model-interaction",[1061,1065,1069],{"title":1062,"path":1063,"stem":1064},"Model Loading","/en/document/threejs/model-interaction/model-loading","en/document/30.threejs/03.model-interaction/08.model-loading",{"title":1066,"path":1067,"stem":1068},"Animation Loops","/en/document/threejs/model-interaction/animation-loop","en/document/30.threejs/03.model-interaction/09.animation-loop",{"title":1070,"path":1071,"stem":1072},"Raycasting and Interaction","/en/document/threejs/model-interaction/raycast-interaction","en/document/30.threejs/03.model-interaction/10.raycast-interaction",{"title":1074,"icon":1075,"path":1076,"stem":1077,"children":1078,"page":49},"Engineering and Performance","i-lucide-gauge","/en/document/threejs/engineering","en/document/30.threejs/04.engineering",[1079],{"title":1080,"path":1081,"stem":1082},"Renderer and Performance","/en/document/threejs/engineering/renderer-performance","en/document/30.threejs/04.engineering/11.renderer-performance",{"title":1084,"icon":803,"path":1085,"stem":1086,"children":1087,"page":49},"Node.js fundamentals","/en/document/nodejs","en/document/32.nodejs",[1088,1103,1114,1149,1164],{"title":1089,"path":1090,"stem":1091,"children":1092},"Getting started with Node.js","/en/document/nodejs/guide","en/document/32.nodejs/01.guide/01.index",[1093,1095,1099],{"title":1094,"path":1090,"stem":1091},"Introduction and use cases",{"title":1096,"path":1097,"stem":1098},"Environment setup","/en/document/nodejs/guide/setup","en/document/32.nodejs/01.guide/02.setup",{"title":1100,"path":1101,"stem":1102},"Running programs","/en/document/nodejs/guide/running","en/document/32.nodejs/01.guide/03.running",{"title":1104,"path":1105,"stem":1106,"children":1107},"Node.js module system","/en/document/nodejs/modules","en/document/32.nodejs/02.modules/01.index",[1108,1110],{"title":1109,"path":1105,"stem":1106},"ESM and CommonJS",{"title":1111,"path":1112,"stem":1113},"Module loading","/en/document/nodejs/modules/loading","en/document/32.nodejs/02.modules/02.loading",{"title":1115,"path":1116,"stem":1117,"children":1118},"Core Node.js modules","/en/document/nodejs/core","en/document/32.nodejs/03.core/01.index",[1119,1121,1125,1129,1133,1137,1141,1145],{"title":1120,"path":1116,"stem":1117},"Path handling",{"title":1122,"path":1123,"stem":1124},"Files and directories with fs","/en/document/nodejs/core/file-system","en/document/32.nodejs/03.core/02.file-system",{"title":1126,"path":1127,"stem":1128},"Asynchronous files with fs/promises","/en/document/nodejs/core/fs-promises","en/document/32.nodejs/03.core/03.fs-promises",{"title":1130,"path":1131,"stem":1132},"Buffer and character encodings","/en/document/nodejs/core/buffer","en/document/32.nodejs/03.core/04.buffer",{"title":1134,"path":1135,"stem":1136},"The process object","/en/document/nodejs/core/process","en/document/32.nodejs/03.core/05.process",{"title":1138,"path":1139,"stem":1140},"Events with EventEmitter","/en/document/nodejs/core/events","en/document/32.nodejs/03.core/06.events",{"title":1142,"path":1143,"stem":1144},"URLs and query parameters","/en/document/nodejs/core/url-query","en/document/32.nodejs/03.core/07.url-query",{"title":1146,"path":1147,"stem":1148},"Common crypto capabilities","/en/document/nodejs/core/crypto","en/document/32.nodejs/03.core/08.crypto",{"title":1150,"path":1151,"stem":1152,"children":1153},"Asynchronous I/O and runtime behavior","/en/document/nodejs/async","en/document/32.nodejs/04.async/01.index",[1154,1156,1160],{"title":1155,"path":1151,"stem":1152},"Single-threaded execution and nonblocking I/O",{"title":1157,"path":1158,"stem":1159},"The event loop","/en/document/nodejs/async/event-loop","en/document/32.nodejs/04.async/02.event-loop",{"title":1161,"path":1162,"stem":1163},"Asynchronous task scheduling","/en/document/nodejs/async/scheduling","en/document/32.nodejs/04.async/03.scheduling",{"title":1165,"path":1166,"stem":1167,"children":1168},"Streams and data processing","/en/document/nodejs/streams","en/document/32.nodejs/05.streams/01.index",[1169],{"title":1170,"path":1166,"stem":1167},"Processing data with streams",{"title":1172,"icon":1173,"path":1174,"stem":1175,"children":1176,"page":49},"Express","i-simple-icons-express","/en/document/express","en/document/33.express",[1177],{"title":1178,"path":1179,"stem":1180,"children":1181},"Introduction to Express","/en/document/express/guide","en/document/33.express/01.guide/01.index",[1182,1183,1187,1191,1195,1199],{"title":1178,"path":1179,"stem":1180},{"title":1184,"path":1185,"stem":1186},"Routing","/en/document/express/guide/routing","en/document/33.express/01.guide/02.routing",{"title":1188,"path":1189,"stem":1190},"Middleware","/en/document/express/guide/middleware","en/document/33.express/01.guide/03.middleware",{"title":1192,"path":1193,"stem":1194},"Requests and Responses","/en/document/express/guide/request-response","en/document/33.express/01.guide/04.request-response",{"title":1196,"path":1197,"stem":1198},"Error Handling","/en/document/express/guide/error-handling","en/document/33.express/01.guide/05.error-handling",{"title":1200,"path":1201,"stem":1202},"RESTful API Project","/en/document/express/guide/restful-api","en/document/33.express/01.guide/06.restful-api",{"title":1204,"icon":1205,"path":1206,"stem":1207,"children":1208,"page":49},"Koa","i-simple-icons-koa","/en/document/koa","en/document/34.koa",[1209],{"title":1210,"path":1211,"stem":1212,"children":1213},"Introduction to Koa","/en/document/koa/guide","en/document/34.koa/01.guide/01.index",[1214,1215,1219,1223,1226,1230],{"title":1210,"path":1211,"stem":1212},{"title":1216,"path":1217,"stem":1218},"Context","/en/document/koa/guide/context","en/document/34.koa/01.guide/02.context",{"title":1220,"path":1221,"stem":1222},"Middleware and the Onion Model","/en/document/koa/guide/middleware","en/document/34.koa/01.guide/03.middleware",{"title":1184,"path":1224,"stem":1225},"/en/document/koa/guide/routing","en/document/34.koa/01.guide/04.routing",{"title":1227,"path":1228,"stem":1229},"Request Bodies and Errors","/en/document/koa/guide/body-and-error","en/document/34.koa/01.guide/05.body-and-error",{"title":1200,"path":1231,"stem":1232},"/en/document/koa/guide/restful-api","en/document/34.koa/01.guide/06.restful-api",{"title":1234,"icon":1235,"path":1236,"stem":1237,"children":1238,"page":49},"Egg.js","i-lucide-egg","/en/document/egg","en/document/35.egg",[1239],{"title":1240,"path":1241,"stem":1242,"children":1243},"Introduction to Egg.js","/en/document/egg/guide","en/document/35.egg/01.guide/01.index",[1244,1245,1249,1253,1257,1261],{"title":1240,"path":1241,"stem":1242},{"title":1246,"path":1247,"stem":1248},"Routes and Controllers","/en/document/egg/guide/router-controller","en/document/35.egg/01.guide/02.router-controller",{"title":1250,"path":1251,"stem":1252},"Service Layer","/en/document/egg/guide/service","en/document/35.egg/01.guide/03.service",{"title":1254,"path":1255,"stem":1256},"Configuration and Middleware","/en/document/egg/guide/config-middleware","en/document/35.egg/01.guide/04.config-middleware",{"title":1258,"path":1259,"stem":1260},"Plugins and Extensions","/en/document/egg/guide/plugin-extend","en/document/35.egg/01.guide/05.plugin-extend",{"title":1262,"path":1263,"stem":1264},"RESTful API Practice","/en/document/egg/guide/restful-api","en/document/35.egg/01.guide/06.restful-api",{"title":1266,"icon":1267,"path":1268,"stem":1269,"children":1270,"page":49},"Docker","i-simple-icons-docker","/en/document/docker","en/document/36.docker",[1271],{"title":1272,"path":1273,"stem":1274,"children":1275},"Introduction to Docker","/en/document/docker/guide","en/document/36.docker/01.guide/01.index",[1276,1277,1281,1285,1289],{"title":1272,"path":1273,"stem":1274},{"title":1278,"path":1279,"stem":1280},"Images and Containers","/en/document/docker/guide/image-container","en/document/36.docker/01.guide/02.image-container",{"title":1282,"path":1283,"stem":1284},"Volumes","/en/document/docker/guide/volume","en/document/36.docker/01.guide/03.volume",{"title":1286,"path":1287,"stem":1288},"Dockerfile","/en/document/docker/guide/dockerfile","en/document/36.docker/01.guide/04.dockerfile",{"title":1290,"path":1291,"stem":1292},"Docker Compose","/en/document/docker/guide/docker-compose","en/document/36.docker/01.guide/05.docker-compose",{"title":1294,"icon":1295,"path":1296,"stem":1297,"children":1298,"page":49},"MySQL","i-simple-icons-mysql","/en/document/mysql","en/document/37.mysql",[1299,1313,1332,1347,1358],{"title":1300,"path":1301,"stem":1302,"children":1303},"Getting Started","/en/document/mysql/guide","en/document/37.mysql/01.guide/01.index",[1304,1305,1309],{"title":1300,"path":1301,"stem":1302},{"title":1306,"path":1307,"stem":1308},"Databases and CRUD","/en/document/mysql/guide/crud","en/document/37.mysql/01.guide/02.crud",{"title":1310,"path":1311,"stem":1312},"Types and Constraints","/en/document/mysql/guide/data-type","en/document/37.mysql/01.guide/03.data-type",{"title":1314,"path":1315,"stem":1316,"children":1317},"Queries and Aggregation","/en/document/mysql/query","en/document/37.mysql/02.query/01.index",[1318,1320,1324,1328],{"title":1319,"path":1315,"stem":1316},"Filtering and Pagination",{"title":1321,"path":1322,"stem":1323},"Grouping and Aggregation","/en/document/mysql/query/aggregate","en/document/37.mysql/02.query/02.aggregate",{"title":1325,"path":1326,"stem":1327},"Joining Tables","/en/document/mysql/query/join","en/document/37.mysql/02.query/03.join",{"title":1329,"path":1330,"stem":1331},"Subqueries and Ranking","/en/document/mysql/query/subqueries","en/document/37.mysql/02.query/04.subqueries",{"title":1333,"path":1334,"stem":1335,"children":1336},"Table Design and Transactions","/en/document/mysql/reliability","en/document/37.mysql/03.reliability/01.index",[1337,1339,1343],{"title":1338,"path":1334,"stem":1335},"Relationship Design",{"title":1340,"path":1341,"stem":1342},"Transactions and Rollbacks","/en/document/mysql/reliability/transactions","en/document/37.mysql/03.reliability/02.transactions",{"title":1344,"path":1345,"stem":1346},"Concurrency and Locks","/en/document/mysql/reliability/concurrency","en/document/37.mysql/03.reliability/03.concurrency",{"title":1348,"path":1349,"stem":1350,"children":1351},"Indexes and Performance","/en/document/mysql/performance","en/document/37.mysql/04.performance/01.index",[1352,1354],{"title":1353,"path":1349,"stem":1350},"Index Design",{"title":1355,"path":1356,"stem":1357},"Execution Plans and Optimization","/en/document/mysql/performance/explain","en/document/37.mysql/04.performance/02.explain",{"title":1359,"path":1360,"stem":1361,"children":1362},"Application Integration and Maintenance","/en/document/mysql/engineering","en/document/37.mysql/05.engineering/01.index",[1363,1365],{"title":1364,"path":1360,"stem":1361},"Node.js Integration",{"title":1366,"path":1367,"stem":1368},"Backup and Recovery","/en/document/mysql/engineering/backup","en/document/37.mysql/05.engineering/02.backup",{"title":1370,"icon":1371,"path":1372,"stem":1373,"children":1374,"page":49},"MongoDB","i-simple-icons-mongodb","/en/document/mongodb","en/document/38.mongodb",[1375],{"title":1376,"path":1377,"stem":1378,"children":1379},"Introduction to MongoDB","/en/document/mongodb/guide","en/document/38.mongodb/01.guide/01.index",[1380,1381,1385,1389,1393,1397,1401,1405],{"title":1376,"path":1377,"stem":1378},{"title":1382,"path":1383,"stem":1384},"CRUD Operations","/en/document/mongodb/guide/crud","en/document/38.mongodb/01.guide/02.crud",{"title":1386,"path":1387,"stem":1388},"Query Filters","/en/document/mongodb/guide/query","en/document/38.mongodb/01.guide/03.query",{"title":1390,"path":1391,"stem":1392},"Documents and Data Types","/en/document/mongodb/guide/document","en/document/38.mongodb/01.guide/04.document",{"title":1394,"path":1395,"stem":1396},"MongoDB in Node.js","/en/document/mongodb/guide/nodejs","en/document/38.mongodb/01.guide/05.nodejs",{"title":1398,"path":1399,"stem":1400},"Mongoose","/en/document/mongodb/guide/mongoose","en/document/38.mongodb/01.guide/06.mongoose",{"title":1402,"path":1403,"stem":1404},"Indexes","/en/document/mongodb/guide/optimize","en/document/38.mongodb/01.guide/07.optimize",{"title":1406,"path":1407,"stem":1408},"Aggregation Pipelines","/en/document/mongodb/guide/aggregate","en/document/38.mongodb/01.guide/08.aggregate",{"title":1410,"icon":1411,"path":1412,"stem":1413,"children":1414,"page":49},"GraphQL","i-simple-icons-graphql","/en/document/graphql","en/document/39.graphql",[1415],{"title":1416,"path":1417,"stem":1418,"children":1419},"Introduction to GraphQL","/en/document/graphql/guide","en/document/39.graphql/01.guide/01.index",[1420,1421,1425,1429,1433,1437],{"title":1416,"path":1417,"stem":1418},{"title":1422,"path":1423,"stem":1424},"Type System","/en/document/graphql/guide/schema","en/document/39.graphql/01.guide/02.schema",{"title":1426,"path":1427,"stem":1428},"Advanced Queries","/en/document/graphql/guide/query","en/document/39.graphql/01.guide/03.query",{"title":1430,"path":1431,"stem":1432},"Mutations","/en/document/graphql/guide/mutation","en/document/39.graphql/01.guide/04.mutation",{"title":1434,"path":1435,"stem":1436},"Express Integration","/en/document/graphql/guide/express","en/document/39.graphql/01.guide/05.express",{"title":1438,"path":1439,"stem":1440},"Frontend Requests","/en/document/graphql/guide/client","en/document/39.graphql/01.guide/06.client",{"title":1442,"icon":1443,"path":1444,"stem":1445,"children":1446,"page":49},"Vue 2 Source Code","i-simple-icons-vuedotjs","/en/document/source-vue2","en/document/40.source-vue2",[1447],{"title":1442,"path":1448,"stem":1449,"children":1450},"/en/document/source-vue2/guide","en/document/40.source-vue2/01.guide/01.index",[1451,1452,1456,1460,1464,1468,1472,1476],{"title":1442,"path":1448,"stem":1449},{"title":1453,"path":1454,"stem":1455},"Initialization","/en/document/source-vue2/guide/init","en/document/40.source-vue2/01.guide/02.init",{"title":1457,"path":1458,"stem":1459},"Reactivity","/en/document/source-vue2/guide/reactive","en/document/40.source-vue2/01.guide/03.reactive",{"title":1461,"path":1462,"stem":1463},"Dep and Watcher","/en/document/source-vue2/guide/dep-watcher","en/document/40.source-vue2/01.guide/04.dep-watcher",{"title":1465,"path":1466,"stem":1467},"Asynchronous Updates and nextTick","/en/document/source-vue2/guide/nexttick","en/document/40.source-vue2/01.guide/05.nexttick",{"title":1469,"path":1470,"stem":1471},"Virtual DOM and patch","/en/document/source-vue2/guide/vnode-patch","en/document/40.source-vue2/01.guide/06.vnode-patch",{"title":1473,"path":1474,"stem":1475},"Template Compilation","/en/document/source-vue2/guide/compile","en/document/40.source-vue2/01.guide/07.compile",{"title":1477,"path":1478,"stem":1479},"computed and watch Internals","/en/document/source-vue2/guide/computed-watch","en/document/40.source-vue2/01.guide/08.computed-watch",{"title":1481,"icon":1443,"path":1482,"stem":1483,"children":1484,"page":49},"Vue 3 Source Code","/en/document/source-vue3","en/document/41.source-vue3",[1485],{"title":1486,"path":1487,"stem":1488,"children":1489},"Introduction to Vue 3 Source Code","/en/document/source-vue3/guide","en/document/41.source-vue3/01.guide/01.index",[1490,1491,1495,1499,1503,1507,1511,1514],{"title":1486,"path":1487,"stem":1488},{"title":1492,"path":1493,"stem":1494},"Creation and Mounting","/en/document/source-vue3/guide/create-app","en/document/41.source-vue3/01.guide/02.create-app",{"title":1496,"path":1497,"stem":1498},"Proxy-Based Reactivity","/en/document/source-vue3/guide/reactive","en/document/41.source-vue3/01.guide/03.reactive",{"title":1500,"path":1501,"stem":1502},"effect and Dependency Tracking","/en/document/source-vue3/guide/effect","en/document/41.source-vue3/01.guide/04.effect",{"title":1504,"path":1505,"stem":1506},"ref and computed","/en/document/source-vue3/guide/ref-computed","en/document/41.source-vue3/01.guide/05.ref-computed",{"title":1508,"path":1509,"stem":1510},"Scheduler and nextTick","/en/document/source-vue3/guide/scheduler-nexttick","en/document/41.source-vue3/01.guide/06.scheduler-nexttick",{"title":1469,"path":1512,"stem":1513},"/en/document/source-vue3/guide/vnode-patch","en/document/41.source-vue3/01.guide/07.vnode-patch",{"title":1473,"path":1515,"stem":1516},"/en/document/source-vue3/guide/compile","en/document/41.source-vue3/01.guide/08.compile",{"title":1518,"icon":1519,"path":1520,"stem":1521,"children":1522,"page":49},"Performance Optimization","i-lucide-zap","/en/document/performance","en/document/42.performance",[1523],{"title":1524,"path":1525,"stem":1526,"children":1527},"Introduction to Performance Optimization","/en/document/performance/guide","en/document/42.performance/01.guide/01.index",[1528,1529,1533,1537,1541,1545],{"title":1524,"path":1525,"stem":1526},{"title":1530,"path":1531,"stem":1532},"Loading Optimization","/en/document/performance/guide/loading","en/document/42.performance/01.guide/02.loading",{"title":1534,"path":1535,"stem":1536},"Rendering Optimization","/en/document/performance/guide/rendering","en/document/42.performance/01.guide/03.rendering",{"title":1538,"path":1539,"stem":1540},"Caching Strategies","/en/document/performance/guide/cache","en/document/42.performance/01.guide/04.cache",{"title":1542,"path":1543,"stem":1544},"Build Output Optimization","/en/document/performance/guide/build","en/document/42.performance/01.guide/05.build",{"title":1546,"path":1547,"stem":1548},"Performance Metrics and Tools","/en/document/performance/guide/metrics","en/document/42.performance/01.guide/06.metrics",{"title":1550,"icon":1551,"path":1552,"stem":1553,"children":1554,"page":49},"Frontend Monitoring","i-lucide-activity","/en/document/monitor","en/document/43.monitor",[1555],{"title":1556,"path":1557,"stem":1558,"children":1559},"Introduction to Frontend Monitoring","/en/document/monitor/guide","en/document/43.monitor/01.guide/01.index",[1560,1561,1565,1569,1573,1577],{"title":1556,"path":1557,"stem":1558},{"title":1562,"path":1563,"stem":1564},"Error Collection","/en/document/monitor/guide/error","en/document/43.monitor/01.guide/02.error",{"title":1566,"path":1567,"stem":1568},"Tracking and Reporting","/en/document/monitor/guide/tracking","en/document/43.monitor/01.guide/03.tracking",{"title":1570,"path":1571,"stem":1572},"Performance Data Reporting","/en/document/monitor/guide/performance-data","en/document/43.monitor/01.guide/04.performance-data",{"title":1574,"path":1575,"stem":1576},"Sentry in Practice","/en/document/monitor/guide/sentry","en/document/43.monitor/01.guide/05.sentry",{"title":1578,"path":1579,"stem":1580},"Logging and Alerts","/en/document/monitor/guide/logging","en/document/43.monitor/01.guide/06.logging",{"title":1582,"icon":1583,"path":1584,"stem":1585,"children":1586,"page":49},"Electron","i-simple-icons-electron","/en/document/electron","en/document/44.electron",[1587,1603,1621,1639,1656],{"title":1588,"path":1589,"stem":1590,"children":1591,"icon":1602},"Architecture Basics","/en/document/electron/guide","en/document/44.electron/01.guide/01.index",[1592,1594,1598],{"title":1593,"path":1589,"stem":1590},"Introduction to Electron",{"title":1595,"path":1596,"stem":1597},"Main Process, Renderer Process, and Preload Scripts","/en/document/electron/guide/process-model","en/document/44.electron/01.guide/02.process-model",{"title":1599,"path":1600,"stem":1601},"Integrating Electron with Vue","/en/document/electron/guide/vue-integration","en/document/44.electron/01.guide/03.vue-integration","i-lucide-layers",{"title":1604,"icon":1605,"path":1606,"stem":1607,"children":1608,"page":49},"Core Development","i-lucide-code-2","/en/document/electron/core","en/document/44.electron/02.core",[1609,1613,1617],{"title":1610,"path":1611,"stem":1612},"Window Creation and Application Lifecycle","/en/document/electron/core/window-lifecycle","en/document/44.electron/02.core/04.window-lifecycle",{"title":1614,"path":1615,"stem":1616},"IPC and API Design","/en/document/electron/core/ipc-design","en/document/44.electron/02.core/05.ipc-design",{"title":1618,"path":1619,"stem":1620},"Local Files and System Interaction","/en/document/electron/core/filesystem-system","en/document/44.electron/02.core/06.filesystem-system",{"title":1622,"icon":1623,"path":1624,"stem":1625,"children":1626,"page":49},"Desktop Capabilities and Security","i-lucide-monitor-cog","/en/document/electron/desktop","en/document/44.electron/03.desktop",[1627,1631,1635],{"title":1628,"path":1629,"stem":1630},"Desktop Security Basics","/en/document/electron/desktop/security","en/document/44.electron/03.desktop/07.security",{"title":1632,"path":1633,"stem":1634},"Menus, Tray Icons, and Multiple Windows","/en/document/electron/desktop/window-menu-tray","en/document/44.electron/03.desktop/08.window-menu-tray",{"title":1636,"path":1637,"stem":1638},"Sessions, Networking, and Local Storage","/en/document/electron/desktop/session-storage","en/document/44.electron/03.desktop/09.session-storage",{"title":1640,"icon":1075,"path":1641,"stem":1642,"children":1643,"page":49},"Resources, Performance, and Export","/en/document/electron/stability","en/document/44.electron/04.stability",[1644,1648,1652],{"title":1645,"path":1646,"stem":1647},"Custom Protocols, Resource Loading, and Deep Links","/en/document/electron/stability/protocol-loading","en/document/44.electron/04.stability/10.protocol-loading",{"title":1649,"path":1650,"stem":1651},"Long-running Tasks and Performance Troubleshooting","/en/document/electron/stability/tasks-performance","en/document/44.electron/04.stability/11.tasks-performance",{"title":1653,"path":1654,"stem":1655},"PDF Printing and Report Export","/en/document/electron/stability/pdf-report","en/document/44.electron/04.stability/12.pdf-report",{"title":1657,"icon":1658,"path":1659,"stem":1660,"children":1661,"page":49},"Delivery and Practical Project","i-lucide-rocket","/en/document/electron/delivery","en/document/44.electron/05.delivery",[1662,1666,1670,1674],{"title":1663,"path":1664,"stem":1665},"Application Packaging and Automatic Updates","/en/document/electron/delivery/package-update","en/document/44.electron/05.delivery/13.package-update",{"title":1667,"path":1668,"stem":1669},"Desktop Application Signing and Notarization","/en/document/electron/delivery/code-signing","en/document/44.electron/05.delivery/14.code-signing",{"title":1671,"path":1672,"stem":1673},"Testing, Monitoring, and Release","/en/document/electron/delivery/test-monitor-release","en/document/44.electron/05.delivery/15.test-monitor-release",{"title":1675,"path":1676,"stem":1677},"Project: A Desktop Document Manager","/en/document/electron/delivery/project-file-manager","en/document/44.electron/05.delivery/16.project-file-manager",{"title":1679,"icon":1680,"path":1681,"stem":1682,"children":1683,"page":49},"WebGIS","i-lucide-map","/en/document/webgis","en/document/45.webgis",[1684,1691,1705,1719,1737,1751],{"title":1685,"path":1686,"stem":1687,"children":1688,"icon":1680},"WebGIS Fundamentals","/en/document/webgis/guide","en/document/45.webgis/01.guide/01.index",[1689],{"title":1690,"path":1686,"stem":1687},"WebGIS Overview",{"title":1692,"icon":1693,"path":1694,"stem":1695,"children":1696,"page":49},"Spatial Data Fundamentals","i-lucide-shapes","/en/document/webgis/spatial","en/document/45.webgis/02.spatial",[1697,1701],{"title":1698,"path":1699,"stem":1700},"Vector and Raster","/en/document/webgis/spatial/vector-and-raster","en/document/45.webgis/02.spatial/02.vector-and-raster",{"title":1702,"path":1703,"stem":1704},"GeoJSON and Common Formats","/en/document/webgis/spatial/geojson-and-formats","en/document/45.webgis/02.spatial/03.geojson-and-formats",{"title":1706,"icon":1707,"path":1708,"stem":1709,"children":1710,"page":49},"Coordinates and Map Projections","i-lucide-compass","/en/document/webgis/coordinate","en/document/45.webgis/03.coordinate",[1711,1715],{"title":1712,"path":1713,"stem":1714},"CRS and Map Projections","/en/document/webgis/coordinate/coordinate-reference-systems","en/document/45.webgis/03.coordinate/04.coordinate-reference-systems",{"title":1716,"path":1717,"stem":1718},"Transformations and Misalignment","/en/document/webgis/coordinate/coordinate-offset","en/document/45.webgis/03.coordinate/05.coordinate-offset",{"title":1720,"icon":1721,"path":1722,"stem":1723,"children":1724,"page":49},"Tiles and Map Services","i-lucide-grid-2x2","/en/document/webgis/tiles","en/document/45.webgis/04.tiles",[1725,1729,1733],{"title":1726,"path":1727,"stem":1728},"Map Tiles","/en/document/webgis/tiles/map-tiles","en/document/45.webgis/04.tiles/06.map-tiles",{"title":1730,"path":1731,"stem":1732},"Raster and Vector Tiles","/en/document/webgis/tiles/raster-and-vector-tiles","en/document/45.webgis/04.tiles/07.raster-and-vector-tiles",{"title":1734,"path":1735,"stem":1736},"Map Services and OGC","/en/document/webgis/tiles/map-services","en/document/45.webgis/04.tiles/08.map-services",{"title":1738,"icon":1739,"path":1740,"stem":1741,"children":1742,"page":49},"Spatial Queries and Analysis","i-lucide-search","/en/document/webgis/analysis","en/document/45.webgis/05.analysis",[1743,1747],{"title":1744,"path":1745,"stem":1746},"Spatial Queries and Relationships","/en/document/webgis/analysis/spatial-relationships","en/document/45.webgis/05.analysis/09.spatial-relationships",{"title":1748,"path":1749,"stem":1750},"Distance, Area, and Spatial Analysis","/en/document/webgis/analysis/distance-and-analysis","en/document/45.webgis/05.analysis/10.distance-and-analysis",{"title":1752,"icon":1753,"path":1754,"stem":1755,"children":1756,"page":49},"GIS Data Engineering","i-lucide-database","/en/document/webgis/engineering","en/document/45.webgis/06.engineering",[1757,1761],{"title":1758,"path":1759,"stem":1760},"GIS Data Processing and Cleaning","/en/document/webgis/engineering/data-cleaning","en/document/45.webgis/06.engineering/11.data-cleaning",{"title":1762,"path":1763,"stem":1764},"Displaying Large Datasets","/en/document/webgis/engineering/large-data-display","en/document/45.webgis/06.engineering/12.large-data-display",{"title":1766,"icon":1767,"path":1768,"stem":1769,"children":1770,"page":49},"Mapbox GL JS","i-simple-icons-mapbox","/en/document/mapbox-gl-js","en/document/46.mapbox-gl-js",[1771,1786,1812],{"title":1772,"path":1773,"stem":1774,"children":1775,"icon":1680},"Map fundamentals","/en/document/mapbox-gl-js/start","en/document/46.mapbox-gl-js/01.start/01.index",[1776,1778,1782],{"title":1777,"path":1773,"stem":1774},"Getting started",{"title":1779,"path":1780,"stem":1781},"Initialization and camera control","/en/document/mapbox-gl-js/start/view-control","en/document/46.mapbox-gl-js/01.start/02.view-control",{"title":1783,"path":1784,"stem":1785},"Events and basic controls","/en/document/mapbox-gl-js/start/events-controls","en/document/46.mapbox-gl-js/01.start/03.events-controls",{"title":1787,"icon":1788,"path":1789,"stem":1790,"children":1791,"page":49},"Data and styling","i-lucide-layers-3","/en/document/mapbox-gl-js/data","en/document/46.mapbox-gl-js/02.data",[1792,1796,1800,1804,1808],{"title":1793,"path":1794,"stem":1795},"Sources and layers","/en/document/mapbox-gl-js/data/source-layer","en/document/46.mapbox-gl-js/02.data/04.source-layer",{"title":1797,"path":1798,"stem":1799},"GeoJSON geometry","/en/document/mapbox-gl-js/data/geojson-features","en/document/46.mapbox-gl-js/02.data/05.geojson-features",{"title":1801,"path":1802,"stem":1803},"Styling and expressions","/en/document/mapbox-gl-js/data/style-expressions","en/document/46.mapbox-gl-js/02.data/06.style-expressions",{"title":1805,"path":1806,"stem":1807},"Markers, popups, and symbols","/en/document/mapbox-gl-js/data/marker-popup-symbol","en/document/46.mapbox-gl-js/02.data/07.marker-popup-symbol",{"title":1809,"path":1810,"stem":1811},"Tile services","/en/document/mapbox-gl-js/data/tile-services","en/document/46.mapbox-gl-js/02.data/08.tile-services",{"title":1813,"icon":1814,"path":1815,"stem":1816,"children":1817,"page":49},"Application interactions","i-lucide-map-pinned","/en/document/mapbox-gl-js/business","en/document/46.mapbox-gl-js/03.business",[1818,1822,1826,1830,1834],{"title":1819,"path":1820,"stem":1821},"Queries and highlighting","/en/document/mapbox-gl-js/business/query-highlight","en/document/46.mapbox-gl-js/03.business/08.query-highlight",{"title":1823,"path":1824,"stem":1825},"Filtering and layer management","/en/document/mapbox-gl-js/business/filter-layers","en/document/46.mapbox-gl-js/03.business/09.filter-layers",{"title":1827,"path":1828,"stem":1829},"Point clustering","/en/document/mapbox-gl-js/business/clusters","en/document/46.mapbox-gl-js/03.business/10.clusters",{"title":1831,"path":1832,"stem":1833},"Drawing, editing, and measuring","/en/document/mapbox-gl-js/business/draw-measure","en/document/46.mapbox-gl-js/03.business/11.draw-measure",{"title":1835,"path":1836,"stem":1837},"Three.js integration","/en/document/mapbox-gl-js/business/three-in-mapbox","en/document/46.mapbox-gl-js/03.business/12.three-in-mapbox",{"title":1839,"icon":1788,"path":1840,"stem":1841,"children":1842,"page":49},"deck.gl","/en/document/deck-gl","en/document/47.deck-gl",[1843,1858,1875],{"title":1844,"path":1845,"stem":1846,"children":1847},"deck.gl Basics","/en/document/deck-gl/basics","en/document/47.deck-gl/01.basics/01.index",[1848,1850,1854],{"title":1849,"path":1845,"stem":1846},"Introduction to deck.gl",{"title":1851,"path":1852,"stem":1853},"Layers, Data, and Accessors","/en/document/deck-gl/basics/layer-data-accessor","en/document/47.deck-gl/01.basics/02.layer-data-accessor",{"title":1855,"path":1856,"stem":1857},"Common Basic Layers","/en/document/deck-gl/basics/common-layers","en/document/47.deck-gl/01.basics/03.common-layers",{"title":1859,"path":1860,"stem":1861,"children":1862,"page":49},"Map Interaction and Mapbox Integration","/en/document/deck-gl/interaction-mapbox","en/document/47.deck-gl/02.interaction-mapbox",[1863,1867,1871],{"title":1864,"path":1865,"stem":1866},"Picking and Tooltips","/en/document/deck-gl/interaction-mapbox/picking-tooltip","en/document/47.deck-gl/02.interaction-mapbox/04.picking-tooltip",{"title":1868,"path":1869,"stem":1870},"Coordinates and Units","/en/document/deck-gl/interaction-mapbox/coordinates-units","en/document/47.deck-gl/02.interaction-mapbox/05.coordinates-units",{"title":1872,"path":1873,"stem":1874},"deck.gl and Mapbox","/en/document/deck-gl/interaction-mapbox/mapbox-integration","en/document/47.deck-gl/02.interaction-mapbox/06.mapbox-integration",{"title":1876,"path":1877,"stem":1878,"children":1879,"page":49},"Dynamic Data and Thematic Visualization","/en/document/deck-gl/dynamic-thematic","en/document/47.deck-gl/03.dynamic-thematic",[1880,1884,1888,1892],{"title":1881,"path":1882,"stem":1883},"Layer Updates and Dynamic Data","/en/document/deck-gl/dynamic-thematic/layer-updates","en/document/47.deck-gl/03.dynamic-thematic/07.layer-updates",{"title":1885,"path":1886,"stem":1887},"Aggregation and Thematic Maps","/en/document/deck-gl/dynamic-thematic/aggregation-thematic","en/document/47.deck-gl/03.dynamic-thematic/08.aggregation-thematic",{"title":1889,"path":1890,"stem":1891},"Time Series and Trip Animation","/en/document/deck-gl/dynamic-thematic/trips-animation","en/document/47.deck-gl/03.dynamic-thematic/09.trips-animation",{"title":1893,"path":1894,"stem":1895},"Tiles and Large Spatial Datasets","/en/document/deck-gl/dynamic-thematic/tiles-large-data","en/document/47.deck-gl/03.dynamic-thematic/10.tiles-large-data",{"title":1897,"icon":803,"path":1898,"stem":1899,"children":1900,"page":49},"HTTP and Backend Fundamentals","/en/document/nodejs-backend","en/document/48.nodejs-backend",[1901,1921,1940,1959,1978,1997,2012,2027],{"title":1902,"path":1903,"stem":1904,"children":1905,"icon":1920},"Backend Fundamentals","/en/document/nodejs-backend/guide","en/document/48.nodejs-backend/01.guide/01.index",[1906,1908,1912,1916],{"title":1907,"path":1903,"stem":1904},"Frontend and Backend Responsibilities",{"title":1909,"path":1910,"stem":1911},"HTTP and HTTPS Fundamentals","/en/document/nodejs-backend/guide/http-https","en/document/48.nodejs-backend/01.guide/02.http-https",{"title":1913,"path":1914,"stem":1915},"Cookies, Sessions, and the Same-Origin Policy","/en/document/nodejs-backend/guide/cookies-origin","en/document/48.nodejs-backend/01.guide/03.cookies-origin",{"title":1917,"path":1918,"stem":1919},"The Request Lifecycle","/en/document/nodejs-backend/guide/request-lifecycle","en/document/48.nodejs-backend/01.guide/04.request-lifecycle","i-lucide-book-open",{"title":1922,"path":1923,"stem":1924,"children":1925,"icon":1920},"Node.js HTTP Services","/en/document/nodejs-backend/http","en/document/48.nodejs-backend/02.http/01.index",[1926,1928,1932,1936],{"title":1927,"path":1923,"stem":1924},"Create an HTTP Server with Node.js",{"title":1929,"path":1930,"stem":1931},"Parse HTTP Requests","/en/document/nodejs-backend/http/request","en/document/48.nodejs-backend/02.http/02.request",{"title":1933,"path":1934,"stem":1935},"Handle HTTP Responses","/en/document/nodejs-backend/http/response","en/document/48.nodejs-backend/02.http/03.response",{"title":1937,"path":1938,"stem":1939},"Route Matching and Request Processing","/en/document/nodejs-backend/http/routing","en/document/48.nodejs-backend/02.http/04.routing",{"title":1941,"path":1942,"stem":1943,"children":1944,"icon":1920},"RESTful API Design","/en/document/nodejs-backend/api","en/document/48.nodejs-backend/03.api/01.index",[1945,1947,1951,1955],{"title":1946,"path":1942,"stem":1943},"RESTful API Design and HTTP Methods",{"title":1948,"path":1949,"stem":1950},"Validate API Parameters and Data Formats","/en/document/nodejs-backend/api/validation","en/document/48.nodejs-backend/03.api/02.validation",{"title":1952,"path":1953,"stem":1954},"Response Formats, Error Codes, and Exception Handling","/en/document/nodejs-backend/api/errors","en/document/48.nodejs-backend/03.api/03.errors",{"title":1956,"path":1957,"stem":1958},"API Versioning, Pagination, Filtering, Sorting, and Documentation","/en/document/nodejs-backend/api/query-contract","en/document/48.nodejs-backend/03.api/04.query-contract",{"title":1960,"path":1961,"stem":1962,"children":1963,"icon":1920},"Authentication and Access Control","/en/document/nodejs-backend/auth","en/document/48.nodejs-backend/04.auth/01.index",[1964,1966,1970,1974],{"title":1965,"path":1961,"stem":1962},"Authentication and Authorization",{"title":1967,"path":1968,"stem":1969},"Sessions, JWTs, and Token Authentication","/en/document/nodejs-backend/auth/session-jwt","en/document/48.nodejs-backend/04.auth/02.session-jwt",{"title":1971,"path":1972,"stem":1973},"Access Tokens, Refresh Tokens, and Login State","/en/document/nodejs-backend/auth/token-lifecycle","en/document/48.nodejs-backend/04.auth/03.token-lifecycle",{"title":1975,"path":1976,"stem":1977},"RBAC and Endpoint-Level Access Control","/en/document/nodejs-backend/auth/rbac","en/document/48.nodejs-backend/04.auth/04.rbac",{"title":1979,"path":1980,"stem":1981,"children":1982,"icon":1920},"Backend Security","/en/document/nodejs-backend/security","en/document/48.nodejs-backend/05.security/01.index",[1983,1985,1989,1993],{"title":1984,"path":1980,"stem":1981},"CORS and Cross-Origin Requests",{"title":1986,"path":1987,"stem":1988},"XSS, CSRF, SQL Injection, and Web Security Risks","/en/document/nodejs-backend/security/web-risks","en/document/48.nodejs-backend/05.security/02.web-risks",{"title":1990,"path":1991,"stem":1992},"Password Security","/en/document/nodejs-backend/security/passwords","en/document/48.nodejs-backend/05.security/03.passwords",{"title":1994,"path":1995,"stem":1996},"API Protection","/en/document/nodejs-backend/security/request-protection","en/document/48.nodejs-backend/05.security/04.request-protection",{"title":1998,"path":1999,"stem":2000,"children":2001,"icon":1920},"Backend Engineering and Architecture","/en/document/nodejs-backend/architecture","en/document/48.nodejs-backend/06.architecture/01.index",[2002,2004,2008],{"title":2003,"path":1999,"stem":2000},"Backend Project Structure and Layered Architecture",{"title":2005,"path":2006,"stem":2007},"Controller, Service, and Repository Responsibilities","/en/document/nodejs-backend/architecture/layers","en/document/48.nodejs-backend/06.architecture/02.layers",{"title":2009,"path":2010,"stem":2011},"Configuration, Logging, and Error Handling","/en/document/nodejs-backend/architecture/configuration-logging","en/document/48.nodejs-backend/06.architecture/03.configuration-logging",{"title":2013,"path":2014,"stem":2015,"children":2016,"icon":1920},"Common Backend Features","/en/document/nodejs-backend/business","en/document/48.nodejs-backend/07.business/01.index",[2017,2019,2023],{"title":2018,"path":2014,"stem":2015},"File Uploads, Downloads, and Static Assets",{"title":2020,"path":2021,"stem":2022},"Email, Verification Codes, and Third-Party Services","/en/document/nodejs-backend/business/integrations","en/document/48.nodejs-backend/07.business/02.integrations",{"title":2024,"path":2025,"stem":2026},"WebSocket, SSE, and Real-Time Messaging","/en/document/nodejs-backend/business/realtime","en/document/48.nodejs-backend/07.business/03.realtime",{"title":2028,"path":2029,"stem":2030,"children":2031,"icon":1920},"API Testing and Deployment","/en/document/nodejs-backend/delivery","en/document/48.nodejs-backend/08.delivery/01.index",[2032,2034],{"title":2033,"path":2029,"stem":2030},"API Debugging and Automated Testing",{"title":2035,"path":2036,"stem":2037},"Deploying Node.js Services","/en/document/nodejs-backend/delivery/deployment","en/document/48.nodejs-backend/08.delivery/02.deployment",{"title":2039,"icon":2040,"path":2041,"stem":2042,"children":2043,"page":49},"Redis","i-simple-icons-redis","/en/document/redis","en/document/50.redis",[2044,2059,2074,2085],{"title":2045,"path":2046,"stem":2047,"children":2048},"Redis Basics and Data Structures","/en/document/redis/guide","en/document/50.redis/01.guide/01.index",[2049,2051,2055],{"title":2050,"path":2046,"stem":2047},"Introduction and Node.js Integration",{"title":2052,"path":2053,"stem":2054},"Core Data Types and Common Operations","/en/document/redis/guide/data-types","en/document/50.redis/01.guide/02.data-types",{"title":2056,"path":2057,"stem":2058},"Key Management and Expiration","/en/document/redis/guide/keys-expiration","en/document/50.redis/01.guide/03.keys-expiration",{"title":2060,"path":2061,"stem":2062,"children":2063},"Redis Core Mechanisms","/en/document/redis/mechanisms","en/document/50.redis/02.mechanisms/01.index",[2064,2066,2070],{"title":2065,"path":2061,"stem":2062},"Atomic Operations, Transactions, and Pipelining",{"title":2067,"path":2068,"stem":2069},"Memory Management and Eviction Policies","/en/document/redis/mechanisms/memory-eviction","en/document/50.redis/02.mechanisms/02.memory-eviction",{"title":2071,"path":2072,"stem":2073},"Persistence","/en/document/redis/mechanisms/persistence","en/document/50.redis/02.mechanisms/03.persistence",{"title":2075,"path":2076,"stem":2077,"children":2078},"Redis in Node.js Applications","/en/document/redis/applications","en/document/50.redis/03.applications/01.index",[2079,2081],{"title":2080,"path":2076,"stem":2077},"Data Caching",{"title":2082,"path":2083,"stem":2084},"Common Caching Problems and Solutions","/en/document/redis/applications/cache-protection","en/document/50.redis/03.applications/02.cache-protection",{"title":2086,"path":2087,"stem":2088,"children":2089},"Redis in Production","/en/document/redis/production","en/document/50.redis/04.production/01.index",[2090],{"title":2091,"path":2087,"stem":2088},"Connection Management, Security, and Troubleshooting",{"title":2093,"icon":2094,"path":2095,"stem":2096,"children":2097,"page":49},"BullMQ","i-lucide-list-todo","/en/document/bullmq","en/document/51.bullmq",[2098,2109,2124],{"title":2099,"path":2100,"stem":2101,"children":2102},"BullMQ Basics","/en/document/bullmq/guide","en/document/51.bullmq/01.guide/01.index",[2103,2105],{"title":2104,"path":2100,"stem":2101},"Introduction and Quick Start",{"title":2106,"path":2107,"stem":2108},"Queue, Worker, and Job","/en/document/bullmq/guide/queue-worker-job","en/document/51.bullmq/01.guide/02.queue-worker-job",{"title":2110,"path":2111,"stem":2112,"children":2113},"Scheduling and Management","/en/document/bullmq/scheduling","en/document/51.bullmq/02.scheduling/01.index",[2114,2116,2120],{"title":2115,"path":2111,"stem":2112},"Delayed and Scheduled Jobs",{"title":2117,"path":2118,"stem":2119},"Concurrency and Rate Limiting","/en/document/bullmq/scheduling/concurrency-rate-limiting","en/document/51.bullmq/02.scheduling/02.concurrency-rate-limiting",{"title":2121,"path":2122,"stem":2123},"States, Progress, and Events","/en/document/bullmq/scheduling/status-progress-events","en/document/51.bullmq/02.scheduling/03.status-progress-events",{"title":2125,"path":2126,"stem":2127,"children":2128},"Job Reliability","/en/document/bullmq/reliability","en/document/51.bullmq/03.reliability/01.index",[2129],{"title":2130,"path":2126,"stem":2127},"Retries and Error Handling",{"title":2132,"icon":2133,"path":2134,"stem":2135,"children":2136,"page":49},"RabbitMQ","i-simple-icons-rabbitmq","/en/document/rabbitmq","en/document/52.rabbitmq",[2137,2155,2170,2189],{"title":1777,"path":2138,"stem":2139,"children":2140},"/en/document/rabbitmq/guide","en/document/52.rabbitmq/01.guide/01.index",[2141,2143,2147,2151],{"title":2142,"path":2138,"stem":2139},"Introduction to RabbitMQ",{"title":2144,"path":2145,"stem":2146},"Installation and connection","/en/document/rabbitmq/guide/environment","en/document/52.rabbitmq/01.guide/02.environment",{"title":2148,"path":2149,"stem":2150},"Send and receive a message","/en/document/rabbitmq/guide/first-message","en/document/52.rabbitmq/01.guide/03.first-message",{"title":2152,"path":2153,"stem":2154},"Message bodies and properties","/en/document/rabbitmq/guide/message-format","en/document/52.rabbitmq/01.guide/04.message-format",{"title":2156,"path":2157,"stem":2158,"children":2159},"Exchanges and routing","/en/document/rabbitmq/routing","en/document/52.rabbitmq/02.routing/01.index",[2160,2162,2166],{"title":2161,"path":2157,"stem":2158},"Exchanges and publish/subscribe",{"title":2163,"path":2164,"stem":2165},"Exact routing with direct exchanges","/en/document/rabbitmq/routing/direct","en/document/52.rabbitmq/02.routing/02.direct",{"title":2167,"path":2168,"stem":2169},"Wildcard routing with topic exchanges","/en/document/rabbitmq/routing/topic","en/document/52.rabbitmq/02.routing/03.topic",{"title":2171,"path":2172,"stem":2173,"children":2174},"Message reliability","/en/document/rabbitmq/reliability","en/document/52.rabbitmq/03.reliability/01.index",[2175,2177,2181,2185],{"title":2176,"path":2172,"stem":2173},"Message processing and consumer acknowledgements",{"title":2178,"path":2179,"stem":2180},"Publisher confirms and returned messages","/en/document/rabbitmq/reliability/publisher-confirms","en/document/52.rabbitmq/03.reliability/02.publisher-confirms",{"title":2182,"path":2183,"stem":2184},"Queue durability and message persistence","/en/document/rabbitmq/reliability/persistence","en/document/52.rabbitmq/03.reliability/03.persistence",{"title":2186,"path":2187,"stem":2188},"Consumer failures and dead-letter handling","/en/document/rabbitmq/reliability/dead-letter","en/document/52.rabbitmq/03.reliability/04.dead-letter",{"title":2190,"path":2191,"stem":2192,"children":2193},"Consumers and operations","/en/document/rabbitmq/management","en/document/52.rabbitmq/04.management/01.index",[2194,2196],{"title":2195,"path":2191,"stem":2192},"Multiple consumers and prefetch control",{"title":2197,"path":2198,"stem":2199},"Queue state and troubleshooting","/en/document/rabbitmq/management/monitoring","en/document/52.rabbitmq/04.management/02.monitoring",{"title":2201,"icon":2202,"path":2203,"stem":2204,"children":2205,"page":49},"Socket.IO","i-simple-icons-socketdotio","/en/document/socket-io","en/document/53.socket-io",[2206,2221,2236,2247],{"title":2207,"path":2208,"stem":2209,"children":2210},"Introduction and Messaging","/en/document/socket-io/guide","en/document/53.socket-io/01.guide/01.index",[2211,2213,2217],{"title":2212,"path":2208,"stem":2209},"Introduction and Setup",{"title":2214,"path":2215,"stem":2216},"Emitting and Listening for Events","/en/document/socket-io/guide/events","en/document/53.socket-io/01.guide/02.events",{"title":2218,"path":2219,"stem":2220},"Acknowledgements and Input Validation","/en/document/socket-io/guide/acknowledgements","en/document/53.socket-io/01.guide/03.acknowledgements",{"title":2222,"path":2223,"stem":2224,"children":2225},"Broadcasting, Rooms, and Authentication","/en/document/socket-io/messaging","en/document/53.socket-io/02.messaging/01.index",[2226,2228,2232],{"title":2227,"path":2223,"stem":2224},"Broadcasting and Message Recipients",{"title":2229,"path":2230,"stem":2231},"Joining Rooms and Group Chat","/en/document/socket-io/messaging/rooms","en/document/53.socket-io/02.messaging/02.rooms",{"title":2233,"path":2234,"stem":2235},"Authentication and Room Permissions","/en/document/socket-io/messaging/authentication","en/document/53.socket-io/02.messaging/03.authentication",{"title":2237,"path":2238,"stem":2239,"children":2240},"Disconnections and Message Recovery","/en/document/socket-io/reliability","en/document/53.socket-io/03.reliability/01.index",[2241,2243],{"title":2242,"path":2238,"stem":2239},"Reconnection and Connection Status",{"title":2244,"path":2245,"stem":2246},"Recent Messages and Recovery","/en/document/socket-io/reliability/history","en/document/53.socket-io/03.reliability/02.history",{"title":2248,"path":2249,"stem":2250,"children":2251},"Deployment and Troubleshooting","/en/document/socket-io/production","en/document/53.socket-io/04.production/01.index",[2252],{"title":2248,"path":2249,"stem":2250},{"title":2254,"icon":2255,"path":2256,"stem":2257,"children":2258,"page":49},"Nginx","i-simple-icons-nginx","/en/document/nginx","en/document/55.nginx",[2259,2277,2296,2311],{"title":1300,"path":2260,"stem":2261,"children":2262},"/en/document/nginx/guide","en/document/55.nginx/01.guide/01.index",[2263,2265,2269,2273],{"title":2264,"path":2260,"stem":2261},"Course Overview",{"title":2266,"path":2267,"stem":2268},"Installation and Setup","/en/document/nginx/guide/install","en/document/55.nginx/01.guide/02.install",{"title":2270,"path":2271,"stem":2272},"Configuration Structure","/en/document/nginx/guide/configuration","en/document/55.nginx/01.guide/03.configuration",{"title":2274,"path":2275,"stem":2276},"Starting and Reloading","/en/document/nginx/guide/lifecycle","en/document/55.nginx/01.guide/04.lifecycle",{"title":2278,"path":2279,"stem":2280,"children":2281},"Serving Static Websites","/en/document/nginx/website","en/document/55.nginx/02.website/01.index",[2282,2284,2288,2292],{"title":2283,"path":2279,"stem":2280},"Static Files and Directories",{"title":2285,"path":2286,"stem":2287},"Site and Path Matching","/en/document/nginx/website/location","en/document/55.nginx/02.website/02.location",{"title":2289,"path":2290,"stem":2291},"Frontend Routing and Fallbacks","/en/document/nginx/website/spa-routing","en/document/55.nginx/02.website/03.spa-routing",{"title":2293,"path":2294,"stem":2295},"Caching and Compression","/en/document/nginx/website/cache-gzip","en/document/55.nginx/02.website/04.cache-gzip",{"title":2297,"path":2298,"stem":2299,"children":2300},"Proxying and Load Balancing","/en/document/nginx/proxy","en/document/55.nginx/03.proxy/01.index",[2301,2303,2307],{"title":2302,"path":2298,"stem":2299},"Reverse Proxy Basics",{"title":2304,"path":2305,"stem":2306},"Forwarded Headers and Timeouts","/en/document/nginx/proxy/forwarded-headers","en/document/55.nginx/03.proxy/02.forwarded-headers",{"title":2308,"path":2309,"stem":2310},"Load Balancing","/en/document/nginx/proxy/load-balancing","en/document/55.nginx/03.proxy/03.load-balancing",{"title":2312,"path":2313,"stem":2314,"children":2315},"Troubleshooting and Deployment","/en/document/nginx/operations","en/document/55.nginx/04.operations/01.index",[2316,2318,2322],{"title":2317,"path":2313,"stem":2314},"Logs and Troubleshooting",{"title":2319,"path":2320,"stem":2321},"Size and Rate Limits","/en/document/nginx/operations/request-limits","en/document/55.nginx/04.operations/02.request-limits",{"title":2323,"path":2324,"stem":2325},"HTTPS and Certificates","/en/document/nginx/operations/https","en/document/55.nginx/04.operations/03.https",{"title":2327,"icon":2328,"path":2329,"stem":2330,"children":2331,"page":49},"Linux and server fundamentals","i-simple-icons-linux","/en/document/linux","en/document/56.linux",[2332,2359,2382],{"title":2333,"path":2334,"stem":2335,"children":2336},"Linux basics","/en/document/linux/guide","en/document/56.linux/01.guide/01.index",[2337,2339,2343,2347,2351,2355],{"title":2338,"path":2334,"stem":2335},"Linux course overview",{"title":2340,"path":2341,"stem":2342},"Filesystems and directories","/en/document/linux/guide/filesystem","en/document/56.linux/01.guide/02.filesystem",{"title":2344,"path":2345,"stem":2346},"Viewing files and using Vim","/en/document/linux/guide/editing","en/document/56.linux/01.guide/03.editing",{"title":2348,"path":2349,"stem":2350},"Search, pipelines, and redirection","/en/document/linux/guide/search-pipelines","en/document/56.linux/01.guide/04.search-pipelines",{"title":2352,"path":2353,"stem":2354},"Users, groups, and permissions","/en/document/linux/guide/permissions","en/document/56.linux/01.guide/05.permissions",{"title":2356,"path":2357,"stem":2358},"SSH and file transfers","/en/document/linux/guide/ssh","en/document/56.linux/01.guide/06.ssh",{"title":2360,"path":2361,"stem":2362,"children":2363},"Linux server administration","/en/document/linux/server","en/document/56.linux/02.server/01.index",[2364,2366,2370,2374,2378],{"title":2365,"path":2361,"stem":2362},"Packages and environment variables",{"title":2367,"path":2368,"stem":2369},"Processes and background execution","/en/document/linux/server/processes","en/document/56.linux/02.server/02.processes",{"title":2371,"path":2372,"stem":2373},"systemd service management","/en/document/linux/server/systemd","en/document/56.linux/02.server/03.systemd",{"title":2375,"path":2376,"stem":2377},"System resources and disks","/en/document/linux/server/resources","en/document/56.linux/02.server/05.resources",{"title":2379,"path":2380,"stem":2381},"System and application logs","/en/document/linux/server/logs","en/document/56.linux/02.server/06.logs",{"title":2383,"path":2384,"stem":2385,"children":2386},"Shell scripting and server practice","/en/document/linux/practice","en/document/56.linux/03.practice/01.index",[2387,2389,2393],{"title":2388,"path":2384,"stem":2385},"Bash scripting basics",{"title":2390,"path":2391,"stem":2392},"Scheduled tasks with cron","/en/document/linux/practice/cron","en/document/56.linux/03.practice/02.cron",{"title":2394,"path":2395,"stem":2396},"Basic server security","/en/document/linux/practice/security","en/document/56.linux/03.practice/03.security",{"title":2398,"icon":2399,"path":2400,"stem":2401,"children":2402,"page":49},"BFF and Multi-Service Architecture","i-lucide-network","/en/document/backend-architecture","en/document/57.backend-architecture",[2403,2418],{"title":2404,"path":2405,"stem":2406,"children":2407},"BFF Fundamentals and Practice","/en/document/backend-architecture/guide","en/document/57.backend-architecture/01.guide/01.index",[2408,2410,2414],{"title":2409,"path":2405,"stem":2406},"BFF Overview",{"title":2411,"path":2412,"stem":2413},"API Aggregation","/en/document/backend-architecture/guide/aggregation","en/document/57.backend-architecture/01.guide/02.aggregation",{"title":2415,"path":2416,"stem":2417},"API Adaptation and Boundaries","/en/document/backend-architecture/guide/adaptation","en/document/57.backend-architecture/01.guide/03.adaptation",{"title":2419,"path":2420,"stem":2421,"children":2422},"Service Decomposition and Communication","/en/document/backend-architecture/services","en/document/57.backend-architecture/02.services/01.index",[2423,2425,2429,2433],{"title":2424,"path":2420,"stem":2421},"From a Monolith to Services",{"title":2426,"path":2427,"stem":2428},"HTTP Service Communication","/en/document/backend-architecture/services/http-collaboration","en/document/57.backend-architecture/02.services/02.http-collaboration",{"title":2430,"path":2431,"stem":2432},"Unified API Entry Point","/en/document/backend-architecture/services/api-entry","en/document/57.backend-architecture/02.services/03.api-entry",{"title":2434,"path":2435,"stem":2436},"Service Call Failure Handling","/en/document/backend-architecture/services/failure-handling","en/document/57.backend-architecture/02.services/04.failure-handling",{"title":2438,"icon":2399,"path":2439,"stem":2440,"children":2441,"page":49},"Microservices Architecture","/en/document/microservices","en/document/58.microservices",[2442,2461,2480],{"title":2443,"path":2444,"stem":2445,"children":2446},"Microservices Architecture and Design","/en/document/microservices/guide","en/document/58.microservices/01.guide/01.index",[2447,2449,2453,2457],{"title":2448,"path":2444,"stem":2445},"Introduction to Microservices",{"title":2450,"path":2451,"stem":2452},"Designing and Decomposing Microservices","/en/document/microservices/guide/service-design","en/document/58.microservices/01.guide/02.service-design",{"title":2454,"path":2455,"stem":2456},"Project Structure and Setup","/en/document/microservices/guide/project-setup","en/document/58.microservices/01.guide/03.project-setup",{"title":2458,"path":2459,"stem":2460},"Service Communication and Discovery","/en/document/microservices/guide/communication-discovery","en/document/58.microservices/01.guide/04.communication-discovery",{"title":2462,"path":2463,"stem":2464,"children":2465},"Microservices Business Development","/en/document/microservices/development","en/document/58.microservices/02.development/01.index",[2466,2468,2472,2476],{"title":2467,"path":2463,"stem":2464},"Database Design",{"title":2469,"path":2470,"stem":2471},"Business Events","/en/document/microservices/development/business-events","en/document/58.microservices/02.development/02.business-events",{"title":2473,"path":2474,"stem":2475},"Distributed Transactions and Data Consistency","/en/document/microservices/development/distributed-transactions","en/document/58.microservices/02.development/03.distributed-transactions",{"title":2477,"path":2478,"stem":2479},"Fault Tolerance and Reliability","/en/document/microservices/development/resilience","en/document/58.microservices/02.development/04.resilience",{"title":2481,"path":2482,"stem":2483,"children":2484},"Microservices Operations and Governance","/en/document/microservices/operations","en/document/58.microservices/03.operations/01.index",[2485,2487,2491],{"title":2486,"path":2482,"stem":2483},"Security",{"title":2488,"path":2489,"stem":2490},"Observability","/en/document/microservices/operations/observability","en/document/58.microservices/03.operations/02.observability",{"title":2492,"path":2493,"stem":2494},"Deployment and Scaling","/en/document/microservices/operations/deployment-scaling","en/document/58.microservices/03.operations/04.deployment-scaling",{"title":2496,"icon":2497,"path":2498,"stem":2499,"children":2500,"page":49},"Kubernetes Application Deployment","i-simple-icons-kubernetes","/en/document/kubernetes","en/document/59.kubernetes",[2501,2524],{"title":2502,"path":2503,"stem":2504,"children":2505},"Kubernetes Fundamentals and Application Deployment","/en/document/kubernetes/guide","en/document/59.kubernetes/01.guide/01.index",[2506,2508,2512,2516,2520],{"title":2507,"path":2503,"stem":2504},"Introduction",{"title":2509,"path":2510,"stem":2511},"Environment Setup and Basic Operations","/en/document/kubernetes/guide/setup","en/document/59.kubernetes/01.guide/02.setup",{"title":2513,"path":2514,"stem":2515},"Pod","/en/document/kubernetes/guide/pod","en/document/59.kubernetes/01.guide/03.pod",{"title":2517,"path":2518,"stem":2519},"Deployment","/en/document/kubernetes/guide/deployment","en/document/59.kubernetes/01.guide/04.deployment",{"title":2521,"path":2522,"stem":2523},"Service","/en/document/kubernetes/guide/service","en/document/59.kubernetes/01.guide/05.service",{"title":2525,"path":2526,"stem":2527,"children":2528,"page":49},"Service Configuration and Runtime Management","/en/document/kubernetes/management","en/document/59.kubernetes/02.management",[2529,2533,2537,2541,2545,2549,2553],{"title":2530,"path":2531,"stem":2532},"Gateway API","/en/document/kubernetes/management/gateway-api","en/document/59.kubernetes/02.management/06.gateway-api",{"title":2534,"path":2535,"stem":2536},"ConfigMaps and Secrets","/en/document/kubernetes/management/configmap-secret","en/document/59.kubernetes/02.management/07.configmap-secret",{"title":2538,"path":2539,"stem":2540},"Health Checks","/en/document/kubernetes/management/probes","en/document/59.kubernetes/02.management/08.probes",{"title":2542,"path":2543,"stem":2544},"Resource Requests and Limits","/en/document/kubernetes/management/resources","en/document/59.kubernetes/02.management/09.resources",{"title":2546,"path":2547,"stem":2548},"Rolling Updates and Rollbacks","/en/document/kubernetes/management/rolling-update","en/document/59.kubernetes/02.management/10.rolling-update",{"title":2550,"path":2551,"stem":2552},"Scaling and Autoscaling","/en/document/kubernetes/management/autoscaling","en/document/59.kubernetes/02.management/11.autoscaling",{"title":2554,"path":2555,"stem":2556},"Storage and Persistence","/en/document/kubernetes/management/storage","en/document/59.kubernetes/02.management/12.storage",{"title":2558,"icon":2559,"path":2560,"stem":2561,"children":2562,"page":49},"LLM Fundamentals","i-lucide-brain","/en/document/llm","en/document/60.llm",[2563,2586,2604],{"title":2564,"path":2565,"stem":2566,"children":2567},"Large Language Model Fundamentals","/en/document/llm/guide","en/document/60.llm/01.guide/01.index",[2568,2570,2574,2578,2582],{"title":2569,"path":2565,"stem":2566},"LLM Overview",{"title":2571,"path":2572,"stem":2573},"How LLMs Work","/en/document/llm/guide/how-llms-work","en/document/60.llm/01.guide/02.how-llms-work",{"title":2575,"path":2576,"stem":2577},"Tokens and Context","/en/document/llm/guide/tokens-and-context-window","en/document/60.llm/01.guide/03.tokens-and-context-window",{"title":2579,"path":2580,"stem":2581},"Model Types and Parameters","/en/document/llm/guide/model-types-and-parameters","en/document/60.llm/01.guide/04.model-types-and-parameters",{"title":2583,"path":2584,"stem":2585},"Embeddings and Semantics","/en/document/llm/guide/embeddings","en/document/60.llm/01.guide/05.embeddings",{"title":2587,"path":2588,"stem":2589,"children":2590},"Prompt Engineering","/en/document/llm/prompt-engineering","en/document/60.llm/02.prompt-engineering/01.index",[2591,2592,2596,2600],{"title":2587,"path":2588,"stem":2589},{"title":2593,"path":2594,"stem":2595},"Roles and Instructions","/en/document/llm/prompt-engineering/roles-and-instructions","en/document/60.llm/02.prompt-engineering/02.roles-and-instructions",{"title":2597,"path":2598,"stem":2599},"Few-Shot Examples","/en/document/llm/prompt-engineering/few-shot","en/document/60.llm/02.prompt-engineering/03.few-shot",{"title":2601,"path":2602,"stem":2603},"Structured Output and Task Decomposition","/en/document/llm/prompt-engineering/structured-output-and-complex-tasks","en/document/60.llm/02.prompt-engineering/04.structured-output-and-complex-tasks",{"title":2605,"path":2606,"stem":2607,"children":2608},"Context Engineering and Practice","/en/document/llm/context-engineering","en/document/60.llm/03.context-engineering/01.index",[2609,2611],{"title":2610,"path":2606,"stem":2607},"Context Engineering",{"title":2612,"path":2613,"stem":2614},"Testing and Optimization","/en/document/llm/context-engineering/prompt-testing-and-optimization","en/document/60.llm/03.context-engineering/02.prompt-testing-and-optimization",{"title":2616,"icon":2617,"path":2618,"stem":2619,"children":2620,"page":49},"AI SDK","i-lucide-code-xml","/en/document/ai-sdk","en/document/61.ai-sdk",[2621,2640,2657],{"title":2622,"path":2623,"stem":2624,"children":2625},"Basic API Calls","/en/document/ai-sdk/guide","en/document/61.ai-sdk/01.guide/01.index",[2626,2628,2632,2636],{"title":2627,"path":2623,"stem":2624},"Introduction to AI SDKs",{"title":2629,"path":2630,"stem":2631},"Text Generation and Parameters","/en/document/ai-sdk/guide/text-generation","en/document/61.ai-sdk/01.guide/02.text-generation",{"title":2633,"path":2634,"stem":2635},"Message Management and Multi-Turn Conversations","/en/document/ai-sdk/guide/conversation","en/document/61.ai-sdk/01.guide/03.conversation",{"title":2637,"path":2638,"stem":2639},"Streaming Output","/en/document/ai-sdk/guide/streaming","en/document/61.ai-sdk/01.guide/04.streaming",{"title":2641,"path":2642,"stem":2643,"children":2644,"page":49},"Model Capabilities and Integration","/en/document/ai-sdk/capabilities","en/document/61.ai-sdk/02.capabilities",[2645,2649,2653],{"title":2646,"path":2647,"stem":2648},"Structured Output","/en/document/ai-sdk/capabilities/structured-output","en/document/61.ai-sdk/02.capabilities/05.structured-output",{"title":2650,"path":2651,"stem":2652},"Function Calling","/en/document/ai-sdk/capabilities/function-calling","en/document/61.ai-sdk/02.capabilities/06.function-calling",{"title":2654,"path":2655,"stem":2656},"Multimodal Input","/en/document/ai-sdk/capabilities/multimodal","en/document/61.ai-sdk/02.capabilities/07.multimodal",{"title":2658,"path":2659,"stem":2660,"children":2661,"page":49},"Building Applications","/en/document/ai-sdk/application","en/document/61.ai-sdk/03.application",[2662,2666],{"title":2663,"path":2664,"stem":2665},"AI Service API","/en/document/ai-sdk/application/express-api","en/document/61.ai-sdk/03.application/08.express-api",{"title":2667,"path":2668,"stem":2669},"Persisting Conversation History","/en/document/ai-sdk/application/persistence","en/document/61.ai-sdk/03.application/09.persistence",{"title":2671,"icon":2672,"path":2673,"stem":2674,"children":2675,"page":49},"RAG (Retrieval-Augmented Generation)","i-lucide-book-open-check","/en/document/rag","en/document/62.rag",[2676,2691,2712],{"title":2677,"path":2678,"stem":2679,"children":2680},"RAG Fundamentals and Implementation","/en/document/rag/guide","en/document/62.rag/01.guide/01.index",[2681,2683,2687],{"title":2682,"path":2678,"stem":2679},"RAG Overview",{"title":2684,"path":2685,"stem":2686},"Your First RAG Application","/en/document/rag/guide/first-rag","en/document/62.rag/01.guide/02.first-rag",{"title":2688,"path":2689,"stem":2690},"Loading and Chunking","/en/document/rag/guide/document-chunking","en/document/62.rag/01.guide/03.document-chunking",{"title":2692,"path":2693,"stem":2694,"children":2695,"page":49},"Knowledge Storage and Retrieval","/en/document/rag/knowledge-retrieval","en/document/62.rag/02.knowledge-retrieval",[2696,2700,2704,2708],{"title":2697,"path":2698,"stem":2699},"Vector Databases","/en/document/rag/knowledge-retrieval/vector-database","en/document/62.rag/02.knowledge-retrieval/01.vector-database",{"title":2701,"path":2702,"stem":2703},"Similarity Search","/en/document/rag/knowledge-retrieval/similarity-search","en/document/62.rag/02.knowledge-retrieval/02.similarity-search",{"title":2705,"path":2706,"stem":2707},"Retrieval and Answers","/en/document/rag/knowledge-retrieval/grounded-answer","en/document/62.rag/02.knowledge-retrieval/03.grounded-answer",{"title":2709,"path":2710,"stem":2711},"Conversational RAG","/en/document/rag/knowledge-retrieval/conversational-rag","en/document/62.rag/02.knowledge-retrieval/04.conversational-rag",{"title":2713,"path":2714,"stem":2715,"children":2716,"page":49},"Maintenance and Optimization","/en/document/rag/management-optimization","en/document/62.rag/03.management-optimization",[2717,2721,2725,2729,2733],{"title":2718,"path":2719,"stem":2720},"Knowledge Base Maintenance","/en/document/rag/management-optimization/knowledge-maintenance","en/document/62.rag/03.management-optimization/01.knowledge-maintenance",{"title":2722,"path":2723,"stem":2724},"RAG Evaluation","/en/document/rag/management-optimization/rag-evaluation","en/document/62.rag/03.management-optimization/02.rag-evaluation",{"title":2726,"path":2727,"stem":2728},"Hybrid Retrieval","/en/document/rag/management-optimization/retrieval-optimization","en/document/62.rag/03.management-optimization/03.retrieval-optimization",{"title":2730,"path":2731,"stem":2732},"RRF Rank Fusion","/en/document/rag/management-optimization/retrieval-reranking","en/document/62.rag/03.management-optimization/04.retrieval-reranking",{"title":2734,"path":2735,"stem":2736},"Rerankers","/en/document/rag/management-optimization/reranker","en/document/62.rag/03.management-optimization/05.reranker",{"title":2738,"icon":2739,"path":2740,"stem":2741,"children":2742,"page":49},"MCP","i-lucide-plug","/en/document/mcp","en/document/63.mcp",[2743,2754,2771],{"title":2744,"path":2745,"stem":2746,"children":2747},"MCP Basics","/en/document/mcp/guide","en/document/63.mcp/01.guide/01.index",[2748,2750],{"title":2749,"path":2745,"stem":2746},"MCP Overview",{"title":2751,"path":2752,"stem":2753},"Your First MCP Server","/en/document/mcp/guide/first-server","en/document/63.mcp/01.guide/02.first-server",{"title":2755,"path":2756,"stem":2757,"children":2758,"page":49},"MCP Server Development","/en/document/mcp/server","en/document/63.mcp/02.server",[2759,2763,2767],{"title":2760,"path":2761,"stem":2762},"Tools","/en/document/mcp/server/tools","en/document/63.mcp/02.server/01.tools",{"title":2764,"path":2765,"stem":2766},"Resources","/en/document/mcp/server/resources","en/document/63.mcp/02.server/02.resources",{"title":2768,"path":2769,"stem":2770},"Prompts","/en/document/mcp/server/prompts","en/document/63.mcp/02.server/03.prompts",{"title":2772,"path":2773,"stem":2774,"children":2775,"page":49},"MCP Application Integration","/en/document/mcp/integration","en/document/63.mcp/03.integration",[2776,2780],{"title":2777,"path":2778,"stem":2779},"AI Application Integration","/en/document/mcp/integration/ai-integration","en/document/63.mcp/03.integration/03.ai-integration",{"title":1965,"path":2781,"stem":2782},"/en/document/mcp/integration/auth-deployment","en/document/63.mcp/03.integration/04.auth-deployment",{"title":2784,"icon":2785,"path":2786,"stem":2787,"children":2788,"page":49},"LangChain","i-lucide-bot","/en/document/ai-agent","en/document/64.ai-agent",[2789,2800,2815],{"title":2790,"path":2791,"stem":2792,"children":2793},"Agent Basics","/en/document/ai-agent/guide","en/document/64.ai-agent/01.guide/01.index",[2794,2796],{"title":2795,"path":2791,"stem":2792},"AI Agent Overview",{"title":2797,"path":2798,"stem":2799},"Agent Loop","/en/document/ai-agent/guide/agent-loop","en/document/64.ai-agent/01.guide/02.agent-loop",{"title":2801,"path":2802,"stem":2803,"children":2804},"Agent Development","/en/document/ai-agent/langchain","en/document/64.ai-agent/02.langchain/01.index",[2805,2807,2811],{"title":2806,"path":2802,"stem":2803},"Your First LangChain Agent",{"title":2808,"path":2809,"stem":2810},"RAG and MCP Integration","/en/document/ai-agent/langchain/rag-mcp","en/document/64.ai-agent/02.langchain/02.rag-mcp",{"title":2812,"path":2813,"stem":2814},"Streaming","/en/document/ai-agent/langchain/streaming","en/document/64.ai-agent/02.langchain/03.streaming",{"title":2816,"path":2817,"stem":2818,"children":2819},"Advanced Agents","/en/document/ai-agent/advanced","en/document/64.ai-agent/03.advanced/01.index",[2820,2822,2826],{"title":2821,"path":2817,"stem":2818},"Short-Term Memory",{"title":2823,"path":2824,"stem":2825},"Long-Term Memory","/en/document/ai-agent/advanced/long-term-memory","en/document/64.ai-agent/03.advanced/02.long-term-memory",{"title":2827,"path":2828,"stem":2829},"Middleware and Execution Controls","/en/document/ai-agent/advanced/middleware","en/document/64.ai-agent/03.advanced/03.middleware",{"title":2831,"icon":2832,"path":2833,"stem":2834,"children":2835,"page":49},"LangGraph","i-lucide-workflow","/en/document/langgraph","en/document/65.langgraph",[2836,2850,2865],{"title":2837,"path":2838,"stem":2839,"children":2840,"icon":1920},"LangGraph Basics","/en/document/langgraph/guide","en/document/65.langgraph/01.guide/01.index",[2841,2843,2847],{"title":2842,"path":2838,"stem":2839},"LangGraph Overview",{"title":2844,"path":2845,"stem":2846},"Your First Workflow","/en/document/langgraph/guide/first-workflow","en/document/65.langgraph/01.guide/02.first-workflow",{"title":725,"path":2848,"stem":2849},"/en/document/langgraph/guide/state","en/document/65.langgraph/01.guide/03.state",{"title":2851,"path":2852,"stem":2853,"children":2854,"icon":2832},"Workflow Orchestration","/en/document/langgraph/workflow","en/document/65.langgraph/02.workflow/01.index",[2855,2857,2861],{"title":2856,"path":2852,"stem":2853},"Conditional Branches and Loops",{"title":2858,"path":2859,"stem":2860},"Parallel Execution","/en/document/langgraph/workflow/parallel","en/document/65.langgraph/02.workflow/02.parallel",{"title":2862,"path":2863,"stem":2864},"Subgraphs and Workflow Reuse","/en/document/langgraph/workflow/subgraphs","en/document/65.langgraph/02.workflow/03.subgraphs",{"title":2866,"path":2867,"stem":2868,"children":2869,"icon":1602},"Advanced LangGraph","/en/document/langgraph/advanced","en/document/65.langgraph/03.advanced/01.index",[2870,2872,2876],{"title":2871,"path":2867,"stem":2868},"State Persistence",{"title":2873,"path":2874,"stem":2875},"Interrupts and Resuming","/en/document/langgraph/advanced/interrupts","en/document/65.langgraph/03.advanced/02.interrupts",{"title":2877,"path":2878,"stem":2879},"Custom Agents","/en/document/langgraph/advanced/custom-agent","en/document/65.langgraph/03.advanced/03.custom-agent",{"id":2881,"title":2827,"body":2882,"description":7129,"extension":7130,"links":7131,"meta":7132,"navigation":7133,"path":2828,"seo":7134,"stem":2829,"__hash__":7136},"englishPages/en/document/64.ai-agent/03.advanced/03.middleware.md",{"type":2883,"value":2884,"toc":7110},"minimal",[2885,2890,2894,2897,2901,2904,2907,2919,2922,2925,3006,3009,3011,3015,3026,3361,3373,3376,3580,3583,3602,3605,3613,3616,3619,3621,3625,3628,3634,3687,3694,3826,3836,3850,3855,3867,4083,4085,4097,4100,4106,4110,4124,4136,4139,4145,4152,4155,4157,4161,4164,4171,4536,4539,4542,4806,4808,4822,4825,4831,4841,4848,4850,4854,4857,4864,4871,5049,5059,5062,5360,5362,5376,5379,5385,5388,5398,5400,5404,5407,5414,5418,5424,5714,5720,5887,5893,5897,5899,6330,6332,6346,6349,6355,6365,6369,6372,6375,6402,6405,6690,6696,6702,6713,6717,6724,6735,6737,6792,6800,6807,6870,6876,6910,6917,6920,7021,7024,7036,7041,7047,7053,7059,7065,7068,7070,7074,7079,7082,7084,7088,7101,7103,7106],[2886,2887,2889],"h2",{"id":2888},"introduction","🎯 Introduction",[2891,2892,2893],"p",{},"Agents can select tools autonomously, but the application still needs to control repeated queries, API failures, growing history, and sensitive operations. This article uses LangChain middleware to add logging, retries, call limits, summarization, and human approval, keeping developers in control of execution instead of delegating every business decision to the model.",[2895,2896],"hr",{},[2886,2898,2900],{"id":2899},"what-is-middleware","🧱 What Is Middleware?",[2891,2902,2903],{},"Express middleware can log requests, validate inputs, and check permissions before a request reaches a business handler. Agent middleware follows a similar idea, intervening at different points during agent execution.",[2891,2905,2906],{},"For example, an agent may call the model repeatedly, and we may want to log each request without changing every tool function. We may also want a shared, bounded retry policy for transient tool failures.",[2891,2908,2909,2910,2914,2915,2918],{},"Middleware provides two kinds of hooks: ",[2911,2912,2913],"strong",{},"lifecycle hooks"," run logic at specific stages, while ",[2911,2916,2917],{},"wrap hooks"," wrap model or tool calls and can decide whether to execute or retry them.",[2891,2920,2921],{},"The diagram below shows where both kinds of hooks intervene in the agent loop:",[2923,2924],"ai-agent-middleware-flow",{},[2926,2927,2928,2941],"table",{},[2929,2930,2931],"thead",{},[2932,2933,2934,2938],"tr",{},[2935,2936,2937],"th",{},"Hook",[2935,2939,2940],{},"When it runs",[2942,2943,2944,2956,2966,2976,2986,2996],"tbody",{},[2932,2945,2946,2953],{},[2947,2948,2949],"td",{},[2950,2951,2952],"code",{},"beforeAgent",[2947,2954,2955],{},"Before the current agent run starts",[2932,2957,2958,2963],{},[2947,2959,2960],{},[2950,2961,2962],{},"beforeModel",[2947,2964,2965],{},"Before each model request",[2932,2967,2968,2973],{},[2947,2969,2970],{},[2950,2971,2972],{},"afterModel",[2947,2974,2975],{},"After each model response",[2932,2977,2978,2983],{},[2947,2979,2980],{},[2950,2981,2982],{},"afterAgent",[2947,2984,2985],{},"When the agent run ends normally",[2932,2987,2988,2993],{},[2947,2989,2990],{},[2950,2991,2992],{},"wrapModelCall",[2947,2994,2995],{},"Wraps model requests to control call behavior",[2932,2997,2998,3003],{},[2947,2999,3000],{},[2950,3001,3002],{},"wrapToolCall",[2947,3004,3005],{},"Wraps tool execution to handle errors or restrict execution",[2891,3007,3008],{},"We will first use custom logging to understand hooks, then solve specific problems with built-in middleware. No underlying StateGraph implementation is needed.",[2895,3010],{},[2886,3012,3014],{"id":3013},"log-execution-with-hooks","🛠 Log Execution with Hooks",[2891,3016,3017,3018,3021,3022,3025],{},"Continue in ",[2950,3019,3020],{},"agent-demo"," and create ",[2950,3023,3024],{},"03.control.mjs",":",[3027,3028,3033],"pre",{"className":3029,"code":3030,"language":3031,"meta":3032,"style":3032},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createAgent, createMiddleware } from 'langchain';\nimport { shopOptions } from './agent.mjs';\n\nconst logger = createMiddleware({\n    name: 'AgentLogger',\n\n    // Log the message count before each model call\n    beforeModel: state => {\n        console.log('Calling model. Current message count:', state.messages.length);\n    },\n\n    // Log the requested tool count after each model response\n    afterModel: state => {\n        const message = state.messages.at(-1);\n        const toolCount = message?.tool_calls?.length ?? 0;\n\n        console.log('Model responded. Tool request count:', toolCount);\n    },\n});\n","js","",[2950,3034,3035,3077,3100,3107,3129,3148,3153,3160,3178,3218,3224,3229,3235,3249,3285,3315,3320,3346,3351],{"__ignoreMap":3032},[3036,3037,3040,3044,3048,3052,3055,3058,3061,3064,3067,3071,3074],"span",{"class":3038,"line":3039},"line",1,[3036,3041,3043],{"class":3042},"s8pZq","import",[3036,3045,3047],{"class":3046},"s86vT"," {",[3036,3049,3051],{"class":3050},"sndM8"," createAgent",[3036,3053,3054],{"class":3046},",",[3036,3056,3057],{"class":3050}," createMiddleware",[3036,3059,3060],{"class":3046}," }",[3036,3062,3063],{"class":3042}," from",[3036,3065,3066],{"class":3046}," '",[3036,3068,3070],{"class":3069},"sIEYB","langchain",[3036,3072,3073],{"class":3046},"'",[3036,3075,3076],{"class":3046},";\n",[3036,3078,3080,3082,3084,3087,3089,3091,3093,3096,3098],{"class":3038,"line":3079},2,[3036,3081,3043],{"class":3042},[3036,3083,3047],{"class":3046},[3036,3085,3086],{"class":3050}," shopOptions",[3036,3088,3060],{"class":3046},[3036,3090,3063],{"class":3042},[3036,3092,3066],{"class":3046},[3036,3094,3095],{"class":3069},"./agent.mjs",[3036,3097,3073],{"class":3046},[3036,3099,3076],{"class":3046},[3036,3101,3103],{"class":3038,"line":3102},3,[3036,3104,3106],{"emptyLinePlaceholder":3105},true,"\n",[3036,3108,3110,3114,3117,3120,3123,3126],{"class":3038,"line":3109},4,[3036,3111,3113],{"class":3112},"s50WR","const",[3036,3115,3116],{"class":3050}," logger ",[3036,3118,3119],{"class":3046},"=",[3036,3121,3057],{"class":3122},"swgpB",[3036,3124,3125],{"class":3050},"(",[3036,3127,3128],{"class":3046},"{\n",[3036,3130,3132,3136,3138,3140,3143,3145],{"class":3038,"line":3131},5,[3036,3133,3135],{"class":3134},"sd2Uz","    name",[3036,3137,3025],{"class":3046},[3036,3139,3066],{"class":3046},[3036,3141,3142],{"class":3069},"AgentLogger",[3036,3144,3073],{"class":3046},[3036,3146,3147],{"class":3046},",\n",[3036,3149,3151],{"class":3038,"line":3150},6,[3036,3152,3106],{"emptyLinePlaceholder":3105},[3036,3154,3156],{"class":3038,"line":3155},7,[3036,3157,3159],{"class":3158},"syuKq","    // Log the message count before each model call\n",[3036,3161,3163,3166,3168,3172,3175],{"class":3038,"line":3162},8,[3036,3164,3165],{"class":3122},"    beforeModel",[3036,3167,3025],{"class":3046},[3036,3169,3171],{"class":3170},"sK9QF"," state",[3036,3173,3174],{"class":3112}," =>",[3036,3176,3177],{"class":3046}," {\n",[3036,3179,3181,3184,3187,3190,3192,3194,3197,3199,3201,3203,3205,3208,3210,3213,3216],{"class":3038,"line":3180},9,[3036,3182,3183],{"class":3050},"        console",[3036,3185,3186],{"class":3046},".",[3036,3188,3189],{"class":3122},"log",[3036,3191,3125],{"class":3134},[3036,3193,3073],{"class":3046},[3036,3195,3196],{"class":3069},"Calling model. Current message count:",[3036,3198,3073],{"class":3046},[3036,3200,3054],{"class":3046},[3036,3202,3171],{"class":3050},[3036,3204,3186],{"class":3046},[3036,3206,3207],{"class":3050},"messages",[3036,3209,3186],{"class":3046},[3036,3211,3212],{"class":3050},"length",[3036,3214,3215],{"class":3134},")",[3036,3217,3076],{"class":3046},[3036,3219,3221],{"class":3038,"line":3220},10,[3036,3222,3223],{"class":3046},"    },\n",[3036,3225,3227],{"class":3038,"line":3226},11,[3036,3228,3106],{"emptyLinePlaceholder":3105},[3036,3230,3232],{"class":3038,"line":3231},12,[3036,3233,3234],{"class":3158},"    // Log the requested tool count after each model response\n",[3036,3236,3238,3241,3243,3245,3247],{"class":3038,"line":3237},13,[3036,3239,3240],{"class":3122},"    afterModel",[3036,3242,3025],{"class":3046},[3036,3244,3171],{"class":3170},[3036,3246,3174],{"class":3112},[3036,3248,3177],{"class":3046},[3036,3250,3252,3255,3258,3261,3263,3265,3267,3269,3272,3274,3277,3281,3283],{"class":3038,"line":3251},14,[3036,3253,3254],{"class":3112},"        const",[3036,3256,3257],{"class":3050}," message",[3036,3259,3260],{"class":3046}," =",[3036,3262,3171],{"class":3050},[3036,3264,3186],{"class":3046},[3036,3266,3207],{"class":3050},[3036,3268,3186],{"class":3046},[3036,3270,3271],{"class":3122},"at",[3036,3273,3125],{"class":3134},[3036,3275,3276],{"class":3046},"-",[3036,3278,3280],{"class":3279},"smPcV","1",[3036,3282,3215],{"class":3134},[3036,3284,3076],{"class":3046},[3036,3286,3288,3290,3293,3295,3297,3300,3303,3305,3307,3310,3313],{"class":3038,"line":3287},15,[3036,3289,3254],{"class":3112},[3036,3291,3292],{"class":3050}," toolCount",[3036,3294,3260],{"class":3046},[3036,3296,3257],{"class":3050},[3036,3298,3299],{"class":3046},"?.",[3036,3301,3302],{"class":3050},"tool_calls",[3036,3304,3299],{"class":3046},[3036,3306,3212],{"class":3050},[3036,3308,3309],{"class":3046}," ??",[3036,3311,3312],{"class":3279}," 0",[3036,3314,3076],{"class":3046},[3036,3316,3318],{"class":3038,"line":3317},16,[3036,3319,3106],{"emptyLinePlaceholder":3105},[3036,3321,3323,3325,3327,3329,3331,3333,3336,3338,3340,3342,3344],{"class":3038,"line":3322},17,[3036,3324,3183],{"class":3050},[3036,3326,3186],{"class":3046},[3036,3328,3189],{"class":3122},[3036,3330,3125],{"class":3134},[3036,3332,3073],{"class":3046},[3036,3334,3335],{"class":3069},"Model responded. Tool request count:",[3036,3337,3073],{"class":3046},[3036,3339,3054],{"class":3046},[3036,3341,3292],{"class":3050},[3036,3343,3215],{"class":3134},[3036,3345,3076],{"class":3046},[3036,3347,3349],{"class":3038,"line":3348},18,[3036,3350,3223],{"class":3046},[3036,3352,3354,3357,3359],{"class":3038,"line":3353},19,[3036,3355,3356],{"class":3046},"}",[3036,3358,3215],{"class":3050},[3036,3360,3076],{"class":3046},[2891,3362,3363,3366,3367,3369,3370,3372],{},[2950,3364,3365],{},"createMiddleware()"," creates a middleware object. ",[2950,3368,2962],{}," and ",[2950,3371,2972],{}," receive the current agent state. This example reads message and tool call counts without changing results, letting us observe individual model calls rather than only the task’s start and end.",[2891,3374,3375],{},"Append to the file:",[3027,3377,3379],{"className":3029,"code":3378,"language":3031,"meta":3032,"style":3032},"const agent = createAgent({\n    ...shopOptions,\n    middleware: [logger],\n});\n\nconst result = await agent.invoke(\n    {\n        messages: [{ role: 'user', content: 'How many mechanical keyboards are in stock?' }],\n    },\n    { recursionLimit: 20 }\n);\n\nconsole.log('Final answer:', result.messages.at(-1)?.content);\n",[2950,3380,3381,3396,3406,3418,3426,3430,3453,3458,3504,3508,3524,3530,3534],{"__ignoreMap":3032},[3036,3382,3383,3385,3388,3390,3392,3394],{"class":3038,"line":3039},[3036,3384,3113],{"class":3112},[3036,3386,3387],{"class":3050}," agent ",[3036,3389,3119],{"class":3046},[3036,3391,3051],{"class":3122},[3036,3393,3125],{"class":3050},[3036,3395,3128],{"class":3046},[3036,3397,3398,3401,3404],{"class":3038,"line":3079},[3036,3399,3400],{"class":3046},"    ...",[3036,3402,3403],{"class":3050},"shopOptions",[3036,3405,3147],{"class":3046},[3036,3407,3408,3411,3413,3416],{"class":3038,"line":3102},[3036,3409,3410],{"class":3134},"    middleware",[3036,3412,3025],{"class":3046},[3036,3414,3415],{"class":3050}," [logger]",[3036,3417,3147],{"class":3046},[3036,3419,3420,3422,3424],{"class":3038,"line":3109},[3036,3421,3356],{"class":3046},[3036,3423,3215],{"class":3050},[3036,3425,3076],{"class":3046},[3036,3427,3428],{"class":3038,"line":3131},[3036,3429,3106],{"emptyLinePlaceholder":3105},[3036,3431,3432,3434,3437,3439,3442,3445,3447,3450],{"class":3038,"line":3150},[3036,3433,3113],{"class":3112},[3036,3435,3436],{"class":3050}," result ",[3036,3438,3119],{"class":3046},[3036,3440,3441],{"class":3042}," await",[3036,3443,3444],{"class":3050}," agent",[3036,3446,3186],{"class":3046},[3036,3448,3449],{"class":3122},"invoke",[3036,3451,3452],{"class":3050},"(\n",[3036,3454,3455],{"class":3038,"line":3155},[3036,3456,3457],{"class":3046},"    {\n",[3036,3459,3460,3463,3465,3468,3471,3474,3476,3478,3481,3483,3485,3488,3490,3492,3495,3497,3499,3502],{"class":3038,"line":3162},[3036,3461,3462],{"class":3134},"        messages",[3036,3464,3025],{"class":3046},[3036,3466,3467],{"class":3050}," [",[3036,3469,3470],{"class":3046},"{",[3036,3472,3473],{"class":3134}," role",[3036,3475,3025],{"class":3046},[3036,3477,3066],{"class":3046},[3036,3479,3480],{"class":3069},"user",[3036,3482,3073],{"class":3046},[3036,3484,3054],{"class":3046},[3036,3486,3487],{"class":3134}," content",[3036,3489,3025],{"class":3046},[3036,3491,3066],{"class":3046},[3036,3493,3494],{"class":3069},"How many mechanical keyboards are in stock?",[3036,3496,3073],{"class":3046},[3036,3498,3060],{"class":3046},[3036,3500,3501],{"class":3050},"]",[3036,3503,3147],{"class":3046},[3036,3505,3506],{"class":3038,"line":3180},[3036,3507,3223],{"class":3046},[3036,3509,3510,3513,3516,3518,3521],{"class":3038,"line":3220},[3036,3511,3512],{"class":3046},"    {",[3036,3514,3515],{"class":3134}," recursionLimit",[3036,3517,3025],{"class":3046},[3036,3519,3520],{"class":3279}," 20",[3036,3522,3523],{"class":3046}," }\n",[3036,3525,3526,3528],{"class":3038,"line":3226},[3036,3527,3215],{"class":3050},[3036,3529,3076],{"class":3046},[3036,3531,3532],{"class":3038,"line":3231},[3036,3533,3106],{"emptyLinePlaceholder":3105},[3036,3535,3536,3539,3541,3543,3545,3547,3550,3552,3554,3557,3559,3561,3563,3565,3567,3569,3571,3573,3575,3578],{"class":3038,"line":3237},[3036,3537,3538],{"class":3050},"console",[3036,3540,3186],{"class":3046},[3036,3542,3189],{"class":3122},[3036,3544,3125],{"class":3050},[3036,3546,3073],{"class":3046},[3036,3548,3549],{"class":3069},"Final answer:",[3036,3551,3073],{"class":3046},[3036,3553,3054],{"class":3046},[3036,3555,3556],{"class":3050}," result",[3036,3558,3186],{"class":3046},[3036,3560,3207],{"class":3050},[3036,3562,3186],{"class":3046},[3036,3564,3271],{"class":3122},[3036,3566,3125],{"class":3050},[3036,3568,3276],{"class":3046},[3036,3570,3280],{"class":3279},[3036,3572,3215],{"class":3050},[3036,3574,3299],{"class":3046},[3036,3576,3577],{"class":3050},"content)",[3036,3579,3076],{"class":3046},[2891,3581,3582],{},"Run:",[3027,3584,3588],{"className":3585,"code":3586,"language":3587,"meta":3032,"style":3032},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","node --env-file=.env 03.control.mjs\n","bash",[2950,3589,3590],{"__ignoreMap":3032},[3036,3591,3592,3596,3599],{"class":3038,"line":3039},[3036,3593,3595],{"class":3594},"sYGMc","node",[3036,3597,3598],{"class":3069}," --env-file=.env",[3036,3600,3601],{"class":3069}," 03.control.mjs\n",[2891,3603,3604],{},"If the model looks up the product ID before checking stock, you will usually see three model requests. Example logs follow (actual message counts depend on runtime state):",[3027,3606,3611],{"className":3607,"code":3609,"language":3610,"meta":3032},[3608],"language-text","Calling model. Current message count: 1\nModel responded. Tool request count: 1\nCalling model. Current message count: 3\nModel responded. Tool request count: 1\nCalling model. Current message count: 5\nModel responded. Tool request count: 0\nFinal answer: There are 12 mechanical keyboards in stock.\n","text",[2950,3612,3609],{"__ignoreMap":3032},[2891,3614,3615],{},"Model hooks run for each model call, rather than just once for the whole agent run.",[2891,3617,3618],{},"Production logging should not print complete user messages, tokens, or business data by default. This example logs only counts to keep sensitive information out of logs.",[2895,3620],{},[2886,3622,3624],{"id":3623},"limit-model-and-tool-calls","🧱 Limit Model and Tool Calls",[2891,3626,3627],{},"Unclear requests or repeated searches for nonexistent products can cause many unproductive queries. Set a per-task call budget to limit latency and model costs.",[2891,3629,3630,3631,3633],{},"Expand the LangChain import in ",[2950,3632,3024],{}," to:",[3027,3635,3637],{"className":3029,"code":3636,"language":3031,"meta":3032,"style":3032},"import {\n    createAgent,\n    createMiddleware,\n    modelCallLimitMiddleware,\n    toolCallLimitMiddleware,\n} from 'langchain';\n",[2950,3638,3639,3645,3652,3659,3666,3673],{"__ignoreMap":3032},[3036,3640,3641,3643],{"class":3038,"line":3039},[3036,3642,3043],{"class":3042},[3036,3644,3177],{"class":3046},[3036,3646,3647,3650],{"class":3038,"line":3079},[3036,3648,3649],{"class":3050},"    createAgent",[3036,3651,3147],{"class":3046},[3036,3653,3654,3657],{"class":3038,"line":3102},[3036,3655,3656],{"class":3050},"    createMiddleware",[3036,3658,3147],{"class":3046},[3036,3660,3661,3664],{"class":3038,"line":3109},[3036,3662,3663],{"class":3050},"    modelCallLimitMiddleware",[3036,3665,3147],{"class":3046},[3036,3667,3668,3671],{"class":3038,"line":3131},[3036,3669,3670],{"class":3050},"    toolCallLimitMiddleware",[3036,3672,3147],{"class":3046},[3036,3674,3675,3677,3679,3681,3683,3685],{"class":3038,"line":3150},[3036,3676,3356],{"class":3046},[3036,3678,3063],{"class":3042},[3036,3680,3066],{"class":3046},[3036,3682,3070],{"class":3069},[3036,3684,3073],{"class":3046},[3036,3686,3076],{"class":3046},[2891,3688,3689,3690,3693],{},"Replace ",[2950,3691,3692],{},"middleware: [logger]"," with:",[3027,3695,3697],{"className":3029,"code":3696,"language":3031,"meta":3032,"style":3032},"middleware: [\n    logger,\n\n    // Allow at most 5 model calls per task\n    modelCallLimitMiddleware({\n        runLimit: 5,\n        exitBehavior: 'error',\n    }),\n\n    // Allow at most 3 tool calls per task\n    toolCallLimitMiddleware({\n        runLimit: 3,\n        exitBehavior: 'error',\n    }),\n],\n",[2950,3698,3699,3709,3716,3720,3725,3733,3745,3761,3770,3774,3779,3787,3798,3812,3820],{"__ignoreMap":3032},[3036,3700,3701,3704,3706],{"class":3038,"line":3039},[3036,3702,3703],{"class":3594},"middleware",[3036,3705,3025],{"class":3046},[3036,3707,3708],{"class":3050}," [\n",[3036,3710,3711,3714],{"class":3038,"line":3079},[3036,3712,3713],{"class":3050},"    logger",[3036,3715,3147],{"class":3046},[3036,3717,3718],{"class":3038,"line":3102},[3036,3719,3106],{"emptyLinePlaceholder":3105},[3036,3721,3722],{"class":3038,"line":3109},[3036,3723,3724],{"class":3158},"    // Allow at most 5 model calls per task\n",[3036,3726,3727,3729,3731],{"class":3038,"line":3131},[3036,3728,3663],{"class":3122},[3036,3730,3125],{"class":3050},[3036,3732,3128],{"class":3046},[3036,3734,3735,3738,3740,3743],{"class":3038,"line":3150},[3036,3736,3737],{"class":3134},"        runLimit",[3036,3739,3025],{"class":3046},[3036,3741,3742],{"class":3279}," 5",[3036,3744,3147],{"class":3046},[3036,3746,3747,3750,3752,3754,3757,3759],{"class":3038,"line":3155},[3036,3748,3749],{"class":3134},"        exitBehavior",[3036,3751,3025],{"class":3046},[3036,3753,3066],{"class":3046},[3036,3755,3756],{"class":3069},"error",[3036,3758,3073],{"class":3046},[3036,3760,3147],{"class":3046},[3036,3762,3763,3766,3768],{"class":3038,"line":3162},[3036,3764,3765],{"class":3046},"    }",[3036,3767,3215],{"class":3050},[3036,3769,3147],{"class":3046},[3036,3771,3772],{"class":3038,"line":3180},[3036,3773,3106],{"emptyLinePlaceholder":3105},[3036,3775,3776],{"class":3038,"line":3220},[3036,3777,3778],{"class":3158},"    // Allow at most 3 tool calls per task\n",[3036,3780,3781,3783,3785],{"class":3038,"line":3226},[3036,3782,3670],{"class":3122},[3036,3784,3125],{"class":3050},[3036,3786,3128],{"class":3046},[3036,3788,3789,3791,3793,3796],{"class":3038,"line":3231},[3036,3790,3737],{"class":3134},[3036,3792,3025],{"class":3046},[3036,3794,3795],{"class":3279}," 3",[3036,3797,3147],{"class":3046},[3036,3799,3800,3802,3804,3806,3808,3810],{"class":3038,"line":3237},[3036,3801,3749],{"class":3134},[3036,3803,3025],{"class":3046},[3036,3805,3066],{"class":3046},[3036,3807,3756],{"class":3069},[3036,3809,3073],{"class":3046},[3036,3811,3147],{"class":3046},[3036,3813,3814,3816,3818],{"class":3038,"line":3251},[3036,3815,3765],{"class":3046},[3036,3817,3215],{"class":3050},[3036,3819,3147],{"class":3046},[3036,3821,3822,3824],{"class":3038,"line":3287},[3036,3823,3501],{"class":3050},[3036,3825,3147],{"class":3046},[2891,3827,3828,3831,3832,3835],{},[2950,3829,3830],{},"modelCallLimitMiddleware"," limits model calls, and ",[2950,3833,3834],{},"toolCallLimitMiddleware"," limits tool calls. Because one model response can request several tools, configure these limits separately.",[2891,3837,3838,3841,3842,3845,3846,3849],{},[2950,3839,3840],{},"runLimit"," applies to one run. ",[2950,3843,3844],{},"exitBehavior: 'error'"," throws when the limit is exceeded, so the application must not treat the task as successful. Keep ",[2950,3847,3848],{},"recursionLimit"," as well: it limits underlying execution steps, separately from these business call budgets.",[3851,3852,3854],"h3",{"id":3853},"test-the-model-call-limit","Test the Model Call Limit",[2891,3856,3857,3858,3860,3861,3863,3864,3866],{},"Temporarily set ",[2950,3859,3830],{},"’s ",[2950,3862,3840],{}," to ",[2950,3865,3280],{},". To clearly observe a limit failure, replace the agent invocation and output at the end of the file with:",[3027,3868,3870],{"className":3029,"code":3869,"language":3031,"meta":3032,"style":3032},"try {\n    const result = await agent.invoke(\n        {\n            messages: [{ role: 'user', content: 'First find the product ID for mechanical keyboard, then check its stock.' }],\n        },\n        { recursionLimit: 20 }\n    );\n\n    console.log('Final answer:', result.messages.at(-1)?.content);\n} catch (error) {\n    console.error('Task failed:', error.message);\n    process.exitCode = 1;\n}\n",[2950,3871,3872,3879,3898,3903,3943,3948,3961,3968,3972,4018,4030,4061,4078],{"__ignoreMap":3032},[3036,3873,3874,3877],{"class":3038,"line":3039},[3036,3875,3876],{"class":3042},"try",[3036,3878,3177],{"class":3046},[3036,3880,3881,3884,3886,3888,3890,3892,3894,3896],{"class":3038,"line":3079},[3036,3882,3883],{"class":3112},"    const",[3036,3885,3556],{"class":3050},[3036,3887,3260],{"class":3046},[3036,3889,3441],{"class":3042},[3036,3891,3444],{"class":3050},[3036,3893,3186],{"class":3046},[3036,3895,3449],{"class":3122},[3036,3897,3452],{"class":3134},[3036,3899,3900],{"class":3038,"line":3102},[3036,3901,3902],{"class":3046},"        {\n",[3036,3904,3905,3908,3910,3912,3914,3916,3918,3920,3922,3924,3926,3928,3930,3932,3935,3937,3939,3941],{"class":3038,"line":3109},[3036,3906,3907],{"class":3134},"            messages",[3036,3909,3025],{"class":3046},[3036,3911,3467],{"class":3134},[3036,3913,3470],{"class":3046},[3036,3915,3473],{"class":3134},[3036,3917,3025],{"class":3046},[3036,3919,3066],{"class":3046},[3036,3921,3480],{"class":3069},[3036,3923,3073],{"class":3046},[3036,3925,3054],{"class":3046},[3036,3927,3487],{"class":3134},[3036,3929,3025],{"class":3046},[3036,3931,3066],{"class":3046},[3036,3933,3934],{"class":3069},"First find the product ID for mechanical keyboard, then check its stock.",[3036,3936,3073],{"class":3046},[3036,3938,3060],{"class":3046},[3036,3940,3501],{"class":3134},[3036,3942,3147],{"class":3046},[3036,3944,3945],{"class":3038,"line":3131},[3036,3946,3947],{"class":3046},"        },\n",[3036,3949,3950,3953,3955,3957,3959],{"class":3038,"line":3150},[3036,3951,3952],{"class":3046},"        {",[3036,3954,3515],{"class":3134},[3036,3956,3025],{"class":3046},[3036,3958,3520],{"class":3279},[3036,3960,3523],{"class":3046},[3036,3962,3963,3966],{"class":3038,"line":3155},[3036,3964,3965],{"class":3134},"    )",[3036,3967,3076],{"class":3046},[3036,3969,3970],{"class":3038,"line":3162},[3036,3971,3106],{"emptyLinePlaceholder":3105},[3036,3973,3974,3977,3979,3981,3983,3985,3987,3989,3991,3993,3995,3997,3999,4001,4003,4005,4007,4009,4011,4014,4016],{"class":3038,"line":3180},[3036,3975,3976],{"class":3050},"    console",[3036,3978,3186],{"class":3046},[3036,3980,3189],{"class":3122},[3036,3982,3125],{"class":3134},[3036,3984,3073],{"class":3046},[3036,3986,3549],{"class":3069},[3036,3988,3073],{"class":3046},[3036,3990,3054],{"class":3046},[3036,3992,3556],{"class":3050},[3036,3994,3186],{"class":3046},[3036,3996,3207],{"class":3050},[3036,3998,3186],{"class":3046},[3036,4000,3271],{"class":3122},[3036,4002,3125],{"class":3134},[3036,4004,3276],{"class":3046},[3036,4006,3280],{"class":3279},[3036,4008,3215],{"class":3134},[3036,4010,3299],{"class":3046},[3036,4012,4013],{"class":3050},"content",[3036,4015,3215],{"class":3134},[3036,4017,3076],{"class":3046},[3036,4019,4020,4022,4025,4028],{"class":3038,"line":3220},[3036,4021,3356],{"class":3046},[3036,4023,4024],{"class":3042}," catch",[3036,4026,4027],{"class":3050}," (error) ",[3036,4029,3128],{"class":3046},[3036,4031,4032,4034,4036,4038,4040,4042,4045,4047,4049,4052,4054,4057,4059],{"class":3038,"line":3226},[3036,4033,3976],{"class":3050},[3036,4035,3186],{"class":3046},[3036,4037,3756],{"class":3122},[3036,4039,3125],{"class":3134},[3036,4041,3073],{"class":3046},[3036,4043,4044],{"class":3069},"Task failed:",[3036,4046,3073],{"class":3046},[3036,4048,3054],{"class":3046},[3036,4050,4051],{"class":3050}," error",[3036,4053,3186],{"class":3046},[3036,4055,4056],{"class":3050},"message",[3036,4058,3215],{"class":3134},[3036,4060,3076],{"class":3046},[3036,4062,4063,4066,4068,4071,4073,4076],{"class":3038,"line":3231},[3036,4064,4065],{"class":3050},"    process",[3036,4067,3186],{"class":3046},[3036,4069,4070],{"class":3050},"exitCode",[3036,4072,3260],{"class":3046},[3036,4074,4075],{"class":3279}," 1",[3036,4077,3076],{"class":3046},[3036,4079,4080],{"class":3038,"line":3237},[3036,4081,4082],{"class":3046},"}\n",[2891,4084,3582],{},[3027,4086,4087],{"className":3585,"code":3586,"language":3587,"meta":3032,"style":3032},[2950,4088,4089],{"__ignoreMap":3032},[3036,4090,4091,4093,4095],{"class":3038,"line":3039},[3036,4092,3595],{"class":3594},[3036,4094,3598],{"class":3069},[3036,4096,3601],{"class":3069},[2891,4098,4099],{},"If the model requests product search first, another model call is needed after the search. The call budget is already exhausted, so the task ends with an error. Key output may look like this (error wording depends on the installed version):",[3027,4101,4104],{"className":4102,"code":4103,"language":3610,"meta":3032},[3608],"Calling model. Current message count: 1\nModel responded. Tool request count: 1\nTask failed: Model call limit exceeded ...\n",[2950,4105,4103],{"__ignoreMap":3032},[3851,4107,4109],{"id":4108},"test-the-tool-call-limit","Test the Tool Call Limit",[2891,4111,4112,4113,4116,4117,3860,4119,3863,4121,4123],{},"Restore the model call limit to ",[2950,4114,4115],{},"5",", then set ",[2950,4118,3834],{},[2950,4120,3840],{},[2950,4122,3280],{},". Keep the same question and run again:",[3027,4125,4126],{"className":3585,"code":3586,"language":3587,"meta":3032,"style":3032},[2950,4127,4128],{"__ignoreMap":3032},[3036,4129,4130,4132,4134],{"class":3038,"line":3039},[3036,4131,3595],{"class":3594},[3036,4133,3598],{"class":3069},[3036,4135,3601],{"class":3069},[2891,4137,4138],{},"If the model searches for the ID and then requests stock as instructed, the second tool call is blocked. Key output may look like this:",[3027,4140,4143],{"className":4141,"code":4142,"language":3610,"meta":3032},[3608],"Calling model. Current message count: 1\nModel responded. Tool request count: 1\nCalling model. Current message count: 3\nModel responded. Tool request count: 1\nTask failed: Tool call limit exceeded ...\n",[2950,4144,4142],{"__ignoreMap":3032},[2891,4146,4147,4148,4151],{},"These experiments limit model and tool calls separately. Logs and errors may vary by model and SDK version. If the model does not request the required tools, inspect the logs rather than interpreting a normal answer as evidence that the limit triggered. Restore the tool call limit to ",[2950,4149,4150],{},"3"," afterward.",[2891,4153,4154],{},"For write operations, call limits prevent excessive execution but cannot undo actions that already succeeded. The business system must still ensure consistency through transactions or compensation where needed.",[2895,4156],{},[2886,4158,4160],{"id":4159},"handle-transient-tool-failures","🧱 Handle Transient Tool Failures",[2891,4162,4163],{},"Occasional network timeouts from the stock API may be retried automatically. However, do not retry all errors indefinitely or indiscriminately retry tools whose side effects could duplicate charges or orders.",[2891,4165,4166,4167,4170],{},"To observe retries, create ",[2950,4168,4169],{},"03.retry.mjs",", reusing the model and product lookup functions:",[3027,4172,4174],{"className":3029,"code":4173,"language":3031,"meta":3032,"style":3032},"import { createAgent, tool, toolRetryMiddleware } from 'langchain';\nimport { z } from 'zod';\nimport { model } from './agent.mjs';\nimport { getStock } from './shop.mjs';\n\nlet attempts = 0;\nconst unstableStock = tool(\n    ({ id }) => {\n        attempts++;\n        console.log('Stock API execution count:', attempts);\n\n        // Simulate a failed first request\n        if (attempts === 1) {\n            throw new Error('Simulated transient network failure');\n        }\n\n        return JSON.stringify(getStock(id));\n    },\n    {\n        name: 'get_stock',\n        description: 'Look up stock by product ID',\n        schema: z.object({ id: z.string() }),\n    }\n);\n",[2950,4175,4176,4206,4228,4249,4271,4275,4289,4302,4317,4325,4351,4355,4360,4381,4405,4410,4414,4442,4446,4450,4467,4484,4523,4529],{"__ignoreMap":3032},[3036,4177,4178,4180,4182,4184,4186,4189,4191,4194,4196,4198,4200,4202,4204],{"class":3038,"line":3039},[3036,4179,3043],{"class":3042},[3036,4181,3047],{"class":3046},[3036,4183,3051],{"class":3050},[3036,4185,3054],{"class":3046},[3036,4187,4188],{"class":3050}," tool",[3036,4190,3054],{"class":3046},[3036,4192,4193],{"class":3050}," toolRetryMiddleware",[3036,4195,3060],{"class":3046},[3036,4197,3063],{"class":3042},[3036,4199,3066],{"class":3046},[3036,4201,3070],{"class":3069},[3036,4203,3073],{"class":3046},[3036,4205,3076],{"class":3046},[3036,4207,4208,4210,4212,4215,4217,4219,4221,4224,4226],{"class":3038,"line":3079},[3036,4209,3043],{"class":3042},[3036,4211,3047],{"class":3046},[3036,4213,4214],{"class":3050}," z",[3036,4216,3060],{"class":3046},[3036,4218,3063],{"class":3042},[3036,4220,3066],{"class":3046},[3036,4222,4223],{"class":3069},"zod",[3036,4225,3073],{"class":3046},[3036,4227,3076],{"class":3046},[3036,4229,4230,4232,4234,4237,4239,4241,4243,4245,4247],{"class":3038,"line":3102},[3036,4231,3043],{"class":3042},[3036,4233,3047],{"class":3046},[3036,4235,4236],{"class":3050}," model",[3036,4238,3060],{"class":3046},[3036,4240,3063],{"class":3042},[3036,4242,3066],{"class":3046},[3036,4244,3095],{"class":3069},[3036,4246,3073],{"class":3046},[3036,4248,3076],{"class":3046},[3036,4250,4251,4253,4255,4258,4260,4262,4264,4267,4269],{"class":3038,"line":3109},[3036,4252,3043],{"class":3042},[3036,4254,3047],{"class":3046},[3036,4256,4257],{"class":3050}," getStock",[3036,4259,3060],{"class":3046},[3036,4261,3063],{"class":3042},[3036,4263,3066],{"class":3046},[3036,4265,4266],{"class":3069},"./shop.mjs",[3036,4268,3073],{"class":3046},[3036,4270,3076],{"class":3046},[3036,4272,4273],{"class":3038,"line":3131},[3036,4274,3106],{"emptyLinePlaceholder":3105},[3036,4276,4277,4280,4283,4285,4287],{"class":3038,"line":3150},[3036,4278,4279],{"class":3112},"let",[3036,4281,4282],{"class":3050}," attempts ",[3036,4284,3119],{"class":3046},[3036,4286,3312],{"class":3279},[3036,4288,3076],{"class":3046},[3036,4290,4291,4293,4296,4298,4300],{"class":3038,"line":3155},[3036,4292,3113],{"class":3112},[3036,4294,4295],{"class":3050}," unstableStock ",[3036,4297,3119],{"class":3046},[3036,4299,4188],{"class":3122},[3036,4301,3452],{"class":3050},[3036,4303,4304,4307,4310,4313,4315],{"class":3038,"line":3162},[3036,4305,4306],{"class":3046},"    ({",[3036,4308,4309],{"class":3170}," id",[3036,4311,4312],{"class":3046}," })",[3036,4314,3174],{"class":3112},[3036,4316,3177],{"class":3046},[3036,4318,4319,4322],{"class":3038,"line":3180},[3036,4320,4321],{"class":3050},"        attempts",[3036,4323,4324],{"class":3046},"++;\n",[3036,4326,4327,4329,4331,4333,4335,4337,4340,4342,4344,4347,4349],{"class":3038,"line":3220},[3036,4328,3183],{"class":3050},[3036,4330,3186],{"class":3046},[3036,4332,3189],{"class":3122},[3036,4334,3125],{"class":3134},[3036,4336,3073],{"class":3046},[3036,4338,4339],{"class":3069},"Stock API execution count:",[3036,4341,3073],{"class":3046},[3036,4343,3054],{"class":3046},[3036,4345,4346],{"class":3050}," attempts",[3036,4348,3215],{"class":3134},[3036,4350,3076],{"class":3046},[3036,4352,4353],{"class":3038,"line":3226},[3036,4354,3106],{"emptyLinePlaceholder":3105},[3036,4356,4357],{"class":3038,"line":3231},[3036,4358,4359],{"class":3158},"        // Simulate a failed first request\n",[3036,4361,4362,4365,4368,4371,4374,4376,4379],{"class":3038,"line":3237},[3036,4363,4364],{"class":3042},"        if",[3036,4366,4367],{"class":3134}," (",[3036,4369,4370],{"class":3050},"attempts",[3036,4372,4373],{"class":3046}," ===",[3036,4375,4075],{"class":3279},[3036,4377,4378],{"class":3134},") ",[3036,4380,3128],{"class":3046},[3036,4382,4383,4386,4389,4392,4394,4396,4399,4401,4403],{"class":3038,"line":3251},[3036,4384,4385],{"class":3042},"            throw",[3036,4387,4388],{"class":3046}," new",[3036,4390,4391],{"class":3122}," Error",[3036,4393,3125],{"class":3134},[3036,4395,3073],{"class":3046},[3036,4397,4398],{"class":3069},"Simulated transient network failure",[3036,4400,3073],{"class":3046},[3036,4402,3215],{"class":3134},[3036,4404,3076],{"class":3046},[3036,4406,4407],{"class":3038,"line":3287},[3036,4408,4409],{"class":3046},"        }\n",[3036,4411,4412],{"class":3038,"line":3317},[3036,4413,3106],{"emptyLinePlaceholder":3105},[3036,4415,4416,4419,4422,4424,4427,4429,4432,4434,4437,4440],{"class":3038,"line":3322},[3036,4417,4418],{"class":3042},"        return",[3036,4420,4421],{"class":3050}," JSON",[3036,4423,3186],{"class":3046},[3036,4425,4426],{"class":3122},"stringify",[3036,4428,3125],{"class":3134},[3036,4430,4431],{"class":3122},"getStock",[3036,4433,3125],{"class":3134},[3036,4435,4436],{"class":3050},"id",[3036,4438,4439],{"class":3134},"))",[3036,4441,3076],{"class":3046},[3036,4443,4444],{"class":3038,"line":3348},[3036,4445,3223],{"class":3046},[3036,4447,4448],{"class":3038,"line":3353},[3036,4449,3457],{"class":3046},[3036,4451,4453,4456,4458,4460,4463,4465],{"class":3038,"line":4452},20,[3036,4454,4455],{"class":3134},"        name",[3036,4457,3025],{"class":3046},[3036,4459,3066],{"class":3046},[3036,4461,4462],{"class":3069},"get_stock",[3036,4464,3073],{"class":3046},[3036,4466,3147],{"class":3046},[3036,4468,4470,4473,4475,4477,4480,4482],{"class":3038,"line":4469},21,[3036,4471,4472],{"class":3134},"        description",[3036,4474,3025],{"class":3046},[3036,4476,3066],{"class":3046},[3036,4478,4479],{"class":3069},"Look up stock by product ID",[3036,4481,3073],{"class":3046},[3036,4483,3147],{"class":3046},[3036,4485,4487,4490,4492,4494,4496,4499,4501,4503,4505,4507,4509,4511,4514,4517,4519,4521],{"class":3038,"line":4486},22,[3036,4488,4489],{"class":3134},"        schema",[3036,4491,3025],{"class":3046},[3036,4493,4214],{"class":3050},[3036,4495,3186],{"class":3046},[3036,4497,4498],{"class":3122},"object",[3036,4500,3125],{"class":3050},[3036,4502,3470],{"class":3046},[3036,4504,4309],{"class":3134},[3036,4506,3025],{"class":3046},[3036,4508,4214],{"class":3050},[3036,4510,3186],{"class":3046},[3036,4512,4513],{"class":3122},"string",[3036,4515,4516],{"class":3050},"() ",[3036,4518,3356],{"class":3046},[3036,4520,3215],{"class":3050},[3036,4522,3147],{"class":3046},[3036,4524,4526],{"class":3038,"line":4525},23,[3036,4527,4528],{"class":3046},"    }\n",[3036,4530,4532,4534],{"class":3038,"line":4531},24,[3036,4533,3215],{"class":3050},[3036,4535,3076],{"class":3046},[2891,4537,4538],{},"This example intentionally throws on the first read and succeeds on the second. The counter only simulates an unreliable API; it is not the retry mechanism.",[2891,4540,4541],{},"Continue by adding:",[3027,4543,4545],{"className":3029,"code":4544,"language":3031,"meta":3032,"style":3032},"const agent = createAgent({\n    model,\n    tools: [unstableStock],\n    systemPrompt: 'Always use tools to check stock. Report failures accurately.',\n    middleware: [\n        toolRetryMiddleware({\n            tools: ['get_stock'],\n            maxRetries: 1,\n            onFailure: 'error',\n        }),\n    ],\n});\n\nconst result = await agent.invoke(\n    {\n        messages: [{ role: 'user', content: 'Check stock for P100.' }],\n    },\n    { recursionLimit: 20 }\n);\n\nconsole.log(result.messages.at(-1)?.content);\n",[2950,4546,4547,4561,4568,4580,4596,4604,4613,4632,4643,4658,4667,4674,4682,4686,4704,4708,4747,4751,4763,4769,4773],{"__ignoreMap":3032},[3036,4548,4549,4551,4553,4555,4557,4559],{"class":3038,"line":3039},[3036,4550,3113],{"class":3112},[3036,4552,3387],{"class":3050},[3036,4554,3119],{"class":3046},[3036,4556,3051],{"class":3122},[3036,4558,3125],{"class":3050},[3036,4560,3128],{"class":3046},[3036,4562,4563,4566],{"class":3038,"line":3079},[3036,4564,4565],{"class":3050},"    model",[3036,4567,3147],{"class":3046},[3036,4569,4570,4573,4575,4578],{"class":3038,"line":3102},[3036,4571,4572],{"class":3134},"    tools",[3036,4574,3025],{"class":3046},[3036,4576,4577],{"class":3050}," [unstableStock]",[3036,4579,3147],{"class":3046},[3036,4581,4582,4585,4587,4589,4592,4594],{"class":3038,"line":3109},[3036,4583,4584],{"class":3134},"    systemPrompt",[3036,4586,3025],{"class":3046},[3036,4588,3066],{"class":3046},[3036,4590,4591],{"class":3069},"Always use tools to check stock. Report failures accurately.",[3036,4593,3073],{"class":3046},[3036,4595,3147],{"class":3046},[3036,4597,4598,4600,4602],{"class":3038,"line":3131},[3036,4599,3410],{"class":3134},[3036,4601,3025],{"class":3046},[3036,4603,3708],{"class":3050},[3036,4605,4606,4609,4611],{"class":3038,"line":3150},[3036,4607,4608],{"class":3122},"        toolRetryMiddleware",[3036,4610,3125],{"class":3050},[3036,4612,3128],{"class":3046},[3036,4614,4615,4618,4620,4622,4624,4626,4628,4630],{"class":3038,"line":3155},[3036,4616,4617],{"class":3134},"            tools",[3036,4619,3025],{"class":3046},[3036,4621,3467],{"class":3050},[3036,4623,3073],{"class":3046},[3036,4625,4462],{"class":3069},[3036,4627,3073],{"class":3046},[3036,4629,3501],{"class":3050},[3036,4631,3147],{"class":3046},[3036,4633,4634,4637,4639,4641],{"class":3038,"line":3162},[3036,4635,4636],{"class":3134},"            maxRetries",[3036,4638,3025],{"class":3046},[3036,4640,4075],{"class":3279},[3036,4642,3147],{"class":3046},[3036,4644,4645,4648,4650,4652,4654,4656],{"class":3038,"line":3180},[3036,4646,4647],{"class":3134},"            onFailure",[3036,4649,3025],{"class":3046},[3036,4651,3066],{"class":3046},[3036,4653,3756],{"class":3069},[3036,4655,3073],{"class":3046},[3036,4657,3147],{"class":3046},[3036,4659,4660,4663,4665],{"class":3038,"line":3220},[3036,4661,4662],{"class":3046},"        }",[3036,4664,3215],{"class":3050},[3036,4666,3147],{"class":3046},[3036,4668,4669,4672],{"class":3038,"line":3226},[3036,4670,4671],{"class":3050},"    ]",[3036,4673,3147],{"class":3046},[3036,4675,4676,4678,4680],{"class":3038,"line":3231},[3036,4677,3356],{"class":3046},[3036,4679,3215],{"class":3050},[3036,4681,3076],{"class":3046},[3036,4683,4684],{"class":3038,"line":3237},[3036,4685,3106],{"emptyLinePlaceholder":3105},[3036,4687,4688,4690,4692,4694,4696,4698,4700,4702],{"class":3038,"line":3251},[3036,4689,3113],{"class":3112},[3036,4691,3436],{"class":3050},[3036,4693,3119],{"class":3046},[3036,4695,3441],{"class":3042},[3036,4697,3444],{"class":3050},[3036,4699,3186],{"class":3046},[3036,4701,3449],{"class":3122},[3036,4703,3452],{"class":3050},[3036,4705,4706],{"class":3038,"line":3287},[3036,4707,3457],{"class":3046},[3036,4709,4710,4712,4714,4716,4718,4720,4722,4724,4726,4728,4730,4732,4734,4736,4739,4741,4743,4745],{"class":3038,"line":3317},[3036,4711,3462],{"class":3134},[3036,4713,3025],{"class":3046},[3036,4715,3467],{"class":3050},[3036,4717,3470],{"class":3046},[3036,4719,3473],{"class":3134},[3036,4721,3025],{"class":3046},[3036,4723,3066],{"class":3046},[3036,4725,3480],{"class":3069},[3036,4727,3073],{"class":3046},[3036,4729,3054],{"class":3046},[3036,4731,3487],{"class":3134},[3036,4733,3025],{"class":3046},[3036,4735,3066],{"class":3046},[3036,4737,4738],{"class":3069},"Check stock for P100.",[3036,4740,3073],{"class":3046},[3036,4742,3060],{"class":3046},[3036,4744,3501],{"class":3050},[3036,4746,3147],{"class":3046},[3036,4748,4749],{"class":3038,"line":3322},[3036,4750,3223],{"class":3046},[3036,4752,4753,4755,4757,4759,4761],{"class":3038,"line":3348},[3036,4754,3512],{"class":3046},[3036,4756,3515],{"class":3134},[3036,4758,3025],{"class":3046},[3036,4760,3520],{"class":3279},[3036,4762,3523],{"class":3046},[3036,4764,4765,4767],{"class":3038,"line":3353},[3036,4766,3215],{"class":3050},[3036,4768,3076],{"class":3046},[3036,4770,4771],{"class":3038,"line":4452},[3036,4772,3106],{"emptyLinePlaceholder":3105},[3036,4774,4775,4777,4779,4781,4784,4786,4788,4790,4792,4794,4796,4798,4800,4802,4804],{"class":3038,"line":4469},[3036,4776,3538],{"class":3050},[3036,4778,3186],{"class":3046},[3036,4780,3189],{"class":3122},[3036,4782,4783],{"class":3050},"(result",[3036,4785,3186],{"class":3046},[3036,4787,3207],{"class":3050},[3036,4789,3186],{"class":3046},[3036,4791,3271],{"class":3122},[3036,4793,3125],{"class":3050},[3036,4795,3276],{"class":3046},[3036,4797,3280],{"class":3279},[3036,4799,3215],{"class":3050},[3036,4801,3299],{"class":3046},[3036,4803,3577],{"class":3050},[3036,4805,3076],{"class":3046},[2891,4807,3582],{},[3027,4809,4811],{"className":3585,"code":4810,"language":3587,"meta":3032,"style":3032},"node --env-file=.env 03.retry.mjs\n",[2950,4812,4813],{"__ignoreMap":3032},[3036,4814,4815,4817,4819],{"class":3038,"line":3039},[3036,4816,3595],{"class":3594},[3036,4818,3598],{"class":3069},[3036,4820,4821],{"class":3069}," 03.retry.mjs\n",[2891,4823,4824],{},"One possible output:",[3027,4826,4829],{"className":4827,"code":4828,"language":3610,"meta":3032},[3608],"Stock API execution count: 1\nStock API execution count: 2\nP100 has 12 units in stock.\n",[2950,4830,4828],{"__ignoreMap":3032},[2891,4832,4833,4836,4837,4840],{},[2950,4834,4835],{},"maxRetries: 1"," permits one additional attempt after the initial failure. If that also fails, ",[2950,4838,4839],{},"onFailure: 'error'"," propagates the error. This retry occurs inside the same tool request; the model does not need to generate another request first.",[2891,4842,4843,4844,4847],{},"In production, use ",[2950,4845,4846],{},"retryOn"," to distinguish recoverable network errors from unrecoverable business errors, and choose an appropriate backoff strategy. Returning an error string without throwing usually does not trigger exception-based retries, so configure retries for the tool’s actual error behavior.",[2895,4849],{},[2886,4851,4853],{"id":4852},"manage-growing-context","🧱 Manage Growing Context",[2891,4855,4856],{},"As we saw with short-term memory, conversation messages accumulate. Longer histories require more processing and bring the model closer to its context window limit.",[2891,4858,4859,4860,4863],{},"LangChain provides ",[2950,4861,4862],{},"summarizationMiddleware()"," to compress older messages into a summary when a condition is reached, keeping recent messages available to the model.",[2891,4865,4866,4867,4870],{},"To observe summarization separately, create ",[2950,4868,4869],{},"03.summary.mjs"," without product tools for now:",[3027,4872,4874],{"className":3029,"code":4873,"language":3031,"meta":3032,"style":3032},"import { createAgent, summarizationMiddleware } from 'langchain';\nimport { model } from './agent.mjs';\n\nconst agent = createAgent({\n    model,\n    tools: [],\n    middleware: [\n        summarizationMiddleware({\n            model,\n            // Trigger summarization when history reaches 5 messages\n            trigger: { messages: 5 },\n            // Aim to keep the most recent 2 messages\n            keep: { messages: 2 },\n        }),\n    ],\n});\n",[2950,4875,4876,4901,4921,4925,4939,4945,4956,4964,4973,4980,4985,5004,5009,5027,5035,5041],{"__ignoreMap":3032},[3036,4877,4878,4880,4882,4884,4886,4889,4891,4893,4895,4897,4899],{"class":3038,"line":3039},[3036,4879,3043],{"class":3042},[3036,4881,3047],{"class":3046},[3036,4883,3051],{"class":3050},[3036,4885,3054],{"class":3046},[3036,4887,4888],{"class":3050}," summarizationMiddleware",[3036,4890,3060],{"class":3046},[3036,4892,3063],{"class":3042},[3036,4894,3066],{"class":3046},[3036,4896,3070],{"class":3069},[3036,4898,3073],{"class":3046},[3036,4900,3076],{"class":3046},[3036,4902,4903,4905,4907,4909,4911,4913,4915,4917,4919],{"class":3038,"line":3079},[3036,4904,3043],{"class":3042},[3036,4906,3047],{"class":3046},[3036,4908,4236],{"class":3050},[3036,4910,3060],{"class":3046},[3036,4912,3063],{"class":3042},[3036,4914,3066],{"class":3046},[3036,4916,3095],{"class":3069},[3036,4918,3073],{"class":3046},[3036,4920,3076],{"class":3046},[3036,4922,4923],{"class":3038,"line":3102},[3036,4924,3106],{"emptyLinePlaceholder":3105},[3036,4926,4927,4929,4931,4933,4935,4937],{"class":3038,"line":3109},[3036,4928,3113],{"class":3112},[3036,4930,3387],{"class":3050},[3036,4932,3119],{"class":3046},[3036,4934,3051],{"class":3122},[3036,4936,3125],{"class":3050},[3036,4938,3128],{"class":3046},[3036,4940,4941,4943],{"class":3038,"line":3131},[3036,4942,4565],{"class":3050},[3036,4944,3147],{"class":3046},[3036,4946,4947,4949,4951,4954],{"class":3038,"line":3150},[3036,4948,4572],{"class":3134},[3036,4950,3025],{"class":3046},[3036,4952,4953],{"class":3050}," []",[3036,4955,3147],{"class":3046},[3036,4957,4958,4960,4962],{"class":3038,"line":3155},[3036,4959,3410],{"class":3134},[3036,4961,3025],{"class":3046},[3036,4963,3708],{"class":3050},[3036,4965,4966,4969,4971],{"class":3038,"line":3162},[3036,4967,4968],{"class":3122},"        summarizationMiddleware",[3036,4970,3125],{"class":3050},[3036,4972,3128],{"class":3046},[3036,4974,4975,4978],{"class":3038,"line":3180},[3036,4976,4977],{"class":3050},"            model",[3036,4979,3147],{"class":3046},[3036,4981,4982],{"class":3038,"line":3220},[3036,4983,4984],{"class":3158},"            // Trigger summarization when history reaches 5 messages\n",[3036,4986,4987,4990,4992,4994,4997,4999,5001],{"class":3038,"line":3226},[3036,4988,4989],{"class":3134},"            trigger",[3036,4991,3025],{"class":3046},[3036,4993,3047],{"class":3046},[3036,4995,4996],{"class":3134}," messages",[3036,4998,3025],{"class":3046},[3036,5000,3742],{"class":3279},[3036,5002,5003],{"class":3046}," },\n",[3036,5005,5006],{"class":3038,"line":3231},[3036,5007,5008],{"class":3158},"            // Aim to keep the most recent 2 messages\n",[3036,5010,5011,5014,5016,5018,5020,5022,5025],{"class":3038,"line":3237},[3036,5012,5013],{"class":3134},"            keep",[3036,5015,3025],{"class":3046},[3036,5017,3047],{"class":3046},[3036,5019,4996],{"class":3134},[3036,5021,3025],{"class":3046},[3036,5023,5024],{"class":3279}," 2",[3036,5026,5003],{"class":3046},[3036,5028,5029,5031,5033],{"class":3038,"line":3251},[3036,5030,4662],{"class":3046},[3036,5032,3215],{"class":3050},[3036,5034,3147],{"class":3046},[3036,5036,5037,5039],{"class":3038,"line":3287},[3036,5038,4671],{"class":3050},[3036,5040,3147],{"class":3046},[3036,5042,5043,5045,5047],{"class":3038,"line":3317},[3036,5044,3356],{"class":3046},[3036,5046,3215],{"class":3050},[3036,5048,3076],{"class":3046},[2891,5050,5051,5054,5055,5058],{},[2950,5052,5053],{},"trigger"," controls when summarization runs; ",[2950,5056,5057],{},"keep"," controls how much recent content remains. These deliberately small thresholds make the effect easy to observe.",[2891,5060,5061],{},"Append a simulated conversation history:",[3027,5063,5065],{"className":3029,"code":5064,"language":3031,"meta":3032,"style":3032},"const messages = [\n    { role: 'user', content: 'I plan to buy 15 mechanical keyboards.' },\n    { role: 'assistant', content: 'Understood. I have noted the purchase quantity.' },\n    { role: 'user', content: 'The budget is CNY 3,000.' },\n    { role: 'assistant', content: 'Understood. The purchase budget is CNY 3,000.' },\n    { role: 'user', content: 'Please summarize my purchasing requirements.' },\n];\n\nconsole.log('Message count before summarization:', messages.length);\n\nconst result = await agent.invoke({ messages });\n\n// Inspect the retained messages and final answer after summarization\nfor (const message of result.messages) {\n    console.log(message.type, message.content);\n}\n",[2950,5066,5067,5078,5107,5137,5166,5195,5224,5230,5234,5262,5266,5294,5298,5303,5327,5356],{"__ignoreMap":3032},[3036,5068,5069,5071,5074,5076],{"class":3038,"line":3039},[3036,5070,3113],{"class":3112},[3036,5072,5073],{"class":3050}," messages ",[3036,5075,3119],{"class":3046},[3036,5077,3708],{"class":3050},[3036,5079,5080,5082,5084,5086,5088,5090,5092,5094,5096,5098,5100,5103,5105],{"class":3038,"line":3079},[3036,5081,3512],{"class":3046},[3036,5083,3473],{"class":3134},[3036,5085,3025],{"class":3046},[3036,5087,3066],{"class":3046},[3036,5089,3480],{"class":3069},[3036,5091,3073],{"class":3046},[3036,5093,3054],{"class":3046},[3036,5095,3487],{"class":3134},[3036,5097,3025],{"class":3046},[3036,5099,3066],{"class":3046},[3036,5101,5102],{"class":3069},"I plan to buy 15 mechanical keyboards.",[3036,5104,3073],{"class":3046},[3036,5106,5003],{"class":3046},[3036,5108,5109,5111,5113,5115,5117,5120,5122,5124,5126,5128,5130,5133,5135],{"class":3038,"line":3102},[3036,5110,3512],{"class":3046},[3036,5112,3473],{"class":3134},[3036,5114,3025],{"class":3046},[3036,5116,3066],{"class":3046},[3036,5118,5119],{"class":3069},"assistant",[3036,5121,3073],{"class":3046},[3036,5123,3054],{"class":3046},[3036,5125,3487],{"class":3134},[3036,5127,3025],{"class":3046},[3036,5129,3066],{"class":3046},[3036,5131,5132],{"class":3069},"Understood. I have noted the purchase quantity.",[3036,5134,3073],{"class":3046},[3036,5136,5003],{"class":3046},[3036,5138,5139,5141,5143,5145,5147,5149,5151,5153,5155,5157,5159,5162,5164],{"class":3038,"line":3109},[3036,5140,3512],{"class":3046},[3036,5142,3473],{"class":3134},[3036,5144,3025],{"class":3046},[3036,5146,3066],{"class":3046},[3036,5148,3480],{"class":3069},[3036,5150,3073],{"class":3046},[3036,5152,3054],{"class":3046},[3036,5154,3487],{"class":3134},[3036,5156,3025],{"class":3046},[3036,5158,3066],{"class":3046},[3036,5160,5161],{"class":3069},"The budget is CNY 3,000.",[3036,5163,3073],{"class":3046},[3036,5165,5003],{"class":3046},[3036,5167,5168,5170,5172,5174,5176,5178,5180,5182,5184,5186,5188,5191,5193],{"class":3038,"line":3131},[3036,5169,3512],{"class":3046},[3036,5171,3473],{"class":3134},[3036,5173,3025],{"class":3046},[3036,5175,3066],{"class":3046},[3036,5177,5119],{"class":3069},[3036,5179,3073],{"class":3046},[3036,5181,3054],{"class":3046},[3036,5183,3487],{"class":3134},[3036,5185,3025],{"class":3046},[3036,5187,3066],{"class":3046},[3036,5189,5190],{"class":3069},"Understood. The purchase budget is CNY 3,000.",[3036,5192,3073],{"class":3046},[3036,5194,5003],{"class":3046},[3036,5196,5197,5199,5201,5203,5205,5207,5209,5211,5213,5215,5217,5220,5222],{"class":3038,"line":3150},[3036,5198,3512],{"class":3046},[3036,5200,3473],{"class":3134},[3036,5202,3025],{"class":3046},[3036,5204,3066],{"class":3046},[3036,5206,3480],{"class":3069},[3036,5208,3073],{"class":3046},[3036,5210,3054],{"class":3046},[3036,5212,3487],{"class":3134},[3036,5214,3025],{"class":3046},[3036,5216,3066],{"class":3046},[3036,5218,5219],{"class":3069},"Please summarize my purchasing requirements.",[3036,5221,3073],{"class":3046},[3036,5223,5003],{"class":3046},[3036,5225,5226,5228],{"class":3038,"line":3155},[3036,5227,3501],{"class":3050},[3036,5229,3076],{"class":3046},[3036,5231,5232],{"class":3038,"line":3162},[3036,5233,3106],{"emptyLinePlaceholder":3105},[3036,5235,5236,5238,5240,5242,5244,5246,5249,5251,5253,5255,5257,5260],{"class":3038,"line":3180},[3036,5237,3538],{"class":3050},[3036,5239,3186],{"class":3046},[3036,5241,3189],{"class":3122},[3036,5243,3125],{"class":3050},[3036,5245,3073],{"class":3046},[3036,5247,5248],{"class":3069},"Message count before summarization:",[3036,5250,3073],{"class":3046},[3036,5252,3054],{"class":3046},[3036,5254,4996],{"class":3050},[3036,5256,3186],{"class":3046},[3036,5258,5259],{"class":3050},"length)",[3036,5261,3076],{"class":3046},[3036,5263,5264],{"class":3038,"line":3220},[3036,5265,3106],{"emptyLinePlaceholder":3105},[3036,5267,5268,5270,5272,5274,5276,5278,5280,5282,5284,5286,5288,5290,5292],{"class":3038,"line":3226},[3036,5269,3113],{"class":3112},[3036,5271,3436],{"class":3050},[3036,5273,3119],{"class":3046},[3036,5275,3441],{"class":3042},[3036,5277,3444],{"class":3050},[3036,5279,3186],{"class":3046},[3036,5281,3449],{"class":3122},[3036,5283,3125],{"class":3050},[3036,5285,3470],{"class":3046},[3036,5287,5073],{"class":3050},[3036,5289,3356],{"class":3046},[3036,5291,3215],{"class":3050},[3036,5293,3076],{"class":3046},[3036,5295,5296],{"class":3038,"line":3231},[3036,5297,3106],{"emptyLinePlaceholder":3105},[3036,5299,5300],{"class":3038,"line":3237},[3036,5301,5302],{"class":3158},"// Inspect the retained messages and final answer after summarization\n",[3036,5304,5305,5308,5310,5312,5315,5318,5320,5322,5325],{"class":3038,"line":3251},[3036,5306,5307],{"class":3042},"for",[3036,5309,4367],{"class":3050},[3036,5311,3113],{"class":3112},[3036,5313,5314],{"class":3050}," message ",[3036,5316,5317],{"class":3046},"of",[3036,5319,3556],{"class":3050},[3036,5321,3186],{"class":3046},[3036,5323,5324],{"class":3050},"messages) ",[3036,5326,3128],{"class":3046},[3036,5328,5329,5331,5333,5335,5337,5339,5341,5344,5346,5348,5350,5352,5354],{"class":3038,"line":3287},[3036,5330,3976],{"class":3050},[3036,5332,3186],{"class":3046},[3036,5334,3189],{"class":3122},[3036,5336,3125],{"class":3134},[3036,5338,4056],{"class":3050},[3036,5340,3186],{"class":3046},[3036,5342,5343],{"class":3050},"type",[3036,5345,3054],{"class":3046},[3036,5347,3257],{"class":3050},[3036,5349,3186],{"class":3046},[3036,5351,4013],{"class":3050},[3036,5353,3215],{"class":3134},[3036,5355,3076],{"class":3046},[3036,5357,5358],{"class":3038,"line":3317},[3036,5359,4082],{"class":3046},[2891,5361,3582],{},[3027,5363,5365],{"className":3585,"code":5364,"language":3587,"meta":3032,"style":3032},"node --env-file=.env 03.summary.mjs\n",[2950,5366,5367],{"__ignoreMap":3032},[3036,5368,5369,5371,5373],{"class":3038,"line":3039},[3036,5370,3595],{"class":3594},[3036,5372,3598],{"class":3069},[3036,5374,5375],{"class":3069}," 03.summary.mjs\n",[2891,5377,5378],{},"One possible excerpt follows (the model generates the summary and answer; the summary prefix and retained message count depend on actual execution):",[3027,5380,5383],{"className":5381,"code":5382,"language":3610,"meta":3032},[3608],"Message count before summarization: 5\nhuman [Summary of earlier conversation: The user plans to buy 15 mechanical keyboards.]\nhuman The budget is CNY 3,000.\nai Understood. The purchase budget is CNY 3,000.\nhuman Please summarize my purchasing requirements.\nai You plan to buy 15 mechanical keyboards with a budget of CNY 3,000.\n",[2950,5384,5382],{"__ignoreMap":3032},[2891,5386,5387],{},"Older messages are no longer sent individually; their important information is retained in a summary. The framework may keep additional recent messages to preserve message structure, so exactly two remaining messages are not guaranteed.",[2891,5389,5390,5391,3369,5394,5397],{},"Real projects should generally set token thresholds based on context capacity, such as ",[2950,5392,5393],{},"trigger: { tokens: 4000 }",[2950,5395,5396],{},"keep: { messages: 10 }",". Summarization adds model calls and may lose details, so critical business data should remain in the business system.",[2895,5399],{},[2886,5401,5403],{"id":5402},"require-human-approval-for-sensitive-tools","🧱 Require Human Approval for Sensitive Tools",[2891,5405,5406],{},"Reading stock leaves business data unchanged, while updating it directly affects the business system. Applications can require human approval before these sensitive operations execute.",[2891,5408,5409,5410,5413],{},"LangChain’s ",[2950,5411,5412],{},"humanInTheLoopMiddleware()"," pauses a task before a specified tool executes and waits for the application to provide a human decision. To avoid modifying product data used earlier, this example simulates a write with a separate in-memory stock value.",[3851,5415,5417],{"id":5416},"configure-a-tool-that-requires-approval","Configure a Tool That Requires Approval",[2891,5419,5420,5421,3025],{},"Create ",[2950,5422,5423],{},"03.approval.mjs",[3027,5425,5427],{"className":3029,"code":5426,"language":3031,"meta":3032,"style":3032},"import { createAgent, tool, humanInTheLoopMiddleware } from 'langchain';\nimport { Command, MemorySaver } from '@langchain/langgraph';\nimport { z } from 'zod';\nimport { model } from './agent.mjs';\n\nlet stock = 12;\nconst updateStock = tool(\n    ({ quantity }) => {\n        // Change stock only when the tool actually executes\n        stock = quantity;\n        return `Stock for P100 updated to ${stock} units`;\n    },\n    {\n        name: 'update_stock',\n        description: 'Set stock for P100 to the specified quantity',\n        schema: z.object({ quantity: z.number().int().min(0) }),\n    }\n);\n",[2950,5428,5429,5458,5485,5505,5525,5529,5543,5556,5569,5574,5585,5611,5615,5619,5634,5649,5704,5708],{"__ignoreMap":3032},[3036,5430,5431,5433,5435,5437,5439,5441,5443,5446,5448,5450,5452,5454,5456],{"class":3038,"line":3039},[3036,5432,3043],{"class":3042},[3036,5434,3047],{"class":3046},[3036,5436,3051],{"class":3050},[3036,5438,3054],{"class":3046},[3036,5440,4188],{"class":3050},[3036,5442,3054],{"class":3046},[3036,5444,5445],{"class":3050}," humanInTheLoopMiddleware",[3036,5447,3060],{"class":3046},[3036,5449,3063],{"class":3042},[3036,5451,3066],{"class":3046},[3036,5453,3070],{"class":3069},[3036,5455,3073],{"class":3046},[3036,5457,3076],{"class":3046},[3036,5459,5460,5462,5464,5467,5469,5472,5474,5476,5478,5481,5483],{"class":3038,"line":3079},[3036,5461,3043],{"class":3042},[3036,5463,3047],{"class":3046},[3036,5465,5466],{"class":3050}," Command",[3036,5468,3054],{"class":3046},[3036,5470,5471],{"class":3050}," MemorySaver",[3036,5473,3060],{"class":3046},[3036,5475,3063],{"class":3042},[3036,5477,3066],{"class":3046},[3036,5479,5480],{"class":3069},"@langchain/langgraph",[3036,5482,3073],{"class":3046},[3036,5484,3076],{"class":3046},[3036,5486,5487,5489,5491,5493,5495,5497,5499,5501,5503],{"class":3038,"line":3102},[3036,5488,3043],{"class":3042},[3036,5490,3047],{"class":3046},[3036,5492,4214],{"class":3050},[3036,5494,3060],{"class":3046},[3036,5496,3063],{"class":3042},[3036,5498,3066],{"class":3046},[3036,5500,4223],{"class":3069},[3036,5502,3073],{"class":3046},[3036,5504,3076],{"class":3046},[3036,5506,5507,5509,5511,5513,5515,5517,5519,5521,5523],{"class":3038,"line":3109},[3036,5508,3043],{"class":3042},[3036,5510,3047],{"class":3046},[3036,5512,4236],{"class":3050},[3036,5514,3060],{"class":3046},[3036,5516,3063],{"class":3042},[3036,5518,3066],{"class":3046},[3036,5520,3095],{"class":3069},[3036,5522,3073],{"class":3046},[3036,5524,3076],{"class":3046},[3036,5526,5527],{"class":3038,"line":3131},[3036,5528,3106],{"emptyLinePlaceholder":3105},[3036,5530,5531,5533,5536,5538,5541],{"class":3038,"line":3150},[3036,5532,4279],{"class":3112},[3036,5534,5535],{"class":3050}," stock ",[3036,5537,3119],{"class":3046},[3036,5539,5540],{"class":3279}," 12",[3036,5542,3076],{"class":3046},[3036,5544,5545,5547,5550,5552,5554],{"class":3038,"line":3155},[3036,5546,3113],{"class":3112},[3036,5548,5549],{"class":3050}," updateStock ",[3036,5551,3119],{"class":3046},[3036,5553,4188],{"class":3122},[3036,5555,3452],{"class":3050},[3036,5557,5558,5560,5563,5565,5567],{"class":3038,"line":3162},[3036,5559,4306],{"class":3046},[3036,5561,5562],{"class":3170}," quantity",[3036,5564,4312],{"class":3046},[3036,5566,3174],{"class":3112},[3036,5568,3177],{"class":3046},[3036,5570,5571],{"class":3038,"line":3180},[3036,5572,5573],{"class":3158},"        // Change stock only when the tool actually executes\n",[3036,5575,5576,5579,5581,5583],{"class":3038,"line":3220},[3036,5577,5578],{"class":3050},"        stock",[3036,5580,3260],{"class":3046},[3036,5582,5562],{"class":3050},[3036,5584,3076],{"class":3046},[3036,5586,5587,5589,5592,5595,5598,5601,5603,5606,5609],{"class":3038,"line":3226},[3036,5588,4418],{"class":3042},[3036,5590,5591],{"class":3046}," `",[3036,5593,5594],{"class":3069},"Stock for P100 updated to ",[3036,5596,5597],{"class":3046},"${",[3036,5599,5600],{"class":3050},"stock",[3036,5602,3356],{"class":3046},[3036,5604,5605],{"class":3069}," units",[3036,5607,5608],{"class":3046},"`",[3036,5610,3076],{"class":3046},[3036,5612,5613],{"class":3038,"line":3231},[3036,5614,3223],{"class":3046},[3036,5616,5617],{"class":3038,"line":3237},[3036,5618,3457],{"class":3046},[3036,5620,5621,5623,5625,5627,5630,5632],{"class":3038,"line":3251},[3036,5622,4455],{"class":3134},[3036,5624,3025],{"class":3046},[3036,5626,3066],{"class":3046},[3036,5628,5629],{"class":3069},"update_stock",[3036,5631,3073],{"class":3046},[3036,5633,3147],{"class":3046},[3036,5635,5636,5638,5640,5642,5645,5647],{"class":3038,"line":3287},[3036,5637,4472],{"class":3134},[3036,5639,3025],{"class":3046},[3036,5641,3066],{"class":3046},[3036,5643,5644],{"class":3069},"Set stock for P100 to the specified quantity",[3036,5646,3073],{"class":3046},[3036,5648,3147],{"class":3046},[3036,5650,5651,5653,5655,5657,5659,5661,5663,5665,5667,5669,5671,5673,5676,5679,5681,5684,5686,5688,5691,5693,5696,5698,5700,5702],{"class":3038,"line":3317},[3036,5652,4489],{"class":3134},[3036,5654,3025],{"class":3046},[3036,5656,4214],{"class":3050},[3036,5658,3186],{"class":3046},[3036,5660,4498],{"class":3122},[3036,5662,3125],{"class":3050},[3036,5664,3470],{"class":3046},[3036,5666,5562],{"class":3134},[3036,5668,3025],{"class":3046},[3036,5670,4214],{"class":3050},[3036,5672,3186],{"class":3046},[3036,5674,5675],{"class":3122},"number",[3036,5677,5678],{"class":3050},"()",[3036,5680,3186],{"class":3046},[3036,5682,5683],{"class":3122},"int",[3036,5685,5678],{"class":3050},[3036,5687,3186],{"class":3046},[3036,5689,5690],{"class":3122},"min",[3036,5692,3125],{"class":3050},[3036,5694,5695],{"class":3279},"0",[3036,5697,4378],{"class":3050},[3036,5699,3356],{"class":3046},[3036,5701,3215],{"class":3050},[3036,5703,3147],{"class":3046},[3036,5705,5706],{"class":3038,"line":3322},[3036,5707,4528],{"class":3046},[3036,5709,5710,5712],{"class":3038,"line":3348},[3036,5711,3215],{"class":3050},[3036,5713,3076],{"class":3046},[2891,5715,5716,5717,5719],{},"This tool changes ",[2950,5718,5600],{}," in the current process. Next, configure it to require human approval:",[3027,5721,5723],{"className":3029,"code":5722,"language":3031,"meta":3032,"style":3032},"const agent = createAgent({\n    model,\n    tools: [updateStock],\n    systemPrompt: 'Update stock only through the specified tool. If it is rejected, do not try to update stock again.',\n    // Save execution state when paused\n    checkpointer: new MemorySaver(),\n    middleware: [\n        humanInTheLoopMiddleware({\n            interruptOn: {\n                update_stock: {\n                    allowedDecisions: ['approve', 'reject'],\n                },\n            },\n        }),\n    ],\n});\n",[2950,5724,5725,5739,5745,5756,5771,5776,5791,5799,5808,5817,5826,5855,5860,5865,5873,5879],{"__ignoreMap":3032},[3036,5726,5727,5729,5731,5733,5735,5737],{"class":3038,"line":3039},[3036,5728,3113],{"class":3112},[3036,5730,3387],{"class":3050},[3036,5732,3119],{"class":3046},[3036,5734,3051],{"class":3122},[3036,5736,3125],{"class":3050},[3036,5738,3128],{"class":3046},[3036,5740,5741,5743],{"class":3038,"line":3079},[3036,5742,4565],{"class":3050},[3036,5744,3147],{"class":3046},[3036,5746,5747,5749,5751,5754],{"class":3038,"line":3102},[3036,5748,4572],{"class":3134},[3036,5750,3025],{"class":3046},[3036,5752,5753],{"class":3050}," [updateStock]",[3036,5755,3147],{"class":3046},[3036,5757,5758,5760,5762,5764,5767,5769],{"class":3038,"line":3109},[3036,5759,4584],{"class":3134},[3036,5761,3025],{"class":3046},[3036,5763,3066],{"class":3046},[3036,5765,5766],{"class":3069},"Update stock only through the specified tool. If it is rejected, do not try to update stock again.",[3036,5768,3073],{"class":3046},[3036,5770,3147],{"class":3046},[3036,5772,5773],{"class":3038,"line":3131},[3036,5774,5775],{"class":3158},"    // Save execution state when paused\n",[3036,5777,5778,5781,5783,5785,5787,5789],{"class":3038,"line":3150},[3036,5779,5780],{"class":3134},"    checkpointer",[3036,5782,3025],{"class":3046},[3036,5784,4388],{"class":3046},[3036,5786,5471],{"class":3122},[3036,5788,5678],{"class":3050},[3036,5790,3147],{"class":3046},[3036,5792,5793,5795,5797],{"class":3038,"line":3155},[3036,5794,3410],{"class":3134},[3036,5796,3025],{"class":3046},[3036,5798,3708],{"class":3050},[3036,5800,5801,5804,5806],{"class":3038,"line":3162},[3036,5802,5803],{"class":3122},"        humanInTheLoopMiddleware",[3036,5805,3125],{"class":3050},[3036,5807,3128],{"class":3046},[3036,5809,5810,5813,5815],{"class":3038,"line":3180},[3036,5811,5812],{"class":3134},"            interruptOn",[3036,5814,3025],{"class":3046},[3036,5816,3177],{"class":3046},[3036,5818,5819,5822,5824],{"class":3038,"line":3220},[3036,5820,5821],{"class":3134},"                update_stock",[3036,5823,3025],{"class":3046},[3036,5825,3177],{"class":3046},[3036,5827,5828,5831,5833,5835,5837,5840,5842,5844,5846,5849,5851,5853],{"class":3038,"line":3226},[3036,5829,5830],{"class":3134},"                    allowedDecisions",[3036,5832,3025],{"class":3046},[3036,5834,3467],{"class":3050},[3036,5836,3073],{"class":3046},[3036,5838,5839],{"class":3069},"approve",[3036,5841,3073],{"class":3046},[3036,5843,3054],{"class":3046},[3036,5845,3066],{"class":3046},[3036,5847,5848],{"class":3069},"reject",[3036,5850,3073],{"class":3046},[3036,5852,3501],{"class":3050},[3036,5854,3147],{"class":3046},[3036,5856,5857],{"class":3038,"line":3231},[3036,5858,5859],{"class":3046},"                },\n",[3036,5861,5862],{"class":3038,"line":3237},[3036,5863,5864],{"class":3046},"            },\n",[3036,5866,5867,5869,5871],{"class":3038,"line":3251},[3036,5868,4662],{"class":3046},[3036,5870,3215],{"class":3050},[3036,5872,3147],{"class":3046},[3036,5874,5875,5877],{"class":3038,"line":3287},[3036,5876,4671],{"class":3050},[3036,5878,3147],{"class":3046},[3036,5880,5881,5883,5885],{"class":3038,"line":3317},[3036,5882,3356],{"class":3046},[3036,5884,3215],{"class":3050},[3036,5886,3076],{"class":3046},[2891,5888,5889,5892],{},[2950,5890,5891],{},"interruptOn"," specifies which tools pause execution and which decisions are allowed. This example allows only approval or rejection. A checkpointer saves the paused execution state so the application can resume the task.",[3851,5894,5896],{"id":5895},"observe-the-pause","Observe the Pause",[2891,5898,3375],{},[3027,5900,5902],{"className":3029,"code":5901,"language":3031,"meta":3032,"style":3032},"const config = {\n    configurable: { thread_id: 'stock-approval' },\n    recursionLimit: 20,\n};\n\nconst pending = await agent.invoke(\n    {\n        messages: [{ role: 'user', content: 'Please set stock for P100 to 20 units.' }],\n    },\n    config\n);\n\n// Read actions awaiting human approval\nconst interrupts = pending.__interrupt__ ?? [];\nconsole.log('Stock before approval:', stock);\n\nif (interrupts.length !== 1) {\n    throw new Error('This example requires one pending approval interrupt');\n}\n\nconst actions = interrupts[0].value.actionRequests;\n\nif (actions?.length !== 1 || actions[0].name !== 'update_stock') {\n    throw new Error('This example handles only one stock update request');\n}\n\nconst action = actions[0];\nconsole.log('Tool awaiting approval:', action.name);\nconsole.log('Action arguments:', action.args);\n",[2950,5903,5904,5915,5938,5949,5954,5958,5977,5981,6020,6024,6029,6035,6039,6044,6068,6092,6096,6118,6140,6144,6148,6176,6180,6222,6243,6248,6253,6271,6301],{"__ignoreMap":3032},[3036,5905,5906,5908,5911,5913],{"class":3038,"line":3039},[3036,5907,3113],{"class":3112},[3036,5909,5910],{"class":3050}," config ",[3036,5912,3119],{"class":3046},[3036,5914,3177],{"class":3046},[3036,5916,5917,5920,5922,5924,5927,5929,5931,5934,5936],{"class":3038,"line":3079},[3036,5918,5919],{"class":3134},"    configurable",[3036,5921,3025],{"class":3046},[3036,5923,3047],{"class":3046},[3036,5925,5926],{"class":3134}," thread_id",[3036,5928,3025],{"class":3046},[3036,5930,3066],{"class":3046},[3036,5932,5933],{"class":3069},"stock-approval",[3036,5935,3073],{"class":3046},[3036,5937,5003],{"class":3046},[3036,5939,5940,5943,5945,5947],{"class":3038,"line":3102},[3036,5941,5942],{"class":3134},"    recursionLimit",[3036,5944,3025],{"class":3046},[3036,5946,3520],{"class":3279},[3036,5948,3147],{"class":3046},[3036,5950,5951],{"class":3038,"line":3109},[3036,5952,5953],{"class":3046},"};\n",[3036,5955,5956],{"class":3038,"line":3131},[3036,5957,3106],{"emptyLinePlaceholder":3105},[3036,5959,5960,5962,5965,5967,5969,5971,5973,5975],{"class":3038,"line":3150},[3036,5961,3113],{"class":3112},[3036,5963,5964],{"class":3050}," pending ",[3036,5966,3119],{"class":3046},[3036,5968,3441],{"class":3042},[3036,5970,3444],{"class":3050},[3036,5972,3186],{"class":3046},[3036,5974,3449],{"class":3122},[3036,5976,3452],{"class":3050},[3036,5978,5979],{"class":3038,"line":3155},[3036,5980,3457],{"class":3046},[3036,5982,5983,5985,5987,5989,5991,5993,5995,5997,5999,6001,6003,6005,6007,6009,6012,6014,6016,6018],{"class":3038,"line":3162},[3036,5984,3462],{"class":3134},[3036,5986,3025],{"class":3046},[3036,5988,3467],{"class":3050},[3036,5990,3470],{"class":3046},[3036,5992,3473],{"class":3134},[3036,5994,3025],{"class":3046},[3036,5996,3066],{"class":3046},[3036,5998,3480],{"class":3069},[3036,6000,3073],{"class":3046},[3036,6002,3054],{"class":3046},[3036,6004,3487],{"class":3134},[3036,6006,3025],{"class":3046},[3036,6008,3066],{"class":3046},[3036,6010,6011],{"class":3069},"Please set stock for P100 to 20 units.",[3036,6013,3073],{"class":3046},[3036,6015,3060],{"class":3046},[3036,6017,3501],{"class":3050},[3036,6019,3147],{"class":3046},[3036,6021,6022],{"class":3038,"line":3180},[3036,6023,3223],{"class":3046},[3036,6025,6026],{"class":3038,"line":3220},[3036,6027,6028],{"class":3050},"    config\n",[3036,6030,6031,6033],{"class":3038,"line":3226},[3036,6032,3215],{"class":3050},[3036,6034,3076],{"class":3046},[3036,6036,6037],{"class":3038,"line":3231},[3036,6038,3106],{"emptyLinePlaceholder":3105},[3036,6040,6041],{"class":3038,"line":3237},[3036,6042,6043],{"class":3158},"// Read actions awaiting human approval\n",[3036,6045,6046,6048,6051,6053,6056,6058,6061,6064,6066],{"class":3038,"line":3251},[3036,6047,3113],{"class":3112},[3036,6049,6050],{"class":3050}," interrupts ",[3036,6052,3119],{"class":3046},[3036,6054,6055],{"class":3050}," pending",[3036,6057,3186],{"class":3046},[3036,6059,6060],{"class":3050},"__interrupt__ ",[3036,6062,6063],{"class":3046},"??",[3036,6065,4953],{"class":3050},[3036,6067,3076],{"class":3046},[3036,6069,6070,6072,6074,6076,6078,6080,6083,6085,6087,6090],{"class":3038,"line":3287},[3036,6071,3538],{"class":3050},[3036,6073,3186],{"class":3046},[3036,6075,3189],{"class":3122},[3036,6077,3125],{"class":3050},[3036,6079,3073],{"class":3046},[3036,6081,6082],{"class":3069},"Stock before approval:",[3036,6084,3073],{"class":3046},[3036,6086,3054],{"class":3046},[3036,6088,6089],{"class":3050}," stock)",[3036,6091,3076],{"class":3046},[3036,6093,6094],{"class":3038,"line":3317},[3036,6095,3106],{"emptyLinePlaceholder":3105},[3036,6097,6098,6101,6104,6106,6109,6112,6114,6116],{"class":3038,"line":3322},[3036,6099,6100],{"class":3042},"if",[3036,6102,6103],{"class":3050}," (interrupts",[3036,6105,3186],{"class":3046},[3036,6107,6108],{"class":3050},"length ",[3036,6110,6111],{"class":3046},"!==",[3036,6113,4075],{"class":3279},[3036,6115,4378],{"class":3050},[3036,6117,3128],{"class":3046},[3036,6119,6120,6123,6125,6127,6129,6131,6134,6136,6138],{"class":3038,"line":3348},[3036,6121,6122],{"class":3042},"    throw",[3036,6124,4388],{"class":3046},[3036,6126,4391],{"class":3122},[3036,6128,3125],{"class":3134},[3036,6130,3073],{"class":3046},[3036,6132,6133],{"class":3069},"This example requires one pending approval interrupt",[3036,6135,3073],{"class":3046},[3036,6137,3215],{"class":3134},[3036,6139,3076],{"class":3046},[3036,6141,6142],{"class":3038,"line":3353},[3036,6143,4082],{"class":3046},[3036,6145,6146],{"class":3038,"line":4452},[3036,6147,3106],{"emptyLinePlaceholder":3105},[3036,6149,6150,6152,6155,6157,6160,6162,6164,6166,6169,6171,6174],{"class":3038,"line":4469},[3036,6151,3113],{"class":3112},[3036,6153,6154],{"class":3050}," actions ",[3036,6156,3119],{"class":3046},[3036,6158,6159],{"class":3050}," interrupts[",[3036,6161,5695],{"class":3279},[3036,6163,3501],{"class":3050},[3036,6165,3186],{"class":3046},[3036,6167,6168],{"class":3050},"value",[3036,6170,3186],{"class":3046},[3036,6172,6173],{"class":3050},"actionRequests",[3036,6175,3076],{"class":3046},[3036,6177,6178],{"class":3038,"line":4486},[3036,6179,3106],{"emptyLinePlaceholder":3105},[3036,6181,6182,6184,6187,6189,6191,6193,6195,6198,6201,6203,6205,6207,6210,6212,6214,6216,6218,6220],{"class":3038,"line":4525},[3036,6183,6100],{"class":3042},[3036,6185,6186],{"class":3050}," (actions",[3036,6188,3299],{"class":3046},[3036,6190,6108],{"class":3050},[3036,6192,6111],{"class":3046},[3036,6194,4075],{"class":3279},[3036,6196,6197],{"class":3046}," ||",[3036,6199,6200],{"class":3050}," actions[",[3036,6202,5695],{"class":3279},[3036,6204,3501],{"class":3050},[3036,6206,3186],{"class":3046},[3036,6208,6209],{"class":3050},"name ",[3036,6211,6111],{"class":3046},[3036,6213,3066],{"class":3046},[3036,6215,5629],{"class":3069},[3036,6217,3073],{"class":3046},[3036,6219,4378],{"class":3050},[3036,6221,3128],{"class":3046},[3036,6223,6224,6226,6228,6230,6232,6234,6237,6239,6241],{"class":3038,"line":4531},[3036,6225,6122],{"class":3042},[3036,6227,4388],{"class":3046},[3036,6229,4391],{"class":3122},[3036,6231,3125],{"class":3134},[3036,6233,3073],{"class":3046},[3036,6235,6236],{"class":3069},"This example handles only one stock update request",[3036,6238,3073],{"class":3046},[3036,6240,3215],{"class":3134},[3036,6242,3076],{"class":3046},[3036,6244,6246],{"class":3038,"line":6245},25,[3036,6247,4082],{"class":3046},[3036,6249,6251],{"class":3038,"line":6250},26,[3036,6252,3106],{"emptyLinePlaceholder":3105},[3036,6254,6256,6258,6261,6263,6265,6267,6269],{"class":3038,"line":6255},27,[3036,6257,3113],{"class":3112},[3036,6259,6260],{"class":3050}," action ",[3036,6262,3119],{"class":3046},[3036,6264,6200],{"class":3050},[3036,6266,5695],{"class":3279},[3036,6268,3501],{"class":3050},[3036,6270,3076],{"class":3046},[3036,6272,6274,6276,6278,6280,6282,6284,6287,6289,6291,6294,6296,6299],{"class":3038,"line":6273},28,[3036,6275,3538],{"class":3050},[3036,6277,3186],{"class":3046},[3036,6279,3189],{"class":3122},[3036,6281,3125],{"class":3050},[3036,6283,3073],{"class":3046},[3036,6285,6286],{"class":3069},"Tool awaiting approval:",[3036,6288,3073],{"class":3046},[3036,6290,3054],{"class":3046},[3036,6292,6293],{"class":3050}," action",[3036,6295,3186],{"class":3046},[3036,6297,6298],{"class":3050},"name)",[3036,6300,3076],{"class":3046},[3036,6302,6304,6306,6308,6310,6312,6314,6317,6319,6321,6323,6325,6328],{"class":3038,"line":6303},29,[3036,6305,3538],{"class":3050},[3036,6307,3186],{"class":3046},[3036,6309,3189],{"class":3122},[3036,6311,3125],{"class":3050},[3036,6313,3073],{"class":3046},[3036,6315,6316],{"class":3069},"Action arguments:",[3036,6318,3073],{"class":3046},[3036,6320,3054],{"class":3046},[3036,6322,6293],{"class":3050},[3036,6324,3186],{"class":3046},[3036,6326,6327],{"class":3050},"args)",[3036,6329,3076],{"class":3046},[2891,6331,3582],{},[3027,6333,6335],{"className":3585,"code":6334,"language":3587,"meta":3032,"style":3032},"node --env-file=.env 03.approval.mjs\n",[2950,6336,6337],{"__ignoreMap":3032},[3036,6338,6339,6341,6343],{"class":3038,"line":3039},[3036,6340,3595],{"class":3594},[3036,6342,3598],{"class":3069},[3036,6344,6345],{"class":3069}," 03.approval.mjs\n",[2891,6347,6348],{},"If the model requests a stock update, you may see:",[3027,6350,6353],{"className":6351,"code":6352,"language":3610,"meta":3032},[3608],"Stock before approval: 12\nTool awaiting approval: update_stock\nAction arguments: { quantity: 20 }\n",[2950,6354,6352],{"__ignoreMap":3032},[2891,6356,6357,6358,6361,6362,6364],{},"The agent is paused and the tool has not run. ",[2950,6359,6360],{},"__interrupt__"," contains interrupt information, including ",[2950,6363,6173],{}," for tools awaiting review. This example handles only one stock update request and stops on unexpected input to avoid approving unknown actions.",[3851,6366,6368],{"id":6367},"obtain-a-human-decision","Obtain a Human Decision",[2891,6370,6371],{},"In a real application, the frontend can show the pending tool and its arguments and let a reviewer approve or reject it. This example simulates that interaction through terminal input.",[2891,6373,6374],{},"Add at the top of the file:",[3027,6376,6378],{"className":3029,"code":6377,"language":3031,"meta":3032,"style":3032},"import { createInterface } from 'node:readline/promises';\n",[2950,6379,6380],{"__ignoreMap":3032},[3036,6381,6382,6384,6386,6389,6391,6393,6395,6398,6400],{"class":3038,"line":3039},[3036,6383,3043],{"class":3042},[3036,6385,3047],{"class":3046},[3036,6387,6388],{"class":3050}," createInterface",[3036,6390,3060],{"class":3046},[3036,6392,3063],{"class":3042},[3036,6394,3066],{"class":3046},[3036,6396,6397],{"class":3069},"node:readline/promises",[3036,6399,3073],{"class":3046},[3036,6401,3076],{"class":3046},[2891,6403,6404],{},"Continue appending to the file:",[3027,6406,6408],{"className":3029,"code":6407,"language":3031,"meta":3032,"style":3032},"const rl = createInterface({\n    input: process.stdin,\n    output: process.stdout,\n});\n\nlet answer;\n\ntry {\n    answer = await rl.question('Approve this action? Enter yes to approve; anything else rejects: ');\n} finally {\n    rl.close();\n}\n\n// Reject by default; approve only on an explicit yes\nlet decision = { type: 'reject', message: 'The reviewer rejected the stock update' };\n\nif (answer.trim().toLowerCase() === 'yes') {\n    decision = { type: 'approve' };\n}\n\nconsole.log('Human decision:', decision.type);\n",[2950,6409,6410,6425,6442,6458,6466,6470,6479,6483,6489,6519,6528,6542,6546,6550,6555,6593,6597,6632,6653,6657,6661],{"__ignoreMap":3032},[3036,6411,6412,6414,6417,6419,6421,6423],{"class":3038,"line":3039},[3036,6413,3113],{"class":3112},[3036,6415,6416],{"class":3050}," rl ",[3036,6418,3119],{"class":3046},[3036,6420,6388],{"class":3122},[3036,6422,3125],{"class":3050},[3036,6424,3128],{"class":3046},[3036,6426,6427,6430,6432,6435,6437,6440],{"class":3038,"line":3079},[3036,6428,6429],{"class":3134},"    input",[3036,6431,3025],{"class":3046},[3036,6433,6434],{"class":3050}," process",[3036,6436,3186],{"class":3046},[3036,6438,6439],{"class":3050},"stdin",[3036,6441,3147],{"class":3046},[3036,6443,6444,6447,6449,6451,6453,6456],{"class":3038,"line":3102},[3036,6445,6446],{"class":3134},"    output",[3036,6448,3025],{"class":3046},[3036,6450,6434],{"class":3050},[3036,6452,3186],{"class":3046},[3036,6454,6455],{"class":3050},"stdout",[3036,6457,3147],{"class":3046},[3036,6459,6460,6462,6464],{"class":3038,"line":3109},[3036,6461,3356],{"class":3046},[3036,6463,3215],{"class":3050},[3036,6465,3076],{"class":3046},[3036,6467,6468],{"class":3038,"line":3131},[3036,6469,3106],{"emptyLinePlaceholder":3105},[3036,6471,6472,6474,6477],{"class":3038,"line":3150},[3036,6473,4279],{"class":3112},[3036,6475,6476],{"class":3050}," answer",[3036,6478,3076],{"class":3046},[3036,6480,6481],{"class":3038,"line":3155},[3036,6482,3106],{"emptyLinePlaceholder":3105},[3036,6484,6485,6487],{"class":3038,"line":3162},[3036,6486,3876],{"class":3042},[3036,6488,3177],{"class":3046},[3036,6490,6491,6494,6496,6498,6501,6503,6506,6508,6510,6513,6515,6517],{"class":3038,"line":3180},[3036,6492,6493],{"class":3050},"    answer",[3036,6495,3260],{"class":3046},[3036,6497,3441],{"class":3042},[3036,6499,6500],{"class":3050}," rl",[3036,6502,3186],{"class":3046},[3036,6504,6505],{"class":3122},"question",[3036,6507,3125],{"class":3134},[3036,6509,3073],{"class":3046},[3036,6511,6512],{"class":3069},"Approve this action? Enter yes to approve; anything else rejects: ",[3036,6514,3073],{"class":3046},[3036,6516,3215],{"class":3134},[3036,6518,3076],{"class":3046},[3036,6520,6521,6523,6526],{"class":3038,"line":3220},[3036,6522,3356],{"class":3046},[3036,6524,6525],{"class":3042}," finally",[3036,6527,3177],{"class":3046},[3036,6529,6530,6533,6535,6538,6540],{"class":3038,"line":3226},[3036,6531,6532],{"class":3050},"    rl",[3036,6534,3186],{"class":3046},[3036,6536,6537],{"class":3122},"close",[3036,6539,5678],{"class":3134},[3036,6541,3076],{"class":3046},[3036,6543,6544],{"class":3038,"line":3231},[3036,6545,4082],{"class":3046},[3036,6547,6548],{"class":3038,"line":3237},[3036,6549,3106],{"emptyLinePlaceholder":3105},[3036,6551,6552],{"class":3038,"line":3251},[3036,6553,6554],{"class":3158},"// Reject by default; approve only on an explicit yes\n",[3036,6556,6557,6559,6562,6564,6566,6569,6571,6573,6575,6577,6579,6581,6583,6585,6588,6590],{"class":3038,"line":3287},[3036,6558,4279],{"class":3112},[3036,6560,6561],{"class":3050}," decision ",[3036,6563,3119],{"class":3046},[3036,6565,3047],{"class":3046},[3036,6567,6568],{"class":3134}," type",[3036,6570,3025],{"class":3046},[3036,6572,3066],{"class":3046},[3036,6574,5848],{"class":3069},[3036,6576,3073],{"class":3046},[3036,6578,3054],{"class":3046},[3036,6580,3257],{"class":3134},[3036,6582,3025],{"class":3046},[3036,6584,3066],{"class":3046},[3036,6586,6587],{"class":3069},"The reviewer rejected the stock update",[3036,6589,3073],{"class":3046},[3036,6591,6592],{"class":3046}," };\n",[3036,6594,6595],{"class":3038,"line":3317},[3036,6596,3106],{"emptyLinePlaceholder":3105},[3036,6598,6599,6601,6604,6606,6609,6611,6613,6616,6618,6621,6623,6626,6628,6630],{"class":3038,"line":3322},[3036,6600,6100],{"class":3042},[3036,6602,6603],{"class":3050}," (answer",[3036,6605,3186],{"class":3046},[3036,6607,6608],{"class":3122},"trim",[3036,6610,5678],{"class":3050},[3036,6612,3186],{"class":3046},[3036,6614,6615],{"class":3122},"toLowerCase",[3036,6617,4516],{"class":3050},[3036,6619,6620],{"class":3046},"===",[3036,6622,3066],{"class":3046},[3036,6624,6625],{"class":3069},"yes",[3036,6627,3073],{"class":3046},[3036,6629,4378],{"class":3050},[3036,6631,3128],{"class":3046},[3036,6633,6634,6637,6639,6641,6643,6645,6647,6649,6651],{"class":3038,"line":3348},[3036,6635,6636],{"class":3050},"    decision",[3036,6638,3260],{"class":3046},[3036,6640,3047],{"class":3046},[3036,6642,6568],{"class":3134},[3036,6644,3025],{"class":3046},[3036,6646,3066],{"class":3046},[3036,6648,5839],{"class":3069},[3036,6650,3073],{"class":3046},[3036,6652,6592],{"class":3046},[3036,6654,6655],{"class":3038,"line":3353},[3036,6656,4082],{"class":3046},[3036,6658,6659],{"class":3038,"line":4452},[3036,6660,3106],{"emptyLinePlaceholder":3105},[3036,6662,6663,6665,6667,6669,6671,6673,6676,6678,6680,6683,6685,6688],{"class":3038,"line":4469},[3036,6664,3538],{"class":3050},[3036,6666,3186],{"class":3046},[3036,6668,3189],{"class":3122},[3036,6670,3125],{"class":3050},[3036,6672,3073],{"class":3046},[3036,6674,6675],{"class":3069},"Human decision:",[3036,6677,3073],{"class":3046},[3036,6679,3054],{"class":3046},[3036,6681,6682],{"class":3050}," decision",[3036,6684,3186],{"class":3046},[3036,6686,6687],{"class":3050},"type)",[3036,6689,3076],{"class":3046},[2891,6691,6692,6693,6695],{},"Run again and enter ",[2950,6694,6625],{},". The output should end with:",[3027,6697,6700],{"className":6698,"code":6699,"language":3610,"meta":3032},[3608],"Human decision: approve\n",[2950,6701,6699],{"__ignoreMap":3032},[2891,6703,6704,6705,6708,6709,6712],{},"Entering ",[2950,6706,6707],{},"no"," prints ",[2950,6710,6711],{},"Human decision: reject",". This only obtains the decision; the agent has not resumed, so stock is unchanged.",[3851,6714,6716],{"id":6715},"resume-the-agent","Resume the Agent",[2891,6718,6719,6720,6723],{},"We now have ",[2950,6721,6722],{},"decision",", but the agent remains paused and stock is unchanged. Pass the decision to the agent so it can continue from the pause point.",[2891,6725,6726,6727,6730,6731,6734],{},"LangGraph provides ",[2950,6728,6729],{},"Command"," to control agent execution. Here, ",[2950,6732,6733],{},"resume"," resumes the task and supplies the reviewer’s decision.",[2891,6736,3375],{},[3027,6738,6740],{"className":3029,"code":6739,"language":3031,"meta":3032,"style":3032},"const command = new Command({\n    resume: {\n        decisions: [decision],\n    },\n});\n",[2950,6741,6742,6759,6768,6780,6784],{"__ignoreMap":3032},[3036,6743,6744,6746,6749,6751,6753,6755,6757],{"class":3038,"line":3039},[3036,6745,3113],{"class":3112},[3036,6747,6748],{"class":3050}," command ",[3036,6750,3119],{"class":3046},[3036,6752,4388],{"class":3046},[3036,6754,5466],{"class":3122},[3036,6756,3125],{"class":3050},[3036,6758,3128],{"class":3046},[3036,6760,6761,6764,6766],{"class":3038,"line":3079},[3036,6762,6763],{"class":3134},"    resume",[3036,6765,3025],{"class":3046},[3036,6767,3177],{"class":3046},[3036,6769,6770,6773,6775,6778],{"class":3038,"line":3102},[3036,6771,6772],{"class":3134},"        decisions",[3036,6774,3025],{"class":3046},[3036,6776,6777],{"class":3050}," [decision]",[3036,6779,3147],{"class":3046},[3036,6781,6782],{"class":3038,"line":3109},[3036,6783,3223],{"class":3046},[3036,6785,6786,6788,6790],{"class":3038,"line":3131},[3036,6787,3356],{"class":3046},[3036,6789,3215],{"class":3050},[3036,6791,3076],{"class":3046},[2891,6793,6794,6797,6798,3186],{},[2950,6795,6796],{},"decisions"," is an array because a pause may include multiple pending tool requests. This example has just one stock update request, so it supplies one ",[2950,6799,6722],{},[2891,6801,6802,6803,6806],{},"Call ",[2950,6804,6805],{},"invoke()"," to resume the task:",[3027,6808,6810],{"className":3029,"code":6809,"language":3031,"meta":3032,"style":3032},"// Resume with the original conversation configuration\nconst result = await agent.invoke(command, config);\n\nconsole.log('Stock after resuming:', stock);\n",[2950,6811,6812,6817,6843,6847],{"__ignoreMap":3032},[3036,6813,6814],{"class":3038,"line":3039},[3036,6815,6816],{"class":3158},"// Resume with the original conversation configuration\n",[3036,6818,6819,6821,6823,6825,6827,6829,6831,6833,6836,6838,6841],{"class":3038,"line":3079},[3036,6820,3113],{"class":3112},[3036,6822,3436],{"class":3050},[3036,6824,3119],{"class":3046},[3036,6826,3441],{"class":3042},[3036,6828,3444],{"class":3050},[3036,6830,3186],{"class":3046},[3036,6832,3449],{"class":3122},[3036,6834,6835],{"class":3050},"(command",[3036,6837,3054],{"class":3046},[3036,6839,6840],{"class":3050}," config)",[3036,6842,3076],{"class":3046},[3036,6844,6845],{"class":3038,"line":3102},[3036,6846,3106],{"emptyLinePlaceholder":3105},[3036,6848,6849,6851,6853,6855,6857,6859,6862,6864,6866,6868],{"class":3038,"line":3109},[3036,6850,3538],{"class":3050},[3036,6852,3186],{"class":3046},[3036,6854,3189],{"class":3122},[3036,6856,3125],{"class":3050},[3036,6858,3073],{"class":3046},[3036,6860,6861],{"class":3069},"Stock after resuming:",[3036,6863,3073],{"class":3046},[3036,6865,3054],{"class":3046},[3036,6867,6089],{"class":3050},[3036,6869,3076],{"class":3046},[2891,6871,6872,6873,6875],{},"This is a second ",[2950,6874,6805],{}," call. The two calls have different purposes:",[2926,6877,6878,6888],{},[2929,6879,6880],{},[2932,6881,6882,6885],{},[2935,6883,6884],{},"Call",[2935,6886,6887],{},"Purpose",[2942,6889,6890,6900],{},[2932,6891,6892,6897],{},[2947,6893,6894],{},[2950,6895,6896],{},"agent.invoke({ messages: [...] }, config)",[2947,6898,6899],{},"Start the task and pause at a tool requiring human approval",[2932,6901,6902,6907],{},[2947,6903,6904],{},[2950,6905,6906],{},"agent.invoke(command, config)",[2947,6908,6909],{},"Submit the human decision and resume the paused task",[2891,6911,6912,6913,6916],{},"Both calls must use the same ",[2950,6914,6915],{},"thread_id"," so the framework can find saved state through the checkpointer. Approval executes the stock update tool. Rejection skips it and sends the rejection information back to the model.",[2891,6918,6919],{},"Finally, add the following to check whether the task ended and inspect the model’s answer:",[3027,6921,6923],{"className":3029,"code":6922,"language":3031,"meta":3032,"style":3032},"if (result.__interrupt__?.length) {\n    console.log('Task paused again. Further approval is required.');\n} else {\n    console.log('Final answer:', result.messages.at(-1)?.content);\n}\n",[2950,6924,6925,6943,6964,6973,7017],{"__ignoreMap":3032},[3036,6926,6927,6929,6932,6934,6936,6938,6941],{"class":3038,"line":3039},[3036,6928,6100],{"class":3042},[3036,6930,6931],{"class":3050}," (result",[3036,6933,3186],{"class":3046},[3036,6935,6360],{"class":3050},[3036,6937,3299],{"class":3046},[3036,6939,6940],{"class":3050},"length) ",[3036,6942,3128],{"class":3046},[3036,6944,6945,6947,6949,6951,6953,6955,6958,6960,6962],{"class":3038,"line":3079},[3036,6946,3976],{"class":3050},[3036,6948,3186],{"class":3046},[3036,6950,3189],{"class":3122},[3036,6952,3125],{"class":3134},[3036,6954,3073],{"class":3046},[3036,6956,6957],{"class":3069},"Task paused again. Further approval is required.",[3036,6959,3073],{"class":3046},[3036,6961,3215],{"class":3134},[3036,6963,3076],{"class":3046},[3036,6965,6966,6968,6971],{"class":3038,"line":3102},[3036,6967,3356],{"class":3046},[3036,6969,6970],{"class":3042}," else",[3036,6972,3177],{"class":3046},[3036,6974,6975,6977,6979,6981,6983,6985,6987,6989,6991,6993,6995,6997,6999,7001,7003,7005,7007,7009,7011,7013,7015],{"class":3038,"line":3109},[3036,6976,3976],{"class":3050},[3036,6978,3186],{"class":3046},[3036,6980,3189],{"class":3122},[3036,6982,3125],{"class":3134},[3036,6984,3073],{"class":3046},[3036,6986,3549],{"class":3069},[3036,6988,3073],{"class":3046},[3036,6990,3054],{"class":3046},[3036,6992,3556],{"class":3050},[3036,6994,3186],{"class":3046},[3036,6996,3207],{"class":3050},[3036,6998,3186],{"class":3046},[3036,7000,3271],{"class":3122},[3036,7002,3125],{"class":3134},[3036,7004,3276],{"class":3046},[3036,7006,3280],{"class":3279},[3036,7008,3215],{"class":3134},[3036,7010,3299],{"class":3046},[3036,7012,4013],{"class":3050},[3036,7014,3215],{"class":3134},[3036,7016,3076],{"class":3046},[3036,7018,7019],{"class":3038,"line":3131},[3036,7020,4082],{"class":3046},[2891,7022,7023],{},"Run the complete script again:",[3027,7025,7026],{"className":3585,"code":6334,"language":3587,"meta":3032,"style":3032},[2950,7027,7028],{"__ignoreMap":3032},[3036,7029,7030,7032,7034],{"class":3038,"line":3039},[3036,7031,3595],{"class":3594},[3036,7033,3598],{"class":3069},[3036,7035,6345],{"class":3069},[2891,7037,6704,7038,7040],{},[2950,7039,6625],{}," may produce:",[3027,7042,7045],{"className":7043,"code":7044,"language":3610,"meta":3032},[3608],"Stock before approval: 12\nTool awaiting approval: update_stock\nAction arguments: { quantity: 20 }\nApprove this action? Enter yes to approve; anything else rejects: yes\nHuman decision: approve\nStock after resuming: 20\nFinal answer: Stock has been updated to 20 units.\n",[2950,7046,7044],{"__ignoreMap":3032},[2891,7048,7049,7050,7052],{},"Run the script again and enter ",[2950,7051,6707],{},". You may see:",[3027,7054,7057],{"className":7055,"code":7056,"language":3610,"meta":3032},[3608],"Stock before approval: 12\nTool awaiting approval: update_stock\nAction arguments: { quantity: 20 }\nApprove this action? Enter yes to approve; anything else rejects: no\nHuman decision: reject\nStock after resuming: 12\nFinal answer: The stock update was rejected.\n",[2950,7058,7056],{"__ignoreMap":3032},[2891,7060,7061,7062,7064],{},"Check ",[2950,7063,5600],{}," for the actual effect. If the model requests another update, the task pauses again for a new human decision instead of executing automatically.",[2891,7066,7067],{},"Human approval does not replace business access controls. Production systems must also validate the reviewer’s identity, target object, and permissions, then recheck business conditions before writing.",[2895,7069],{},[2886,7071,7073],{"id":7072},"questions-and-answers","❓ Questions and Answers",[2891,7075,7076],{},[2911,7077,7078],{},"Q1: Is a tool retry the same as the agent calling the tool again?",[2891,7080,7081],{},"No. Middleware retries happen within one tool request under an application-defined policy. A repeated agent tool call requires a new model request based on existing results. Both can produce real business actions, so limit them separately.",[2895,7083],{},[2886,7085,7087],{"id":7086},"exercises","🧪 Exercises",[2891,7089,7090,7091,7093,7094,7097,7098,7100],{},"In ",[2950,7092,4169],{},", change the simulated failure condition to ",[2950,7095,7096],{},"attempts \u003C= 2",", keeping ",[2950,7099,4835],{},". Run the script and check that the tool executes only twice and ends in failure. Restore the original example afterward.",[2895,7102],{},[2891,7104,7105],{},"🎉 Congratulations! You can now add execution controls to an agent. Next, explore custom workflow orchestration with LangGraph.",[7107,7108,7109],"style",{},"html pre.shiki code .s8pZq, html code.shiki .s8pZq{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s86vT, html code.shiki .s86vT{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sndM8, html code.shiki .sndM8{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sIEYB, html code.shiki .sIEYB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s50WR, html code.shiki .s50WR{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swgpB, html code.shiki .swgpB{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sd2Uz, html code.shiki .sd2Uz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .syuKq, html code.shiki .syuKq{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sK9QF, html code.shiki .sK9QF{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .smPcV, html code.shiki .smPcV{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sYGMc, html code.shiki .sYGMc{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":3032,"searchDepth":3079,"depth":3079,"links":7111},[7112,7113,7114,7115,7119,7120,7121,7127,7128],{"id":2888,"depth":3079,"text":2889},{"id":2899,"depth":3079,"text":2900},{"id":3013,"depth":3079,"text":3014},{"id":3623,"depth":3079,"text":3624,"children":7116},[7117,7118],{"id":3853,"depth":3102,"text":3854},{"id":4108,"depth":3102,"text":4109},{"id":4159,"depth":3079,"text":4160},{"id":4852,"depth":3079,"text":4853},{"id":5402,"depth":3079,"text":5403,"children":7122},[7123,7124,7125,7126],{"id":5416,"depth":3102,"text":5417},{"id":5895,"depth":3102,"text":5896},{"id":6367,"depth":3102,"text":6368},{"id":6715,"depth":3102,"text":6716},{"id":7072,"depth":3079,"text":7073},{"id":7086,"depth":3079,"text":7087},"Use agent middleware to observe execution, retry transient tool failures, limit calls, manage context, and require human approval for sensitive operations.","md",null,{},{"title":2827},{"title":7135,"description":7129},"LangChain agent middleware and execution controls","tJ0aOu7hD5",[7138,7140],{"title":2823,"path":2824,"stem":2825,"description":7139,"children":-1},"Save and read information across conversations with a store, and isolate user memories using trusted user IDs.",{"title":2842,"path":2838,"stem":2839,"description":7141,"children":-1},"Understand LangGraph's core concepts, execution model, and use cases.",1795886698979]