sift-light 1.0.1 → 1.0.2

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.
@@ -10,6 +10,7 @@ import {
10
10
  } from "./analysis-limits.js";
11
11
  import {
12
12
  MAX_CONTEXT_LINES,
13
+ MAX_INSPECT_REQUEST_TARGETS,
13
14
  MAX_INSPECT_TARGETS,
14
15
  MAX_PAGE_SIZE,
15
16
  MAX_SELECTED_PATHS,
@@ -25,6 +26,7 @@ import {
25
26
  SIFT_LIGHT_MODES,
26
27
  fieldGuidance,
27
28
  } from "./request-contract.js";
29
+ import { MODE_ALIASES } from "./request-aliases.js";
28
30
 
29
31
  function stringEnum<const Values extends readonly string[]>(
30
32
  values: Values,
@@ -68,9 +70,9 @@ export const siftLightSchema = Type.Object({
68
70
  ),
69
71
  allOf: Type.Optional(
70
72
  Type.Array(Type.String({ maxLength: MAX_PATH_CHARACTERS }), {
71
- minItems: 2,
73
+ minItems: 1,
72
74
  maxItems: 3,
73
- description: `${fieldGuidance("allOf")}. 2-3 distinct terms must occur in one file (default) or one function.`,
75
+ description: `${fieldGuidance("allOf")}. 1-3 distinct terms must occur in one file (default) or one function; one term lists the files or functions containing it.`,
74
76
  }),
75
77
  ),
76
78
  within: Type.Optional(
@@ -95,7 +97,7 @@ export const siftLightSchema = Type.Object({
95
97
  {
96
98
  minItems: 1,
97
99
  description:
98
- "Filter each single-pattern occurrence by syntax role (JS/TS/TSX/Go). Roles may be candidates, especially Go call/conversion ambiguity. Cannot combine with allOf.",
100
+ "Filter each single-pattern occurrence by syntax role (JS/TS/TSX/Go parsed; Python lexical: comment, string, code, declaration, import, call candidates). Roles may be candidates, especially Go call/conversion and Python calls. Cannot combine with allOf.",
99
101
  },
100
102
  ),
101
103
  ),
@@ -151,7 +153,7 @@ export const siftLightSchema = Type.Object({
151
153
  minItems: 1,
152
154
  maxItems: MAX_SELECTED_PATHS,
153
155
  description:
154
- "Exact retained files to select together from a cursor. A new search accepts one path; split multiple roots into separate requests.",
156
+ "Exact retained files to select together from a cursor. A new search accepts one path; split multiple roots into separate requests. With mode=inspect and no cursor, opens each file from line 1 (same as targets with line 1).",
155
157
  }),
156
158
  ),
157
159
  glob: Type.Optional(
@@ -193,7 +195,7 @@ export const siftLightSchema = Type.Object({
193
195
  ignorePolicy: Type.Optional(
194
196
  stringEnum(["respect", "include"] as const, {
195
197
  description:
196
- "respect (default) honors ignore rules and reports policy-filtered coverage when files are omitted. include searches ignored files while still excluding .git internals and protected paths.",
198
+ "respect (default) honors ignore rules and reports policy-filtered coverage when files are omitted, including mode=files. include searches or lists ignored files while still excluding .git internals and protected paths.",
197
199
  }),
198
200
  ),
199
201
  patterns: Type.Optional(
@@ -264,19 +266,19 @@ export const siftLightSchema = Type.Object({
264
266
  Type.Integer({
265
267
  minimum: 1,
266
268
  maximum: MAX_PAGE_SIZE,
267
- description: `${fieldGuidance("limit")}. Ordinary search only: explicit detail-page match limit (max 100). Normally omit to preserve automatic summarization; analysis and inspect modes reject it.`,
269
+ description: `${fieldGuidance("limit")}. Ordinary search: explicit detail-page match limit (max 100); mode=files: files per page (default 30). Normally omit to preserve automatic summarization; other analysis and inspect modes reject it.`,
268
270
  }),
269
271
  ),
270
272
  mode: Type.Optional(
271
- stringEnum(SIFT_LIGHT_MODES, {
272
- description: `Ordinary search defaults to auto; summary/matches request explicit pages. capabilities returns a compact names-only project inventory and per-language supported modes without loading providers. files uses query, structure uses an AST pattern, concept uses a required natural-language query, and hybrid uses one query for exact literal plus concept evidence in a single snapshot. validate rechecks saved search or analysis sources against their recorded origin. await waits for an existing long-running concept or hybrid operation without restarting it; cancel explicitly cancels one and waits for owned cleanup. Copy the returned nextRequest exactly and do not repeat the original query. Waiting is an operation state, not evidence. Validation details report the requested scope, comparison target, coverage, and freshness as current, stale, or unknown; partial coverage is retained during validation. inspect/outline/imports/tests retain their documented location selectors. Syntax results are static evidence; concept and related-test results remain candidates. ${MODE_CONTRACT_DESCRIPTION}`,
273
+ stringEnum([...SIFT_LIGHT_MODES, ...MODE_ALIASES], {
274
+ description: `Ordinary search defaults to auto; summary/matches request explicit pages. capabilities returns a compact names-only project inventory and per-language supported modes without loading providers. files uses query, structure uses an AST pattern, concept uses a required natural-language query, and hybrid uses one query for exact literal plus concept evidence in a single snapshot. validate rechecks saved search or analysis sources against their recorded origin. await waits for an existing long-running concept or hybrid operation without restarting it; cancel explicitly cancels one and waits for owned cleanup. Copy the returned nextRequest exactly and do not repeat the original query. Waiting is an operation state, not evidence. Validation details report the requested scope, comparison target, coverage, and freshness as current, stale, or unknown; partial coverage is retained during validation. inspect/outline/imports/tests retain their documented location selectors. Syntax results are static evidence; concept and related-test results remain candidates. ${MODE_CONTRACT_DESCRIPTION} anyOf/allOf are field names, not modes; as mode values they are accepted aliases for omitting mode, disclosed in a request note.`,
273
275
  }),
274
276
  ),
275
277
 
276
278
  line: Type.Optional(
277
279
  Type.Number({
278
280
  description:
279
- "1-indexed source line for path inspection/navigation. Omit with matchIndex, matchIndices or targets.",
281
+ "1-indexed source line for path inspection/navigation; path-only inspect starts at line 1. Omit with matchIndex, matchIndices or targets.",
280
282
  }),
281
283
  ),
282
284
  matchIndex: Type.Optional(
@@ -288,9 +290,8 @@ export const siftLightSchema = Type.Object({
288
290
  matchIndices: Type.Optional(
289
291
  Type.Array(Type.Integer({ minimum: 1 }), {
290
292
  minItems: 1,
291
- maxItems: MAX_INSPECT_TARGETS,
292
- description:
293
- "Inspect up to five visible match numbers together using the same cursor; mutually exclusive with matchIndex, path, line and targets.",
293
+ maxItems: MAX_INSPECT_REQUEST_TARGETS,
294
+ description: `Inspect visible match numbers together using the same cursor; mutually exclusive with matchIndex, path, line and targets. One response inspects ${String(MAX_INSPECT_TARGETS)}; the rest are returned as an exact nextRequest.`,
294
295
  }),
295
296
  ),
296
297
  targets: Type.Optional(
@@ -301,9 +302,8 @@ export const siftLightSchema = Type.Object({
301
302
  }),
302
303
  {
303
304
  minItems: 1,
304
- maxItems: MAX_INSPECT_TARGETS,
305
- description:
306
- "Inspect known path/line locations together without a cursor. The complete batch shares one 16 KiB response budget.",
305
+ maxItems: MAX_INSPECT_REQUEST_TARGETS,
306
+ description: `Inspect known path/line locations together without a cursor. One response inspects ${String(MAX_INSPECT_TARGETS)} within a shared 16 KiB budget; the rest are returned as an exact nextRequest.`,
307
307
  },
308
308
  ),
309
309
  ),
package/src/tui/layout.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
2
2
  import type { SiftLightLocale } from "../config.js";
3
- import type { SiftLightInput } from "../service.js";
3
+ import type { SiftLightRequest } from "../service.js";
4
4
  import type { Dashboard } from "./dashboard.js";
5
5
 
6
6
  import { candy, type SiftLightTheme } from "./palette.js";
@@ -254,7 +254,7 @@ export function renderDashboard(
254
254
  }
255
255
 
256
256
  export function renderSiftLightCallLines(
257
- input: SiftLightInput,
257
+ input: SiftLightRequest,
258
258
  locale: SiftLightLocale,
259
259
  theme: SiftLightTheme,
260
260
  width: number,
@@ -1,6 +1,6 @@
1
1
  import { type Component } from "@earendil-works/pi-tui";
2
2
  import type { SiftLightLocale } from "../config.js";
3
- import type { SiftLightInput } from "../service.js";
3
+ import type { SiftLightRequest } from "../service.js";
4
4
  import type { SiftLightDetails } from "../types.js";
5
5
  import { dashboard } from "./dashboard.js";
6
6
  import { fit, renderDashboard, renderSiftLightCallLines, type SiftLightTheme } from "./layout.js";
@@ -47,7 +47,7 @@ function failure(text: string, locale: SiftLightLocale): string {
47
47
  }
48
48
 
49
49
  export function renderSiftLightCall(
50
- input: SiftLightInput,
50
+ input: SiftLightRequest,
51
51
  locale: SiftLightLocale,
52
52
  theme: SiftLightTheme,
53
53
  ): Component {
package/src/types.ts CHANGED
@@ -23,6 +23,8 @@ export const ESTIMATED_CHARACTERS_PER_TOKEN = 4;
23
23
  export const DEFAULT_SUMMARY_FILE_LIMIT = 30;
24
24
  export const MAX_SELECTED_PATHS = 20;
25
25
  export const MAX_INSPECT_TARGETS = 5;
26
+ /** A request may name more targets; they are served in pages of MAX_INSPECT_TARGETS. */
27
+ export const MAX_INSPECT_REQUEST_TARGETS = 20;
26
28
  export const MAX_DISPLAYED_OCCURRENCES = 20;
27
29
  export const MAX_STORED_MATCHES = 50_000;
28
30
  export const MAX_STORED_OCCURRENCES = 200_000;
@@ -310,6 +312,8 @@ export interface SiftLightDetails {
310
312
  source?: SourceExcerptDetails;
311
313
  inspections?: InspectBatchItemDetails[];
312
314
  scope?: SearchScopeDetails;
315
+ /** Disclosed request normalizations, such as a field name sent as mode. */
316
+ requestNotes?: string[];
313
317
  redactedCount?: number;
314
318
  redactionRequested?: boolean;
315
319
  redactionApplied?: boolean;