@volter/supercode-interchange 0.1.14 → 0.1.15
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/discovery.mjs +6 -2
- package/index.d.ts +2 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/discovery.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import { readLatestCandidates, readFileTopics } from './previews.mjs';
|
|
|
3
3
|
import { nativeTrim } from './text.mjs';
|
|
4
4
|
|
|
5
5
|
/** Preview refusal preserves the native metadata row. The owner can retain
|
|
6
|
-
* the exact failed source in diagnostics; it never invents message content.
|
|
6
|
+
* the exact failed source in diagnostics; it never invents message content.
|
|
7
|
+
* A query that shows no message (`include_latest_candidates: false`, with no
|
|
8
|
+
* topics asked) opens no file: its row is the index's own. */
|
|
7
9
|
export async function enrichDescriptor(query, descriptor, { codexTopics, metrics, previewFailure } = {}) {
|
|
8
10
|
const row = { ...descriptor };
|
|
9
11
|
const take = async (read) => {
|
|
@@ -17,7 +19,7 @@ export async function enrichDescriptor(query, descriptor, { codexTopics, metrics
|
|
|
17
19
|
if (topics.length) row.preview_candidates = topics;
|
|
18
20
|
else delete row.preview_candidates;
|
|
19
21
|
}
|
|
20
|
-
const latest = await take(() => readLatestCandidates(row.locator, metrics));
|
|
22
|
+
const latest = query.include_latest_candidates === false ? [] : await take(() => readLatestCandidates(row.locator, metrics));
|
|
21
23
|
if (latest.length) row.latest_message_candidates = latest;
|
|
22
24
|
else delete row.latest_message_candidates;
|
|
23
25
|
return row;
|
|
@@ -25,6 +27,8 @@ export async function enrichDescriptor(query, descriptor, { codexTopics, metrics
|
|
|
25
27
|
|
|
26
28
|
/** Bounded enrichment belongs to returned/current-window rows. Metadata
|
|
27
29
|
* maintenance never invokes this function, including unchanged warm queries. */
|
|
30
|
+
export const readsPreviews = (query) => query.include_latest_candidates !== false || Boolean(query.include_topic_candidates);
|
|
31
|
+
|
|
28
32
|
export async function enrichIndexPage(query, rows, options) {
|
|
29
33
|
const result = [];
|
|
30
34
|
for (const row of rows) result.push(await enrichDescriptor(query, row, options));
|
package/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface DiscoveryQuery {
|
|
|
29
29
|
workspace?: string | null; workspace_subtree?: boolean; workspace_family?: string | null;
|
|
30
30
|
updated_after_ms?: number | null; updated_before_ms?: number | null;
|
|
31
31
|
query?: string | null; search_previews?: boolean; cursor?: string | null; limit?: number | null;
|
|
32
|
-
include_topic_candidates?: boolean; include_child_sessions?: boolean;
|
|
32
|
+
include_topic_candidates?: boolean; include_latest_candidates?: boolean; include_child_sessions?: boolean;
|
|
33
33
|
root_session_id?: string | null; profile?: string | null;
|
|
34
34
|
}
|
|
35
35
|
export interface DiscoveryReceipt {
|
|
@@ -110,6 +110,7 @@ export interface DiscoveryEnrichmentOptions extends MetadataProjectionOptions {
|
|
|
110
110
|
lateClaudeName?: (name: string) => Promise<string | null>;
|
|
111
111
|
}
|
|
112
112
|
export function enrichDescriptor(query: DiscoveryQuery, descriptor: SessionDescriptor, options?: DiscoveryEnrichmentOptions): Promise<SessionDescriptor>;
|
|
113
|
+
export function readsPreviews(query: DiscoveryQuery): boolean;
|
|
113
114
|
export function enrichIndexPage(query: DiscoveryQuery, descriptors: SessionDescriptor[], options?: DiscoveryEnrichmentOptions): Promise<SessionDescriptor[]>;
|
|
114
115
|
export function discoverFromIndex(query: DiscoveryQuery, descriptors: Iterable<SessionDescriptor>, options?: DiscoveryEnrichmentOptions): Promise<DiscoveryPage>;
|
|
115
116
|
export function nativeTrim(value: string): string;
|
package/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ export { readForeignStore } from './foreign-store.mjs';
|
|
|
14
14
|
export { readHermesStore } from './hermes-store.mjs';
|
|
15
15
|
export { readOrchestratorStore } from './orchestrator-store.mjs';
|
|
16
16
|
export { codexNamesPath, readCodexNames, readCodexHistory, readClaudeTitles } from './native-ledgers.mjs';
|
|
17
|
-
export { enrichDescriptor, enrichIndexPage, discoverFromIndex } from './discovery.mjs';
|
|
17
|
+
export { enrichDescriptor, enrichIndexPage, readsPreviews, discoverFromIndex } from './discovery.mjs';
|
|
18
18
|
export { nativeInteger } from './native-json.mjs';
|
|
19
19
|
export { nativeTrim } from './text.mjs';
|
|
20
20
|
export { RetainedMetadataProjection, filedUnderOwnKey } from './retained-projection.mjs';
|
package/package.json
CHANGED