openplanr 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cli/commands/upgrade.d.ts.map +1 -1
  3. package/dist/cli/commands/upgrade.js +4 -2
  4. package/dist/cli/commands/upgrade.js.map +1 -1
  5. package/dist/dashboard/.vite/manifest.json +1 -1
  6. package/dist/dashboard/assets/{index-Csby7_ur.js → index-n08LJ6bK.js} +2 -2
  7. package/dist/dashboard/assets/{index-Csby7_ur.js.map → index-n08LJ6bK.js.map} +1 -1
  8. package/dist/dashboard/dashboard-manifest.json +8 -8
  9. package/dist/dashboard/index.html +1 -1
  10. package/dist/services/claude-plugin-service.d.ts +9 -0
  11. package/dist/services/claude-plugin-service.d.ts.map +1 -1
  12. package/dist/services/claude-plugin-service.js +12 -0
  13. package/dist/services/claude-plugin-service.js.map +1 -1
  14. package/dist/services/upgrade-report.d.ts.map +1 -1
  15. package/dist/services/upgrade-report.js +5 -2
  16. package/dist/services/upgrade-report.js.map +1 -1
  17. package/dist/services/upgrade-service.d.ts +14 -0
  18. package/dist/services/upgrade-service.d.ts.map +1 -1
  19. package/dist/services/upgrade-service.js +66 -10
  20. package/dist/services/upgrade-service.js.map +1 -1
  21. package/lib/host-packages/adapter-registry.json +5 -5
  22. package/lib/host-packages/capability-map.json +1 -1
  23. package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
  24. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
  25. package/lib/host-packages/claude/openplanr/.openplanr-content.json +9 -9
  26. package/lib/host-packages/claude/openplanr/README.md +1 -1
  27. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  28. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  29. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +146 -54
  30. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +4 -4
  31. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  32. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  33. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +8 -8
  34. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  35. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  36. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  37. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +146 -54
  38. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +4 -4
  39. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  40. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  41. package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
  42. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
  43. package/lib/host-packages/openai/openplanr/.openplanr-content.json +8 -8
  44. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  45. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  46. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +146 -54
  47. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +4 -4
  48. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  49. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  50. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0b4992c: Expose the shared authored diagram review projection for browser callers without filesystem dependencies, preserving graph, geometry and validated source identity while excluding private source correspondence.
8
+ - 0b4992c: Add revision-aware company workspace contracts for project and artifact catalogs, fixed-revision guest access, publication recovery, and project archive and restore. Browser consumers can validate these records while existing contracts remain readable.
9
+ - 0b4992c: Studio and diagram toolbars switch to a compact layout when their controls stop fitting rather than at a fixed width, list actions before view tools so visual and keyboard order match, keep titles readable beside navigation controls, and return keyboard focus to the menu trigger when the layout reflows.
10
+ - 0b4992c: Retain independent diagram edits during concurrent saves, require explicit overlap choices, and preserve exact retries through recovery. Trusted hosts can present one comparison dialog without changing standalone editing.
11
+ - 46337d9: `openplanr upgrade status` recognizes the Claude plugin when it was added from the Claude plugin directory or another marketplace, and shows where it came from. It no longer suggests installing a second copy beside it: when that plugin is older than the CLI, status reports the coding agent as behind and explains that Claude updates the plugin.
12
+
3
13
  ## 3.0.0
4
14
 
5
15
  ### Major Changes
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,QAsH3E"}
1
+ {"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBzC;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,QAwH3E"}
@@ -2,7 +2,7 @@ import { isNonInteractive } from '../../services/interactive-state.js';
2
2
  import { runPendingMigrations } from '../../services/migration-registry.js';
3
3
  import { promptConfirm } from '../../services/prompt-service.js';
4
4
  import { printNextSteps, printReconciliationStatus, printUpgradeReport, } from '../../services/upgrade-report.js';
5
- import { executeCliHalfUpgrade, planCliUpgrade, reconcileInstalledTuple, upgradeNextSteps, withAgentNextSteps, } from '../../services/upgrade-service.js';
5
+ import { executeCliHalfUpgrade, hostPluginSource, planCliUpgrade, reconcileInstalledTuple, upgradeNextSteps, withAgentNextSteps, } from '../../services/upgrade-service.js';
6
6
  import { CLI_COMMAND } from '../../utils/constants.js';
7
7
  import { display, logger } from '../../utils/logger.js';
