@krapht/ork 1.0.0-alpha.1 → 1.0.0-alpha.10

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.
Files changed (41) hide show
  1. package/README.md +3 -4
  2. package/dist/{__build_info__-D9lSlMFy.mjs → __build_info__-DFF18K8y.mjs} +72 -3
  3. package/dist/bin.mjs +579 -379
  4. package/dist/{clean-CA_Oi2Wl.mjs → clean-DVaEH9e7.mjs} +5 -2
  5. package/dist/{completion-DBGfL-gN.mjs → completion-Dv5kf598.mjs} +6 -6
  6. package/dist/context-CEaKOVmG.mjs +683 -0
  7. package/dist/{decide-CoIJh34e.mjs → decide-3l9q8UtX.mjs} +3 -3
  8. package/dist/{find-rBBk7Jui.mjs → find-DEjjOlTG.mjs} +1 -1
  9. package/dist/format-Cb5_m-Qd.mjs +191 -0
  10. package/dist/{in-a-run-DdAakpRR.mjs → in-a-run-BS9Nc-JW.mjs} +1 -1
  11. package/dist/{limits-BPM9wUlV.mjs → limits-BSwEjQST.mjs} +1 -1
  12. package/dist/{list-Bv5Lxu7z.mjs → list-Qxr6rwsY.mjs} +11 -4
  13. package/dist/{mcp-DM30MFBw.mjs → mcp-CslnG5wf.mjs} +6 -6
  14. package/dist/output-Bqljtmp_.mjs +40 -0
  15. package/dist/{pause-C7lJkSma.mjs → pause-D7OVB5Ac.mjs} +4 -4
  16. package/dist/{relay-BipJYszF.mjs → relay-EceRIebO.mjs} +2 -2
  17. package/dist/{remove-BDs9isB6.mjs → remove-0IQZVWmI.mjs} +14 -7
  18. package/dist/{send-nbkjf3sc.mjs → send-C0uwfUYi.mjs} +3 -3
  19. package/dist/{src-hrj2h0IZ.mjs → src-Df6KOIDC.mjs} +5678 -3245
  20. package/dist/{src-BxUJPGa5.mjs → src-cmmXKHn1.mjs} +265 -203
  21. package/dist/{src-B0TT7DBi.mjs → src-i5k2Y-kf.mjs} +35 -86
  22. package/dist/src-oaJYIddp.mjs +2255 -0
  23. package/dist/ui/THIRD_PARTY_LICENSES.txt +594 -0
  24. package/dist/ui/assets/app-C8uhHVYp.css +1 -0
  25. package/dist/ui/assets/app-qs8Lofv6.js +75 -0
  26. package/dist/ui/assets/{index-CPx74lFf.js → index-DV1ZaOk-.js} +3 -3
  27. package/dist/ui/assets/theme-CdXvqTQ6.js +1 -0
  28. package/dist/ui/index.html +2 -2
  29. package/dist/{ui-B98FSboa.mjs → ui-CBkHJdqk.mjs} +4 -4
  30. package/dist/{usage-EW7DI6Z7.mjs → usage-Cd8pEYyK.mjs} +5 -5
  31. package/dist/{watch-BAkSGaOp.mjs → watch-DW5R2OPO.mjs} +6 -6
  32. package/dist/{workflows-vsEohqa7.mjs → workflows-BT1gDRIV.mjs} +4 -3
  33. package/dist/{worktrees-Ahj9rdWK.mjs → worktrees-g1MQMGie.mjs} +78 -19
  34. package/package.json +2 -4
  35. package/dist/context-6x3kXREO.mjs +0 -274
  36. package/dist/format-zMmhqyLE.mjs +0 -427
  37. package/dist/output-TV_j7Ni0.mjs +0 -950
  38. package/dist/src-B9v0lDc6.mjs +0 -1204
  39. package/dist/ui/assets/app-BNT0SuIz.css +0 -1
  40. package/dist/ui/assets/app-CmkynZyW.js +0 -67
  41. 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};
