index.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * `@mavis/agent-core/tools` —— tool protocol types, `defineRuntimeTool`, and
  3. * decorated-class `bindTool` / `toRuntimeTool` helpers.
  4. *
  5. * Usage:
  6. *
  7. * ```ts
  8. * import { defineRuntimeTool } from '@mavis/agent-core/tools';
  9. * import { Type } from '@sinclair/typebox';
  10. *
  11. * const CloudBashTool = defineRuntimeTool({
  12. * name: 'bash',
  13. * description: 'Execute a command in the cloud sandbox executor.',
  14. * schema: Type.Object({ command: Type.String() }),
  15. * async execute(ctx, input, signal) { ... },
  16. * });
  17. * ```
  18. */
  19. export type {
  20. ToolDefinition,
  21. ToolImpl,
  22. ToolResult,
  23. ToolResultContent,
  24. ToolExecutionContext,
  25. ToolExecutionMode,
  26. ToolOperationClassifier,
  27. RuntimeTool,
  28. RuntimeToolSource,
  29. ToolCallProvenanceResolutionInput,
  30. ToolCallProvenanceResolver,
  31. } from './types.js';
  32. export { defineRuntimeTool, type RuntimeToolDeclaration } from './define.js';
  33. export { bindTool, toRuntimeTool } from './bind.js';
  34. export { prepareEditArguments, type PreparedEditArguments } from './edit-prepare-arguments.js';
  35. export { isRuntimeToolInputValid } from './input-validation.js';
  36. export {
  37. ReadToolDef,
  38. WriteToolDef,
  39. EditToolDef,
  40. BashToolDef,
  41. GrepToolDef,
  42. GlobToolDef,
  43. TodoWriteToolDef,
  44. TaskToolDef,
  45. type ReadToolInput,
  46. type WriteToolInput,
  47. type EditToolInput,
  48. type BashToolInput,
  49. type GrepToolInput,
  50. type GlobToolInput,
  51. type TodoWriteToolInput,
  52. type TaskToolInput,
  53. } from './builtin-defs.js';