sang-ai-kit 0.1.1 → 0.2.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.
Files changed (43) hide show
  1. package/README.md +9 -8
  2. package/generated/sang-ai-utilities.css +120 -1
  3. package/package.json +3 -1
  4. package/src/AiAssistant.tsx +20 -33
  5. package/src/AiSettings.tsx +6 -3
  6. package/src/ModelControls.tsx +3 -11
  7. package/src/SessionList.tsx +4 -1
  8. package/src/SkillSettings.tsx +4 -2
  9. package/src/TokenUsageBar.tsx +4 -1
  10. package/src/assistant.css +2125 -1712
  11. package/src/assistantTypes.ts +7 -2
  12. package/src/background-removal/BackgroundRemovalSettings.tsx +502 -0
  13. package/src/background-removal/ColorMattingEditor.tsx +649 -0
  14. package/src/background-removal/background-removal.css +294 -0
  15. package/src/background-removal/color-matting.css +838 -0
  16. package/src/background-removal/colorMatting.ts +117 -0
  17. package/src/background-removal/colorMatting.worker.ts +21 -0
  18. package/src/background-removal/index.ts +92 -0
  19. package/src/background-removal/inference.worker.ts +117 -0
  20. package/src/background-removal/models.ts +65 -0
  21. package/src/background-removal/processing.ts +61 -0
  22. package/src/background-removal/resources.ts +114 -0
  23. package/src/background-removal/status.ts +23 -0
  24. package/src/background-removal/storage.ts +56 -0
  25. package/src/background-removal/tool.ts +70 -0
  26. package/src/background-removal/types.ts +38 -0
  27. package/src/background-removal/useResources.ts +38 -0
  28. package/src/builtInToolDefinitions.ts +68 -0
  29. package/src/builtInTools.ts +66 -22
  30. package/src/bun-env.d.ts +25 -0
  31. package/src/conversationUtils.ts +71 -1
  32. package/src/endpointConnection.ts +2 -2
  33. package/src/features.ts +3 -1
  34. package/src/imageToolHost.ts +86 -0
  35. package/src/index.ts +15 -6
  36. package/src/modelConfig.ts +49 -7
  37. package/src/openai.ts +56 -30
  38. package/src/responses.ts +14 -0
  39. package/src/settingsTypes.ts +6 -8
  40. package/src/skills.ts +1 -1
  41. package/src/style.css +111 -67
  42. package/src/useAssistant.ts +5 -38
  43. package/src/useResolvedTheme.ts +2 -1
@@ -1,6 +1,7 @@
1
- import { useState, useRef, useEffect, useLayoutEffect, type CSSProperties } from 'react';
1
+ import { useState, useRef, useEffect, useLayoutEffect, useContext, type CSSProperties } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
3
  import type { TokenUsage } from './assistantTypes';
4
+ import { ResolvedThemeContext } from './useResolvedTheme';
4
5
  import { Activity, Layers, MessageSquare, Terminal, Zap, Clock, ShieldCheck, AlertTriangle, AlertOctagon } from 'lucide-react';
5
6
 
6
7
  export interface UsageSummary {
@@ -22,6 +23,7 @@ interface Props {
22
23
  }
23
24
 
24
25
  export default function TokenUsageBar({ usage, model, busy, english }: Props) {
26
+ const resolvedTheme = useContext(ResolvedThemeContext);
25
27
  const [open, setOpen] = useState(false);
26
28
  const [activeTab, setActiveTab] = useState<'turn' | 'total'>('turn');
27
29
  const containerRef = useRef<HTMLDivElement>(null);
@@ -186,6 +188,7 @@ export default function TokenUsageBar({ usage, model, busy, english }: Props) {
186
188
  <div
187
189
  ref={popoverRef}
188
190
  className="sang-ai-portal fixed z-[100] w-[330px] max-w-[calc(100vw-24px)] overflow-y-auto pointer-events-auto"
191
+ data-theme={resolvedTheme}
189
192
  style={popoverPosition}
190
193
  onMouseEnter={handleMouseEnter}
191
194
  onMouseLeave={handleMouseLeave}