@@ -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-CPx74lFf.js"></script>
23
- <link rel="modulepreload" crossorigin href="/assets/theme-3xH5jxKs.js">
22
+ <script type="module" crossorigin src="/assets/index-DV1ZaOk-.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__-D9lSlMFy.mjs";
2
- import { a as write, i as style, o as writeErr } from "./output-TV_j7Ni0.mjs";
3
- import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-B0TT7DBi.mjs";
4
- import { a as mayShowSignIn } from "./in-a-run-DdAakpRR.mjs";
1
+ import { n as ORK_VERSION, t as ORK_NAME } from "./__build_info__-DFF18K8y.mjs";
2
+ import { a as write, i as style, o as writeErr } from "./output-Bqljtmp_.mjs";
3
+ import { a as mayShowSignIn } from "./in-a-run-BS9Nc-JW.mjs";
4
+ import { i as uiFilePath, l as newToken, n as startServer, r as runningServer, t as DEFAULT_PORT } from "./src-i5k2Y-kf.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,9 @@
1
- import { Cn as runDirOf, c as usd, ht as liveStatus, xn as placeFor } from "./src-hrj2h0IZ.mjs";
2
- import { a as write, c as openStore, i as style, n as cost, o as writeErr, t as confirm } from "./output-TV_j7Ni0.mjs";
3
- import { n as listOrkWorktrees, t as createdWorktrees } from "./list-Bv5Lxu7z.mjs";
1
+ import { D as openStore, Dn as runDirOf, Tn as placeFor, bt as liveStatus, c as usd } from "./src-Df6KOIDC.mjs";
2
+ import { n as listOrkWorktrees, t as createdWorktrees } from "./list-Qxr6rwsY.mjs";
4
3
  import { n as usageReport, t as USAGE_DIMENSIONS } from "./report-DK4LGqwF.mjs";
5
- import "./format-zMmhqyLE.mjs";
6
- import { n as limitsHere } from "./limits-BPM9wUlV.mjs";
4
+ import { a as write, i as style, n as cost, o as writeErr, t as confirm } from "./output-Bqljtmp_.mjs";
5
+ import "./format-Cb5_m-Qd.mjs";
6
+ import { n as limitsHere } from "./limits-BSwEjQST.mjs";
7
7
  import { existsSync, rmSync } from "node:fs";
8
8
  import { defineCommand } from "citty";
9
9
  // ../core/src/store/prune.ts
@@ -1,9 +1,9 @@
1
- import { $n as timeoutMs, S as readProjectTriggers, T as watchingPid, Wn as CheckReportSchema, Xn as isToolNode, b as triggerStanding, bn as placeFiles, ht as liveStatus, ot as detachRun, v as triggersReport, w as takeWatchLock, x as declaredTriggers, xt as stillTheSameProcess, y as createWatcher } from "./src-hrj2h0IZ.mjs";
2
- import { n as newRunId } from "./find-rBBk7Jui.mjs";
3
- import { a as write, c as openStore, i as style, o as writeErr, r as plain, t as confirm } from "./output-TV_j7Ni0.mjs";
4
- import { i as runLimits, r as limitsRefusal } from "./limits-BPM9wUlV.mjs";
5
- import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-BxUJPGa5.mjs";
6
- import { t as acceptRefusal } from "./in-a-run-DdAakpRR.mjs";
1
+ import { D as openStore, Et as stillTheSameProcess, S as readProjectTriggers, T as watchingPid, Xn as CheckReportSchema, ar as timeoutMs, b as triggerStanding, bt as liveStatus, it as detachRun, tr as isToolNode, v as triggersReport, w as takeWatchLock, wn as placeFiles, x as declaredTriggers, y as createWatcher } from "./src-Df6KOIDC.mjs";
2
+ import { n as newRunId } from "./find-DEjjOlTG.mjs";
3
+ import { a as write, i as style, o as writeErr, r as plain, t as confirm } from "./output-Bqljtmp_.mjs";
4
+ import { c as toolExecutor, o as spawnTool, s as mcpCallExecutor } from "./src-cmmXKHn1.mjs";
5
+ import { i as runLimits, r as limitsRefusal } from "./limits-BSwEjQST.mjs";
6
+ import { t as acceptRefusal } from "./in-a-run-BS9Nc-JW.mjs";
7
7
  import path from "node:path";
8
8
  import { mkdirSync } from "node:fs";
9
9
  import { homedir } from "node:os";