8
8
  /**
@@ -31,7 +31,9 @@ export function registerUpgradeCommand(program, _cliVersion) {
31
31
  display.keyValue('Manifest source', result.ecosystemSource);
32
32
  display.keyValue('Installed CLI', result.installed.cli);
33
33
  display.keyValue('Bundled pipeline', result.bundledPipeline ?? 'not resolved');
34
- display.keyValue('Installed host plugin (planr@openplanr-local)', result.installed.skills ?? 'not installed');
34
+ display.keyValue('Claude plugin', result.hostPlugin
35
+ ? `${result.hostPlugin.id} ${result.hostPlugin.version ?? 'version unknown'} (${hostPluginSource(result.hostPlugin)})`
36
+ : 'not installed');
35
37
  if (result.legacyPlugins && result.legacyPlugins.length > 0) {
36
38
  display.keyValue('Legacy plugins', result.legacyPlugins.join(', '));
37
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../src/cli/commands/upgrade.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,kBAAkB,GAEnB,MAAM,kC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,EAAE;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -44,7 +44,7 @@
44
44
  "src": "../../../node_modules/@fontsource-variable/geist/files/geist-vietnamese-wght-normal.woff2"
45
45
  },
46
46
  "index.html": {
47
- "file": "assets/index-Csby7_ur.js",
47
+ "file": "assets/index-n08LJ6bK.js",
48
48
  "name": "index",
49
49
  "src": "index.html",
50
50
  "isEntry": true,
@@ -553,5 +553,5 @@ Error generating stack: `+d.message+`
553
553
  `),C=(b=I.find(S=>S.startsWith("event:")))==null?void 0:b.slice(6).trim(),O=I.filter(S=>S.startsWith("data:")).map(S=>S.slice(5).trimStart()).join(`
554
554
  `);O&&e.reconciler.ingestSseFrame(O,C),x=m.indexOf(`
555
555
 
556
- `)}if(w.done){if(m.trim())return he("$","Planning live response ended mid-frame");break}}}finally{A.releaseLock()}})().catch(h=>{if(!t.signal.aborted)throw h instanceof ee?h:new ee("$","Planning live response failed safely")}).finally(()=>{var h;return(h=e.signal)==null?void 0:h.removeEventListener("abort",a)});return Object.freeze({completion:l,close:()=>{var h;t.abort(),e.reconciler.dispose(),(h=e.signal)==null||h.removeEventListener("abort",a)}})}const B4=Object.freeze({connectSse:E4,createSseReconciler:h4,encodeCheckpoint:y4,fetchGraph:A4,parseGraphEnvelope:Su}),v4=Object.freeze(Object.defineProperty({__proto__:null,planningRuntime:B4},Symbol.toStringTag,{value:"Module"})),b4=Object.freeze({create:Ve}),w4=Object.freeze({ValidationError:ee,isValidatedState:Pe,parseSafeError:Uw,parseState:so,statePolicy:oo}),x4=Object.freeze({parse:Ha}),j4=Object.freeze({connectSse:aI,createSseReconciler:nI}),Q4=Object.freeze({identity:b4,projection:w4,routing:x4,transport:j4}),I4=Object.freeze(Object.defineProperty({__proto__:null,dashboardRuntime:Q4},Symbol.toStringTag,{value:"Module"})),{operateRuntime:Xe}=JP,{planningRuntime:Hc}=v4,{dashboardRuntime:Ne}=I4,XI=new Set(["ready","read-only","stale","partial","blocked","offline"]),Pr=Ne.projection.parseState({kind:"booting",binding:null,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("booting")}),WI=Ne.routing.parse("#/overview");function e0(e){return`DASHBOARD_${e.toUpperCase().replace("-","_")}`}function pr(e){return Ne.projection.parseState({kind:"loading",binding:e,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("loading")},{currentBinding:e})}function t0(e,t=null){return Ne.projection.parseState({kind:"unavailable",binding:e,data:null,reasonCodes:["DASHBOARD_UNAVAILABLE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("unavailable")},{currentBinding:e})}function yr(e,t=!1){const s=(e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}).code==="DASHBOARD_RESPONSE_INVALID"||e instanceof Ne.projection.ValidationError;return Ne.projection.parseSafeError({code:t||!s?"DASHBOARD_READ_FAILED":"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{operation:"dashboard.projection.read"}})}function Ya(e,t){const a=t??yr(void 0);if(a.code!=="DASHBOARD_RESPONSE_INVALID")return t0(e,a);const s=Ne.projection.parseSafeError({code:"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{}});return Ne.projection.parseState({kind:"corrupt",binding:null,data:null,reasonCodes:["DASHBOARD_CORRUPT"],error:s,mutationEnabled:!1,policy:Ne.projection.statePolicy("corrupt")})}function C4(e,t,a,s,c=!1,l=null){if(!XI.has(e))throw new Error("Unsupported owner presentation state.");return Ne.projection.parseState({kind:e,binding:t,data:a,reasonCodes:e==="ready"?[]:[e0(e)],error:l,mutationEnabled:e==="ready"&&c,policy:Ne.projection.statePolicy(e)},{currentBinding:t,validateData:s})}function S4(e,t){return!Ne.projection.isValidatedState(e)||e.binding===null||e.data===null?e:Ne.projection.parseState({kind:"stale",binding:e.binding,data:e.data,reasonCodes:["DASHBOARD_STALE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("stale")},{currentBinding:e.binding,validateData:a=>a!==null})}function O4(e,t){return Ne.projection.parseState({kind:e,binding:t,data:null,reasonCodes:[e0(e)],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy(e)},{currentBinding:t})}function Fr(e,t){const a=B.useRef(t);a.current=t;const s=B.useRef(e);s.current=e;const c=B.useRef(null),l=B.useRef(null),[u,f]=B.useState(0),[h,A]=B.useState(()=>Object.freeze({key:null,revision:0,phase:"idle",data:null,error:null})),y=B.useCallback(()=>f(j=>j+1),[]),m=B.useCallback(()=>{var O;if(c.current!==null)return c.current;const j=s.current;if(j===null)return Promise.reject(new Error("Owner read is unavailable."));const I=new AbortController;(O=l.current)==null||O.abort(),l.current=I,A(S=>Object.freeze({key:j,revision:S.revision,phase:"loading",data:S.key===j?S.data:null,error:null}));const C=a.current(I.signal).then(S=>{if(I.signal.aborted||s.current!==j)throw new DOMException("Cancelled","AbortError");return A(_=>Object.freeze({key:j,revision:_.revision,phase:"ready",data:S,error:null})),S}).catch(S=>{throw!I.signal.aborted&&s.current===j&&A(_=>Object.freeze({key:j,revision:_.revision,phase:"failed",data:_.key===j?_.data:null,error:yr(S,_.key===j&&_.data!==null)})),S}).finally(()=>{c.current===C&&(c.current=null),l.current===I&&(l.current=null)});return c.current=C,C},[]);B.useEffect(()=>{var I;if((I=l.current)==null||I.abort(),l.current=null,c.current=null,e===null){A(Object.freeze({key:null,revision:u,phase:"idle",data:null,error:null}));return}const j=new AbortController;return A(C=>Object.freeze({key:e,revision:u,phase:"loading",data:C.key===e?C.data:null,error:null})),a.current(j.signal).then(C=>{j.signal.aborted||A(Object.freeze({key:e,revision:u,phase:"ready",data:C,error:null}))}).catch(C=>{j.signal.aborted||A(O=>Object.freeze({key:e,revision:u,phase:"failed",data:O.key===e?O.data:null,error:yr(C,O.key===e&&O.data!==null)}))}),()=>j.abort()},[e,u]);const E=h.key===e&&h.revision===u,b=E?h.phase:e===null?"idle":"loading",w=E?h.data:null,x=E?h.error:null;return B.useMemo(()=>Object.freeze({phase:b,data:w,error:x,refetch:y,reconcile:m}),[w,x,b,m,y])}function _4(e){return e===null?null:JSON.stringify(e)}function N4(e){return e.product==="planning"?e:WI}function R4(e){return e.kind==="operate.evidence"||e.kind==="operate.evidence-item"?"evidence":e.kind==="operate.outcomes"?"outcomes":e.kind==="operate.outcome"?"outcome":e.kind==="operate.history"?"history":null}function tu(e){return e.kind==="operate.actions"||e.kind==="operate.action"||e.kind==="operate.action-planning"||e.kind==="operate.inbox"||e.kind==="operate.inbox-item"||e.kind==="operate.recovery"}function D4(e){return e.kind==="operate.action-planning"?{kind:"operate.action",product:"operate",subjectId:e.subjectId}:e}function Vr(e){return Object.freeze({eventHead:e.payload.eventHead,viewHash:e.payload.viewHash})}function Io(e){const t=e.payload.status;if(!XI.has(t))throw new Ne.projection.ValidationError("$.payload.status","contains an unsupported display status");return t}function T4(e){return e.payload.status==="terminal"?"read-only":Io(e)}function Ew(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.payload.sourceEventHead,viewHash:e.data.payload.sourceViewHash});return Ei(e,a,e.data,Xe.review.createValidator(a),T4(e.data),e.data.payload.mutationEnabled)}function Ei(e,t,a,s,c,l=!1){const u=e.phase==="failed"?"stale":e.phase==="loading"||e.phase==="idle"?"refreshing":c;try{return C4(u,t,a,s,l,u==="stale"?e.error??yr(void 0,!0):null)}catch(f){return Ya(t,yr(f))}}function Bw(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.cursor.eventHead,viewHash:e.data.cursor.viewHash});return Ei(e,a,e.data,s=>{try{return Hc.parseGraphEnvelope(s,t),!0}catch{return!1}},"ready")}function vw(e,t,a,s){var u;if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const c=Ne.identity.create({...t,...Vr(e.data)}),l=a==="today"?Xe.today.createValidator(c):Xe.cycles.createListValidator(c);return e.phase!=="ready"?Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled):a==="today"&&e.data.payload.surface==="today"&&e.data.payload.status==="ready"&&e.data.payload.data.activeCycle===null?l(e.data)?s?s.phase==="loading"||s.phase==="idle"?Ei(Object.freeze({...e,phase:"loading",error:null}),c,e.data,l,"ready"):s.phase==="failed"?Ei(Object.freeze({...e,phase:"failed",error:s.error}),c,e.data,l,"ready"):((u=s.data)==null?void 0:u.payload.surface)!=="cycles"?Ya(c,yr(new Ne.projection.ValidationError("$.payload.surface","does not contain the required cycles display"))):O4(s.data.payload.data.cycles.length===0?"first-use":"empty",c):pr(c):Ya(c,yr(new Ne.projection.ValidationError("$.data","failed its owner-boundary contract"))):Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled)}function k4(e){if(e.subjectId===null)throw new Error("Action display identity requires a subject.");return Ne.identity.create({...e,route:`#/operate/actions/${encodeURIComponent(e.subjectId)}`})}function bw(e,t,a){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const s=Ne.identity.create({...t,...Vr(e.data)});let c;if(a.kind==="operate.actions")c=Xe.actions.createListValidator(s);else if(a.kind==="operate.action"||a.kind==="operate.action-planning"){const l=a.kind==="operate.action-planning"?k4(s):s;c=Xe.actions.createDetailValidator(l)}else if(a.kind==="operate.inbox"||a.kind==="operate.inbox-item")c=Xe.actions.createInboxValidator(s);else if(a.kind==="operate.recovery")c=Xe.actions.createRecoveryValidator(s);else return t0(s);return Ei(e,s,e.data,c,Io(e.data),a.kind==="operate.action-planning"?!1:e.data.payload.mutationEnabled)}function M4(e,t){var ye,Ee;const a=(e==null?void 0:e.origin)??null,s=JSON.stringify(t),[c,l]=B.useState(null),u=(e==null?void 0:e.queryRoots.planning)??null,f=(e==null?void 0:e.queryRoots.operate)??null,h=B.useMemo(()=>N4(t),[t]),A=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,WI):null,[u]),y=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,h):null,[u,h]),m=Fr(A?JSON.stringify(A):null,R=>{if(!a||!A)throw new Error("Planning query root is unavailable.");return Hc.fetchGraph({origin:a,identity:A,signal:R})}),E=_4(f),b=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"today",signal:R})}),w=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"cycles",signal:R})}),x=((ye=b.data)==null?void 0:ye.payload.surface)==="today"?b.data:null,j=(x==null?void 0:x.payload.surface)==="today"?((Ee=x.payload.data.activeCycle)==null?void 0:Ee.cycleId)??null:null,I=t.kind==="operate.cycle"?t.subjectId:t.kind==="operate.review"?t.cycleId:j,C=x?Vr(x):null,O=B.useMemo(()=>f&&t.product==="operate"&&I&&C?Xe.transport.identityFromRoot(f,t,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[C,f,t,I]),S=a&&f&&O?JSON.stringify({root:f,binding:O}):null,_=B.useMemo(()=>f&&t.kind==="operate.review"?Xe.transport.identityFromRoot(f,t,{cycleId:t.cycleId}):null,[f,t]),k=a&&_?JSON.stringify({root:f,route:_.route}):null,N=Fr(k,R=>{if(!a||!f||t.kind!=="operate.review")throw new Error("Operate Review query custody is incomplete.");return Xe.review.fetch({origin:a,root:f,cycleId:t.cycleId,reviewId:t.subjectId,signal:R})}),z=B.useMemo(()=>D4(t),[t]),M=B.useMemo(()=>f&&tu(t)&&I&&C?Xe.transport.identityFromRoot(f,z,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[z,C,f,t,I]),L=a&&f&&M?JSON.stringify({root:f,binding:M}):null,Z=R4(t),F=Fr(Z?S:null,R=>{if(!a||!f||!I||!Z)throw new Error("Operate audit query custody is incomplete.");return Xe.transport.fetchAuditDisplay({origin:a,root:f,route:t,surface:Z,cycleId:I,signal:R})}),oe=Fr(t.kind==="operate.cycle"?S:null,R=>{if(!a||!f||t.kind!=="operate.cycle")throw new Error("Operate Cycle query custody is incomplete.");return Xe.transport.fetchCycleDisplay({origin:a,root:f,cycleId:t.subjectId,signal:R})}),re=Fr(tu(t)?L:null,R=>{if(!a||!M)throw new Error("Operate route display custody is incomplete.");if(t.kind==="operate.actions")return Xe.actions.fetchList({origin:a,identity:M,signal:R});if(t.kind==="operate.action"||t.kind==="operate.action-planning")return Xe.actions.fetchDetail({origin:a,identity:M,signal:R});if(t.kind==="operate.inbox"||t.kind==="operate.inbox-item")return Xe.actions.fetchInbox({origin:a,identity:M,signal:R});if(t.kind==="operate.recovery")return Xe.actions.fetchRecovery({origin:a,identity:M,signal:R});throw new Error("Operate route does not own a bound display read.")}),pe=B.useMemo(()=>y?Bw(m,y):Pr,[y,m]),Y=B.useMemo(()=>{if(!f)return null;const R=Ne.routing.parse("#/operate/today");return Xe.transport.identityFromRoot(f,R,{cycleId:j})},[j,f]),V=B.useMemo(()=>Y?vw(b,Y,"today",w):Pr,[w,Y,b]),te=B.useMemo(()=>{if(!V.binding||!I)return null;const R=Xe.today.resolveModel({current:V},V.binding);return(R==null?void 0:R.kind)==="surface"?Xe.review.uniqueNavigationForCycle(R,I):null},[I,V]),le=B.useMemo(()=>f?Xe.transport.identityFromRoot(f,Ne.routing.parse("#/operate/cycles")):null,[f]),fe=B.useMemo(()=>le?vw(w,le,"cycles"):Pr,[le,w]),T=B.useMemo(()=>{var ne;if(!f||((ne=w.data)==null?void 0:ne.payload.surface)!=="cycles")return Object.freeze([]);const R=Vr(w.data),J=Ne.routing.parse("#/operate/cycles");return Object.freeze(w.data.payload.data.cycles.map(Ae=>Xe.transport.identityFromRoot(f,J,{cycleId:Ae.cycleId,eventHead:R.eventHead,viewHash:R.viewHash})))},[w,f]),X=B.useMemo(()=>{if(t.product==="planning")return Object.freeze({binding:pe.binding,projection:pe});if(t.product!=="operate"||!f)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.today")return Object.freeze({binding:V.binding,projection:V});if(t.kind==="operate.cycles")return Object.freeze({binding:fe.binding,projection:fe});if(t.kind==="operate.review"){if(!_)return Object.freeze({binding:null,projection:Pr});const J=Ew(N,_);return Object.freeze({binding:J.binding,projection:J})}if(!C||!I)return Object.freeze({binding:null,projection:Pr});const R=O;if(!R)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.cycle"){if(oe.data===null){const ne=oe.phase==="loading"||oe.phase==="idle"?pr(R):Ya(R,oe.error);return Object.freeze({binding:ne.binding,projection:ne})}const J=Ne.identity.create({...R,...Vr(oe.data)});return Object.freeze({binding:J,projection:Ei(oe,J,oe.data,Xe.cycles.createDetailValidator(J),Io(oe.data),oe.data.payload.mutationEnabled)})}if(Z){if(F.data===null){const Ae=F.phase==="loading"||F.phase==="idle"?pr(R):Ya(R,F.error);return Object.freeze({binding:Ae.binding,projection:Ae})}const J=Ne.identity.create({...R,...Vr(F.data)}),ne=Z==="evidence"?Xe.audit.createEvidenceValidator(J):Z==="outcomes"||Z==="outcome"?Xe.audit.createOutcomeValidator(J):Xe.audit.createHistoryValidator(J);return Object.freeze({binding:J,projection:Ei(F,J,F.data,ne,Io(F.data),!1)})}return tu(t)?Object.freeze({binding:R,projection:bw(re,R,t)}):Object.freeze({binding:R,projection:pr(R)})},[F,Z,re,O,oe,C,fe,f,pe,N,_,t,I,V]);B.useEffect(()=>{l(R=>R!==null&&R.routeKey!==s?null:R)},[s]);const se=B.useMemo(()=>c!==null&&c.routeKey===s&&(!Ne.projection.isValidatedState(X.projection)||X.projection.data===null)?Object.freeze({binding:c.binding,projection:c.projection}):X,[c,X,s]);B.useEffect(()=>{if(!a||!m.data||m.phase!=="ready"||!A)return;const R=Ne.identity.create({...A,eventHead:m.data.cursor.eventHead,viewHash:m.data.cursor.viewHash});let J=!0;const ne=Hc.createSseReconciler({identity:R,initial:m.data,isCurrent:()=>J,onSnapshot:()=>{},onPatch:()=>m.refetch(),onRefetch:()=>m.refetch(),onStale:()=>m.refetch()}),Ae=Hc.connectSse({origin:a,identity:R,reconciler:ne,lastEventId:Hc.encodeCheckpoint(m.data.cursor)});return Ae.completion.catch(()=>{}),()=>{J=!1,Ae.close()}},[a,A,m]),B.useEffect(()=>{if(!a||!f||!x||!Y)return;const R=Vr(x),J=Ne.identity.create({...Y,...R});let ne=!0;const Ae=Ne.transport.createSseReconciler({identity:J,isCurrent:()=>ne,onSnapshot:(xe,Ze)=>{var Ie,ce;(Ze.eventHead.sequence!==((Ie=R.eventHead)==null?void 0:Ie.sequence)||Ze.eventHead.hash!==((ce=R.eventHead)==null?void 0:ce.hash)||Ze.viewHash!==R.viewHash)&&(b.refetch(),w.refetch())},onPatch:()=>{b.refetch(),w.refetch()},onRefetch:()=>{b.refetch(),w.refetch()},onStale:()=>{b.refetch(),w.refetch()}}),we=Ne.transport.connectSse({origin:a,identity:J,reconciler:Ae});return we.completion.catch(()=>{}),()=>{ne=!1,we.close()}},[w,a,f,x,Y,b]);const de=B.useCallback(async()=>{const R=se;R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:R.projection}));try{let J;if(t.kind==="operate.review"&&_){const ne=await N.reconcile();J=Ew(Object.freeze({phase:"ready",data:ne,error:null,refetch:N.refetch,reconcile:N.reconcile}),_)}else if(tu(t)&&O){const ne=await re.reconcile();J=bw(Object.freeze({phase:"ready",data:ne,error:null,refetch:re.refetch,reconcile:re.reconcile}),O,t)}else if(t.product==="planning"&&y){const ne=await m.reconcile();J=Bw(Object.freeze({phase:"ready",data:ne,error:null,refetch:m.refetch,reconcile:m.reconcile}),y)}else throw new Ne.projection.ValidationError("$.route","does not own an exact reconciliation read");if(!Ne.projection.isValidatedState(J)||J.data===null)throw new Ne.projection.ValidationError("$.projection","did not return a verified projection");return l(null),J}catch(J){const ne=R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null,Ae=yr(J,ne),we=ne?S4(R.projection,Ae):R.binding===null?R.projection:Ya(R.binding,Ae);return ne&&R.binding!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:we})),we}},[re,O,se,y,m,N,_,t,s]);return Object.freeze({binding:se.binding,projection:se.projection,planningProjection:pe,operateCyclesProjection:fe,operateSearchBindings:T,operateReviewNavigation:te,refetchCurrent:de})}function ww(e){return e!==void 0?e:typeof window>"u"?"":window.location.hash}function G4(e,t){return e!==void 0||typeof window>"u"?()=>{}:(window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t))}function Y4({buildId:e,initialHash:t,identity:a,connection:s,bootstrap:c,bootPhase:l,bootDetail:u}){const f=B.useSyncExternalStore(S=>G4(t,S),()=>ww(t),()=>ww(t)),h=c===void 0&&s===void 0,[A,y]=B.useState(c??null),[m,E]=B.useState(l??(h?"checking":"compatible")),[b,w]=B.useState(u??null);B.useEffect(()=>{if(!h)return;const S=new AbortController;return E("checking"),w("Waiting for OpenPlanr to return a validated bootstrap envelope."),bP(e,{signal:S.signal}).then(_=>{y(_.bootstrap),E(_.phase==="compatible"?"compatible":_.phase),w(_.detail)}).catch(()=>{}),()=>S.abort()},[e,h]);const x=B.useMemo(()=>s??j1(A,e,b),[A,b,e,s]),j=B.useMemo(()=>a??Q1(A),[A,a]),I=B.useMemo(()=>Ha(f),[f]),C=I.kind==="system.diagnostics"||m==="incompatible"||x.state==="incompatible",O=M4(m==="compatible"&&x.state!=="incompatible"&&I.product!==null?A:null,I);return r.jsxs(E1,{buildId:e,initialHash:C?Pa(Mw):t,identity:j,connection:x,bootstrap:A,bootPhase:m,bootDetail:b,binding:O.binding,projection:O.projection,planningProjection:O.planningProjection,operateCyclesProjection:O.operateCyclesProjection,operateSearchBindings:O.operateSearchBindings,operateReviewNavigation:O.operateReviewNavigation,refetchCurrent:O.refetchCurrent,children:[r.jsx(v1,{}),r.jsx(gP,{})]})}const n0=document.querySelector("#root");if(!n0)throw new Error("OpenPlanr dashboard root element is missing.");TS.createRoot(n0).render(r.jsx(B.StrictMode,{children:r.jsx(Y4,{buildId:"dashboard-0.1.18-642d0e2451a256dc"})}));
557
- //# sourceMappingURL=index-Csby7_ur.js.map
556
+ `)}if(w.done){if(m.trim())return he("$","Planning live response ended mid-frame");break}}}finally{A.releaseLock()}})().catch(h=>{if(!t.signal.aborted)throw h instanceof ee?h:new ee("$","Planning live response failed safely")}).finally(()=>{var h;return(h=e.signal)==null?void 0:h.removeEventListener("abort",a)});return Object.freeze({completion:l,close:()=>{var h;t.abort(),e.reconciler.dispose(),(h=e.signal)==null||h.removeEventListener("abort",a)}})}const B4=Object.freeze({connectSse:E4,createSseReconciler:h4,encodeCheckpoint:y4,fetchGraph:A4,parseGraphEnvelope:Su}),v4=Object.freeze(Object.defineProperty({__proto__:null,planningRuntime:B4},Symbol.toStringTag,{value:"Module"})),b4=Object.freeze({create:Ve}),w4=Object.freeze({ValidationError:ee,isValidatedState:Pe,parseSafeError:Uw,parseState:so,statePolicy:oo}),x4=Object.freeze({parse:Ha}),j4=Object.freeze({connectSse:aI,createSseReconciler:nI}),Q4=Object.freeze({identity:b4,projection:w4,routing:x4,transport:j4}),I4=Object.freeze(Object.defineProperty({__proto__:null,dashboardRuntime:Q4},Symbol.toStringTag,{value:"Module"})),{operateRuntime:Xe}=JP,{planningRuntime:Hc}=v4,{dashboardRuntime:Ne}=I4,XI=new Set(["ready","read-only","stale","partial","blocked","offline"]),Pr=Ne.projection.parseState({kind:"booting",binding:null,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("booting")}),WI=Ne.routing.parse("#/overview");function e0(e){return`DASHBOARD_${e.toUpperCase().replace("-","_")}`}function pr(e){return Ne.projection.parseState({kind:"loading",binding:e,data:null,reasonCodes:[],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy("loading")},{currentBinding:e})}function t0(e,t=null){return Ne.projection.parseState({kind:"unavailable",binding:e,data:null,reasonCodes:["DASHBOARD_UNAVAILABLE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("unavailable")},{currentBinding:e})}function yr(e,t=!1){const s=(e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}).code==="DASHBOARD_RESPONSE_INVALID"||e instanceof Ne.projection.ValidationError;return Ne.projection.parseSafeError({code:t||!s?"DASHBOARD_READ_FAILED":"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{operation:"dashboard.projection.read"}})}function Ya(e,t){const a=t??yr(void 0);if(a.code!=="DASHBOARD_RESPONSE_INVALID")return t0(e,a);const s=Ne.projection.parseSafeError({code:"DASHBOARD_RESPONSE_INVALID",retryable:!1,context:{}});return Ne.projection.parseState({kind:"corrupt",binding:null,data:null,reasonCodes:["DASHBOARD_CORRUPT"],error:s,mutationEnabled:!1,policy:Ne.projection.statePolicy("corrupt")})}function C4(e,t,a,s,c=!1,l=null){if(!XI.has(e))throw new Error("Unsupported owner presentation state.");return Ne.projection.parseState({kind:e,binding:t,data:a,reasonCodes:e==="ready"?[]:[e0(e)],error:l,mutationEnabled:e==="ready"&&c,policy:Ne.projection.statePolicy(e)},{currentBinding:t,validateData:s})}function S4(e,t){return!Ne.projection.isValidatedState(e)||e.binding===null||e.data===null?e:Ne.projection.parseState({kind:"stale",binding:e.binding,data:e.data,reasonCodes:["DASHBOARD_STALE"],error:t,mutationEnabled:!1,policy:Ne.projection.statePolicy("stale")},{currentBinding:e.binding,validateData:a=>a!==null})}function O4(e,t){return Ne.projection.parseState({kind:e,binding:t,data:null,reasonCodes:[e0(e)],error:null,mutationEnabled:!1,policy:Ne.projection.statePolicy(e)},{currentBinding:t})}function Fr(e,t){const a=B.useRef(t);a.current=t;const s=B.useRef(e);s.current=e;const c=B.useRef(null),l=B.useRef(null),[u,f]=B.useState(0),[h,A]=B.useState(()=>Object.freeze({key:null,revision:0,phase:"idle",data:null,error:null})),y=B.useCallback(()=>f(j=>j+1),[]),m=B.useCallback(()=>{var O;if(c.current!==null)return c.current;const j=s.current;if(j===null)return Promise.reject(new Error("Owner read is unavailable."));const I=new AbortController;(O=l.current)==null||O.abort(),l.current=I,A(S=>Object.freeze({key:j,revision:S.revision,phase:"loading",data:S.key===j?S.data:null,error:null}));const C=a.current(I.signal).then(S=>{if(I.signal.aborted||s.current!==j)throw new DOMException("Cancelled","AbortError");return A(_=>Object.freeze({key:j,revision:_.revision,phase:"ready",data:S,error:null})),S}).catch(S=>{throw!I.signal.aborted&&s.current===j&&A(_=>Object.freeze({key:j,revision:_.revision,phase:"failed",data:_.key===j?_.data:null,error:yr(S,_.key===j&&_.data!==null)})),S}).finally(()=>{c.current===C&&(c.current=null),l.current===I&&(l.current=null)});return c.current=C,C},[]);B.useEffect(()=>{var I;if((I=l.current)==null||I.abort(),l.current=null,c.current=null,e===null){A(Object.freeze({key:null,revision:u,phase:"idle",data:null,error:null}));return}const j=new AbortController;return A(C=>Object.freeze({key:e,revision:u,phase:"loading",data:C.key===e?C.data:null,error:null})),a.current(j.signal).then(C=>{j.signal.aborted||A(Object.freeze({key:e,revision:u,phase:"ready",data:C,error:null}))}).catch(C=>{j.signal.aborted||A(O=>Object.freeze({key:e,revision:u,phase:"failed",data:O.key===e?O.data:null,error:yr(C,O.key===e&&O.data!==null)}))}),()=>j.abort()},[e,u]);const E=h.key===e&&h.revision===u,b=E?h.phase:e===null?"idle":"loading",w=E?h.data:null,x=E?h.error:null;return B.useMemo(()=>Object.freeze({phase:b,data:w,error:x,refetch:y,reconcile:m}),[w,x,b,m,y])}function _4(e){return e===null?null:JSON.stringify(e)}function N4(e){return e.product==="planning"?e:WI}function R4(e){return e.kind==="operate.evidence"||e.kind==="operate.evidence-item"?"evidence":e.kind==="operate.outcomes"?"outcomes":e.kind==="operate.outcome"?"outcome":e.kind==="operate.history"?"history":null}function tu(e){return e.kind==="operate.actions"||e.kind==="operate.action"||e.kind==="operate.action-planning"||e.kind==="operate.inbox"||e.kind==="operate.inbox-item"||e.kind==="operate.recovery"}function D4(e){return e.kind==="operate.action-planning"?{kind:"operate.action",product:"operate",subjectId:e.subjectId}:e}function Vr(e){return Object.freeze({eventHead:e.payload.eventHead,viewHash:e.payload.viewHash})}function Io(e){const t=e.payload.status;if(!XI.has(t))throw new Ne.projection.ValidationError("$.payload.status","contains an unsupported display status");return t}function T4(e){return e.payload.status==="terminal"?"read-only":Io(e)}function Ew(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.payload.sourceEventHead,viewHash:e.data.payload.sourceViewHash});return Ei(e,a,e.data,Xe.review.createValidator(a),T4(e.data),e.data.payload.mutationEnabled)}function Ei(e,t,a,s,c,l=!1){const u=e.phase==="failed"?"stale":e.phase==="loading"||e.phase==="idle"?"refreshing":c;try{return C4(u,t,a,s,l,u==="stale"?e.error??yr(void 0,!0):null)}catch(f){return Ya(t,yr(f))}}function Bw(e,t){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const a=Ne.identity.create({...t,eventHead:e.data.cursor.eventHead,viewHash:e.data.cursor.viewHash});return Ei(e,a,e.data,s=>{try{return Hc.parseGraphEnvelope(s,t),!0}catch{return!1}},"ready")}function vw(e,t,a,s){var u;if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const c=Ne.identity.create({...t,...Vr(e.data)}),l=a==="today"?Xe.today.createValidator(c):Xe.cycles.createListValidator(c);return e.phase!=="ready"?Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled):a==="today"&&e.data.payload.surface==="today"&&e.data.payload.status==="ready"&&e.data.payload.data.activeCycle===null?l(e.data)?s?s.phase==="loading"||s.phase==="idle"?Ei(Object.freeze({...e,phase:"loading",error:null}),c,e.data,l,"ready"):s.phase==="failed"?Ei(Object.freeze({...e,phase:"failed",error:s.error}),c,e.data,l,"ready"):((u=s.data)==null?void 0:u.payload.surface)!=="cycles"?Ya(c,yr(new Ne.projection.ValidationError("$.payload.surface","does not contain the required cycles display"))):O4(s.data.payload.data.cycles.length===0?"first-use":"empty",c):pr(c):Ya(c,yr(new Ne.projection.ValidationError("$.data","failed its owner-boundary contract"))):Ei(e,c,e.data,l,Io(e.data),e.data.payload.mutationEnabled)}function k4(e){if(e.subjectId===null)throw new Error("Action display identity requires a subject.");return Ne.identity.create({...e,route:`#/operate/actions/${encodeURIComponent(e.subjectId)}`})}function bw(e,t,a){if(e.data===null)return e.phase==="loading"||e.phase==="idle"?pr(t):Ya(t,e.error);const s=Ne.identity.create({...t,...Vr(e.data)});let c;if(a.kind==="operate.actions")c=Xe.actions.createListValidator(s);else if(a.kind==="operate.action"||a.kind==="operate.action-planning"){const l=a.kind==="operate.action-planning"?k4(s):s;c=Xe.actions.createDetailValidator(l)}else if(a.kind==="operate.inbox"||a.kind==="operate.inbox-item")c=Xe.actions.createInboxValidator(s);else if(a.kind==="operate.recovery")c=Xe.actions.createRecoveryValidator(s);else return t0(s);return Ei(e,s,e.data,c,Io(e.data),a.kind==="operate.action-planning"?!1:e.data.payload.mutationEnabled)}function M4(e,t){var ye,Ee;const a=(e==null?void 0:e.origin)??null,s=JSON.stringify(t),[c,l]=B.useState(null),u=(e==null?void 0:e.queryRoots.planning)??null,f=(e==null?void 0:e.queryRoots.operate)??null,h=B.useMemo(()=>N4(t),[t]),A=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,WI):null,[u]),y=B.useMemo(()=>u?Xe.transport.identityFromRoot(u,h):null,[u,h]),m=Fr(A?JSON.stringify(A):null,R=>{if(!a||!A)throw new Error("Planning query root is unavailable.");return Hc.fetchGraph({origin:a,identity:A,signal:R})}),E=_4(f),b=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"today",signal:R})}),w=Fr(E,R=>{if(!a||!f)throw new Error("Operate query root is unavailable.");return Xe.transport.fetchRootDisplay({origin:a,root:f,surface:"cycles",signal:R})}),x=((ye=b.data)==null?void 0:ye.payload.surface)==="today"?b.data:null,j=(x==null?void 0:x.payload.surface)==="today"?((Ee=x.payload.data.activeCycle)==null?void 0:Ee.cycleId)??null:null,I=t.kind==="operate.cycle"?t.subjectId:t.kind==="operate.review"?t.cycleId:j,C=x?Vr(x):null,O=B.useMemo(()=>f&&t.product==="operate"&&I&&C?Xe.transport.identityFromRoot(f,t,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[C,f,t,I]),S=a&&f&&O?JSON.stringify({root:f,binding:O}):null,_=B.useMemo(()=>f&&t.kind==="operate.review"?Xe.transport.identityFromRoot(f,t,{cycleId:t.cycleId}):null,[f,t]),k=a&&_?JSON.stringify({root:f,route:_.route}):null,N=Fr(k,R=>{if(!a||!f||t.kind!=="operate.review")throw new Error("Operate Review query custody is incomplete.");return Xe.review.fetch({origin:a,root:f,cycleId:t.cycleId,reviewId:t.subjectId,signal:R})}),z=B.useMemo(()=>D4(t),[t]),M=B.useMemo(()=>f&&tu(t)&&I&&C?Xe.transport.identityFromRoot(f,z,{cycleId:I,eventHead:C.eventHead,viewHash:C.viewHash}):null,[z,C,f,t,I]),L=a&&f&&M?JSON.stringify({root:f,binding:M}):null,Z=R4(t),F=Fr(Z?S:null,R=>{if(!a||!f||!I||!Z)throw new Error("Operate audit query custody is incomplete.");return Xe.transport.fetchAuditDisplay({origin:a,root:f,route:t,surface:Z,cycleId:I,signal:R})}),oe=Fr(t.kind==="operate.cycle"?S:null,R=>{if(!a||!f||t.kind!=="operate.cycle")throw new Error("Operate Cycle query custody is incomplete.");return Xe.transport.fetchCycleDisplay({origin:a,root:f,cycleId:t.subjectId,signal:R})}),re=Fr(tu(t)?L:null,R=>{if(!a||!M)throw new Error("Operate route display custody is incomplete.");if(t.kind==="operate.actions")return Xe.actions.fetchList({origin:a,identity:M,signal:R});if(t.kind==="operate.action"||t.kind==="operate.action-planning")return Xe.actions.fetchDetail({origin:a,identity:M,signal:R});if(t.kind==="operate.inbox"||t.kind==="operate.inbox-item")return Xe.actions.fetchInbox({origin:a,identity:M,signal:R});if(t.kind==="operate.recovery")return Xe.actions.fetchRecovery({origin:a,identity:M,signal:R});throw new Error("Operate route does not own a bound display read.")}),pe=B.useMemo(()=>y?Bw(m,y):Pr,[y,m]),Y=B.useMemo(()=>{if(!f)return null;const R=Ne.routing.parse("#/operate/today");return Xe.transport.identityFromRoot(f,R,{cycleId:j})},[j,f]),V=B.useMemo(()=>Y?vw(b,Y,"today",w):Pr,[w,Y,b]),te=B.useMemo(()=>{if(!V.binding||!I)return null;const R=Xe.today.resolveModel({current:V},V.binding);return(R==null?void 0:R.kind)==="surface"?Xe.review.uniqueNavigationForCycle(R,I):null},[I,V]),le=B.useMemo(()=>f?Xe.transport.identityFromRoot(f,Ne.routing.parse("#/operate/cycles")):null,[f]),fe=B.useMemo(()=>le?vw(w,le,"cycles"):Pr,[le,w]),T=B.useMemo(()=>{var ne;if(!f||((ne=w.data)==null?void 0:ne.payload.surface)!=="cycles")return Object.freeze([]);const R=Vr(w.data),J=Ne.routing.parse("#/operate/cycles");return Object.freeze(w.data.payload.data.cycles.map(Ae=>Xe.transport.identityFromRoot(f,J,{cycleId:Ae.cycleId,eventHead:R.eventHead,viewHash:R.viewHash})))},[w,f]),X=B.useMemo(()=>{if(t.product==="planning")return Object.freeze({binding:pe.binding,projection:pe});if(t.product!=="operate"||!f)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.today")return Object.freeze({binding:V.binding,projection:V});if(t.kind==="operate.cycles")return Object.freeze({binding:fe.binding,projection:fe});if(t.kind==="operate.review"){if(!_)return Object.freeze({binding:null,projection:Pr});const J=Ew(N,_);return Object.freeze({binding:J.binding,projection:J})}if(!C||!I)return Object.freeze({binding:null,projection:Pr});const R=O;if(!R)return Object.freeze({binding:null,projection:Pr});if(t.kind==="operate.cycle"){if(oe.data===null){const ne=oe.phase==="loading"||oe.phase==="idle"?pr(R):Ya(R,oe.error);return Object.freeze({binding:ne.binding,projection:ne})}const J=Ne.identity.create({...R,...Vr(oe.data)});return Object.freeze({binding:J,projection:Ei(oe,J,oe.data,Xe.cycles.createDetailValidator(J),Io(oe.data),oe.data.payload.mutationEnabled)})}if(Z){if(F.data===null){const Ae=F.phase==="loading"||F.phase==="idle"?pr(R):Ya(R,F.error);return Object.freeze({binding:Ae.binding,projection:Ae})}const J=Ne.identity.create({...R,...Vr(F.data)}),ne=Z==="evidence"?Xe.audit.createEvidenceValidator(J):Z==="outcomes"||Z==="outcome"?Xe.audit.createOutcomeValidator(J):Xe.audit.createHistoryValidator(J);return Object.freeze({binding:J,projection:Ei(F,J,F.data,ne,Io(F.data),!1)})}return tu(t)?Object.freeze({binding:R,projection:bw(re,R,t)}):Object.freeze({binding:R,projection:pr(R)})},[F,Z,re,O,oe,C,fe,f,pe,N,_,t,I,V]);B.useEffect(()=>{l(R=>R!==null&&R.routeKey!==s?null:R)},[s]);const se=B.useMemo(()=>c!==null&&c.routeKey===s&&(!Ne.projection.isValidatedState(X.projection)||X.projection.data===null)?Object.freeze({binding:c.binding,projection:c.projection}):X,[c,X,s]);B.useEffect(()=>{if(!a||!m.data||m.phase!=="ready"||!A)return;const R=Ne.identity.create({...A,eventHead:m.data.cursor.eventHead,viewHash:m.data.cursor.viewHash});let J=!0;const ne=Hc.createSseReconciler({identity:R,initial:m.data,isCurrent:()=>J,onSnapshot:()=>{},onPatch:()=>m.refetch(),onRefetch:()=>m.refetch(),onStale:()=>m.refetch()}),Ae=Hc.connectSse({origin:a,identity:R,reconciler:ne,lastEventId:Hc.encodeCheckpoint(m.data.cursor)});return Ae.completion.catch(()=>{}),()=>{J=!1,Ae.close()}},[a,A,m]),B.useEffect(()=>{if(!a||!f||!x||!Y)return;const R=Vr(x),J=Ne.identity.create({...Y,...R});let ne=!0;const Ae=Ne.transport.createSseReconciler({identity:J,isCurrent:()=>ne,onSnapshot:(xe,Ze)=>{var Ie,ce;(Ze.eventHead.sequence!==((Ie=R.eventHead)==null?void 0:Ie.sequence)||Ze.eventHead.hash!==((ce=R.eventHead)==null?void 0:ce.hash)||Ze.viewHash!==R.viewHash)&&(b.refetch(),w.refetch())},onPatch:()=>{b.refetch(),w.refetch()},onRefetch:()=>{b.refetch(),w.refetch()},onStale:()=>{b.refetch(),w.refetch()}}),we=Ne.transport.connectSse({origin:a,identity:J,reconciler:Ae});return we.completion.catch(()=>{}),()=>{ne=!1,we.close()}},[w,a,f,x,Y,b]);const de=B.useCallback(async()=>{const R=se;R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:R.projection}));try{let J;if(t.kind==="operate.review"&&_){const ne=await N.reconcile();J=Ew(Object.freeze({phase:"ready",data:ne,error:null,refetch:N.refetch,reconcile:N.reconcile}),_)}else if(tu(t)&&O){const ne=await re.reconcile();J=bw(Object.freeze({phase:"ready",data:ne,error:null,refetch:re.refetch,reconcile:re.reconcile}),O,t)}else if(t.product==="planning"&&y){const ne=await m.reconcile();J=Bw(Object.freeze({phase:"ready",data:ne,error:null,refetch:m.refetch,reconcile:m.reconcile}),y)}else throw new Ne.projection.ValidationError("$.route","does not own an exact reconciliation read");if(!Ne.projection.isValidatedState(J)||J.data===null)throw new Ne.projection.ValidationError("$.projection","did not return a verified projection");return l(null),J}catch(J){const ne=R.binding!==null&&Ne.projection.isValidatedState(R.projection)&&R.projection.data!==null,Ae=yr(J,ne),we=ne?S4(R.projection,Ae):R.binding===null?R.projection:Ya(R.binding,Ae);return ne&&R.binding!==null&&l(Object.freeze({routeKey:s,binding:R.binding,projection:we})),we}},[re,O,se,y,m,N,_,t,s]);return Object.freeze({binding:se.binding,projection:se.projection,planningProjection:pe,operateCyclesProjection:fe,operateSearchBindings:T,operateReviewNavigation:te,refetchCurrent:de})}function ww(e){return e!==void 0?e:typeof window>"u"?"":window.location.hash}function G4(e,t){return e!==void 0||typeof window>"u"?()=>{}:(window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t))}function Y4({buildId:e,initialHash:t,identity:a,connection:s,bootstrap:c,bootPhase:l,bootDetail:u}){const f=B.useSyncExternalStore(S=>G4(t,S),()=>ww(t),()=>ww(t)),h=c===void 0&&s===void 0,[A,y]=B.useState(c??null),[m,E]=B.useState(l??(h?"checking":"compatible")),[b,w]=B.useState(u??null);B.useEffect(()=>{if(!h)return;const S=new AbortController;return E("checking"),w("Waiting for OpenPlanr to return a validated bootstrap envelope."),bP(e,{signal:S.signal}).then(_=>{y(_.bootstrap),E(_.phase==="compatible"?"compatible":_.phase),w(_.detail)}).catch(()=>{}),()=>S.abort()},[e,h]);const x=B.useMemo(()=>s??j1(A,e,b),[A,b,e,s]),j=B.useMemo(()=>a??Q1(A),[A,a]),I=B.useMemo(()=>Ha(f),[f]),C=I.kind==="system.diagnostics"||m==="incompatible"||x.state==="incompatible",O=M4(m==="compatible"&&x.state!=="incompatible"&&I.product!==null?A:null,I);return r.jsxs(E1,{buildId:e,initialHash:C?Pa(Mw):t,identity:j,connection:x,bootstrap:A,bootPhase:m,bootDetail:b,binding:O.binding,projection:O.projection,planningProjection:O.planningProjection,operateCyclesProjection:O.operateCyclesProjection,operateSearchBindings:O.operateSearchBindings,operateReviewNavigation:O.operateReviewNavigation,refetchCurrent:O.refetchCurrent,children:[r.jsx(v1,{}),r.jsx(gP,{})]})}const n0=document.querySelector("#root");if(!n0)throw new Error("OpenPlanr dashboard root element is missing.");TS.createRoot(n0).render(r.jsx(B.StrictMode,{children:r.jsx(Y4,{buildId:"dashboard-0.1.19-8b7d00340d6ac9ae"})}));
557
+ //# sourceMappingURL=index-n08LJ6bK.js.map