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,153 +0,0 @@
1
- import AppKit
2
- import SwiftUI
3
-
4
- enum NotchGeometryAnimation {
5
- static let animation = Animation.spring(duration: 0.4, bounce: 0.08)
6
- static let duration: TimeInterval = 0.4
7
- static func progress(_ t: Double) -> Double {
8
- let x = min(1, max(0, t))
9
- return x*x*x*(x*(6*x-15)+10)
10
- }
11
- }
12
-
13
- final class NotchPanel: NSPanel {
14
- private var resizeTimer: Timer?
15
- private var resizeTarget: NSSize?
16
- private var resizeGeneration = 0
17
-
18
- func cancelResize() {
19
- resizeTimer?.invalidate()
20
- resizeTimer = nil
21
- resizeTarget = nil
22
- resizeGeneration += 1
23
- }
24
-
25
- /// Animate one native rectangle, preserving its top-right edge at every frame.
26
- func resizeAnchored(to size: NSSize, animated: Bool = true) {
27
- guard resizeTarget != size else { return }
28
- cancelResize()
29
- let generation = resizeGeneration
30
- resizeTarget = size
31
- let start = frame
32
- let end = NSRect(x: start.maxX - size.width, y: start.maxY - size.height, width: size.width, height: size.height)
33
- guard animated, !NSWorkspace.shared.accessibilityDisplayShouldReduceMotion else {
34
- setFrame(end, display: true)
35
- return
36
- }
37
- if #available(macOS 15.0, *) {
38
- NSAnimationContext.animate(NotchGeometryAnimation.animation) {
39
- self.animator().setFrame(end, display: true)
40
- }
41
- return
42
- }
43
- let began = ProcessInfo.processInfo.systemUptime
44
- resizeTimer = Timer.scheduledTimer(withTimeInterval: 1.0 / 60.0, repeats: true) { [weak self] _ in
45
- Task { @MainActor in
46
- guard let self, self.resizeGeneration == generation else { return }
47
- let t = min(1, (ProcessInfo.processInfo.systemUptime - began) / NotchGeometryAnimation.duration)
48
- let progress = NotchGeometryAnimation.progress(t)
49
- let width = start.width + (size.width - start.width) * progress
50
- let height = start.height + (size.height - start.height) * progress
51
- self.setFrame(NSRect(x: start.maxX - width, y: start.maxY - height, width: width, height: height), display: true)
52
- if t >= 1 { self.resizeTimer?.invalidate(); self.resizeTimer = nil }
53
- }
54
- }
55
- }
56
-
57
- override var canBecomeKey: Bool { true }
58
- override var canBecomeMain: Bool { false }
59
-
60
- // An accessory panel has no active app Edit menu to route Command keys.
61
- // Handle only standard editing commands, and only for our focused editor.
62
- override func performKeyEquivalent(with event: NSEvent) -> Bool {
63
- guard isKeyWindow, let editor = firstResponder as? NSTextView else {
64
- return super.performKeyEquivalent(with: event)
65
- }
66
- let flags = event.modifierFlags.intersection(.deviceIndependentFlagsMask)
67
- guard flags.contains(.command), !flags.contains(.control), !flags.contains(.option) else {
68
- return super.performKeyEquivalent(with: event)
69
- }
70
- let key = event.charactersIgnoringModifiers?.lowercased()
71
- if flags.contains(.shift) {
72
- if key == "z", editor.isEditable, let undo = editor.undoManager, undo.canRedo {
73
- undo.redo()
74
- return true
75
- }
76
- return super.performKeyEquivalent(with: event)
77
- }
78
- switch key {
79
- case "a": editor.selectAll(nil)
80
- case "c": editor.copy(nil)
81
- case "x" where editor.isEditable: editor.cut(nil)
82
- case "v" where editor.isEditable: editor.paste(nil)
83
- case "z" where editor.isEditable:
84
- guard let undo = editor.undoManager, undo.canUndo else {
85
- return super.performKeyEquivalent(with: event)
86
- }
87
- undo.undo()
88
- default: return super.performKeyEquivalent(with: event)
89
- }
90
- return true
91
- }
92
-
93
- convenience init(size: NSSize) {
94
- self.init(
95
- contentRect: NSRect(origin: .zero, size: size),
96
- styleMask: [.borderless, .nonactivatingPanel],
97
- backing: .buffered,
98
- defer: false
99
- )
100
- level = .statusBar
101
- collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
102
- isOpaque = false
103
- backgroundColor = .clear
104
- appearance = NSAppearance(named: .darkAqua)
105
- hasShadow = false
106
- isMovable = false
107
- hidesOnDeactivate = false
108
- becomesKeyOnlyIfNeeded = true
109
- isReleasedWhenClosed = false
110
- }
111
-
112
- /// Put the SwiftUI host on top of a real window-backed HUD blur.
113
- /// A VisualEffect inside NSHostingView is covered by the hosting view's opaque fill.
114
- func embedHost(_ hosting: NSView) {
115
- let effect = NSVisualEffectView(frame: contentView?.bounds ?? NSRect(origin: .zero, size: frame.size))
116
- effect.material = .hudWindow
117
- effect.blendingMode = .behindWindow
118
- effect.state = .active
119
- effect.isEmphasized = true
120
- effect.autoresizingMask = [.width, .height]
121
- effect.wantsLayer = true
122
- effect.layer?.masksToBounds = true
123
- effect.layer?.cornerRadius = 16
124
- effect.layer?.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner]
125
- effect.appearance = NSAppearance(named: .darkAqua)
126
- contentView = effect
127
- hosting.autoresizingMask = [.width, .height]
128
- hosting.frame = effect.bounds
129
- hosting.wantsLayer = true
130
- hosting.layer?.isOpaque = false
131
- hosting.layer?.backgroundColor = NSColor.clear.cgColor
132
- effect.addSubview(hosting)
133
- }
134
- }
135
-
136
- final class NotchHostingView<Content: View>: NSHostingView<Content> {
137
- override var isOpaque: Bool { false }
138
-
139
- // The panel is intentionally nonactivating. A click must reach SwiftUI
140
- // controls immediately, even while another app is the active application.
141
- override func acceptsFirstMouse(for event: NSEvent?) -> Bool { true }
142
- }
143
-
144
- struct NotchScreenLayout {
145
- let edgeInset: CGFloat
146
- let maximumHeight: CGFloat
147
-
148
- init(availableHeight: CGFloat, preferredInset: CGFloat = 100) {
149
- let height = max(1, availableHeight)
150
- edgeInset = min(preferredInset, max(0, (height - 1) / 2))
151
- maximumHeight = height - 2 * edgeInset
152
- }
153
- }