@krapht/ork 1.0.0-alpha.2 → 1.0.0-alpha.21
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/README.md +12 -7
- package/dist/__build_info__-0wqQ-rtf.mjs +180 -0
- package/dist/apply-Mb0fNpCX.mjs +17 -0
- package/dist/argument-error-CihH46Le.mjs +27 -0
- package/dist/attach-C0-YyNoY.mjs +92 -0
- package/dist/attach-CAKNqnUK.mjs +1259 -0
- package/dist/bin.mjs +1885 -1609
- package/dist/brief-C2hew8cS.mjs +116 -0
- package/dist/{decide-CGyx9rv7.mjs → builtin-files-YYAnbZGD.mjs} +3 -51
- package/dist/chips-CP_pgKlj.mjs +48 -0
- package/dist/command-tree-CEkzWNy6.mjs +63 -0
- package/dist/{completion-CSU5vkEt.mjs → completion-K4rAVsrf.mjs} +200 -30
- package/dist/context-B-fjPJky.mjs +106 -0
- package/dist/context-DMK0U1w0.mjs +160 -0
- package/dist/detached-q0AYG0Bs.mjs +39 -0
- package/dist/extra-arguments-BxQMXARO.mjs +13 -0
- package/dist/{find-D6Gj1sxg.mjs → find-Ct5CNl1J.mjs} +2 -2
- package/dist/flags-C90N4J1i.mjs +145 -0
- package/dist/follow-ups-D3HPyNYM.mjs +568 -0
- package/dist/format-CiPhQqbX.mjs +260 -0
- package/dist/{help-groups-BwYoAWsh.mjs → help-groups-BQvcKQ9H.mjs} +49 -78
- package/dist/in-a-run-D_wg4iJi.mjs +27 -0
- package/dist/install-Hji6LIei.mjs +259 -0
- package/dist/{limits-B1-DYc3d.mjs → limits-BD6RZRCS.mjs} +2 -2
- package/dist/{mcp-DE_EmyVm.mjs → mcp-CpbDmBLG.mjs} +6 -6
- package/dist/once-J8Qn5fTG.mjs +112 -0
- package/dist/orphan-guard-BFKg8VSd.mjs +58 -0
- package/dist/output-DXZbnFt_.mjs +458 -0
- package/dist/outputs-text-CNTJ7Qq_.mjs +19 -0
- package/dist/{pause-CL6N_Xrj.mjs → pause-Cl4ZYA35.mjs} +7 -4
- package/dist/print-DzugGZQB.mjs +19 -0
- package/dist/project-records-CtkmlsHN.mjs +233 -0
- package/dist/refusals-DQQX3AIb.mjs +116 -0
- package/dist/{relay-0SD0erwf.mjs → relay-CiP77vga.mjs} +2 -2
- package/dist/run-CtuNY3mE.mjs +234 -0
- package/dist/send-DRYGks8K.mjs +104 -0
- package/dist/short-flags-DkJLWVqh.mjs +1 -0
- package/dist/short-flags-Qf21as0E.mjs +83 -0
- package/dist/src-BMFQKHz4.mjs +3122 -0
- package/dist/{src-BbyEoMn4.mjs → src-BrFfDKux.mjs} +800 -235
- package/dist/{src-Dujmvv4s.mjs → src-BuF9Lbow.mjs} +12580 -5505
- package/dist/{src-DOcK8Jfp.mjs → src-k0A_QpST.mjs} +1024 -590
- package/dist/store-rTgRu8xy.mjs +25 -0
- package/dist/ui/THIRD_PARTY_LICENSES.txt +612 -0
- package/dist/ui/assets/app-BYxpKJRh.css +1 -0
- package/dist/ui/assets/app-SEFEJLkF.js +112 -0
- package/dist/ui/assets/{index-9dFha9Qn.js → index-Cb6Voq_W.js} +3 -3
- package/dist/ui/assets/theme-CdXvqTQ6.js +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/{ui-CTmO2Xzu.mjs → ui-C2f37TSb.mjs} +57 -25
- package/dist/usage-BuvGcQSk.mjs +256 -0
- package/dist/validate-ObP5lt29.mjs +1 -0
- package/dist/validate-_HjACtk9.mjs +632 -0
- package/dist/verdict-B592j1W3.mjs +84 -0
- package/dist/{watch-CtbgDAcz.mjs → watch-DV3ixCYj.mjs} +45 -17
- package/dist/{workflows-D1_WVukk.mjs → workflows-QLjBhGNS.mjs} +30 -5
- package/dist/worktrees-D3ubG_Qw.mjs +302 -0
- package/dist/yolo-BSH1E_kE.mjs +33 -0
- package/package.json +10 -8
- package/dist/__build_info__-fy6L1Mrd.mjs +0 -615
- package/dist/clean-DaHjs__2.mjs +0 -88
- package/dist/context-DT8MfEIR.mjs +0 -274
- package/dist/format-Dnfv8zMT.mjs +0 -427
- package/dist/in-a-run-pLAZeNys.mjs +0 -22
- package/dist/list-BrH8KRSJ.mjs +0 -110
- package/dist/output-BLQWD6MJ.mjs +0 -950
- package/dist/remove-BeGdqroy.mjs +0 -194
- package/dist/report-DK4LGqwF.mjs +0 -129
- package/dist/send-C8tunWhv.mjs +0 -163
- package/dist/src-CCUKRX51.mjs +0 -1204
- package/dist/ui/assets/app-BNT0SuIz.css +0 -1
- package/dist/ui/assets/app-T7wVAhgx.js +0 -67
- package/dist/ui/assets/theme-3xH5jxKs.js +0 -1
- package/dist/usage-DYUmP0i4.mjs +0 -419
- package/dist/worktrees-DdMYoNOC.mjs +0 -212
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=d.createContext(void 0),p={disableStyleElements:!1};function m(){return d.useContext(f)??p}var h=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),g=o(((e,t)=>{t.exports=h()})),_=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),v=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()}));function y(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function b(e,t=`|`){return e.map(e=>H(e)).join(t)}function x(e,t){return typeof t==`bigint`?t.toString():t}var S=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function C(e){return new S(e)}function w(e){return e==null}function T(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function E(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function D(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function O(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function k(e){return O(e._zod.def)??e._zod.def.shape}function A(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return D(this,t,e),e},enumerable:!0,configurable:!0})}function j(e,t,n){t in e?D(e,t,n):e[t]=n}function M(e,t,n,r){let i=k(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?A(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):j(e,a,r?r(n.value,a):n.value))}}function N(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?A(e,n,()=>t[n]):j(e,n,r.value))}}function P(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function F(e){return JSON.stringify(e)}function I(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var L=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function R(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var z=C(()=>{if(Q.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function B(e){if(R(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return R(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ee(e){return B(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var te=new Set([`string`,`number`,`symbol`]);function ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function V(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function re(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function H(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ie(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ae={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},oe={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function se(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return M(i,e,U(e,t)),V(e,P(n,{shape:i,checks:[]}))}function U(e,t){let n=k(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(U(e,t)),a={};return M(a,e,Reflect.ownKeys(k(e)).filter(e=>!i.has(e))),V(e,P(n,{shape:a,checks:[]}))}function le(e,t){if(!B(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=k(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return V(e,P(e._zod.def,{shape:W(e,t)}))}function W(e,t){let n={};return M(n,e,Reflect.ownKeys(k(e))),N(n,t),n}function ue(e,t){if(!B(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return V(e,P(e._zod.def,{shape:W(e,t)}))}function de(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return M(n,e,Reflect.ownKeys(k(e))),M(n,t,Reflect.ownKeys(k(t))),V(e,P(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function fe(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(U(t,n)):void 0,o={};return M(o,t,Reflect.ownKeys(k(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),V(t,P(t._zod.def,{shape:o,checks:[]}))}function pe(e,t,n){let r=n?new Set(U(t,n)):void 0,i={};return M(i,t,Reflect.ownKeys(k(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),V(t,P(t._zod.def,{shape:i}))}function me(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function he(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ge(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function G(e){return typeof e==`string`?e:e?.message}function _e(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function ve(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ye(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:G(e.inst?._zod.def?.error?.(e))??G(a?.(e))??G(t?.error?.(e))??G(n.customError?.(e))??G(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var be=/[\uD800-\uDBFF]/;function xe(e){let t=e.length;if(!be.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Se(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ce(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function we(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Te(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Oe(e,n,r.value)}}function K(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ee(e,t,n){return K(e,t,n,!1)}function De(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return K(this,n,r(this))},set(e){K(this,n,e)}})}return t}function Oe(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:K(this,t,n.bind(this))},set(e){K(this,t,e)}})}function ke(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var q,J=!1,Ae={configurable:!0,get(){J=!0}};function je(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&q!==e._zod?q=void 0:(q=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ae);let e=J;J=!1;try{let r=n(this);return J?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),J||=e,r}catch(n){throw delete this[t],J||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Me(e,t,n,r){let i=ke(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Ne=`~constantCatch`;function Pe(e){let t=()=>e;return t[Ne]=!0,t}var Y,X={value:void 0,enumerable:!1},Z=`captureStackTrace`in Error?Error:null;function Fe(e){let t=Z;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Z=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Ie(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){X.value=new a(r);try{Object.defineProperty(n,"_zod",X)}finally{X.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Te(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Fe(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Le=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Re=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Y=globalThis).__zod_globalConfig??(Y.__zod_globalConfig={});var Q=globalThis.__zod_globalConfig;function ze(e){return e&&Object.assign(Q,e),Q}var Be=`(prefers-color-scheme: light)`,Ve=`(prefers-contrast: more)`,He=(e,t)=>{let n=t(Be)?`light`:`dark`;return{theme:e===`system`?n:e,contrast:t(Ve)?`more`:`standard`}},Ue=(e,t)=>{e.dataset.theme=t.theme,e.dataset.contrast=t.contrast},$=(e,t)=>{Ue(e.document.documentElement,He(t,t=>e.matchMedia(t).matches))},We=(e,t)=>{let n=[Be,Ve].map(t=>e.matchMedia(t)),r=()=>{$(e,t())};r();for(let e of n)e.addEventListener(`change`,r);return()=>{for(let e of n)e.removeEventListener(`change`,r)}};export{_e as $,Ee as A,w as B,ne as C,E as D,ye as E,b as F,fe as G,ie as H,x as I,te as J,se as K,de as L,R as M,B as N,y as O,we as P,ee as Q,P as R,F as S,le as T,K as U,ce as V,Ce as W,pe as X,O as Y,ue as Z,V as _,Ie as a,m as at,je as b,oe as c,c as ct,z as d,I as et,D as f,T as g,L as h,Re as i,f as it,Me as j,Se as k,ae as l,C as m,We as n,v as nt,ze as o,u as ot,ve as p,ge as q,Le as r,g as rt,Q as s,o as st,$ as t,H as tt,me as u,xe as v,he as w,De as x,Pe as y,re as z};
|
package/dist/usage-DYUmP0i4.mjs
DELETED
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { Cn as runDirOf, c as usd, ht as liveStatus, xn as placeFor } from "./src-Dujmvv4s.mjs";
|
|
2
|
-
import { a as write, c as openStore, i as style, n as cost, o as writeErr, t as confirm } from "./output-BLQWD6MJ.mjs";
|
|
3
|
-
import { n as listOrkWorktrees, t as createdWorktrees } from "./list-BrH8KRSJ.mjs";
|
|
4
|
-
import { n as usageReport, t as USAGE_DIMENSIONS } from "./report-DK4LGqwF.mjs";
|
|
5
|
-
import "./format-Dnfv8zMT.mjs";
|
|
6
|
-
import { n as limitsHere } from "./limits-B1-DYc3d.mjs";
|
|
7
|
-
import { existsSync, rmSync } from "node:fs";
|
|
8
|
-
import { defineCommand } from "citty";
|
|
9
|
-
// ../core/src/store/prune.ts
|
|
10
|
-
/**
|
|
11
|
-
* @file `ork prune` (ADR-046): which runs may lose their transcript, and doing
|
|
12
|
-
* it. A run goes with the runs it called or was called by, or not at all, and
|
|
13
|
-
* not while it is live, is linked, or has a worktree or branch left: those
|
|
14
|
-
* read the run's events. The usage ledger and feedback records stay.
|
|
15
|
-
*/
|
|
16
|
-
const messageOf = (error) => error instanceof Error ? error.message : String(error);
|
|
17
|
-
/**
|
|
18
|
-
* The runs in a project that still have a worktree or branch. With its folder
|
|
19
|
-
* gone, or no longer a repository, there is nothing left to clean up; any other
|
|
20
|
-
* failure says nothing about them, so it rejects.
|
|
21
|
-
*/
|
|
22
|
-
const runsWithWorktrees = (store) => async (root) => {
|
|
23
|
-
if (!existsSync(root)) return /* @__PURE__ */ new Set();
|
|
24
|
-
try {
|
|
25
|
-
const found = await listOrkWorktrees(root, createdWorktrees(store, root));
|
|
26
|
-
return new Set(found.map((w) => w.runId));
|
|
27
|
-
} catch (error) {
|
|
28
|
-
if (/not a git repository/iu.test(messageOf(error))) return /* @__PURE__ */ new Set();
|
|
29
|
-
throw error;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
/** The run at the top of a run's chain of calls. */
|
|
33
|
-
const callRootOf = (run, byId) => {
|
|
34
|
-
let top = run;
|
|
35
|
-
const seen = /* @__PURE__ */ new Set([run.id]);
|
|
36
|
-
while (top.parent !== void 0) {
|
|
37
|
-
const parent = byId.get(top.parent);
|
|
38
|
-
if (parent === void 0 || seen.has(parent.id)) break;
|
|
39
|
-
seen.add(parent.id);
|
|
40
|
-
top = parent;
|
|
41
|
-
}
|
|
42
|
-
return top.id;
|
|
43
|
-
};
|
|
44
|
-
/** Sorts the runs before the cutoff into those to remove and those to keep. */
|
|
45
|
-
const planPrune = async (store, filter, worktreesOf = runsWithWorktrees(store)) => {
|
|
46
|
-
const all = store.runs();
|
|
47
|
-
const byId = new Map(all.map((run) => [run.id, run]));
|
|
48
|
-
const inScope = (run) => filter.project === void 0 || run.project === filter.project;
|
|
49
|
-
const old = (run) => (store.lastEventAt(run.id) ?? run.finishedAt ?? run.startedAt) < filter.before;
|
|
50
|
-
const trees = /* @__PURE__ */ new Map();
|
|
51
|
-
for (const run of all) {
|
|
52
|
-
const root = callRootOf(run, byId);
|
|
53
|
-
trees.set(root, [...trees.get(root) ?? [], run]);
|
|
54
|
-
}
|
|
55
|
-
const projects = [...new Set(all.filter((r) => old(r) && inScope(r)).map((r) => r.project))];
|
|
56
|
-
const withWorktrees = new Map(await Promise.all(projects.map(async (project) => {
|
|
57
|
-
try {
|
|
58
|
-
return [project, await worktreesOf(project)];
|
|
59
|
-
} catch (error) {
|
|
60
|
-
return [project, messageOf(error)];
|
|
61
|
-
}
|
|
62
|
-
})));
|
|
63
|
-
/** Why this run itself cannot go, or `null` when it can. */
|
|
64
|
-
const blocker = (run) => {
|
|
65
|
-
if (liveStatus(run) === "running") return "it is still running";
|
|
66
|
-
const worktrees = withWorktrees.get(run.project);
|
|
67
|
-
if (typeof worktrees === "string") return `cannot tell whether it has a worktree left: ${worktrees}`;
|
|
68
|
-
if (worktrees?.has(run.id) === true) return "it has a worktree or branch left (ork worktrees clean)";
|
|
69
|
-
if (store.links({
|
|
70
|
-
run: run.id,
|
|
71
|
-
live: true
|
|
72
|
-
}).length > 0) return "it has a live link";
|
|
73
|
-
return null;
|
|
74
|
-
};
|
|
75
|
-
const plan = {
|
|
76
|
-
remove: [],
|
|
77
|
-
keep: []
|
|
78
|
-
};
|
|
79
|
-
for (const tree of trees.values()) {
|
|
80
|
-
const held = tree.map((run) => {
|
|
81
|
-
if (!inScope(run)) return `run ${run.id} of its call is in another project (--all)`;
|
|
82
|
-
if (!old(run)) return `run ${run.id} of its call is newer`;
|
|
83
|
-
const why = blocker(run);
|
|
84
|
-
return why === null ? null : `run ${run.id} of its call stays: ${why}`;
|
|
85
|
-
}).find((why) => why !== null);
|
|
86
|
-
for (const run of tree) {
|
|
87
|
-
if (!inScope(run) || !old(run)) continue;
|
|
88
|
-
if (held === void 0) plan.remove.push(run);
|
|
89
|
-
else plan.keep.push({
|
|
90
|
-
run,
|
|
91
|
-
reason: blocker(run) ?? held
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return plan;
|
|
96
|
-
};
|
|
97
|
-
const SAFE_ID = /^[\w-]+$/u;
|
|
98
|
-
/** Forgets the plan's runs and removes their folders. */
|
|
99
|
-
const applyPrune = (store, plan) => {
|
|
100
|
-
const outcome = {
|
|
101
|
-
removed: 0,
|
|
102
|
-
folders: 0,
|
|
103
|
-
failed: []
|
|
104
|
-
};
|
|
105
|
-
const places = store.projects();
|
|
106
|
-
for (const run of plan.remove) {
|
|
107
|
-
if (!store.deleteRun(run.id)) {
|
|
108
|
-
outcome.failed.push({
|
|
109
|
-
run: run.id,
|
|
110
|
-
reason: "it is running again"
|
|
111
|
-
});
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
outcome.removed += 1;
|
|
115
|
-
if (!SAFE_ID.test(run.id)) continue;
|
|
116
|
-
const place = places.find((p) => p.root === run.project) ?? placeFor(run.project, places);
|
|
117
|
-
const folder = runDirOf(place, run.id);
|
|
118
|
-
if (!existsSync(folder)) continue;
|
|
119
|
-
try {
|
|
120
|
-
rmSync(folder, {
|
|
121
|
-
recursive: true,
|
|
122
|
-
force: true
|
|
123
|
-
});
|
|
124
|
-
outcome.folders += 1;
|
|
125
|
-
} catch (error) {
|
|
126
|
-
outcome.failed.push({
|
|
127
|
-
run: run.id,
|
|
128
|
-
reason: `its folder stays, at ${folder}: ${messageOf(error)}`
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return outcome;
|
|
133
|
-
};
|
|
134
|
-
// src/runs/usage.ts
|
|
135
|
-
/**
|
|
136
|
-
* @file How usage reads on the terminal (`ork usage`, specs/usage.md), and the
|
|
137
|
-
* times its `--since`, `--until` and `ork prune --older-than` take.
|
|
138
|
-
*/
|
|
139
|
-
const UNITS = {
|
|
140
|
-
h: 36e5,
|
|
141
|
-
d: 864e5,
|
|
142
|
-
w: 6048e5
|
|
143
|
-
};
|
|
144
|
-
/** `30d`, `12w`, `24h` before `now`, as an ISO time; `null` when it is not one. */
|
|
145
|
-
const agoTime = (text, now) => {
|
|
146
|
-
const match = /^(\d+)([hdw])$/u.exec(text);
|
|
147
|
-
if (match === null) return null;
|
|
148
|
-
const [, amount = "0", unit = "d"] = match;
|
|
149
|
-
if (Number(amount) === 0) return null;
|
|
150
|
-
const date = new Date(now - Number(amount) * (UNITS[unit] ?? 0));
|
|
151
|
-
return Number.isNaN(date.getTime()) ? null : date.toISOString();
|
|
152
|
-
};
|
|
153
|
-
/** A `YYYY-MM-DD` day's start in the machine's time zone, `after` days on. */
|
|
154
|
-
const dayTime = (text, after) => {
|
|
155
|
-
const match = /^(\d{4})-(\d{2})-(\d{2})$/u.exec(text);
|
|
156
|
-
if (match === null) return null;
|
|
157
|
-
const [, year = "", month = "", day = ""] = match;
|
|
158
|
-
const start = new Date(Number(year), Number(month) - 1, Number(day));
|
|
159
|
-
if (start.getMonth() !== Number(month) - 1) return null;
|
|
160
|
-
if (start.getDate() !== Number(day)) return null;
|
|
161
|
-
start.setDate(start.getDate() + after);
|
|
162
|
-
return start.toISOString();
|
|
163
|
-
};
|
|
164
|
-
/** The start of the day `days` whole days ago, counting today as one. */
|
|
165
|
-
const wholeDays = (days, now) => {
|
|
166
|
-
const today = new Date(now);
|
|
167
|
-
return new Date(today.getFullYear(), today.getMonth(), today.getDate() - (days - 1)).toISOString();
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* `--since`: an age or the day it starts from. Days and weeks are whole days,
|
|
171
|
-
* today among them, as the Usage panel counts them; hours are exact.
|
|
172
|
-
*/
|
|
173
|
-
const sinceTime = (text, now) => {
|
|
174
|
-
const ago = agoTime(text, now);
|
|
175
|
-
if (ago === null) return dayTime(text, 0);
|
|
176
|
-
if (text.endsWith("h")) return ago;
|
|
177
|
-
const amount = Number(text.slice(0, -1));
|
|
178
|
-
return wholeDays(text.endsWith("w") ? amount * 7 : amount, now);
|
|
179
|
-
};
|
|
180
|
-
/** `--until`: the last day it includes. */
|
|
181
|
-
const untilTime = (text) => dayTime(text, 1);
|
|
182
|
-
/** `950`, `12.3k`, `4.5M`. */
|
|
183
|
-
const tokens = (count) => {
|
|
184
|
-
if (count < 1e3) return String(count);
|
|
185
|
-
if (count < 1e6) return `${(count / 1e3).toFixed(1)}k`;
|
|
186
|
-
return `${(count / 1e6).toFixed(1)}M`;
|
|
187
|
-
};
|
|
188
|
-
const percent = (share) => `${String(Math.round(share * 100))}%`;
|
|
189
|
-
const counted = (count, noun) => `${String(count)} ${noun}${count === 1 ? "" : "s"}`;
|
|
190
|
-
const TITLES = {
|
|
191
|
-
day: "By day",
|
|
192
|
-
week: "By week",
|
|
193
|
-
month: "By month",
|
|
194
|
-
workflow: "By workflow",
|
|
195
|
-
node: "Costliest nodes",
|
|
196
|
-
model: "By model",
|
|
197
|
-
driver: "By driver",
|
|
198
|
-
project: "By project"
|
|
199
|
-
};
|
|
200
|
-
const table = (groups) => {
|
|
201
|
-
const rows = groups.map((group) => ({
|
|
202
|
-
key: group.key,
|
|
203
|
-
cost: cost(group.costUsd),
|
|
204
|
-
sessions: String(group.sessions),
|
|
205
|
-
tokens: `${tokens(group.inputTokens + group.cacheReadTokens + group.cacheWriteTokens)} in / ${tokens(group.outputTokens)} out`,
|
|
206
|
-
cache: percent(group.cacheHitRate)
|
|
207
|
-
}));
|
|
208
|
-
const width = (pick, title) => Math.max(title.length, ...rows.map((row) => pick(row).length));
|
|
209
|
-
const w = {
|
|
210
|
-
key: width((r) => r.key, ""),
|
|
211
|
-
cost: width((r) => r.cost, "COST"),
|
|
212
|
-
sessions: width((r) => r.sessions, "SESSIONS"),
|
|
213
|
-
tokens: width((r) => r.tokens, "TOKENS")
|
|
214
|
-
};
|
|
215
|
-
const line = (key, c, s, t, h) => ` ${key.padEnd(w.key)} ${c.padStart(w.cost)} ${s.padStart(w.sessions)} ${t.padEnd(w.tokens)} ${h}`;
|
|
216
|
-
return [style("dim", line("", "COST", "SESSIONS", "TOKENS", "CACHE")), ...rows.map((r) => line(r.key, r.cost, r.sessions, r.tokens, r.cache))];
|
|
217
|
-
};
|
|
218
|
-
/** What `ork usage` prints without `--by`. */
|
|
219
|
-
const OVERVIEW = [
|
|
220
|
-
"day",
|
|
221
|
-
"workflow",
|
|
222
|
-
"model",
|
|
223
|
-
"node"
|
|
224
|
-
];
|
|
225
|
-
/** How many rows the overview shows of each; `--by` shows them all. */
|
|
226
|
-
const OVERVIEW_ROWS = 10;
|
|
227
|
-
const shortTime = (iso) => new Date(iso).toLocaleString(void 0, {
|
|
228
|
-
dateStyle: "medium",
|
|
229
|
-
timeStyle: "short"
|
|
230
|
-
});
|
|
231
|
-
/** The limits across runs, above a report; nothing with none set. */
|
|
232
|
-
const formatLimits = ({ problems, caps, plan }) => {
|
|
233
|
-
if (problems.length === 0 && caps.length === 0 && plan.length === 0) return [];
|
|
234
|
-
return [
|
|
235
|
-
style("bold", "Limits"),
|
|
236
|
-
...problems.map((problem) => style("yellow", ` ${problem}`)),
|
|
237
|
-
...caps.map((cap) => {
|
|
238
|
-
const line = ` ${cap.project === void 0 ? "all projects" : "this project"}, this ${cap.window}: ${usd(cap.spentUsd)} of ${usd(cap.capUsd)}, resets ${shortTime(cap.resetsAt)}`;
|
|
239
|
-
return cap.leftUsd <= 0 ? style("yellow", line) : line;
|
|
240
|
-
}),
|
|
241
|
-
...plan.map((limit) => style("yellow", ` Claude plan's ${limit.window.replaceAll("_", " ")} limit ${limit.status === "rejected" ? "was reached" : "is close"}${limit.resetsAt === void 0 ? "" : `, resets ${shortTime(limit.resetsAt)}`}`)),
|
|
242
|
-
""
|
|
243
|
-
];
|
|
244
|
-
};
|
|
245
|
-
/** The report, as the terminal shows it. */
|
|
246
|
-
const formatUsage = (report, scope, by) => {
|
|
247
|
-
const { totals } = report;
|
|
248
|
-
if (totals.sessions === 0) return [`No Claude sessions in ${scope}.`];
|
|
249
|
-
const lines = [`${style("bold", cost(totals.costUsd))} in ${scope}`, `${counted(totals.runs, "run")} · ${counted(totals.sessions, "session")} · ${counted(totals.turns, "turn")} · ${tokens(totals.inputTokens + totals.cacheReadTokens + totals.cacheWriteTokens)} in / ${tokens(totals.outputTokens)} out · ${percent(totals.cacheHitRate)} from cache`];
|
|
250
|
-
for (const dimension of by === void 0 ? OVERVIEW : [by]) {
|
|
251
|
-
const groups = report.groups[dimension];
|
|
252
|
-
const shown = by === void 0 ? dimension === "day" ? groups.slice(-10) : groups.slice(0, OVERVIEW_ROWS) : groups;
|
|
253
|
-
lines.push("", style("bold", TITLES[dimension]), ...table(shown));
|
|
254
|
-
if (shown.length < groups.length) lines.push(style("dim", ` and ${String(groups.length - shown.length)} more (--by ${dimension})`));
|
|
255
|
-
}
|
|
256
|
-
const hints = report.hints.length === 0 ? [] : [
|
|
257
|
-
"",
|
|
258
|
-
style("bold", "Worth a look"),
|
|
259
|
-
...report.hints.map((h) => ` ${h.message}`)
|
|
260
|
-
];
|
|
261
|
-
return [
|
|
262
|
-
...lines,
|
|
263
|
-
...hints,
|
|
264
|
-
"",
|
|
265
|
-
style("dim", "Costs are Claude Code's own estimates. On a subscription they are not what you are billed.")
|
|
266
|
-
];
|
|
267
|
-
};
|
|
268
|
-
// src/commands/usage.ts
|
|
269
|
-
/**
|
|
270
|
-
* @file `ork usage` and `ork prune` (specs/usage.md): what runs spent over
|
|
271
|
-
* time, from the store's ledger, and forgetting old runs' transcripts while
|
|
272
|
-
* keeping that ledger.
|
|
273
|
-
*/
|
|
274
|
-
const isDimension = (value) => USAGE_DIMENSIONS.some((dimension) => dimension === value);
|
|
275
|
-
const refuse = (message) => {
|
|
276
|
-
writeErr(message);
|
|
277
|
-
process.exitCode = 1;
|
|
278
|
-
};
|
|
279
|
-
const usage = defineCommand({
|
|
280
|
-
meta: {
|
|
281
|
-
name: "usage",
|
|
282
|
-
description: "Show what this project's runs spent over time"
|
|
283
|
-
},
|
|
284
|
-
args: {
|
|
285
|
-
all: {
|
|
286
|
-
type: "boolean",
|
|
287
|
-
description: "Every project's runs",
|
|
288
|
-
default: false
|
|
289
|
-
},
|
|
290
|
-
"clear-plan-limits": {
|
|
291
|
-
type: "boolean",
|
|
292
|
-
description: "Forget what Claude Code last said of your plan's limits, for one that has lifted",
|
|
293
|
-
default: false
|
|
294
|
-
},
|
|
295
|
-
since: {
|
|
296
|
-
type: "string",
|
|
297
|
-
description: "Whole days counting today (30d, 12w), exact hours (24h), a day (2026-11-01), or all",
|
|
298
|
-
default: "30d"
|
|
299
|
-
},
|
|
300
|
-
until: {
|
|
301
|
-
type: "string",
|
|
302
|
-
description: "The last day to include"
|
|
303
|
-
},
|
|
304
|
-
by: {
|
|
305
|
-
type: "string",
|
|
306
|
-
description: USAGE_DIMENSIONS.join(", ")
|
|
307
|
-
},
|
|
308
|
-
workflow: {
|
|
309
|
-
type: "string",
|
|
310
|
-
description: "Only this workflow"
|
|
311
|
-
},
|
|
312
|
-
json: {
|
|
313
|
-
type: "boolean",
|
|
314
|
-
description: "Print JSON",
|
|
315
|
-
default: false
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
run: ({ args }) => {
|
|
319
|
-
const since = args.since === "all" ? void 0 : sinceTime(args.since, Date.now());
|
|
320
|
-
const until = args.until === void 0 ? void 0 : untilTime(args.until);
|
|
321
|
-
if (since === null) {
|
|
322
|
-
refuse(`--since takes an age (30d), a day (2026-11-01) or all, not \`${args.since}\`.`);
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
if (until === null) {
|
|
326
|
-
refuse(`--until takes a day (2026-11-01), not \`${String(args.until)}\`.`);
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (args.by !== void 0 && !isDimension(args.by)) {
|
|
330
|
-
refuse(`--by takes one of ${USAGE_DIMENSIONS.join(", ")}, not \`${args.by}\`.`);
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
const store = openStore();
|
|
334
|
-
try {
|
|
335
|
-
if (args["clear-plan-limits"]) store.clearPlanLimits();
|
|
336
|
-
const report = usageReport(store.usage({
|
|
337
|
-
...args.all ? {} : { project: placeFor(process.cwd(), store.projects()).root },
|
|
338
|
-
...args.workflow === void 0 ? {} : { workflow: args.workflow },
|
|
339
|
-
...since === void 0 ? {} : { since },
|
|
340
|
-
...until === void 0 ? {} : { until }
|
|
341
|
-
}));
|
|
342
|
-
const limits = limitsHere(store, args.all ? void 0 : placeFor(process.cwd(), store.projects()));
|
|
343
|
-
if (args.json) {
|
|
344
|
-
write(JSON.stringify({
|
|
345
|
-
...report,
|
|
346
|
-
limits
|
|
347
|
-
}, void 0, 2));
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
for (const line of formatLimits(limits)) write(line);
|
|
351
|
-
const place = args.all ? "every project" : "this project";
|
|
352
|
-
const period = args.since === "all" ? "" : `, since ${args.since}`;
|
|
353
|
-
for (const line of formatUsage(report, `${place}${period}`, args.by)) write(line);
|
|
354
|
-
} finally {
|
|
355
|
-
store.close();
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
const prune = defineCommand({
|
|
360
|
-
meta: {
|
|
361
|
-
name: "prune",
|
|
362
|
-
description: "Forget old runs' transcripts; what they spent stays"
|
|
363
|
-
},
|
|
364
|
-
args: {
|
|
365
|
-
"older-than": {
|
|
366
|
-
type: "string",
|
|
367
|
-
description: "Runs that ended this long ago: 90d, 12w",
|
|
368
|
-
required: true
|
|
369
|
-
},
|
|
370
|
-
all: {
|
|
371
|
-
type: "boolean",
|
|
372
|
-
description: "Every project's runs",
|
|
373
|
-
default: false
|
|
374
|
-
},
|
|
375
|
-
"dry-run": {
|
|
376
|
-
type: "boolean",
|
|
377
|
-
description: "Show what would go, and change nothing",
|
|
378
|
-
default: false
|
|
379
|
-
},
|
|
380
|
-
yes: {
|
|
381
|
-
type: "boolean",
|
|
382
|
-
alias: "y",
|
|
383
|
-
description: "Do not ask",
|
|
384
|
-
default: false
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
run: async ({ args }) => {
|
|
388
|
-
const before = agoTime(args["older-than"], Date.now());
|
|
389
|
-
if (before === null) {
|
|
390
|
-
refuse(`--older-than takes an age (90d, 12w), not \`${args["older-than"]}\`.`);
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
const store = openStore();
|
|
394
|
-
try {
|
|
395
|
-
const filter = {
|
|
396
|
-
before,
|
|
397
|
-
...args.all ? {} : { project: placeFor(process.cwd(), store.projects()).root }
|
|
398
|
-
};
|
|
399
|
-
const plan = await planPrune(store, filter);
|
|
400
|
-
for (const { run, reason } of plan.keep) write(style("dim", `keep ${run.id} (${run.workflow}): ${reason}`));
|
|
401
|
-
for (const run of plan.remove) write(`${args["dry-run"] ? "would remove" : "remove"} ${run.id} (${run.workflow}, ${run.startedAt.slice(0, 10)})`);
|
|
402
|
-
if (plan.remove.length === 0) {
|
|
403
|
-
write("Nothing to prune.");
|
|
404
|
-
return;
|
|
405
|
-
}
|
|
406
|
-
if (args["dry-run"]) return;
|
|
407
|
-
const question = `Forget ${String(plan.remove.length)} run(s) and their logs for good? They can no longer be resumed or read. [y/N] `;
|
|
408
|
-
if (!args.yes && !await confirm(question)) return;
|
|
409
|
-
const agreed = new Set(plan.remove.map((run) => run.id));
|
|
410
|
-
const outcome = applyPrune(store, { remove: (args.yes ? plan : await planPrune(store, filter)).remove.filter((run) => agreed.has(run.id)) });
|
|
411
|
-
const notShrunk = store.compact();
|
|
412
|
-
write(`Removed ${String(outcome.removed)} run(s) and ${String(outcome.folders)} folder(s). Their usage stays in \`ork usage\`.${notShrunk === null ? "" : ` The store's file did not shrink: ${notShrunk}. The next prune tries again, and its free space is used first.`}`);
|
|
413
|
-
for (const { run, reason } of outcome.failed) refuse(`Run ${run}: ${reason}.`);
|
|
414
|
-
} finally {
|
|
415
|
-
store.close();
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
export { prune, usage };
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { D as inspectProject } from "./src-Dujmvv4s.mjs";
|
|
2
|
-
import { a as write, c as openStore, i as style, o as writeErr, t as confirm } from "./output-BLQWD6MJ.mjs";
|
|
3
|
-
import { a as planClean, i as keyOf, o as stepActs, t as applyClean } from "./clean-DaHjs__2.mjs";
|
|
4
|
-
import { a as readWorktrees, c as planLine, n as lostWork, o as labelOf, r as planRemove, s as mergeStateOf, t as applyRemove, u as stateParts } from "./remove-BeGdqroy.mjs";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { defineCommand } from "citty";
|
|
7
|
-
// src/project/worktrees.ts
|
|
8
|
-
/**
|
|
9
|
-
* @file What `ork worktrees` prints: each worktree or branch a run left, with
|
|
10
|
-
* its state read from git, the plan `ork worktrees clean` or `remove` would
|
|
11
|
-
* carry out, and what a forced remove would lose. The words are core's
|
|
12
|
-
* (worktree/words.ts), which the Worktrees panel says too; this only colors
|
|
13
|
-
* them.
|
|
14
|
-
*/
|
|
15
|
-
/** One line of state: its merge state, then what clean would care about. */
|
|
16
|
-
const worktreeState = (item) => {
|
|
17
|
-
const merge = mergeStateOf(item);
|
|
18
|
-
const head = merge === "merged" ? [style("green", "merged")] : merge === "detached" ? ["detached"] : [];
|
|
19
|
-
const parts = stateParts(item).map((part) => part.risk ? style("yellow", part.text) : part.text);
|
|
20
|
-
return [...head, ...parts].join(" · ");
|
|
21
|
-
};
|
|
22
|
-
/** A name as the list shows it, saying when it's detached. */
|
|
23
|
-
const nameOf = (item) => mergeStateOf(item) === "detached" ? `${labelOf(item)} (detached)` : labelOf(item);
|
|
24
|
-
const formatWorktrees = (items) => {
|
|
25
|
-
if (items.length === 0) return ["No Ork worktrees or branches."];
|
|
26
|
-
const width = Math.max(...items.map((i) => nameOf(i).length));
|
|
27
|
-
return items.flatMap((item) => [`${style("bold", nameOf(item).padEnd(width))} ${worktreeState(item)}`, ...item.path === null ? [] : [` ${style("dim", item.path)}`]]);
|
|
28
|
-
};
|
|
29
|
-
const formatPlan = (steps) => steps.map((step) => {
|
|
30
|
-
const { text, reason } = planLine(step);
|
|
31
|
-
return ` ${text}${reason === void 0 ? "" : style("dim", ` (${reason})`)}`;
|
|
32
|
-
});
|
|
33
|
-
/** What a forced remove loses, as git prints it, under a heading each. */
|
|
34
|
-
const formatLost = (lost) => [...lost.changes.length === 0 ? [] : ["Uncommitted changes:", ...lost.changes.map((line) => ` ${line}`)], ...lost.commits.length === 0 ? [] : [lost.commitsOn === "no branch" ? "Commits on no branch:" : "Commits not merged:", ...lost.commits.map((line) => ` ${line}`)]];
|
|
35
|
-
// src/commands/worktrees.ts
|
|
36
|
-
/**
|
|
37
|
-
* @file `ork worktrees` (or `ork wt`): lists the worktrees and branches runs
|
|
38
|
-
* left behind (those the runs recorded creating, whatever the project's git
|
|
39
|
-
* rules named them, and any `ork/` branch), with their state read from git;
|
|
40
|
-
* cleans them up safely after showing the plan and asking; and removes one,
|
|
41
|
-
* the twin of the Worktrees panel's Remove…. The plans are core's, so the
|
|
42
|
-
* panel keeps and removes exactly what these do.
|
|
43
|
-
*/
|
|
44
|
-
/** The repo this folder is in, and what Ork created there; null outside one. */
|
|
45
|
-
const here = async () => {
|
|
46
|
-
const root = (await inspectProject(process.cwd()))?.root ?? null;
|
|
47
|
-
if (root === null) {
|
|
48
|
-
writeErr("Not in a git repository with a commit.");
|
|
49
|
-
process.exitCode = 1;
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const store = openStore();
|
|
53
|
-
try {
|
|
54
|
-
return {
|
|
55
|
-
root,
|
|
56
|
-
...await readWorktrees(store, root)
|
|
57
|
-
};
|
|
58
|
-
} finally {
|
|
59
|
-
store.close();
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
/** Asks before acting, unless `--yes`; without a terminal `--yes` is needed. */
|
|
63
|
-
const goAhead = (yes, verb) => {
|
|
64
|
-
if (yes) return Promise.resolve(true);
|
|
65
|
-
if (!process.stdin.isTTY) {
|
|
66
|
-
writeErr(`Pass --yes to ${verb} without a terminal.`);
|
|
67
|
-
process.exitCode = 1;
|
|
68
|
-
return Promise.resolve(false);
|
|
69
|
-
}
|
|
70
|
-
return confirm("Go ahead? [y/N] ");
|
|
71
|
-
};
|
|
72
|
-
const done = (lines) => {
|
|
73
|
-
for (const line of lines) write(`${style("green", "✓")} ${line}`);
|
|
74
|
-
};
|
|
75
|
-
const show = async (json) => {
|
|
76
|
-
const found = await here();
|
|
77
|
-
if (found === null) return;
|
|
78
|
-
if (json) write(JSON.stringify(found.items, void 0, 2));
|
|
79
|
-
else for (const line of formatWorktrees(found.items)) write(line);
|
|
80
|
-
};
|
|
81
|
-
const list = defineCommand({
|
|
82
|
-
meta: {
|
|
83
|
-
name: "list",
|
|
84
|
-
description: "List Ork's worktrees and branches (the default)"
|
|
85
|
-
},
|
|
86
|
-
args: { json: {
|
|
87
|
-
type: "boolean",
|
|
88
|
-
description: "Print JSON",
|
|
89
|
-
default: false
|
|
90
|
-
} },
|
|
91
|
-
run: ({ args }) => show(args.json)
|
|
92
|
-
});
|
|
93
|
-
const yes = {
|
|
94
|
-
type: "boolean",
|
|
95
|
-
description: "Do not ask",
|
|
96
|
-
default: false
|
|
97
|
-
};
|
|
98
|
-
const clean = defineCommand({
|
|
99
|
-
meta: {
|
|
100
|
-
name: "clean",
|
|
101
|
-
description: "Remove Ork's worktrees (merged ones by default); never one with uncommitted changes unless --force, nor one whose run is still going"
|
|
102
|
-
},
|
|
103
|
-
args: {
|
|
104
|
-
run: {
|
|
105
|
-
type: "string",
|
|
106
|
-
description: "Only this run's worktrees"
|
|
107
|
-
},
|
|
108
|
-
all: {
|
|
109
|
-
type: "boolean",
|
|
110
|
-
description: "Include worktrees whose branch is not merged",
|
|
111
|
-
default: false
|
|
112
|
-
},
|
|
113
|
-
branches: {
|
|
114
|
-
type: "boolean",
|
|
115
|
-
description: "Also delete the branches",
|
|
116
|
-
default: false
|
|
117
|
-
},
|
|
118
|
-
force: {
|
|
119
|
-
type: "boolean",
|
|
120
|
-
description: "Remove uncommitted changes and unmerged branches too",
|
|
121
|
-
default: false
|
|
122
|
-
},
|
|
123
|
-
yes
|
|
124
|
-
},
|
|
125
|
-
run: async ({ args }) => {
|
|
126
|
-
const found = await here();
|
|
127
|
-
if (found === null) return;
|
|
128
|
-
const filter = { merged: !args.all };
|
|
129
|
-
if (args.run !== void 0) filter.runId = args.run;
|
|
130
|
-
const steps = planClean(found.items, filter, {
|
|
131
|
-
branches: args.branches,
|
|
132
|
-
force: args.force,
|
|
133
|
-
live: found.live
|
|
134
|
-
});
|
|
135
|
-
const acting = steps.filter((s) => stepActs(s));
|
|
136
|
-
if (acting.length === 0) {
|
|
137
|
-
for (const line of formatPlan(steps)) write(line);
|
|
138
|
-
write("Nothing to clean.");
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
write("Plan:");
|
|
142
|
-
for (const line of formatPlan(steps)) write(line);
|
|
143
|
-
if (!await goAhead(args.yes, "clean")) return;
|
|
144
|
-
done(await applyClean(found.root, acting, args.force));
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
const remove = defineCommand({
|
|
148
|
-
meta: {
|
|
149
|
-
name: "remove",
|
|
150
|
-
description: "Remove one of Ork's worktrees, by its branch or its path; --force when that loses work"
|
|
151
|
-
},
|
|
152
|
-
args: {
|
|
153
|
-
target: {
|
|
154
|
-
type: "positional",
|
|
155
|
-
description: "The branch, or the worktree's path",
|
|
156
|
-
required: true
|
|
157
|
-
},
|
|
158
|
-
branch: {
|
|
159
|
-
type: "boolean",
|
|
160
|
-
description: "Also delete the branch",
|
|
161
|
-
default: false
|
|
162
|
-
},
|
|
163
|
-
force: {
|
|
164
|
-
type: "boolean",
|
|
165
|
-
description: "Remove even when that loses uncommitted changes or commits",
|
|
166
|
-
default: false
|
|
167
|
-
},
|
|
168
|
-
yes
|
|
169
|
-
},
|
|
170
|
-
run: async ({ args }) => {
|
|
171
|
-
const found = await here();
|
|
172
|
-
if (found === null) return;
|
|
173
|
-
const byPath = path.resolve(args.target);
|
|
174
|
-
const item = found.items.find((i) => keyOf(i) === args.target || i.path === byPath);
|
|
175
|
-
const planned = planRemove(found, item === void 0 ? args.target : keyOf(item), args.branch);
|
|
176
|
-
if (!planned.ok) {
|
|
177
|
-
writeErr(planned.error);
|
|
178
|
-
process.exitCode = 1;
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
const { plan } = planned;
|
|
182
|
-
write("Plan:");
|
|
183
|
-
for (const line of formatPlan([plan.step])) write(line);
|
|
184
|
-
if (plan.force) {
|
|
185
|
-
for (const line of formatLost(await lostWork(found.root, plan))) write(line);
|
|
186
|
-
if (!args.force) {
|
|
187
|
-
writeErr("That loses work; pass --force to remove it anyway.");
|
|
188
|
-
process.exitCode = 1;
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
if (!await goAhead(args.yes, "remove")) return;
|
|
193
|
-
done(await applyRemove(found.root, plan));
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
const worktrees = defineCommand({
|
|
197
|
-
meta: {
|
|
198
|
-
name: "worktrees",
|
|
199
|
-
description: "Track and clean up the git worktrees Ork creates for runs"
|
|
200
|
-
},
|
|
201
|
-
subCommands: {
|
|
202
|
-
list,
|
|
203
|
-
clean,
|
|
204
|
-
remove
|
|
205
|
-
},
|
|
206
|
-
run: async ({ rawArgs }) => {
|
|
207
|
-
const [first] = rawArgs;
|
|
208
|
-
if (first === "list" || first === "clean" || first === "remove") return;
|
|
209
|
-
await show(rawArgs.includes("--json"));
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
export { worktrees };
|