@octocodeai/octocode-tools-core 16.6.2 → 16.6.3

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.
Files changed (58) hide show
  1. package/README.md +11 -9
  2. package/dist/direct.js +37 -34
  3. package/dist/github/pullRequestSearch.d.ts +1 -0
  4. package/dist/index.d.ts +6 -4
  5. package/dist/index.js +39 -43
  6. package/dist/oql/adapters/graphProof.d.ts +6 -0
  7. package/dist/oql/adapters/graphView.d.ts +28 -0
  8. package/dist/oql/adapters/resultMap.d.ts +7 -0
  9. package/dist/oql/adapters/runner.d.ts +7 -0
  10. package/dist/oql/index.js +37 -34
  11. package/dist/oql/schema.d.ts +24 -8
  12. package/dist/oql/schemeText.d.ts +12 -11
  13. package/dist/oql/transformers/github/common.d.ts +7 -1
  14. package/dist/oql/types.d.ts +12 -2
  15. package/dist/responses.d.ts +4 -35
  16. package/dist/schema.js +2 -2
  17. package/dist/scheme/pagination.d.ts +51 -0
  18. package/dist/scheme/responseEnvelope.d.ts +67 -1
  19. package/dist/shared/config/index.d.ts +1 -8
  20. package/dist/shared/config/index.js +1 -2
  21. package/dist/shared/credentials/index.d.ts +1 -1
  22. package/dist/shared/credentials/index.js +2 -1
  23. package/dist/shared/credentials/storage.d.ts +0 -2
  24. package/dist/shared/credentials/testing.js +1 -1
  25. package/dist/shared/paths.d.ts +4 -0
  26. package/dist/shared/paths.js +1 -1
  27. package/dist/shared/session/index.js +1 -1
  28. package/dist/tools/directToolCatalog.exec.d.ts +5 -0
  29. package/dist/tools/github_clone_repo/scheme.d.ts +0 -1
  30. package/dist/tools/github_fetch_content/scheme.d.ts +6 -7
  31. package/dist/tools/github_search_code/scheme.d.ts +4 -6
  32. package/dist/tools/github_search_pull_requests/scheme.d.ts +0 -1
  33. package/dist/tools/github_search_repos/execution.d.ts +58 -0
  34. package/dist/tools/github_search_repos/scheme.d.ts +3 -6
  35. package/dist/tools/github_view_repo_structure/scheme.d.ts +0 -1
  36. package/dist/tools/local_binary_inspect/scheme.d.ts +97 -0
  37. package/dist/tools/local_fetch_content/scheme.d.ts +66 -0
  38. package/dist/tools/local_find_files/scheme.d.ts +49 -0
  39. package/dist/tools/local_ripgrep/scheme.d.ts +75 -0
  40. package/dist/tools/local_view_structure/scheme.d.ts +52 -0
  41. package/dist/tools/lsp/semantic_content/scheme.d.ts +8 -8
  42. package/dist/tools/lsp/shared/readiness.d.ts +17 -0
  43. package/dist/tools/package_search/scheme.d.ts +2 -4
  44. package/dist/tools/toolNames.d.ts +1 -0
  45. package/dist/utils/response/bulk.d.ts +1 -0
  46. package/dist/utils/response/groupedFinalizer.d.ts +7 -2
  47. package/package.json +4 -3
  48. package/dist/oql/adapters/v2.d.ts +0 -32
  49. package/dist/oql/v2params.d.ts +0 -22
  50. package/dist/shared/config/defaults.d.ts +0 -14
  51. package/dist/shared/config/loader.d.ts +0 -7
  52. package/dist/shared/config/resolver.d.ts +0 -2
  53. package/dist/shared/config/resolverCache.d.ts +0 -12
  54. package/dist/shared/config/resolverSections.d.ts +0 -10
  55. package/dist/shared/config/runtimeSurface.d.ts +0 -22
  56. package/dist/shared/config/types.d.ts +0 -92
  57. package/dist/shared/config/validator.d.ts +0 -2
  58. package/dist/shared/credentials/envTokens.d.ts +0 -9
