@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/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare const SDK_VERSION = "ts-1.0.
|
|
3
|
+
declare const SDK_VERSION = "ts-1.0.1";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Zod schemas + TS types for the Baton event stream per SPEC §11.4.
|
|
@@ -14,7 +14,7 @@ declare const SDK_VERSION = "ts-1.0.0";
|
|
|
14
14
|
*
|
|
15
15
|
* All concrete event schemas share the same envelope fields and differ only
|
|
16
16
|
* in `payload`. Fields match Python field-for-field (snake_case on the wire,
|
|
17
|
-
*
|
|
17
|
+
* NOT camelCase).
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/** Emitted before the vendor handler runs. `params` is PII-scrubbed at
|
|
@@ -133,7 +133,6 @@ declare const CaptureObservedSchema: z.ZodObject<{
|
|
|
133
133
|
audience: z.ZodOptional<z.ZodString>;
|
|
134
134
|
overlay: z.ZodOptional<z.ZodString>;
|
|
135
135
|
}, z.core.$strict>;
|
|
136
|
-
/** @experimental May change in a minor release. */
|
|
137
136
|
type CaptureObserved = z.infer<typeof CaptureObservedSchema>;
|
|
138
137
|
declare const EventTypeSchema: z.ZodEnum<{
|
|
139
138
|
tool_call_start: "tool_call_start";
|
|
@@ -2702,9 +2701,7 @@ interface Principal {
|
|
|
2702
2701
|
/** The company this principal belongs to. Sent as `organization`, and
|
|
2703
2702
|
* dropped alone when unusable (SPEC §11.4). */
|
|
2704
2703
|
organization?: Organization | null | undefined;
|
|
2705
|
-
/**
|
|
2706
|
-
*
|
|
2707
|
-
* As `Organization.labels`. A principal's labels and its organization's
|
|
2704
|
+
/** As `Organization.labels`. A principal's labels and its organization's
|
|
2708
2705
|
* are sent together. */
|
|
2709
2706
|
labels?: readonly string[] | undefined;
|
|
2710
2707
|
}
|
|
@@ -2715,9 +2712,7 @@ interface Organization {
|
|
|
2715
2712
|
organizationId: string;
|
|
2716
2713
|
form?: PrincipalForm | undefined;
|
|
2717
2714
|
displayName?: string | null | undefined;
|
|
2718
|
-
/**
|
|
2719
|
-
*
|
|
2720
|
-
* Your names for the groups this caller is in, for Console settings to
|
|
2715
|
+
/** Your names for the groups this caller is in, for Console settings to
|
|
2721
2716
|
* match (SPEC §11.4). Baton sees them, so use group names or keys you keep,
|
|
2722
2717
|
* never raw ids. */
|
|
2723
2718
|
labels?: readonly string[] | undefined;
|
|
@@ -2920,9 +2915,7 @@ interface BatonConfig {
|
|
|
2920
2915
|
* goal still arrives through `user_goal`. `"on"` registers the tool and
|
|
2921
2916
|
* serves its instructions. */
|
|
2922
2917
|
reportMode?: "on" | "off";
|
|
2923
|
-
/**
|
|
2924
|
-
*
|
|
2925
|
-
* Where capture settings come from. `"local"` (default): the values in
|
|
2918
|
+
/** Where capture settings come from. `"local"` (default): the values in
|
|
2926
2919
|
* this config, and Baton is never asked. `"console"`: the settings saved on
|
|
2927
2920
|
* the Console's Capture page, read from the collector every
|
|
2928
2921
|
* `settingsRefreshMs`, so they can differ by label, client or a share of
|
|
@@ -2936,9 +2929,7 @@ interface BatonConfig {
|
|
|
2936
2929
|
* so the Console can hide reports from some callers only when they are on
|
|
2937
2930
|
* here. */
|
|
2938
2931
|
settings?: SettingsMode;
|
|
2939
|
-
/**
|
|
2940
|
-
*
|
|
2941
|
-
* How often `settings: "console"` reads the saved settings, in
|
|
2932
|
+
/** How often `settings: "console"` reads the saved settings, in
|
|
2942
2933
|
* milliseconds. Default 60000, at least 15000. */
|
|
2943
2934
|
settingsRefreshMs?: number;
|
|
2944
2935
|
/** Per-tool intent-param injection (mirrors baton-extmcp's vendor-neutral
|
|
@@ -3247,8 +3238,8 @@ interface SessionOptions {
|
|
|
3247
3238
|
sessionId?: string;
|
|
3248
3239
|
/** Who the vendor says is calling: a `Principal`, which may carry its
|
|
3249
3240
|
* `organization`, or an `Organization` alone when only the company is known.
|
|
3250
|
-
* A block with only a company and no `sessionId`
|
|
3251
|
-
*
|
|
3241
|
+
* A block with only a company and no `sessionId` gets a session of its own,
|
|
3242
|
+
* so pass your own `sessionId` to keep a conversation's blocks together. */
|
|
3252
3243
|
principal?: Principal | Organization;
|
|
3253
3244
|
/** What the calling client said about itself. */
|
|
3254
3245
|
clientInfo?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare const SDK_VERSION = "ts-1.0.
|
|
3
|
+
declare const SDK_VERSION = "ts-1.0.1";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Zod schemas + TS types for the Baton event stream per SPEC §11.4.
|
|
@@ -14,7 +14,7 @@ declare const SDK_VERSION = "ts-1.0.0";
|
|
|
14
14
|
*
|
|
15
15
|
* All concrete event schemas share the same envelope fields and differ only
|
|
16
16
|
* in `payload`. Fields match Python field-for-field (snake_case on the wire,
|
|
17
|
-
*
|
|
17
|
+
* NOT camelCase).
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/** Emitted before the vendor handler runs. `params` is PII-scrubbed at
|
|
@@ -133,7 +133,6 @@ declare const CaptureObservedSchema: z.ZodObject<{
|
|
|
133
133
|
audience: z.ZodOptional<z.ZodString>;
|
|
134
134
|
overlay: z.ZodOptional<z.ZodString>;
|
|
135
135
|
}, z.core.$strict>;
|
|
136
|
-
/** @experimental May change in a minor release. */
|
|
137
136
|
type CaptureObserved = z.infer<typeof CaptureObservedSchema>;
|
|
138
137
|
declare const EventTypeSchema: z.ZodEnum<{
|
|
139
138
|
tool_call_start: "tool_call_start";
|
|
@@ -2702,9 +2701,7 @@ interface Principal {
|
|
|
2702
2701
|
/** The company this principal belongs to. Sent as `organization`, and
|
|
2703
2702
|
* dropped alone when unusable (SPEC §11.4). */
|
|
2704
2703
|
organization?: Organization | null | undefined;
|
|
2705
|
-
/**
|
|
2706
|
-
*
|
|
2707
|
-
* As `Organization.labels`. A principal's labels and its organization's
|
|
2704
|
+
/** As `Organization.labels`. A principal's labels and its organization's
|
|
2708
2705
|
* are sent together. */
|
|
2709
2706
|
labels?: readonly string[] | undefined;
|
|
2710
2707
|
}
|
|
@@ -2715,9 +2712,7 @@ interface Organization {
|
|
|
2715
2712
|
organizationId: string;
|
|
2716
2713
|
form?: PrincipalForm | undefined;
|
|
2717
2714
|
displayName?: string | null | undefined;
|
|
2718
|
-
/**
|
|
2719
|
-
*
|
|
2720
|
-
* Your names for the groups this caller is in, for Console settings to
|
|
2715
|
+
/** Your names for the groups this caller is in, for Console settings to
|
|
2721
2716
|
* match (SPEC §11.4). Baton sees them, so use group names or keys you keep,
|
|
2722
2717
|
* never raw ids. */
|
|
2723
2718
|
labels?: readonly string[] | undefined;
|
|
@@ -2920,9 +2915,7 @@ interface BatonConfig {
|
|
|
2920
2915
|
* goal still arrives through `user_goal`. `"on"` registers the tool and
|
|
2921
2916
|
* serves its instructions. */
|
|
2922
2917
|
reportMode?: "on" | "off";
|
|
2923
|
-
/**
|
|
2924
|
-
*
|
|
2925
|
-
* Where capture settings come from. `"local"` (default): the values in
|
|
2918
|
+
/** Where capture settings come from. `"local"` (default): the values in
|
|
2926
2919
|
* this config, and Baton is never asked. `"console"`: the settings saved on
|
|
2927
2920
|
* the Console's Capture page, read from the collector every
|
|
2928
2921
|
* `settingsRefreshMs`, so they can differ by label, client or a share of
|
|
@@ -2936,9 +2929,7 @@ interface BatonConfig {
|
|
|
2936
2929
|
* so the Console can hide reports from some callers only when they are on
|
|
2937
2930
|
* here. */
|
|
2938
2931
|
settings?: SettingsMode;
|
|
2939
|
-
/**
|
|
2940
|
-
*
|
|
2941
|
-
* How often `settings: "console"` reads the saved settings, in
|
|
2932
|
+
/** How often `settings: "console"` reads the saved settings, in
|
|
2942
2933
|
* milliseconds. Default 60000, at least 15000. */
|
|
2943
2934
|
settingsRefreshMs?: number;
|
|
2944
2935
|
/** Per-tool intent-param injection (mirrors baton-extmcp's vendor-neutral
|
|
@@ -3247,8 +3238,8 @@ interface SessionOptions {
|
|
|
3247
3238
|
sessionId?: string;
|
|
3248
3239
|
/** Who the vendor says is calling: a `Principal`, which may carry its
|
|
3249
3240
|
* `organization`, or an `Organization` alone when only the company is known.
|
|
3250
|
-
* A block with only a company and no `sessionId`
|
|
3251
|
-
*
|
|
3241
|
+
* A block with only a company and no `sessionId` gets a session of its own,
|
|
3242
|
+
* so pass your own `sessionId` to keep a conversation's blocks together. */
|
|
3252
3243
|
principal?: Principal | Organization;
|
|
3253
3244
|
/** What the calling client said about itself. */
|
|
3254
3245
|
clientInfo?: {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var SDK_VERSION = "ts-1.0.
|
|
2
|
+
var SDK_VERSION = "ts-1.0.1";
|
|
3
3
|
|
|
4
4
|
// src/events.ts
|
|
5
5
|
import { z } from "zod";
|
|
@@ -2125,11 +2125,10 @@ async function resolveCaller(hook, call, settings, client = null) {
|
|
|
2125
2125
|
const caller = await resolveIdentity(hook, call);
|
|
2126
2126
|
if (settings === void 0) return caller;
|
|
2127
2127
|
try {
|
|
2128
|
-
const identity = caller.principal ?? caller.organization;
|
|
2129
2128
|
const callSettings = settings.forCaller({
|
|
2130
2129
|
labels: caller.labels,
|
|
2131
2130
|
clientName: client?.info?.name ?? null,
|
|
2132
|
-
shareKey:
|
|
2131
|
+
shareKey: caller.principal?.id ?? null
|
|
2133
2132
|
});
|
|
2134
2133
|
return callSettings === void 0 ? caller : { ...caller, settings: callSettings };
|
|
2135
2134
|
} catch {
|
|
@@ -4724,7 +4723,7 @@ function paramsOf(args) {
|
|
|
4724
4723
|
var Core = class {
|
|
4725
4724
|
closed = false;
|
|
4726
4725
|
// A snapshot describes the server, so it takes no block's session,
|
|
4727
|
-
// principal or client
|
|
4726
|
+
// principal or client (SPEC §5.6 rule 7).
|
|
4728
4727
|
surfaceSessionId = uuid7();
|
|
4729
4728
|
sentSurfaces = new SentSurfaces();
|
|
4730
4729
|
sink;
|