@autorag/librarian 2.13.2 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -36,6 +36,9 @@ License: Apache-2.0
36
36
  fast-xml-parser@5.11.2
37
37
  License: MIT
38
38
 
39
+ gpt-tokenizer@4.1.0
40
+ License: MIT
41
+
39
42
  iconv-lite@0.7.3
40
43
  License: MIT
41
44
 
package/README.md CHANGED
@@ -667,7 +667,6 @@ AutoRAG Agent connects to external tools and communication platforms using dedic
667
667
  | **Cloud Drives** | `cloud-drive` | [`rclone`](https://rclone.org) CLI | Google Drive (Tier-1), OneDrive, Dropbox, etc. | Incremental Mirror + BM25 |
668
668
  | **Photos & Shots** | `clawgallery` | `clawgallery` CLI | Local screenshot and photo store | Hybrid OCR/Visual Search |
669
669
  | **RSS / News** | `rss` | Native HTTP Poller | RSS 2.0 & Atom feeds (24h deduplication) | Lexical |
670
- | **macOS Spotlight** | `spotlight` | Native `mdfind` CLI | macOS system metadata and content index | System Native |
671
670
  | **Browser History** | `hister` | [Hister](https://github.com/asciimoo/hister) server (AGPL-3.0-or-later, separate program, HTTP API) | Pages visited in Chrome/Chromium/Firefox, captured by Hister's own extension and indexed by Hister (web pages only; its local-file indexing is never used) | Lexical full-text; optional Semantic via Hister's own embedding endpoint |
672
671
 
673
672
  For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md). Non-interactive `sync`/`index` steps get a one-hour per-connector budget (`connector.indexTimeoutMs`) because first-run imports routinely take minutes; interactive search keeps its 60-second default.
@@ -20,15 +20,20 @@ export declare function createContextTokenGuardedTransform(model: ContextTokenGu
20
20
  /** The model with its output limit held to {@link MAX_OUTPUT_TOKENS}; the same model when already within it, or when absent. */
21
21
  export declare function withBoundedOutput<T extends Model<any> | undefined>(model: T): T;
22
22
  /**
23
- * Keep complete retrieval candidates while the assembled request fits the
24
- * model budget. Removing a per-chunk cut is only safe because this drops whole
25
- * lower-ranked candidates (with an explicit marker) instead of hiding text.
23
+ * Keep the request inside the model budget by dropping retrieval chunks only: the
24
+ * lowest-ranked ones go first, across every ranked list in the transcript (every
25
+ * list's best chunk stays before any list's second), each with an explicit marker.
26
+ * The user's query, earlier turns, and the system prompt are never edited. When no
27
+ * chunk is left to drop, only the newest tool result is shortened; anything still
28
+ * too large is left for the provider to reject and pi's compaction to recover.
26
29
  */
27
30
  export declare function guardAgentContextMessages(model: Model<any> | undefined, messages: AgentMessage[], useReportedUsage?: boolean, fixedOverheadTokens?: number): AgentMessage[];
28
31
  /**
29
- * Estimate the current transcript with pi-coding-agent's conservative chars/4
30
- * counter. `useReportedUsage` adds the last assistant turn's provider-reported
31
- * usage for the settled prefix; pass false when the messages were just edited.
32
+ * Estimate the current transcript: pi-coding-agent's chars/4 counter as the
33
+ * floor, raised by a real BPE count for text that chars/4 undercounts (see
34
+ * `token-count.ts`). `useReportedUsage` adds the last assistant turn's
35
+ * provider-reported usage for the settled prefix; pass false when the messages
36
+ * were just edited.
32
37
  */
33
38
  export declare function estimateContextMessageTokens(messages: readonly AgentMessage[], useReportedUsage?: boolean): number;
34
39
  export {};
@@ -0,0 +1,4 @@
1
+ /** Tokens in `text`, never fewer than the chars/4 guess so prose keeps the budget it had. */
2
+ export declare function estimateTextTokens(text: string): number;
3
+ /** How many tokens the pieces add beyond their chars/4 guesses; zero for prose. */
4
+ export declare function tokensBeyondCharGuess(parts: readonly string[]): number;