@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/README.md
CHANGED
|
@@ -171,6 +171,8 @@ Each affected event says so, in its own field (`result_capture: "off"`), rather
|
|
|
171
171
|
|
|
172
172
|
**What is still captured, and it is deliberate:** the tool name, the duration, and whether the call failed — so failure detection, pairing and timing all keep working. The message of an error your handler **throws** is withheld too: thrown messages often echo the data a call was handling.
|
|
173
173
|
|
|
174
|
+
**What it 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` keep it under `"off"`, so `withBaton` and `createBaton` print a warning saying so when you set the mode (see [Resources and prompts](#resources-and-prompts)).
|
|
175
|
+
|
|
174
176
|
**What it costs you:** anything that needs to read a response body. A call that returns `200` with a useless body can no longer be detected, and those calls sit outside the denominator of body-level analysis rather than counting as passes or failures.
|
|
175
177
|
|
|
176
178
|
## Failures your handler never saw
|
package/dist/index.cjs
CHANGED
|
@@ -103,7 +103,7 @@ __export(index_exports, {
|
|
|
103
103
|
module.exports = __toCommonJS(index_exports);
|
|
104
104
|
|
|
105
105
|
// src/version.ts
|
|
106
|
-
var SDK_VERSION = "ts-0.6.
|
|
106
|
+
var SDK_VERSION = "ts-0.6.6";
|
|
107
107
|
|
|
108
108
|
// src/events.ts
|
|
109
109
|
var import_zod = require("zod");
|
|
@@ -3377,10 +3377,9 @@ function installLifecycleSeam(lowLevel, ctx, spec) {
|
|
|
3377
3377
|
} catch (err) {
|
|
3378
3378
|
await fire(spec.schemas.error, {
|
|
3379
3379
|
error_type: errorTypeOf(err),
|
|
3380
|
-
// KEPT under every capture mode
|
|
3381
|
-
//
|
|
3382
|
-
//
|
|
3383
|
-
// are `scrubLifecyclePayload`'s, in that order.
|
|
3380
|
+
// KEPT under every capture mode (SPEC §11.4.4), though it can quote what
|
|
3381
|
+
// the handler fetched, so `"off"` warns instead: `warnAboutSettings`.
|
|
3382
|
+
// The scrub and the cap are `scrubLifecyclePayload`'s, in that order.
|
|
3384
3383
|
error_body: messageOf(err),
|
|
3385
3384
|
duration_ms: elapsed()
|
|
3386
3385
|
});
|
|
@@ -3717,9 +3716,9 @@ function withBaton(server, supplied = {}) {
|
|
|
3717
3716
|
return inertHandle(supplied.sink ?? new DisabledSink(), "baton-disabled");
|
|
3718
3717
|
}
|
|
3719
3718
|
const { resolved, unconfigured } = resolveInstallConfig(supplied);
|
|
3720
|
-
if (!unconfigured) warnUnusedReportSettings(resolved);
|
|
3721
3719
|
const handle = install(server, supplied, resolved, newBatonState(resolved), unconfigured);
|
|
3722
3720
|
if (unconfigured) logUnconfigured("withBaton");
|
|
3721
|
+
else warnAboutSettings(resolved);
|
|
3723
3722
|
return handle;
|
|
3724
3723
|
}
|
|
3725
3724
|
function createBaton(supplied = {}) {
|
|
@@ -3737,7 +3736,7 @@ function createBaton(supplied = {}) {
|
|
|
3737
3736
|
const { resolved, unconfigured } = resolveInstallConfig(supplied);
|
|
3738
3737
|
if (resolved.reportMode === "on") deriveAnnotationToolName(resolved.vendorId, supplied.annotationToolName);
|
|
3739
3738
|
if (unconfigured) logUnconfigured("createBaton");
|
|
3740
|
-
else
|
|
3739
|
+
else warnAboutSettings(resolved);
|
|
3741
3740
|
const sink = unconfigured ? new DisabledSink() : resolved.sink ?? new StdoutSink();
|
|
3742
3741
|
const config = {
|
|
3743
3742
|
...resolved,
|
|
@@ -3943,13 +3942,18 @@ function reportsFor(config) {
|
|
|
3943
3942
|
if (config.reportMode !== "on") return void 0;
|
|
3944
3943
|
return { vendorDisplayName: config.vendorDisplayName ?? "" };
|
|
3945
3944
|
}
|
|
3946
|
-
function
|
|
3945
|
+
function warnAboutSettings(config) {
|
|
3947
3946
|
if (config.reportMode !== "on" && config.annotationToolName !== void 0) {
|
|
3948
3947
|
process.stderr.write(
|
|
3949
3948
|
`baton: annotationToolName=${JSON.stringify(config.annotationToolName)} has no effect with reportMode: "off", because no annotation tool is registered
|
|
3950
3949
|
`
|
|
3951
3950
|
);
|
|
3952
3951
|
}
|
|
3952
|
+
if (config.resultCaptureMode === WITHHELD) {
|
|
3953
|
+
warn(
|
|
3954
|
+
'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.'
|
|
3955
|
+
);
|
|
3956
|
+
}
|
|
3953
3957
|
}
|
|
3954
3958
|
|
|
3955
3959
|
// src/integrations/mcp/oauthHooks.ts
|