@jkwd/inbase 0.1.21 → 0.1.23

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 (58) hide show
  1. package/README.md +13 -7
  2. package/apps/explorer/package.json +1 -0
  3. package/apps/explorer/scripts/explain-store.d.ts +135 -0
  4. package/apps/explorer/scripts/explain-store.mjs +666 -0
  5. package/apps/explorer/scripts/patch-lib.mjs +4 -0
  6. package/apps/explorer/scripts/scan-target.mjs +22 -5
  7. package/apps/explorer/scripts/session-store.d.ts +86 -11
  8. package/apps/explorer/scripts/session-store.mjs +371 -58
  9. package/apps/explorer/scripts/target-config.d.ts +38 -3
  10. package/apps/explorer/scripts/target-config.mjs +147 -3
  11. package/apps/explorer/src/App.tsx +1073 -158
  12. package/apps/explorer/src/agentIntent.ts +61 -7
  13. package/apps/explorer/src/codebase.ts +1 -1
  14. package/apps/explorer/src/devTargets.ts +66 -0
  15. package/apps/explorer/src/explain.ts +312 -0
  16. package/apps/explorer/src/index.css +874 -222
  17. package/apps/explorer/src/layout.ts +55 -0
  18. package/apps/explorer/src/scene/DistantFileBlocks.tsx +4 -2
  19. package/apps/explorer/src/scene/FileBlock.tsx +95 -72
  20. package/apps/explorer/src/scene/FolderArea.tsx +55 -32
  21. package/apps/explorer/src/scene/MapView.tsx +506 -33
  22. package/apps/explorer/src/scene/RelationLines.tsx +7 -0
  23. package/apps/explorer/src/scene/World.tsx +146 -32
  24. package/apps/explorer/src/speech.ts +228 -0
  25. package/apps/explorer/src/theme.ts +29 -0
  26. package/apps/explorer/src/types.ts +98 -8
  27. package/apps/explorer/src/ui/CanvasErrorBoundary.tsx +1 -1
  28. package/apps/explorer/src/ui/ExplainAskCard.tsx +142 -0
  29. package/apps/explorer/src/ui/ExplainHud.tsx +524 -0
  30. package/apps/explorer/src/ui/ExplainInfoPanel.tsx +135 -0
  31. package/apps/explorer/src/ui/ExplainPointer.tsx +73 -0
  32. package/apps/explorer/src/ui/EyeIcon.tsx +38 -1
  33. package/apps/explorer/src/ui/HUD.tsx +1067 -795
  34. package/apps/explorer/src/ui/NameInput.tsx +114 -5
  35. package/apps/explorer/src/userContext.ts +0 -11
  36. package/apps/explorer/src/userCreated.ts +54 -1
  37. package/apps/explorer/vite.config.ts +173 -26
  38. package/bin/inbase.mjs +11 -2
  39. package/bin/project.mjs +6 -4
  40. package/bin/session.mjs +287 -38
  41. package/package.json +4 -1
  42. package/skill/commands/amber.md +23 -0
  43. package/skill/commands/blue.md +13 -0
  44. package/skill/commands/coral.md +23 -0
  45. package/skill/commands/explain.md +77 -0
  46. package/skill/commands/green.md +23 -0
  47. package/skill/commands/inbase.md +7 -5
  48. package/skill/commands/lime.md +23 -0
  49. package/skill/commands/orange.md +23 -0
  50. package/skill/commands/purple.md +23 -0
  51. package/skill/commands/red.md +23 -0
  52. package/skill/commands/skipinbase.md +1 -1
  53. package/skill/commands/violet.md +23 -0
  54. package/skill/commands/yellow.md +23 -0
  55. package/skill/inbase/SKILL.md +124 -76
  56. package/apps/explorer/src/scene/BlockPlacer.tsx +0 -78
  57. package/apps/explorer/src/scene/IslandPlacer.tsx +0 -31
  58. package/apps/explorer/src/scene/SelectionThumbnail.tsx +0 -1069
