@sylphx/flow 0.2.13 → 1.0.1
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/CHANGELOG.md +318 -0
- package/LOOP_MODE.md +446 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +59398 -698
- package/dist/lancedb.linux-x64-gnu-b7f0jgsz.node +0 -0
- package/dist/lancedb.linux-x64-musl-tgcv22rx.node +0 -0
- package/dist/shared/chunk-25dwp0dp.js +89 -0
- package/dist/shared/chunk-3pjb6063.js +208 -0
- package/dist/shared/chunk-4d6ydpw7.js +2854 -0
- package/dist/shared/chunk-4wjcadjk.js +225 -0
- package/dist/shared/chunk-5j4w74t6.js +30 -0
- package/dist/shared/chunk-5j8m3dh3.js +58 -0
- package/dist/shared/chunk-5thh3qem.js +91 -0
- package/dist/shared/chunk-6g9xy73m.js +252 -0
- package/dist/shared/chunk-7eq34c42.js +23 -0
- package/dist/shared/chunk-c2gwgx3r.js +115 -0
- package/dist/shared/chunk-cjd3mk4c.js +1320 -0
- package/dist/shared/chunk-g5cv6703.js +368 -0
- package/dist/shared/chunk-hpkhykhq.js +574 -0
- package/dist/shared/chunk-m2322pdk.js +122 -0
- package/dist/shared/chunk-nd5fdvaq.js +26 -0
- package/dist/shared/chunk-pgd3m6zf.js +108 -0
- package/dist/shared/chunk-qk8n91hw.js +494 -0
- package/dist/shared/chunk-rkkn8szp.js +16855 -0
- package/dist/shared/chunk-t16rfxh0.js +61 -0
- package/dist/shared/chunk-t4fbfa5v.js +19 -0
- package/dist/shared/chunk-t77h86w6.js +276 -0
- package/dist/shared/chunk-v0ez4aef.js +71 -0
- package/dist/shared/chunk-v29j2r3s.js +32051 -0
- package/dist/shared/chunk-vfbc6ew5.js +765 -0
- package/dist/shared/chunk-vmeqwm1c.js +204 -0
- package/dist/shared/chunk-x66eh37x.js +137 -0
- package/package.json +45 -93
- package/README.md +0 -625
- package/assets/agents/coder.md +0 -32
- package/assets/agents/orchestrator.md +0 -36
- package/assets/agents/reviewer.md +0 -30
- package/assets/agents/writer.md +0 -30
- package/assets/knowledge/data/sql.md +0 -216
- package/assets/knowledge/guides/saas-template.md +0 -85
- package/assets/knowledge/guides/system-prompt.md +0 -344
- package/assets/knowledge/guides/tech-stack.md +0 -92
- package/assets/knowledge/guides/ui-ux.md +0 -44
- package/assets/knowledge/stacks/nextjs-app.md +0 -165
- package/assets/knowledge/stacks/node-api.md +0 -220
- package/assets/knowledge/stacks/react-app.md +0 -232
- package/assets/knowledge/universal/deployment.md +0 -109
- package/assets/knowledge/universal/performance.md +0 -121
- package/assets/knowledge/universal/security.md +0 -79
- package/assets/knowledge/universal/testing.md +0 -111
- package/assets/output-styles/silent.md +0 -23
- package/assets/rules/core.md +0 -197
- package/assets/slash-commands/commit.md +0 -23
- package/assets/slash-commands/context.md +0 -112
- package/assets/slash-commands/explain.md +0 -35
- package/assets/slash-commands/mep.md +0 -63
- package/assets/slash-commands/review.md +0 -39
- package/assets/slash-commands/test.md +0 -30
- package/dist/assets/agents/coder.md +0 -32
- package/dist/assets/agents/orchestrator.md +0 -36
- package/dist/assets/agents/reviewer.md +0 -30
- package/dist/assets/agents/writer.md +0 -30
- package/dist/assets/knowledge/data/sql.md +0 -216
- package/dist/assets/knowledge/guides/saas-template.md +0 -85
- package/dist/assets/knowledge/guides/system-prompt.md +0 -344
- package/dist/assets/knowledge/guides/tech-stack.md +0 -92
- package/dist/assets/knowledge/guides/ui-ux.md +0 -44
- package/dist/assets/knowledge/stacks/nextjs-app.md +0 -165
- package/dist/assets/knowledge/stacks/node-api.md +0 -220
- package/dist/assets/knowledge/stacks/react-app.md +0 -232
- package/dist/assets/knowledge/universal/deployment.md +0 -109
- package/dist/assets/knowledge/universal/performance.md +0 -121
- package/dist/assets/knowledge/universal/security.md +0 -79
- package/dist/assets/knowledge/universal/testing.md +0 -111
- package/dist/assets/output-styles/silent.md +0 -23
- package/dist/assets/rules/core.md +0 -197
- package/dist/assets/slash-commands/commit.md +0 -23
- package/dist/assets/slash-commands/context.md +0 -112
- package/dist/assets/slash-commands/explain.md +0 -35
- package/dist/assets/slash-commands/mep.md +0 -63
- package/dist/assets/slash-commands/review.md +0 -39
- package/dist/assets/slash-commands/test.md +0 -30
- package/dist/chunk-01gv4qey.js +0 -4
- package/dist/chunk-01gv4qey.js.map +0 -11
- package/dist/chunk-1e8xf3f6.js +0 -27
- package/dist/chunk-1e8xf3f6.js.map +0 -23
- package/dist/chunk-3m9whg4q.js +0 -4
- package/dist/chunk-3m9whg4q.js.map +0 -9
- package/dist/chunk-3qxj0zy3.js +0 -23
- package/dist/chunk-3qxj0zy3.js.map +0 -11
- package/dist/chunk-3w6pd43t.js +0 -25
- package/dist/chunk-3w6pd43t.js.map +0 -61
- package/dist/chunk-4e5g3df9.js +0 -105
- package/dist/chunk-4e5g3df9.js.map +0 -27
- package/dist/chunk-4nm4ere4.js +0 -4
- package/dist/chunk-4nm4ere4.js.map +0 -11
- package/dist/chunk-4vrj3f8r.js +0 -26
- package/dist/chunk-4vrj3f8r.js.map +0 -75
- package/dist/chunk-5njgv5k5.js +0 -161
- package/dist/chunk-5njgv5k5.js.map +0 -83
- package/dist/chunk-67n29s4q.js +0 -7
- package/dist/chunk-67n29s4q.js.map +0 -10
- package/dist/chunk-7yyg008s.js +0 -27
- package/dist/chunk-7yyg008s.js.map +0 -14
- package/dist/chunk-86ce45n6.js +0 -3
- package/dist/chunk-86ce45n6.js.map +0 -10
- package/dist/chunk-99pz5wm0.js +0 -75
- package/dist/chunk-99pz5wm0.js.map +0 -12
- package/dist/chunk-cv1nhr27.js +0 -2
- package/dist/chunk-cv1nhr27.js.map +0 -9
- package/dist/chunk-g4baca7p.js +0 -10
- package/dist/chunk-g4baca7p.js.map +0 -23
- package/dist/chunk-gc66xe7z.js +0 -4
- package/dist/chunk-gc66xe7z.js.map +0 -11
- package/dist/chunk-hj6qtsqp.js +0 -15
- package/dist/chunk-hj6qtsqp.js.map +0 -10
- package/dist/chunk-jbd95k1f.js +0 -14
- package/dist/chunk-jbd95k1f.js.map +0 -20
- package/dist/chunk-jk1ebfqn.js +0 -23
- package/dist/chunk-jk1ebfqn.js.map +0 -132
- package/dist/chunk-kn908zkk.js +0 -4
- package/dist/chunk-kn908zkk.js.map +0 -10
- package/dist/chunk-mw13a082.js +0 -4
- package/dist/chunk-mw13a082.js.map +0 -10
- package/dist/chunk-n8vzewr3.js +0 -4
- package/dist/chunk-n8vzewr3.js.map +0 -12
- package/dist/chunk-nke51f3c.js +0 -4
- package/dist/chunk-nke51f3c.js.map +0 -10
- package/dist/chunk-ns5atzyz.js +0 -3
- package/dist/chunk-ns5atzyz.js.map +0 -10
- package/dist/chunk-q4nh3vst.js +0 -54
- package/dist/chunk-q4nh3vst.js.map +0 -53
- package/dist/chunk-q5gqgs0p.js +0 -4
- package/dist/chunk-q5gqgs0p.js.map +0 -10
- package/dist/chunk-qpej66sh.js +0 -6
- package/dist/chunk-qpej66sh.js.map +0 -11
- package/dist/chunk-s9bsh0gp.js +0 -4
- package/dist/chunk-s9bsh0gp.js.map +0 -10
- package/dist/chunk-waemzsf4.js +0 -4
- package/dist/chunk-waemzsf4.js.map +0 -10
- package/dist/chunk-wnhhwtsy.js +0 -19
- package/dist/chunk-wnhhwtsy.js.map +0 -11
- package/dist/chunk-xs370t8p.js +0 -119
- package/dist/chunk-xs370t8p.js.map +0 -26
- package/dist/chunk-xtrn4wn0.js +0 -3
- package/dist/chunk-xtrn4wn0.js.map +0 -10
- package/dist/index.js.map +0 -920
- package/drizzle/0000_wooden_lady_bullseye.sql +0 -52
- package/drizzle/0001_material_pyro.sql +0 -85
- package/drizzle/0002_lyrical_random.sql +0 -2
- package/drizzle/0003_romantic_lockjaw.sql +0 -4
- package/drizzle/0004_blushing_meteorite.sql +0 -6
- package/drizzle/meta/0000_snapshot.json +0 -310
- package/drizzle/meta/0001_snapshot.json +0 -906
- package/drizzle/meta/0002_snapshot.json +0 -920
- package/drizzle/meta/0003_snapshot.json +0 -920
- package/drizzle/meta/0004_snapshot.json +0 -921
- package/drizzle/meta/_journal.json +0 -41
package/dist/chunk-1e8xf3f6.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import{R as XY}from"./chunk-mw13a082.js";import"./chunk-3w6pd43t.js";import"./chunk-s9bsh0gp.js";import{ma as b}from"./chunk-jk1ebfqn.js";import"./chunk-01gv4qey.js";import"./chunk-g4baca7p.js";import"./chunk-cv1nhr27.js";import{xb as T}from"./chunk-jbd95k1f.js";import{Sb as K}from"./chunk-4vrj3f8r.js";import{Tb as OZ,Ub as M2,Wb as sZ}from"./chunk-3m9whg4q.js";var DZ=M2((N2,wY)=>{(function(){function Y(Z,W){Object.defineProperty(B.prototype,Z,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",W[0],W[1])}})}function X(Z){if(Z===null||typeof Z!=="object")return null;return Z=ZZ&&Z[ZZ]||Z["@@iterator"],typeof Z==="function"?Z:null}function $(Z,W){Z=(Z=Z.constructor)&&(Z.displayName||Z.name)||"ReactClass";var H=Z+"."+W;XZ[H]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",W,Z),XZ[H]=!0)}function B(Z,W,H){this.props=Z,this.context=W,this.refs=TY,this.updater=H||$Z}function G(){}function Q(Z,W,H){this.props=Z,this.context=W,this.refs=TY,this.updater=H||$Z}function q(){}function J(Z){return""+Z}function N(Z){try{J(Z);var W=!1}catch(M){W=!0}if(W){W=console;var H=W.error,U=typeof Symbol==="function"&&Symbol.toStringTag&&Z[Symbol.toStringTag]||Z.constructor.name||"Object";return H.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),J(Z)}}function O(Z){if(Z==null)return null;if(typeof Z==="function")return Z.$$typeof===cZ?null:Z.displayName||Z.name||null;if(typeof Z==="string")return Z;switch(Z){case IY:return"Fragment";case rY:return"Profiler";case oY:return"StrictMode";case eY:return"Suspense";case dZ:return"SuspenseList";case YZ:return"Activity"}if(typeof Z==="object")switch(typeof Z.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Z.$$typeof){case sY:return"Portal";case aY:return Z.displayName||"Context";case CY:return(Z._context.displayName||"Context")+".Consumer";case tY:var W=Z.render;return Z=Z.displayName,Z||(Z=W.displayName||W.name||"",Z=Z!==""?"ForwardRef("+Z+")":"ForwardRef"),Z;case AY:return W=Z.displayName||null,W!==null?W:O(Z.type)||"Memo";case YY:W=Z._payload,Z=Z._init;try{return O(Z(W))}catch(H){}}return null}function w(Z){if(Z===IY)return"<>";if(typeof Z==="object"&&Z!==null&&Z.$$typeof===YY)return"<...>";try{var W=O(Z);return W?"<"+W+">":"<...>"}catch(H){return"<...>"}}function L(){var Z=R.A;return Z===null?null:Z.getOwner()}function V(){return Error("react-stack-top-frame")}function F(Z){if(qY.call(Z,"key")){var W=Object.getOwnPropertyDescriptor(Z,"key").get;if(W&&W.isReactWarning)return!1}return Z.key!==void 0}function C(Z,W){function H(){QZ||(QZ=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}H.isReactWarning=!0,Object.defineProperty(Z,"key",{get:H,configurable:!0})}function P(){var Z=O(this.type);return UZ[Z]||(UZ[Z]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Z=this.props.ref,Z!==void 0?Z:null}function I(Z,W,H,U,M,x){var E=H.ref;return Z={$$typeof:PY,type:Z,key:W,props:H,_owner:U},(E!==void 0?E:null)!==null?Object.defineProperty(Z,"ref",{enumerable:!1,get:P}):Object.defineProperty(Z,"ref",{enumerable:!1,value:null}),Z._store={},Object.defineProperty(Z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(Z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.freeze&&(Object.freeze(Z.props),Object.freeze(Z)),Z}function h(Z,W){return W=I(Z.type,W,Z.props,Z._owner,Z._debugStack,Z._debugTask),Z._store&&(W._store.validated=Z._store.validated),W}function u(Z){S(Z)?Z._store&&(Z._store.validated=1):typeof Z==="object"&&Z!==null&&Z.$$typeof===YY&&(Z._payload.status==="fulfilled"?S(Z._payload.value)&&Z._payload.value._store&&(Z._payload.value._store.validated=1):Z._store&&(Z._store.validated=1))}function S(Z){return typeof Z==="object"&&Z!==null&&Z.$$typeof===PY}function m(Z){var W={"=":"=0",":":"=2"};return"$"+Z.replace(/[=:]/g,function(H){return W[H]})}function d(Z,W){return typeof Z==="object"&&Z!==null&&Z.key!=null?(N(Z.key),m(""+Z.key)):W.toString(36)}function UY(Z){switch(Z.status){case"fulfilled":return Z.value;case"rejected":throw Z.reason;default:switch(typeof Z.status==="string"?Z.then(q,q):(Z.status="pending",Z.then(function(W){Z.status==="pending"&&(Z.status="fulfilled",Z.value=W)},function(W){Z.status==="pending"&&(Z.status="rejected",Z.reason=W)})),Z.status){case"fulfilled":return Z.value;case"rejected":throw Z.reason}}throw Z}function A(Z,W,H,U,M){var x=typeof Z;if(x==="undefined"||x==="boolean")Z=null;var E=!1;if(Z===null)E=!0;else switch(x){case"bigint":case"string":case"number":E=!0;break;case"object":switch(Z.$$typeof){case PY:case sY:E=!0;break;case YY:return E=Z._init,A(E(Z._payload),W,H,U,M)}}if(E){E=Z,M=M(E);var j=U===""?"."+d(E,0):U;return WZ(M)?(H="",j!=null&&(H=j.replace(qZ,"$&/")+"/"),A(M,W,H,"",function(y){return y})):M!=null&&(S(M)&&(M.key!=null&&(E&&E.key===M.key||N(M.key)),H=h(M,H+(M.key==null||E&&E.key===M.key?"":(""+M.key).replace(qZ,"$&/")+"/")+j),U!==""&&E!=null&&S(E)&&E.key==null&&E._store&&!E._store.validated&&(H._store.validated=2),M=H),W.push(M)),1}if(E=0,j=U===""?".":U+":",WZ(Z))for(var z=0;z<Z.length;z++)U=Z[z],x=j+d(U,z),E+=A(U,W,H,x,M);else if(z=X(Z),typeof z==="function")for(z===Z.entries&&(JZ||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),JZ=!0),Z=z.call(Z),z=0;!(U=Z.next()).done;)U=U.value,x=j+d(U,z++),E+=A(U,W,H,x,M);else if(x==="object"){if(typeof Z.then==="function")return A(UY(Z),W,H,U,M);throw W=String(Z),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(Z).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return E}function t(Z,W,H){if(Z==null)return Z;var U=[],M=0;return A(Z,U,"","",function(x){return W.call(H,x,M++)}),U}function JY(Z){if(Z._status===-1){var W=Z._ioInfo;W!=null&&(W.start=W.end=performance.now()),W=Z._result;var H=W();if(H.then(function(M){if(Z._status===0||Z._status===-1){Z._status=1,Z._result=M;var x=Z._ioInfo;x!=null&&(x.end=performance.now()),H.status===void 0&&(H.status="fulfilled",H.value=M)}},function(M){if(Z._status===0||Z._status===-1){Z._status=2,Z._result=M;var x=Z._ioInfo;x!=null&&(x.end=performance.now()),H.status===void 0&&(H.status="rejected",H.reason=M)}}),W=Z._ioInfo,W!=null){W.value=H;var U=H.displayName;typeof U==="string"&&(W.name=U)}Z._status===-1&&(Z._status=0,Z._result=H)}if(Z._status===1)return W=Z._result,W===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
-
|
|
3
|
-
Your code should look like:
|
|
4
|
-
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
-
|
|
6
|
-
Did you accidentally put curly braces around the import?`,W),"default"in W||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
-
|
|
8
|
-
Your code should look like:
|
|
9
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,W),W.default;throw Z._result}function D(){var Z=R.H;return Z===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
-
2. You might be breaking the Rules of Hooks
|
|
12
|
-
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),Z}function g(){R.asyncTransitions--}function s(Z){if(KY===null)try{var W=("require"+Math.random()).slice(0,7);KY=(wY&&wY[W]).call(wY,"timers").setImmediate}catch(H){KY=function(U){MZ===!1&&(MZ=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var M=new MessageChannel;M.port1.onmessage=U,M.port2.postMessage(void 0)}}return KY(Z)}function c(Z){return 1<Z.length&&typeof AggregateError==="function"?AggregateError(Z):Z[0]}function f(Z,W){W!==MY-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),MY=W}function e(Z,W,H){var U=R.actQueue;if(U!==null)if(U.length!==0)try{FY(U),s(function(){return e(Z,W,H)});return}catch(M){R.thrownErrors.push(M)}else R.actQueue=null;0<R.thrownErrors.length?(U=c(R.thrownErrors),R.thrownErrors.length=0,H(U)):W(Z)}function FY(Z){if(!_Y){_Y=!0;var W=0;try{for(;W<Z.length;W++){var H=Z[W];do{R.didUsePromise=!1;var U=H(!1);if(U!==null){if(R.didUsePromise){Z[W]=H,Z.splice(0,W);return}H=U}else break}while(1)}Z.length=0}catch(M){Z.splice(0,W+1),R.thrownErrors.push(M)}finally{_Y=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var PY=Symbol.for("react.transitional.element"),sY=Symbol.for("react.portal"),IY=Symbol.for("react.fragment"),oY=Symbol.for("react.strict_mode"),rY=Symbol.for("react.profiler"),CY=Symbol.for("react.consumer"),aY=Symbol.for("react.context"),tY=Symbol.for("react.forward_ref"),eY=Symbol.for("react.suspense"),dZ=Symbol.for("react.suspense_list"),AY=Symbol.for("react.memo"),YY=Symbol.for("react.lazy"),YZ=Symbol.for("react.activity"),ZZ=Symbol.iterator,XZ={},$Z={isMounted:function(){return!1},enqueueForceUpdate:function(Z){$(Z,"forceUpdate")},enqueueReplaceState:function(Z){$(Z,"replaceState")},enqueueSetState:function(Z){$(Z,"setState")}},BZ=Object.assign,TY={};Object.freeze(TY),B.prototype.isReactComponent={},B.prototype.setState=function(Z,W){if(typeof Z!=="object"&&typeof Z!=="function"&&Z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Z,W,"setState")},B.prototype.forceUpdate=function(Z){this.updater.enqueueForceUpdate(this,Z,"forceUpdate")};var v={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(ZY in v)v.hasOwnProperty(ZY)&&Y(ZY,v[ZY]);G.prototype=B.prototype,v=Q.prototype=new G,v.constructor=Q,BZ(v,B.prototype),v.isPureReactComponent=!0;var WZ=Array.isArray,cZ=Symbol.for("react.client.reference"),R={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},qY=Object.prototype.hasOwnProperty,GZ=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(Z){return Z()}};var QZ,HZ,UZ={},pZ=v.react_stack_bottom_frame.bind(v,V)(),lZ=GZ(w(V)),JZ=!1,qZ=/\/+/g,KZ=typeof reportError==="function"?reportError:function(Z){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Z==="object"&&Z!==null&&typeof Z.message==="string"?String(Z.message):String(Z),error:Z});if(!window.dispatchEvent(W))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",Z);return}console.error(Z)},MZ=!1,KY=null,MY=0,NY=!1,_Y=!1,NZ=typeof queueMicrotask==="function"?function(Z){queueMicrotask(function(){return queueMicrotask(Z)})}:s;v=Object.freeze({__proto__:null,c:function(Z){return D().useMemoCache(Z)}});var ZY={map:t,forEach:function(Z,W,H){t(Z,function(){W.apply(this,arguments)},H)},count:function(Z){var W=0;return t(Z,function(){W++}),W},toArray:function(Z){return t(Z,function(W){return W})||[]},only:function(Z){if(!S(Z))throw Error("React.Children.only expected to receive a single React element child.");return Z}};N2.Activity=YZ,N2.Children=ZY,N2.Component=B,N2.Fragment=IY,N2.Profiler=rY,N2.PureComponent=Q,N2.StrictMode=oY,N2.Suspense=eY,N2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,N2.__COMPILER_RUNTIME=v,N2.act=function(Z){var W=R.actQueue,H=MY;MY++;var U=R.actQueue=W!==null?W:[],M=!1;try{var x=Z()}catch(z){R.thrownErrors.push(z)}if(0<R.thrownErrors.length)throw f(W,H),Z=c(R.thrownErrors),R.thrownErrors.length=0,Z;if(x!==null&&typeof x==="object"&&typeof x.then==="function"){var E=x;return NZ(function(){M||NY||(NY=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(z,y){M=!0,E.then(function(o){if(f(W,H),H===0){try{FY(U),s(function(){return e(o,z,y)})}catch(nZ){R.thrownErrors.push(nZ)}if(0<R.thrownErrors.length){var iZ=c(R.thrownErrors);R.thrownErrors.length=0,y(iZ)}}else z(o)},function(o){f(W,H),0<R.thrownErrors.length?(o=c(R.thrownErrors),R.thrownErrors.length=0,y(o)):y(o)})}}}var j=x;if(f(W,H),H===0&&(FY(U),U.length!==0&&NZ(function(){M||NY||(NY=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),R.actQueue=null),0<R.thrownErrors.length)throw Z=c(R.thrownErrors),R.thrownErrors.length=0,Z;return{then:function(z,y){M=!0,H===0?(R.actQueue=U,s(function(){return e(j,z,y)})):z(j)}}},N2.cache=function(Z){return function(){return Z.apply(null,arguments)}},N2.cacheSignal=function(){return null},N2.captureOwnerStack=function(){var Z=R.getCurrentStack;return Z===null?null:Z()},N2.cloneElement=function(Z,W,H){if(Z===null||Z===void 0)throw Error("The argument must be a React element, but you passed "+Z+".");var U=BZ({},Z.props),M=Z.key,x=Z._owner;if(W!=null){var E;Y:{if(qY.call(W,"ref")&&(E=Object.getOwnPropertyDescriptor(W,"ref").get)&&E.isReactWarning){E=!1;break Y}E=W.ref!==void 0}E&&(x=L()),F(W)&&(N(W.key),M=""+W.key);for(j in W)!qY.call(W,j)||j==="key"||j==="__self"||j==="__source"||j==="ref"&&W.ref===void 0||(U[j]=W[j])}var j=arguments.length-2;if(j===1)U.children=H;else if(1<j){E=Array(j);for(var z=0;z<j;z++)E[z]=arguments[z+2];U.children=E}U=I(Z.type,M,U,x,Z._debugStack,Z._debugTask);for(M=2;M<arguments.length;M++)u(arguments[M]);return U},N2.createContext=function(Z){return Z={$$typeof:aY,_currentValue:Z,_currentValue2:Z,_threadCount:0,Provider:null,Consumer:null},Z.Provider=Z,Z.Consumer={$$typeof:CY,_context:Z},Z._currentRenderer=null,Z._currentRenderer2=null,Z},N2.createElement=function(Z,W,H){for(var U=2;U<arguments.length;U++)u(arguments[U]);U={};var M=null;if(W!=null)for(z in HZ||!("__self"in W)||"key"in W||(HZ=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),F(W)&&(N(W.key),M=""+W.key),W)qY.call(W,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(U[z]=W[z]);var x=arguments.length-2;if(x===1)U.children=H;else if(1<x){for(var E=Array(x),j=0;j<x;j++)E[j]=arguments[j+2];Object.freeze&&Object.freeze(E),U.children=E}if(Z&&Z.defaultProps)for(z in x=Z.defaultProps,x)U[z]===void 0&&(U[z]=x[z]);M&&C(U,typeof Z==="function"?Z.displayName||Z.name||"Unknown":Z);var z=1e4>R.recentlyCreatedOwnerStacks++;return I(Z,M,U,L(),z?Error("react-stack-top-frame"):pZ,z?GZ(w(Z)):lZ)},N2.createRef=function(){var Z={current:null};return Object.seal(Z),Z},N2.forwardRef=function(Z){Z!=null&&Z.$$typeof===AY?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof Z!=="function"?console.error("forwardRef requires a render function but was given %s.",Z===null?"null":typeof Z):Z.length!==0&&Z.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",Z.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),Z!=null&&Z.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var W={$$typeof:tY,render:Z},H;return Object.defineProperty(W,"displayName",{enumerable:!1,configurable:!0,get:function(){return H},set:function(U){H=U,Z.name||Z.displayName||(Object.defineProperty(Z,"name",{value:U}),Z.displayName=U)}}),W},N2.isValidElement=S,N2.lazy=function(Z){Z={_status:-1,_result:Z};var W={$$typeof:YY,_payload:Z,_init:JY},H={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return Z._ioInfo=H,W._debugInfo=[{awaited:H}],W},N2.memo=function(Z,W){Z==null&&console.error("memo: The first argument must be a component. Instead received: %s",Z===null?"null":typeof Z),W={$$typeof:AY,type:Z,compare:W===void 0?null:W};var H;return Object.defineProperty(W,"displayName",{enumerable:!1,configurable:!0,get:function(){return H},set:function(U){H=U,Z.name||Z.displayName||(Object.defineProperty(Z,"name",{value:U}),Z.displayName=U)}}),W},N2.startTransition=function(Z){var W=R.T,H={};H._updatedFibers=new Set,R.T=H;try{var U=Z(),M=R.S;M!==null&&M(H,U),typeof U==="object"&&U!==null&&typeof U.then==="function"&&(R.asyncTransitions++,U.then(g,g),U.then(q,KZ))}catch(x){KZ(x)}finally{W===null&&H._updatedFibers&&(Z=H._updatedFibers.size,H._updatedFibers.clear(),10<Z&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),W!==null&&H.types!==null&&(W.types!==null&&W.types!==H.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),W.types=H.types),R.T=W}},N2.unstable_useCacheRefresh=function(){return D().useCacheRefresh()},N2.use=function(Z){return D().use(Z)},N2.useActionState=function(Z,W,H){return D().useActionState(Z,W,H)},N2.useCallback=function(Z,W){return D().useCallback(Z,W)},N2.useContext=function(Z){var W=D();return Z.$$typeof===CY&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),W.useContext(Z)},N2.useDebugValue=function(Z,W){return D().useDebugValue(Z,W)},N2.useDeferredValue=function(Z,W){return D().useDeferredValue(Z,W)},N2.useEffect=function(Z,W){return Z==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),D().useEffect(Z,W)},N2.useEffectEvent=function(Z){return D().useEffectEvent(Z)},N2.useId=function(){return D().useId()},N2.useImperativeHandle=function(Z,W,H){return D().useImperativeHandle(Z,W,H)},N2.useInsertionEffect=function(Z,W){return Z==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),D().useInsertionEffect(Z,W)},N2.useLayoutEffect=function(Z,W){return Z==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),D().useLayoutEffect(Z,W)},N2.useMemo=function(Z,W){return D().useMemo(Z,W)},N2.useOptimistic=function(Z,W){return D().useOptimistic(Z,W)},N2.useReducer=function(Z,W,H){return D().useReducer(Z,W,H)},N2.useRef=function(Z){return D().useRef(Z)},N2.useState=function(Z){return D().useState(Z)},N2.useSyncExternalStore=function(Z,W,H){return D().useSyncExternalStore(Z,W,H)},N2.useTransition=function(){return D().useTransition()},N2.version="19.2.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});import{readFile as wZ,writeFile as LZ,mkdir as oZ}from"node:fs/promises";import{dirname as rZ}from"node:path";var aZ=T({description:"Read contents of a file from the filesystem",inputSchema:K.object({file_path:K.string().describe("Path to file"),offset:K.number().optional().describe("Start line number (1-based)"),limit:K.number().optional().describe("Number of lines to read")}),execute:async({file_path:Y,offset:X,limit:$})=>{try{let{stat:Q}=await import("node:fs/promises"),q=await Q(Y);if(q.size>10485760)return{path:Y,error:`File too large (${Math.round(q.size/1024/1024)}MB). Maximum size is 10MB. Use offset and limit parameters to read specific sections.`,encoding:"utf8"}}catch(Q){return{path:Y,error:`Failed to check file size: ${Q instanceof Error?Q.message:String(Q)}`,encoding:"utf8"}}let G=await wZ(Y,"utf8");if(X!==void 0||$!==void 0){let Q=G.split(`
|
|
14
|
-
`),q=X?X-1:0,J=$?q+$:Q.length,N=Q.slice(q,J);return{path:Y,content:N.join(`
|
|
15
|
-
`),encoding:"utf8"}}return{path:Y,content:G,encoding:"utf8"}}}),tZ=T({description:"Write content to a file",inputSchema:K.object({file_path:K.string().describe("Path to file (overwrites if exists)"),content:K.string().describe("Content to write")}),execute:async({file_path:Y,content:X})=>{let $=rZ(Y);await oZ($,{recursive:!0}),await LZ(Y,X,"utf8");let B=Y.split("/").pop()||"",G=X.split(`
|
|
16
|
-
`);return{path:Y,bytes:Buffer.byteLength(X,"utf8"),fileName:B,lineCount:G.length,preview:G.slice(0,5)}}}),eZ=T({description:"Perform exact string replacements in files",inputSchema:K.object({file_path:K.string().describe("Path to file"),old_string:K.string().describe("Text to replace (must be exact and unique unless replace_all=true)"),new_string:K.string().describe("Replacement text"),replace_all:K.boolean().default(!1).optional().describe("Replace all occurrences. If false, old_string must be unique")}),execute:async({file_path:Y,old_string:X,new_string:$,replace_all:B=!1})=>{if(X===$)throw Error("old_string and new_string must be different");let G=await wZ(Y,"utf8");if(!G.includes(X))throw Error(`old_string not found in file: ${Y}`);if(!B){let P=G.indexOf(X),I=G.lastIndexOf(X);if(P!==I)throw Error("old_string appears multiple times in the file. Either provide more context to make it unique or use replace_all=true")}let Q=G.split(`
|
|
17
|
-
`),J=G.substring(0,G.indexOf(X)).split(`
|
|
18
|
-
`).length,N=2,O=Math.max(0,J-N-1),w=Math.min(Q.length,J+N),L=B?G.split(X).join($):G.replace(X,$);await LZ(Y,L,"utf8");let V=B?G.split(X).length-1:1,F=Q.slice(O,w),C=[];for(let P=0;P<F.length;P++){let I=O+P+1,h=F[P];if(I===J){let u=X.split(`
|
|
19
|
-
`),S=$.split(`
|
|
20
|
-
`);u.forEach((m)=>{C.push(`${I.toString().padStart(6)} - ${m}`)}),S.forEach((m)=>{C.push(`${I.toString().padStart(6)} + ${m}`)})}else C.push(`${I.toString().padStart(6)} ${h}`)}return{path:Y,replacements:V,old_length:X.length,new_length:$.length,diff:C,old_string:X,new_string:$}}}),kY={read:aZ,write:tZ,edit:eZ};import{exec as Y2}from"node:child_process";import{promisify as Z2}from"node:util";var X2=Z2(Y2),$2=T({description:"Execute a bash command and return its output",inputSchema:K.object({command:K.string().describe("Bash command to execute"),cwd:K.string().optional().describe("Working directory"),timeout:K.number().default(30000).optional().describe("Timeout in milliseconds (foreground mode only)"),run_in_background:K.boolean().default(!1).optional().describe("Run in background. Returns bash_id for bash-output tool")}),execute:async({command:Y,cwd:X,timeout:$=30000,run_in_background:B=!1})=>{if(B){let G=XY.spawn(Y,X);return{bash_id:G,command:Y,mode:"background",message:`Started in background. Use bash-output tool with bash_id: ${G}`}}try{let{stdout:G,stderr:Q}=await X2(Y,{cwd:X||process.cwd(),timeout:$,maxBuffer:10485760});return{command:Y,stdout:G.trim(),stderr:Q.trim(),exitCode:0}}catch(G){if(G.code!==void 0)return{command:Y,stdout:G.stdout?.trim()||"",stderr:G.stderr?.trim()||"",exitCode:G.code};throw Error(`Command execution failed: ${G.message}`)}}}),B2=T({description:"Get output from a background bash process",inputSchema:K.object({bash_id:K.string().describe("bash_id from background bash command"),filter:K.string().optional().describe("Regex to filter output lines")}),execute:async({bash_id:Y,filter:X})=>{let $=XY.getOutput(Y);if(!$)throw Error(`Bash process not found: ${Y}`);let{stdout:B,stderr:G}=$;if(X)try{let Q=new RegExp(X);B=B.split(`
|
|
21
|
-
`).filter((q)=>Q.test(q)).join(`
|
|
22
|
-
`),G=G.split(`
|
|
23
|
-
`).filter((q)=>Q.test(q)).join(`
|
|
24
|
-
`)}catch(Q){throw Error(`Invalid regex filter: ${Q instanceof Error?Q.message:String(Q)}`)}return{bash_id:Y,command:$.command,stdout:B,stderr:G,exitCode:$.exitCode,isRunning:$.isRunning,duration:$.duration}}}),W2=T({description:"Kill a background bash process",inputSchema:K.object({bash_id:K.string().describe("bash_id of process to kill")}),execute:async({bash_id:Y})=>{if(!XY.kill(Y))throw Error(`Bash process not found: ${Y}`);return{bash_id:Y,status:"killed",message:`Sent termination signal to bash process ${Y}`}}}),SY={bash:$2,"bash-output":B2,"kill-bash":W2};import{readdir as G2,readFile as Q2,stat as H2}from"node:fs/promises";import{join as U2}from"node:path";function EZ(Y,X){let $=Y.replace(/\./g,"\\.").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/\?/g,".");return new RegExp(`^${$}$`).test(X)}async function vY(Y,X,$,B=[]){if(B.length>=$)return B;try{let G=await G2(Y,{withFileTypes:!0});for(let Q of G){if(B.length>=$)break;let q=U2(Y,Q.name);if(Q.isDirectory()&&["node_modules",".git","dist","build",".next"].includes(Q.name))continue;if(Q.isDirectory())await vY(q,X,$,B);else if(EZ(X,q)||EZ(X,Q.name))B.push(q)}return B}catch(G){return B}}var J2=T({description:"Search for files matching a glob pattern",inputSchema:K.object({pattern:K.string().describe('Glob pattern: * (any except /), ** (any), ? (single). Examples: "*.ts", "src/**/*.tsx"'),path:K.string().optional().describe("Directory to search")}),execute:async({pattern:Y,path:X})=>{let $=X||process.cwd(),B=await vY($,Y,1000);return{pattern:Y,directory:$,files:B,count:B.length}}}),q2=T({description:"Search for text content within files using regex patterns",inputSchema:K.object({pattern:K.string().describe("Regex pattern to search"),path:K.string().optional().describe("File or directory to search"),output_mode:K.enum(["content","files_with_matches","count"]).default("files_with_matches").optional().describe("content: show lines | files_with_matches: show paths | count: show counts"),type:K.string().optional().describe("File type: js, ts, py, rust, go, java, c, cpp, html, css, json, yaml, md"),glob:K.string().optional().describe('Glob filter: "*.js", "*.{ts,tsx}"'),"-i":K.boolean().optional().describe("Case insensitive"),"-n":K.boolean().optional().describe("Show line numbers (content mode only)"),"-A":K.number().optional().describe("Lines after match (content mode only)"),"-B":K.number().optional().describe("Lines before match (content mode only)"),"-C":K.number().optional().describe("Lines before and after match (content mode only)"),multiline:K.boolean().optional().describe("Multiline mode: . matches newlines"),head_limit:K.number().optional().describe("Limit output to first N entries")}),execute:async({pattern:Y,path:X,output_mode:$="files_with_matches",type:B,glob:G,"-i":Q=!1,"-n":q=!1,"-A":J=0,"-B":N=0,"-C":O,multiline:w=!1,head_limit:L})=>{let V=X||process.cwd(),F="**/*";if(G)F=G;else if(B)F={js:"*.{js,jsx}",ts:"*.{ts,tsx}",py:"*.py",rust:"*.rs",go:"*.go",java:"*.java",c:"*.{c,h}",cpp:"*.{cpp,hpp,cc,cxx}",html:"*.{html,htm}",css:"*.{css,scss,sass}",json:"*.json",yaml:"*.{yaml,yml}",md:"*.md"}[B]||`*.${B}`;let C=await vY(V,F,1000),P=O!==void 0?O:N||0,I=O!==void 0?O:J||0,h="g";if(Q)h+="i";if(w)h+="s";let u=new RegExp(Y,h),S=[],m=new Set,d=0;for(let A of C)try{if((await H2(A)).size>1048576)continue;let JY=await Q2(A,"utf8");if(w){if(u.test(JY))m.add(A),d++}else{let D=JY.split(`
|
|
25
|
-
`);for(let g=0;g<D.length;g++)if(u.test(D[g])){if(m.add(A),d++,$==="content"){let s=Math.max(0,g-P),c=Math.min(D.length-1,g+I);for(let f=s;f<=c;f++){let e=q?`${f+1}: ${D[f]}`:D[f];S.push({file:A,line:f+1,content:e})}}}}}catch{continue}let UY=(A)=>{return L?A.slice(0,L):A};if($==="content")return{pattern:Y,directory:V,matches:UY(S),count:S.length};else if($==="files_with_matches")return{pattern:Y,directory:V,files:UY(Array.from(m)),count:m.size};else return{pattern:Y,directory:V,count:d}}}),fY={glob:J2,grep:q2};var r=null,p=[],$Y=!1,OY=null;function RZ(){if(OY)OY(p.length)}function a2(Y){OY=Y}function t2(){return r!==null}function e2(){return p.length}function Y4(Y){r=Y}function Z4(){r=null,p=[],$Y=!1,OY=null}async function xZ(){if($Y||p.length===0||!r)return;$Y=!0;let Y=p.shift();RZ();try{let X=await r({type:"selection",questions:[{id:Y.id,question:Y.question,options:Y.options,multiSelect:Y.multiSelect,preSelected:Y.preSelected}]}),$=typeof X==="string"?X:X[Y.id],B=Array.isArray($)?$.join(", "):$||"";Y.resolve(B)}catch(X){console.error("[processAsk] Error:",X),Y.resolve("")}finally{if($Y=!1,p.length>0)xZ()}}var K2=T({description:"Ask the user a multiple choice question and wait for their selection. Supports predefined options, free text input, and default selections.",inputSchema:K.object({question:K.string().describe("Question to ask"),options:K.array(K.object({label:K.string().describe("Display text for this option"),value:K.string().optional().describe("Return value (defaults to label if not provided)"),freeText:K.boolean().optional().describe('If true, selecting this option lets user type custom text instead of selecting from list. Use for "Other..." options'),placeholder:K.string().optional().describe('Placeholder text shown when user enters free text mode (e.g., "Enter custom option...")'),checked:K.boolean().optional().describe("Default checked state (only for multiSelect). If true, option is pre-selected")})).min(1).describe("Options to choose from. Can include free text options for custom input"),multiSelect:K.boolean().optional().describe("Allow multiple selections. Returns comma-separated values. Use checked field to pre-select options"),preSelected:K.array(K.string()).optional().describe("Pre-selected values for multi-select (question-level default). Use option.checked for per-option control")}),execute:async({question:Y,options:X,multiSelect:$,preSelected:B})=>{if(!r)throw Error("User input handler not available. This tool can only be used in interactive mode.");return new Promise((G)=>{let Q=`ask_${Date.now()}_${Math.random()}`;if(p.push({id:Q,question:Y,options:X,multiSelect:$,preSelected:B,resolve:G}),RZ(),!$Y)xZ()})}}),mY={ask:K2};var zZ=(Y)=>{let X,$=new Set,B=(O,w)=>{let L=typeof O==="function"?O(X):O;if(!Object.is(L,X)){let V=X;X=(w!=null?w:typeof L!=="object"||L===null)?L:Object.assign({},X,L),$.forEach((F)=>F(X,V))}},G=()=>X,J={setState:B,getState:G,getInitialState:()=>N,subscribe:(O)=>{return $.add(O),()=>$.delete(O)}},N=X=Y(B,G,J);return J},VZ=(Y)=>Y?zZ(Y):zZ;var BY=OZ(DZ(),1);var O2=(Y)=>Y;function w2(Y,X=O2){let $=BY.default.useSyncExternalStore(Y.subscribe,BY.default.useCallback(()=>X(Y.getState()),[Y,X]),BY.default.useCallback(()=>X(Y.getInitialState()),[Y,X]));return BY.default.useDebugValue($),$}var jZ=(Y)=>{let X=VZ(Y),$=(B)=>w2(X,B);return Object.assign($,X),$},FZ=(Y)=>Y?jZ(Y):jZ;var kZ=Symbol.for("immer-nothing"),PZ=Symbol.for("immer-draftable"),k=Symbol.for("immer-state"),L2=[function(Y){return`The plugin for '${Y}' has not been loaded into Immer. To enable the plugin, import and call \`enable${Y}()\` when initializing your application.`},function(Y){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${Y}'`},"This object has been frozen and should not be mutated",function(Y){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+Y},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(Y){return`'current' expects a draft, got: ${Y}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(Y){return`'original' expects a draft, got: ${Y}`}];function _(Y,...X){{let $=L2[Y],B=typeof $==="function"?$.apply(null,X):$;throw Error(`[Immer] ${B}`)}throw Error(`[Immer] minified error nr: ${Y}. Full error at: https://bit.ly/3cXEKWf`)}var WY=Object.getPrototypeOf;function a(Y){return!!Y&&!!Y[k]}function i(Y){if(!Y)return!1;return SZ(Y)||Array.isArray(Y)||!!Y[PZ]||!!Y.constructor?.[PZ]||HY(Y)||VY(Y)}var E2=Object.prototype.constructor.toString(),IZ=new WeakMap;function SZ(Y){if(!Y||typeof Y!=="object")return!1;let X=Object.getPrototypeOf(Y);if(X===null||X===Object.prototype)return!0;let $=Object.hasOwnProperty.call(X,"constructor")&&X.constructor;if($===Object)return!0;if(typeof $!=="function")return!1;let B=IZ.get($);if(B===void 0)B=Function.toString.call($),IZ.set($,B);return B===E2}function EY(Y,X,$=!0){if(zY(Y)===0)($?Reflect.ownKeys(Y):Object.keys(Y)).forEach((G)=>{X(G,Y[G],Y)});else Y.forEach((B,G)=>X(G,B,Y))}function zY(Y){let X=Y[k];return X?X.type_:Array.isArray(Y)?1:HY(Y)?2:VY(Y)?3:0}function bY(Y,X){return zY(Y)===2?Y.has(X):Object.prototype.hasOwnProperty.call(Y,X)}function vZ(Y,X,$){let B=zY(Y);if(B===2)Y.set(X,$);else if(B===3)Y.add($);else Y[X]=$}function R2(Y,X){if(Y===X)return Y!==0||1/Y===1/X;else return Y!==Y&&X!==X}function HY(Y){return Y instanceof Map}function VY(Y){return Y instanceof Set}function l(Y){return Y.copy_||Y.base_}function hY(Y,X){if(HY(Y))return new Map(Y);if(VY(Y))return new Set(Y);if(Array.isArray(Y))return Array.prototype.slice.call(Y);let $=SZ(Y);if(X===!0||X==="class_only"&&!$){let B=Object.getOwnPropertyDescriptors(Y);delete B[k];let G=Reflect.ownKeys(B);for(let Q=0;Q<G.length;Q++){let q=G[Q],J=B[q];if(J.writable===!1)J.writable=!0,J.configurable=!0;if(J.get||J.set)B[q]={configurable:!0,writable:!0,enumerable:J.enumerable,value:Y[q]}}return Object.create(WY(Y),B)}else{let B=WY(Y);if(B!==null&&$)return{...Y};let G=Object.create(B);return Object.assign(G,Y)}}function lY(Y,X=!1){if(DY(Y)||a(Y)||!i(Y))return Y;if(zY(Y)>1)Object.defineProperties(Y,{set:LY,add:LY,clear:LY,delete:LY});if(Object.freeze(Y),X)Object.values(Y).forEach(($)=>lY($,!0));return Y}function x2(){_(2)}var LY={value:x2};function DY(Y){if(Y===null||typeof Y!=="object")return!0;return Object.isFrozen(Y)}var z2={};function n(Y){let X=z2[Y];if(!X)_(0,Y);return X}var GY;function fZ(){return GY}function V2(Y,X){return{drafts_:[],parent_:Y,immer_:X,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function CZ(Y,X){if(X)n("Patches"),Y.patches_=[],Y.inversePatches_=[],Y.patchListener_=X}function uY(Y){dY(Y),Y.drafts_.forEach(D2),Y.drafts_=null}function dY(Y){if(Y===GY)GY=Y.parent_}function AZ(Y){return GY=V2(GY,Y)}function D2(Y){let X=Y[k];if(X.type_===0||X.type_===1)X.revoke_();else X.revoked_=!0}function TZ(Y,X){X.unfinalizedDrafts_=X.drafts_.length;let $=X.drafts_[0];if(Y!==void 0&&Y!==$){if($[k].modified_)uY(X),_(4);if(i(Y)){if(Y=RY(X,Y),!X.parent_)xY(X,Y)}if(X.patches_)n("Patches").generateReplacementPatches_($[k].base_,Y,X.patches_,X.inversePatches_)}else Y=RY(X,$,[]);if(uY(X),X.patches_)X.patchListener_(X.patches_,X.inversePatches_);return Y!==kZ?Y:void 0}function RY(Y,X,$){if(DY(X))return X;let B=Y.immer_.shouldUseStrictIteration(),G=X[k];if(!G)return EY(X,(Q,q)=>_Z(Y,G,X,Q,q,$),B),X;if(G.scope_!==Y)return X;if(!G.modified_)return xY(Y,G.base_,!0),G.base_;if(!G.finalized_){G.finalized_=!0,G.scope_.unfinalizedDrafts_--;let Q=G.copy_,q=Q,J=!1;if(G.type_===3)q=new Set(Q),Q.clear(),J=!0;if(EY(q,(N,O)=>_Z(Y,G,Q,N,O,$,J),B),xY(Y,Q,!1),$&&Y.patches_)n("Patches").generatePatches_(G,$,Y.patches_,Y.inversePatches_)}return G.copy_}function _Z(Y,X,$,B,G,Q,q){if(G==null)return;if(typeof G!=="object"&&!q)return;let J=DY(G);if(J&&!q)return;if(G===$)_(5);if(a(G)){let N=Q&&X&&X.type_!==3&&!bY(X.assigned_,B)?Q.concat(B):void 0,O=RY(Y,G,N);if(vZ($,B,O),a(O))Y.canAutoFreeze_=!1;else return}else if(q)$.add(G);if(i(G)&&!J){if(!Y.immer_.autoFreeze_&&Y.unfinalizedDrafts_<1)return;if(X&&X.base_&&X.base_[B]===G&&J)return;if(RY(Y,G),(!X||!X.scope_.parent_)&&typeof B!=="symbol"&&(HY($)?$.has(B):Object.prototype.propertyIsEnumerable.call($,B)))xY(Y,G)}}function xY(Y,X,$=!1){if(!Y.parent_&&Y.immer_.autoFreeze_&&Y.canAutoFreeze_)lY(X,$)}function j2(Y,X){let $=Array.isArray(Y),B={type_:$?1:0,scope_:X?X.scope_:fZ(),modified_:!1,finalized_:!1,assigned_:{},parent_:X,base_:Y,draft_:null,copy_:null,revoke_:null,isManual_:!1},G=B,Q=iY;if($)G=[B],Q=QY;let{revoke:q,proxy:J}=Proxy.revocable(G,Q);return B.draft_=J,B.revoke_=q,J}var iY={get(Y,X){if(X===k)return Y;let $=l(Y);if(!bY($,X))return F2(Y,$,X);let B=$[X];if(Y.finalized_||!i(B))return B;if(B===gY(Y.base_,X))return yY(Y),Y.copy_[X]=pY(B,Y);return B},has(Y,X){return X in l(Y)},ownKeys(Y){return Reflect.ownKeys(l(Y))},set(Y,X,$){let B=mZ(l(Y),X);if(B?.set)return B.set.call(Y.draft_,$),!0;if(!Y.modified_){let G=gY(l(Y),X),Q=G?.[k];if(Q&&Q.base_===$)return Y.copy_[X]=$,Y.assigned_[X]=!1,!0;if(R2($,G)&&($!==void 0||bY(Y.base_,X)))return!0;yY(Y),cY(Y)}if(Y.copy_[X]===$&&($!==void 0||(X in Y.copy_))||Number.isNaN($)&&Number.isNaN(Y.copy_[X]))return!0;return Y.copy_[X]=$,Y.assigned_[X]=!0,!0},deleteProperty(Y,X){if(gY(Y.base_,X)!==void 0||X in Y.base_)Y.assigned_[X]=!1,yY(Y),cY(Y);else delete Y.assigned_[X];if(Y.copy_)delete Y.copy_[X];return!0},getOwnPropertyDescriptor(Y,X){let $=l(Y),B=Reflect.getOwnPropertyDescriptor($,X);if(!B)return B;return{writable:!0,configurable:Y.type_!==1||X!=="length",enumerable:B.enumerable,value:$[X]}},defineProperty(){_(11)},getPrototypeOf(Y){return WY(Y.base_)},setPrototypeOf(){_(12)}},QY={};EY(iY,(Y,X)=>{QY[Y]=function(){return arguments[0]=arguments[0][0],X.apply(this,arguments)}});QY.deleteProperty=function(Y,X){if(isNaN(parseInt(X)))_(13);return QY.set.call(this,Y,X,void 0)};QY.set=function(Y,X,$){if(X!=="length"&&isNaN(parseInt(X)))_(14);return iY.set.call(this,Y[0],X,$,Y[0])};function gY(Y,X){let $=Y[k];return($?l($):Y)[X]}function F2(Y,X,$){let B=mZ(X,$);return B?"value"in B?B.value:B.get?.call(Y.draft_):void 0}function mZ(Y,X){if(!(X in Y))return;let $=WY(Y);while($){let B=Object.getOwnPropertyDescriptor($,X);if(B)return B;$=WY($)}return}function cY(Y){if(!Y.modified_){if(Y.modified_=!0,Y.parent_)cY(Y.parent_)}}function yY(Y){if(!Y.copy_)Y.copy_=hY(Y.base_,Y.scope_.immer_.useStrictShallowCopy_)}var P2=class{constructor(Y){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(X,$,B)=>{if(typeof X==="function"&&typeof $!=="function"){let Q=$;$=X;let q=this;return function(N=Q,...O){return q.produce(N,(w)=>$.call(this,w,...O))}}if(typeof $!=="function")_(6);if(B!==void 0&&typeof B!=="function")_(7);let G;if(i(X)){let Q=AZ(this),q=pY(X,void 0),J=!0;try{G=$(q),J=!1}finally{if(J)uY(Q);else dY(Q)}return CZ(Q,B),TZ(G,Q)}else if(!X||typeof X!=="object"){if(G=$(X),G===void 0)G=X;if(G===kZ)G=void 0;if(this.autoFreeze_)lY(G,!0);if(B){let Q=[],q=[];n("Patches").generateReplacementPatches_(X,G,Q,q),B(Q,q)}return G}else _(1,X)},this.produceWithPatches=(X,$)=>{if(typeof X==="function")return(q,...J)=>this.produceWithPatches(q,(N)=>X(N,...J));let B,G;return[this.produce(X,$,(q,J)=>{B=q,G=J}),B,G]},typeof Y?.autoFreeze==="boolean")this.setAutoFreeze(Y.autoFreeze);if(typeof Y?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(Y.useStrictShallowCopy);if(typeof Y?.useStrictIteration==="boolean")this.setUseStrictIteration(Y.useStrictIteration)}createDraft(Y){if(!i(Y))_(8);if(a(Y))Y=I2(Y);let X=AZ(this),$=pY(Y,void 0);return $[k].isManual_=!0,dY(X),$}finishDraft(Y,X){let $=Y&&Y[k];if(!$||!$.isManual_)_(9);let{scope_:B}=$;return CZ(B,X),TZ(void 0,B)}setAutoFreeze(Y){this.autoFreeze_=Y}setUseStrictShallowCopy(Y){this.useStrictShallowCopy_=Y}setUseStrictIteration(Y){this.useStrictIteration_=Y}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(Y,X){let $;for($=X.length-1;$>=0;$--){let G=X[$];if(G.path.length===0&&G.op==="replace"){Y=G.value;break}}if($>-1)X=X.slice($+1);let B=n("Patches").applyPatches_;if(a(Y))return B(Y,X);return this.produce(Y,(G)=>B(G,X))}};function pY(Y,X){let $=HY(Y)?n("MapSet").proxyMap_(Y,X):VY(Y)?n("MapSet").proxySet_(Y,X):j2(Y,X);return(X?X.scope_:fZ()).drafts_.push($),$}function I2(Y){if(!a(Y))_(10,Y);return gZ(Y)}function gZ(Y){if(!i(Y)||DY(Y))return Y;let X=Y[k],$,B=!0;if(X){if(!X.modified_)return X.base_;X.finalized_=!0,$=hY(Y,X.scope_.immer_.useStrictShallowCopy_),B=X.scope_.immer_.shouldUseStrictIteration()}else $=hY(Y,!0);if(EY($,(G,Q)=>{vZ($,G,gZ(Q))},B),X)X.finalized_=!1;return $}var C2=new P2,yZ=C2.produce;var A2=(Y)=>(X,$,B)=>{return B.setState=(G,Q,...q)=>{let J=typeof G==="function"?yZ(G):G;return X(J,Q,...q)},Y(B.setState,$,B)},bZ=A2;var T2=(Y)=>(X,$,B)=>{let G=B.subscribe;return B.subscribe=(q,J,N)=>{let O=q;if(J){let w=(N==null?void 0:N.equalityFn)||Object.is,L=q(B.getState());if(O=(V)=>{let F=q(V);if(!w(L,F)){let C=L;J(L=F,C)}},N==null?void 0:N.fireImmediately)J(L,L)}return G(O)},Y(X,$,B)},hZ=T2;var uZ=FZ()(hZ(bZ((Y)=>({currentScreen:"chat",navigateTo:(X)=>Y(($)=>{$.currentScreen=X}),aiConfig:null,setAIConfig:(X)=>Y(($)=>{$.aiConfig=X}),updateProvider:(X,$)=>Y((B)=>{if(!B.aiConfig)B.aiConfig={providers:{}};if(!B.aiConfig.providers)B.aiConfig.providers={};B.aiConfig.providers[X]={...B.aiConfig.providers[X],...$}}),removeProvider:(X)=>Y(($)=>{if($.aiConfig?.providers)delete $.aiConfig.providers[X];if($.aiConfig?.defaultProvider===X)$.aiConfig.defaultProvider=void 0,$.aiConfig.defaultModel=void 0}),selectedProvider:null,selectedModel:null,setSelectedProvider:(X)=>Y(($)=>{$.selectedProvider=X}),setSelectedModel:(X)=>Y(($)=>{$.selectedModel=X}),sessions:[],currentSessionId:null,createSession:(X,$)=>{let B=`session-${Date.now()}`,G=Date.now();return Y((Q)=>{Q.sessions.push({id:B,provider:X,model:$,messages:[],todos:[],nextTodoId:1,created:G,updated:G}),Q.currentSessionId=B}),b().then((Q)=>{Q.createSessionFromData({id:B,provider:X,model:$,nextTodoId:1,created:G,updated:G}).catch((q)=>{console.error("Failed to create session in database:",q)})}),B},updateSessionModel:(X,$)=>{Y((B)=>{let G=B.sessions.find((Q)=>Q.id===X);if(G)G.model=$}),b().then((B)=>{B.updateSessionModel(X,$).catch((G)=>{console.error("Failed to update session model in database:",G)})})},updateSessionProvider:(X,$,B)=>{Y((G)=>{let Q=G.sessions.find((q)=>q.id===X);if(Q)Q.provider=$,Q.model=B}),b().then((G)=>{G.updateSessionProvider(X,$,B).catch((Q)=>{console.error("Failed to update session provider in database:",Q)})})},updateSessionTitle:(X,$)=>{Y((B)=>{let G=B.sessions.find((Q)=>Q.id===X);if(G)G.title=$}),b().then((B)=>{B.updateSessionTitle(X,$).catch((G)=>{console.error("Failed to update session title in database:",G)})})},addMessage:(X,$,B,G,Q,q,J,N)=>{let O=typeof B==="string"?[{type:"text",content:B}]:B;Y((w)=>{let L=w.sessions.find((V)=>V.id===X);if(L)L.messages.push({role:$,content:O,timestamp:Date.now(),status:"completed",...G!==void 0&&G.length>0&&{attachments:G},...Q!==void 0&&{usage:Q},...q!==void 0&&{finishReason:q},...J!==void 0&&{metadata:J},...N!==void 0&&N.length>0&&{todoSnapshot:N}})}),b().then((w)=>{w.addMessage(X,$,O,G,Q,q,J,N).catch((L)=>{console.error("Failed to add message to database:",L)})})},setCurrentSession:(X)=>Y(($)=>{$.currentSessionId=X}),deleteSession:(X)=>{Y(($)=>{if($.sessions=$.sessions.filter((B)=>B.id!==X),$.currentSessionId===X)$.currentSessionId=null}),b().then(($)=>{$.deleteSession(X).catch((B)=>{console.error("Failed to delete session from database:",B)})})},isLoading:!1,error:null,setLoading:(X)=>Y(($)=>{$.isLoading=X}),setError:(X)=>Y(($)=>{$.error=X}),currentAgentId:"coder",setCurrentAgentId:(X)=>Y(($)=>{$.currentAgentId=X}),enabledRuleIds:[],setEnabledRuleIds:(X)=>Y(($)=>{$.enabledRuleIds=X}),debugLogs:[],addDebugLog:(X)=>Y(($)=>{if(!process.env.DEBUG)return;let B=new Date().toLocaleTimeString();$.debugLogs.push(`[${B}] ${X}`);let G=1000;if($.debugLogs.length>G)$.debugLogs=$.debugLogs.slice(-G/2)}),clearDebugLogs:()=>Y((X)=>{X.debugLogs=[]}),notificationSettings:{osNotifications:!0,terminalNotifications:!0,sound:!0,autoGenerateTitle:!0},updateNotificationSettings:(X)=>Y(($)=>{$.notificationSettings={...$.notificationSettings,...X}}),updateTodos:(X,$)=>Y((B)=>{let G=B.sessions.find((J)=>J.id===X);if(!G)return;for(let J of $)if(J.id===void 0||J.id===null){let N=G.nextTodoId,O=G.todos.length>0?Math.max(...G.todos.map((w)=>w.ordering)):0;G.todos.push({id:N,content:J.content||"",activeForm:J.activeForm||"",status:J.status||"pending",ordering:O+10}),G.nextTodoId=N+1}else{let N=G.todos.find((O)=>O.id===J.id);if(!N)continue;if(J.content!==void 0)N.content=J.content;if(J.activeForm!==void 0)N.activeForm=J.activeForm;if(J.status!==void 0)N.status=J.status;if(J.reorder){let{type:O,id:w}=J.reorder;if(O==="top"){let L=Math.min(...G.todos.map((V)=>V.ordering));N.ordering=L-10}else if(O==="last"){let L=Math.max(...G.todos.map((V)=>V.ordering));N.ordering=L+10}else if(O==="before"&&w!==void 0){let L=G.todos.find((V)=>V.id===w);if(L){let V=[...G.todos].sort((P,I)=>P.ordering-I.ordering||P.id-I.id),F=V.findIndex((P)=>P.id===w),C=F>0?V[F-1]:null;if(C)N.ordering=Math.floor((C.ordering+L.ordering)/2);else N.ordering=L.ordering-10}}else if(O==="after"&&w!==void 0){let L=G.todos.find((V)=>V.id===w);if(L){let V=[...G.todos].sort((P,I)=>P.ordering-I.ordering||P.id-I.id),F=V.findIndex((P)=>P.id===w),C=F<V.length-1?V[F+1]:null;if(C)N.ordering=Math.floor((L.ordering+C.ordering)/2);else N.ordering=L.ordering+10}}}}let Q=JSON.parse(JSON.stringify(G.todos)),q=G.nextTodoId;b().then((J)=>{J.updateTodos(X,Q,q).catch((N)=>{console.error("Failed to update todos in database:",N)})})})}))));var G5=(Y)=>{switch(Y){case"in_progress":return"▶";case"pending":return"○";case"completed":return"✓";case"removed":return"✗"}},Q5=(Y)=>{switch(Y){case"in_progress":return"#00FF88";case"pending":return"gray";case"completed":return"green";case"removed":return"red"}},H5=(Y)=>{return Y.status==="in_progress"?Y.activeForm:Y.content},U5=(Y)=>{return Y==="pending"||Y==="completed"},J5=(Y)=>{return Y==="in_progress"},q5=(Y)=>{return Y==="completed"},jY=(Y,X,$,B)=>{if(Y==="added")return`+ ${X.content}`;if(Y==="reordered"&&B)return`[${X.id}] reordered to ${B}`;if(Y==="updated"&&$&&$!==X.status)return`[${X.id}] ${$} → ${X.status}`;return`[${X.id}] updated`};var _2=T({description:"Update task list to track work progress",inputSchema:K.object({todos:K.array(K.object({id:K.number().optional().describe("ID to update existing, omit to add new"),content:K.string().optional().describe('Imperative form: "Build feature"'),activeForm:K.string().optional().describe('Present continuous: "Building feature"'),status:K.enum(["pending","in_progress","completed","removed"]).optional().describe("pending | in_progress (keep ONE only) | completed | removed"),reorder:K.object({type:K.enum(["top","last","before","after"]).describe("top | last | before | after"),id:K.number().optional().describe("Target ID (for before/after)")}).optional().describe("Change order")})).describe('Add/update todos. Examples: [{ content: "Build login", activeForm: "Building login", status: "pending" }] | [{ id: 1, status: "completed" }]')}),execute:({todos:Y})=>{let X=uZ.getState(),$=X.currentSessionId;if(!$)return{error:"No active session",summary:"Failed: no active session",changes:[],total:0};let B=X.sessions.find((w)=>w.id===$);if(!B)return{error:"Session not found",summary:"Failed: session not found",changes:[],total:0};let G=B.todos;X.updateTodos($,Y);let q=X.sessions.find((w)=>w.id===$)?.todos||[],J=Y.filter((w)=>w.id===void 0),N=Y.filter((w)=>w.id!==void 0),O=[];if(J.length>0)J.forEach((w)=>{let L=q.find((V)=>V.content===w.content);if(L)O.push(jY("added",L))});if(N.length>0)N.forEach((w)=>{let L=G.find((F)=>F.id===w.id),V=q.find((F)=>F.id===w.id);if(L&&V){if(w.status&&w.status!==L.status)O.push(jY("updated",V,L.status));else if(w.reorder)O.push(jY("reordered",V,void 0,w.reorder.type))}});return{summary:`${J.length} added, ${N.length} updated`,changes:O.length>0?O:["No changes"],total:q.filter((w)=>w.status!=="removed").length}}}),nY={updateTodos:_2};function k2(Y={}){let{interactive:X=!0}=Y;return{...kY,...SY,...fY,...X?mY:{},...nY}}function D5(){return{filesystem:Object.keys(kY),shell:Object.keys(SY),search:Object.keys(fY),interaction:Object.keys(mY),todo:Object.keys(nY)}}function j5(){return Object.keys(k2())}export{tZ as writeFileTool,SY as shellTools,Y4 as setUserInputHandler,a2 as setQueueUpdateCallback,fY as searchTools,aZ as readFileTool,W2 as killBashTool,mY as interactionTools,t2 as hasUserInputHandler,q2 as grepTool,J2 as globTool,D5 as getToolCategories,e2 as getQueueLength,j5 as getAllToolNames,k2 as getAISDKTools,kY as filesystemTools,$2 as executeBashTool,eZ as editFileTool,Z4 as clearUserInputHandler,B2 as bashOutputTool,K2 as askUserSelectionTool};export{DZ as s,a2 as t,t2 as u,Y4 as v,Z4 as w,uZ as x,G5 as y,Q5 as z,H5 as A,U5 as B,J5 as C,q5 as D,k2 as E};
|
|
26
|
-
|
|
27
|
-
//# debugId=1E9EC7ECA365ED9164756E2164756E21
|