@goodtiming/baton-sdk 0.6.5 → 0.6.6
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 +2 -0
- package/dist/index.cjs +12 -8
- 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 +12 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var SDK_VERSION = "ts-0.6.
|
|
2
|
+
var SDK_VERSION = "ts-0.6.6";
|
|
3
3
|
|
|
4
4
|
// src/events.ts
|
|
5
5
|
import { z } from "zod";
|
|
@@ -3273,10 +3273,9 @@ function installLifecycleSeam(lowLevel, ctx, spec) {
|
|
|
3273
3273
|
} catch (err) {
|
|
3274
3274
|
await fire(spec.schemas.error, {
|
|
3275
3275
|
error_type: errorTypeOf(err),
|
|
3276
|
-
// KEPT under every capture mode
|
|
3277
|
-
//
|
|
3278
|
-
//
|
|
3279
|
-
// are `scrubLifecyclePayload`'s, in that order.
|
|
3276
|
+
// KEPT under every capture mode (SPEC §11.4.4), though it can quote what
|
|
3277
|
+
// the handler fetched, so `"off"` warns instead: `warnAboutSettings`.
|
|
3278
|
+
// The scrub and the cap are `scrubLifecyclePayload`'s, in that order.
|
|
3280
3279
|
error_body: messageOf(err),
|
|
3281
3280
|
duration_ms: elapsed()
|
|
3282
3281
|
});
|
|
@@ -3613,9 +3612,9 @@ function withBaton(server, supplied = {}) {
|
|
|
3613
3612
|
return inertHandle(supplied.sink ?? new DisabledSink(), "baton-disabled");
|
|
3614
3613
|
}
|
|
3615
3614
|
const { resolved, unconfigured } = resolveInstallConfig(supplied);
|
|
3616
|
-
if (!unconfigured) warnUnusedReportSettings(resolved);
|
|
3617
3615
|
const handle = install(server, supplied, resolved, newBatonState(resolved), unconfigured);
|
|
3618
3616
|
if (unconfigured) logUnconfigured("withBaton");
|
|
3617
|
+
else warnAboutSettings(resolved);
|
|
3619
3618
|
return handle;
|
|
3620
3619
|
}
|
|
3621
3620
|
function createBaton(supplied = {}) {
|
|
@@ -3633,7 +3632,7 @@ function createBaton(supplied = {}) {
|
|
|
3633
3632
|
const { resolved, unconfigured } = resolveInstallConfig(supplied);
|
|
3634
3633
|
if (resolved.reportMode === "on") deriveAnnotationToolName(resolved.vendorId, supplied.annotationToolName);
|
|
3635
3634
|
if (unconfigured) logUnconfigured("createBaton");
|
|
3636
|
-
else
|
|
3635
|
+
else warnAboutSettings(resolved);
|
|
3637
3636
|
const sink = unconfigured ? new DisabledSink() : resolved.sink ?? new StdoutSink();
|
|
3638
3637
|
const config = {
|
|
3639
3638
|
...resolved,
|
|
@@ -3839,13 +3838,18 @@ function reportsFor(config) {
|
|
|
3839
3838
|
if (config.reportMode !== "on") return void 0;
|
|
3840
3839
|
return { vendorDisplayName: config.vendorDisplayName ?? "" };
|
|
3841
3840
|
}
|
|
3842
|
-
function
|
|
3841
|
+
function warnAboutSettings(config) {
|
|
3843
3842
|
if (config.reportMode !== "on" && config.annotationToolName !== void 0) {
|
|
3844
3843
|
process.stderr.write(
|
|
3845
3844
|
`baton: annotationToolName=${JSON.stringify(config.annotationToolName)} has no effect with reportMode: "off", because no annotation tool is registered
|
|
3846
3845
|
`
|
|
3847
3846
|
);
|
|
3848
3847
|
}
|
|
3848
|
+
if (config.resultCaptureMode === WITHHELD) {
|
|
3849
|
+
warn(
|
|
3850
|
+
'baton: resultCaptureMode "off" does not withhold the message of a failed resource or prompt request. resource_list_error, resource_read_error, prompt_list_error and prompt_get_error carry that message, which can quote what your handler fetched. Throw a message that names the resource or prompt, not its contents.'
|
|
3851
|
+
);
|
|
3852
|
+
}
|
|
3849
3853
|
}
|
|
3850
3854
|
|
|
3851
3855
|
// src/integrations/mcp/oauthHooks.ts
|