Skip to content

Commit 417ae20

Browse files
authored
v0.8.2: rabbitmq, code hygiene, new kb connectors
2 parents 5e998fc + 96f7b23 commit 417ae20

723 files changed

Lines changed: 62142 additions & 8487 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/desktop/src/main/browser-agent/driver.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import type { BrowserDownloadsState, BrowserToolbarCommand } from '@sim/desktop-
2929
import { createLogger } from '@sim/logger'
3030
import { getErrorMessage } from '@sim/utils/errors'
3131
import { sleep } from '@sim/utils/helpers'
32-
import { isRecordLike, omit } from '@sim/utils/object'
32+
import { isRecordLike, omit, toRecord } from '@sim/utils/object'
3333
import type { BrowserWindow, MenuItemConstructorOptions, WebContents, WebFrameMain } from 'electron'
3434
import { Menu } from 'electron'
3535
import * as cdp from '@/main/browser-agent/cdp'
@@ -1015,7 +1015,7 @@ function raceAgainstWatchdog<T>(
10151015
*/
10161016
async function activeElementState(target: PageExecutionTarget): Promise<Record<string, unknown>> {
10171017
const state = await execInPage(target, readActiveElementState, []).catch(() => null)
1018-
return isRecordLike(state) ? state : {}
1018+
return toRecord(state)
10191019
}
10201020

10211021
function requireSnapshotForElementAction(): void {
@@ -1191,7 +1191,7 @@ async function pageActionState(
11911191
resetMutationRevision,
11921192
elementId,
11931193
]).catch(() => null)
1194-
return isRecordLike(state) ? state : {}
1194+
return toRecord(state)
11951195
}
11961196

