@botpress/adk-cli 1.19.0-beta.3 → 1.19.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/ui-dist/assets/{index-CSTz-oTK.js → index-B3b7PPgV.js} +4 -4
- package/{dist/index-DNqXHLNi-27nvpkee.js → assets/ui-dist/assets/index-BESZeTO5.js} +2 -2
- package/{dist/index-DAztRXeA-vr85xnxs.css → assets/ui-dist/assets/index-DIFGtVmI.css} +1 -1
- package/{dist/index-DfjXY3Oo-szsanhnt.js → assets/ui-dist/assets/index-a3ZL0_Jr.js} +2 -2
- package/assets/ui-dist/index.html +2 -2
- package/dist/{README-wjb7z7f0.md → README-824wa4jj.md} +1 -1
- package/dist/SKILL-75ym6tcj.md +257 -0
- package/dist/SKILL-chnwzmt1.md +548 -0
- package/dist/SKILL-d4bs53y3.md +244 -0
- package/dist/SKILL-h4b2f1n9.md +114 -0
- package/dist/SKILL-hbw5nt95.md +111 -0
- package/dist/actions-h7hxxvxr.md +823 -0
- package/dist/adk-build-emhwd0tg.md +39 -0
- package/dist/adk-debug-yrrdtpmb.md +23 -0
- package/dist/adk-dev-console-7z9rtjpy.md +17 -0
- package/dist/adk-document-ras6zzzh.md +68 -0
- package/dist/adk-eval-vx76dwq0.md +17 -0
- package/dist/adk-explain-fcsaw852.md +22 -0
- package/dist/adk-init-9kmxmbbe.md +30 -0
- package/dist/adk-ship-dybzn884.md +29 -0
- package/dist/adk-test-xq67savs.md +27 -0
- package/dist/adk-validate-1p4skv4m.md +31 -0
- package/dist/advanced-patterns-z86m9h1a.md +669 -0
- package/dist/agent-config-1aqvkrgf.md +450 -0
- package/dist/agent-steps-zj4c1n9t.md +115 -0
- package/dist/agent0-assets/skills/adk/SKILL.md +5 -5
- package/dist/agent0-assets/skills/adk/references/cli.md +265 -24
- package/dist/agent0-assets/skills/adk-debugger/SKILL.md +5 -5
- package/dist/agent0-assets/skills/adk-debugger/references/common-failures.md +1 -1
- package/dist/agent0-assets/skills/adk-debugger/references/debug-workflow.md +3 -3
- package/dist/agent0-assets/skills/adk-debugger/references/traces-and-logs.md +15 -7
- package/dist/assets-q7jt8r2q.md +237 -0
- package/dist/autonomous-execution-fymc12e5.md +747 -0
- package/dist/cli-c31e06yr.md +1334 -0
- package/dist/cli.js +963 -548
- package/dist/commands.json +24 -3
- package/dist/common-failures-ht29w2db.md +231 -0
- package/dist/component-registry-bbpw0see.md +43 -0
- package/dist/context-api-760cvh0h.md +461 -0
- package/dist/conversation-analysis-8ka4nrm4.md +420 -0
- package/dist/conversation-lifecycle-4seqqjc1.md +311 -0
- package/dist/conversations-gwfvxaee.md +1111 -0
- package/dist/custom-components-y5wdgpey.md +167 -0
- package/dist/debug-workflow-vz84q80v.md +239 -0
- package/dist/desk-k54ktvsd.md +852 -0
- package/dist/doc-standards-ck6ax2jd.md +124 -0
- package/dist/eval-format-7n9brja4.md +354 -0
- package/dist/evals-y1zcr1mc.md +11 -0
- package/dist/explain-config-1yaq3zzd.md +424 -0
- package/dist/files-dzt0wxn3.md +918 -0
- package/dist/{index-gqxgqnyz.html → index-3t354nbw.html} +2 -2
- package/dist/{index-CSTz-oTK-mdfh47r8.js → index-B3b7PPgV-zetkb01w.js} +4 -4
- package/{assets/ui-dist/assets/index-DNqXHLNi.js → dist/index-BESZeTO5-2rpmcefa.js} +2 -2
- package/{assets/ui-dist/assets/index-DAztRXeA.css → dist/index-DIFGtVmI-d4dhjg97.css} +1 -1
- package/{assets/ui-dist/assets/index-DfjXY3Oo.js → dist/index-a3ZL0_Jr-q145h35p.js} +2 -2
- package/dist/integration-actions-xang7tma.md +659 -0
- package/dist/integrations-k5ss07f4.md +266 -0
- package/dist/interfaces-6t0bpxs4.md +97 -0
- package/dist/knowledge-bases-20rg8p5c.md +456 -0
- package/dist/llm-debugging-76ng8rzm.md +209 -0
- package/dist/mcp-server-n1asyzhv.md +112 -0
- package/dist/messages-gkkg0b54.md +769 -0
- package/dist/model-configuration-f273kgd0.md +201 -0
- package/dist/multi-agent-dashboard-1mdfjdts.md +70 -0
- package/dist/pages-xn18xn73.md +273 -0
- package/dist/patterns-mistakes-5vb99dhf.md +469 -0
- package/dist/plugins-ttnx8f49.md +280 -0
- package/dist/tables-x45t36dd.md +1136 -0
- package/dist/tags-46td3qrg.md +516 -0
- package/dist/test-patterns-hj47w4nc.md +355 -0
- package/dist/testing-workflow-2vkp932f.md +225 -0
- package/dist/tools-wk7bq24z.md +581 -0
- package/dist/trace-summarization-hdyx1c2e.md +313 -0
- package/dist/traces-and-logs-f2kjfh19.md +203 -0
- package/dist/triggers-4j2cc86x.md +719 -0
- package/dist/ui-server-entry.js +977 -162
- package/dist/workflow-steps-mrdrf1c5.md +851 -0
- package/dist/workflows-gadx3s69.md +1408 -0
- package/dist/zai-agent-reference-e6644aad.md +454 -0
- package/dist/zai-complete-guide-mnna5d6f.md +1408 -0
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,W as R}from"./index-
|
|
1
|
+
import{r as a,W as R}from"./index-B3b7PPgV.js";function oe(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t){if(e==null)return{};var r,n,o=je(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function je(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Me(e,t){return me(e)||ye(e,t)||Ee(e,t)||we()}function Pe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Ee(e,t){if(e){if(typeof e=="string")return oe(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ue(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ie(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function A(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function U(e){return{}.toString.call(e).includes("Object")}function Te(e){return!Object.keys(e).length}function D(e){return typeof e=="function"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Le(e,t){return U(t)||P("changeType"),Object.keys(t).some(function(r){return!Ce(e,r)})&&P("changeField"),t}function Ae(e){D(e)||P("selectorType")}function $e(e){D(e)||U(e)||P("handlerType"),U(e)&&Object.values(e).some(function(t){return!D(t)})&&P("handlersType")}function De(e){e||P("initialIsRequired"),U(e)||P("initialType"),Te(e)&&P("initialContent")}function Ve(e,t){throw new Error(e[t]||e.default)}var xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},P=A(Ve)(xe),q={changes:Le,selector:Ae,handler:$e,initial:De};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};q.initial(e),q.handler(t);var r={current:e},n=A(Ue)(r,t),o=A(ze)(r),i=A(q.changes)(e),c=A(qe)(r);function s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(j){return j};return q.selector(p),p(r.current)}function f(p){Ie(n,o,i,c)(p)}return[s,f]}function qe(e,t){return D(t)?t(e.current):t}function ze(e,t){return e.current=ce(ce({},e.current),t),t}function Ue(e,t,r){return D(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Fe={create:Ne},We={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function He(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function _e(e){return{}.toString.call(e).includes("Object")}function Be(e){return e||le("configIsRequired"),_e(e)||le("configType"),e.urls?(Ke(),{paths:{vs:e.urls.monacoBase}}):e}function Ke(){console.warn(se.deprecation)}function Ge(e,t){throw new Error(e[t]||e.default)}var se={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|
|
@@ -9,4 +9,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
9
9
|
|
|
10
10
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
11
11
|
`},le=He(Ge)(se),Ye={config:Be},Je=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,c){return c(i)},o)}};function fe(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],fe(e[r],t[r]))}),ae(ae({},e),t)}var Qe={type:"cancelation",msg:"operation is manually canceled"};function Z(e){var t=!1,r=new Promise(function(n,o){e.then(function(i){return t?o(Qe):n(i)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var Xe=["monaco"],Ze=Fe.create({config:We,isInitialized:!1,resolve:null,reject:null,monaco:null}),de=Me(Ze,2),V=de[0],W=de[1];function ke(e){var t=Ye.config(e),r=t.monaco,n=Oe(t,Xe);W(function(o){return{config:fe(o.config,n),monaco:r}})}function et(){var e=V(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(W({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Z(k);if(window.monaco&&window.monaco.editor)return pe(window.monaco),e.resolve(window.monaco),Z(k);Je(tt,nt)(ot)}return Z(k)}function tt(e){return document.body.appendChild(e)}function rt(e){var t=document.createElement("script");return e&&(t.src=e),t}function nt(e){var t=V(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=rt("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function ot(){var e=V(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var n=r.m||r;pe(n),e.resolve(n)},function(r){e.reject(r)})}function pe(e){V().monaco||W({monaco:e})}function it(){return V(function(e){var t=e.monaco;return t})}var k=new Promise(function(e,t){return W({resolve:e,reject:t})}),F={config:ke,init:et,__getMonacoInstance:it},at={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ee=at,ut={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ct=ut;function lt({children:e}){return R.createElement("div",{style:ct.container},e)}var st=lt,ft=st;function dt({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:c}){return R.createElement("section",{style:{...ee.wrapper,width:e,height:t},...c},!r&&R.createElement(ft,null,n),R.createElement("div",{ref:o,style:{...ee.fullWidth,...!r&&ee.hide},className:i}))}var pt=dt,ge=a.memo(pt);function gt(e){a.useEffect(e,[])}var te=gt;function ht(e,t,r=!0){let n=a.useRef(!0);a.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var w=ht;function $(){}function E(e,t,r,n){return vt(e,n)||mt(e,t,r,n)}function vt(e,t){return e.editor.getModel(he(e,t))}function mt(e,t,r,n){return e.editor.createModel(t,r,n?he(e,n):void 0)}function he(e,t){return e.Uri.parse(t)}function bt({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:f=!1,theme:p="light",loading:j="Loading...",options:O={},height:H="100%",width:_="100%",className:B,wrapperProps:K={},beforeMount:G=$,onMount:Y=$}){let[y,I]=a.useState(!1),[T,g]=a.useState(!0),h=a.useRef(null),d=a.useRef(null),C=a.useRef(null),m=a.useRef(Y),u=a.useRef(G),S=a.useRef(!1);te(()=>{let l=F.init();return l.then(v=>(d.current=v)&&g(!1)).catch(v=>v?.type!=="cancelation"&&console.error("Monaco initialization: error:",v)),()=>h.current?L():l.cancel()}),w(()=>{if(h.current&&d.current){let l=h.current.getOriginalEditor(),v=E(d.current,e||"",n||r||"text",i||"");v!==l.getModel()&&l.setModel(v)}},[i],y),w(()=>{if(h.current&&d.current){let l=h.current.getModifiedEditor(),v=E(d.current,t||"",o||r||"text",c||"");v!==l.getModel()&&l.setModel(v)}},[c],y),w(()=>{let l=h.current.getModifiedEditor();l.getOption(d.current.editor.EditorOption.readOnly)?l.setValue(t||""):t!==l.getValue()&&(l.executeEdits("",[{range:l.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),l.pushUndoStop())},[t],y),w(()=>{h.current?.getModel()?.original.setValue(e||"")},[e],y),w(()=>{let{original:l,modified:v}=h.current.getModel();d.current.editor.setModelLanguage(l,n||r||"text"),d.current.editor.setModelLanguage(v,o||r||"text")},[r,n,o],y),w(()=>{d.current?.editor.setTheme(p)},[p],y),w(()=>{h.current?.updateOptions(O)},[O],y);let x=a.useCallback(()=>{if(!d.current)return;u.current(d.current);let l=E(d.current,e||"",n||r||"text",i||""),v=E(d.current,t||"",o||r||"text",c||"");h.current?.setModel({original:l,modified:v})},[r,t,o,e,n,i,c]),N=a.useCallback(()=>{!S.current&&C.current&&(h.current=d.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...O}),x(),d.current?.editor.setTheme(p),I(!0),S.current=!0)},[O,p,x]);a.useEffect(()=>{y&&m.current(h.current,d.current)},[y]),a.useEffect(()=>{!T&&!y&&N()},[T,y,N]);function L(){let l=h.current?.getModel();s||l?.original?.dispose(),f||l?.modified?.dispose(),h.current?.dispose()}return R.createElement(ge,{width:_,height:H,isEditorReady:y,loading:j,_ref:C,className:B,wrapperProps:K})}var yt=bt,Rt=a.memo(yt);function wt(){let[e,t]=a.useState(F.__getMonacoInstance());return te(()=>{let r;return e||(r=F.init(),r.then(n=>{t(n)})),()=>r?.cancel()}),e}var It=wt;function Ot(e){let t=a.useRef();return a.useEffect(()=>{t.current=e},[e]),t.current}var jt=Ot,z=new Map;function Mt({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:c="light",line:s,loading:f="Loading...",options:p={},overrideServices:j={},saveViewState:O=!0,keepCurrentModel:H=!1,width:_="100%",height:B="100%",className:K,wrapperProps:G={},beforeMount:Y=$,onMount:y=$,onChange:I,onValidate:T=$}){let[g,h]=a.useState(!1),[d,C]=a.useState(!0),m=a.useRef(null),u=a.useRef(null),S=a.useRef(null),x=a.useRef(y),N=a.useRef(Y),L=a.useRef(),l=a.useRef(n),v=jt(i),re=a.useRef(!1),J=a.useRef(!1);te(()=>{let b=F.init();return b.then(M=>(m.current=M)&&C(!1)).catch(M=>M?.type!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>u.current?ve():b.cancel()}),w(()=>{let b=E(m.current,e||n||"",t||o||"",i||r||"");b!==u.current?.getModel()&&(O&&z.set(v,u.current?.saveViewState()),u.current?.setModel(b),O&&u.current?.restoreViewState(z.get(i)))},[i],g),w(()=>{u.current?.updateOptions(p)},[p],g),w(()=>{!u.current||n===void 0||(u.current.getOption(m.current.editor.EditorOption.readOnly)?u.current.setValue(n):n!==u.current.getValue()&&(J.current=!0,u.current.executeEdits("",[{range:u.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),u.current.pushUndoStop(),J.current=!1))},[n],g),w(()=>{let b=u.current?.getModel();b&&o&&m.current?.editor.setModelLanguage(b,o)},[o],g),w(()=>{s!==void 0&&u.current?.revealLine(s)},[s],g),w(()=>{m.current?.editor.setTheme(c)},[c],g);let ne=a.useCallback(()=>{if(!(!S.current||!m.current)&&!re.current){N.current(m.current);let b=i||r,M=E(m.current,n||e||"",t||o||"",b||"");u.current=m.current?.editor.create(S.current,{model:M,automaticLayout:!0,...p},j),O&&u.current.restoreViewState(z.get(b)),m.current.editor.setTheme(c),s!==void 0&&u.current.revealLine(s),h(!0),re.current=!0}},[e,t,r,n,o,i,p,j,O,c,s]);a.useEffect(()=>{g&&x.current(u.current,m.current)},[g]),a.useEffect(()=>{!d&&!g&&ne()},[d,g,ne]),l.current=n,a.useEffect(()=>{g&&I&&(L.current?.dispose(),L.current=u.current?.onDidChangeModelContent(b=>{J.current||I(u.current.getValue(),b)}))},[g,I]),a.useEffect(()=>{if(g){let b=m.current.editor.onDidChangeMarkers(M=>{let Q=u.current.getModel()?.uri;if(Q&&M.find(X=>X.path===Q.path)){let X=m.current.editor.getModelMarkers({resource:Q});T?.(X)}});return()=>{b?.dispose()}}return()=>{}},[g,T]);function ve(){L.current?.dispose(),H?O&&z.set(i,u.current.saveViewState()):u.current.getModel()?.dispose(),u.current.dispose()}return R.createElement(ge,{width:_,height:B,isEditorReady:g,loading:f,_ref:S,className:K,wrapperProps:G})}var Pt=Mt,St=a.memo(Pt),Tt=St;export{Rt as DiffEditor,St as Editor,Tt as default,F as loader,It as useMonaco};
|
|
12
|
-
//# sourceMappingURL=index-
|
|
12
|
+
//# sourceMappingURL=index-a3ZL0_Jr.js.map
|
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
# Integration Actions
|
|
2
|
+
|
|
3
|
+
Call actions from installed integrations using a simple, type-safe API.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { actions } from "@botpress/runtime";
|
|
9
|
+
|
|
10
|
+
// Call integration action
|
|
11
|
+
const { items } = await actions.linear.issueList({
|
|
12
|
+
first: 10,
|
|
13
|
+
filter: { state: { name: { eq: "In Progress" } } }
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
Integration actions allow you to call functionality from installed integrations (Slack, Linear, GitHub, etc.) using a unified, type-safe API. Each integration exposes actions that map to its capabilities.
|
|
20
|
+
|
|
21
|
+
**Pattern:**
|
|
22
|
+
```typescript
|
|
23
|
+
await actions.{integration}.{actionName}(params);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Available in:**
|
|
27
|
+
- Actions
|
|
28
|
+
- Tools
|
|
29
|
+
- Workflows
|
|
30
|
+
- Conversations
|
|
31
|
+
- Triggers
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
Before using integration actions, add the integration to your project:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Add integration
|
|
39
|
+
adk integrations add slack@2.5.5
|
|
40
|
+
|
|
41
|
+
# Or with custom alias
|
|
42
|
+
adk integrations add linear@2.0.0 --alias my-linear
|
|
43
|
+
|
|
44
|
+
# Start dev to configure
|
|
45
|
+
adk dev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Then configure the integration in the Dev Console at `localhost:3001` or via `adk integrations configure`.
|
|
49
|
+
|
|
50
|
+
## Basic Usage
|
|
51
|
+
|
|
52
|
+
### Importing Actions
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { actions } from "@botpress/runtime";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Calling Actions
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Slack - Send message
|
|
62
|
+
await actions.slack.sendMessage({
|
|
63
|
+
channel: "#general",
|
|
64
|
+
text: "Hello from bot!"
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Linear - List issues
|
|
68
|
+
const { items } = await actions.linear.issueList({
|
|
69
|
+
first: 10,
|
|
70
|
+
filter: { state: { name: { eq: "In Progress" } } }
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// GitHub - Create issue
|
|
74
|
+
await actions.github.createIssue({
|
|
75
|
+
owner: "myorg",
|
|
76
|
+
repo: "myrepo",
|
|
77
|
+
title: "Bug report",
|
|
78
|
+
body: "Issue description"
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Alternative: Bracket Notation
|
|
83
|
+
|
|
84
|
+
Use bracket notation when integration names contain special characters or when accessing them dynamically:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// Useful for dynamic integration names
|
|
88
|
+
const integrationName = "intercom";
|
|
89
|
+
await actions[integrationName].getConversation({
|
|
90
|
+
intercomConversationId: "conv_123"
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Or when the integration name has special characters
|
|
94
|
+
await actions["my-integration"].someAction({
|
|
95
|
+
param: "value"
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Type Safety
|
|
100
|
+
|
|
101
|
+
All integration actions are fully typed with TypeScript:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
type LinearIssue = Awaited<ReturnType<typeof actions.linear.getIssue>>;
|
|
105
|
+
|
|
106
|
+
// TypeScript knows the exact shape of the result
|
|
107
|
+
const issue = await actions.linear.getIssue({ id: "ISS-123" });
|
|
108
|
+
// issue.title, issue.description, issue.state, etc. are all typed
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Converting to AI Tools
|
|
112
|
+
|
|
113
|
+
Integration actions can be converted to AI-callable tools using `.asTool()`:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
await execute({
|
|
117
|
+
instructions: "Help the user browse the web",
|
|
118
|
+
tools: [
|
|
119
|
+
// Convert integration action to tool
|
|
120
|
+
actions.browser.captureScreenshot.asTool(),
|
|
121
|
+
|
|
122
|
+
// Mix with custom tools
|
|
123
|
+
customSearchTool,
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**How it works:**
|
|
129
|
+
- The action's input/output schemas become the tool's parameters
|
|
130
|
+
- The action's description (if any) helps the AI understand when to use it
|
|
131
|
+
- The AI can call the tool during autonomous execution
|
|
132
|
+
|
|
133
|
+
## Common Integration Actions
|
|
134
|
+
|
|
135
|
+
### Slack Integration
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// Send message
|
|
139
|
+
await actions.slack.sendMessage({
|
|
140
|
+
channel: "#general",
|
|
141
|
+
text: "Hello!",
|
|
142
|
+
blocks: [
|
|
143
|
+
{
|
|
144
|
+
type: "section",
|
|
145
|
+
text: { type: "mrkdwn", text: "*Hello* from bot!" }
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Add reaction
|
|
151
|
+
await actions.slack.addReaction({
|
|
152
|
+
channel: "C123456",
|
|
153
|
+
timestamp: "1234567890.123456",
|
|
154
|
+
name: "thumbsup"
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Upload file
|
|
158
|
+
await actions.slack.uploadFile({
|
|
159
|
+
channels: ["#general"],
|
|
160
|
+
file: fileBuffer,
|
|
161
|
+
filename: "report.pdf",
|
|
162
|
+
title: "Monthly Report"
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Linear Integration
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
// List issues with filters
|
|
170
|
+
const { items, meta } = await actions.linear.issueList({
|
|
171
|
+
first: 50,
|
|
172
|
+
filter: {
|
|
173
|
+
state: { name: { eq: "In Progress" } },
|
|
174
|
+
assignee: { email: { eq: "user@example.com" } }
|
|
175
|
+
},
|
|
176
|
+
orderBy: { createdAt: "desc" }
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// Get specific issue
|
|
180
|
+
const issue = await actions.linear.getIssue({
|
|
181
|
+
id: "ISS-123"
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Create issue
|
|
185
|
+
await actions.linear.issueCreate({
|
|
186
|
+
teamId: "team_123",
|
|
187
|
+
title: "New feature request",
|
|
188
|
+
description: "Detailed description",
|
|
189
|
+
priority: 1,
|
|
190
|
+
assigneeId: "user_456"
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// Update issue
|
|
194
|
+
await actions.linear.issueUpdate({
|
|
195
|
+
id: "ISS-123",
|
|
196
|
+
stateId: "state_done"
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Browser Integration
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// Browse pages (web scraping)
|
|
204
|
+
const { results } = await actions.browser.browsePages({
|
|
205
|
+
urls: ["https://docs.example.com"],
|
|
206
|
+
extractType: "markdown",
|
|
207
|
+
maxPages: 10
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// Web search
|
|
211
|
+
const output = await actions.browser.webSearch({
|
|
212
|
+
query: "Botpress ADK documentation",
|
|
213
|
+
maxResults: 5
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Capture screenshot
|
|
217
|
+
const screenshot = await actions.browser.captureScreenshot({
|
|
218
|
+
url: "https://example.com",
|
|
219
|
+
fullPage: true,
|
|
220
|
+
format: "png"
|
|
221
|
+
});
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### GitHub Integration
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
// Create issue
|
|
228
|
+
await actions.github.createIssue({
|
|
229
|
+
owner: "myorg",
|
|
230
|
+
repo: "myrepo",
|
|
231
|
+
title: "Bug: Login not working",
|
|
232
|
+
body: "Steps to reproduce:\n1. ...",
|
|
233
|
+
labels: ["bug", "priority-high"]
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// Get repository
|
|
237
|
+
const repo = await actions.github.getRepository({
|
|
238
|
+
owner: "myorg",
|
|
239
|
+
repo: "myrepo"
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Create pull request
|
|
243
|
+
await actions.github.createPullRequest({
|
|
244
|
+
owner: "myorg",
|
|
245
|
+
repo: "myrepo",
|
|
246
|
+
title: "Fix login issue",
|
|
247
|
+
head: "feature-branch",
|
|
248
|
+
base: "main",
|
|
249
|
+
body: "This PR fixes the login issue"
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Discord Integration
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
// Send message
|
|
257
|
+
await actions.discord.sendMessage({
|
|
258
|
+
channelId: "123456789",
|
|
259
|
+
content: "Hello from bot!",
|
|
260
|
+
embeds: [
|
|
261
|
+
{
|
|
262
|
+
title: "Notification",
|
|
263
|
+
description: "Your task is complete",
|
|
264
|
+
color: 0x00ff00
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// Add reaction
|
|
270
|
+
await actions.discord.addReaction({
|
|
271
|
+
channelId: "123456789",
|
|
272
|
+
messageId: "987654321",
|
|
273
|
+
emoji: "✅"
|
|
274
|
+
});
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### WhatsApp Integration
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
// Send text message
|
|
281
|
+
await actions.whatsapp.sendMessage({
|
|
282
|
+
to: "+1234567890",
|
|
283
|
+
type: "text",
|
|
284
|
+
text: { body: "Hello from bot!" }
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// Send template message
|
|
288
|
+
await actions.whatsapp.sendTemplate({
|
|
289
|
+
to: "+1234567890",
|
|
290
|
+
template: {
|
|
291
|
+
name: "order_confirmation",
|
|
292
|
+
language: { code: "en" },
|
|
293
|
+
components: [
|
|
294
|
+
{
|
|
295
|
+
type: "body",
|
|
296
|
+
parameters: [{ type: "text", text: "12345" }]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Intercom Integration
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
// Send admin message with attachments
|
|
307
|
+
await actions.intercom.sendAdminMessage({
|
|
308
|
+
adminId: "admin_123",
|
|
309
|
+
intercomConversationId: "conv_456",
|
|
310
|
+
messageType: "comment",
|
|
311
|
+
body: "Thank you for contacting us!",
|
|
312
|
+
attachment_urls: ["https://example.com/image.png"]
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// Close/open conversation
|
|
316
|
+
await actions.intercom.closeConversation({
|
|
317
|
+
intercomConversationId: "conv_456",
|
|
318
|
+
adminId: "admin_123"
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// Manage tags
|
|
322
|
+
await actions.intercom.updateConversationTags({
|
|
323
|
+
intercomConversationId: "conv_456",
|
|
324
|
+
adminId: "admin_123",
|
|
325
|
+
tagsToAdd: ["priority"],
|
|
326
|
+
tagsToRemove: ["pending"]
|
|
327
|
+
});
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## Advanced: Building Custom Integration Actions
|
|
331
|
+
|
|
332
|
+
> **Note**: This section is for integration developers building custom integrations. If you're building a bot and using existing integrations (Slack, Linear, etc.), you can skip this section.
|
|
333
|
+
|
|
334
|
+
When building a custom integration, you define actions that bot developers can call via `actions.{yourIntegration}.{actionName}()`.
|
|
335
|
+
|
|
336
|
+
### Integration Action Structure
|
|
337
|
+
|
|
338
|
+
Here's how integration actions are implemented (example from Intercom integration):
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
// In integrations/intercom/src/actions/send-admin-message.ts
|
|
342
|
+
import { RuntimeError } from "@botpress/client";
|
|
343
|
+
import * as bp from "../../.botpress";
|
|
344
|
+
|
|
345
|
+
export const sendAdminMessage: bp.IntegrationProps["actions"]["sendAdminMessage"] =
|
|
346
|
+
async ({ input }) => {
|
|
347
|
+
const url = new URL(
|
|
348
|
+
`https://api.intercom.io/conversations/${input.intercomConversationId}/reply`
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
const requestBody: Record<string, unknown> = {
|
|
352
|
+
message_type: input.messageType ?? "comment",
|
|
353
|
+
type: "admin",
|
|
354
|
+
body: input.body,
|
|
355
|
+
admin_id: input.adminId,
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
// Add optional parameters
|
|
359
|
+
if (input.attachment_urls && input.attachment_urls.length > 0) {
|
|
360
|
+
requestBody.attachment_urls = input.attachment_urls;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Call external API
|
|
364
|
+
const response = await fetch(url.toString(), {
|
|
365
|
+
method: "POST",
|
|
366
|
+
headers: {
|
|
367
|
+
Authorization: `Bearer ${bp.secrets.TOKEN}`,
|
|
368
|
+
"Intercom-Version": "2.14",
|
|
369
|
+
"Content-Type": "application/json",
|
|
370
|
+
},
|
|
371
|
+
body: JSON.stringify(requestBody),
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// Error handling
|
|
375
|
+
if (!response.ok) {
|
|
376
|
+
const errorText = await response.text();
|
|
377
|
+
throw new RuntimeError(
|
|
378
|
+
`Failed to send admin message: ${response.status} - ${errorText}`
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return await response.json();
|
|
383
|
+
};
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Integration Action Definition
|
|
387
|
+
|
|
388
|
+
Actions are defined in the integration's definition file:
|
|
389
|
+
|
|
390
|
+
```typescript
|
|
391
|
+
// In integrations/intercom/integration.definition.ts
|
|
392
|
+
import { Integration, z } from "@botpress/sdk";
|
|
393
|
+
|
|
394
|
+
export default new Integration({
|
|
395
|
+
actions: {
|
|
396
|
+
sendAdminMessage: {
|
|
397
|
+
title: "Send Admin Message",
|
|
398
|
+
description: "Send a message as an admin with optional attachments",
|
|
399
|
+
input: {
|
|
400
|
+
schema: z.object({
|
|
401
|
+
adminId: z.string(),
|
|
402
|
+
intercomConversationId: z.string(),
|
|
403
|
+
body: z.string(),
|
|
404
|
+
messageType: z.enum(["comment", "note"]).optional(),
|
|
405
|
+
attachment_urls: z.array(z.string().url()).max(10).optional(),
|
|
406
|
+
}),
|
|
407
|
+
},
|
|
408
|
+
output: {
|
|
409
|
+
schema: z.object({
|
|
410
|
+
id: z.string(),
|
|
411
|
+
body: z.string(),
|
|
412
|
+
createdAt: z.string(),
|
|
413
|
+
}),
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
// ... more actions
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Key Integration Action Patterns
|
|
422
|
+
|
|
423
|
+
1. **Use RuntimeError for failures** - Provides better error context to bot developers
|
|
424
|
+
2. **Validate external API responses** - Always check `response.ok` and handle errors
|
|
425
|
+
3. **Transform external data** - Map external API schemas to your action output schema
|
|
426
|
+
4. **Use bp.secrets for credentials** - Never hardcode tokens or API keys
|
|
427
|
+
5. **Handle optional parameters** - Check before adding to request body
|
|
428
|
+
6. **Type external API responses** - Use TypeScript types from SDK if available
|
|
429
|
+
|
|
430
|
+
## Using Integration Actions
|
|
431
|
+
|
|
432
|
+
### Composing Actions
|
|
433
|
+
|
|
434
|
+
```typescript
|
|
435
|
+
// In a workflow step
|
|
436
|
+
await step("sync-to-slack", async () => {
|
|
437
|
+
// Get data from Linear
|
|
438
|
+
const { items } = await actions.linear.issueList({
|
|
439
|
+
first: 10,
|
|
440
|
+
filter: { state: { name: { eq: "Done" } } }
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
// Send to Slack
|
|
444
|
+
for (const issue of items) {
|
|
445
|
+
await actions.slack.sendMessage({
|
|
446
|
+
channel: "#updates",
|
|
447
|
+
text: `✅ Completed: ${issue.title}`
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Using in Workflows
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
export const SyncLinearWorkflow = new Workflow({
|
|
457
|
+
name: "syncLinear",
|
|
458
|
+
async handler({ step }) {
|
|
459
|
+
// Step 1: Fetch from Linear
|
|
460
|
+
const issues = await step("fetch-issues", async () => {
|
|
461
|
+
const { items } = await actions.linear.issueList({
|
|
462
|
+
first: 50,
|
|
463
|
+
orderBy: { updatedAt: "desc" }
|
|
464
|
+
});
|
|
465
|
+
return items;
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// Step 2: Process and update
|
|
469
|
+
await step("update-database", async () => {
|
|
470
|
+
for (const issue of issues) {
|
|
471
|
+
await updateDatabase(issue);
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### Using in Tools
|
|
479
|
+
|
|
480
|
+
```typescript
|
|
481
|
+
import { Autonomous, z } from "@botpress/runtime";
|
|
482
|
+
|
|
483
|
+
export const searchWebTool = new Autonomous.Tool({
|
|
484
|
+
name: "searchWeb",
|
|
485
|
+
description: "Search the web for information",
|
|
486
|
+
input: z.object({
|
|
487
|
+
query: z.string().describe("Search query")
|
|
488
|
+
}),
|
|
489
|
+
output: z.string(),
|
|
490
|
+
handler: async ({ query }) => {
|
|
491
|
+
const results = await actions.browser.webSearch({
|
|
492
|
+
query,
|
|
493
|
+
maxResults: 5
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
return results
|
|
497
|
+
.map((r, i) => `${i + 1}. ${r.title}\n${r.snippet}`)
|
|
498
|
+
.join("\n\n");
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
## Type Inference
|
|
504
|
+
|
|
505
|
+
TypeScript automatically infers types from integration actions:
|
|
506
|
+
|
|
507
|
+
```typescript
|
|
508
|
+
// Infer return type
|
|
509
|
+
type SearchResult = Awaited<ReturnType<typeof actions.browser.webSearch>>;
|
|
510
|
+
// SearchResult is { title: string; url: string; snippet: string }[]
|
|
511
|
+
|
|
512
|
+
// Infer parameter type
|
|
513
|
+
type IssueListParams = Parameters<typeof actions.linear.issueList>[0];
|
|
514
|
+
// IssueListParams is { first?: number; filter?: {...}; ... }
|
|
515
|
+
|
|
516
|
+
// Use in function signatures
|
|
517
|
+
async function processIssues(
|
|
518
|
+
params: Parameters<typeof actions.linear.issueList>[0]
|
|
519
|
+
) {
|
|
520
|
+
const { items } = await actions.linear.issueList(params);
|
|
521
|
+
// ...
|
|
522
|
+
}
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
## Bot Actions vs Integration Actions
|
|
526
|
+
|
|
527
|
+
The `actions` proxy handles both:
|
|
528
|
+
|
|
529
|
+
**Bot Actions** (from `src/actions/*.ts`):
|
|
530
|
+
```typescript
|
|
531
|
+
// Direct access to your bot's actions
|
|
532
|
+
await actions.myCustomAction({ param: "value" });
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
**Integration Actions** (from installed integrations):
|
|
536
|
+
```typescript
|
|
537
|
+
// Nested under integration name
|
|
538
|
+
await actions.slack.sendMessage({ channel: "#general", text: "Hi" });
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
The actions proxy automatically determines whether you're calling a bot action (top-level) or an integration action (nested under integration name).
|
|
542
|
+
|
|
543
|
+
## Troubleshooting
|
|
544
|
+
|
|
545
|
+
### Integration Not Found
|
|
546
|
+
|
|
547
|
+
```typescript
|
|
548
|
+
// Error: Could not find integration "slack" and action "sendMessage"
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
**Solutions:**
|
|
552
|
+
1. Add integration: `adk integrations add slack@2.5.5`
|
|
553
|
+
2. Enable: `adk integrations enable slack`
|
|
554
|
+
3. Configure credentials in Dev Console (localhost:3001) or via `adk integrations configure`
|
|
555
|
+
4. Restart dev server: `adk dev`
|
|
556
|
+
|
|
557
|
+
### Action Not Found
|
|
558
|
+
|
|
559
|
+
```typescript
|
|
560
|
+
// Error: Action "nonexistentAction" not found in integration "slack"
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**Solutions:**
|
|
564
|
+
1. Check integration documentation for available actions
|
|
565
|
+
2. Verify integration version supports the action
|
|
566
|
+
3. Check for typos in action name
|
|
567
|
+
|
|
568
|
+
### Type Errors
|
|
569
|
+
|
|
570
|
+
```typescript
|
|
571
|
+
// Error: Property 'wrongParam' does not exist on type ...
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
**Solutions:**
|
|
575
|
+
1. Check IntelliSense for correct parameter names
|
|
576
|
+
2. Verify integration version matches your usage
|
|
577
|
+
3. Run `adk dev` to regenerate types
|
|
578
|
+
|
|
579
|
+
### Authentication Errors
|
|
580
|
+
|
|
581
|
+
```typescript
|
|
582
|
+
// Error: Integration not authenticated
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
**Solutions:**
|
|
586
|
+
1. Configure credentials in Dev Console (localhost:3001 during dev)
|
|
587
|
+
2. Set credentials via `adk integrations configure <alias> --set key=value`
|
|
588
|
+
3. Check environment variables are set
|
|
589
|
+
4. Verify API keys/tokens are valid
|
|
590
|
+
|
|
591
|
+
## Best Practices
|
|
592
|
+
|
|
593
|
+
### 1. Handle Errors Gracefully
|
|
594
|
+
|
|
595
|
+
```typescript
|
|
596
|
+
try {
|
|
597
|
+
await actions.slack.sendMessage({ channel: "#general", text: "Hi" });
|
|
598
|
+
} catch (error) {
|
|
599
|
+
console.error("Failed to send Slack message:", error);
|
|
600
|
+
// Fallback or retry logic
|
|
601
|
+
}
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### 2. Use Type Inference
|
|
605
|
+
|
|
606
|
+
```typescript
|
|
607
|
+
// ✅ Good - Let TypeScript infer types
|
|
608
|
+
const issue = await actions.linear.getIssue({ id: "ISS-123" });
|
|
609
|
+
|
|
610
|
+
// ❌ Bad - Manual typing (can get out of sync)
|
|
611
|
+
const issue: { id: string; title: string } = await actions.linear.getIssue(...);
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### 3. Check Integration Availability
|
|
615
|
+
|
|
616
|
+
```typescript
|
|
617
|
+
// For optional integrations
|
|
618
|
+
const slack = adk.project.integrations.get("slack");
|
|
619
|
+
if (slack) {
|
|
620
|
+
await actions.slack.sendMessage(...);
|
|
621
|
+
} else {
|
|
622
|
+
console.log("Slack not configured, skipping notification");
|
|
623
|
+
}
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
### 4. Batch When Possible
|
|
627
|
+
|
|
628
|
+
```typescript
|
|
629
|
+
// ✅ Good - Parallel requests
|
|
630
|
+
await Promise.all([
|
|
631
|
+
actions.slack.sendMessage({ channel: "#team1", text: "Update" }),
|
|
632
|
+
actions.slack.sendMessage({ channel: "#team2", text: "Update" })
|
|
633
|
+
]);
|
|
634
|
+
|
|
635
|
+
// ❌ Bad - Sequential (slower)
|
|
636
|
+
await actions.slack.sendMessage({ channel: "#team1", text: "Update" });
|
|
637
|
+
await actions.slack.sendMessage({ channel: "#team2", text: "Update" });
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### 5. Use .asTool() for AI
|
|
641
|
+
|
|
642
|
+
```typescript
|
|
643
|
+
// Make integration actions available to AI
|
|
644
|
+
await execute({
|
|
645
|
+
instructions: "Help the user",
|
|
646
|
+
tools: [
|
|
647
|
+
actions.linear.issueCreate.asTool(),
|
|
648
|
+
actions.slack.sendMessage.asTool(),
|
|
649
|
+
]
|
|
650
|
+
});
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
## See Also
|
|
654
|
+
|
|
655
|
+
- **[Agent Configuration](./agent-config.md)** - Installing and configuring integrations
|
|
656
|
+
- **[Actions](./actions.md)** - Creating custom actions
|
|
657
|
+
- **[Tools](./tools.md)** - Creating AI-callable tools
|
|
658
|
+
- **[Workflows](./workflows.md)** - Using actions in workflows
|
|
659
|
+
- **[Context API](./context-api.md)** - Accessing integrations via context
|