import type { NotesIdentity } from "../notes/identity.js"; import { Type, type Static } from "typebox"; import { type NoteChange } from "../notes/index.js"; import { type Outcome } from "./result.js"; /** One unrecognized entry, and all of them together, are bounded; omissions are counted, never listed. */ export declare const MAX_METADATA_ENTRY_BYTES = 1024; export declare const NoteMetadataSchema: Type.TObject<{ origin: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"self">, Type.TLiteral<"external">]>; created_at: Type.TString; updated_at: Type.TString; last_accessed: Type.TString; access_count: Type.TInteger; crumpled_at: Type.TOptional; project: Type.TOptional; extra: Type.TRecord<"^.*$", Type.TUnknown>; /** Values left in the file but too large to show, summarized so the summary cannot grow. */ omitted_extra: Type.TOptional>; }>; export type NoteMetadata = Static; export declare const NotesWriteDataSchema: Type.TObject<{ address: Type.TString; project_key: Type.TOptional; outcome: Type.TUnion<[Type.TLiteral<"created">, Type.TLiteral<"overwrote">, Type.TLiteral<"uncrumpled">]>; }>; export type NotesWriteData = Static; export declare const NotesUpdateDataSchema: Type.TObject<{ address: Type.TString; project_key: Type.TOptional; applied: Type.TInteger; change_kind: Type.TUnion<[Type.TLiteral<"none">, Type.TLiteral<"body">, Type.TLiteral<"metadata">, Type.TLiteral<"file">]>; diff: Type.TString; diff_truncated: Type.TOptional>; rename_from: Type.TOptional; rename_to: Type.TOptional; replaced_crumpled_target: Type.TOptional; }>; export type NotesUpdateData = Static; export declare const NotesReadDataSchema: Type.TObject<{ address: Type.TString; project_key: Type.TOptional; metadata: Type.TObject<{ origin: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"self">, Type.TLiteral<"external">]>; created_at: Type.TString; updated_at: Type.TString; last_accessed: Type.TString; access_count: Type.TInteger; crumpled_at: Type.TOptional; project: Type.TOptional; extra: Type.TRecord<"^.*$", Type.TUnknown>; /** Values left in the file but too large to show, summarized so the summary cannot grow. */ omitted_extra: Type.TOptional>; }>; window: Type.TObject<{ text: Type.TString; offset_chars: Type.TInteger; total_chars: Type.TInteger; next_offset_chars: Type.TUnion<[Type.TInteger, Type.TNull]>; limited_by: Type.TUnion<[Type.TLiteral<"limit">, Type.TLiteral<"bytes">, Type.TNull]>; }>; }>; export type NotesReadData = Static; export declare const NotesListDataSchema: Type.TObject<{ more: Type.TInteger; crumpled_excluded: Type.TInteger; homes_unavailable: Type.TArray; files: Type.TArray; updated_at: Type.TString; crumpled_at: Type.TOptional; }>>; }>; export type NotesListData = Static; export declare const NotesSearchDataSchema: Type.TObject<{ more: Type.TInteger; crumpled_excluded: Type.TInteger; homes_unavailable: Type.TArray; files: Type.TArray>; address: Type.TString; project_key: Type.TOptional; updated_at: Type.TString; crumpled_at: Type.TOptional; }>>; }>; export type NotesSearchData = Static; export declare const notesWriteParameters: Type.TObject<{ address: Type.TString; content: Type.TString; origin: Type.TOptional, Type.TLiteral<"self">, Type.TLiteral<"external">]>>; }>; export declare const notesWrite: { readonly name: "notes_write"; readonly label: "Notes write"; readonly description: "Create or rewrite a note, and name it for what it holds and when to reach for it: a fresh window sees only the name in the index and decides whether to open by it. Write it so the next window can pick it up: what it's for, what was decided, what's still open. Whatever git and history can hand back on their own, leave out. Keep it true when the content drifts. Address forms per the boot protocol. `@` addresses are notes, not files: feed one to read/write/edit/bash and a real directory named `@project` is born. Don't. A rewrite replaces the body whole while preserving createdAt and every other frontmatter key. Writing always produces an uncrumpled note. The receipt reports the resolved address, project key when applicable, and actual create/overwrite/uncrumple outcome."; readonly parameters: Type.TObject<{ address: Type.TString; content: Type.TString; origin: Type.TOptional, Type.TLiteral<"self">, Type.TLiteral<"external">]>>; }>; readonly outputSchema: Type.TUnion<[Type.TObject<{ ok: Type.TLiteral; data: Type.TObject<{ address: Type.TString; project_key: Type.TOptional; outcome: Type.TUnion<[Type.TLiteral<"created">, Type.TLiteral<"overwrote">, Type.TLiteral<"uncrumpled">]>; }>; }>, Type.TObject<{ ok: Type.TLiteral; error: Type.TObject<{ code: Type.TString; message: Type.TString; details: Type.TOptional>; }>; }>]>; readonly executionMode: "sequential"; readonly execute: (params: Static, identity: NotesIdentity) => Promise>; readonly render: (result: Outcome) => string; }; export declare const notesUpdateParameters: Type.TObject<{ address: Type.TString; edits: Type.TOptional>>; origin: Type.TOptional, Type.TLiteral<"self">, Type.TLiteral<"external">]>>; crumpled: Type.TOptional; replace_all: Type.TOptional; rename_to: Type.TOptional; }>; declare function renderUpdate(result: Outcome): string; export declare const notesUpdate: { readonly name: "notes_update"; readonly label: "Notes update"; readonly description: "Update one note: exact-text body edits, a metadata-only change, or a rename_to move; frontmatter is never editable through edits. Address forms per the boot protocol. `@` addresses are notes, not files: feed one to read/write/edit/bash and a real directory named `@project` is born. Don't. Each oldText must occur exactly once unless replace_all is set; a multi-match anchor fails with its match line numbers and a zero-match anchor names the failing edit index. edits may be omitted (or empty) for a metadata-only update, which requires at least one of origin/crumpled. rename_to moves the note to a new address preserving createdAt and every other metadata key; it is used alone, never combined with edits, origin, crumpled, or replace_all, refuses a live note at the target, and may replace a crumpled one. The receipt reports resolved identity, the number of edits that changed text, the change kind (including none), and the actual diff, shortened when it would not fit the output budget."; readonly parameters: Type.TObject<{ address: Type.TString; edits: Type.TOptional>>; origin: Type.TOptional, Type.TLiteral<"self">, Type.TLiteral<"external">]>>; crumpled: Type.TOptional; replace_all: Type.TOptional; rename_to: Type.TOptional; }>; readonly outputSchema: Type.TUnion<[Type.TObject<{ ok: Type.TLiteral; data: Type.TObject<{ address: Type.TString; project_key: Type.TOptional; applied: Type.TInteger; change_kind: Type.TUnion<[Type.TLiteral<"none">, Type.TLiteral<"body">, Type.TLiteral<"metadata">, Type.TLiteral<"file">]>; diff: Type.TString; diff_truncated: Type.TOptional>; rename_from: Type.TOptional; rename_to: Type.TOptional; replaced_crumpled_target: Type.TOptional; }>; }>, Type.TObject<{ ok: Type.TLiteral; error: Type.TObject<{ code: Type.TString; message: Type.TString; details: Type.TOptional>; }>; }>]>; readonly executionMode: "sequential"; readonly execute: (params: Static, identity: NotesIdentity, renderDiff: (change: NoteChange) => string) => Promise>; readonly render: typeof renderUpdate; }; export declare const notesReadParameters: Type.TObject<{ address: Type.TString; offset_chars: Type.TOptional; limit_chars: Type.TOptional; }>; export declare const notesRead: { readonly name: "notes_read"; readonly label: "Notes read"; readonly description: "Read a window of one note's body, frontmatter excluded. Address forms per the boot protocol. `@` addresses are notes, not files: feed one to read/write/edit/bash and a real directory named `@project` is born. Don't. The response leads with the resolved address and the note's metadata, then delivers the body window verbatim. offset_chars is the code-point offset into the body (default 0) - a negative value counts back from the end - and limit_chars caps the window (default 12000, max 50000). The response carries the longest fitting prefix of that window as text, plus the same window as structured fields; when characters remain, the closing line names the offset_chars to pass back to continue. Body text is never re-encoded, so concatenating consecutive windows reconstructs the body exactly. Metadata values too large to show are counted rather than listed; they remain in the note file."; readonly parameters: Type.TObject<{ address: Type.TString; offset_chars: Type.TOptional; limit_chars: Type.TOptional; }>; readonly outputSchema: Type.TUnion<[Type.TObject<{ ok: Type.TLiteral; data: Type.TObject<{ address: Type.TString; project_key: Type.TOptional; metadata: Type.TObject<{ origin: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"self">, Type.TLiteral<"external">]>; created_at: Type.TString; updated_at: Type.TString; last_accessed: Type.TString; access_count: Type.TInteger; crumpled_at: Type.TOptional; project: Type.TOptional; extra: Type.TRecord<"^.*$", Type.TUnknown>; /** Values left in the file but too large to show, summarized so the summary cannot grow. */ omitted_extra: Type.TOptional>; }>; window: Type.TObject<{ text: Type.TString; offset_chars: Type.TInteger; total_chars: Type.TInteger; next_offset_chars: Type.TUnion<[Type.TInteger, Type.TNull]>; limited_by: Type.TUnion<[Type.TLiteral<"limit">, Type.TLiteral<"bytes">, Type.TNull]>; }>; }>; }>, Type.TObject<{ ok: Type.TLiteral; error: Type.TObject<{ code: Type.TString; message: Type.TString; details: Type.TOptional>; }>; }>]>; readonly execute: (params: Static, identity: NotesIdentity) => Promise>; readonly render: (result: Outcome) => string; }; export declare const notesListParameters: Type.TObject<{ pattern: Type.TOptional>; limit: Type.TOptional; wastebasket: Type.TOptional; }>; export declare const notesList: { readonly name: "notes_list"; readonly label: "Notes list"; readonly description: "List note files as a recent-first snapshot carrying address and updated_at; wastebasket rows also carry crumpled_at. more is the number of matching files omitted by limit or the wire budget; use pattern to narrow the address range. Address forms per the boot protocol. `@` addresses are notes, not files: feed one to read/write/edit/bash and a real directory named `@project` is born. Don't. Listings merge your five prefixes: this session, @project/, @human/, @self/, and @model/. The receipt counts hidden crumpled files and names unavailable homes; row identities and omission counts reflect the scanned result."; readonly parameters: Type.TObject<{ pattern: Type.TOptional>; limit: Type.TOptional; wastebasket: Type.TOptional; }>; readonly outputSchema: Type.TUnion<[Type.TObject<{ ok: Type.TLiteral; data: Type.TObject<{ more: Type.TInteger; crumpled_excluded: Type.TInteger; homes_unavailable: Type.TArray; files: Type.TArray; updated_at: Type.TString; crumpled_at: Type.TOptional; }>>; }>; }>, Type.TObject<{ ok: Type.TLiteral; error: Type.TObject<{ code: Type.TString; message: Type.TString; details: Type.TOptional>; }>; }>]>; readonly execute: (params: Static, identity: NotesIdentity) => Promise>; readonly render: (result: Outcome) => string; }; export declare const notesSearchParameters: Type.TObject<{ query: Type.TUnion<[Type.TString, Type.TArray]>; pattern: Type.TOptional>; limit: Type.TOptional; max_matches_per_file: Type.TOptional; wastebasket: Type.TOptional; }>; export declare const notesSearch: { readonly name: "notes_search"; readonly label: "Notes search"; readonly description: "Case-insensitive literal substring search over note bodies; query is one string or several (OR), each matched line appears once. Results are a recent-first snapshot, not pageable; more counts matching files omitted by limit or the wire budget. Use pattern to narrow the address range. Address forms per the boot protocol. `@` addresses are notes, not files: feed one to read/write/edit/bash and a real directory named `@project` is born. Don't. Search merges the same five prefixes as notes_list. Patterns glob over full address strings. Each file entry carries matches_total, its full match count before per-file capping. Each match carries line, text, offset_chars (a code-point offset into the note body delivered by notes_read, at the earliest query match), and truncated (some line text is omitted). Pass address and offset_chars to notes_read to read from the match. The receipt counts hidden crumpled files and names unavailable homes; row identities, matches, and omission counts come from the scan."; readonly parameters: Type.TObject<{ query: Type.TUnion<[Type.TString, Type.TArray]>; pattern: Type.TOptional>; limit: Type.TOptional; max_matches_per_file: Type.TOptional; wastebasket: Type.TOptional; }>; readonly outputSchema: Type.TUnion<[Type.TObject<{ ok: Type.TLiteral; data: Type.TObject<{ more: Type.TInteger; crumpled_excluded: Type.TInteger; homes_unavailable: Type.TArray; files: Type.TArray>; address: Type.TString; project_key: Type.TOptional; updated_at: Type.TString; crumpled_at: Type.TOptional; }>>; }>; }>, Type.TObject<{ ok: Type.TLiteral; error: Type.TObject<{ code: Type.TString; message: Type.TString; details: Type.TOptional>; }>; }>]>; readonly execute: (params: Static, identity: NotesIdentity) => Promise>; readonly render: (result: Outcome) => string; }; export {};