Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.13/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
168 changes: 123 additions & 45 deletions bun.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,27 @@
},
"devDependencies": {
"@axe-core/playwright": "^4.11.3",
"@biomejs/biome": "^2.4.13",
"@biomejs/biome": "^2.4.15",
"@playwright/test": "^1.59.1",
"@types/bun": "^1.3.13",
"@types/node": "^25.6.0",
"@types/node": "^25.6.2",
"typescript": "~5.9.3"
},
"dependencies": {
"@algorandfoundation/algokit-utils": "^9.2.0",
"@anthropic-ai/claude-agent-sdk": "0.2.126",
"@anthropic-ai/sdk": "^0.93.0",
"@anthropic-ai/claude-agent-sdk": "0.2.138",
"@anthropic-ai/sdk": "^0.95.1",
"@discordjs/builders": "^1.9.0",
"@discordjs/rest": "^2.4.0",
"@discordjs/voice": "^0.19.2",
"@modelcontextprotocol/sdk": "^1.29.0",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/auto-instrumentations-node": "^0.74.0",
"@opentelemetry/exporter-prometheus": "^0.216.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.216.0",
"@opentelemetry/exporter-prometheus": "^0.217.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.217.0",
"@opentelemetry/resources": "^2.7.1",
"@opentelemetry/sdk-metrics": "^2.7.1",
"@opentelemetry/sdk-node": "^0.216.0",
"@opentelemetry/sdk-node": "^0.217.0",
"@opentelemetry/sdk-trace-node": "^2.7.1",
"@opentelemetry/semantic-conventions": "^1.40.0",
"@vscode/tree-sitter-wasm": "0.3.1",
Expand All @@ -109,7 +109,7 @@
"express-rate-limit": ">=8.2.2",
"path-to-regexp": ">=8.4.0",
"protobufjs": ">=7.5.5",
"@anthropic-ai/sdk": ">=0.88.0",
"@anthropic-ai/sdk": ">=0.95.1",
"ip-address": ">=10.1.1"
}
}
3 changes: 2 additions & 1 deletion server/__tests__/discord-rest-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ describe('DiscordRestClient methods', () => {
expect(calls).toHaveLength(1);
expect(calls[0].method).toBe('get');
expect(calls[0].route).toContain('guild-1');
expect(calls[0].route).toContain('with_counts=true');
const opts = calls[0].options as { query?: URLSearchParams };
expect(opts?.query?.get('with_counts')).toBe('true');
});

test('throws on API error', async () => {
Expand Down
4 changes: 3 additions & 1 deletion server/algochat/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ export class AlgoChatBridge implements ChannelAdapter {

// Update the PSK manager lookup to check both networks
this.responseFormatter.setPskManagerLookup((address) => {
return this.contactManager.lookupPskManager(address) ?? this.localnetContactManager?.lookupPskManager(address) ?? null;
return (
this.contactManager.lookupPskManager(address) ?? this.localnetContactManager?.lookupPskManager(address) ?? null
);
});

log.info('Localnet PSK bridge added for dual-network operation');
Expand Down
17 changes: 10 additions & 7 deletions server/discord/embeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* REST client (rest-client.ts), which handles rate limiting automatically.
*/

import { MessageFlags, type RepliableInteraction } from 'discord.js';
import { type APIEmbed, MessageFlags, type RepliableInteraction } from 'discord.js';
import type { DeliveryTracker } from '../lib/delivery-tracker';
import { createLogger } from '../lib/logger';
import { splitMessage } from './message-formatter';
Expand Down Expand Up @@ -296,8 +296,10 @@ export async function respondToInteractionEmbed(
ephemeral = false,
): Promise<void> {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await interaction.reply({ embeds: [embed as any], ...(ephemeral && { flags: MessageFlags.Ephemeral }) });
await interaction.reply({
embeds: [embed as unknown as APIEmbed],
...(ephemeral && { flags: MessageFlags.Ephemeral }),
});
} catch (error) {
log.error('Failed to respond to Discord interaction with embed', {
error: error instanceof Error ? error.message : String(error),
Expand All @@ -311,8 +313,10 @@ export async function respondToInteractionEmbeds(
ephemeral = false,
): Promise<void> {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await interaction.reply({ embeds: embeds as any[], ...(ephemeral && { flags: MessageFlags.Ephemeral }) });
await interaction.reply({
embeds: embeds as unknown[] as APIEmbed[],
...(ephemeral && { flags: MessageFlags.Ephemeral }),
});
} catch (error) {
log.error('Failed to respond to Discord interaction with embeds', {
error: error instanceof Error ? error.message : String(error),
Expand Down Expand Up @@ -345,8 +349,7 @@ export async function editDeferredResponse(
try {
const body: Record<string, unknown> = {};
if (content) body.content = content.slice(0, MAX_MESSAGE_LENGTH);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (embeds) body.embeds = embeds as any[];
if (embeds) body.embeds = embeds as unknown[] as APIEmbed[];
await interaction.editReply(body);
} catch (error) {
log.error('Failed to edit deferred response', {
Expand Down
3 changes: 1 addition & 2 deletions server/discord/rest-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ export class DiscordRestClient {
try {
let result: unknown;
if (withCounts) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
result = await (this.rest.get as any)(`/guilds/${guildId}?with_counts=true`);
result = await this.rest.get(Routes.guild(guildId), { query: new URLSearchParams({ with_counts: 'true' }) });
} else {
result = await this.rest.get(Routes.guild(guildId));
}
Expand Down
6 changes: 5 additions & 1 deletion server/ws/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ export function createWebSocketHandler(
const label = typeof msg.label === 'string' ? msg.label.slice(0, MAX_LABEL_LENGTH) : 'unnamed';
const projectId = typeof msg.projectId === 'string' ? msg.projectId.slice(0, MAX_LABEL_LENGTH) : '';

const clientCaps = (msg.capabilities as BridgeCapabilities | undefined) ?? { read: true, write: false, exec: false };
const clientCaps = (msg.capabilities as BridgeCapabilities | undefined) ?? {
read: true,
write: false,
exec: false,
};
const effectiveCaps = service.intersectCapabilities(clientCaps);

data.authenticated = true;
Expand Down
Loading