@ctxprotocol/sdk 0.11.1 → 0.13.0
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/README.md +10 -14
- package/dist/client/index.cjs +7 -4
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +8 -6
- package/dist/client/index.d.ts +8 -6
- package/dist/client/index.js +7 -4
- package/dist/client/index.js.map +1 -1
- package/dist/contrib/search/index.d.cts +2 -2
- package/dist/contrib/search/index.d.ts +2 -2
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/{types-DRbq-FA6.d.cts → types-DPxI353c.d.cts} +71 -56
- package/dist/{types-DRbq-FA6.d.ts → types-DPxI353c.d.ts} +71 -56
- package/package.json +1 -1
|
@@ -221,7 +221,7 @@ interface McpToolRateLimitHints {
|
|
|
221
221
|
supportsBulk?: boolean;
|
|
222
222
|
/** Preferred batch-oriented methods to call instead of fan-out loops */
|
|
223
223
|
recommendedBatchTools?: string[];
|
|
224
|
-
/** Optional human-readable notes for
|
|
224
|
+
/** Optional human-readable notes for execution behavior */
|
|
225
225
|
notes?: string;
|
|
226
226
|
}
|
|
227
227
|
type DiscoveryMode = "query" | "execute";
|
|
@@ -237,7 +237,7 @@ interface McpToolMeta {
|
|
|
237
237
|
surface?: McpToolSurface;
|
|
238
238
|
/** Whether this method can be selected in query mode */
|
|
239
239
|
queryEligible?: boolean;
|
|
240
|
-
/** Declared latency class for
|
|
240
|
+
/** Declared latency class for metadata-scout/runtime gating */
|
|
241
241
|
latencyClass?: McpToolLatencyClass;
|
|
242
242
|
/** Method-level pricing metadata */
|
|
243
243
|
pricing?: McpToolPricingMeta;
|
|
@@ -248,7 +248,7 @@ interface McpToolMeta {
|
|
|
248
248
|
/** Context injection requirements handled by the Context runtime */
|
|
249
249
|
contextRequirements?: string[];
|
|
250
250
|
/**
|
|
251
|
-
* Optional
|
|
251
|
+
* Optional metadata-scout/runtime pacing hints.
|
|
252
252
|
* Tool contributors can publish these to reduce rate-limit failures.
|
|
253
253
|
*/
|
|
254
254
|
rateLimit?: McpToolRateLimitHints;
|
|
@@ -363,6 +363,13 @@ interface SearchOptions {
|
|
|
363
363
|
excludeLatencyClasses?: McpToolLatencyClass[];
|
|
364
364
|
/** Convenience switch to exclude slow methods in query mode */
|
|
365
365
|
excludeSlow?: boolean;
|
|
366
|
+
/**
|
|
367
|
+
* Restrict discovery to the caller's favorite tools.
|
|
368
|
+
* - `true`: force favorites-only discovery for this request
|
|
369
|
+
* - `false`: force unrestricted discovery for this request
|
|
370
|
+
* - omitted: use the account-level default from Context settings
|
|
371
|
+
*/
|
|
372
|
+
favoritesOnly?: boolean;
|
|
366
373
|
}
|
|
367
374
|
/**
|
|
368
375
|
* Options for updating a tool listing via `client.developer.updateTool()`.
|
|
@@ -505,8 +512,6 @@ interface ExecutionResult<T = unknown> {
|
|
|
505
512
|
/** Execution duration in milliseconds */
|
|
506
513
|
durationMs: number;
|
|
507
514
|
}
|
|
508
|
-
/** Supported orchestration depth modes for query execution. */
|
|
509
|
-
type QueryDepth = "fast" | "auto" | "deep";
|
|
510
515
|
type QueryDeepMode = "deep" | "deep-light" | "deep-heavy";
|
|
511
516
|
type QueryClarificationPolicy = "return" | "auto" | "error";
|
|
512
517
|
type QueryOutcomeType = "answer" | "clarification_required" | "capability_miss";
|
|
@@ -602,19 +607,22 @@ interface QueryClarificationDiagnostics {
|
|
|
602
607
|
* Options for the agentic query endpoint (pay-per-response).
|
|
603
608
|
*
|
|
604
609
|
* Unlike `execute()` which calls a single tool once, `query()` sends a
|
|
605
|
-
* natural-language question and lets the server handle
|
|
606
|
-
*
|
|
607
|
-
*
|
|
610
|
+
* natural-language question and lets the server handle the live librarian
|
|
611
|
+
* pipeline (`discover -> select -> metadata scout -> clarify if needed ->
|
|
612
|
+
* iterative execute -> synthesize -> settle`).
|
|
608
613
|
* One flat fee covers up to 100 MCP skill calls per tool.
|
|
609
614
|
*/
|
|
610
615
|
interface QueryOptions {
|
|
611
616
|
/** The natural-language question to answer */
|
|
612
617
|
query: string;
|
|
613
618
|
/**
|
|
614
|
-
* How the SDK should handle clarification-required
|
|
619
|
+
* How the SDK should handle clarification-required situations:
|
|
615
620
|
* - `return`: surface a structured clarification result to the caller
|
|
616
621
|
* - `auto`: enable clarification auto-select and continue with the server's deterministic recommended option
|
|
617
622
|
* - `error`: turn structured clarification/capability outcomes into terminal errors
|
|
623
|
+
*
|
|
624
|
+
* Default behavior is surface-dependent: headless SDK and MCP callers default
|
|
625
|
+
* to `auto`, while first-party chat defaults to `return`.
|
|
618
626
|
*/
|
|
619
627
|
clarificationPolicy?: QueryClarificationPolicy;
|
|
620
628
|
/**
|
|
@@ -623,6 +631,14 @@ interface QueryOptions {
|
|
|
623
631
|
* (Manual Mode).
|
|
624
632
|
*/
|
|
625
633
|
tools?: string[];
|
|
634
|
+
/**
|
|
635
|
+
* Restrict auto-discovery to the caller's favorite tools.
|
|
636
|
+
* Ignored when `tools` is provided because manual tool selection wins.
|
|
637
|
+
* - `true`: force favorites-only discovery for this request
|
|
638
|
+
* - `false`: force unrestricted discovery for this request
|
|
639
|
+
* - omitted: use the account-level default from Context settings
|
|
640
|
+
*/
|
|
641
|
+
favoritesOnly?: boolean;
|
|
626
642
|
/**
|
|
627
643
|
* Resume a prior durable query attempt from its latest checkpoint.
|
|
628
644
|
* Cannot be combined with `tools` or `forkFrom`.
|
|
@@ -662,23 +678,10 @@ interface QueryOptions {
|
|
|
662
678
|
/**
|
|
663
679
|
* Include machine-readable developer trace output for this query response.
|
|
664
680
|
* When enabled, the server may return summary counters plus diagnostics
|
|
665
|
-
* for lane selection, scout
|
|
681
|
+
* for lane selection, metadata scout adequacy, clarification, and iterative
|
|
682
|
+
* execution behavior.
|
|
666
683
|
*/
|
|
667
684
|
includeDeveloperTrace?: boolean;
|
|
668
|
-
/**
|
|
669
|
-
* Query orchestration depth mode:
|
|
670
|
-
* - `fast`: lower-latency path
|
|
671
|
-
* - `auto`: server decides between fast/deep
|
|
672
|
-
* - `deep`: full completeness-oriented path
|
|
673
|
-
*/
|
|
674
|
-
queryDepth?: QueryDepth;
|
|
675
|
-
/**
|
|
676
|
-
* Development/testing only: force the server's internal deep lane.
|
|
677
|
-
* `deep` is the canonical value. Legacy `deep-light` / `deep-heavy`
|
|
678
|
-
* aliases are still accepted temporarily for compatibility and normalize
|
|
679
|
-
* to the same runtime lane. Invalid when `queryDepth` is `fast`.
|
|
680
|
-
*/
|
|
681
|
-
debugScoutDeepMode?: QueryDeepMode;
|
|
682
685
|
/**
|
|
683
686
|
* Optional idempotency key (UUID recommended).
|
|
684
687
|
* Reuse the same key when retrying the same logical request.
|
|
@@ -704,7 +707,7 @@ interface QueryDeveloperTraceLoopInfo {
|
|
|
704
707
|
[key: string]: unknown;
|
|
705
708
|
}
|
|
706
709
|
/**
|
|
707
|
-
* Tool selection metadata attached to discovery
|
|
710
|
+
* Tool selection metadata attached to discovery and metadata-scout diagnostics.
|
|
708
711
|
*/
|
|
709
712
|
interface QueryDeveloperTraceToolSelection {
|
|
710
713
|
toolId: string;
|
|
@@ -715,7 +718,7 @@ interface QueryDeveloperTraceToolSelection {
|
|
|
715
718
|
priceUsd?: string;
|
|
716
719
|
}
|
|
717
720
|
/**
|
|
718
|
-
*
|
|
721
|
+
* Execution-contract details handed to the iterative runtime.
|
|
719
722
|
*/
|
|
720
723
|
interface QueryPlanningTraceDiagnostic {
|
|
721
724
|
plannerQuery: string;
|
|
@@ -723,25 +726,6 @@ interface QueryPlanningTraceDiagnostic {
|
|
|
723
726
|
scoutEvidencePromptBlock: string | null;
|
|
724
727
|
allowedModules: string[];
|
|
725
728
|
}
|
|
726
|
-
/**
|
|
727
|
-
* Rediscovery/fallback diagnostic details.
|
|
728
|
-
*/
|
|
729
|
-
interface QueryRediscoveryTraceDiagnostic {
|
|
730
|
-
considered: boolean;
|
|
731
|
-
executed: boolean;
|
|
732
|
-
skipReason: string | null;
|
|
733
|
-
missingCapability: string | null;
|
|
734
|
-
rediscoveryQuery: string | null;
|
|
735
|
-
capabilityLooksLikeSearchNeed: boolean;
|
|
736
|
-
allowSearchFallbackOnElapsedCap: boolean;
|
|
737
|
-
searchFallbackUsed: boolean;
|
|
738
|
-
preRediscoveryBudgetReasonCode: string | null;
|
|
739
|
-
candidateSearchResults: QueryDeveloperTraceToolSelection[];
|
|
740
|
-
selectedAlternatives: QueryDeveloperTraceToolSelection[];
|
|
741
|
-
mergedTools: QueryDeveloperTraceToolSelection[];
|
|
742
|
-
usingPaidFallback: boolean;
|
|
743
|
-
branchPlan: QueryPlanningTraceDiagnostic | null;
|
|
744
|
-
}
|
|
745
729
|
interface QueryCompletenessRepairEvent {
|
|
746
730
|
attempt: number;
|
|
747
731
|
outcome: "attempted" | "skipped_by_guardrail" | "skipped_no_retry_budget" | "skipped_needs_different_tools" | "skipped_no_retry_path" | "patch_failed" | "replan_failed" | "patched" | "replanned";
|
|
@@ -762,16 +746,15 @@ interface QueryCompletenessRepairEvent {
|
|
|
762
746
|
}>;
|
|
763
747
|
}
|
|
764
748
|
/**
|
|
765
|
-
* Rich developer-trace diagnostics for
|
|
749
|
+
* Rich developer-trace diagnostics for managed query-runtime internals.
|
|
766
750
|
*/
|
|
767
751
|
interface QueryDeveloperTraceDiagnostics {
|
|
768
752
|
selection: {
|
|
769
|
-
|
|
770
|
-
deepMode: string | null;
|
|
753
|
+
selectedPolicy: string;
|
|
771
754
|
debugScoutDeepMode: string | null;
|
|
772
755
|
plannerReasoningStage: string;
|
|
773
756
|
scoutEnabled: boolean;
|
|
774
|
-
|
|
757
|
+
oneShotBias: boolean;
|
|
775
758
|
candidateMethodCount: number;
|
|
776
759
|
scoutProbeStatus: string;
|
|
777
760
|
scoutProbeAdequacy: string;
|
|
@@ -786,8 +769,7 @@ interface QueryDeveloperTraceDiagnostics {
|
|
|
786
769
|
scoutPrePlanProbeBudgetReasonCode: string | null;
|
|
787
770
|
scoutChangedInitialPlan: boolean;
|
|
788
771
|
scoutChangedPlannerReasoningStage: boolean;
|
|
789
|
-
|
|
790
|
-
scoutInitialDeepMode: string | null;
|
|
772
|
+
scoutInitialSelectedPolicy: string;
|
|
791
773
|
scoutInitialPlannerReasoningStage: string;
|
|
792
774
|
scoutInitialReasonCode: string;
|
|
793
775
|
scoutFinalReasonCode: string;
|
|
@@ -797,9 +779,7 @@ interface QueryDeveloperTraceDiagnostics {
|
|
|
797
779
|
scoutLlmSelectionLatencyMs: number | null;
|
|
798
780
|
selectedTools: QueryDeveloperTraceToolSelection[];
|
|
799
781
|
};
|
|
800
|
-
|
|
801
|
-
initial: QueryPlanningTraceDiagnostic;
|
|
802
|
-
};
|
|
782
|
+
executionContract?: QueryPlanningTraceDiagnostic;
|
|
803
783
|
cost?: {
|
|
804
784
|
planningCostUsd: number;
|
|
805
785
|
initialExecutionCostUsd: number;
|
|
@@ -809,13 +789,20 @@ interface QueryDeveloperTraceDiagnostics {
|
|
|
809
789
|
toolCostUsd: number;
|
|
810
790
|
totalChargedUsd: number;
|
|
811
791
|
};
|
|
812
|
-
|
|
792
|
+
verification: {
|
|
813
793
|
evaluations: unknown[];
|
|
814
794
|
repairEvents: QueryCompletenessRepairEvent[];
|
|
815
795
|
triggerNeedsDifferentTools: boolean;
|
|
816
796
|
triggerMissingCapability: string | null;
|
|
817
797
|
};
|
|
818
|
-
|
|
798
|
+
execution?: {
|
|
799
|
+
reasoningEnabled: boolean;
|
|
800
|
+
receivedReasoning: boolean;
|
|
801
|
+
reasoningChars: number;
|
|
802
|
+
scoutEvidenceInjected: boolean;
|
|
803
|
+
stepBudget: number;
|
|
804
|
+
completedStepCount: number;
|
|
805
|
+
};
|
|
819
806
|
clarification?: QueryClarificationDiagnostics;
|
|
820
807
|
contributorSearches?: ContributorSearchTraceRecord[];
|
|
821
808
|
[key: string]: unknown;
|
|
@@ -849,6 +836,25 @@ interface QueryDeveloperTraceSummary {
|
|
|
849
836
|
loopCount?: number;
|
|
850
837
|
[key: string]: unknown;
|
|
851
838
|
}
|
|
839
|
+
/**
|
|
840
|
+
* Full tool call record (untruncated) for debugging.
|
|
841
|
+
*/
|
|
842
|
+
interface QueryDeveloperTraceToolCall {
|
|
843
|
+
toolId?: string;
|
|
844
|
+
toolName: string;
|
|
845
|
+
args?: unknown;
|
|
846
|
+
result: unknown;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* MCP method schema exposed in the developer trace.
|
|
850
|
+
*/
|
|
851
|
+
interface QueryDeveloperTraceToolSchema {
|
|
852
|
+
serverName: string;
|
|
853
|
+
toolName: string;
|
|
854
|
+
description: string;
|
|
855
|
+
inputSchema?: Record<string, unknown>;
|
|
856
|
+
outputSchema?: Record<string, unknown>;
|
|
857
|
+
}
|
|
852
858
|
/**
|
|
853
859
|
* Developer Mode trace payload returned per query response (opt-in).
|
|
854
860
|
*/
|
|
@@ -859,6 +865,15 @@ interface QueryDeveloperTrace {
|
|
|
859
865
|
query?: string;
|
|
860
866
|
source?: string;
|
|
861
867
|
diagnostics?: QueryDeveloperTraceDiagnostics;
|
|
868
|
+
initialCode?: string;
|
|
869
|
+
finalCode?: string;
|
|
870
|
+
executionTrace?: unknown[];
|
|
871
|
+
executionProgram?: unknown;
|
|
872
|
+
attemptCount?: number;
|
|
873
|
+
executionSuccess?: boolean;
|
|
874
|
+
executionResult?: unknown;
|
|
875
|
+
toolCallHistory?: QueryDeveloperTraceToolCall[];
|
|
876
|
+
toolSchemas?: QueryDeveloperTraceToolSchema[];
|
|
862
877
|
[key: string]: unknown;
|
|
863
878
|
}
|
|
864
879
|
/**
|
|
@@ -221,7 +221,7 @@ interface McpToolRateLimitHints {
|
|
|
221
221
|
supportsBulk?: boolean;
|
|
222
222
|
/** Preferred batch-oriented methods to call instead of fan-out loops */
|
|
223
223
|
recommendedBatchTools?: string[];
|
|
224
|
-
/** Optional human-readable notes for
|
|
224
|
+
/** Optional human-readable notes for execution behavior */
|
|
225
225
|
notes?: string;
|
|
226
226
|
}
|
|
227
227
|
type DiscoveryMode = "query" | "execute";
|
|
@@ -237,7 +237,7 @@ interface McpToolMeta {
|
|
|
237
237
|
surface?: McpToolSurface;
|
|
238
238
|
/** Whether this method can be selected in query mode */
|
|
239
239
|
queryEligible?: boolean;
|
|
240
|
-
/** Declared latency class for
|
|
240
|
+
/** Declared latency class for metadata-scout/runtime gating */
|
|
241
241
|
latencyClass?: McpToolLatencyClass;
|
|
242
242
|
/** Method-level pricing metadata */
|
|
243
243
|
pricing?: McpToolPricingMeta;
|
|
@@ -248,7 +248,7 @@ interface McpToolMeta {
|
|
|
248
248
|
/** Context injection requirements handled by the Context runtime */
|
|
249
249
|
contextRequirements?: string[];
|
|
250
250
|
/**
|
|
251
|
-
* Optional
|
|
251
|
+
* Optional metadata-scout/runtime pacing hints.
|
|
252
252
|
* Tool contributors can publish these to reduce rate-limit failures.
|
|
253
253
|
*/
|
|
254
254
|
rateLimit?: McpToolRateLimitHints;
|
|
@@ -363,6 +363,13 @@ interface SearchOptions {
|
|
|
363
363
|
excludeLatencyClasses?: McpToolLatencyClass[];
|
|
364
364
|
/** Convenience switch to exclude slow methods in query mode */
|
|
365
365
|
excludeSlow?: boolean;
|
|
366
|
+
/**
|
|
367
|
+
* Restrict discovery to the caller's favorite tools.
|
|
368
|
+
* - `true`: force favorites-only discovery for this request
|
|
369
|
+
* - `false`: force unrestricted discovery for this request
|
|
370
|
+
* - omitted: use the account-level default from Context settings
|
|
371
|
+
*/
|
|
372
|
+
favoritesOnly?: boolean;
|
|
366
373
|
}
|
|
367
374
|
/**
|
|
368
375
|
* Options for updating a tool listing via `client.developer.updateTool()`.
|
|
@@ -505,8 +512,6 @@ interface ExecutionResult<T = unknown> {
|
|
|
505
512
|
/** Execution duration in milliseconds */
|
|
506
513
|
durationMs: number;
|
|
507
514
|
}
|
|
508
|
-
/** Supported orchestration depth modes for query execution. */
|
|
509
|
-
type QueryDepth = "fast" | "auto" | "deep";
|
|
510
515
|
type QueryDeepMode = "deep" | "deep-light" | "deep-heavy";
|
|
511
516
|
type QueryClarificationPolicy = "return" | "auto" | "error";
|
|
512
517
|
type QueryOutcomeType = "answer" | "clarification_required" | "capability_miss";
|
|
@@ -602,19 +607,22 @@ interface QueryClarificationDiagnostics {
|
|
|
602
607
|
* Options for the agentic query endpoint (pay-per-response).
|
|
603
608
|
*
|
|
604
609
|
* Unlike `execute()` which calls a single tool once, `query()` sends a
|
|
605
|
-
* natural-language question and lets the server handle
|
|
606
|
-
*
|
|
607
|
-
*
|
|
610
|
+
* natural-language question and lets the server handle the live librarian
|
|
611
|
+
* pipeline (`discover -> select -> metadata scout -> clarify if needed ->
|
|
612
|
+
* iterative execute -> synthesize -> settle`).
|
|
608
613
|
* One flat fee covers up to 100 MCP skill calls per tool.
|
|
609
614
|
*/
|
|
610
615
|
interface QueryOptions {
|
|
611
616
|
/** The natural-language question to answer */
|
|
612
617
|
query: string;
|
|
613
618
|
/**
|
|
614
|
-
* How the SDK should handle clarification-required
|
|
619
|
+
* How the SDK should handle clarification-required situations:
|
|
615
620
|
* - `return`: surface a structured clarification result to the caller
|
|
616
621
|
* - `auto`: enable clarification auto-select and continue with the server's deterministic recommended option
|
|
617
622
|
* - `error`: turn structured clarification/capability outcomes into terminal errors
|
|
623
|
+
*
|
|
624
|
+
* Default behavior is surface-dependent: headless SDK and MCP callers default
|
|
625
|
+
* to `auto`, while first-party chat defaults to `return`.
|
|
618
626
|
*/
|
|
619
627
|
clarificationPolicy?: QueryClarificationPolicy;
|
|
620
628
|
/**
|
|
@@ -623,6 +631,14 @@ interface QueryOptions {
|
|
|
623
631
|
* (Manual Mode).
|
|
624
632
|
*/
|
|
625
633
|
tools?: string[];
|
|
634
|
+
/**
|
|
635
|
+
* Restrict auto-discovery to the caller's favorite tools.
|
|
636
|
+
* Ignored when `tools` is provided because manual tool selection wins.
|
|
637
|
+
* - `true`: force favorites-only discovery for this request
|
|
638
|
+
* - `false`: force unrestricted discovery for this request
|
|
639
|
+
* - omitted: use the account-level default from Context settings
|
|
640
|
+
*/
|
|
641
|
+
favoritesOnly?: boolean;
|
|
626
642
|
/**
|
|
627
643
|
* Resume a prior durable query attempt from its latest checkpoint.
|
|
628
644
|
* Cannot be combined with `tools` or `forkFrom`.
|
|
@@ -662,23 +678,10 @@ interface QueryOptions {
|
|
|
662
678
|
/**
|
|
663
679
|
* Include machine-readable developer trace output for this query response.
|
|
664
680
|
* When enabled, the server may return summary counters plus diagnostics
|
|
665
|
-
* for lane selection, scout
|
|
681
|
+
* for lane selection, metadata scout adequacy, clarification, and iterative
|
|
682
|
+
* execution behavior.
|
|
666
683
|
*/
|
|
667
684
|
includeDeveloperTrace?: boolean;
|
|
668
|
-
/**
|
|
669
|
-
* Query orchestration depth mode:
|
|
670
|
-
* - `fast`: lower-latency path
|
|
671
|
-
* - `auto`: server decides between fast/deep
|
|
672
|
-
* - `deep`: full completeness-oriented path
|
|
673
|
-
*/
|
|
674
|
-
queryDepth?: QueryDepth;
|
|
675
|
-
/**
|
|
676
|
-
* Development/testing only: force the server's internal deep lane.
|
|
677
|
-
* `deep` is the canonical value. Legacy `deep-light` / `deep-heavy`
|
|
678
|
-
* aliases are still accepted temporarily for compatibility and normalize
|
|
679
|
-
* to the same runtime lane. Invalid when `queryDepth` is `fast`.
|
|
680
|
-
*/
|
|
681
|
-
debugScoutDeepMode?: QueryDeepMode;
|
|
682
685
|
/**
|
|
683
686
|
* Optional idempotency key (UUID recommended).
|
|
684
687
|
* Reuse the same key when retrying the same logical request.
|
|
@@ -704,7 +707,7 @@ interface QueryDeveloperTraceLoopInfo {
|
|
|
704
707
|
[key: string]: unknown;
|
|
705
708
|
}
|
|
706
709
|
/**
|
|
707
|
-
* Tool selection metadata attached to discovery
|
|
710
|
+
* Tool selection metadata attached to discovery and metadata-scout diagnostics.
|
|
708
711
|
*/
|
|
709
712
|
interface QueryDeveloperTraceToolSelection {
|
|
710
713
|
toolId: string;
|
|
@@ -715,7 +718,7 @@ interface QueryDeveloperTraceToolSelection {
|
|
|
715
718
|
priceUsd?: string;
|
|
716
719
|
}
|
|
717
720
|
/**
|
|
718
|
-
*
|
|
721
|
+
* Execution-contract details handed to the iterative runtime.
|
|
719
722
|
*/
|
|
720
723
|
interface QueryPlanningTraceDiagnostic {
|
|
721
724
|
plannerQuery: string;
|
|
@@ -723,25 +726,6 @@ interface QueryPlanningTraceDiagnostic {
|
|
|
723
726
|
scoutEvidencePromptBlock: string | null;
|
|
724
727
|
allowedModules: string[];
|
|
725
728
|
}
|
|
726
|
-
/**
|
|
727
|
-
* Rediscovery/fallback diagnostic details.
|
|
728
|
-
*/
|
|
729
|
-
interface QueryRediscoveryTraceDiagnostic {
|
|
730
|
-
considered: boolean;
|
|
731
|
-
executed: boolean;
|
|
732
|
-
skipReason: string | null;
|
|
733
|
-
missingCapability: string | null;
|
|
734
|
-
rediscoveryQuery: string | null;
|
|
735
|
-
capabilityLooksLikeSearchNeed: boolean;
|
|
736
|
-
allowSearchFallbackOnElapsedCap: boolean;
|
|
737
|
-
searchFallbackUsed: boolean;
|
|
738
|
-
preRediscoveryBudgetReasonCode: string | null;
|
|
739
|
-
candidateSearchResults: QueryDeveloperTraceToolSelection[];
|
|
740
|
-
selectedAlternatives: QueryDeveloperTraceToolSelection[];
|
|
741
|
-
mergedTools: QueryDeveloperTraceToolSelection[];
|
|
742
|
-
usingPaidFallback: boolean;
|
|
743
|
-
branchPlan: QueryPlanningTraceDiagnostic | null;
|
|
744
|
-
}
|
|
745
729
|
interface QueryCompletenessRepairEvent {
|
|
746
730
|
attempt: number;
|
|
747
731
|
outcome: "attempted" | "skipped_by_guardrail" | "skipped_no_retry_budget" | "skipped_needs_different_tools" | "skipped_no_retry_path" | "patch_failed" | "replan_failed" | "patched" | "replanned";
|
|
@@ -762,16 +746,15 @@ interface QueryCompletenessRepairEvent {
|
|
|
762
746
|
}>;
|
|
763
747
|
}
|
|
764
748
|
/**
|
|
765
|
-
* Rich developer-trace diagnostics for
|
|
749
|
+
* Rich developer-trace diagnostics for managed query-runtime internals.
|
|
766
750
|
*/
|
|
767
751
|
interface QueryDeveloperTraceDiagnostics {
|
|
768
752
|
selection: {
|
|
769
|
-
|
|
770
|
-
deepMode: string | null;
|
|
753
|
+
selectedPolicy: string;
|
|
771
754
|
debugScoutDeepMode: string | null;
|
|
772
755
|
plannerReasoningStage: string;
|
|
773
756
|
scoutEnabled: boolean;
|
|
774
|
-
|
|
757
|
+
oneShotBias: boolean;
|
|
775
758
|
candidateMethodCount: number;
|
|
776
759
|
scoutProbeStatus: string;
|
|
777
760
|
scoutProbeAdequacy: string;
|
|
@@ -786,8 +769,7 @@ interface QueryDeveloperTraceDiagnostics {
|
|
|
786
769
|
scoutPrePlanProbeBudgetReasonCode: string | null;
|
|
787
770
|
scoutChangedInitialPlan: boolean;
|
|
788
771
|
scoutChangedPlannerReasoningStage: boolean;
|
|
789
|
-
|
|
790
|
-
scoutInitialDeepMode: string | null;
|
|
772
|
+
scoutInitialSelectedPolicy: string;
|
|
791
773
|
scoutInitialPlannerReasoningStage: string;
|
|
792
774
|
scoutInitialReasonCode: string;
|
|
793
775
|
scoutFinalReasonCode: string;
|
|
@@ -797,9 +779,7 @@ interface QueryDeveloperTraceDiagnostics {
|
|
|
797
779
|
scoutLlmSelectionLatencyMs: number | null;
|
|
798
780
|
selectedTools: QueryDeveloperTraceToolSelection[];
|
|
799
781
|
};
|
|
800
|
-
|
|
801
|
-
initial: QueryPlanningTraceDiagnostic;
|
|
802
|
-
};
|
|
782
|
+
executionContract?: QueryPlanningTraceDiagnostic;
|
|
803
783
|
cost?: {
|
|
804
784
|
planningCostUsd: number;
|
|
805
785
|
initialExecutionCostUsd: number;
|
|
@@ -809,13 +789,20 @@ interface QueryDeveloperTraceDiagnostics {
|
|
|
809
789
|
toolCostUsd: number;
|
|
810
790
|
totalChargedUsd: number;
|
|
811
791
|
};
|
|
812
|
-
|
|
792
|
+
verification: {
|
|
813
793
|
evaluations: unknown[];
|
|
814
794
|
repairEvents: QueryCompletenessRepairEvent[];
|
|
815
795
|
triggerNeedsDifferentTools: boolean;
|
|
816
796
|
triggerMissingCapability: string | null;
|
|
817
797
|
};
|
|
818
|
-
|
|
798
|
+
execution?: {
|
|
799
|
+
reasoningEnabled: boolean;
|
|
800
|
+
receivedReasoning: boolean;
|
|
801
|
+
reasoningChars: number;
|
|
802
|
+
scoutEvidenceInjected: boolean;
|
|
803
|
+
stepBudget: number;
|
|
804
|
+
completedStepCount: number;
|
|
805
|
+
};
|
|
819
806
|
clarification?: QueryClarificationDiagnostics;
|
|
820
807
|
contributorSearches?: ContributorSearchTraceRecord[];
|
|
821
808
|
[key: string]: unknown;
|
|
@@ -849,6 +836,25 @@ interface QueryDeveloperTraceSummary {
|
|
|
849
836
|
loopCount?: number;
|
|
850
837
|
[key: string]: unknown;
|
|
851
838
|
}
|
|
839
|
+
/**
|
|
840
|
+
* Full tool call record (untruncated) for debugging.
|
|
841
|
+
*/
|
|
842
|
+
interface QueryDeveloperTraceToolCall {
|
|
843
|
+
toolId?: string;
|
|
844
|
+
toolName: string;
|
|
845
|
+
args?: unknown;
|
|
846
|
+
result: unknown;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* MCP method schema exposed in the developer trace.
|
|
850
|
+
*/
|
|
851
|
+
interface QueryDeveloperTraceToolSchema {
|
|
852
|
+
serverName: string;
|
|
853
|
+
toolName: string;
|
|
854
|
+
description: string;
|
|
855
|
+
inputSchema?: Record<string, unknown>;
|
|
856
|
+
outputSchema?: Record<string, unknown>;
|
|
857
|
+
}
|
|
852
858
|
/**
|
|
853
859
|
* Developer Mode trace payload returned per query response (opt-in).
|
|
854
860
|
*/
|
|
@@ -859,6 +865,15 @@ interface QueryDeveloperTrace {
|
|
|
859
865
|
query?: string;
|
|
860
866
|
source?: string;
|
|
861
867
|
diagnostics?: QueryDeveloperTraceDiagnostics;
|
|
868
|
+
initialCode?: string;
|
|
869
|
+
finalCode?: string;
|
|
870
|
+
executionTrace?: unknown[];
|
|
871
|
+
executionProgram?: unknown;
|
|
872
|
+
attemptCount?: number;
|
|
873
|
+
executionSuccess?: boolean;
|
|
874
|
+
executionResult?: unknown;
|
|
875
|
+
toolCallHistory?: QueryDeveloperTraceToolCall[];
|
|
876
|
+
toolSchemas?: QueryDeveloperTraceToolSchema[];
|
|
862
877
|
[key: string]: unknown;
|
|
863
878
|
}
|
|
864
879
|
/**
|
package/package.json
CHANGED