fix: lint errors and add /search docs
oops, forgot to document the /search command and had some lint issues: - removed unused imports - fixed template literal type issues - documented /search in slash-commands.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
0845b24e9d
commit
cab8dcf456
@ -61,7 +61,8 @@ Text + native (when enabled):
|
||||
- `/skill <name> [input]` (run a skill by name)
|
||||
- `/status` (show current status; includes provider usage/quota for the current model provider when available)
|
||||
- `/allowlist` (list/add/remove allowlist entries)
|
||||
- `/context [list|detail|json]` (explain “context”; `detail` shows per-file + per-tool + per-skill + system prompt size)
|
||||
- `/search <query> [--from <contact>] [--platform <name>] [--since <time>]` (search messages across platforms)
|
||||
- `/context [list|detail|json]` (explain "context"; `detail` shows per-file + per-tool + per-skill + system prompt size)
|
||||
- `/whoami` (show your sender id; alias: `/id`)
|
||||
- `/subagents list|stop|log|info|send` (inspect, stop, log, or message sub-agent runs for the current session)
|
||||
- `/config show|get|set|unset` (persist config to disk, owner-only; requires `commands.config: true`)
|
||||
|
||||
@ -2,7 +2,6 @@ import type { Command } from "commander";
|
||||
|
||||
import {
|
||||
autoLinkHighConfidence,
|
||||
ContactStore,
|
||||
findLinkSuggestions,
|
||||
getContactStore,
|
||||
linkContacts,
|
||||
|
||||
@ -5,7 +5,6 @@ import type { Platform } from "../contacts/types.js";
|
||||
import { danger } from "../globals.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { renderTable } from "../terminal/table.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
|
||||
function formatTimestamp(ts: number): string {
|
||||
|
||||
@ -272,11 +272,11 @@ export async function importSlackUsers(
|
||||
if (isNew) result.imported++;
|
||||
}
|
||||
} catch (err) {
|
||||
result.errors.push(`Failed to import user ${user.id}: ${err}`);
|
||||
result.errors.push(`Failed to import user ${user.id}: ${String(err)}`);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
result.errors.push(`Failed to list Slack users: ${err}`);
|
||||
result.errors.push(`Failed to list Slack users: ${String(err)}`);
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -327,11 +327,11 @@ export async function importDiscordGuildMembers(
|
||||
if (isNew) result.imported++;
|
||||
}
|
||||
} catch (err) {
|
||||
result.errors.push(`Failed to import member ${member.user.id}: ${err}`);
|
||||
result.errors.push(`Failed to import member ${member.user.id}: ${String(err)}`);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
result.errors.push(`Failed to list Discord members: ${err}`);
|
||||
result.errors.push(`Failed to list Discord members: ${String(err)}`);
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -374,11 +374,11 @@ export async function importWhatsAppGroupParticipants(
|
||||
if (isNew) result.imported++;
|
||||
}
|
||||
} catch (err) {
|
||||
result.errors.push(`Failed to import participant ${participant.id}: ${err}`);
|
||||
result.errors.push(`Failed to import participant ${participant.id}: ${String(err)}`);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
result.errors.push(`Failed to get group metadata for ${groupJid}: ${err}`);
|
||||
result.errors.push(`Failed to get group metadata for ${groupJid}: ${String(err)}`);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@ -491,11 +491,9 @@ describe("linker", () => {
|
||||
lastSeenAt: null,
|
||||
});
|
||||
|
||||
const initialCount = store.listContacts().length;
|
||||
const result = autoLinkHighConfidence(store);
|
||||
|
||||
// Name similarity below threshold should not auto-link
|
||||
const finalCount = store.listContacts().length;
|
||||
// They may or may not be linked depending on exact similarity
|
||||
// But we verify auto-link only processes high confidence
|
||||
expect(result.suggestions.every((s) => s.confidence === "high")).toBe(true);
|
||||
|
||||
@ -366,10 +366,7 @@ export class ContactStore {
|
||||
/**
|
||||
* Get a platform identity by platform and platform-specific ID.
|
||||
*/
|
||||
getIdentityByPlatformId(
|
||||
platform: Platform | string,
|
||||
platformId: string,
|
||||
): PlatformIdentity | null {
|
||||
getIdentityByPlatformId(platform: string, platformId: string): PlatformIdentity | null {
|
||||
const row = this.stmtGetIdentityByPlatformId.get(platform, platformId) as
|
||||
| {
|
||||
id: number;
|
||||
@ -434,7 +431,7 @@ export class ContactStore {
|
||||
/**
|
||||
* Update last seen timestamp for a platform identity.
|
||||
*/
|
||||
updateIdentityLastSeen(platform: Platform | string, platformId: string): void {
|
||||
updateIdentityLastSeen(platform: string, platformId: string): void {
|
||||
this.stmtUpdateIdentityLastSeen.run(Date.now(), platform, platformId);
|
||||
}
|
||||
|
||||
@ -442,7 +439,7 @@ export class ContactStore {
|
||||
* Resolve a platform sender to a canonical contact ID.
|
||||
* Returns null if the sender is not in the contact graph.
|
||||
*/
|
||||
resolveContact(platform: Platform | string, platformId: string): string | null {
|
||||
resolveContact(platform: string, platformId: string): string | null {
|
||||
const identity = this.getIdentityByPlatformId(platform, platformId);
|
||||
return identity?.contactId ?? null;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user