dsh-notch 0.3.1 → 0.3.4

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 (102) hide show
  1. package/README.en.md +58 -47
  2. package/README.md +60 -55
  3. package/cordis.patch.yml +3 -0
  4. package/desktop/README.md +29 -0
  5. package/desktop/notch-lifecycle.mjs +120 -0
  6. package/desktop/restart-probe.mjs +61 -0
  7. package/docs/desktop-017rc2.md +23 -0
  8. package/docs/elastic-edge-dock.md +127 -0
  9. package/docs/motion-audit.md +1 -1
  10. package/docs/releases/v0.3.2.md +38 -0
  11. package/docs/releases/v0.3.3.md +9 -0
  12. package/docs/subagent-compatibility.md +51 -0
  13. package/docs/verification/elastic-algorithm-timing.json +337 -0
  14. package/docs/verification/elastic-attention.json +44 -0
  15. package/docs/verification/elastic-frame-timing.json +240 -0
  16. package/docs/verification/elastic-tension.json +59 -0
  17. package/docs/verification/elastic-tip-taper.json +181 -0
  18. package/dshx.yml +2 -0
  19. package/lib/client.js +112 -0
  20. package/lib/client.js.map +1 -0
  21. package/lib/index.mjs +990 -0
  22. package/lib/index.mjs.map +1 -0
  23. package/package.json +58 -10
  24. package/src/board.ts +178 -35
  25. package/src/client/index.ts +104 -0
  26. package/src/dsh-notch.ts +19 -2
  27. package/src/http.ts +17 -2
  28. package/src/session-state.ts +15 -1
  29. package/src/store.ts +3 -3
  30. package/src/types.ts +3 -0
  31. package/BASELINE.md +0 -13
  32. package/DESIGN.md +0 -34
  33. package/cordis.yml +0 -5
  34. package/macos/Package.swift +0 -17
  35. package/macos/STATUS-MOTION.md +0 -49
  36. package/macos/Sources/Client.swift +0 -139
  37. package/macos/Sources/IdleRobot.swift +0 -423
  38. package/macos/Sources/NotchMarkdown.swift +0 -266
  39. package/macos/Sources/Panel.swift +0 -153
  40. package/macos/Sources/Resources/Idle/balance.json +0 -1
  41. package/macos/Sources/Resources/Idle/blink.json +0 -1
  42. package/macos/Sources/Resources/Idle/cube-in.json +0 -1
  43. package/macos/Sources/Resources/Idle/dance.json +0 -1
  44. package/macos/Sources/Resources/Idle/hop.json +0 -1
  45. package/macos/Sources/Resources/Idle/nod.json +0 -1
  46. package/macos/Sources/Resources/Idle/satellite-in.json +0 -1
  47. package/macos/Sources/Resources/Idle/satellite-out.json +0 -1
  48. package/macos/Sources/Resources/Idle/scan.json +0 -1
  49. package/macos/Sources/Resources/Idle/sleep.json +0 -1
  50. package/macos/Sources/Resources/Idle/sneeze.json +0 -1
  51. package/macos/Sources/Resources/Idle/stretch.json +0 -1
  52. package/macos/Sources/Resources/Idle/tilt.json +0 -1
  53. package/macos/Sources/ReviewStudio.swift +0 -337
  54. package/macos/Sources/RootView.swift +0 -1093
  55. package/macos/Sources/StatusOrbit.swift +0 -642
  56. package/macos/Sources/main.swift +0 -153
  57. package/macos/Tests/ExpandedHeightProbe.swift +0 -108
  58. package/macos/Tests/GeometryProbe.swift +0 -98
  59. package/macos/Tests/IdleProbe.swift +0 -294
  60. package/macos/Tests/MotionProbe.swift +0 -106
  61. package/macos/Tests/OutcomeProbe.swift +0 -133
  62. package/macos/Tests/ScrollbarProbe.swift +0 -91
  63. package/macos/Tests/expanded-height.sh +0 -13
  64. package/macos/Tests/geometry.sh +0 -14
  65. package/macos/Tests/idle.sh +0 -14
  66. package/macos/Tests/motion.sh +0 -14
  67. package/macos/Tests/outcome.sh +0 -14
  68. package/macos/Tests/scrollbar.sh +0 -13
  69. package/tests/answer-lifecycle.test.mjs +0 -23
  70. package/tests/board.test.mjs +0 -7
  71. package/tests/browse-sync.test.mjs +0 -20
  72. package/tests/mirror.test.mjs +0 -4
  73. package/tests/peer-range.test.mjs +0 -21
  74. package/tests/session-state.test.mjs +0 -54
  75. package/tests/unread-hold.test.mjs +0 -90
  76. package/tools/desktop-shell/README.md +0 -56
  77. package/tools/desktop-shell/child-log.mjs +0 -6
  78. package/tools/desktop-shell/child-log.test.mjs +0 -14
  79. package/tools/desktop-shell/package-recovery.py +0 -78
  80. package/tools/desktop-shell/recovery-probe.cjs +0 -50
  81. package/tools/desktop-shell/renderer-recovery.mjs +0 -95
  82. package/tools/desktop-shell/renderer-recovery.test.mjs +0 -24
  83. package/tools/diagnostics/completion-watch.py +0 -101
  84. package/tools/diagnostics/completion-watch.test.py +0 -17
  85. package/tools/diagnostics/renderer-diagnostics.mjs +0 -56
  86. package/tools/diagnostics/renderer-diagnostics.test.mjs +0 -32
  87. package/tools/idle/LICENSE.open-bot-motion +0 -21
  88. package/tools/idle/export.mjs +0 -40
  89. package/tools/idle/index.html +0 -4
  90. package/tools/idle/motions.js +0 -83
  91. package/tools/idle/original.js +0 -1673
  92. package/tools/idle/renderer.js +0 -1673
  93. package/tools/recording/Client.swift +0 -76
  94. package/tools/recording/DemoCatalog.swift +0 -174
  95. package/tools/recording/README.md +0 -23
  96. package/tools/recording/build.sh +0 -41
  97. package/tools/recording/main.swift +0 -100
  98. package/tools/review/ReviewStudio.swift +0 -236
  99. package/tools/review/audit.sh +0 -19
  100. package/tools/review/build.sh +0 -7
  101. package/tools/review/main.swift +0 -158
  102. package/tools/review/render-audit.swift +0 -32
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Open Bot Motion Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,40 +0,0 @@
1
- import {homedir} from 'node:os';
2
- import {fileURLToPath,pathToFileURL} from 'node:url';
3
- const {launchPinnedChromium}=await import(pathToFileURL(homedir()+'/.codex/playwright-runtime/runtime.mjs'));
4
- import {writeFile,mkdir} from 'node:fs/promises';
5
- const out=fileURLToPath(new URL('../../macos/Sources/Resources/Idle',import.meta.url));await mkdir(out,{recursive:true});
6
- const b=await launchPinnedChromium();const p=await b.newPage();await p.goto(new URL('./index.html',import.meta.url).href);
7
- await p.evaluate(()=>window.capture=true);
8
- for(const id of (process.argv.slice(2).length?process.argv.slice(2):['blink','scan','tilt','nod','stretch','hop','balance','sneeze','sleep','dance','satellite-out','satellite-in','cube-in'])){
9
- const data=await p.evaluate(id=>{
10
- const fps=30,duration=id==='dance'?20.783:id==='satellite-out'?.8:id==='satellite-in'?.82:id==='cube-in'?1.05:id==='sleep'?9:7,frames=[],proj=new OpenBotMotion.SvgProjector({viewportSize:280});
11
- const path=document.createElementNS('http://www.w3.org/2000/svg','path');
12
- for(let i=0;i<Math.ceil(duration*fps);i++){
13
- const pose=poseFor(id,i/fps).bot,res=proj.projectRoundedCube(pose);path.setAttribute('d',res.bodyPath);const len=path.getTotalLength();
14
- // SVG hull start vertices change with rotation. Sample a fixed angular grid
15
- // around the bounds center, so index k always represents the same direction.
16
- const outline=Array.from({length:768},(_,k)=>path.getPointAtLength(k*len/768));
17
- const cx=(Math.min(...outline.map(p=>p.x))+Math.max(...outline.map(p=>p.x)))/2;
18
- const cy=(Math.min(...outline.map(p=>p.y))+Math.max(...outline.map(p=>p.y)))/2;
19
- const points=Array.from({length:192},(_,k)=>{
20
- const angle=2*Math.PI*k/192,dx=Math.cos(angle),dy=Math.sin(angle);
21
- let radius=Infinity;
22
- for(let j=0;j<outline.length;j++) {
23
- const a=outline[j],b=outline[(j+1)%outline.length];
24
- const ex=b.x-a.x,ey=b.y-a.y,den=dx*ey-dy*ex;
25
- if(Math.abs(den)<1e-10) continue;
26
- const ax=a.x-cx,ay=a.y-cy;
27
- const r=(ax*ey-ay*ex)/den,u=(ax*dy-ay*dx)/den;
28
- if(r>=0 && u>=-1e-8 && u<=1+1e-8) radius=Math.min(radius,r);
29
- }
30
- if(!Number.isFinite(radius)) throw new Error('Missing contour intersection');
31
- return [Math.round((cx+dx*radius)*1000)/1000,Math.round((cy+dy*radius)*1000)/1000];
32
- });
33
- const eyeSource=res.eyes.length===2?res.eyes:[{cx:-12,cy:0,w:1,h:1,rx:.5,angle:0,opacity:0},{cx:12,cy:0,w:1,h:1,rx:.5,angle:0,opacity:0}];
34
- const eyes=eyeSource.map(e=>({x:e.cx,y:e.cy,w:e.w,h:e.h,r:e.rx,angle:e.angle,opacity:e.opacity??1}));
35
- frames.push({points,eyes,body:pose.bodyColor,eye:pose.eyeColor});
36
- }
37
- return {fps,duration,frames};
38
- },id);await writeFile(`${out}/${id}.json`,JSON.stringify(data));console.log(id,data.frames.length);
39
- }
40
- await b.close();
@@ -1,4 +0,0 @@
1
- <!doctype html><meta charset="utf-8"><title>Notch · 九个基础待机动作</title>
2
- <style>*{box-sizing:border-box}body{margin:0;background:#ededf0;color:#24242a;font-family:-apple-system,BlinkMacSystemFont,sans-serif}main{width:660px;padding:24px}h1{font-size:22px;margin:0 0 8px}p{font-size:13px;color:#7d7d84;margin:0 0 20px}#grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}article{background:black;border-radius:20px;height:192px;display:flex;align-items:center;flex-direction:column}label{font-size:13px;color:#c6c6ce;margin-top:-8px}label span{color:#73737e;font-size:11px;margin-right:5px}.bot{width:166px;height:166px}footer{font-size:12px;color:#8b8b94;margin-top:16px}#dance{margin-top:30px;display:flex;gap:12px}#dance article{width:300px;height:220px}#dance label{margin-top:10px}</style>
3
- <main><section id="nine"><h1>九个基础动作,各有一点小性格</h1><p>同步展示便于比较;正式待机每次只触发一个动作。</p><div id="grid"></div><footer>保留双眼的统一形状,通过视线、身体和节奏表达情绪。</footer></section><section id="dance"><article><div data-motion="dance-old"></div><label>之前:0.65 倍速</label></article><article><div data-motion="dance"></div><label>原库:原速 · 原弹跳 · 原色彩</label></article></section></main>
4
- <script src="renderer.js"></script><script src="motions.js"></script>
@@ -1,83 +0,0 @@
1
- const clamp=x=>Math.max(0,Math.min(1,x));
2
- const ease=x=>{x=clamp(x);return x*x*x*(x*(x*6-15)+10)};
3
- const pulse=(t,a,b,c,d)=>ease((t-a)/(b-a))*(1-ease((t-c)/(d-c)));
4
- const neutral=()=>({visible:true,scale:1,scaleX:1,scaleY:1,x:0,y:0,yaw:0,pitch:0,roll:0,eyeShiftX:0,eyeShiftY:0,eyeShiftYL:0,eyeShiftYR:0,eyeGap:.24,eyeScaleXL:1,eyeScaleXR:1,eyeScaleYL:1,eyeScaleYR:1,eyeSlantL:0,eyeSlantR:0,squint:0,bodyColor:0xe5e5e7,eyeColor:0x171719});
5
- window.poseFor=(id,time)=>{
6
- if(id==='cube-in') {
7
- const result=OpenBotMotion.getBot5State(2.22+Math.min(time,1.05));
8
- result.bot.visible=true;result.bot.scale=Math.max(.015,result.bot.scale);
9
- result.bot.bodyColor=0xe5e5e7;result.bot.eyeColor=0x171719;
10
- // Rear-facing phases retain two invisible eye slots for native interpolation.
11
- return result;
12
- }
13
- if(id==='satellite-out'||id==='satellite-in') {
14
- const t=id==='satellite-out'?2+Math.min(time,.8):7.04+Math.min(time,.82);
15
- const result=OpenBotMotion.getBot7State(t);
16
- result.bot.bodyColor=0xe5e5e7;result.bot.eyeColor=0x171719;
17
- if(id==='satellite-out') {
18
- // #7 supplies anticipation; add a real backward revolution before collapse.
19
- const turn=ease((time-.20)/.38);
20
- result.bot.pitch=-Math.PI*2*turn;
21
- result.bot.yaw=.26*Math.sin(Math.PI*turn);
22
- result.bot.scale=1-.48*ease((time-.40)/.22);
23
- result.bot.y+=.065*Math.sin(Math.PI*turn);
24
- result.bot.showEyes=true;
25
- }
26
- // Keep topology stable even while #7 hides its eyes.
27
- if(result.bot.showEyes===false){result.bot.showEyes=true;result.bot.eyeScaleY=.01;}
28
- return result;
29
- }
30
- if(id==='dance')return OpenBotMotion.getBot3State(time);
31
- if(id==='dance-old')return OpenBotMotion.getBot3State(time*.65);
32
- const t=time%(id==='sleep'?9:7),p=neutral();
33
- const close=v=>{p.eyeScaleYL=1-.94*v;p.eyeScaleYR=1-.94*v};
34
- switch(id){
35
- case 'blink': {
36
- close(pulse(t,1.1,1.22,1.31,1.52)+pulse(t,1.8,1.94,2.01,2.2));
37
- const wake=pulse(t,2.35,2.7,3.1,3.9);p.eyeScaleYL+=.16*wake;p.eyeScaleYR+=.16*wake;p.y=.018*wake;break;
38
- }
39
- case 'scan': {
40
- const left=pulse(t,.8,1.25,1.8,2.3),right=pulse(t,2.5,3,3.6,4.2);
41
- p.eyeShiftX=.18*(right-left);p.yaw=.22*(pulse(t,1,1.5,1.8,2.5)*-1+pulse(t,2.7,3.2,3.6,4.4));break;
42
- }
43
- case 'tilt': {
44
- const first=pulse(t,1,1.7,2.4,3),second=pulse(t,3.2,3.8,4.15,4.9);
45
- p.roll=-.27*first+.14*second;p.eyeShiftY=.035*first;p.pitch=-.08*first;close(.38*pulse(t,4.8,4.92,5.01,5.18));break;
46
- }
47
- case 'nod': {
48
- const hello=pulse(t,.8,1.2,1.45,1.85)+.65*pulse(t,2.0,2.3,2.5,2.95);
49
- p.pitch=.3*hello;p.y=-.045*hello;p.scaleY=1-.07*hello;p.scaleX=1+.025*hello;close(.35*hello);break;
50
- }
51
- case 'stretch': {
52
- const prep=pulse(t,.8,1.2,1.4,1.8),up=pulse(t,1.5,2.3,3.3,4.35);
53
- p.scaleY=1-.16*prep+.22*up;p.scaleX=1+.1*prep-.12*up;p.y=.025*up;close(.72*up);p.roll=.035*Math.sin(t*4)*up;break;
54
- }
55
- case 'hop': {
56
- const prep=pulse(t,.8,1.15,1.3,1.55);p.scaleY-=.23*prep;p.scaleX+=.16*prep;
57
- if(t>=1.5&&t<2.35){const u=(t-1.5)/.85;p.y=.32*Math.sin(Math.PI*u);p.scaleY+=.12*Math.sin(Math.PI*u);p.scaleX-=.07*Math.sin(Math.PI*u);}
58
- const land=pulse(t,2.3,2.46,2.51,2.84);p.scaleY-=.20*land;p.scaleX+=.14*land;
59
- if(t>=2.8&&t<3.25)p.y=.065*Math.sin(Math.PI*(t-2.8)/.45);
60
- const settle=pulse(t,3.2,3.3,3.33,3.6);p.scaleY-=.05*settle;p.scaleX+=.03*settle;break;
61
- }
62
- case 'balance': {
63
- const w=pulse(t,.7,1.3,3.8,4.7);p.roll=.24*Math.sin((t-.7)*3.5)*w;p.x=.05*Math.sin((t-.7)*3.5)*w;p.eyeShiftX=-.10*Math.sin((t-.7)*3.5)*w;break;
64
- }
65
- case 'sneeze': {
66
- const inhale=pulse(t,.7,1.5,1.75,2.15);p.scaleY+=.13*inhale;p.scaleX-=.065*inhale;p.pitch=-.15*inhale;close(.6*inhale);
67
- const sneeze=pulse(t,1.9,2.05,2.13,2.4);p.scaleY-=.30*sneeze;p.scaleX+=.18*sneeze;p.pitch+=.40*sneeze;p.y-=.035*sneeze;close(Math.max(.6*inhale,sneeze));
68
- p.roll=.045*Math.sin((t-2.4)*12)*pulse(t,2.4,2.55,2.7,3.2);
69
- const surprise=pulse(t,3.3,3.6,3.95,4.6);p.eyeScaleYL+=.15*surprise;p.eyeScaleYR+=.15*surprise;break;
70
- }
71
- case 'sleep': {
72
- const drowse=pulse(t,.6,1.7,5.7,6.2);close(drowse);p.scaleY-=.10*drowse;p.scaleX+=.035*drowse;p.roll=.12*drowse;p.y=-.035*drowse;
73
- const droop=pulse(t,2.4,3.1,5.4,6.0);p.pitch=.2*droop;p.y-=.025*droop;
74
- const wake=pulse(t,5.95,6.2,6.32,6.9);p.y+=.05*wake;p.scaleY+=.06*wake;p.eyeScaleYL+=.22*wake;p.eyeScaleYR+=.22*wake;break;
75
- }
76
- }
77
- return {botId:1,type:'bot1',label:id,bot:p,dots:[]};
78
- };
79
- const items=[['blink','01','眨眼回神'],['scan','02','左右巡视'],['tilt','03','歪头琢磨'],['nod','04','点头招呼'],['stretch','05','伸个懒腰'],['hop','06','果冻小跳'],['balance','07','摇摇平衡'],['sneeze','08','憋个喷嚏'],['sleep','09','打盹惊醒']];
80
- for(const [id,n,label] of items){const card=document.createElement('article');card.innerHTML=`<div class="bot" data-motion="${id}"></div><label><span>${n}</span> ${label}</label>`;document.querySelector('#grid').append(card)}
81
- const bots=[...document.querySelectorAll('[data-motion]')].map(el=>OpenBotMotion.mount(el,{bot:1,size:166,autoplay:false,loop:false}));
82
- window.frame=t=>{window.previewTime=t;bots.forEach(b=>b.seek(t));};
83
- let start=performance.now();function tick(t){if(!window.capture)frame((t-start)/1000);requestAnimationFrame(tick)}requestAnimationFrame(tick);