@@ -1,6 +1,6 @@
1
- import { Cn as runDirOf, En as inside, bn as placeFiles, xn as placeFor } from "./src-hrj2h0IZ.mjs";
2
- import { i as builtinWorkflowFile, r as builtinProblem, s as isBuiltinArg } from "./decide-CoIJh34e.mjs";
3
- import { c as openStore, l as storePath, o as writeErr } from "./output-TV_j7Ni0.mjs";
1
+ import { An as inside, D as openStore, Dn as runDirOf, O as storePath, Tn as placeFor, wn as placeFiles } from "./src-Df6KOIDC.mjs";
2
+ import { i as builtinWorkflowFile, r as builtinProblem, s as isBuiltinArg } from "./decide-3l9q8UtX.mjs";
3
+ import { o as writeErr } from "./output-Bqljtmp_.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,28 @@
1
- import { D as inspectProject } from "./src-hrj2h0IZ.mjs";
2
- import { a as write, c as openStore, i as style, o as writeErr, t as confirm } from "./output-TV_j7Ni0.mjs";
3
- import { a as planClean, i as keyOf, o as stepActs, t as applyClean } from "./clean-CA_Oi2Wl.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-BDs9isB6.mjs";
1
+ import { A as inspectProject, D as openStore } from "./src-Df6KOIDC.mjs";
2
+ import { a as planClean, i as keyOf, o as stepActs, t as applyClean } from "./clean-DVaEH9e7.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-0IQZVWmI.mjs";
4
+ import { a as write, i as style, o as writeErr, t as confirm } from "./output-Bqljtmp_.mjs";
5
5
  import path from "node:path";
6
+ import { realpathSync } from "node:fs";
6
7
  import { defineCommand } from "citty";
8
+ // src/project/go-ahead.ts
9
+ /**
10
+ * @file The question `ork worktrees clean` and `remove` ask before they act:
11
+ * skipped with `--yes`, impossible without a terminal (so `--yes` is needed),
12
+ * and a no says so rather than leaving the command silent.
13
+ */
14
+ /** Whether to carry on; says why not when it won't. */
15
+ const goAhead = async (yes, verb, terminal = process.stdin.isTTY, ask = confirm) => {
16
+ if (yes) return true;
17
+ if (!terminal) {
18
+ writeErr(`Pass --yes to ${verb} without a terminal.`);
19
+ process.exitCode = 1;
20
+ return false;
21
+ }
22
+ if (await ask("Go ahead? [y/N] ")) return true;
23
+ write("Cancelled.");
24
+ return false;
25
+ };
7
26
  // src/project/worktrees.ts
8
27
  /**
9
28
  * @file What `ork worktrees` prints: each worktree or branch a run left, with
@@ -32,6 +51,11 @@ const formatPlan = (steps) => steps.map((step) => {
32
51
  });
33
52
  /** What a forced remove loses, as git prints it, under a heading each. */
34
53
  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}`)]];
54
+ /** What a forced clean loses, item by item: the same lines `remove` prints. */
55
+ const formatLosses = (losses) => losses.flatMap(({ item, lost }) => {
56
+ const lines = formatLost(lost);
57
+ return lines.length === 0 ? [] : [`Loses in ${labelOf(item)}:`, ...lines];
58
+ });
35
59
  // src/commands/worktrees.ts
36
60
  /**
37
61
  * @file `ork worktrees` (or `ork wt`): lists the worktrees and branches runs
@@ -41,10 +65,22 @@ const formatLost = (lost) => [...lost.changes.length === 0 ? [] : ["Uncommitted
41
65
  * the twin of the Worktrees panel's Remove…. The plans are core's, so the
42
66
  * panel keeps and removes exactly what these do.
43
67
  */
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;
68
+ /**
69
+ * The repo this folder is in, and what Ork created there; null outside one. A
70
+ * repo with no commit has nothing of Ork's, which only a read says as an empty
71
+ * list.
72
+ */
73
+ const here = async (emptyWithoutCommit = false) => {
74
+ const cwd = process.cwd();
75
+ const root = (await inspectProject(cwd))?.root ?? null;
47
76
  if (root === null) {
77
+ const bare = emptyWithoutCommit ? await repoRoot(cwd) : null;
78
+ if (bare !== null) return {
79
+ root: bare,
80
+ items: [],
81
+ live: /* @__PURE__ */ new Set(),
82
+ runs: []
83
+ };
48
84
  writeErr("Not in a git repository with a commit.");
49
85
  process.exitCode = 1;
50
86
  return null;
@@ -53,27 +89,25 @@ const here = async () => {
53
89
  try {
54
90
  return {
55
91
  root,
92
+ runs: store.runs({ project: root }).map((run) => run.id),
56
93
  ...await readWorktrees(store, root)
57
94
  };
58
95
  } finally {
59
96
  store.close();
60
97
  }
61
98
  };
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);
99
+ const realOr = (target) => {
100
+ try {
101
+ return realpathSync(target);
102
+ } catch {
103
+ return target;
69
104
  }
70
- return confirm("Go ahead? [y/N] ");
71
105
  };
72
106
  const done = (lines) => {
73
107
  for (const line of lines) write(`${style("green", "✓")} ${line}`);
74
108
  };
75
109
  const show = async (json) => {
76
- const found = await here();
110
+ const found = await here(true);
77
111
  if (found === null) return;
78
112
  if (json) write(JSON.stringify(found.items, void 0, 2));
79
113
  else for (const line of formatWorktrees(found.items)) write(line);
@@ -123,10 +157,24 @@ const clean = defineCommand({
123
157
  yes
124
158
  },
125
159
  run: async ({ args }) => {
160
+ const [name] = args._;
161
+ if (name !== void 0) {
162
+ writeErr(`\`clean\` takes no name (got ${name}); to remove one worktree: ork worktrees remove ${name}`);
163
+ process.exitCode = 1;
164
+ return;
165
+ }
126
166
  const found = await here();