@@ -92,11 +92,13 @@ export declare const QueryControlsSchema: z.ZodObject<{
92
92
  matchPage: z.ZodOptional<z.ZodNumber>;
93
93
  sort: z.ZodOptional<z.ZodEnum<{
94
94
  path: "path";
95
+ size: "size";
95
96
  created: "created";
97
+ name: "name";
96
98
  modified: "modified";
99
+ accessed: "accessed";
97
100
  relevance: "relevance";
98
101
  matchCount: "matchCount";
99
- accessed: "accessed";
100
102
  }>>;
101
103
  sortReverse: z.ZodOptional<z.ZodBoolean>;
102
104
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -204,11 +206,13 @@ export declare const OqlQuerySchema: z.ZodObject<{
204
206
  matchPage: z.ZodOptional<z.ZodNumber>;
205
207
  sort: z.ZodOptional<z.ZodEnum<{
206
208
  path: "path";
209
+ size: "size";
207
210
  created: "created";
211
+ name: "name";
208
212
  modified: "modified";
213
+ accessed: "accessed";
209
214
  relevance: "relevance";
210
215
  matchCount: "matchCount";
211
- accessed: "accessed";
212
216
  }>>;
213
217
  sortReverse: z.ZodOptional<z.ZodBoolean>;
214
218
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -325,11 +329,13 @@ export declare const OqlBatchSchema: z.ZodObject<{
325
329
  matchPage: z.ZodOptional<z.ZodNumber>;
326
330
  sort: z.ZodOptional<z.ZodEnum<{
327
331
  path: "path";
332
+ size: "size";
328
333
  created: "created";
334
+ name: "name";
329
335
  modified: "modified";
336
+ accessed: "accessed";
330
337
  relevance: "relevance";
331
338
  matchCount: "matchCount";
332
- accessed: "accessed";
333
339
  }>>;
334
340
  sortReverse: z.ZodOptional<z.ZodBoolean>;
335
341
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -452,11 +458,13 @@ export declare const OqlCanonicalInputSchema: z.ZodUnion<readonly [z.ZodObject<{
452
458
  matchPage: z.ZodOptional<z.ZodNumber>;
453
459
  sort: z.ZodOptional<z.ZodEnum<{
454
460
  path: "path";
461
+ size: "size";
455
462
  created: "created";
463
+ name: "name";
456
464
  modified: "modified";
465
+ accessed: "accessed";
457
466
  relevance: "relevance";
458
467
  matchCount: "matchCount";
459
- accessed: "accessed";
460
468
  }>>;
461
469
  sortReverse: z.ZodOptional<z.ZodBoolean>;
462
470
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -572,11 +580,13 @@ export declare const OqlCanonicalInputSchema: z.ZodUnion<readonly [z.ZodObject<{
572
580
  matchPage: z.ZodOptional<z.ZodNumber>;
573
581
  sort: z.ZodOptional<z.ZodEnum<{
574
582
  path: "path";
583
+ size: "size";
575
584
  created: "created";
585
+ name: "name";
576
586
  modified: "modified";
587
+ accessed: "accessed";
577
588
  relevance: "relevance";
578
589
  matchCount: "matchCount";
579
- accessed: "accessed";
580
590
  }>>;
581
591
  sortReverse: z.ZodOptional<z.ZodBoolean>;
582
592
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -690,11 +700,13 @@ export declare const OqlDisplayQuerySchema: z.ZodObject<{
690
700
  matchPage: z.ZodOptional<z.ZodNumber>;
691
701
  sort: z.ZodOptional<z.ZodEnum<{
692
702
  path: "path";
703
+ size: "size";
693
704
  created: "created";
705
+ name: "name";
694
706
  modified: "modified";
707
+ accessed: "accessed";
695
708
  relevance: "relevance";
696
709
  matchCount: "matchCount";
697
- accessed: "accessed";
698
710
  }>>;
699
711
  sortReverse: z.ZodOptional<z.ZodBoolean>;
700
712
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -822,11 +834,13 @@ export declare const OqlInputQuerySchema: z.ZodObject<{
822
834
  matchPage: z.ZodOptional<z.ZodNumber>;
823
835
  sort: z.ZodOptional<z.ZodEnum<{
824
836
  path: "path";
837
+ size: "size";
825
838
  created: "created";
839
+ name: "name";
826
840
  modified: "modified";
841
+ accessed: "accessed";
827
842
  relevance: "relevance";
828
843
  matchCount: "matchCount";
829
- accessed: "accessed";
830
844
  }>>;
831
845
  sortReverse: z.ZodOptional<z.ZodBoolean>;
832
846
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -967,11 +981,13 @@ export declare const OqlSearchInputSchema: z.ZodObject<{
967
981
  matchPage: z.ZodOptional<z.ZodNumber>;
968
982
  sort: z.ZodOptional<z.ZodEnum<{
969
983
  path: "path";
984
+ size: "size";
970
985
  created: "created";
986
+ name: "name";
971
987
  modified: "modified";
988
+ accessed: "accessed";
972
989
  relevance: "relevance";
973
990
  matchCount: "matchCount";
974
- accessed: "accessed";
975
991
  }>>;
976
992
  sortReverse: z.ZodOptional<z.ZodBoolean>;
977
993
  rankingProfile: z.ZodOptional<z.ZodString>;
@@ -36,20 +36,20 @@ export declare const OQL_SCHEMA_DOC: {
36
36
  readonly agentBestPractices: readonly ["Start with cheap orientation: --tree, --search path, --view discovery, or --content-view symbols.", "Then narrow and read exact evidence: --match-string, --start-line/--end-line, --char-offset/--char-length, or --content-view exact.", "Use snippets as discovery only; make decisions from exact content, PR/commit metadata, or LSP/graph proof.", "For semantics, run documentSymbols first to get line anchors, then references/callers/hover with symbolName + lineHint.", "For GitHub zero rows / providerUnindexed, do NOT claim absence — follow evidenceSemantics.providerUnindexed (verify path with structure, then materialize a bounded path).", "Read evidence.answerReady, evidence.complete, diagnostics, pagination, and next.* before concluding."];
37
37
  readonly quickStart: {
38
38
  readonly 'text search (local)': "search \"functionName\" ./src";
39
- readonly 'text search (GitHub)': "search \"functionName\" facebook/react";
39
+ readonly 'text search (GitHub)': "search \"functionName\" vercel/next.js";
40
40
  readonly 'package lookup (npm)': "search zod --target packages";
41
- readonly 'PR deep read (GitHub)': "search facebook/react#1 --target pullRequests --comments --patches";
42
- readonly 'commit history (GitHub)': "search facebook/react/packages/react/src --target commits --since 2024-01-01T00:00:00Z";
43
- readonly 'browse a tree (local dir or owner/repo)': "search ./src --tree | search facebook/react --tree";
44
- readonly 'read a file (local or owner/repo/path)': "search ./src/index.ts | search facebook/react/packages/react/src/index.js";
45
- readonly 'read a remote file (exact)': "search facebook/react/README.md --content-view exact";
41
+ readonly 'PR deep read (GitHub)': "search vercel/next.js#1 --target pullRequests --comments --patches";
42
+ readonly 'commit history (GitHub)': "search vercel/next.js/packages/next/src --target commits --since 2024-01-01T00:00:00Z";
43
+ readonly 'browse a tree (local dir or owner/repo)': "search ./src --tree | search vercel/next.js --tree";
44
+ readonly 'read a file (local or owner/repo/path)': "search ./src/index.ts | search vercel/next.js/packages/next/src/server/config.ts";
45
+ readonly 'read a remote file (exact)': "search vercel/next.js/README.md --content-view exact";
46
46
  readonly 'semantics (local/materialized)': "search ./src/index.ts --op documentSymbols | search ./src/index.ts --op references --symbol runCLI --line 42";
47
47
  readonly 'artifact inspect/list': "search app.tgz --target artifacts --list | search dist/server.node --target artifacts --inspect";
48
- readonly 'PR diff (GitHub)': "search facebook/react#123 --target diff | search facebook/react --target diff --pr 123";
48
+ readonly 'PR diff (GitHub)': "search vercel/next.js#123 --target diff | search vercel/next.js --target diff --pr 123";
49
49
  readonly 'two-ref / two-file diff': "search src/a.ts src/b.ts --target diff | search owner/repo --target diff --base-ref <sha> --head-ref <sha> --path <file>";
50
50
  readonly 'structural AST (local \u2014 needs full node shape)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" ./src --lang ts";
51
- readonly 'structural AST (GitHub \u2014 clones bounded subtree)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" facebook/react/packages --lang js --materialize auto";
52
- readonly 'GitHub index miss recovery': "search useState packages/react/src --repo facebook/react --materialize required | clone facebook/react/packages/react/src | cache fetch facebook/react packages/react/src --depth tree";
51
+ readonly 'structural AST (GitHub \u2014 clones bounded subtree)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" vercel/next.js/packages/next/src --lang ts --materialize auto";
52
+ readonly 'GitHub index miss recovery': "search useState packages/next/src --repo vercel/next.js --materialize required | clone vercel/next.js/packages/next/src | cache fetch vercel/next.js packages/next/src --depth tree";
53
53
  readonly 'dead-code triage (research)': "search --query '{\"schema\":\"oql\",\"target\":\"research\",\"from\":{\"kind\":\"local\",\"path\":\"./src\"},\"params\":{\"intent\":\"reachability\",\"facets\":[\"symbols\",\"files\"]},\"itemsPerPage\":1,\"page\":1}'";
54
54
  readonly 'LSP-proven dead symbols (graph)': "search --query '{\"schema\":\"oql\",\"target\":\"graph\",\"from\":{\"kind\":\"local\",\"path\":\"./src\"},\"params\":{\"intent\":\"reachability\",\"facets\":[\"symbols\"],\"proof\":\"lsp\",\"proofLimit\":5,\"includePackets\":true},\"page\":1,\"itemsPerPage\":10}'";
55
55
  readonly 'OQL full-schema reference': "search --scheme";
@@ -87,7 +87,7 @@ export declare const OQL_SCHEMA_DOC: {
87
87
  readonly params: "target options (validated by OQL for common fields and by the backing tool exhaustively) — see params hints below";
88
88
  readonly select: "string[] projection of result/continuation fields";
89
89
  readonly view: "discovery | paginated | detailed";
90
- readonly controls: "{ search?: { countLinesPerFile?, countMatchesPerFile?, onlyMatching?, unique?, countUnique?, contextLines?, invertMatch?, matchWindow?, matchContentLength?, maxMatchesPerFile?, matchPage?, sort?, sortReverse?, rankingProfile?, debugRanking? }, budget?: { maxFiles?, maxCandidates?, maxBytes?, maxMaterializedBytes?, maxPlanNodes?, maxBooleanExpansion?, timeoutMs? } } — output/cost controls";
90
+ readonly controls: "{ search?: { countLinesPerFile?, countMatchesPerFile?, onlyMatching?, unique?, countUnique?, contextLines?, invertMatch?, matchWindow?, matchContentLength?, maxMatchesPerFile?, matchPage?, sort?:\"relevance\"|\"matchCount\"|\"path\"|\"modified\"|\"accessed\"|\"created\"|\"size\"|\"name\", sortReverse?, rankingProfile?, debugRanking? }, budget?: { maxFiles?, maxCandidates?, maxBytes?, maxMaterializedBytes?, maxPlanNodes?, maxBooleanExpansion?, timeoutMs? } } — output/cost controls; sort values \"size\"/\"name\" apply to target:\"files\" only (lowered to localFindFiles sortBy), the rest are code-search sorts";
91
91
  readonly limit: "number — total result cap where supported. Prefer itemsPerPage for paged research/graph/file-history continuations.";
92
92
  readonly page: "number — top-level page number for OQL windowing/continuations";
93
93
  readonly itemsPerPage: "number — page size for the target primary result domain. For code search this may be matched files, not individual matches; per-file match paging uses controls.search.matchPage. Per-target params expose backing-tool sub-pages only (filePage/commentPage/commitPage, entryPageNumber, scanOffset, etc.).";
@@ -109,8 +109,9 @@ export declare const OQL_SCHEMA_DOC: {
109
109
  readonly text: "{ kind:\"text\", value, case?, wholeWord? }";
110
110
  readonly regex: "{ kind:\"regex\", value, dialect?:\"rust\"|\"pcre2\"|\"provider\", case?, wholeWord?, multiline?, dotAll? }";
111
111
  readonly structural: "{ kind:\"structural\", lang, pattern? | rule? } (exactly one; rule is a JSON object or grep-compatible YAML rule string) — pattern must match the COMPLETE node, so include the parts the real node has: a fn WITH a return type only matches if the pattern has one too (`function $N($$$A): $R { $$$B }`); omitting it returns 0. Shapes: `function $N($$$A) { $$$B }` (no-return-type fn), `($$$A) => $$$B` (arrow, block+expression), `$F($$$A)` (call), `$O.$M($$$A)` (method). For \"find symbol X\" the ROBUST form is a rule, not a pattern: `{ kind:\"function_declaration\", has:{ pattern:\"X\" } }`. 0 matches + no parse error = pattern shape ≠ real node (add `: $R`, or switch to a rule). Note: $$$-only patterns skip files with no literal anchor → low counts; add a literal name or use a regex where.";
112
- readonly field: "{ kind:\"field\", field:\"path\"|\"basename\"|\"extension\"|\"size\"|\"modified\"|\"accessed\"|\"empty\"|\"permissions\"|\"executable\"|\"readable\"|\"writable\"|\"entryType\", op:\"=\"|\"!=\"|\"in\"|\"exists\"|\"glob\"|\"regex\"|\">\"|\">=\"|\"<\"|\"<=\"|\"within\"|\"before\", value? } (use symbolic ops like \"=\"; aliases such as \"eq\" are invalid; there is no \"contains\" op — use op:\"glob\", value:\"*term*\" or op:\"regex\"; \"within\"/\"before\" compare modified/accessed times; empty/executable/readable/writable are boolean file attributes paired with op:\"exists\" or op:\"=\")";
112
+ readonly field: "{ kind:\"field\", field:\"path\"|\"basename\"|\"extension\"|\"size\"|\"modified\"|\"accessed\"|\"empty\"|\"permissions\"|\"executable\"|\"readable\"|\"writable\"|\"entryType\", op:\"=\"|\"!=\"|\"in\"|\"exists\"|\"glob\"|\"regex\"|\">\"|\">=\"|\"<\"|\"<=\"|\"within\"|\"before\", value? } (use symbolic ops like \"=\"; aliases such as \"eq\" are invalid; there is no \"contains\" op — use op:\"glob\", value:\"*term*\" or op:\"regex\"; \"within\"/\"before\" compare modified/accessed times; empty/executable/readable/writable are boolean file attributes paired with op:\"exists\" or op:\"=\") SCOPE: field predicates evaluate file attributes, so they run on target:\"files\" (and mixed into files-lane booleans); target:\"code\" rejects a bare field predicate with unsupportedPredicate — use text/regex/structural for code content, or target:\"files\" for file discovery.";
113
113
  readonly boolean: "{ kind:\"all\"|\"any\", of: Predicate[] } | { kind:\"not\", predicate }";
114
+ readonly booleanSugar: "Top-level sugar keys lower to canonical booleans at normalize time: and:[...]→all, or:[...]→any, noneOf:[...]→not(any), xor:[a,b]→any(all(a,not b),all(not a,b)), oneOf:[...]→exactly-one expansion (bounded by controls.budget.maxBooleanExpansion), invert:true→not(where). Prefer canonical all/any/not in programmatic queries; sugar is for terse hand-written ones.";
114
115
  };
115
116
  readonly batch: {
116
117
  readonly queries: "OqlQuery[] (1-5)";
@@ -1,4 +1,10 @@
1
- import type { OqlQuery, QueryScope, QuerySource } from '../../types.js';
1
+ import type { OqlQuery, Predicate, QueryScope, QuerySource } from '../../types.js';
2
+ /**
3
+ * Collect the leaf predicates (text/regex/structural/field) of a `where`
4
+ * tree. Mirrors the planner's walk without importing planner.ts (cycle risk);
5
+ * used to verify a provider transformer consumed every routed leaf.
6
+ */
7
+ export declare function leafPredicates(where: Predicate): Predicate[];
2
8
  export declare function splitGithubSource(source: QuerySource | undefined): {
3
9
  owner?: string;
4
10
  repo?: string;
@@ -15,6 +15,16 @@ export declare const ACTIVE_TARGETS: readonly OqlActiveTarget[];
15
15
  export declare const RESERVED_TARGETS: readonly OqlReservedTarget[];
16
16
  /** Targets that do not need a code corpus (provider/registry discovery). */
17
17
  export declare const CORPUS_OPTIONAL_TARGETS: readonly OqlActiveTarget[];
18
+ /**
19
+ * Which `controls.search.sort` values each lane can actually execute
20
+ * (files: localFindFiles sortBy; code: code-search ranking sorts). Single
21
+ * source for shorthand lowering and the planner's inapplicable-sort warning —
22
+ * a value outside the target's set is IGNORED by the backend, never an error.
23
+ */
24
+ export declare const SEARCH_SORTS_BY_TARGET: {
25
+ readonly code: readonly ["relevance", "matchCount", "path", "modified", "accessed", "created"];
26
+ readonly files: readonly ["size", "name", "path", "modified"];
27
+ };
18
28
  export type PredicateId = string;
19
29
  export type QuerySource = {
20
30
  kind: 'local';
@@ -150,7 +160,7 @@ export interface QueryControls {
150
160
  matchContentLength?: number;
151
161
  maxMatchesPerFile?: number;
152
162
  matchPage?: number;
153
- sort?: 'relevance' | 'matchCount' | 'path' | 'modified' | 'accessed' | 'created';
163
+ sort?: 'relevance' | 'matchCount' | 'path' | 'modified' | 'accessed' | 'created' | 'size' | 'name';
154
164
  sortReverse?: boolean;
155
165
  rankingProfile?: string;
156
166
  debugRanking?: boolean;
@@ -238,7 +248,7 @@ export interface OqlInputBatch {
238
248
  explain?: boolean;
239
249
  }
240
250
  export type OqlSearchInput = OqlInputQuery | OqlInputBatch;
241
- export type DiagnosticCode = 'invalidQuery' | 'ambiguousSugar' | 'unknownField' | 'unsupportedTarget' | 'unsupportedPredicate' | 'unsupportedBoolean' | 'unsupportedScope' | 'negativeUniverseRequired' | 'residualNotExact' | 'fieldTypeMismatch' | 'requiresMaterialization' | 'vendorNoEquivalent' | 'lossyTransform' | 'unsupportedVendorPredicate' | 'responseShapeMismatch' | 'materializationNotAllowed' | 'materializationFailed' | 'providerUnindexed' | 'providerSemanticsApproximate' | 'partialResult' | 'contentTruncated' | 'matchTruncated' | 'planTruncated' | 'budgetExhausted' | 'parserFailed' | 'partialParse' | 'signatureUnsupported' | 'lspUnavailable' | 'staleCache' | 'sanitized' | 'rateLimited' | 'zeroMatches';
251
+ export type DiagnosticCode = 'invalidQuery' | 'ambiguousSugar' | 'unknownField' | 'unsupportedTarget' | 'unsupportedPredicate' | 'unsupportedBoolean' | 'unsupportedScope' | 'negativeUniverseRequired' | 'residualNotExact' | 'fieldTypeMismatch' | 'requiresMaterialization' | 'vendorNoEquivalent' | 'lossyTransform' | 'unsupportedVendorPredicate' | 'responseShapeMismatch' | 'materializationNotAllowed' | 'materializationFailed' | 'providerUnindexed' | 'providerSemanticsApproximate' | 'partialResult' | 'contentTruncated' | 'matchTruncated' | 'planTruncated' | 'budgetExhausted' | 'parserFailed' | 'partialParse' | 'signatureUnsupported' | 'lspUnavailable' | 'staleCache' | 'sanitized' | 'rateLimited' | 'authRequired' | 'zeroMatches' | 'symbolNotFound';
242
252
  export interface OqlDiagnostic {
243
253
  code: DiagnosticCode;
244
254
  severity: 'info' | 'warning' | 'error';
@@ -1,47 +1,16 @@
1
1
  import { CallToolResult } from '@modelcontextprotocol/sdk/types';
2
2
  import type { BulkToolResponse } from './types/bulk.js';
3
3
  import type { StructuredToolResponse } from './types/toolResults.js';
4
- import type { RoleContentBlock, RoleBasedResultOptions } from './types/responseTypes.js';
5
- export { StatusEmojis } from './types/responseTypes.js';
6
- export type { ContentRole, RoleContentBlock, RoleBasedResultOptions, RoleAnnotations, } from './types/responseTypes.js';
7
4
  export type CallToolResultOutputMode = 'text' | 'json';
8
5
  export declare function createResult(options: {
9
6
  data: unknown;
10
7
  instructions?: string;
11
8
  isError?: boolean;
12
9
  }): CallToolResult;
13
- export declare const ContentBuilder: {
14
- system(text: string, priority?: number): RoleContentBlock;
15
- assistant(text: string, priority?: number): RoleContentBlock;
16
- user(text: string, priority?: number): RoleContentBlock;
17
- data(data: unknown, format?: "yaml" | "json"): RoleContentBlock;
18
- };
19
- export declare const StatusEmoji: {
20
- readonly success: "✅";
21
- readonly empty: "📭";
22
- readonly error: "❌";
23
- readonly partial: "⚠️";
24
- readonly searching: "🔍";
25
- readonly loading: "⏳";
26
- readonly info: "ℹ️";
27
- readonly file: "📄";
28
- readonly folder: "📁";
29
- readonly page: "📃";
30
- readonly definition: "🎯";
31
- readonly reference: "🔗";
32
- readonly call: "📞";
33
- };
34
- export declare function createRoleBasedResult(options: RoleBasedResultOptions): CallToolResult;
35
- export declare const QuickResult: {
36
- success(summary: string, data: unknown, hints?: string[]): CallToolResult;
37
- empty(message: string, hints?: string[]): CallToolResult;
38
- error(error: string, details?: unknown): CallToolResult;
39
- paginated(summary: string, data: unknown, pagination: {
40
- page: number;
41
- total: number;
42
- hasMore: boolean;
43
- }, hints?: string[]): CallToolResult;
44
- };
45
10
  export declare function sanitizeStructuredContent(obj: unknown): unknown;
46
11
  export declare function formatCallToolResultForOutput(result: Pick<CallToolResult, 'content' | 'structuredContent' | 'isError'>, outputMode: CallToolResultOutputMode): string;
47
12
  export declare function createResponseFormat(responseData: StructuredToolResponse | BulkToolResponse, keysPriority?: string[]): string;
13
+ export declare function cleanJsonObject(obj: unknown, context?: {
14
+ inFilesObject?: boolean;
15
+ depth?: number;
16
+ }): unknown;