@krapht/ork 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +3 -4
- package/dist/{__build_info__-D9lSlMFy.mjs → __build_info__-CIchF6nr.mjs} +2 -2
- package/dist/bin.mjs +1479 -600
- package/dist/chips-BA7SrrH5.mjs +43 -0
- package/dist/{clean-CA_Oi2Wl.mjs → clean-Di-KT7Mf.mjs} +5 -2
- package/dist/{completion-DBGfL-gN.mjs → completion-C5D0sEs5.mjs} +23 -16
- package/dist/context-BaNshWr9.mjs +695 -0
- package/dist/{decide-CoIJh34e.mjs → decide-B6PnKeqo.mjs} +3 -3
- package/dist/{find-rBBk7Jui.mjs → find-BicBbGMg.mjs} +1 -1
- package/dist/format-lWhN-jYR.mjs +286 -0
- package/dist/{in-a-run-DdAakpRR.mjs → in-a-run-CgkVouyG.mjs} +1 -1
- package/dist/{limits-BPM9wUlV.mjs → limits-jZQp9ZJC.mjs} +1 -1
- package/dist/{list-Bv5Lxu7z.mjs → list-CEaJ07jd.mjs} +11 -4
- package/dist/{mcp-DM30MFBw.mjs → mcp-DYgVA9f5.mjs} +6 -6
- package/dist/output-CM95njYt.mjs +421 -0
- package/dist/{pause-C7lJkSma.mjs → pause-D6PuSlNl.mjs} +4 -4
- package/dist/{relay-BipJYszF.mjs → relay-DNx7be9k.mjs} +2 -2
- package/dist/{remove-BDs9isB6.mjs → remove-CpMb4NDl.mjs} +14 -7
- package/dist/{report-DK4LGqwF.mjs → report-CEN8VoUb.mjs} +31 -20
- package/dist/{send-nbkjf3sc.mjs → send-CLs_fyg7.mjs} +3 -3
- package/dist/{src-BxUJPGa5.mjs → src-9iGkjnsy.mjs} +487 -341
- package/dist/{src-B0TT7DBi.mjs → src-B6KvTm7B.mjs} +106 -90
- package/dist/src-BnZgZGrf.mjs +2697 -0
- package/dist/{src-hrj2h0IZ.mjs → src-D6_xjm-x.mjs} +6719 -3389
- package/dist/ui/THIRD_PARTY_LICENSES.txt +594 -0
- package/dist/ui/assets/app-CxURph7a.js +75 -0
- package/dist/ui/assets/app-QoHVi-mb.css +1 -0
- package/dist/ui/assets/{index-CPx74lFf.js → index-By_8KKG6.js} +3 -3
- package/dist/ui/assets/theme-CdXvqTQ6.js +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/{ui-B98FSboa.mjs → ui-CIci4UBW.mjs} +4 -4
- package/dist/{usage-EW7DI6Z7.mjs → usage-GceBGMjU.mjs} +43 -32
- package/dist/{watch-BAkSGaOp.mjs → watch-BmoybMQg.mjs} +28 -16
- package/dist/{workflows-vsEohqa7.mjs → workflows-DZvW3i1e.mjs} +4 -3
- package/dist/{worktrees-Ahj9rdWK.mjs → worktrees-Be51E2rB.mjs} +84 -24
- package/package.json +2 -4
- package/dist/context-6x3kXREO.mjs +0 -274
- package/dist/format-zMmhqyLE.mjs +0 -427
- package/dist/output-TV_j7Ni0.mjs +0 -950
- package/dist/src-B9v0lDc6.mjs +0 -1204
- package/dist/ui/assets/app-BNT0SuIz.css +0 -1
- package/dist/ui/assets/app-CmkynZyW.js +0 -67
- package/dist/ui/assets/theme-3xH5jxKs.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
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,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(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},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=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`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1),p=f.createContext(void 0),m={disableStyleElements:!1};function h(){return f.useContext(p)??m}var g=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})),_=o(((e,t)=>{t.exports=g()})),v=o((e=>{var t=d();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 u(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=u(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=u(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=u(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=u(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`})),y=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=v()}));function b(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 x(e,t=`|`){return e.map(e=>ie(e)).join(t)}function S(e,t){return typeof t==`bigint`?t.toString():t}var C=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 w(e){return new C(e)}function T(e){return e==null}function E(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function D(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 O(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function k(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function A(e){return k(e._zod.def)??e._zod.def.shape}function j(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return O(this,t,e),e},enumerable:!0,configurable:!0})}function M(e,t,n){t in e?O(e,t,n):e[t]=n}function N(e,t,n,r){let i=A(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?j(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):M(e,a,r?r(n.value,a):n.value))}}function P(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?j(e,n,()=>t[n]):M(e,n,r.value))}}function F(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function I(e){return JSON.stringify(e)}function L(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var R=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var B=w(()=>{if(Q.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function V(e){if(z(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return z(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ee(e){return V(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 H(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 ie(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ae(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var oe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},se={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ce(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 N(i,e,U(e,t)),H(e,F(n,{shape:i,checks:[]}))}function U(e,t){let n=A(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 le(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 N(a,e,Reflect.ownKeys(A(e)).filter(e=>!i.has(e))),H(e,F(n,{shape:a,checks:[]}))}function ue(e,t){if(!V(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=A(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 H(e,F(e._zod.def,{shape:W(e,t)}))}function W(e,t){let n={};return N(n,e,Reflect.ownKeys(A(e))),P(n,t),n}function de(e,t){if(!V(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return H(e,F(e._zod.def,{shape:W(e,t)}))}function fe(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 N(n,e,Reflect.ownKeys(A(e))),N(n,t,Reflect.ownKeys(A(t))),H(e,F(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function pe(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 N(o,t,Reflect.ownKeys(A(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),H(t,F(t._zod.def,{shape:o,checks:[]}))}function me(e,t,n){let r=n?new Set(U(t,n)):void 0,i={};return N(i,t,Reflect.ownKeys(A(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),H(t,F(t._zod.def,{shape:i}))}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!==!0)return!0;return!1}function ge(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 _e(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 ve(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 ye(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function be(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 xe=/[\uD800-\uDBFF]/;function Se(e){let t=e.length;if(!xe.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 Ce(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function we(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 Te(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Ee(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):ke(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 De(e,t,n){return K(e,t,n,!1)}function Oe(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 ke(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 Ae(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var q,J=!1,je={configurable:!0,get(){J=!0}};function Me(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,je);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 Ne(e,t,n,r){let i=Ae(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 Pe=`~constantCatch`;function Fe(e){let t=()=>e;return t[Pe]=!0,t}var Y,X={value:void 0,enumerable:!1},Z=`captureStackTrace`in Error?Error:null;function Ie(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 Le(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),Ee(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?Ie(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 Re=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ze=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 Be(e){return e&&Object.assign(Q,e),Q}var Ve=`(prefers-color-scheme: light)`,He=`(prefers-contrast: more)`,Ue=(e,t)=>{let n=t(Ve)?`light`:`dark`;return{theme:e===`system`?n:e,contrast:t(He)?`more`:`standard`}},We=(e,t)=>{e.dataset.theme=t.theme,e.dataset.contrast=t.contrast},$=(e,t)=>{We(e.document.documentElement,Ue(t,t=>e.matchMedia(t).matches))},Ge=(e,t)=>{let n=[Ve,He].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{ve as $,De as A,T as B,ne as C,D,be as E,x as F,pe as G,ae as H,S as I,te as J,ce as K,fe as L,z as M,V as N,b as O,Te as P,ee as Q,F as R,I as S,ue as T,K as U,le as V,we as W,me as X,k as Y,de as Z,H as _,Le as a,h as at,Me as b,se as c,s as ct,B as d,L as et,O as f,E as g,R as h,ze as i,p as it,Ne as j,Ce as k,oe as l,l as lt,w as m,Ge as n,y as nt,Be as o,d as ot,ye as p,_e as q,Re as r,_ as rt,Q as s,o as st,$ as t,ie as tt,he as u,Se as v,ge as w,Oe as x,Fe as y,re as z};
|
package/dist/ui/index.html
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
href="/favicon.svg"
|
|
20
20
|
type="image/svg+xml"
|
|
21
21
|
/>
|
|
22
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-
|
|
22
|
+
<script type="module" crossorigin src="/assets/index-By_8KKG6.js"></script>
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-CdXvqTQ6.js">
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-BPIbqRRb.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-
|
|
2
|
-
import { a as write, i as style, o as writeErr } from "./output-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-CIchF6nr.mjs";
|
|
2
|
+
import { a as write, i as style, o as writeErr } from "./output-CM95njYt.mjs";
|
|
3
|
+
import { a as mayShowSignIn } from "./in-a-run-CgkVouyG.mjs";
|
|
4
|
+
import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-B6KvTm7B.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { constants } from "node:os";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
1
|
+
import { C as openStore, Un as runDirOf, Vn as placeFor, ot as usd, xt as liveStatus } from "./src-D6_xjm-x.mjs";
|
|
2
|
+
import { n as listOrkWorktrees, t as createdWorktrees } from "./list-CEaJ07jd.mjs";
|
|
3
|
+
import { n as usageReport, t as USAGE_DIMENSIONS } from "./report-CEN8VoUb.mjs";
|
|
4
|
+
import { a as write, b as termOf, i as style, n as cost, o as writeErr, t as confirm } from "./output-CM95njYt.mjs";
|
|
5
|
+
import { n as chip, t as CHIP_LABELS } from "./chips-BA7SrrH5.mjs";
|
|
6
|
+
import { a as header, o as table } from "./format-lWhN-jYR.mjs";
|
|
7
|
+
import { n as limitsHere } from "./limits-jZQp9ZJC.mjs";
|
|
7
8
|
import { existsSync, rmSync } from "node:fs";
|
|
8
9
|
import { defineCommand } from "citty";
|
|
9
10
|
// ../core/src/store/prune.ts
|
|
@@ -197,24 +198,31 @@ const TITLES = {
|
|
|
197
198
|
driver: "By driver",
|
|
198
199
|
project: "By project"
|
|
199
200
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
201
|
+
/** Seconds of CPU, `12.3 s`; empty with none. */
|
|
202
|
+
const cpuText = (ms) => ms === 0 ? "" : `${(ms / 1e3).toFixed(1)} s`;
|
|
203
|
+
/** `cpu`: a column for the CPU Ork's tool commands used. */
|
|
204
|
+
const usageTable = (term, groups, cpu = false) => table(term, [
|
|
205
|
+
{ flex: true },
|
|
206
|
+
{ align: "right" },
|
|
207
|
+
{ align: "right" },
|
|
208
|
+
{},
|
|
209
|
+
{},
|
|
210
|
+
...cpu ? [{ align: "right" }] : []
|
|
211
|
+
], [[
|
|
212
|
+
header(""),
|
|
213
|
+
header("COST"),
|
|
214
|
+
header("SESSIONS"),
|
|
215
|
+
header("TOKENS"),
|
|
216
|
+
header("CACHE"),
|
|
217
|
+
...cpu ? [header("TOOL CPU")] : []
|
|
218
|
+
], ...groups.map((group) => [
|
|
219
|
+
{ text: group.key },
|
|
220
|
+
{ text: cost(group.costUsd) },
|
|
221
|
+
{ text: String(group.sessions) },
|
|
222
|
+
{ text: `${tokens(group.inputTokens + group.cacheReadTokens + group.cacheWriteTokens)} in / ${tokens(group.outputTokens)} out` },
|
|
223
|
+
{ text: percent(group.cacheHitRate) },
|
|
224
|
+
...cpu ? [{ text: cpuText(group.cpuMs) }] : []
|
|
225
|
+
])], " ");
|
|
218
226
|
/** What `ork usage` prints without `--by`. */
|
|
219
227
|
const OVERVIEW = [
|
|
220
228
|
"day",
|
|
@@ -228,29 +236,31 @@ const shortTime = (iso) => new Date(iso).toLocaleString(void 0, {
|
|
|
228
236
|
dateStyle: "medium",
|
|
229
237
|
timeStyle: "short"
|
|
230
238
|
});
|
|
239
|
+
/** A warning line: a `WARN` chip when rich, else the line in yellow. */
|
|
240
|
+
const warned = (term, text) => term.rich ? ` ${chip(term, CHIP_LABELS.warn, "warn")} ${text}` : style("yellow", ` ${text}`);
|
|
231
241
|
/** The limits across runs, above a report; nothing with none set. */
|
|
232
|
-
const formatLimits = ({ problems, caps, plan }) => {
|
|
242
|
+
const formatLimits = ({ problems, caps, plan }, term = termOf(process.stdout)) => {
|
|
233
243
|
if (problems.length === 0 && caps.length === 0 && plan.length === 0) return [];
|
|
234
244
|
return [
|
|
235
245
|
style("bold", "Limits"),
|
|
236
|
-
...problems.map((problem) =>
|
|
246
|
+
...problems.map((problem) => warned(term, problem)),
|
|
237
247
|
...caps.map((cap) => {
|
|
238
248
|
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 ?
|
|
249
|
+
return cap.leftUsd <= 0 ? warned(term, line.trimStart()) : line;
|
|
240
250
|
}),
|
|
241
|
-
...plan.map((limit) =>
|
|
251
|
+
...plan.map((limit) => warned(term, `Claude plan's ${limit.window.replaceAll("_", " ")} limit ${limit.status === "rejected" ? "was reached" : "is close"}${limit.resetsAt === void 0 ? "" : `, resets ${shortTime(limit.resetsAt)}`}`)),
|
|
242
252
|
""
|
|
243
253
|
];
|
|
244
254
|
};
|
|
245
255
|
/** The report, as the terminal shows it. */
|
|
246
|
-
const formatUsage = (report, scope, by) => {
|
|
256
|
+
const formatUsage = (report, scope, by, term = termOf(process.stdout)) => {
|
|
247
257
|
const { totals } = report;
|
|
248
258
|
if (totals.sessions === 0) return [`No Claude sessions in ${scope}.`];
|
|
249
259
|
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
260
|
for (const dimension of by === void 0 ? OVERVIEW : [by]) {
|
|
251
261
|
const groups = report.groups[dimension];
|
|
252
262
|
const shown = by === void 0 ? dimension === "day" ? groups.slice(-10) : groups.slice(0, OVERVIEW_ROWS) : groups;
|
|
253
|
-
lines.push("", style("bold", TITLES[dimension]), ...
|
|
263
|
+
lines.push("", style("bold", TITLES[dimension]), ...usageTable(term, shown, dimension === "node"));
|
|
254
264
|
if (shown.length < groups.length) lines.push(style("dim", ` and ${String(groups.length - shown.length)} more (--by ${dimension})`));
|
|
255
265
|
}
|
|
256
266
|
const hints = report.hints.length === 0 ? [] : [
|
|
@@ -333,12 +343,13 @@ const usage = defineCommand({
|
|
|
333
343
|
const store = openStore();
|
|
334
344
|
try {
|
|
335
345
|
if (args["clear-plan-limits"]) store.clearPlanLimits();
|
|
336
|
-
const
|
|
346
|
+
const filter = {
|
|
337
347
|
...args.all ? {} : { project: placeFor(process.cwd(), store.projects()).root },
|
|
338
348
|
...args.workflow === void 0 ? {} : { workflow: args.workflow },
|
|
339
349
|
...since === void 0 ? {} : { since },
|
|
340
350
|
...until === void 0 ? {} : { until }
|
|
341
|
-
}
|
|
351
|
+
};
|
|
352
|
+
const report = usageReport(store.usage(filter), store.toolCpu(filter));
|
|
342
353
|
const limits = limitsHere(store, args.all ? void 0 : placeFor(process.cwd(), store.projects()));
|
|
343
354
|
if (args.json) {
|
|
344
355
|
write(JSON.stringify({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as newRunId } from "./find-
|
|
3
|
-
import { a as write,
|
|
4
|
-
import {
|
|
5
|
-
import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-
|
|
6
|
-
import {
|
|
1
|
+
import { Bn as placeFiles, C as openStore, Ot as stillTheSameProcess, _ as readProjectTriggers, _r as isToolNode, b as watchingPid, et as detachRun, fr as CheckReportSchema, g as declaredTriggers, h as triggerStanding, m as createWatcher, p as triggersReport, xr as timeoutMs, xt as liveStatus, y as takeWatchLock } from "./src-D6_xjm-x.mjs";
|
|
2
|
+
import { n as newRunId } from "./find-BicBbGMg.mjs";
|
|
3
|
+
import { C as widthOf, a as write, b as termOf, i as style, o as writeErr, r as plain, t as confirm, x as cut } from "./output-CM95njYt.mjs";
|
|
4
|
+
import { n as chip, t as CHIP_LABELS } from "./chips-BA7SrrH5.mjs";
|
|
5
|
+
import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-9iGkjnsy.mjs";
|
|
6
|
+
import { i as runLimits, r as limitsRefusal } from "./limits-jZQp9ZJC.mjs";
|
|
7
|
+
import { t as acceptRefusal } from "./in-a-run-CgkVouyG.mjs";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import { mkdirSync } from "node:fs";
|
|
9
10
|
import { homedir } from "node:os";
|
|
@@ -63,7 +64,7 @@ const lookAt = async (options) => {
|
|
|
63
64
|
});
|
|
64
65
|
return result.ok ? resultOf(result.output["json"]) : {
|
|
65
66
|
ok: false,
|
|
66
|
-
error: result.error ?? "the check failed"
|
|
67
|
+
error: [result.error ?? "the check failed", result.end?.detail].filter((part) => part !== void 0).join(": ")
|
|
67
68
|
};
|
|
68
69
|
};
|
|
69
70
|
// src/watch/report.ts
|
|
@@ -73,10 +74,21 @@ const STANDING = {
|
|
|
73
74
|
changed: "off: changed since it was accepted",
|
|
74
75
|
invalid: "off: has an error"
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
-
const
|
|
77
|
+
/** A failure's mark: a `FAIL` chip when rich, else the red `✗`. */
|
|
78
|
+
const failMark = (term) => term.rich ? chip(term, CHIP_LABELS.fail, "danger") : style("red", "✗");
|
|
79
|
+
/** A warning's mark: a `WARN` chip when rich, else the yellow `!`. */
|
|
80
|
+
const warnMark = (term) => term.rich ? chip(term, CHIP_LABELS.warn, "warn") : style("yellow", "!");
|
|
81
|
+
/** A trigger's standing, rich: a chip and what it adds. */
|
|
82
|
+
const standingChip = (term, standing) => {
|
|
83
|
+
const live = standing === "live";
|
|
84
|
+
const label = live ? "LIVE" : "OFF";
|
|
85
|
+
const text = STANDING[standing] ?? standing;
|
|
86
|
+
return `${chip(term, label, live ? "ok" : standing === "invalid" ? "danger" : "warn")}${live ? "" : ` ${text.replace(/^off: /u, "")}`}`;
|
|
87
|
+
};
|
|
88
|
+
const brokenLines = (broken, term = termOf(process.stdout)) => broken.map(({ file, message }) => `${failMark(term)} ${plain(file)}: ${plain(message)}`);
|
|
89
|
+
const statusLines = (report, term = termOf(process.stdout)) => {
|
|
78
90
|
const head = report.pid === void 0 ? "ork watch isn't running. Start it with `ork watch`, or `ork watch --detach`." : `ork watch is running (process ${String(report.pid)}).`;
|
|
79
|
-
const broken = brokenLines(report.broken);
|
|
91
|
+
const broken = brokenLines(report.broken, term);
|
|
80
92
|
if (report.triggers.length === 0) return [
|
|
81
93
|
head,
|
|
82
94
|
...broken,
|
|
@@ -86,11 +98,11 @@ const statusLines = (report) => {
|
|
|
86
98
|
head,
|
|
87
99
|
...broken,
|
|
88
100
|
...report.triggers.flatMap((status) => [
|
|
89
|
-
`${style("bold", plain(status.trigger))} ${style("dim", plain(`${status.project} → ${status.run}, every ${status.every}`))}`,
|
|
90
|
-
` ${STANDING[status.standing] ?? status.standing}${status.lookedAt === void 0 ? "" : `, last looked ${status.lookedAt}`}`,
|
|
101
|
+
term.rich ? `${style("bold", plain(status.trigger))} ${style("dim", cut(plain(`${status.project} → ${status.run}, every ${status.every}`), Math.max(8, term.width - widthOf(status.trigger) - 1)))}` : `${style("bold", plain(status.trigger))} ${style("dim", plain(`${status.project} → ${status.run}, every ${status.every}`))}`,
|
|
102
|
+
` ${term.rich ? standingChip(term, status.standing) : STANDING[status.standing] ?? status.standing}${status.lookedAt === void 0 ? "" : `, last looked ${status.lookedAt}`}`,
|
|
91
103
|
...status.error === void 0 ? [] : [` last look: ${plain(status.error)}`],
|
|
92
104
|
...status.held === void 0 ? [] : [` waiting: ${plain(status.held)}`],
|
|
93
|
-
...status.problems.map((problem) => ` ${
|
|
105
|
+
...status.problems.map((problem) => ` ${failMark(term)} ${plain(problem)}`)
|
|
94
106
|
])
|
|
95
107
|
];
|
|
96
108
|
};
|
|
@@ -126,16 +138,16 @@ const STANDS = {
|
|
|
126
138
|
new: "new",
|
|
127
139
|
changed: "changed since you accepted it, here or in the workflow it starts"
|
|
128
140
|
};
|
|
129
|
-
const acceptLines = (item, standing) => [
|
|
141
|
+
const acceptLines = (item, standing, term = termOf(process.stdout)) => [
|
|
130
142
|
`${style("bold", plain(item.id))} ${style("dim", plain(item.place.root))}`,
|
|
131
143
|
` ${STANDS[standing] ?? standing}`,
|
|
132
144
|
...checkLines(item),
|
|
133
145
|
` starts: ${plain(item.trigger.run)}, looking every ${item.trigger.every}, with up to ${String(item.trigger.maxRunsPerDay ?? 10)} runs a day`,
|
|
134
146
|
...workflowLines(item),
|
|
135
|
-
...item.diagnostics.filter(({ severity }) => severity === "warning").map(({ message }) => ` ${
|
|
147
|
+
...item.diagnostics.filter(({ severity }) => severity === "warning").map(({ message }) => ` ${warnMark(term)} ${plain(message)}`)
|
|
136
148
|
];
|
|
137
149
|
/** The triggers `--accept` can't offer, so they aren't silently left out. */
|
|
138
|
-
const unacceptableLines = (item) => [`${style("bold", plain(item.id))} ${style("dim", plain(item.place.root))}`, ...item.diagnostics.filter(({ severity }) => severity === "error").map(({ message }) => ` ${
|
|
150
|
+
const unacceptableLines = (item, term = termOf(process.stdout)) => [`${style("bold", plain(item.id))} ${style("dim", plain(item.place.root))}`, ...item.diagnostics.filter(({ severity }) => severity === "error").map(({ message }) => ` ${failMark(term)} ${plain(message)}`)];
|
|
139
151
|
// src/watch/start.ts
|
|
140
152
|
/**
|
|
141
153
|
* @file Starting a trigger's run (RFC-011): an ordinary run in the background,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as builtinWorkflowFile, r as builtinProblem, s as isBuiltinArg } from "./decide-
|
|
3
|
-
import {
|
|
1
|
+
import { Bn as placeFiles, C as openStore, Kn as inside, Un as runDirOf, Vn as placeFor, w as storePath } from "./src-D6_xjm-x.mjs";
|
|
2
|
+
import { i as builtinWorkflowFile, r as builtinProblem, s as isBuiltinArg } from "./decide-B6PnKeqo.mjs";
|
|
3
|
+
import { o as writeErr } from "./output-CM95njYt.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
6
6
|
// src/project/place.ts
|
|
@@ -40,6 +40,7 @@ const WORKFLOW_SUFFIX = ".ork.yaml";
|
|
|
40
40
|
* that folder.
|
|
41
41
|
*/
|
|
42
42
|
const findWorkflowFiles = (paths, cwd, workflows = path.join(cwd, WORKFLOW_DIR)) => {
|
|
43
|
+
if (paths.length === 0 && !existsSync(workflows)) return [];
|
|
43
44
|
return (paths.length > 0 ? paths : [fromCwd(workflows, cwd)]).flatMap((target) => {
|
|
44
45
|
const absolute = path.resolve(cwd, target);
|
|
45
46
|
if (existsSync(absolute) && statSync(absolute).isDirectory()) return readdirSync(absolute).filter((name) => name.endsWith(WORKFLOW_SUFFIX)).toSorted().map((name) => path.join(target, name));
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as
|
|
1
|
+
import { C as openStore, E as inspectProject } from "./src-D6_xjm-x.mjs";
|
|
2
|
+
import { a as planClean, i as keyOf, o as stepActs, t as applyClean } from "./clean-Di-KT7Mf.mjs";
|
|
3
|
+
import { a as readWorktrees, c as mergeStateOf, d as stateParts, l as planLine, n as lostWork, o as repoRoot, r as planRemove, s as labelOf, t as applyRemove } from "./remove-CpMb4NDl.mjs";
|
|
4
|
+
import { a as write, b as termOf, f as paint, i as style, o as writeErr, t as confirm, x as cut } from "./output-CM95njYt.mjs";
|
|
5
|
+
import { n as chip } from "./chips-BA7SrrH5.mjs";
|
|
5
6
|
import path from "node:path";
|
|
7
|
+
import { realpathSync } from "node:fs";
|
|
6
8
|
import { defineCommand } from "citty";
|
|
9
|
+
// src/project/go-ahead.ts
|
|
10
|
+
/**
|
|
11
|
+
* @file The question `ork worktrees clean` and `remove` ask before they act:
|
|
12
|
+
* skipped with `--yes`, impossible without a terminal (so `--yes` is needed),
|
|
13
|
+
* and a no says so rather than leaving the command silent.
|
|
14
|
+
*/
|
|
15
|
+
/** Whether to carry on; says why not when it won't. */
|
|
16
|
+
const goAhead = async (yes, verb, terminal = process.stdin.isTTY, ask = confirm) => {
|
|
17
|
+
if (yes) return true;
|
|
18
|
+
if (!terminal) {
|
|
19
|
+
writeErr(`Pass --yes to ${verb} without a terminal.`);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
if (await ask("Go ahead?")) return true;
|
|
24
|
+
write("Cancelled.");
|
|
25
|
+
return false;
|
|
26
|
+
};
|
|
7
27
|
// src/project/worktrees.ts
|
|
8
28
|
/**
|
|
9
29
|
* @file What `ork worktrees` prints: each worktree or branch a run left, with
|
|
@@ -13,18 +33,18 @@ import { defineCommand } from "citty";
|
|
|
13
33
|
* them.
|
|
14
34
|
*/
|
|
15
35
|
/** One line of state: its merge state, then what clean would care about. */
|
|
16
|
-
const worktreeState = (item) => {
|
|
36
|
+
const worktreeState = (item, term = termOf(process.stdout)) => {
|
|
17
37
|
const merge = mergeStateOf(item);
|
|
18
|
-
const head = merge === "merged" ? [style("green", "merged")] : merge === "detached" ? ["detached"] : [];
|
|
19
|
-
const parts = stateParts(item).map((part) => part.risk ?
|
|
38
|
+
const head = merge === "merged" ? [term.rich ? chip(term, "MERGED", "ok") : style("green", "merged")] : merge === "detached" ? ["detached"] : [];
|
|
39
|
+
const parts = stateParts(item).map((part) => part.risk ? paint(term, "warn", part.text) : part.text);
|
|
20
40
|
return [...head, ...parts].join(" · ");
|
|
21
41
|
};
|
|
22
42
|
/** A name as the list shows it, saying when it's detached. */
|
|
23
43
|
const nameOf = (item) => mergeStateOf(item) === "detached" ? `${labelOf(item)} (detached)` : labelOf(item);
|
|
24
|
-
const formatWorktrees = (items) => {
|
|
44
|
+
const formatWorktrees = (items, term = termOf(process.stdout)) => {
|
|
25
45
|
if (items.length === 0) return ["No Ork worktrees or branches."];
|
|
26
46
|
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)}`]]);
|
|
47
|
+
return items.flatMap((item) => [`${style("bold", nameOf(item).padEnd(width))} ${worktreeState(item, term)}`, ...item.path === null ? [] : [` ${style("dim", term.rich ? cut(item.path, term.width - 2) : item.path)}`]]);
|
|
28
48
|
};
|
|
29
49
|
const formatPlan = (steps) => steps.map((step) => {
|
|
30
50
|
const { text, reason } = planLine(step);
|
|
@@ -32,6 +52,11 @@ const formatPlan = (steps) => steps.map((step) => {
|
|
|
32
52
|
});
|
|
33
53
|
/** What a forced remove loses, as git prints it, under a heading each. */
|
|
34
54
|
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}`)]];
|
|
55
|
+
/** What a forced clean loses, item by item: the same lines `remove` prints. */
|
|
56
|
+
const formatLosses = (losses) => losses.flatMap(({ item, lost }) => {
|
|
57
|
+
const lines = formatLost(lost);
|
|
58
|
+
return lines.length === 0 ? [] : [`Loses in ${labelOf(item)}:`, ...lines];
|
|
59
|
+
});
|
|
35
60
|
// src/commands/worktrees.ts
|
|
36
61
|
/**
|
|
37
62
|
* @file `ork worktrees` (or `ork wt`): lists the worktrees and branches runs
|
|
@@ -41,10 +66,22 @@ const formatLost = (lost) => [...lost.changes.length === 0 ? [] : ["Uncommitted
|
|
|
41
66
|
* the twin of the Worktrees panel's Remove…. The plans are core's, so the
|
|
42
67
|
* panel keeps and removes exactly what these do.
|
|
43
68
|
*/
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
69
|
+
/**
|
|
70
|
+
* The repo this folder is in, and what Ork created there; null outside one. A
|
|
71
|
+
* repo with no commit has nothing of Ork's, which only a read says as an empty
|
|
72
|
+
* list.
|
|
73
|
+
*/
|
|
74
|
+
const here = async (emptyWithoutCommit = false) => {
|
|
75
|
+
const cwd = process.cwd();
|
|
76
|
+
const root = (await inspectProject(cwd))?.root ?? null;
|
|
47
77
|
if (root === null) {
|
|
78
|
+
const bare = emptyWithoutCommit ? await repoRoot(cwd) : null;
|
|
79
|
+
if (bare !== null) return {
|
|
80
|
+
root: bare,
|
|
81
|
+
items: [],
|
|
82
|
+
live: /* @__PURE__ */ new Set(),
|
|
83
|
+
runs: []
|
|
84
|
+
};
|
|
48
85
|
writeErr("Not in a git repository with a commit.");
|
|
49
86
|
process.exitCode = 1;
|
|
50
87
|
return null;
|
|
@@ -53,27 +90,25 @@ const here = async () => {
|
|
|
53
90
|
try {
|
|
54
91
|
return {
|
|
55
92
|
root,
|
|
93
|
+
runs: store.runs({ project: root }).map((run) => run.id),
|
|
56
94
|
...await readWorktrees(store, root)
|
|
57
95
|
};
|
|
58
96
|
} finally {
|
|
59
97
|
store.close();
|
|
60
98
|
}
|
|
61
99
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
process.exitCode = 1;
|
|
68
|
-
return Promise.resolve(false);
|
|
100
|
+
const realOr = (target) => {
|
|
101
|
+
try {
|
|
102
|
+
return realpathSync(target);
|
|
103
|
+
} catch {
|
|
104
|
+
return target;
|
|
69
105
|
}
|
|
70
|
-
return confirm("Go ahead? [y/N] ");
|
|
71
106
|
};
|
|
72
107
|
const done = (lines) => {
|
|
73
108
|
for (const line of lines) write(`${style("green", "✓")} ${line}`);
|
|
74
109
|
};
|
|
75
110
|
const show = async (json) => {
|
|
76
|
-
const found = await here();
|
|
111
|
+
const found = await here(true);
|
|
77
112
|
if (found === null) return;
|
|
78
113
|
if (json) write(JSON.stringify(found.items, void 0, 2));
|
|
79
114
|
else for (const line of formatWorktrees(found.items)) write(line);
|
|
@@ -123,10 +158,24 @@ const clean = defineCommand({
|
|
|
123
158
|
yes
|
|
124
159
|
},
|
|
125
160
|
run: async ({ args }) => {
|
|
161
|
+
const [name] = args._;
|
|
162
|
+
if (name !== void 0) {
|
|
163
|
+
writeErr(`\`clean\` takes no name (got ${name}); to remove one worktree: ork worktrees remove ${name}`);
|
|
164
|
+
process.exitCode = 1;
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
126
167
|
const found = await here();
|
|
127
168
|
if (found === null) return;
|
|
128
169
|
const filter = { merged: !args.all };
|
|
129
|
-
if (args.run !== void 0)
|
|
170
|
+
if (args.run !== void 0) {
|
|
171
|
+
const runId = found.runs.find((id) => id === args.run);
|
|
172
|
+
if (runId === void 0) {
|
|
173
|
+
writeErr(`No run ${args.run} in this project.`);
|
|
174
|
+
process.exitCode = 1;
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
filter.runId = runId;
|
|
178
|
+
}
|
|
130
179
|
const steps = planClean(found.items, filter, {
|
|
131
180
|
branches: args.branches,
|
|
132
181
|
force: args.force,
|
|
@@ -135,11 +184,21 @@ const clean = defineCommand({
|
|
|
135
184
|
const acting = steps.filter((s) => stepActs(s));
|
|
136
185
|
if (acting.length === 0) {
|
|
137
186
|
for (const line of formatPlan(steps)) write(line);
|
|
138
|
-
write("Nothing to clean.");
|
|
187
|
+
if (steps.length === 0) write("Nothing to clean.");
|
|
139
188
|
return;
|
|
140
189
|
}
|
|
141
190
|
write("Plan:");
|
|
142
191
|
for (const line of formatPlan(steps)) write(line);
|
|
192
|
+
if (args.force) {
|
|
193
|
+
const losses = await Promise.all(acting.map(async (step) => ({
|
|
194
|
+
item: step.item,
|
|
195
|
+
lost: await lostWork(found.root, {
|
|
196
|
+
step,
|
|
197
|
+
force: true
|
|
198
|
+
})
|
|
199
|
+
})));
|
|
200
|
+
for (const line of formatLosses(losses)) write(line);
|
|
201
|
+
}
|
|
143
202
|
if (!await goAhead(args.yes, "clean")) return;
|
|
144
203
|
done(await applyClean(found.root, acting, args.force));
|
|
145
204
|
}
|
|
@@ -171,7 +230,8 @@ const remove = defineCommand({
|
|
|
171
230
|
const found = await here();
|
|
172
231
|
if (found === null) return;
|
|
173
232
|
const byPath = path.resolve(args.target);
|
|
174
|
-
const
|
|
233
|
+
const paths = /* @__PURE__ */ new Set([byPath, realOr(byPath)]);
|
|
234
|
+
const item = found.items.find((i) => keyOf(i) === args.target || labelOf(i) === args.target || i.path !== null && paths.has(i.path));
|
|
175
235
|
const planned = planRemove(found, item === void 0 ? args.target : keyOf(item), args.branch);
|
|
176
236
|
if (!planned.ok) {
|
|
177
237
|
writeErr(planned.error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krapht/ork",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.11",
|
|
4
4
|
"description": "Orchestrate Claude agents on your machine: hierarchical, serializable workflows with a CLI and a localhost UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -38,8 +38,6 @@
|
|
|
38
38
|
"provenance": true
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.316",
|
|
42
|
-
"@anthropic-ai/sdk": "1.3.0",
|
|
43
41
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
44
42
|
"citty": "0.2.2",
|
|
45
43
|
"yaml": "2.9.1",
|
|
@@ -49,7 +47,7 @@
|
|
|
49
47
|
"@krapht/ork-core": "0.0.0",
|
|
50
48
|
"@krapht/ork-integrations": "0.0.0",
|
|
51
49
|
"@krapht/ork-nodes": "0.0.0",
|
|
52
|
-
"@krapht/ork-runtime
|
|
50
|
+
"@krapht/ork-runtime": "0.0.0",
|
|
53
51
|
"@krapht/ork-schema": "0.0.0",
|
|
54
52
|
"@krapht/ork-server": "0.0.0",
|
|
55
53
|
"@krapht/ork-ui": "0.0.0",
|