127
167
  if (found === null) return;
128
168
  const filter = { merged: !args.all };
129
- if (args.run !== void 0) filter.runId = args.run;
169
+ if (args.run !== void 0) {
170
+ const runId = found.runs.find((id) => id === args.run);
171
+ if (runId === void 0) {
172
+ writeErr(`No run ${args.run} in this project.`);
173
+ process.exitCode = 1;
174
+ return;
175
+ }
176
+ filter.runId = runId;
177
+ }
130
178
  const steps = planClean(found.items, filter, {
131
179
  branches: args.branches,
132
180
  force: args.force,
@@ -135,11 +183,21 @@ const clean = defineCommand({
135
183
  const acting = steps.filter((s) => stepActs(s));
136
184
  if (acting.length === 0) {
137
185
  for (const line of formatPlan(steps)) write(line);
138
- write("Nothing to clean.");
186
+ if (steps.length === 0) write("Nothing to clean.");
139
187
  return;
140
188
  }
141
189
  write("Plan:");
142
190
  for (const line of formatPlan(steps)) write(line);
191
+ if (args.force) {
192
+ const losses = await Promise.all(acting.map(async (step) => ({
193
+ item: step.item,
194
+ lost: await lostWork(found.root, {
195
+ step,
196
+ force: true
197
+ })
198
+ })));
199
+ for (const line of formatLosses(losses)) write(line);
200
+ }
143
201
  if (!await goAhead(args.yes, "clean")) return;
144
202
  done(await applyClean(found.root, acting, args.force));
145
203
  }
@@ -171,7 +229,8 @@ const remove = defineCommand({
171
229
  const found = await here();
172
230
  if (found === null) return;
173
231
  const byPath = path.resolve(args.target);
174
- const item = found.items.find((i) => keyOf(i) === args.target || i.path === byPath);
232
+ const paths = /* @__PURE__ */ new Set([byPath, realOr(byPath)]);
233
+ const item = found.items.find((i) => keyOf(i) === args.target || labelOf(i) === args.target || i.path !== null && paths.has(i.path));
175
234
  const planned = planRemove(found, item === void 0 ? args.target : keyOf(item), args.branch);
176
235
  if (!planned.ok) {
177
236
  writeErr(planned.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krapht/ork",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.10",
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-claude": "0.0.0",
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",
@@ -1,274 +0,0 @@
1
- import { C as workflowTextHash, Ct as walkChecks, On as LESSON_CAP_TOKENS, S as readProjectTriggers, St as checkWorkflowText, Tn as workflowDirOf, bn as placeFiles, lt as explainSession, wt as walkSummary, xn as placeFor } from "./src-hrj2h0IZ.mjs";
2
- import { a as write, i as style, r as plain } from "./output-TV_j7Ni0.mjs";
3
- import { c as registeredProjects, i as refusedBuiltin, o as workflowArg, r as findWorkflowFiles, s as projectAt } from "./workflows-vsEohqa7.mjs";
4
- import path from "node:path";
5
- import { readFileSync } from "node:fs";
6
- import { defineCommand } from "citty";
7
- // src/commands/walk-report.ts
8
- /**
9
- * @file How `ork validate` shows a walk (RFC-009): one line on what it tried,
10
- * and with `--paths`, each way a run can end. A gate's answer that ends the
11
- * run shows here as an ending, not as a problem.
12
- */
13
- const walkLine = (walk) => walk === void 0 ? [] : [style("dim", walkSummary(walk))];
14
- const endingLine = ({ status, notRun, paths }) => {
15
- const ways = `${String(paths)} ${paths === 1 ? "way" : "ways"}`;
16
- const word = status === "succeeded" ? style("green", status) : style("red", status);
17
- const rest = notRun.length === 0 ? "every node ran" : `didn't run: ${notRun.map((id) => plain(id)).join(", ")}`;
18
- return ` ${word} ${style("dim", `(${ways})`)} ${rest}`;
19
- };
20
- const endingLines = (ending) => [endingLine(ending), ...ending.choices.map((choice) => style("dim", ` ${plain(choice)}`))];
21
- /** Each ending, the ones that succeeded first, with one way to get there. */
22
- const pathLines = (walk) => {
23
- const endings = walk?.endings ?? [];
24
- return [...endings.filter(({ status }) => status === "succeeded"), ...endings.filter(({ status }) => status !== "succeeded")].flatMap((ending) => endingLines(ending));
25
- };
26
- // src/commands/validate.ts
27
- /**
28
- * @file `ork validate`: loads, parses and compiles workflow files with the
29
- * project's rules (`.ork/project.yaml`) and the agents they name, checks
30
- * their skill and context references, and reports diagnostics compiler-style,
31
- * with file, line and column. `loadWorkflow` is shared with `ork run`.
32
- */
33
- const hasErrors = (diagnostics) => diagnostics.some((d) => d.severity === "error");
34
- /**
35
- * Parses and compiles one workflow file, with the agents the user and its
36
- * project offer. `home` is the user's `~` (tests pass a folder); `registered`
37
- * the projects a caller's store has, else those of the store in `home`.
38
- */
39
- const loadWorkflow = (file, cwd, home, registered = registeredProjects(home)) => {
40
- const absolute = path.resolve(cwd, file);
41
- const place = placeFor(path.dirname(absolute), registered);
42
- const where = {
43
- place,
44
- workflowDir: workflowDirOf(place, absolute)
45
- };
46
- let text;
47
- try {
48
- text = readFileSync(path.resolve(cwd, file), "utf8");
49
- } catch (error) {
50
- return {
51
- report: {
52
- file,
53
- diagnostics: [{
54
- severity: "error",
55
- code: "file.read",
56
- message: error instanceof Error && "code" in error && error.code === "ENOENT" ? "file not found" : "cannot read file",
57
- path: []
58
- }]
59
- },
60
- workflow: null,
61
- graph: null,
62
- ...where
63
- };
64
- }
65
- const { diagnostics, workflow, graph, summary, locate } = checkWorkflowText(text, {
66
- ...where,
67
- registered,
68
- home
69
- });
70
- return {
71
- report: {
72
- file,
73
- diagnostics,
74
- ...summary === void 0 ? {} : { summary }
75
- },
76
- workflow,
77
- graph,
78
- textHash: workflowTextHash(text),
79
- ...locate === void 0 ? {} : { locate },
80
- ...where
81
- };
82
- };
83
- const validateFile = (file, cwd) => loadWorkflow(file, cwd).report;
84
- /**
85
- * Walks what loaded, with its findings on its report. `ork validate` and `ork
86
- * run` do this; the rest of what loads a workflow doesn't pay for a walk.
87
- */
88
- const walkLoaded = async (loaded) => {
89
- const { diagnostics, walk } = await walkChecks({
90
- diagnostics: loaded.report.diagnostics,
91
- graph: loaded.graph,
92
- ...loaded.locate === void 0 ? {} : { locate: loaded.locate }
93
- });
94
- return {
95
- ...loaded,
96
- report: {
97
- ...loaded.report,
98
- diagnostics,
99
- ...walk === void 0 ? {} : { walk }
100
- }
101
- };
102
- };
103
- const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
104
- const diagnosticLine = (file, d) => {
105
- const where = d.line === void 0 ? file : `${file}:${d.line}:${d.column ?? 1}`;
106
- const severity = d.severity === "error" ? style(["red", "bold"], "error") : style(["yellow", "bold"], "warning");
107
- return `${style("dim", where)} ${severity} ${d.message} ${style("dim", `(${d.code})`)}`;
108
- };
109
- /** The warnings alone, for a run that goes ahead despite them. */
110
- const warningLines = (report) => report.diagnostics.filter((d) => d.severity === "warning").map((d) => diagnosticLine(report.file, d));
111
- /** Human-readable report, one line per diagnostic, compiler style. */
112
- const formatReport = (report) => {
113
- const lines = report.diagnostics.map((d) => diagnosticLine(report.file, d));
114
- const errors = report.diagnostics.filter((d) => d.severity === "error").length;
115
- const warnings = report.diagnostics.length - errors;
116
- if (report.summary === void 0 && errors === 0) lines.push(`${style("green", "✓")} ${report.file}${warnings === 0 ? "" : style("dim", ` (${plural(warnings, "warning")})`)}`);
117
- else if (report.summary !== void 0 && errors === 0) {
118
- const { nodes, edges, entries } = report.summary;
119
- const extra = warnings > 0 ? `, ${plural(warnings, "warning")}` : "";
120
- lines.push(`${style("green", "✓")} ${report.file} ${style("dim", `(${plural(nodes, "node")}, ${plural(edges, "edge")}, starts at ${entries.join(", ")}${extra})`)}`);
121
- } else lines.push(`${style("red", "✗")} ${report.file} ${style("dim", `(${plural(errors, "error")}, ${plural(warnings, "warning")})`)}`);
122
- return [...lines, ...walkLine(report.walk)];
123
- };
124
- const validate = defineCommand({
125
- meta: {
126
- name: "validate",
127
- description: "Check workflow files: schema, ownership tree, edges, loops and references, and walk every way through them"
128
- },
129
- args: {
130
- files: {
131
- type: "positional",
132
- description: "Workflow files or names in .ork/workflows/ (default: every workflow there, and the project's triggers)",
133
- required: false
134
- },
135
- json: {
136
- type: "boolean",
137
- description: "Print the reports as JSON",
138
- default: false
139
- },
140
- paths: {
141
- type: "boolean",
142
- description: "List each way a run can end, and the choices that lead there",
143
- default: false
144
- }
145
- },
146
- run: async ({ args }) => {
147
- const cwd = process.cwd();
148
- if (refusedBuiltin(args._, cwd)) return;
149
- const files = findWorkflowFiles(args._, cwd, placeFiles(projectAt(cwd)).workflows);
150
- if (files.length === 0) {
151
- write("No workflow files found. Run `ork init`, or pass a path.");
152
- process.exitCode = 1;
153
- return;
154
- }
155
- const place = projectAt(cwd);
156
- const triggers = args._.length === 0 ? readProjectTriggers(place, void 0, registeredProjects()) : void 0;
157
- const walked = [];
158
- for (const file of files) {
159
- const { report } = await walkLoaded(loadWorkflow(file, cwd));
160
- walked.push(report);
161
- }
162
- const reports = [...walked, ...triggers?.present === true ? [{
163
- file: path.relative(cwd, triggers.file),
164
- diagnostics: [...triggers.diagnostics, ...triggers.triggers.flatMap((item) => item.diagnostics)]
165
- }] : []];
166
- if (args.json) write(JSON.stringify(reports, void 0, 2));
167
- else for (const report of reports) {
168
- for (const line of formatReport(report)) write(line);
169
- if (args.paths) for (const line of pathLines(report.walk)) write(line);
170
- }
171
- if (reports.some((r) => hasErrors(r.diagnostics))) process.exitCode = 1;
172
- }
173
- });
174
- // src/commands/context.ts
175
- /**
176
- * @file `ork context explain <wf> <node>`: what one node's session would load,
177
- * layer by layer, as core's `explainSession` plans it without writing
178
- * anything (one of Ork's own `ork:` workflows is written into the project's
179
- * run folder first, as `ork run` does): its project instructions, every skill
180
- * with the layer it came from and whether it is live, shadowed or switched
181
- * off, its context files, its practices, and estimated tokens.
182
- */
183
- /** Loads a workflow file and plans one node's session in it, in place. */
184
- const explainNode = (file, nodeId, cwd, home) => {
185
- const { report, workflow, graph, place, workflowDir } = loadWorkflow(file, cwd, home);
186
- if (workflow === null) return {
187
- ok: false,
188
- lines: formatReport(report)
189
- };
190
- const result = explainSession(workflow, graph, nodeId, {
191
- root: place.root,
192
- orkDir: place.dir,
193
- workflowDir,
194
- ...home === void 0 ? {} : { home }
195
- });
196
- return result.ok ? result : {
197
- ok: false,
198
- lines: [result.error]
199
- };
200
- };
201
- const approx = (count) => style("dim", `≈${count.toLocaleString("en")} tokens`);
202
- const formatExplanation = (e) => {
203
- const width = Math.max(8, ...e.skills.map((s) => s.name.length));
204
- const sourceWidth = Math.max(0, ...e.skills.map((s) => s.source.length));
205
- const lines = [
206
- `${style("bold", e.node)} ${style("dim", `(${e.type}) in ${e.workflow}`)}${e.template === void 0 ? "" : style("dim", `, planned as ${e.template}, the node it was spawned from`)}`,
207
- "",
208
- ...e.agent === void 0 ? [] : [`${style("bold", "Agent")} ${e.agent.name} ${style("dim", `(${e.agent.where})`)} ${approx(e.agent.tokens)}`],
209
- `${style("bold", "Instructions")} ${e.instructions}`,
210
- "",
211
- style("bold", "Skills")
212
- ];
213
- if (e.skills.length === 0) lines.push(style("dim", " none"));
214
- for (const s of e.skills) {
215
- const mark = s.state === "live" ? style("green", "✓") : style("dim", "−");
216
- const state = s.why === void 0 ? approx(s.tokens).replace("tokens", "tokens when used") : style("yellow", `off: ${s.why}`);
217
- lines.push(` ${mark} ${s.name.padEnd(width)} ${s.layer.padEnd(8)} ${style("dim", s.source.padEnd(sourceWidth))} ${state}`);
218
- }
219
- lines.push("", style("bold", "Context files"));
220
- if (e.files.length === 0) lines.push(style("dim", " none"));
221
- for (const f of e.files) {
222
- const cut = f.cutFrom === void 0 ? "" : ` ${style("yellow", `cut at the ${LESSON_CAP_TOKENS.toLocaleString("en")}-token cap; the whole file is ${approx(f.cutFrom)}`)}`;
223
- lines.push(` ${f.layer.padEnd(8)} ${f.name} ${approx(f.tokens)}${cut}`);
224
- }
225
- lines.push("", style("bold", "Practices"));
226
- for (const p of e.practices) lines.push(` ${p.name.padEnd(8)} ${approx(p.tokens)}`);
227
- for (const name of e.skippedPractices) lines.push(` ${name.padEnd(8)} ${style("dim", "the project's own skill wins")}`);
228
- if (e.practices.length === 0 && e.skippedPractices.length === 0) lines.push(style("dim", " off"));
229
- lines.push("", `Appended to Claude Code's system prompt: ${approx(e.appendedTokens)}`);
230
- return lines;
231
- };
232
- const explain = defineCommand({
233
- meta: {
234
- name: "explain",
235
- description: "Show what one node's session loads, layer by layer"
236
- },
237
- args: {
238
- workflow: {
239
- type: "positional",
240
- description: "A workflow file, the name of one in the project's workflows (.ork/workflows/), or one of Ork's own (ork:feedback-apply)",
241
- required: true
242
- },
243
- node: {
244
- type: "positional",
245
- description: "Node id",
246
- required: true
247
- },
248
- json: {
249
- type: "boolean",
250
- description: "Print JSON",
251
- default: false
252
- }
253
- },
254
- run: ({ args }) => {
255
- const cwd = process.cwd();
256
- if (refusedBuiltin([args.workflow], cwd)) return;
257
- const result = explainNode(workflowArg(args.workflow, cwd).file, args.node, cwd);
258
- if (!result.ok) {
259
- for (const line of result.lines) process.stderr.write(`${line}\n`);
260
- process.exitCode = 1;
261
- return;
262
- }
263
- if (args.json) write(JSON.stringify(result.explanation, void 0, 2));
264
- else for (const line of formatExplanation(result.explanation)) write(line);
265
- }
266
- });
267
- const context = defineCommand({
268
- meta: {
269
- name: "context",
270
- description: "Inspect the context Ork compiles for each node"
271
- },
272
- subCommands: { explain }
273
- });
274
- export { validate as a, warningLines as c, loadWorkflow as i, explainNode as n, validateFile as o, formatReport as r, walkLoaded as s, context as t };