@goodtiming/baton-sdk 1.0.0 → 1.0.1
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 +5 -7
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -17
- package/dist/index.d.ts +8 -17
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @goodtiming/baton-sdk
|
|
2
2
|
|
|
3
|
-
**Stable from 1.0.** This package follows [semver](https://semver.org). [What is public](#what-is-public) lists the public API and what in it is experimental. The wire format only grows: nothing is removed or changes meaning, except what SPEC marks experimental ([SPEC §13](https://github.com/good-timing/baton/blob/main/
|
|
3
|
+
**Stable from 1.0.** This package follows [semver](https://semver.org). [What is public](#what-is-public) lists the public API and what in it is experimental. The wire format only grows: nothing is removed or changes meaning, except what SPEC marks experimental ([SPEC §13](https://github.com/good-timing/baton-spec/blob/main/SPEC.md#stability-from-10)).
|
|
4
4
|
|
|
5
5
|
MCP standardizes how agents discover and call your tools. It does not capture *why* a call happened or whether it helped the user. Baton instruments those interactions on the vendor side by wrapping your MCP server. It captures intent, the tool calls, expected outcomes and observed outcomes, plus friction signals, and hands each one to a sink.
|
|
6
6
|
|
|
@@ -217,9 +217,7 @@ The SDK reads the settings every 60 seconds, in the background: a read never del
|
|
|
217
217
|
|
|
218
218
|
`reportMode` is `"on"` by default here, so the Console decides who sees the report tool. Set `reportMode: "off"` to keep it off for everyone. The report sentence in your server's instructions stays while any audience has reports on. A client reads the instructions when it connects, so a change reaches new connections only.
|
|
219
219
|
|
|
220
|
-
Labels come from your `resolvePrincipal` hook, as `labels` on the `Principal` or the `Organization` it returns. Up to 20 per caller, sent on every event, so send only names you are happy for Baton to see. A share of callers is picked by the principal's id,
|
|
221
|
-
|
|
222
|
-
These settings, `labels` and `capture` are **experimental** and may change in a minor release.
|
|
220
|
+
Labels come from your `resolvePrincipal` hook, as `labels` on the `Principal` or the `Organization` it returns. Up to 20 per caller, sent on every event, so send only names you are happy for Baton to see. A share of callers is picked by the principal's id, so the same person always lands in the same group. A caller with no principal is never in a share, even with a company: to target a company, give it a label.
|
|
223
221
|
|
|
224
222
|
## Failures your handler never saw
|
|
225
223
|
|
|
@@ -320,7 +318,7 @@ None of it blocks the quickstart above.
|
|
|
320
318
|
|
|
321
319
|
The public API is the exports of `@goodtiming/baton-sdk`, its only entry point.
|
|
322
320
|
|
|
323
|
-
These are **experimental** and may change in a minor release: `
|
|
321
|
+
These are **experimental** and may change in a minor release: `EventSchema`, and `ClientReportEvent` with `ClientReportPayload`. [SPEC §13](https://github.com/good-timing/baton-spec/blob/main/SPEC.md#stability-from-10) lists what is experimental on the wire.
|
|
324
322
|
|
|
325
323
|
The event types are built with zod. `EventSchema` may change with a zod major; the event types may not, so 1.x moves to a new zod major only if they stay the same.
|
|
326
324
|
|
|
@@ -335,8 +333,8 @@ Keeping that submodule current is load-bearing for contributors: a stale pin mak
|
|
|
335
333
|
| | |
|
|
336
334
|
|---|---|
|
|
337
335
|
| [goodtiming.ai/docs.html#typescript](https://goodtiming.ai/docs.html#typescript) | The docs: configuration, what it captures, the Console |
|
|
338
|
-
| [`
|
|
339
|
-
| [`
|
|
336
|
+
| [`SPEC.md`](https://github.com/good-timing/baton-spec/blob/main/SPEC.md) | The wire protocol, in `baton-spec`. Applies here too |
|
|
337
|
+
| [`baton`'s design rules](https://github.com/good-timing/baton/blob/main/AGENTS.md#design-rules) | Why the SDK is thin. Read before architectural changes |
|
|
340
338
|
| [`CHANGELOG.md`](https://github.com/good-timing/baton-ts/blob/main/CHANGELOG.md) | What has shipped |
|
|
341
339
|
|
|
342
340
|
Apache-2.0.
|
package/dist/index.cjs
CHANGED
|
@@ -53,7 +53,7 @@ __export(index_exports, {
|
|
|
53
53
|
module.exports = __toCommonJS(index_exports);
|
|
54
54
|
|
|
55
55
|
// src/version.ts
|
|
56
|
-
var SDK_VERSION = "ts-1.0.
|
|
56
|
+
var SDK_VERSION = "ts-1.0.1";
|
|
57
57
|
|
|
58
58
|
// src/events.ts
|
|
59
59
|
var import_zod = require("zod");
|
|
@@ -2179,11 +2179,10 @@ async function resolveCaller(hook, call, settings, client = null) {
|
|
|
2179
2179
|
const caller = await resolveIdentity(hook, call);
|
|
2180
2180
|
if (settings === void 0) return caller;
|
|
2181
2181
|
try {
|
|
2182
|
-
const identity = caller.principal ?? caller.organization;
|
|
2183
2182
|
const callSettings = settings.forCaller({
|
|
2184
2183
|
labels: caller.labels,
|
|
2185
2184
|
clientName: client?.info?.name ?? null,
|
|
2186
|
-
shareKey:
|
|
2185
|
+
shareKey: caller.principal?.id ?? null
|
|
2187
2186
|
});
|
|
2188
2187
|
return callSettings === void 0 ? caller : { ...caller, settings: callSettings };
|
|
2189
2188
|
} catch {
|
|
@@ -4778,7 +4777,7 @@ function paramsOf(args) {
|
|
|
4778
4777
|
var Core = class {
|
|
4779
4778
|
closed = false;
|
|
4780
4779
|
// A snapshot describes the server, so it takes no block's session,
|
|
4781
|
-
// principal or client
|
|
4780
|
+
// principal or client (SPEC §5.6 rule 7).
|
|
4782
4781
|
surfaceSessionId = uuid7();
|
|
4783
4782
|
sentSurfaces = new SentSurfaces();
|
|
4784
4783
|
sink;
|