@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
37 lines • 3.25 kB
TypeScript
import type { SlackAccessor } from '../../accessor/slack.ts';
import { type ByteSource } from '../../io/types.ts';
import type { DirListing, FileStat, PathSpec } from '../../types.ts';
import { BaseVFS } from '../base.ts';
import type { Handed } from '../types.ts';
export declare const VFS_MD = "```text\n{prefix}\n channels/\n <channel-name>__<channel-id>/\n <yyyy-mm-dd>/\n chat.jsonl # messages for that date\n files/ # attachments shared that day\n <name>__<F-id>.<ext> # cat downloads the bytes\n dms/\n <user-name>__<dm-id>/\n <yyyy-mm-dd>/\n chat.jsonl\n files/\n <name>__<F-id>.<ext>\n users/\n <username>__<user-id>.json # user profile\n```\n\n- A channel, DM or user name is `<display-name>__<id>`. The display name\n keeps Slack's spelling; only `/` becomes `\u2215` (U+2215). `ls` the parent\n first to find exact names, and quote a name that has spaces.\n- Messages are JSONL; use `jq` for fields such as `.text`, `.user`,\n `.ts` and `.files`. A day's `files/` may be empty.\n- `.user` is a user ID (`U\u2026`), not a username; resolve it through\n `users/<username>__<user-id>.json` and filter messages by the ID.\n- Without `start_time`/`end_time`, a channel lists the latest 90 days up\n to its newest message; a date glob finds earlier days.\n- With `start_time`/`end_time`, listings cover that scope; messages and\n attachments outside it are absent, direct paths included, and `grep`\n and `rg` see only the in-scope files. Users and channel metadata stay\n available as context.\n- Unless `walk_limit` is -1, `grep -rw` and `rg -w` read only the channel\n and DM days Slack search names; attachments under `files/` are always\n read.";
/**
* Slack's functions over its accessor, which the node and browser
* packages build over their own transport.
*/
export declare class SlackVFS extends BaseVFS<SlackAccessor> {
readonly readsRanges: boolean;
readonly wholeWordSearch: boolean;
readonly handed: {
readonly readdir: readonly ["entry"];
readonly read: readonly ["entry", "parent"];
readonly follow: readonly ["entry", "parent"];
readonly readMany: readonly ["entry", "parent"];
readonly stat: readonly ["entry", "parent"];
};
readonly searchable: readonly string[];
readdir(path: PathSpec, handed?: Handed): Promise<FileStat[] | DirListing>;
read(path: PathSpec, handed?: Handed, offset?: number, size?: number | null, signal?: AbortSignal): Promise<ByteSource> | AsyncIterable<Uint8Array>;
readMany(paths: PathSpec[], limit: number, handed?: readonly Handed[]): Promise<Map<string, Uint8Array>>;
follow(path: PathSpec, n: number, interval: number, handed?: Handed): Promise<AsyncIterable<Uint8Array> | null>;
stat(path: PathSpec, handed?: Handed): Promise<FileStat>;
/**
* Whether this VFS answers `name`; with no walk limit it reads every
* file rather than ask the service's search.
*/
supports(name: string): boolean;
filesContaining(path: PathSpec, text: string, opts: {
wholeWord: boolean;
ignoreCase: boolean;
}): Promise<PathSpec[] | null>;
}
//# sourceMappingURL=slack.d.ts.map