@@ -0,0 +1,73 @@
1
+ import { useLayoutEffect, useState } from 'react'
2
+
3
+ type Arrow = {
4
+ d: string
5
+ head: string
6
+ }
7
+
8
+ function measureArrow(): Arrow | null {
9
+ const from = document.querySelector('[data-explain-pointer-origin]')
10
+ const to = document.querySelector('[data-explain-target="true"]')
11
+ if (!(from instanceof HTMLElement) || !(to instanceof HTMLElement)) return null
12
+ const start = from.getBoundingClientRect()
13
+ const end = to.getBoundingClientRect()
14
+ if (start.width === 0 || end.width === 0) return null
15
+ const x1 = start.right
16
+ const y1 = start.top + start.height / 2
17
+ const x2 = end.left - 2
18
+ const y2 = end.top + end.height / 2
19
+ const span = Math.max(72, Math.abs(x2 - x1) * 0.42)
20
+ const c1x = x1 + span
21
+ const c1y = y1
22
+ const c2x = x2 - span
23
+ const c2y = y2
24
+ const angle = Math.atan2(y2 - c2y, x2 - c2x)
25
+ const size = 11
26
+ const hx = x2
27
+ const hy = y2
28
+ const left = [
29
+ hx - size * Math.cos(angle - 0.42),
30
+ hy - size * Math.sin(angle - 0.42),
31
+ ]
32
+ const right = [
33
+ hx - size * Math.cos(angle + 0.42),
34
+ hy - size * Math.sin(angle + 0.42),
35
+ ]
36
+ return {
37
+ d: `M ${x1} ${y1} C ${c1x} ${c1y}, ${c2x} ${c2y}, ${x2} ${y2}`,
38
+ head: `M ${hx} ${hy} L ${left[0]} ${left[1]} L ${right[0]} ${right[1]} Z`,
39
+ }
40
+ }
41
+
42
+ export function ExplainPointer({ stepKey }: { stepKey: string }) {
43
+ const [arrow, setArrow] = useState<Arrow | null>(null)
44
+
45
+ useLayoutEffect(() => {
46
+ let frame = 0
47
+ const tick = () => {
48
+ const next = measureArrow()
49
+ setArrow((current) => {
50
+ if (current?.d === next?.d && current?.head === next?.head) return current
51
+ return next
52
+ })
53
+ frame = window.requestAnimationFrame(tick)
54
+ }
55
+ frame = window.requestAnimationFrame(tick)
56
+ return () => window.cancelAnimationFrame(frame)
57
+ }, [stepKey])
58
+
59
+ if (!arrow) return null
60
+
61
+ return (
62
+ <svg
63
+ className="explain-pointer"
64
+ aria-hidden="true"
65
+ width="100%"
66
+ height="100%"
67
+ >
68
+ <path className="explain-pointer-glow" d={arrow.d} fill="none" />
69
+ <path className="explain-pointer-line" d={arrow.d} fill="none" />
70
+ <path className="explain-pointer-head" d={arrow.head} />
71
+ </svg>
72
+ )
73
+ }
@@ -1,3 +1,10 @@
1
+ export const EYE_ICON_PATH =
2
+ 'M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z'
3
+
4
+ export function eyeIconMarkup(size = 14) {
5
+ return `<svg viewBox="0 0 24 24" width="${size}" height="${size}" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${EYE_ICON_PATH}"/><circle cx="12" cy="12" r="3"/></svg>`
6
+ }
7
+
1
8
  export function EyeIcon({
2
9
  size = 18,
3
10
  title,
@@ -19,8 +26,38 @@ export function EyeIcon({
19
26
  role={title ? 'img' : undefined}
20
27
  >
21
28
  {title ? <title>{title}</title> : null}
22
- <path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" />
29
+ <path d={EYE_ICON_PATH} />
23
30
  <circle cx="12" cy="12" r="3" />
24
31
  </svg>
25
32
  )
26
33
  }
34
+
35
+ export function BlueprintEyes({
36
+ colors,
37
+ mapMode,
38
+ size = 18,
39
+ }: {
40
+ colors: string[]
41
+ mapMode?: boolean
42
+ size?: number
43
+ }) {
44
+ if (colors.length === 0) return null
45
+ return (
46
+ <div
47
+ className={colors.length > 1 ? 'blueprint-eye-row' : undefined}
48
+ role="img"
49
+ aria-label="Keep in mind"
50
+ >
51
+ {colors.map((hex, index) => (
52
+ <div
53
+ className="blueprint-eye"
54
+ data-map={mapMode ? 'true' : 'false'}
55
+ key={`${hex}-${index}`}
56
+ style={{ color: hex }}
57
+ >
58
+ <EyeIcon size={size} title={index === 0 ? 'Keep in mind' : undefined} />
59
+ </div>
60
+ ))}
61
+ </div>
62
+ )
63
+ }