Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

shell-tool.test.ts

32 lines907 Bytes

1import { describe, expect, it } from 'vitest'
2import {
3 convertShellToolToAdapterFormat,
4 shellTool,
5} from '../src/tools/shell-tool'
6​
7describe('shellTool', () => {
8 it('defaults to a bare shell tool with no environment', () => {
9 const tool = shellTool()
10 expect(convertShellToolToAdapterFormat(tool)).toEqual({ type: 'shell' })
11 })
12​
13 it('passes a container_auto environment with skill references through the converter', () => {
14 const tool = shellTool({
15 environment: {
16 type: 'container_auto',
17 skills: [
18 { type: 'skill_reference', skill_id: 'skill_abc', version: '2' },
19 ],
20 },
21 })
22 expect(convertShellToolToAdapterFormat(tool)).toEqual({
23 type: 'shell',
24 environment: {
25 type: 'container_auto',
26 skills: [
27 { type: 'skill_reference', skill_id: 'skill_abc', version: '2' },
28 ],
29 },
30 })
31 })
32})