fix(coding-agent,tui): drop typebox compiler shim and fix progress

This commit is contained in:
Mario Zechner
2026-04-22 21:12:20 +02:00
parent 35ff2689ee
commit 3dacaa8ed9
18 changed files with 130 additions and 60 deletions

View File

@@ -646,7 +646,7 @@ Mom runs bash commands inside a sandbox (Docker container), but sometimes you ne
```typescript
// data/tools/gmail/index.ts
import type { MomCustomTool, ToolAPI } from "@mariozechner/pi-mom";
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
const tool: MomCustomTool = {
@@ -691,7 +691,7 @@ export default tool;
### MomCustomTool Type
```typescript
import type { TSchema, Static } from "@sinclair/typebox";
import type { TSchema, Static } from "typebox";
export interface MomToolResult<TDetails = any> {
content: Array<{ type: "text"; text: string } | { type: "image"; data: string; mimeType: string }>;
@@ -798,7 +798,7 @@ async function loadCustomTools(dataDir: string): Promise<LoadedTool[]> {
Mom has a single `invoke_tool` tool that dispatches to custom tools:
```typescript
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
function createInvokeToolTool(loadedTools: LoadedTool[]): AgentTool {
const toolMap = new Map(loadedTools.map(t => [t.tool.name, t.tool]));
@@ -889,7 +889,7 @@ function schemaToSimpleJson(schema: TSchema): object {
```typescript
// data/tools/gmail/index.ts
import type { MomCustomTool, ToolAPI } from "@mariozechner/pi-mom";
import { Type } from "@sinclair/typebox";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import Imap from "imap";
import nodemailer from "nodemailer";