orbital-command 0.3.0 → 1.0.0

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 (160) hide show
  1. package/README.md +67 -42
  2. package/bin/commands/config.js +19 -0
  3. package/bin/commands/events.js +40 -0
  4. package/bin/commands/launch.js +126 -0
  5. package/bin/commands/manifest.js +283 -0
  6. package/bin/commands/registry.js +104 -0
  7. package/bin/commands/update.js +24 -0
  8. package/bin/lib/helpers.js +229 -0
  9. package/bin/orbital.js +95 -870
  10. package/dist/assets/Landing-CfQdHR0N.js +11 -0
  11. package/dist/assets/PrimitivesConfig-DThSipFy.js +32 -0
  12. package/dist/assets/QualityGates-B4kxM5UU.js +26 -0
  13. package/dist/assets/SessionTimeline-Bz1iZnmg.js +1 -0
  14. package/dist/assets/Settings-DLcZwbCT.js +12 -0
  15. package/dist/assets/SourceControl-BMNIz7Lt.js +36 -0
  16. package/dist/assets/WorkflowVisualizer-CxuSBOYu.js +69 -0
  17. package/dist/assets/{arrow-down-CPy85_J6.js → arrow-down-DVPp6_qp.js} +1 -1
  18. package/dist/assets/bot-NFaJBDn_.js +6 -0
  19. package/dist/assets/{charts-DbDg0Psc.js → charts-LGLb8hyU.js} +1 -1
  20. package/dist/assets/{circle-x-Cwz6ZQDV.js → circle-x-IsFCkBZu.js} +1 -1
  21. package/dist/assets/{file-text-C46Xr65c.js → file-text-J1cebZXF.js} +1 -1
  22. package/dist/assets/{globe-Cn2yNZUD.js → globe-WzeyHsUc.js} +1 -1
  23. package/dist/assets/index-BdJ57EhC.css +1 -0
  24. package/dist/assets/index-o4ScMAuR.js +349 -0
  25. package/dist/assets/{key-OPaNTWJ5.js → key-CKR8JJSj.js} +1 -1
  26. package/dist/assets/{minus-GMsbpKym.js → minus-CHBsJyjp.js} +1 -1
  27. package/dist/assets/radio-xqZaR-Uk.js +6 -0
  28. package/dist/assets/rocket-D_xvvNG6.js +6 -0
  29. package/dist/assets/{shield-DwAFkDYI.js → shield-TdB1yv_a.js} +1 -1
  30. package/dist/assets/useSocketListener-0L5yiN5i.js +1 -0
  31. package/dist/assets/useWorkflowEditor-CqeRWVQX.js +11 -0
  32. package/dist/assets/workflow-constants-Rw-GmgHZ.js +6 -0
  33. package/dist/assets/zap-C9wqYMpl.js +6 -0
  34. package/dist/index.html +3 -3
  35. package/dist/server/server/__tests__/data-routes.test.js +2 -0
  36. package/dist/server/server/__tests__/scope-routes.test.js +1 -0
  37. package/dist/server/server/config-migrator.js +0 -3
  38. package/dist/server/server/config.js +35 -6
  39. package/dist/server/server/database.js +0 -22
  40. package/dist/server/server/index.js +26 -814
  41. package/dist/server/server/init.js +32 -399
  42. package/dist/server/server/launch.js +1 -1
  43. package/dist/server/server/parsers/event-parser.js +4 -1
  44. package/dist/server/server/project-context.js +19 -9
  45. package/dist/server/server/project-manager.js +6 -6
  46. package/dist/server/server/routes/aggregate-routes.js +871 -0
  47. package/dist/server/server/routes/config-routes.js +41 -88
  48. package/dist/server/server/routes/data-routes.js +5 -15
  49. package/dist/server/server/routes/dispatch-routes.js +24 -8
  50. package/dist/server/server/routes/manifest-routes.js +1 -1
  51. package/dist/server/server/routes/scope-routes.js +10 -7
  52. package/dist/server/server/schema.js +1 -0
  53. package/dist/server/server/services/batch-orchestrator.js +17 -3
  54. package/dist/server/server/services/config-service.js +10 -1
  55. package/dist/server/server/services/scope-service.js +7 -7
  56. package/dist/server/server/services/sprint-orchestrator.js +24 -11
  57. package/dist/server/server/services/sprint-service.js +2 -2
  58. package/dist/server/server/uninstall.js +195 -0
  59. package/dist/server/server/update.js +212 -0
  60. package/dist/server/server/utils/dispatch-utils.js +8 -6
  61. package/dist/server/server/utils/flag-builder.js +54 -0
  62. package/dist/server/server/utils/json-fields.js +14 -0
  63. package/dist/server/server/utils/json-fields.test.js +73 -0
  64. package/dist/server/server/utils/route-helpers.js +37 -0
  65. package/dist/server/server/utils/route-helpers.test.js +115 -0
  66. package/dist/server/server/watchers/event-watcher.js +28 -13
  67. package/dist/server/server/wizard/config-editor.js +4 -4
  68. package/dist/server/server/wizard/doctor.js +2 -2
  69. package/dist/server/server/wizard/index.js +224 -39
  70. package/dist/server/server/wizard/phases/welcome.js +1 -4
  71. package/dist/server/server/wizard/ui.js +6 -7
  72. package/dist/server/shared/api-types.js +80 -1
  73. package/dist/server/shared/workflow-engine.js +1 -1
  74. package/package.json +20 -20
  75. package/schemas/orbital.config.schema.json +1 -19
  76. package/scripts/postinstall.js +6 -42
  77. package/scripts/release.sh +53 -0
  78. package/server/__tests__/data-routes.test.ts +2 -0
  79. package/server/__tests__/scope-routes.test.ts +1 -0
  80. package/server/config-migrator.ts +0 -3
  81. package/server/config.ts +39 -11
  82. package/server/database.ts +0 -26
  83. package/server/global-config.ts +4 -0
  84. package/server/index.ts +29 -894
  85. package/server/init.ts +32 -443
  86. package/server/launch.ts +1 -1
  87. package/server/parsers/event-parser.ts +4 -1
  88. package/server/project-context.ts +26 -10
  89. package/server/project-manager.ts +5 -6
  90. package/server/routes/aggregate-routes.ts +968 -0
  91. package/server/routes/config-routes.ts +41 -81
  92. package/server/routes/data-routes.ts +7 -16
  93. package/server/routes/dispatch-routes.ts +29 -8
  94. package/server/routes/manifest-routes.ts +1 -1
  95. package/server/routes/scope-routes.ts +12 -7
  96. package/server/schema.ts +1 -0
  97. package/server/services/batch-orchestrator.ts +18 -2
  98. package/server/services/config-service.ts +10 -1
  99. package/server/services/scope-service.ts +6 -6
  100. package/server/services/sprint-orchestrator.ts +24 -9
  101. package/server/services/sprint-service.ts +2 -2
  102. package/server/uninstall.ts +214 -0
  103. package/server/update.ts +263 -0
  104. package/server/utils/dispatch-utils.ts +8 -6
  105. package/server/utils/flag-builder.ts +56 -0
  106. package/server/utils/json-fields.test.ts +83 -0
  107. package/server/utils/json-fields.ts +14 -0
  108. package/server/utils/route-helpers.test.ts +144 -0
  109. package/server/utils/route-helpers.ts +38 -0
  110. package/server/watchers/event-watcher.ts +24 -12
  111. package/server/wizard/config-editor.ts +4 -4
  112. package/server/wizard/doctor.ts +2 -2
  113. package/server/wizard/index.ts +291 -40
  114. package/server/wizard/phases/welcome.ts +1 -5
  115. package/server/wizard/ui.ts +6 -7
  116. package/shared/api-types.ts +106 -0
  117. package/shared/workflow-engine.ts +1 -1
  118. package/templates/agents/QUICK-REFERENCE.md +1 -0
  119. package/templates/agents/README.md +1 -0
  120. package/templates/agents/SKILL-TRIGGERS.md +11 -0
  121. package/templates/agents/green-team/deep-dive.md +361 -0
  122. package/templates/hooks/end-session.sh +1 -0
  123. package/templates/hooks/init-session.sh +1 -0
  124. package/templates/hooks/scope-commit-logger.sh +2 -2
  125. package/templates/hooks/scope-create-gate.sh +2 -4
  126. package/templates/hooks/scope-gate.sh +4 -6
  127. package/templates/hooks/scope-helpers.sh +10 -1
  128. package/templates/hooks/scope-lifecycle-gate.sh +14 -5
  129. package/templates/hooks/scope-prepare.sh +1 -1
  130. package/templates/hooks/scope-transition.sh +14 -6
  131. package/templates/hooks/time-tracker.sh +2 -5
  132. package/templates/orbital.config.json +1 -4
  133. package/templates/presets/development.json +4 -4
  134. package/templates/presets/gitflow.json +7 -0
  135. package/templates/prompts/README.md +23 -0
  136. package/templates/prompts/deep-dive-audit.md +94 -0
  137. package/templates/quick/rules.md +56 -5
  138. package/templates/skills/git-commit/SKILL.md +21 -6
  139. package/templates/skills/git-dev/SKILL.md +8 -4
  140. package/templates/skills/git-main/SKILL.md +8 -4
  141. package/templates/skills/git-production/SKILL.md +6 -3
  142. package/templates/skills/git-staging/SKILL.md +6 -3
  143. package/templates/skills/scope-fix-review/SKILL.md +8 -4
  144. package/templates/skills/scope-implement/SKILL.md +13 -5
  145. package/templates/skills/scope-post-review/SKILL.md +16 -4
  146. package/templates/skills/scope-pre-review/SKILL.md +6 -2
  147. package/dist/assets/PrimitivesConfig-CrmQXYh4.js +0 -32
  148. package/dist/assets/QualityGates-BbasOsF3.js +0 -21
  149. package/dist/assets/SessionTimeline-CGeJsVvy.js +0 -1
  150. package/dist/assets/Settings-oiM496mc.js +0 -12
  151. package/dist/assets/SourceControl-B1fP2nJL.js +0 -41
  152. package/dist/assets/WorkflowVisualizer-CWLYf-f0.js +0 -74
  153. package/dist/assets/formatDistanceToNow-BMqsSP44.js +0 -1
  154. package/dist/assets/index-Aj4sV8Al.css +0 -1
  155. package/dist/assets/index-Bc9dK3MW.js +0 -354
  156. package/dist/assets/useWorkflowEditor-BJkTX_NR.js +0 -16
  157. package/dist/assets/zap-DfbUoOty.js +0 -11
  158. package/dist/server/server/services/telemetry-service.js +0 -143
  159. package/server/services/telemetry-service.ts +0 -195
  160. /package/{shared/default-workflow.json → templates/presets/default.json} +0 -0
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Bc9dK3MW.js";/**
1
+ import{c}from"./index-o4ScMAuR.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Bc9dK3MW.js";/**
1
+ import{c as o}from"./index-o4ScMAuR.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,6 @@
1
+ import{c as a}from"./index-o4ScMAuR.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const c=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],o=a("radio",c);export{o as R};
@@ -0,0 +1,6 @@
1
+ import{c}from"./index-o4ScMAuR.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],t=c("rocket",e);export{t as R};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Bc9dK3MW.js";/**
1
+ import{c}from"./index-o4ScMAuR.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{aa as o,ab as O,ac as S,ad as _,ae as y,af as X,ag as D,ah as T,s as x}from"./index-o4ScMAuR.js";import{a as Y}from"./vendor-Bqt8AJn2.js";function M(r,t){const e=+o(r)-+o(t);return e<0?-1:e>0?1:e}function b(r){return O(r,Date.now())}function w(r,t,e){const[s,n]=S(e==null?void 0:e.in,r,t),u=s.getFullYear()-n.getFullYear(),c=s.getMonth()-n.getMonth();return u*12+c}function F(r){return t=>{const s=(r?Math[r]:Math.trunc)(t);return s===0?0:s}}function A(r,t){return+o(r)-+o(t)}function N(r,t){const e=o(r,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function H(r,t){const e=o(r,t==null?void 0:t.in),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function L(r,t){const e=o(r,t==null?void 0:t.in);return+N(e,t)==+H(e,t)}function k(r,t,e){const[s,n,u]=S(e==null?void 0:e.in,r,r,t),c=M(n,u),a=Math.abs(w(n,u));if(a<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-c*a);let l=M(n,u)===-c;L(s)&&a===1&&M(s,u)===1&&(l=!1);const m=c*(a-+l);return m===0?0:m}function z(r,t,e){const s=A(r,t)/1e3;return F(e==null?void 0:e.roundingMethod)(s)}function E(r,t,e){const s=T(),n=(e==null?void 0:e.locale)??s.locale??_,u=2520,c=M(r,t);if(isNaN(c))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e==null?void 0:e.addSuffix,comparison:c}),[l,m]=S(e==null?void 0:e.in,...c>0?[t,r]:[r,t]),d=z(m,l),I=(y(m)-y(l))/1e3,f=Math.round((d-I)/60);let h;if(f<2)return e!=null&&e.includeSeconds?d<5?n.formatDistance("lessThanXSeconds",5,a):d<10?n.formatDistance("lessThanXSeconds",10,a):d<20?n.formatDistance("lessThanXSeconds",20,a):d<40?n.formatDistance("halfAMinute",0,a):d<60?n.formatDistance("lessThanXMinutes",1,a):n.formatDistance("xMinutes",1,a):f===0?n.formatDistance("lessThanXMinutes",1,a):n.formatDistance("xMinutes",f,a);if(f<45)return n.formatDistance("xMinutes",f,a);if(f<90)return n.formatDistance("aboutXHours",1,a);if(f<X){const i=Math.round(f/60);return n.formatDistance("aboutXHours",i,a)}else{if(f<u)return n.formatDistance("xDays",1,a);if(f<D){const i=Math.round(f/X);return n.formatDistance("xDays",i,a)}else if(f<D*2)return h=Math.round(f/D),n.formatDistance("aboutXMonths",h,a)}if(h=k(m,l),h<12){const i=Math.round(f/D);return n.formatDistance("xMonths",i,a)}else{const i=h%12,g=Math.trunc(h/12);return i<3?n.formatDistance("aboutXYears",g,a):i<9?n.formatDistance("overXYears",g,a):n.formatDistance("almostXYears",g+1,a)}}function j(r,t){return E(r,b(r),t)}function C(r,t,e=[]){Y.useEffect(()=>{const s=Array.isArray(r)?r:[r];for(const n of s)x.on(n,t);return()=>{for(const n of s)x.off(n,t)}},e)}export{j as f,C as u};
@@ -0,0 +1,11 @@
1
+ import{c as P,aW as W,e as V}from"./index-o4ScMAuR.js";import{a as o}from"./vendor-Bqt8AJn2.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const q=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],X=P("pencil",q);/**
7
+ * @license lucide-react v0.577.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const F=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Y=P("save",F);function K(c){const[a,u]=o.useState({past:[],present:structuredClone(c),future:[]}),h=o.useCallback(r=>{u(l=>({past:[...l.past,l.present].slice(-50),present:r,future:[]}))},[]),d=o.useCallback(()=>{u(r=>{if(r.past.length===0)return r;const l=[...r.past],y=l.pop();return{past:l,present:y,future:[r.present,...r.future]}})},[]),s=o.useCallback(()=>{u(r=>{if(r.future.length===0)return r;const l=[...r.future],y=l.shift();return{past:[...r.past,r.present],present:y,future:l}})},[]),f=o.useCallback(r=>{u({past:[],present:structuredClone(r),future:[]})},[]),g=o.useMemo(()=>a.past.length,[a.past.length]);return{present:a.present,canUndo:a.past.length>0,canRedo:a.future.length>0,changeCount:g,pushState:h,undo:d,redo:s,reset:f}}function B(c){const a=[];if(!W(c))return a.push("Invalid config shape: must have version=1, name, lists[], edges[]"),{valid:!1,errors:a};c.branchingMode!==void 0&&c.branchingMode!=="trunk"&&c.branchingMode!=="worktree"&&a.push(`Invalid branchingMode: "${c.branchingMode}" (must be "trunk" or "worktree")`);const u=new Set;for(const s of c.lists)u.has(s.id)&&a.push(`Duplicate list ID: "${s.id}"`),u.add(s.id);const h=new Set;for(const s of c.edges){u.has(s.from)||a.push(`Edge references unknown list: from="${s.from}"`),u.has(s.to)||a.push(`Edge references unknown list: to="${s.to}"`),s.from===s.to&&a.push(`Self-referencing edge: "${s.from}" → "${s.to}"`);const f=`${s.from}:${s.to}`;h.has(f)&&a.push(`Duplicate edge: ${f}`),h.add(f)}const d=c.lists.filter(s=>s.isEntryPoint);if(d.length===0&&a.push("No entry point defined (isEntryPoint=true)"),d.length>1&&a.push(`Multiple entry points: ${d.map(s=>s.id).join(", ")}`),d.length===1&&a.length===0){const s=new Set(c.terminalStatuses??[]),f=new Set,g=[d[0].id];for(;g.length>0;){const r=g.shift();if(!f.has(r)){f.add(r);for(const l of c.edges)l.from===r&&!f.has(l.to)&&g.push(l.to)}}for(const r of c.lists)!s.has(r.id)&&!f.has(r.id)&&a.push(`List "${r.id}" is not reachable from entry point`)}return{valid:a.length===0,errors:a}}function Z(c){const[a,u]=o.useState(!1),[h,d]=o.useState(!1),s=V(),[f,g]=o.useState(null),[r,l]=o.useState(!1),[y,k]=o.useState(null),[$,m]=o.useState(!1),[j,b]=o.useState(!1),[L,E]=o.useState(!1),[x,v]=o.useState(!1),e=K(c),C=o.useMemo(()=>B(e.present),[e.present]),N=o.useCallback(()=>{e.reset(c),u(!0)},[c,e]),w=o.useCallback(()=>{u(!1),m(!1),b(!1),E(!1),v(!1)},[]),T=o.useCallback(()=>{e.reset(c),w()},[c,e,w]),U=o.useCallback(n=>{const t=structuredClone(e.present);t.lists.push(n),e.pushState(t)},[e]),I=o.useCallback((n,t)=>{const i=structuredClone(e.present),S=i.lists.findIndex(p=>p.id===n.id);if(S!==-1){if(n.id!==t.id)for(const p of i.edges)p.from===n.id&&(p.from=t.id),p.to===n.id&&(p.to=t.id);i.lists[S]=t,e.pushState(i)}},[e]),O=o.useCallback(n=>{const t=structuredClone(e.present);t.lists=t.lists.filter(i=>i.id!==n),t.edges=t.edges.filter(i=>i.from!==n&&i.to!==n),e.pushState(t)},[e]),A=o.useCallback(n=>{const t=structuredClone(e.present);t.edges.push(n),e.pushState(t)},[e]),_=o.useCallback(n=>{e.pushState(structuredClone(n))},[e]),z=o.useCallback((n,t)=>{const i=structuredClone(e.present),S=`${n.from}:${n.to}`,p=i.edges.findIndex(M=>`${M.from}:${M.to}`===S);p!==-1&&(i.edges[p]=t,e.pushState(i))},[e]),D=o.useCallback((n,t)=>{const i=structuredClone(e.present);i.edges=i.edges.filter(S=>!(S.from===n&&S.to===t)),e.pushState(i)},[e]),H=o.useCallback(async()=>{if(!(!C.valid||h)){d(!0);try{const t=await(await fetch(s("/workflow"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e.present)})).json();if(!t.success)throw new Error(t.error??"Save failed");w()}catch(n){k(n instanceof Error?n.message:"Save failed")}finally{d(!1)}}},[C.valid,h,e.present,w,s]),J=o.useCallback(async()=>{l(!0),k(null),g(null),m(!0);try{const t=await(await fetch(s("/workflow/preview"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e.present)})).json();if(!t.success)throw new Error(t.error??"Preview failed");g(t.data??null)}catch(n){k(n instanceof Error?n.message:"Preview failed")}finally{l(!1)}},[e.present,s]),R=o.useCallback(async n=>{d(!0);try{const i=await(await fetch(s("/workflow/apply"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e.present,orphanMappings:n})})).json();if(!i.success)throw new Error(i.error??"Migration failed");m(!1),w()}catch(t){k(t instanceof Error?t.message:"Migration failed")}finally{d(!1)}},[e.present,w,s]);return{editMode:a,editConfig:e.present,canUndo:e.canUndo,canRedo:e.canRedo,changeCount:e.changeCount,validation:C,saving:h,previewPlan:f,previewLoading:r,previewError:y,showPreview:$,showAddList:j,showAddEdge:L,showConfigSettings:x,enterEditMode:N,exitEditMode:w,undo:e.undo,redo:e.redo,updateList:I,deleteList:O,addList:U,updateEdge:z,deleteEdge:D,addEdge:A,updateConfig:_,save:H,discard:T,preview:J,applyMigration:R,setShowPreview:m,setShowAddList:b,setShowAddEdge:E,setShowConfigSettings:v}}export{X as P,Y as S,Z as u};
@@ -0,0 +1,6 @@
1
+ import{c as e,E as o,T as r,S as a}from"./index-o4ScMAuR.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const c=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],t=e("cog",c),l={blocker:"#ef4444",advisor:"#f59e0b",operator:"#3b82f6",silent:"#6b7280"},n={blocker:"text-red-400 bg-red-500/10 border-red-500/20",advisor:"text-amber-400 bg-amber-500/10 border-amber-500/20",operator:"text-cyan-400 bg-cyan-500/10 border-cyan-500/20",silent:"text-zinc-400 bg-zinc-500/10 border-zinc-500/20"},d={blocker:"Blocks transition on failure",advisor:"Warns but allows transition",operator:"Side-effects during lifecycle",silent:"Observes without affecting outcome"},i={guard:{icon:a,color:"#ef4444",label:"Guards"},gate:{icon:r,color:"#f59e0b",label:"Gates"},lifecycle:{icon:t,color:"#3b82f6",label:"Lifecycle"},observer:{icon:o,color:"#6b7280",label:"Observers"}},b={guard:"#ef4444",gate:"#f59e0b",lifecycle:"#06b6d4",observer:"#71717a"};export{t as C,n as E,b as a,i as b,l as c,d};
@@ -0,0 +1,6 @@
1
+ import{c as a}from"./index-o4ScMAuR.js";/**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
package/dist/index.html CHANGED
@@ -8,11 +8,11 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="/assets/index-Bc9dK3MW.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-o4ScMAuR.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/vendor-Bqt8AJn2.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/ui-BmsSg9jU.js">
14
- <link rel="modulepreload" crossorigin href="/assets/charts-DbDg0Psc.js">
15
- <link rel="stylesheet" crossorigin href="/assets/index-Aj4sV8Al.css">
14
+ <link rel="modulepreload" crossorigin href="/assets/charts-LGLb8hyU.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/index-BdJ57EhC.css">
16
16
  </head>
17
17
  <body class="h-full">
18
18
  <div id="root" class="h-full"></div>
@@ -9,6 +9,7 @@ import { WorkflowEngine } from '../../shared/workflow-engine.js';
9
9
  import { createTestDb } from './helpers/db.js';
10
10
  import { createMockEmitter } from './helpers/mock-emitter.js';
11
11
  import { DEFAULT_CONFIG } from '../../shared/__fixtures__/workflow-configs.js';
12
+ import { loadConfig } from '../config.js';
12
13
  describe('data-routes', () => {
13
14
  let app;
14
15
  let db;
@@ -37,6 +38,7 @@ describe('data-routes', () => {
37
38
  engine,
38
39
  projectRoot: '/tmp/test-project',
39
40
  inferScopeStatus: vi.fn(),
41
+ config: loadConfig('/tmp/test-project'),
40
42
  });
41
43
  app = express();
42
44
  app.use(express.json());
@@ -61,6 +61,7 @@ describe('scope-routes', () => {
61
61
  projectRoot: '/tmp/test-project',
62
62
  projectName: 'Test',
63
63
  engine,
64
+ config: { claude: { dispatchFlags: { permissionMode: 'bypass', verbose: false, noMarkdown: false, printMode: false, outputFormat: null, allowedTools: [], disallowedTools: [], appendSystemPrompt: '' } }, dispatch: { envVars: {}, maxConcurrent: 5, maxBatchSize: 20, staleTimeoutMinutes: 10 } },
64
65
  });
65
66
  app = express();
66
67
  app.use(express.json());
@@ -55,9 +55,6 @@ const NESTED_DEFAULTS = {
55
55
  lint: null,
56
56
  build: null,
57
57
  test: null,
58
- validateTemplates: null,
59
- validateDocs: null,
60
- checkRules: null,
61
58
  },
62
59
  };
63
60
  /**
@@ -3,6 +3,8 @@ import fs from 'fs';
3
3
  import { execFileSync } from 'child_process';
4
4
  import os from 'os';
5
5
  import { createLogger } from './utils/logger.js';
6
+ import { DEFAULT_DISPATCH_FLAGS, DEFAULT_DISPATCH_CONFIG } from '../shared/api-types.js';
7
+ import { loadGlobalConfig as loadGlobal } from './global-config.js';
6
8
  // ─── Defaults ───────────────────────────────────────────────
7
9
  const DEFAULT_CONFIG = {
8
10
  projectName: 'Project',
@@ -19,19 +21,18 @@ const DEFAULT_CONFIG = {
19
21
  claude: {
20
22
  executable: 'claude',
21
23
  flags: ['--dangerously-skip-permissions'],
24
+ dispatchFlags: DEFAULT_DISPATCH_FLAGS,
22
25
  },
26
+ dispatch: DEFAULT_DISPATCH_CONFIG,
23
27
  commands: {
24
28
  typeCheck: null,
25
29
  lint: null,
26
30
  build: null,
27
31
  test: null,
28
- validateTemplates: null,
29
- validateDocs: null,
30
- checkRules: null,
31
32
  },
32
33
  logLevel: 'info',
33
34
  telemetry: {
34
- enabled: true,
35
+ enabled: false,
35
36
  url: '',
36
37
  headers: {},
37
38
  },
@@ -39,7 +40,6 @@ const DEFAULT_CONFIG = {
39
40
  agents: [
40
41
  { id: 'attacker', label: 'Attacker', emoji: '\u{1F5E1}\u{FE0F}', color: '#ff1744' },
41
42
  { id: 'chaos', label: 'Chaos', emoji: '\u{1F4A5}', color: '#F97316' },
42
- { id: 'solana-expert', label: 'Solana Expert', emoji: '\u{26D3}\u{FE0F}', color: '#8B5CF6' },
43
43
  { id: 'frontend-designer', label: 'Frontend Designer', emoji: '\u{1F3A8}', color: '#EC4899' },
44
44
  { id: 'architect', label: 'Architect', emoji: '\u{1F3D7}\u{FE0F}', color: '#536dfe' },
45
45
  { id: 'rules-enforcer', label: 'Rules Enforcer', emoji: '\u{1F4CB}', color: '#6B7280' },
@@ -94,6 +94,15 @@ export function getClaudeSessionsDir(projectRoot) {
94
94
  */
