@ctxprotocol/sdk 0.13.1 → 0.14.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 -10
- package/dist/client/index.cjs +3 -42
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +4 -5
- package/dist/client/index.d.ts +4 -5
- package/dist/client/index.js +3 -42
- 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 +3 -42
- 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 +3 -42
- package/dist/index.js.map +1 -1
- package/dist/{types-BStHo4tI.d.cts → types-jbYPIQxq.d.cts} +155 -107
- package/dist/{types-BStHo4tI.d.ts → types-jbYPIQxq.d.ts} +155 -107
- package/package.json +1 -1
package/dist/client/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ak as UpdateToolOptions, al as UpdateToolResult, T as Tool, J as SearchOptions, K as ExecuteOptions, U as ExecutionResult, L as ExecuteSessionStartOptions, P as ExecuteSessionResult, a1 as QueryOptions, a2 as QueryResult, ae as QueryStreamEvent, D as ContextClientOptions } from '../types-jbYPIQxq.cjs';
|
|
2
|
+
export { aB as ALLOWED_TOOL_CATEGORIES, B as ContextError, am as ContextErrorCode, W as ExecuteApiErrorResponse, X as ExecuteApiResponse, V as ExecuteApiSuccessResponse, Z as ExecuteSessionApiResponse, Y as ExecuteSessionApiSuccessResponse, O as ExecuteSessionSpend, N as ExecuteSessionStatus, M as McpTool, G as McpToolMeta, H as McpToolRateLimitHints, ad as QueryApiResponse, ac as QueryApiSuccessResponse, ao as QueryAssumptionMetadata, _ as QueryAttemptForkReason, $ as QueryAttemptReference, an as QueryCapabilityMissPayload, ay as QueryChartAxis, at as QueryChartAxisType, aw as QueryChartDataRow, av as QueryChartDataValue, ax as QueryChartSeries, as as QueryChartSeriesType, az as QueryChartSpec, ar as QueryChartType, au as QueryChartValueFormat, a6 as QueryCompletenessRepairEvent, aq as QueryComputedArtifact, a5 as QueryCost, Q as QueryDeveloperTrace, a7 as QueryDeveloperTraceDiagnostics, ab as QueryDeveloperTraceLoopInfo, a9 as QueryDeveloperTraceStep, a8 as QueryDeveloperTraceSummary, aa as QueryDeveloperTraceToolRef, a0 as QueryForkReference, ap as QueryOutcomeType, a3 as QuerySessionState, ah as QueryStreamDeveloperTraceEvent, ai as QueryStreamDoneEvent, aj as QueryStreamErrorEvent, ag as QueryStreamTextDeltaEvent, af as QueryStreamToolStatusEvent, a4 as QueryToolUsage, I as SearchResponse, E as SuggestedPrompt, F as SuggestedPromptSource, aA as ToolCategory } from '../types-jbYPIQxq.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Developer resource for managing tool listings on the Context Protocol marketplace.
|
|
@@ -125,7 +125,7 @@ declare class Tools {
|
|
|
125
125
|
* Unlike `tools.execute()` which calls a single tool once (pay-per-request),
|
|
126
126
|
* the Query resource sends a natural-language question and lets the server
|
|
127
127
|
* handle the live librarian pipeline (`discover -> select -> metadata scout ->
|
|
128
|
-
*
|
|
128
|
+
* iterative execute -> synthesize -> settle`) plus AI
|
|
129
129
|
* synthesis — all for one flat fee.
|
|
130
130
|
*
|
|
131
131
|
* This is the "prepared meal" vs "raw ingredients" distinction:
|
|
@@ -136,7 +136,6 @@ declare class Query {
|
|
|
136
136
|
private client;
|
|
137
137
|
constructor(client: ContextClient);
|
|
138
138
|
private normalizeResult;
|
|
139
|
-
private buildPolicyErrorEvent;
|
|
140
139
|
private buildSyntheticTraceFromRunResult;
|
|
141
140
|
private buildSyntheticTraceFromStreamStatus;
|
|
142
141
|
private mergeDeveloperTrace;
|
|
@@ -261,7 +260,7 @@ declare class ContextClient {
|
|
|
261
260
|
*
|
|
262
261
|
* Unlike `tools.execute()` which calls a single tool once, `query` sends
|
|
263
262
|
* a natural-language question and lets the server handle discovery,
|
|
264
|
-
* metadata scout,
|
|
263
|
+
* metadata scout, iterative execution, and AI synthesis —
|
|
265
264
|
* one flat fee.
|
|
266
265
|
*/
|
|
267
266
|
readonly query: Query;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ak as UpdateToolOptions, al as UpdateToolResult, T as Tool, J as SearchOptions, K as ExecuteOptions, U as ExecutionResult, L as ExecuteSessionStartOptions, P as ExecuteSessionResult, a1 as QueryOptions, a2 as QueryResult, ae as QueryStreamEvent, D as ContextClientOptions } from '../types-jbYPIQxq.js';
|
|
2
|
+
export { aB as ALLOWED_TOOL_CATEGORIES, B as ContextError, am as ContextErrorCode, W as ExecuteApiErrorResponse, X as ExecuteApiResponse, V as ExecuteApiSuccessResponse, Z as ExecuteSessionApiResponse, Y as ExecuteSessionApiSuccessResponse, O as ExecuteSessionSpend, N as ExecuteSessionStatus, M as McpTool, G as McpToolMeta, H as McpToolRateLimitHints, ad as QueryApiResponse, ac as QueryApiSuccessResponse, ao as QueryAssumptionMetadata, _ as QueryAttemptForkReason, $ as QueryAttemptReference, an as QueryCapabilityMissPayload, ay as QueryChartAxis, at as QueryChartAxisType, aw as QueryChartDataRow, av as QueryChartDataValue, ax as QueryChartSeries, as as QueryChartSeriesType, az as QueryChartSpec, ar as QueryChartType, au as QueryChartValueFormat, a6 as QueryCompletenessRepairEvent, aq as QueryComputedArtifact, a5 as QueryCost, Q as QueryDeveloperTrace, a7 as QueryDeveloperTraceDiagnostics, ab as QueryDeveloperTraceLoopInfo, a9 as QueryDeveloperTraceStep, a8 as QueryDeveloperTraceSummary, aa as QueryDeveloperTraceToolRef, a0 as QueryForkReference, ap as QueryOutcomeType, a3 as QuerySessionState, ah as QueryStreamDeveloperTraceEvent, ai as QueryStreamDoneEvent, aj as QueryStreamErrorEvent, ag as QueryStreamTextDeltaEvent, af as QueryStreamToolStatusEvent, a4 as QueryToolUsage, I as SearchResponse, E as SuggestedPrompt, F as SuggestedPromptSource, aA as ToolCategory } from '../types-jbYPIQxq.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Developer resource for managing tool listings on the Context Protocol marketplace.
|
|
@@ -125,7 +125,7 @@ declare class Tools {
|
|
|
125
125
|
* Unlike `tools.execute()` which calls a single tool once (pay-per-request),
|
|
126
126
|
* the Query resource sends a natural-language question and lets the server
|
|
127
127
|
* handle the live librarian pipeline (`discover -> select -> metadata scout ->
|
|
128
|
-
*
|
|
128
|
+
* iterative execute -> synthesize -> settle`) plus AI
|
|
129
129
|
* synthesis — all for one flat fee.
|
|
130
130
|
*
|
|
131
131
|
* This is the "prepared meal" vs "raw ingredients" distinction:
|
|
@@ -136,7 +136,6 @@ declare class Query {
|
|
|
136
136
|
private client;
|
|
137
137
|
constructor(client: ContextClient);
|
|
138
138
|
private normalizeResult;
|
|
139
|
-
private buildPolicyErrorEvent;
|
|
140
139
|
private buildSyntheticTraceFromRunResult;
|
|
141
140
|
private buildSyntheticTraceFromStreamStatus;
|
|
142
141
|
private mergeDeveloperTrace;
|
|
@@ -261,7 +260,7 @@ declare class ContextClient {
|
|
|
261
260
|
*
|
|
262
261
|
* Unlike `tools.execute()` which calls a single tool once, `query` sends
|
|
263
262
|
* a natural-language question and lets the server handle discovery,
|
|
264
|
-
* metadata scout,
|
|
263
|
+
* metadata scout, iterative execution, and AI synthesis —
|
|
265
264
|
* one flat fee.
|
|
266
265
|
*/
|
|
267
266
|
readonly query: Query;
|
package/dist/client/index.js
CHANGED
|
@@ -51,9 +51,9 @@ var Developer = class {
|
|
|
51
51
|
if (!toolId) {
|
|
52
52
|
throw new ContextError("toolId is required");
|
|
53
53
|
}
|
|
54
|
-
if (updates.name === void 0 && updates.description === void 0 && updates.category === void 0) {
|
|
54
|
+
if (updates.name === void 0 && updates.description === void 0 && updates.suggestedPrompts === void 0 && updates.category === void 0) {
|
|
55
55
|
throw new ContextError(
|
|
56
|
-
"At least one field required: name, description, or category"
|
|
56
|
+
"At least one field required: name, description, suggestedPrompts, or category"
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
if (updates.category !== void 0 && updates.category !== null && !ALLOWED_TOOL_CATEGORIES.includes(updates.category)) {
|
|
@@ -302,9 +302,6 @@ var Query = class {
|
|
|
302
302
|
}
|
|
303
303
|
normalizeResult(result) {
|
|
304
304
|
const candidate = result;
|
|
305
|
-
if (candidate.outcomeType === "clarification_required" && "clarification" in candidate && candidate.clarification) {
|
|
306
|
-
return candidate;
|
|
307
|
-
}
|
|
308
305
|
if (candidate.outcomeType === "capability_miss" && "capabilityMiss" in candidate && candidate.capabilityMiss) {
|
|
309
306
|
return candidate;
|
|
310
307
|
}
|
|
@@ -313,34 +310,6 @@ var Query = class {
|
|
|
313
310
|
outcomeType: "answer"
|
|
314
311
|
};
|
|
315
312
|
}
|
|
316
|
-
buildPolicyErrorEvent(params) {
|
|
317
|
-
if (params.clarificationPolicy !== "error") {
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
if (params.result.outcomeType === "clarification_required") {
|
|
321
|
-
return {
|
|
322
|
-
type: "error",
|
|
323
|
-
error: params.result.response,
|
|
324
|
-
code: "clarification_required",
|
|
325
|
-
reasonCode: "clarification_required",
|
|
326
|
-
outcomeType: "clarification_required",
|
|
327
|
-
clarification: params.result.clarification,
|
|
328
|
-
querySession: params.result.querySession
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
if (params.result.outcomeType === "capability_miss") {
|
|
332
|
-
return {
|
|
333
|
-
type: "error",
|
|
334
|
-
error: params.result.response,
|
|
335
|
-
code: "capability_miss",
|
|
336
|
-
reasonCode: "capability_miss",
|
|
337
|
-
outcomeType: "capability_miss",
|
|
338
|
-
capabilityMiss: params.result.capabilityMiss,
|
|
339
|
-
querySession: params.result.querySession
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
return void 0;
|
|
343
|
-
}
|
|
344
313
|
buildSyntheticTraceFromRunResult(params) {
|
|
345
314
|
const timeline = params.toolsUsed.map((tool, index) => ({
|
|
346
315
|
stepType: "tool-call",
|
|
@@ -554,7 +523,6 @@ var Query = class {
|
|
|
554
523
|
tools: opts.tools,
|
|
555
524
|
resumeFrom: opts.resumeFrom,
|
|
556
525
|
forkFrom: opts.forkFrom,
|
|
557
|
-
clarificationPolicy: opts.clarificationPolicy,
|
|
558
526
|
answerModelId: opts.answerModelId,
|
|
559
527
|
responseShape: opts.responseShape,
|
|
560
528
|
favoritesOnly: opts.favoritesOnly,
|
|
@@ -612,13 +580,6 @@ var Query = class {
|
|
|
612
580
|
normalizedResult.developerTrace = mergedTrace;
|
|
613
581
|
}
|
|
614
582
|
event.result = normalizedResult;
|
|
615
|
-
const policyErrorEvent = this.buildPolicyErrorEvent({
|
|
616
|
-
result: normalizedResult,
|
|
617
|
-
clarificationPolicy: opts.clarificationPolicy
|
|
618
|
-
});
|
|
619
|
-
if (policyErrorEvent) {
|
|
620
|
-
return policyErrorEvent;
|
|
621
|
-
}
|
|
622
583
|
}
|
|
623
584
|
return event;
|
|
624
585
|
};
|
|
@@ -689,7 +650,7 @@ var ContextClient = class {
|
|
|
689
650
|
*
|
|
690
651
|
* Unlike `tools.execute()` which calls a single tool once, `query` sends
|
|
691
652
|
* a natural-language question and lets the server handle discovery,
|
|
692
|
-
* metadata scout,
|
|
653
|
+
* metadata scout, iterative execution, and AI synthesis —
|
|
693
654
|
* one flat fee.
|
|
694
655
|
*/
|
|
695
656
|
query;
|