Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: resolve all CI typecheck and build errors

Gener1540c4b9d1e3
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 684d32210..1d4d49c24 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -77,6 +77,9 @@ importers:
specifier: ^3.24
version: 3.25.76
devDependencies:
+ '@cloudflare/workers-types':
+ specifier: latest
+ version: 4.20260410.1
'@types/node':
specifier: latest
version: 25.6.0
diff --git a/src/shared/package.json b/src/shared/package.json
index 588ab79aa..0aac89bd4 100644
--- a/src/shared/package.json
+++ b/src/shared/package.json
@@ -9,5 +9,5 @@
"zod": "^3.24",
"nanoid": "^5.1.7"
},
- "devDependencies": { "typescript": "latest", "vitest": "^4.1.3", "@types/node": "latest" }
+ "devDependencies": { "@cloudflare/workers-types": "latest", "typescript": "latest", "vitest": "^4.1.3", "@types/node": "latest" }
}
diff --git a/src/shared/src/index.ts b/src/shared/src/index.ts
index 1525f8d3b..743d398f0 100644
--- a/src/shared/src/index.ts
+++ b/src/shared/src/index.ts
@@ -12,6 +12,7 @@ export type {
MachineToken,
LoginResponse,
CreateAgentRequest,
+ WsMessage,
} from "./types";
// API types
diff --git a/src/shared/src/types.ts b/src/shared/src/types.ts
index f7640fd7e..d96220db0 100644
--- a/src/shared/src/types.ts
+++ b/src/shared/src/types.ts
@@ -50,6 +50,7 @@ export interface Conversation {
agent_id: string;
title: string;
created_at: string;
+ message_count?: number;
}
export interface Message {
@@ -119,3 +120,9 @@ export interface CreateAgentRequest {
runtime_config?: Record<string, unknown>;
max_concurrent_tasks?: number;
}
+
+/** Generic WebSocket message envelope used by broadcast and WS hooks. */
+export interface WsMessage {
+ type: string;
+ [key: string]: unknown;
+}
diff --git a/src/shared/tsconfig.json b/src/shared/tsconfig.json
index 776e1ef3b..0a0e7b84b 100644
--- a/src/shared/tsconfig.json
+++ b/src/shared/tsconfig.json
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "ES2022", "module": "ESNext", "moduleResolution": "bundler",
- "declaration": true, "outDir": "./dist", "rootDir": "./src", "strict": true
+ "declaration": true, "outDir": "./dist", "rootDir": "./src", "strict": true, "skipLibCheck": true,
+ "types": ["@cloudflare/workers-types"]
},
"include": ["src"]
}
diff --git a/src/shared/types.ts b/src/shared/types.ts
index f7640fd7e..a23c16ae7 100644
--- a/src/shared/types.ts
+++ b/src/shared/types.ts
@@ -50,6 +50,7 @@ export interface Conversation {
agent_id: string;
title: string;
created_at: string;
+ message_count?: number;
}
export interface Message {
diff --git a/src/web/src/app/(app)/chat/[id]/page.tsx b/src/web/src/app/(app)/chat/[id]/page.tsx
index b5a12c472..464cad3fa 100644
--- a/src/web/src/app/(app)/chat/[id]/page.tsx
+++ b/src/web/src/app/(app)/chat/[id]/page.tsx
@@ -157,6 +157,7 @@ export default function ChatPage() {
conversation_id: conversationId,
role: "user",
content,
+ task_id: null,
created_at: new Date().toISOString(),
};
setMessages((prev) => [...prev, optimistic]);
diff --git a/src/web/src/app/(app)/runtimes/page.tsx b/src/web/src/app/(app)/runtimes/page.tsx
index bcbf015a9..7275268f9 100644
--- a/src/web/src/app/(app)/runtimes/page.tsx
+++ b/src/web/src/app/(app)/runtimes/page.tsx
@@ -297,9 +297,9 @@ export default function RuntimesPage() {
) : null}
</p>
<p className="text-xs text-muted-foreground tabular-nums">
- {new Date(
+ {runtime.last_seen_at ? new Date(
runtime.last_seen_at
- ).toLocaleString()}
+ ).toLocaleString() : "Never"}
</p>
</div>
<Badge
diff --git a/src/web/src/app/(auth)/sign-in/page.tsx b/src/web/src/app/(auth)/sign-in/page.tsx
index 4a4036157..fee11a64b 100644
--- a/src/web/src/app/(auth)/sign-in/page.tsx
+++ b/src/web/src/app/(auth)/sign-in/page.tsx
@@ -30,7 +30,7 @@ export default function SignInPage() {
{ onError: (ctx) => setError(ctx.error.message) },
)
if (error) {
- setError(error.message)
+ setError(error.message ?? "")
} else {
window.location.href = "/home"
return
diff --git a/src/web/src/app/(auth)/sign-up/page.tsx b/src/web/src/app/(auth)/sign-up/page.tsx
index 8181ca752..aa9a581f8 100644
--- a/src/web/src/app/(auth)/sign-up/page.tsx
+++ b/src/web/src/app/(auth)/sign-up/page.tsx
@@ -29,7 +29,7 @@ export default function SignUpPage() {
{ onError: (ctx) => setError(ctx.error.message) },
)
if (error) {
- setError(error.message)
+ setError(error.message ?? "")
} else {
window.location.href = "/home"
return
diff --git a/src/web/src/app/api/machine-tokens/route.ts b/src/web/src/app/api/machine-tokens/route.ts
index d956e3341..8b594951f 100644
--- a/src/web/src/app/api/machine-tokens/route.ts
+++ b/src/web/src/app/api/machine-tokens/route.ts
@@ -27,7 +27,7 @@ export const POST = withAuth(async (req: NextRequest, ctx) => {
let name = "default";
try {
- const body = await req.json();
+ const body = (await req.json()) as { name?: string };
if (body.name && typeof body.name === "string" && body.name.trim()) {
name = body.name.trim();
}
diff --git a/src/web/src/components/dashboard-navbar.tsx b/src/web/src/components/dashboard-navbar.tsx
index ce93f90df..70e2cb4a6 100644
--- a/src/web/src/components/dashboard-navbar.tsx
+++ b/src/web/src/components/dashboard-navbar.tsx
@@ -333,9 +333,9 @@ export function DashboardNavbar() {
</div>
<p className="text-[11px] text-muted-foreground tabular-nums">
Last seen{" "}
- {new Date(
+ {runtime.last_seen_at ? new Date(
runtime.last_seen_at
- ).toLocaleString()}
+ ).toLocaleString() : "Never"}
</p>
</div>
))}
diff --git a/src/web/src/lib/api.ts b/src/web/src/lib/api.ts
index b5b285fd9..171335450 100644
--- a/src/web/src/lib/api.ts
+++ b/src/web/src/lib/api.ts
@@ -55,7 +55,7 @@ async function apiFetch<T>(path: string, options?: RequestInit): Promise<T> {
let serverError: string | undefined;
let details: string[] | undefined;
try {
- const body = await res.json();
+ const body = (await res.json()) as { error?: string; details?: string[] };
serverError = body.error;
details = body.details;
} catch {
diff --git a/src/web/tsconfig.json b/src/web/tsconfig.json
index 0c734d6e1..8f08646da 100644
--- a/src/web/tsconfig.json
+++ b/src/web/tsconfig.json
@@ -27,5 +27,5 @@
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
- "exclude": ["node_modules"]
+ "exclude": ["node_modules", "**/*.test.ts"]
}