95
95
  export function loadConfig(projectRoot) {
96
96
  const root = projectRoot ?? resolveProjectRoot();
97
+ // Try loading edition overrides (e.g. edition.json at repo root)
98
+ const editionPath = path.join(root, 'edition.json');
99
+ let editionConfig = {};
100
+ if (fs.existsSync(editionPath)) {
101
+ try {
102
+ editionConfig = JSON.parse(fs.readFileSync(editionPath, 'utf-8'));
103
+ }
104
+ catch { /* malformed edition.json — ignore */ }
105
+ }
97
106
  // Try loading user config
98
107
  const configPath = path.join(root, '.claude', 'orbital.config.json');
99
108
  let userConfig = {};
@@ -121,10 +130,27 @@ export function loadConfig(projectRoot) {
121
130
  ...DEFAULT_CONFIG.terminal,
122
131
  ...(userConfig.terminal ?? {}),
123
132
  };
133
+ // Global settings — seed from ~/.orbital/config.json
134
+ let globalDispatchFlags = DEFAULT_DISPATCH_FLAGS;
135
+ let globalDispatch = DEFAULT_DISPATCH_CONFIG;
136
+ let globalTelemetry = {};
137
+ try {
138
+ const global = loadGlobal();
139
+ if (global.dispatchFlags)
140
+ globalDispatchFlags = { ...DEFAULT_DISPATCH_FLAGS, ...global.dispatchFlags };
141
+ if (global.dispatch)
142
+ globalDispatch = { ...DEFAULT_DISPATCH_CONFIG, ...global.dispatch };
143
+ if (global.telemetry)
144
+ globalTelemetry = global.telemetry;
145
+ }
146
+ catch { /* global config may not exist yet */ }
147
+ const userClaude = userConfig.claude ?? {};
124
148
  const claude = {
125
149
  ...DEFAULT_CONFIG.claude,
126
- ...(userConfig.claude ?? {}),
150
+ ...userClaude,
151
+ dispatchFlags: globalDispatchFlags,
127
152
  };
153
+ const dispatch = globalDispatch;
128
154
  const commands = {
129
155
  ...DEFAULT_CONFIG.commands,
130
156
  ...(userConfig.commands ?? {}),
@@ -134,6 +160,8 @@ export function loadConfig(projectRoot) {
134
160
  const agents = userConfig.agents ?? DEFAULT_CONFIG.agents;
135
161
  const telemetry = {
136
162
  ...DEFAULT_CONFIG.telemetry,
163
+ ...globalTelemetry,
164
+ ...(editionConfig.telemetry ?? {}),
137
165
  ...(userConfig.telemetry ?? {}),
138
166
  };
139
167
  if (process.env.ORBITAL_TELEMETRY === 'false')
@@ -149,6 +177,7 @@ export function loadConfig(projectRoot) {
149
177
  clientPort,
150
178
  terminal,
151
179
  claude,
180
+ dispatch,
152
181
  commands,
153
182
  logLevel,
154
183
  categories,
@@ -2,7 +2,6 @@ import Database from 'better-sqlite3';
2
2
  import path from 'path';
3
3
  import fs from 'fs';
4
4
  import { SCHEMA_DDL } from './schema.js';
5
- import { getConfig } from './config.js';
6
5
  import { createLogger } from './utils/logger.js';
7
6
  const log = createLogger('database');
8
7
  // ─── Factory (multi-project) ────────────────────────────────
@@ -11,7 +10,6 @@ const log = createLogger('database');
11
10
  * Creates the directory if needed, applies schema DDL and migrations.
12
11
  *
13
12
  * Each call returns a NEW connection — callers manage their own lifecycle.
14
- * This is the multi-project replacement for the getDatabase() singleton.
15
13
  */
16
14
  export function openProjectDatabase(dbDir) {
17
15
  fs.mkdirSync(dbDir, { recursive: true });
@@ -25,19 +23,6 @@ export function openProjectDatabase(dbDir) {
25
23
  runMigrations(database);
26
24
  return database;
27
25
  }
28
- // ─── Singleton (backward compat, used by index.ts) ──────────
29
- function getDbPaths() {
30
- const config = getConfig();
31
- return { dir: config.dbDir, file: path.join(config.dbDir, 'orbital.db') };
32
- }
33
- let db = null;
34
- /** @deprecated Use openProjectDatabase() for multi-project support. */
35
- export function getDatabase() {
36
- if (db)
37
- return db;
38
- db = openProjectDatabase(getDbPaths().dir);
39
- return db;
40
- }
41
26
  /** Check if a table exists in the database */
42
27
  function tableExists(database, tableName) {
43
28
  const row = database.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(tableName);
@@ -96,10 +81,3 @@ function runMigrations(database) {
96
81
  `);
97
82
  }
98
83
  }
99
- export function closeDatabase() {
100
- if (db) {
101
- db.close();
102
- db = null;
103
- log.debug('Database closed');
104
- }
105
- }