create-pmos 0.124.0 → 0.126.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.
- package/package.json +1 -1
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/nine-stages.js +81 -0
- package/payload/scripts/workflow-state.js +2 -0
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/c3-one-home-test.js +131 -0
- package/workspace/fixtures/initiatives-api/list.json +171 -3
- package/workspace/fixtures/initiatives-api/roadmap.json +228 -4
- package/workspace/fixtures/initiatives-api/sheet.json +57 -1
- package/workspace/fixtures/one-home-baseline.json +83 -0
- package/workspace/guide/briefing-cards.md +40 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/layout.md +2 -0
- package/workspace/lib/engine/nine-stages.js +81 -0
- package/workspace/lib/engine/workflow-state.js +2 -0
- package/workspace/lib/facts-async.js +51 -0
- package/workspace/lib/item-steps.js +52 -0
- package/workspace/lib/jira-status.js +8 -3
- package/workspace/lib/jobs-to-be-done.js +52 -0
- package/workspace/lib/needs-overdue.js +41 -0
- package/workspace/lib/outbox-store.js +87 -0
- package/workspace/lib/pm-items.js +115 -0
- package/workspace/lib/route-modules.js +21 -0
- package/workspace/lib/routes-briefing.js +109 -0
- package/workspace/lib/routes-c3-init.js +53 -0
- package/workspace/lib/routes-c3-life.js +119 -0
- package/workspace/lib/routes-c3-strategy.js +169 -0
- package/workspace/lib/routes-c3-timeline.js +191 -0
- package/workspace/lib/routes-calendar-import.js +60 -0
- package/workspace/lib/routes-calendar-views.js +61 -0
- package/workspace/lib/routes-doc-health.js +79 -0
- package/workspace/lib/routes-doc-sheet.js +169 -0
- package/workspace/lib/routes-forecast.js +85 -0
- package/workspace/lib/routes-hooks.js +121 -0
- package/workspace/lib/routes-initiatives.js +3 -0
- package/workspace/lib/routes-intake.js +24 -0
- package/workspace/lib/routes-outbox.js +97 -0
- package/workspace/lib/routes-pm-items.js +216 -0
- package/workspace/lib/routes-records.js +61 -0
- package/workspace/lib/routes-releases.js +129 -0
- package/workspace/lib/routes-report-facts.js +84 -0
- package/workspace/lib/routes-report-families.js +32 -0
- package/workspace/lib/routes-roadmap-ops.js +141 -0
- package/workspace/lib/routes-runs.js +119 -0
- package/workspace/lib/routes-signals.js +50 -0
- package/workspace/lib/run-answers.js +69 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/c3.html +26 -0
- package/workspace/public/pm/briefing-deck.js +413 -0
- package/workspace/public/pm/briefing-model.js +211 -0
- package/workspace/public/pm/c3-breakdown.js +240 -0
- package/workspace/public/pm/c3-brief.js +278 -0
- package/workspace/public/pm/c3-cal-strategy.js +528 -0
- package/workspace/public/pm/c3-case.js +185 -0
- package/workspace/public/pm/c3-daypart.js +176 -0
- package/workspace/public/pm/c3-demo-brief-ix.js +350 -0
- package/workspace/public/pm/c3-demo-cal-ix.js +74 -0
- package/workspace/public/pm/c3-demo-cal2.js +66 -0
- package/workspace/public/pm/c3-demo-cal3.js +173 -0
- package/workspace/public/pm/c3-demo-data.js +560 -0
- package/workspace/public/pm/c3-demo-init.js +373 -0
- package/workspace/public/pm/c3-demo-life.js +77 -0
- package/workspace/public/pm/c3-demo-misc2.js +46 -0
- package/workspace/public/pm/c3-demo-plan2.js +30 -0
- package/workspace/public/pm/c3-demo-rep-ix.js +126 -0
- package/workspace/public/pm/c3-demo-rep2.js +92 -0
- package/workspace/public/pm/c3-demo-term.js +153 -0
- package/workspace/public/pm/c3-demo-time.js +49 -0
- package/workspace/public/pm/c3-demo-work-ix.js +80 -0
- package/workspace/public/pm/c3-demo-work2.js +13 -0
- package/workspace/public/pm/c3-demo.js +113 -0
- package/workspace/public/pm/c3-doc-sheet.js +314 -0
- package/workspace/public/pm/c3-dock.js +180 -0
- package/workspace/public/pm/c3-docs.js +290 -0
- package/workspace/public/pm/c3-expand.js +96 -0
- package/workspace/public/pm/c3-init-extras.js +170 -0
- package/workspace/public/pm/c3-lifecycle-panels.js +476 -0
- package/workspace/public/pm/c3-misc-panels.js +89 -0
- package/workspace/public/pm/c3-plan-panels.js +163 -0
- package/workspace/public/pm/c3-plan.js +192 -0
- package/workspace/public/pm/c3-roadmap.js +249 -0
- package/workspace/public/pm/c3-sheet.js +107 -0
- package/workspace/public/pm/c3-shell.js +674 -0
- package/workspace/public/pm/c3-signals.js +196 -0
- package/workspace/public/pm/c3-strategy-panels.js +45 -0
- package/workspace/public/pm/c3-swipe.js +230 -0
- package/workspace/public/pm/c3-terminal-data.js +26 -0
- package/workspace/public/pm/c3-terminal-edge.js +91 -0
- package/workspace/public/pm/c3-terminal-icons.js +41 -0
- package/workspace/public/pm/c3-terminal-results.js +141 -0
- package/workspace/public/pm/c3-terminal.js +52 -0
- package/workspace/public/pm/c3-tickets.js +163 -0
- package/workspace/public/pm/c3-timeline.js +201 -0
- package/workspace/public/pm/c3-toast.js +16 -0
- package/workspace/public/pm/calendar-views.js +1014 -0
- package/workspace/public/pm/console3-lift.md +220 -0
- package/workspace/public/pm/console3.css +1547 -0
- package/workspace/public/pm/dest-initiatives.js +16 -3
- package/workspace/public/pm/dest-mywork.js +8 -1
- package/workspace/public/pm/dest-reports.js +47 -1
- package/workspace/public/pm/dest-today.js +55 -1
- package/workspace/public/pm/doc-health-panel.js +110 -0
- package/workspace/public/pm/doc-rail.js +9 -3
- package/workspace/public/pm/lifecycle-lens-model.js +228 -0
- package/workspace/public/pm/lifecycle-lens.js +261 -0
- package/workspace/public/pm/new-initiative-sheet.js +116 -21
- package/workspace/public/pm/outbox-panel.js +125 -0
- package/workspace/public/pm/pm-work-view.js +895 -0
- package/workspace/public/pm/releases-view.js +248 -0
- package/workspace/public/pm/report-families-view.js +503 -0
- package/workspace/public/pm/run-card.js +244 -0
- package/workspace/public/pm/sessions-panel.js +149 -0
- package/workspace/public/pm/shell-bell.js +162 -0
- package/workspace/public/pm/shell-model.js +83 -0
- package/workspace/public/pm/shell-phone.js +124 -0
- package/workspace/public/pm/shell-readaloud.js +53 -0
- package/workspace/public/pm/shell-recording.js +110 -0
- package/workspace/public/pm/shell-ticker.js +90 -0
- package/workspace/public/pm/slide-confirm.js +163 -0
- package/workspace/public/pm/timeline-forecast-view.js +164 -0
- package/workspace/public/pm/today-day.js +8 -2
- package/workspace/public/pm/tokens.css +1 -0
- package/workspace/server.js +5 -2
- package/workspace/test-files.json +21 -3
- package/workspace/test-lists/browser-suites-green.json +5 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* pm/c3-demo-time.js — DEMO fixtures for the Initiatives Timeline of /c3.html?demo=1, in the REAL response shape of GET /api/c3-timeline
|
|
2
|
+
* (workspace/lib/routes-c3-timeline.js). c3-demo.js answers /api/c3-timeline with timeline(); real mode never loads this file.
|
|
3
|
+
* The DATA was generated by running the mockup's own functions in the mockup page (console3.html: tixAt, planOf, fcAt, ptsAt, revsAt, lines 3896 to 4040)
|
|
4
|
+
* for each of its five checks and dumping what they return, not typed by hand. Days are the mockup's day numbers (8 = 8 Oct 2026). */
|
|
5
|
+
const TODAY = '2026-10-08';
|
|
6
|
+
const SNAP = [["14 Sep","Baseline"],["25 Sep","Saved-card removal added"],["30 Sep","A11y audit added"],["5 Oct","Address autocomplete added"],["8 Oct","Today"]];
|
|
7
|
+
/* item: [title, source, phase or work package, owner, state, progress, milestone, critical, blocker note, initiative] */
|
|
8
|
+
const META = {"CHK-136":["Payment form redesign","Jira","Payments","Dara","done",1,0,0,"","checkout"],"CHK-137":["Tax and shipping display","Jira","Summary and copy","Lee","done",1,0,0,"","checkout"],"CHK-138":["Order summary","Figma","Design","Lee","done",1,0,0,"","checkout"],"CHK-139":["Pricing page copy","Figma","Design","Lee","done",1,0,0,"","checkout"],"CHK-141":["Payments sandbox keys","Jira","Payments","Dara","doing",0.6,0,1,"vendor, 2 days","checkout"],"CHK-145":["Ship Checkout v2","Jira","Quality and release","Dara","todo",0,1,1,"","checkout"],"PM-1":["Address drop-off analysis","Local","Discovery","Agent","done",1,0,0,"","checkout"],"PM-2":["Retry flow whiteboard session","Calendar","Discovery","Wawan","done",1,0,0,"","checkout"],"PM-3":["Checkout flow screens","Figma","Design","Lee","doing",0.6,0,0,"","checkout"],"PM-4":["Release notes","Local","Launch","Wawan","todo",0,0,0,"","checkout"],"PM-5":["Support and sales brief","Local","Launch","Marta","todo",0,0,0,"","checkout"],"CHK-142":["Saved-card removal","Jira","Payments","Wawan","todo",0,0,1,"","checkout"],"CHK-144":["A11y audit slot","Jira","Quality and release","Lee","todo",0,0,1,"no slot before 28 Oct","checkout"],"CHK-143":["Address autocomplete","Jira","Address step","Dara","todo",0,0,0,"","checkout"],"EN-418":["Index job fix","Jira","Relevance","Sam","doing",0.7,0,0,"platform review","search"],"EN-421":["Ranking weights v2","Local","Design","Wawan","todo",0,0,0,"","search"],"EN-425":["Relevance beta","Jira","Relevance","Sam","todo",0,1,0,"","search"],"RET-11":["Interview 3","Calendar","Discovery","Wawan","doing",0.5,0,0,"","returns"],"RET-12":["Interview 4 slot","Gmail","Discovery","Wawan","todo",0,0,0,"","returns"],"RET-13":["Interview 5","Calendar","Discovery","Wawan","todo",0,0,0,"","returns"],"RET-14":["Synthesis and stop rule","Local","Discovery","Agent","todo",0,1,0,"","returns"],"SSO-32":["Beta feedback round","Local","Launch","Marta","done",1,0,0,"","sso"],"SSO-31":["SCIM docs","Jira","Enterprise setup","Wawan","doing",0.5,0,0,"","sso"],"SSO-33":["Confirm date to Marta","Promise","Launch","Wawan","todo",0,0,0,"","sso"],"SSO-34":["SSO general release","Jira","Enterprise setup","Dara","todo",0,1,0,"","sso"],"ONB-2":["Continue or park decision","Notes","Discovery","Wawan","todo",0,0,0,"","onb"]};
|
|
9
|
+
/* per initiative, per check: { pts, fc: [forecast day, promised day], it: [[key, start, due, waits on, forecast start, forecast end, status, points]], ev: [[key, kind, by, why, tx]] } */
|
|
10
|
+
const FRAMES = {"checkout":[{"n":0,"pts":33,"fc":[24,24],"it":[["CHK-136",1,5,[],1,5,"done",8],["CHK-137",1,5,[],1,5,"done",5],["CHK-138",2,6,[],2,6,"done",3],["CHK-139",1,7,[],1,7,"done",2],["CHK-141",3,10,[],3,10,"risk",2],["CHK-145",24,24,["CHK-141"],24,24,"ok",1],["PM-1",1,6,[],1,6,"done",3],["PM-2",7,7,[],7,7,"done",1],["PM-3",5,16,[],5,16,"ok",5],["PM-4",22,23,["CHK-144"],22,23,"ok",1],["PM-5",21,23,[],21,23,"ok",2]],"ev":[["CHK-136","add","Wawan","Part of the original plan.",""],["CHK-137","add","Wawan","Part of the original plan.",""],["CHK-138","add","Wawan","Part of the original plan.",""],["CHK-139","add","Wawan","Part of the original plan.",""],["CHK-141","add","Wawan","Payments need vendor sandbox keys first.",""],["CHK-145","add","Wawan","Date promised to leadership on 2 Oct.",""],["PM-1","add","Wawan","Part of the original plan.",""],["PM-2","add","Wawan","Part of the original plan.",""],["PM-3","add","Wawan","Part of the original plan.",""],["PM-4","add","Wawan","Part of the original plan.",""],["PM-5","add","Wawan","Part of the original plan.",""]]},{"n":1,"pts":38,"fc":[24,24],"it":[["CHK-136",1,5,[],1,5,"done",8],["CHK-137",1,5,[],1,5,"done",5],["CHK-138",2,6,[],2,6,"done",3],["CHK-139",1,7,[],1,7,"done",2],["CHK-141",3,10,[],3,10,"risk",2],["CHK-142",11,17,["CHK-141"],11,17,"ok",5],["CHK-145",24,24,["CHK-141","CHK-142"],24,24,"ok",1],["PM-1",1,6,[],1,6,"done",3],["PM-2",7,7,[],7,7,"done",1],["PM-3",5,16,[],5,16,"ok",5],["PM-4",22,23,["CHK-144"],22,23,"ok",1],["PM-5",21,23,[],21,23,"ok",2]],"ev":[["CHK-142","add","Agent","PRD review: saved cards block the one-page flow. The agent proposed it and you accepted.",""],["CHK-145","edit","Agent","Dependency added with the new ticket.","Waits on CHK-142"]]},{"n":2,"pts":41,"fc":[26,24],"it":[["CHK-136",1,5,[],1,5,"done",8],["CHK-137",1,5,[],1,5,"done",5],["CHK-138",2,6,[],2,6,"done",3],["CHK-139",1,7,[],1,7,"done",2],["CHK-141",3,10,[],3,10,"risk",2],["CHK-142",11,17,["CHK-141"],11,17,"ok",5],["CHK-144",21,24,["CHK-142"],23,26,"late",3],["CHK-145",24,24,["CHK-144"],24,26,"late",1],["PM-1",1,6,[],1,6,"done",3],["PM-2",7,7,[],7,7,"done",1],["PM-3",5,16,[],5,16,"ok",5],["PM-4",22,23,["CHK-144"],27,28,"late",1],["PM-5",21,23,[],21,23,"ok",2]],"ev":[["CHK-144","add","Agent","Gate review: an accessibility audit is required for checkout. Added to the plan.",""],["CHK-145","edit","Agent","Dependency added with the audit.","Waits on CHK-144"]]},{"n":3,"pts":46,"fc":[28,24],"it":[["CHK-136",1,5,[],1,5,"done",8],["CHK-137",1,5,[],1,5,"done",5],["CHK-138",2,6,[],2,6,"done",3],["CHK-139",1,7,[],1,7,"done",2],["CHK-141",3,10,[],3,11,"late",2],["CHK-142",11,17,["CHK-141"],12,18,"late",5],["CHK-143",9,18,["CHK-141"],12,21,"late",5],["CHK-144",21,24,["CHK-142"],25,28,"late",3],["CHK-145",24,24,["CHK-144","CHK-143"],24,28,"late",1],["PM-1",1,6,[],1,6,"done",3],["PM-2",7,7,[],7,7,"done",1],["PM-3",5,16,[],5,16,"ok",5],["PM-4",22,23,["CHK-144"],29,30,"late",1],["PM-5",21,23,[],21,23,"ok",2]],"ev":[["CHK-141","edit","Dara","Vendor said one more day.","Slip 0 to 1 day"],["CHK-143","add","Wawan","Top idea by score in Ideate. The address step loses 45% of carts.",""],["CHK-144","edit","Lee","The vendor moved their first free slot.","Slot 23 to 25 Oct"],["CHK-145","edit","Agent","Dependency added with autocomplete.","Waits on CHK-143"]]},{"n":4,"pts":46,"fc":[31,24],"it":[["CHK-136",1,5,[],1,5,"done",8],["CHK-137",1,5,[],1,5,"done",5],["CHK-138",2,6,[],2,6,"done",3],["CHK-139",1,7,[],1,7,"done",2],["CHK-141",3,10,[],3,12,"late",2],["CHK-142",11,17,["CHK-141"],13,19,"late",5],["CHK-143",11,20,["CHK-141"],13,22,"late",5],["CHK-144",21,24,["CHK-142"],28,31,"late",3],["CHK-145",24,24,["CHK-144","CHK-143"],24,31,"late",1],["PM-1",1,6,[],1,6,"done",3],["PM-2",7,7,[],7,7,"done",1],["PM-3",5,16,[],5,16,"ok",5],["PM-4",22,23,["CHK-144"],32,33,"late",1],["PM-5",21,23,[],21,23,"ok",2]],"ev":[["CHK-141","edit","Dara","No reply since Tuesday. A second day is lost.","Slip 1 to 2 days"],["CHK-143","move","Dara","It cannot start before the keys arrive.","Start 9 to 11 Oct, end 18 to 20 Oct"],["CHK-144","edit","Lee","The vendor moved the slot again.","Slot 25 to 28 Oct"]]}],"search":[{"n":0,"pts":13,"fc":[30,30],"it":[["EN-418",2,12,[],2,12,"risk",5],["EN-421",13,24,["EN-418"],13,24,"ok",5],["EN-425",25,30,["EN-421"],25,30,"ok",3]],"ev":[["EN-418","add","Wawan","Search relevance needs the index fix first.",""],["EN-421","add","Wawan","Part of the original plan.",""],["EN-425","add","Wawan","Part of the original plan.",""]]},{"n":1,"pts":13,"fc":[30,30],"it":[["EN-418",2,12,[],2,12,"risk",5],["EN-421",13,24,["EN-418"],13,24,"ok",5],["EN-425",25,30,["EN-421"],25,30,"ok",3]],"ev":[]},{"n":2,"pts":13,"fc":[30,30],"it":[["EN-418",2,12,[],2,12,"risk",5],["EN-421",13,24,["EN-418"],13,24,"ok",5],["EN-425",25,30,["EN-421"],25,30,"ok",3]],"ev":[]},{"n":3,"pts":13,"fc":[30,30],"it":[["EN-418",2,12,[],2,14,"late",5],["EN-421",13,24,["EN-418"],15,26,"late",5],["EN-425",25,30,["EN-421"],25,30,"ok",3]],"ev":[["EN-418","edit","Sam","Platform review asked for changes.","Slip 0 to 2 days"]]},{"n":4,"pts":13,"fc":[30,30],"it":[["EN-418",2,12,[],2,15,"late",5],["EN-421",13,24,["EN-418"],16,27,"late",5],["EN-425",25,30,["EN-421"],25,30,"ok",3]],"ev":[["EN-418","edit","Sam","Review is still open.","Slip 2 to 3 days"]]}],"returns":[{"n":0,"pts":5,"fc":[15,15],"it":[["RET-11",8,8,[],8,8,"ok",1],["RET-12",9,12,[],9,12,"ok",1],["RET-13",13,13,["RET-12"],13,13,"ok",1],["RET-14",14,15,["RET-13"],14,15,"ok",2]],"ev":[["RET-11","add","Wawan","Part of the original plan.",""],["RET-12","add","Wawan","Five interviews in the discovery brief.",""],["RET-13","add","Wawan","Part of the original plan.",""],["RET-14","add","Agent","The brief says: decide after interview 5.",""]]},{"n":1,"pts":5,"fc":[15,15],"it":[["RET-11",8,8,[],8,8,"ok",1],["RET-12",9,12,[],9,12,"ok",1],["RET-13",13,13,["RET-12"],13,13,"ok",1],["RET-14",14,15,["RET-13"],14,15,"ok",2]],"ev":[]},{"n":2,"pts":5,"fc":[15,15],"it":[["RET-11",8,8,[],8,8,"ok",1],["RET-12",9,12,[],9,12,"ok",1],["RET-13",13,13,["RET-12"],13,13,"ok",1],["RET-14",14,15,["RET-13"],14,15,"ok",2]],"ev":[]},{"n":3,"pts":5,"fc":[15,15],"it":[["RET-11",8,8,[],8,8,"ok",1],["RET-12",9,12,[],9,12,"ok",1],["RET-13",13,13,["RET-12"],13,13,"ok",1],["RET-14",14,15,["RET-13"],14,15,"ok",2]],"ev":[]},{"n":4,"pts":5,"fc":[15,15],"it":[["RET-11",8,8,[],8,8,"ok",1],["RET-12",9,12,[],9,12,"ok",1],["RET-13",13,13,["RET-12"],13,13,"ok",1],["RET-14",14,15,["RET-13"],14,15,"ok",2]],"ev":[["RET-12","edit","Agent","Marta offered three slots. The agent held them.","Slots held"]]}],"sso":[{"n":0,"pts":10,"fc":[14,14],"it":[["SSO-32",1,6,[],1,6,"done",3],["SSO-31",3,12,[],3,12,"ok",5],["SSO-33",12,12,[],12,12,"ok",1],["SSO-34",14,14,["SSO-31","SSO-33"],14,14,"ok",1]],"ev":[["SSO-32","add","Wawan","Part of the original plan.",""],["SSO-31","add","Wawan","Part of the original plan.",""],["SSO-33","add","Wawan","Part of the original plan.",""],["SSO-34","add","Wawan","Part of the original plan.",""]]},{"n":1,"pts":10,"fc":[14,14],"it":[["SSO-32",1,6,[],1,6,"done",3],["SSO-31",3,12,[],3,12,"ok",5],["SSO-33",12,12,[],12,12,"ok",1],["SSO-34",14,14,["SSO-31","SSO-33"],14,14,"ok",1]],"ev":[]},{"n":2,"pts":10,"fc":[14,14],"it":[["SSO-32",1,6,[],1,6,"done",3],["SSO-31",3,12,[],3,12,"ok",5],["SSO-33",12,12,[],12,12,"ok",1],["SSO-34",14,14,["SSO-31","SSO-33"],14,14,"ok",1]],"ev":[]},{"n":3,"pts":10,"fc":[14,14],"it":[["SSO-32",1,6,[],1,6,"done",3],["SSO-31",3,12,[],3,12,"ok",5],["SSO-33",12,12,[],12,12,"ok",1],["SSO-34",14,14,["SSO-31","SSO-33"],14,14,"ok",1]],"ev":[]},{"n":4,"pts":10,"fc":[14,14],"it":[["SSO-32",1,6,[],1,6,"done",3],["SSO-31",3,12,[],3,12,"ok",5],["SSO-33",12,12,[],12,12,"ok",1],["SSO-34",14,14,["SSO-31","SSO-33"],14,14,"ok",1]],"ev":[]}],"onb":[{"n":0,"pts":1,"fc":null,"it":[["ONB-2",8,12,[],8,12,"ok",1]],"ev":[["ONB-2","add","Wawan","Part of the original plan.",""]]},{"n":1,"pts":1,"fc":null,"it":[["ONB-2",8,12,[],8,12,"ok",1]],"ev":[]},{"n":2,"pts":1,"fc":null,"it":[["ONB-2",8,12,[],8,12,"ok",1]],"ev":[]},{"n":3,"pts":1,"fc":null,"it":[["ONB-2",8,12,[],8,12,"ok",1]],"ev":[]},{"n":4,"pts":1,"fc":null,"it":[["ONB-2",8,12,[],8,12,"ok",1]],"ev":[]}]};
|
|
11
|
+
const dOf = (n) => new Date(Date.UTC(2026, 9, n)).toISOString().slice(0, 10);
|
|
12
|
+
const STATUS = { done: 'done', ok: 'on time', risk: 'at risk', late: 'delayed', over: 'overdue' };
|
|
13
|
+
const PMOS = new Set(['Local', 'Figma', 'Calendar', 'Gmail', 'Notes', 'Image']);
|
|
14
|
+
const ORIGIN = (src) => (src === 'Jira' ? 'jira' : PMOS.has(src) ? 'breakdown' : 'plan');
|
|
15
|
+
|
|
16
|
+
function frame(id, n) {
|
|
17
|
+
const f = FRAMES[id][n];
|
|
18
|
+
const items = f.it.map(([k, s, e, dep, fs, fe, st, pts]) => {
|
|
19
|
+
const [t, src, ph, o, c, p, ms, crit, bl] = META[k];
|
|
20
|
+
return { id: k, key: k, title: t, origin: ORIGIN(src), src, phase: ph, owner: o, state: c, progress: p, ms: !!ms, start: dOf(s), due: dOf(e), after: dep.slice(), points: pts,
|
|
21
|
+
blocker: bl || null, critical: !!crit && c !== 'done', forecast: { start: dOf(fs), end: dOf(fe), status: STATUS[st] || 'on time', slip_days: st === 'done' ? 0 : Math.max(0, fe - e) } };
|
|
22
|
+
});
|
|
23
|
+
const by = new Map(items.map((i) => [i.id, i]));
|
|
24
|
+
const events = f.ev.map(([k, kind, who, why, tx]) => ({ id: k, key: k, title: META[k][0], origin: ORIGIN(META[k][1]), op: kind === 'add' ? 'add' : 'edit', by: who, why, tx, at: dOf(8) }));
|
|
25
|
+
const prev = n ? FRAMES[id][n - 1] : null;
|
|
26
|
+
const changes = n ? { added: events.filter((e) => e.op === 'add').map((e) => ({ id: e.id, title: e.title, by: e.by, why: e.why })), removed: [],
|
|
27
|
+
moved: events.filter((e) => e.op === 'edit' && /^(Start|End|Slip|Slot)/.test(e.tx)).map((e) => ({ id: e.id, title: e.title, by: e.by, why: e.why, field: 'due' })),
|
|
28
|
+
deps: events.filter((e) => /^Waits on/.test(e.tx)).map((e) => ({ id: e.id, title: e.title, by: e.by, why: e.why, added: [], removed: [] })),
|
|
29
|
+
points: { from: prev.pts, to: f.pts, delta: f.pts - prev.pts } } : null;
|
|
30
|
+
const crit = items.filter((i) => i.critical).map((i) => i.id);
|
|
31
|
+
void by;
|
|
32
|
+
return { check: n, date: dOf(SNAP_DAYS[n]), label: SNAP[n][1] === 'Today' ? 'Today' : SNAP[n][1], items, critical: crit, forecast_end: f.fc ? dOf(f.fc[0]) : null, promised: f.fc ? dOf(f.fc[1]) : null,
|
|
33
|
+
slip_days: f.fc ? f.fc[0] - f.fc[1] : 0, points: f.pts, problems: [], changes, events };
|
|
34
|
+
}
|
|
35
|
+
const SNAP_DAYS = [-16, -5, 0, 5, 8]; // 14 Sep, 25 Sep, 30 Sep, 5 Oct, 8 Oct as day numbers of the mockup (day 8 = 8 Oct)
|
|
36
|
+
|
|
37
|
+
/** GET /api/c3-timeline?initiative=<id> and ?initiatives=a,b,c */
|
|
38
|
+
export function timeline(q) {
|
|
39
|
+
if (q.initiatives) {
|
|
40
|
+
const ids = q.initiatives.split(',').filter((i) => FRAMES[i]);
|
|
41
|
+
const checks = SNAP.map((s, n) => ({ check: n, date: dOf(SNAP_DAYS[n]), label: s[1] }));
|
|
42
|
+
return { ok: true, today: TODAY, checks, rows: ids.map((id) => ({ id, cells: FRAMES[id].map((f, n) => (f.fc ? { date: dOf(SNAP_DAYS[n]), forecast_end: dOf(f.fc[0]), promised: dOf(f.fc[1]), slip_days: f.fc[0] - f.fc[1] } : null)) })) };
|
|
43
|
+
}
|
|
44
|
+
const id = q.initiative;
|
|
45
|
+
if (!FRAMES[id]) return { ok: true, initiative: id, today: TODAY, checks: [], frames: [], sources: { plan: 0, breakdown: 0, jira: 0 }, notes: [] };
|
|
46
|
+
const frames = FRAMES[id].map((_, n) => frame(id, n));
|
|
47
|
+
const src = (o) => frames[frames.length - 1].items.filter((i) => i.origin === o).length;
|
|
48
|
+
return { ok: true, initiative: id, today: TODAY, checks: frames.map((f) => ({ check: f.check, date: f.date, label: f.label })), frames, sources: { plan: src('plan'), breakdown: src('breakdown'), jira: src('jira') }, notes: [] };
|
|
49
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* pm/c3-demo-work-ix.js — the case-file content of the Work rows in DEMO mode (/c3.html?demo=1): the console3 mockup's own sample
|
|
2
|
+
* evidence, options, confidence, "unsure", "if you wait" and agent runs (console3.html: NEEDC i2 line 2250, the agent moves AM at
|
|
3
|
+
* line 4958, genTask 3216). Importing this file attaches an `ix` object to each demo work item of c3-demo-data.js, matched by TITLE
|
|
4
|
+
* (the item ids come from a counter in that file). pm-work-view.js reads `item.ix` only when the item has it, so real mode, whose
|
|
5
|
+
* items never carry one, draws a case file from the item's own fields and never loads this file.
|
|
6
|
+
*
|
|
7
|
+
* Shape of ix: { move, conf, why: [text, source] (the first evidence row, as the mockup's x.why), chg / unsure / ign (a case of its own), steps: [agent run steps],
|
|
8
|
+
* res: { h, draft?, out?, claims: [[label, text]] }, ev: { h, claims } }
|
|
9
|
+
* Nothing here is sent anywhere: a draft stays a draft (the case file's slide for a send is disabled: no channel connected). */
|
|
10
|
+
import { pmItems } from './c3-demo-data.js';
|
|
11
|
+
|
|
12
|
+
const FIX = {
|
|
13
|
+
'Confirm the 1 Oct numbers before the 10:30 update': {
|
|
14
|
+
move: 'Reply 3.1% and cite the sheet', conf: 78,
|
|
15
|
+
why: ['Priya asked in #leadership at 07:58.', 'Slack'],
|
|
16
|
+
steps: ['Reading the Slack thread (quarantined)', 'Reading the analytics sheet', 'Drafting the reply'],
|
|
17
|
+
res: { h: 'Reply to Priya drafted: 3.1%, from the sheet', draft: 'Hi Priya, the 1 Oct conversion is 3.1% (analytics sheet, refreshed 06:10). The PRD says 3.4% but it is 4 days old; I will correct it today.', out: 'Priya, Slack #leadership',
|
|
18
|
+
claims: [['fact', '3.1% from the analytics sheet, today 06:10'], ['fact', 'The PRD says 3.4%, last edited 4 days ago'], ['est', 'The sheet may refresh again before 10:30']] },
|
|
19
|
+
ev: { h: 'Where 3.1% comes from', claims: [['fact', 'Sheet "Checkout KPIs", cell B14: 3.1%, refreshed 06:10'], ['rep', 'Priya asked in #leadership at 07:58 (imported, untrusted)'], ['ass', 'Priya means conversion, not checkout starts. Not confirmed.']] },
|
|
20
|
+
},
|
|
21
|
+
'Assign owners to 2 unowned workshop actions': {
|
|
22
|
+
move: 'Sandbox follow-up to Dara, label review to Lee', conf: 74,
|
|
23
|
+
why: ['Two actions on the whiteboard photo have no owner.', 'Image'],
|
|
24
|
+
steps: ['Reading the whiteboard photo', 'Matching actions to owners', 'Drawing the owner map'],
|
|
25
|
+
res: { h: 'Owners for the two workshop actions', claims: [['est', 'Action 2 was read at medium confidence (handwriting)'], ['fact', 'Dara owns the sandbox work in Jira (CHK-141)'], ['fact', 'Lee owns the pricing label in Figma']] },
|
|
26
|
+
ev: { h: 'What was read from the photo', claims: [['est', 'Action 1: sandbox follow-up, read at high confidence'], ['est', 'Action 2: label review, read at medium confidence'], ['rep', 'Both due next week, from the whiteboard']] },
|
|
27
|
+
},
|
|
28
|
+
'Approve pricing-page copy before handoff': {
|
|
29
|
+
move: '"Save 20% billed yearly"', conf: 70,
|
|
30
|
+
why: ['One open Figma comment on the annual-plan label.', 'Figma'],
|
|
31
|
+
steps: ['Reading the Figma comment', 'Reading the PRD pricing section', 'Writing the options'],
|
|
32
|
+
res: { h: 'Three slides for the pricing-copy call', claims: [['fact', '"Save 20% billed yearly" shows the discount'], ['est', 'Longer on mobile, one line wraps'], ['ass', 'Customers read "Annual" as a price rise']] },
|
|
33
|
+
ev: { h: 'What Figma says', claims: [['fact', 'One open comment, from Lee on Tue'], ['est', 'The file was last read Tue 17:10, so newer comments may exist']] },
|
|
34
|
+
},
|
|
35
|
+
'Review the 13:00 interview guide': {
|
|
36
|
+
move: 'Ask openly: "What did you do when printing failed?"', conf: 76,
|
|
37
|
+
why: ['Question 6 may lead the answer.', 'Agent'],
|
|
38
|
+
steps: ['Reading the last two calls', 'Reading the guide'],
|
|
39
|
+
res: { h: 'Question 6 is set and the guide is ready', claims: [['fact', 'Question 6 now reads "What did you do when printing failed?"'], ['est', 'The open wording does not lead the answer'], ['fact', 'Written to discovery/returns-guide, pushed to its own branch']] },
|
|
40
|
+
ev: { h: 'Why question 6 needs your wording', claims: [['fact', '2 of 3 calls mentioned the support route'], ['rep', '"we just call support" (call 2, imported)'], ['ass', 'A direct question about support may lead the answer']] },
|
|
41
|
+
},
|
|
42
|
+
'Confirm the growth assumption in the Q4 forecast': {
|
|
43
|
+
move: 'Set 4% and tell Marta', conf: 72,
|
|
44
|
+
why: ['Forecast row 14 says 6% growth.', 'Sheets'],
|
|
45
|
+
steps: ['Reading forecast row 14', 'Reading the PRD section', 'Comparing with 3 months of actuals'],
|
|
46
|
+
res: { h: 'The growth assumption has three sources and two disagree', claims: [['fact', 'Actual growth over 3 months is 3.8%'], ['est', 'Setting 4% leaves a gap of 0.2 points, 2 either way'], ['ass', 'Finance locks the forecast tomorrow as planned']] },
|
|
47
|
+
ev: { h: 'Where 6% came from', claims: [['fact', 'Row 14 was last edited 3 days ago by Finance'], ['rep', 'The edit note says "growth target" (imported text, untrusted)'], ['est', 'The 6% matches the target, not the trend']] },
|
|
48
|
+
},
|
|
49
|
+
'Say yes to Sam: ship the logging change': {
|
|
50
|
+
move: 'Open the logging change as a pull request', conf: 84,
|
|
51
|
+
why: ['Sam asked for a yes in Slack.', 'Slack'],
|
|
52
|
+
steps: ['Reading the change', 'Running lint locally'],
|
|
53
|
+
res: { h: 'Logging change is up for review', claims: [['fact', 'Local lint passes'], ['fact', 'Pushed 5c1d7aa to initiative/search-relevance (observed)'], ['fact', 'Pull request opened; it merges when required CI is green']] },
|
|
54
|
+
ev: { h: 'What the change touches', claims: [['fact', 'Adds one log line in src/rank.js'], ['est', 'No behaviour change, low risk']] },
|
|
55
|
+
},
|
|
56
|
+
'Pick interview slots with 3 customers': {
|
|
57
|
+
move: 'Accept the 3 held slots', conf: 80,
|
|
58
|
+
why: ['3 slots are held, none overlaps a standing meeting.', 'Calendar'],
|
|
59
|
+
steps: ['Reading the calendar', 'Writing the slot brief'],
|
|
60
|
+
res: { h: 'A one-page brief on the three held slots', claims: [['fact', '3 slots held, none overlapping (calendar, now)'], ['rep', 'Marta sent five times (Gmail, imported)']] },
|
|
61
|
+
ev: { h: 'Why these three slots', claims: [['fact', '3 slots held, none overlapping (calendar, now)'], ['rep', 'Marta sent five times (Gmail, imported)']] },
|
|
62
|
+
},
|
|
63
|
+
'Self-serve onboarding: continue or park?': {
|
|
64
|
+
move: 'Park and revisit in Q1', conf: 66,
|
|
65
|
+
why: ['9 days without movement', 'Jira'],
|
|
66
|
+
steps: ['Reading the stop rule'],
|
|
67
|
+
res: { h: 'Parked, with a line in the Q1 plan', claims: [['fact', 'Stop rule asked for 2 signals by 30 Sep, found 0'], ['fact', 'One line added to the Q1 planning list'], ['est', 'Frees one discovery slot']] },
|
|
68
|
+
ev: { h: 'Why it was kept this long', claims: [['fact', '9 days without movement (Jira)'], ['rep', 'The brief said "2 signals by 30 Sep" (imported)']] },
|
|
69
|
+
},
|
|
70
|
+
'Cut Checkout v2 to 3 core flows to hold 24 Oct?': {
|
|
71
|
+
sit: 'When the scope is too big for the date, I want a decision fast and a clear plan, so we ship on 24 Oct.',
|
|
72
|
+
chg: [['scale', 'Four flows fit 31 Oct, three fit 24 Oct.', 'Plan run 09:12', 'warn'], ['doc', 'The PRD lists 4 flows (v5)', 'Confluence', 'warn'], ['clock', 'The decision meeting is at 14:00', 'Calendar']],
|
|
73
|
+
unsure: 'The 24 Oct promise was made to leadership.', ign: 'The forecast stays at 31 Oct.',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
for (const row of pmItems().items) { const f = FIX[row.title]; if (f) row.ix = f; }
|
|
79
|
+
} catch { /* the fixtures are optional: a work item without ix gets a case built from its own fields */ }
|
|
80
|
+
export const WORK_IX_TITLES = Object.keys(FIX);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* pm/c3-demo-work2.js — demo-only fixtures of the Work tab's Jobs card (/c3.html?demo=1). Sets window.__c3work2, which pm-work-view.js reads in demo mode only.
|
|
2
|
+
* jobAll: for each job, the items the mockup lists in its case file under "All N items, across every list" (console3.html c3jall, line 4653),
|
|
3
|
+
* grouped by list in the order triage, today, week, waiting, later, done. Each group is [list label, [titles], struck-through?]. The titles are the
|
|
4
|
+
* mockup's own S.items (line 1070); the demo list data holds a few more items under job 1, so the count shown here is the mockup's. */
|
|
5
|
+
window.__c3work2 = {
|
|
6
|
+
jobAll: {
|
|
7
|
+
j1: [['Triage', ['Assign owners to 2 unowned workshop actions', 'Approve pricing-page copy before handoff', 'Confirm the growth assumption in the Q4 forecast']],
|
|
8
|
+
['Today', ['Cut Checkout v2 to 3 core flows to hold 24 Oct?']], ['Waiting', ['Payments sandbox keys', 'Annual-plan label']], ['Done', ['Send revised PRD to Dara'], true]],
|
|
9
|
+
j2: [['Triage', ['Confirm the 1 Oct numbers before the 10:30 update']]],
|
|
10
|
+
j3: [['Triage', ['Review the 13:00 interview guide', 'Pick interview slots with 3 customers', 'Accept the 15 Oct interview invite']], ['Week', ['Share returns insights with sales']]],
|
|
11
|
+
j4: [['Week', ['Confirm the SSO date to Marta']]],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* pm/c3-demo.js — DEMO MODE of the console3 shell page (/c3.html?demo=1). c3-shell.js loads this module only when the URL has demo=1,
|
|
2
|
+
* before any view mounts. It does three things and nothing else:
|
|
3
|
+
* 1. It freezes the page clock at the mockup's "now" (Thu 8 Oct 2026, 08:12) by replacing the global Date, so every view that asks
|
|
4
|
+
* for "today" or "now" draws the mockup's day. Frozen, not ticking: the mockup's day does not move either.
|
|
5
|
+
* 2. It wraps window.fetch (the original is kept in `realFetch`). A GET to one of the /api routes the page uses is answered with
|
|
6
|
+
* the fixtures in c3-demo-data.js, which have the real routes' response shapes. A GET to any other path goes to the server as
|
|
7
|
+
* it is. EVERY non-GET request is answered here with { ok: true } (and the real route's shape where a view needs one): no
|
|
8
|
+
* press reaches the server, nothing is saved.
|
|
9
|
+
* 3. It gives the shell the small "Demo data: nothing is saved" pill for the header (demoPill).
|
|
10
|
+
* Real mode never loads this file. The views are the real views: only the answers differ. */
|
|
11
|
+
import { el } from './dom.js';
|
|
12
|
+
import * as D from './c3-demo-data.js';
|
|
13
|
+
import { installInit } from './c3-demo-init.js';
|
|
14
|
+
import './c3-demo-cal-ix.js'; // Calendar and the ribbon: sets window.__c3calix (calendar-views.js reads it in demo only)
|
|
15
|
+
import './c3-demo-cal3.js'; // Calendar Quarter and Year: answers GET /api/c3-strategy (chained under this file's fetch wrapper)
|
|
16
|
+
import './c3-demo-rep-ix.js'; // Reports fixtures: sets window.__c3repix (report-families-view.js reads it in demo only)
|
|
17
|
+
import './c3-demo-cal2.js'; // Calendar After notes, Week grid, Progress and timing: sets window.__c3cal2 (calendar-views.js reads it in demo only)
|
|
18
|
+
import './c3-demo-work2.js'; // Work Jobs card: sets window.__c3work2 (pm-work-view.js reads it in demo only)
|
|
19
|
+
import './c3-demo-work-ix.js'; // Work case files: attaches `ix` (evidence, options, agent steps) to the demo work items (pm-work-view.js reads it in demo only)
|
|
20
|
+
import './c3-demo-term.js'; // Agent surfaces: registers the run fixtures (window.__c3termfx_make); c3-terminal-data.js reads them in demo only
|
|
21
|
+
import './c3-demo-life.js'; // Lifecycle panels: ideas, hypotheses, lessons, gates, evaluations, corrections (wraps window.fetch for those GETs; innermost, so it loads before realFetch is taken)
|
|
22
|
+
import './c3-demo-misc2.js'; // Work Today lens as the mockup's; the Reflect lens's "What I could stop" (installMisc2 wraps the fetch after the briefing fixtures)
|
|
23
|
+
import { timeline } from './c3-demo-time.js'; // Initiatives Timeline: every check as a frame, in the real /api/c3-timeline shape
|
|
24
|
+
import './c3-demo-plan2.js'; // Commitments, Why it slips, Dependencies and Releases of Deliver: sets window.__c3planfx (c3-plan-panels.js, timeline-forecast-view.js, releases-view.js read it in demo only)
|
|
25
|
+
|
|
26
|
+
const realFetch = window.fetch.bind(window);
|
|
27
|
+
|
|
28
|
+
/* ── the clock ── */
|
|
29
|
+
function freezeClock() {
|
|
30
|
+
const RealDate = Date;
|
|
31
|
+
const fixed = new RealDate(D.NOW_ISO).getTime(); // local time, as the mockup's clock reads 08:12 for the PM
|
|
32
|
+
function FakeDate(...a) {
|
|
33
|
+
if (!new.target) return new RealDate(fixed).toString();
|
|
34
|
+
return a.length ? new RealDate(...a) : new RealDate(fixed);
|
|
35
|
+
}
|
|
36
|
+
FakeDate.prototype = RealDate.prototype;
|
|
37
|
+
FakeDate.now = () => fixed;
|
|
38
|
+
FakeDate.UTC = RealDate.UTC;
|
|
39
|
+
FakeDate.parse = RealDate.parse;
|
|
40
|
+
Object.defineProperty(window, 'Date', { value: FakeDate, configurable: true, writable: true });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ── the answers ── */
|
|
44
|
+
const json = (body, status) => new Response(JSON.stringify(body), { status: status || 200, headers: { 'content-type': 'application/json' } });
|
|
45
|
+
let added = 0;
|
|
46
|
+
|
|
47
|
+
function getRoute(path, url) {
|
|
48
|
+
const q = new URL(url, location.origin).searchParams;
|
|
49
|
+
switch (path) {
|
|
50
|
+
case '/api/briefing': return D.briefing(url);
|
|
51
|
+
case '/api/calendar-views': return D.calendarViews(url);
|
|
52
|
+
case '/api/pm-items': return D.pmItems();
|
|
53
|
+
case '/api/runs': return D.runs();
|
|
54
|
+
case '/api/releases': return D.releases();
|
|
55
|
+
case '/api/forecast': return D.forecast(q.get('initiative') || 'checkout');
|
|
56
|
+
case '/api/forecast/at': return D.forecastAt(q.get('initiative') || 'checkout', q.get('date') || D.TODAY);
|
|
57
|
+
case '/api/c3-timeline': return timeline({ initiative: q.get('initiative') || '', initiatives: q.get('initiatives') || '' }); // the Timeline's frames (c3-demo-time.js)
|
|
58
|
+
case '/api/report-families': return D.reportFamilies();
|
|
59
|
+
case '/api/report-families/facts': return D.reportFacts();
|
|
60
|
+
case '/api/workspaces': return D.workspaces();
|
|
61
|
+
case '/api/sessions': return D.sessions();
|
|
62
|
+
case '/api/sessions/transcript': return D.transcript(q.get('id'));
|
|
63
|
+
case '/api/scratchpad': return { ok: true, text: '' };
|
|
64
|
+
case '/api/git/worktrees': return D.worktrees();
|
|
65
|
+
case '/api/initiatives': return D.roadmap(q.get('ws') || D.WS_ID);
|
|
66
|
+
case '/api/outbox': return D.outbox();
|
|
67
|
+
default: return undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* a write: nothing is saved; the answer has the shape the real route's caller reads */
|
|
72
|
+
function postRoute(path, body) {
|
|
73
|
+
let b = {};
|
|
74
|
+
try { b = body ? JSON.parse(body) : {}; } catch { b = {}; }
|
|
75
|
+
if (path === '/api/pm-items/add') return { ok: true, item: { id: 'item-demo-new' + (++added), title: String(b.line || '').trim() || 'New item', due: null, priority: null, waiting_on: null, job: null, steps: [], created_at: D.NOW_ISO + 'Z' } };
|
|
76
|
+
if (path === '/api/pm-items/remove') return { ok: true, undo_ms: 8000 };
|
|
77
|
+
if (path === '/api/pm-items/undo') return { ok: true, item: { id: b.id } };
|
|
78
|
+
if (path === '/api/pm-items/steps/add' || path === '/api/pm-items/steps/plan') return { ok: true, step: { id: 'step-demo' + (++added), text: b.text || 'Review the plan', who: b.who || 'you', done: false } };
|
|
79
|
+
if (path === '/api/pm-items/steps/who') return { ok: true, who: b.who };
|
|
80
|
+
if (path === '/api/pm-jobs/add') return { ok: true, job: { id: 'job-demo' + (++added), when: '', want: String(b.line || ''), so: '' } };
|
|
81
|
+
if (path === '/api/pm-jobs/delete') return { ok: true, reassigned: 0 };
|
|
82
|
+
if (path === '/api/releases/create') return { ok: true, release: { id: 'rel-demo' + (++added) } };
|
|
83
|
+
if (path === '/api/releases/summary') return { ok: true };
|
|
84
|
+
if (path === '/api/report-families/check') return D.reportCheck(b);
|
|
85
|
+
if (path === '/api/outbox/confirm') return { ok: true, state: 'confirmed' };
|
|
86
|
+
return { ok: true };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function install() {
|
|
90
|
+
window.fetch = (input, init) => {
|
|
91
|
+
try {
|
|
92
|
+
const raw = typeof input === 'string' ? input : input instanceof URL ? input.href : input && input.url;
|
|
93
|
+
const method = String((init && init.method) || (input && input.method) || 'GET').toUpperCase();
|
|
94
|
+
const u = new URL(raw, location.origin);
|
|
95
|
+
if (u.origin === location.origin && u.pathname.startsWith('/api/')) {
|
|
96
|
+
if (method !== 'GET') return Promise.resolve(json(postRoute(u.pathname, init && init.body)));
|
|
97
|
+
const out = getRoute(u.pathname, u.pathname + u.search);
|
|
98
|
+
if (out !== undefined) return Promise.resolve(json(out));
|
|
99
|
+
} else if (method !== 'GET' && u.origin === location.origin) {
|
|
100
|
+
return Promise.resolve(json({ ok: true }));
|
|
101
|
+
}
|
|
102
|
+
} catch { /* an unreadable request goes to the server as it is */ }
|
|
103
|
+
return realFetch(input, init);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** The header pill. c3-shell.js puts it first in the tools row. */
|
|
108
|
+
export function demoPill() {
|
|
109
|
+
return el('span', { class: 'c3pg-demo', role: 'status', 'data-c3pg': 'demo-pill', title: 'The page shows the mockup\'s sample content. No press reaches the server.' }, 'Demo data: nothing is saved');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const DEMO_WS = D.WS_ID;
|
|
113
|
+
export function installDemo() { freezeClock(); install(); installInit(); import('./c3-demo-rep2.js').then((m) => m.installRep2()); window.__c3demo = true; window.__c3demoReady = import('./c3-demo-brief-ix.js').then((m) => m.installBriefIx()).then(() => import('./c3-demo-misc2.js')).then((m) => m.installMisc2()); } // Briefing case files, people and a simulated agent (c3-shell.js waits for __c3demoReady)
|