11971197
function pageEffect(
@@ -2565,7 +2565,7 @@ async function executeToolInner(
25652565
},
25662566
}
25672567
return {
2568-
...(isRecordLike(fallback) ? fallback : {}),
2568+
...fallback,
25692569
trusted,
25702570
...state,
25712571
...combinedObservation,
@@ -2849,12 +2849,11 @@ async function executeToolInner(
28492849
await sleep(50)
28502850
const state = unwrapPageResult(await execInPage(target, readSelectElementState, [elementId]))
28512851
const effectObserved =
2852-
isRecordLike(selected) &&
28532852
isRecordLike(state) &&
28542853
selected.selected === state.selected &&
28552854
selected.value === state.value
28562855
return {
2857-
...(isRecordLike(selected) ? selected : {}),
2856+
...selected,
28582857
effectObserved,
28592858
readback: state,
28602859
...(!effectObserved
@@ -2994,7 +2993,7 @@ async function executeToolInner(
29942993
: {}),
29952994
}
29962995
return {
2997-
...(isRecordLike(result) ? result : {}),
2996+
...result,
29982997
trusted,
29992998
effect,
30002999
possibleEffectObserved,

apps/desktop/src/main/browser-import/browser-sources.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,6 @@ export function userDataDirFor(source: BrowserSource, home: string = homedir()):
7777
return join(home, ...source.userDataSegments)
7878
}
7979

80-
/**
81-
* Splits a bridge profile id back into its browser and profile directory.
82-
*
83-
* Ids are namespaced (`arc:Profile 1`) because profile directory names repeat
84-
* across browsers — every one of them has a `Default`. Returns null for
85-
* anything malformed; the caller then resolves against discovered profiles
86-
* anyway, so a bad id can never become a path.
87-
*/
88-
export function parseProfileId(profileId: string): { sourceId: string; directory: string } | null {
89-
const separator = profileId.indexOf(':')
90-
if (separator <= 0 || separator === profileId.length - 1) return null
91-
return {
92-
sourceId: profileId.slice(0, separator),
93-
directory: profileId.slice(separator + 1),
94-
}
95-
}
96-
9780
export function formatProfileId(sourceId: string, directory: string): string {
9881
return `${sourceId}:${directory}`
9982
}

apps/desktop/src/main/browser-import/chromium-profiles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { constants } from 'node:fs'
22
import { access, lstat, readdir, readFile, realpath } from 'node:fs/promises'
33
import { homedir } from 'node:os'
44
import { join } from 'node:path'
5+
import { isRecordLike } from '@sim/utils/object'
56
import {
67
BROWSER_SOURCES,
78
type BrowserSource,
@@ -134,7 +135,7 @@ async function readProfileDisplayNames(userDataDir: string): Promise<Map<string,
134135
const raw = await readFile(join(userDataDir, 'Local State'), 'utf8')
135136
const infoCache = (JSON.parse(raw) as { profile?: { info_cache?: unknown } }).profile
136137
?.info_cache
137-
if (infoCache && typeof infoCache === 'object' && !Array.isArray(infoCache)) {
138+
if (isRecordLike(infoCache)) {
138139
for (const [dir, info] of Object.entries(infoCache as Record<string, unknown>)) {
139140
if (!PROFILE_DIR_PATTERN.test(dir)) continue
140141
const name = (info as { name?: unknown })?.name

apps/desktop/src/main/terminal/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
type TerminalToolResponse,
3333
} from '@sim/terminal-protocol'
3434
import { sleep } from '@sim/utils/helpers'
35-
import { isRecordLike } from '@sim/utils/object'
3635
import type { BrowserWindow, WebContents } from 'electron'
3736
import {
3837
type FocusedResourceShortcut,
@@ -1201,8 +1200,3 @@ export class TerminalService {
12011200
function unknownTerminal(terminalId: string): string {
12021201
return `No terminal with id ${terminalId}. Call terminal_list for the open ones.`
12031202
}
1204-
1205-
/** Narrows an IPC payload to the tool-call shape without trusting the sender. */
1206-
export function parseToolParams(value: unknown): Record<string, unknown> {
1207-
return isRecordLike(value) ? value : {}
1208-
}

apps/docs/components/icons.tsx

Lines changed: 148 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,6 +3898,138 @@ export const ClaudeIcon = (props: SVGProps<SVGSVGElement>) => (
38983898
</svg>
38993899
)
39003900

3901+
export function AzureDataExplorerIcon(props: SVGProps<SVGSVGElement>) {
3902+
const id = useId()
3903+
const wedgeGradient = `adx_wedge_${id}`
3904+
const dashLongGradient = `adx_dash_long_${id}`
3905+
const dashTopGradient = `adx_dash_top_${id}`
3906+
const dashBottomGradient = `adx_dash_bottom_${id}`
3907+
3908+
return (
3909+
<svg
3910+
{...props}
3911+
width='18'
3912+
height='18'
3913+
viewBox='0 0 18 18'
3914+
fill='none'
3915+
xmlns='http://www.w3.org/2000/svg'
3916+
>
3917+
<path
3918+
d='M1.47,1.47,16.53,16.53a.57.57,0,0,0,1-.4V1.07A.57.57,0,0,0,16.93.5H1.87A.57.57,0,0,0,1.47,1.47Z'
3919+
fill={`url(#${wedgeGradient})`}
3920+
/>
3921+
<path d='M5.53,5.53l6.94,6.94,5-5V1.07A.57.57,0,0,0,16.93.5H10.56Z' fill='#50e6ff' />
3922+
<rect
3923+
x='-0.38'
3924+
y='12.85'
3925+
width='9.37'
3926+
height='1.7'
3927+
rx='0.27'
3928+
transform='translate(-8.43 7.06) rotate(-45)'
3929+
fill={`url(#${dashLongGradient})`}
3930+
/>
3931+
<rect
3932+
x='0.12'
3933+
y='9.23'
3934+
width='5.99'
3935+
height='1.7'
3936+
rx='0.27'
3937+
transform='translate(-6.22 5.15) rotate(-45)'
3938+
fill={`url(#${dashTopGradient})`}
3939+
/>
3940+
<rect
3941+
x='4.89'
3942+
y='14.04'
3943+
width='5.99'
3944+
height='1.7'
3945+
rx='0.27'
3946+
transform='translate(-8.22 9.93) rotate(-45)'
3947+
fill={`url(#${dashBottomGradient})`}
3948+
/>
3949+
<rect
3950+
x='9.19'
3951+
y='4.75'
3952+
width='1.7'
3953+
height='1.7'
3954+
rx='0.38'
3955+
transform='translate(-1.02 8.74) rotate(-45)'
3956+
fill='#fff'
3957+
/>
3958+
<rect
3959+
x='11.59'
3960+
y='2.35'
3961+
width='1.7'
3962+
height='1.7'
3963+
rx='0.38'
3964+
transform='translate(1.38 9.73) rotate(-45)'
3965+
fill='#fff'
3966+
/>
3967+
<rect
3968+
x='11.59'
3969+
y='7.15'
3970+
width='1.7'
3971+
height='1.7'
3972+
rx='0.38'
3973+
transform='translate(-2.01 11.14) rotate(-45)'
3974+
fill='#fff'
3975+
/>
3976+
<path
3977+
d='M13.91,5.33l.66-.66a.38.38,0,0,1,.54,0l.66.66a.38.38,0,0,1,0,.54l-.66.66a.38.38,0,0,1-.54,0l-.66-.66a.38.38,0,0,1,0-.54'
3978+
fill='#fff'
3979+
/>
3980+
<defs>
3981+
<linearGradient
3982+
id={wedgeGradient}
3983+
x1='1.3'
3984+
y1='8.6'
3985+
x2='17.5'
3986+
y2='8.6'
3987+
gradientUnits='userSpaceOnUse'
3988+
>
3989+
<stop offset='0.1' stopColor='#54aef0' />
3990+
<stop offset='1' stopColor='#1988d9' />
3991+
</linearGradient>
3992+
<linearGradient
3993+
id={dashLongGradient}
3994+
x1='0.5'
3995+
y1='13.7'
3996+
x2='8.11'
3997+
y2='13.7'
3998+
gradientTransform='translate(10.95 0.97) rotate(45)'
3999+
gradientUnits='userSpaceOnUse'
4000+
>
4001+
<stop offset='0' stopColor='#b3b2b3' />
4002+
<stop offset='1' stopColor='#979797' />
4003+
</linearGradient>
4004+
<linearGradient
4005+
id={dashTopGradient}
4006+
x1='0.5'
4007+
y1='10.08'
4008+
x2='5.72'
4009+
y2='10.08'
4010+
gradientTransform='translate(8.04 0.75) rotate(45)'
4011+
gradientUnits='userSpaceOnUse'
4012+
>
4013+
<stop offset='0' stopColor='#b3b2b3' />
4014+
<stop offset='1' stopColor='#979797' />
4015+
</linearGradient>
4016+
<linearGradient
4017+
id={dashBottomGradient}
4018+
x1='5.28'
4019+
y1='14.89'
4020+
x2='10.49'
4021+
y2='14.89'
4022+
gradientTransform='translate(12.84 -1.21) rotate(45)'
4023+
gradientUnits='userSpaceOnUse'
4024+
>
4025+
<stop offset='0' stopColor='#b3b2b3' />
4026+
<stop offset='1' stopColor='#979797' />
4027+
</linearGradient>
4028+
</defs>
4029+
</svg>
4030+
)
4031+
}
4032+
39014033
export function AzureIcon(props: SVGProps<SVGSVGElement>) {
39024034
const id = useId()
39034035
const gradient0 = `azure_paint0_${id}`
@@ -7406,26 +7538,6 @@ export function BedrockIcon(props: SVGProps<SVGSVGElement>) {
74067538
)
74077539
}
74087540

7409-
export function TableIcon(props: SVGProps<SVGSVGElement>) {
7410-
return (
7411-
<svg
7412-
xmlns='http://www.w3.org/2000/svg'
7413-
viewBox='0 0 24 24'
7414-
fill='none'
7415-
stroke='currentColor'
7416-
strokeWidth={2}
7417-
strokeLinecap='round'
7418-
strokeLinejoin='round'
7419-
{...props}
7420-
>
7421-
<rect width='18' height='18' x='3' y='3' rx='2' />
7422-
<path d='M3 9h18' />
7423-
<path d='M3 15h18' />
7424-
<path d='M9 3v18' />
7425-
<path d='M15 3v18' />
7426-
</svg>
7427-
)
7428-
}
74297541
export function ReductoIcon(props: SVGProps<SVGSVGElement>) {
74307542
return (
74317543
<svg
@@ -8578,6 +8690,22 @@ export function HexIcon(props: SVGProps<SVGSVGElement>) {
85788690
)
85798691
}
85808692

8693+
export function RabbitmqIcon(props: SVGProps<SVGSVGElement>) {
8694+
return (
8695+
<svg
8696+
{...props}
8697+
viewBox='-7.5 0 271 271'
8698+
preserveAspectRatio='xMidYMid'
8699+
xmlns='http://www.w3.org/2000/svg'
8700+
>
8701+
<path
8702+
d='M245.44 108.308h-85.09a7.738 7.738 0 0 1-7.735-7.734v-88.68C152.615 5.327 147.29 0 140.726 0h-30.375c-6.568 0-11.89 5.327-11.89 11.894v88.143c0 4.573-3.697 8.29-8.27 8.31l-27.885.133c-4.612.025-8.359-3.717-8.35-8.325l.173-88.241C54.144 5.337 48.817 0 42.24 0H11.89C5.321 0 0 5.327 0 11.894V260.21c0 5.834 4.726 10.56 10.555 10.56H245.44c5.834 0 10.56-4.726 10.56-10.56V118.868c0-5.834-4.726-10.56-10.56-10.56zm-39.902 93.233c0 7.645-6.198 13.844-13.843 13.844H167.69c-7.646 0-13.844-6.199-13.844-13.844v-24.005c0-7.646 6.198-13.844 13.844-13.844h24.005c7.645 0 13.843 6.198 13.843 13.844v24.005z'
8703+
fill='#F60'
8704+
/>
8705+
</svg>
8706+
)
8707+
}
8708+
85818709
export function RailwayIcon(props: SVGProps<SVGSVGElement>) {
85828710
return (
85838711
<svg {...props} xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 24 24'>

apps/docs/components/ui/icon-mapping.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Maps block types to their icon component references
44

55
import type { ComponentType, SVGProps } from 'react'
6-
import { Library, Rocket } from '@sim/emcn/icons'
6+
import { Library, Rocket, Table } from '@sim/emcn/icons'
77
import {
88
A2AIcon,
99
AgentMailIcon,
@@ -22,6 +22,7 @@ import {
2222
AshbyIcon,
2323
AthenaIcon,
2424
AttioIcon,
25+
AzureDataExplorerIcon,
2526
AzureIcon,
2627
BoxCompanyIcon,
2728
BrainIcon,
@@ -182,6 +183,7 @@ import {
182183
QdrantIcon,
183184
QuartrIcon,
184185
QuiverIcon,
186+
RabbitmqIcon,
185187
RailwayIcon,
186188
RB2BIcon,
187189
RDSIcon,
@@ -223,7 +225,6 @@ import {
223225
StagehandIcon,
224226
StripeIcon,
225227
SupabaseIcon,
226-
TableIcon,
227228
TailscaleIcon,
228229
TavilyIcon,
229230
TelegramIcon,
@@ -280,6 +281,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
280281
ashby: AshbyIcon,
281282
athena: AthenaIcon,
282283
attio: AttioIcon,
284+
azure_data_explorer: AzureDataExplorerIcon,
283285
azure_devops: AzureIcon,
284286
box: BoxCompanyIcon,
285287
brandfetch: BrandfetchIcon,
@@ -469,6 +471,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
469471
qdrant: QdrantIcon,
470472
quartr: QuartrIcon,
471473
quiver: QuiverIcon,
474+
rabbitmq: RabbitmqIcon,
472475
railway: RailwayIcon,
473476
rb2b: RB2BIcon,
474477
rds: RDSIcon,
@@ -514,7 +517,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
514517
stt: STTIcon,
515518
stt_v2: STTIcon,
516519
supabase: SupabaseIcon,
517-
table: TableIcon,
520+
table: Table,
518521
tailscale: TailscaleIcon,
519522
tavily: TavilyIcon,
520523
telegram: TelegramIcon,

0 commit comments

Comments
 (0)