@shashu-ai/sdk 1.1.1 → 1.3.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/CHANGELOG.md +72 -42
- package/NOTICE +1 -1
- package/README.md +43 -9
- package/package.json +4 -5
- package/dist/_joiner-DGi8GsY7.d.cts +0 -38
- package/dist/_joiner-DGi8GsY7.d.ts +0 -38
- package/dist/chunk-3GAMCQ6R.js +0 -74
- package/dist/chunk-3JZXUKNA.js +0 -40
- package/dist/chunk-3X5IUBIA.js +0 -71
- package/dist/chunk-F4CXDZQB.js +0 -330
- package/dist/chunk-M7EMWSNS.js +0 -530
- package/dist/chunk-TGD6KDWT.js +0 -800
- package/dist/index.cjs +0 -2567
- package/dist/index.d.cts +0 -748
- package/dist/index.d.ts +0 -748
- package/dist/index.js +0 -974
- package/dist/langchain-DKyrUjk4.d.cts +0 -322
- package/dist/langchain-QCATTIR4.d.ts +0 -322
- package/dist/middleware/anthropic.cjs +0 -930
- package/dist/middleware/anthropic.d.cts +0 -49
- package/dist/middleware/anthropic.d.ts +0 -49
- package/dist/middleware/anthropic.js +0 -10
- package/dist/middleware/google.cjs +0 -530
- package/dist/middleware/google.d.cts +0 -71
- package/dist/middleware/google.d.ts +0 -71
- package/dist/middleware/google.js +0 -9
- package/dist/middleware/langchain.cjs +0 -1329
- package/dist/middleware/langchain.d.cts +0 -3
- package/dist/middleware/langchain.d.ts +0 -3
- package/dist/middleware/langchain.js +0 -22
- package/dist/middleware/vercel-ai.cjs +0 -927
- package/dist/middleware/vercel-ai.d.cts +0 -70
- package/dist/middleware/vercel-ai.d.ts +0 -70
- package/dist/middleware/vercel-ai.js +0 -10
- package/dist/types-BLs_TMFv.d.cts +0 -444
- package/dist/types-BLs_TMFv.d.ts +0 -444
package/dist/chunk-TGD6KDWT.js
DELETED
|
@@ -1,800 +0,0 @@
|
|
|
1
|
-
// src/types.ts
|
|
2
|
-
var ShashuError = class _ShashuError extends Error {
|
|
3
|
-
/**
|
|
4
|
-
* Why a route was refused for the data in the request, off the decision.
|
|
5
|
-
* Set on a `route_data_policy` refusal, so an app can say which route is not
|
|
6
|
-
* approved for which category without parsing the message.
|
|
7
|
-
*/
|
|
8
|
-
get routePolicy() {
|
|
9
|
-
return this.decision?.routePolicy;
|
|
10
|
-
}
|
|
11
|
-
constructor(message, status, body, details) {
|
|
12
|
-
super(message);
|
|
13
|
-
this.name = "ShashuError";
|
|
14
|
-
this.status = status;
|
|
15
|
-
this.body = body;
|
|
16
|
-
this.type = details?.type;
|
|
17
|
-
this.code = details?.code;
|
|
18
|
-
this.decision = details?.decision;
|
|
19
|
-
this.responseHeaders = details?.responseHeaders;
|
|
20
|
-
Object.setPrototypeOf(this, _ShashuError.prototype);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// src/exceptions.ts
|
|
25
|
-
var PROVIDER_ERROR_PREFIX = "TrustGate Provider Error:";
|
|
26
|
-
var ShashuConfigError = class _ShashuConfigError extends ShashuError {
|
|
27
|
-
constructor(message) {
|
|
28
|
-
super(message, 0);
|
|
29
|
-
this.name = "ShashuConfigError";
|
|
30
|
-
Object.setPrototypeOf(this, _ShashuConfigError.prototype);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var ShashuAuthenticationError = class _ShashuAuthenticationError extends ShashuError {
|
|
34
|
-
constructor(message, status, body, details) {
|
|
35
|
-
super(message, status, body, details);
|
|
36
|
-
this.name = "ShashuAuthenticationError";
|
|
37
|
-
Object.setPrototypeOf(this, _ShashuAuthenticationError.prototype);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* True when the upstream provider rejected the gateway's credential.
|
|
41
|
-
*
|
|
42
|
-
* Reads `error.type`, the one field the gateway populates differently for
|
|
43
|
-
* pass-throughs, and falls back to the message prefix it stamps on every
|
|
44
|
-
* pass-through when the body carried no type.
|
|
45
|
-
*/
|
|
46
|
-
get isProviderPassthrough() {
|
|
47
|
-
if (this.type === "authentication_error") return true;
|
|
48
|
-
return this.message.startsWith(PROVIDER_ERROR_PREFIX);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var ShashuBadRequestError = class _ShashuBadRequestError extends ShashuError {
|
|
52
|
-
constructor(message, status, body, details) {
|
|
53
|
-
super(message, status, body, details);
|
|
54
|
-
this.name = "ShashuBadRequestError";
|
|
55
|
-
Object.setPrototypeOf(this, _ShashuBadRequestError.prototype);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var ShashuContextWindowExceeded = class _ShashuContextWindowExceeded extends ShashuBadRequestError {
|
|
59
|
-
constructor(message, status, body, details) {
|
|
60
|
-
super(message, status, body, details);
|
|
61
|
-
this.name = "ShashuContextWindowExceeded";
|
|
62
|
-
Object.setPrototypeOf(this, _ShashuContextWindowExceeded.prototype);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var ShashuRateLimitError = class _ShashuRateLimitError extends ShashuError {
|
|
66
|
-
constructor(message, status, body, details) {
|
|
67
|
-
super(message, status, body, details);
|
|
68
|
-
this.name = "ShashuRateLimitError";
|
|
69
|
-
this.scope = details?.scope;
|
|
70
|
-
this.retryAfterSeconds = details?.retryAfterSeconds;
|
|
71
|
-
Object.setPrototypeOf(this, _ShashuRateLimitError.prototype);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
var ShashuPermissionError = class _ShashuPermissionError extends ShashuError {
|
|
75
|
-
constructor(message, status, body, details) {
|
|
76
|
-
super(message, status, body, details);
|
|
77
|
-
this.name = "ShashuPermissionError";
|
|
78
|
-
Object.setPrototypeOf(this, _ShashuPermissionError.prototype);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
var ShashuBudgetExceededError = class _ShashuBudgetExceededError extends ShashuPermissionError {
|
|
82
|
-
constructor(message, status, body, details) {
|
|
83
|
-
super(message, status, body, details);
|
|
84
|
-
this.name = "ShashuBudgetExceededError";
|
|
85
|
-
Object.setPrototypeOf(this, _ShashuBudgetExceededError.prototype);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
var ShashuPolicyViolation = class _ShashuPolicyViolation extends ShashuPermissionError {
|
|
89
|
-
constructor(message, status, body, details) {
|
|
90
|
-
super(message, status, body, details);
|
|
91
|
-
this.name = "ShashuPolicyViolation";
|
|
92
|
-
Object.setPrototypeOf(this, _ShashuPolicyViolation.prototype);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
var MemoryWriteBlocked = class _MemoryWriteBlocked extends ShashuPolicyViolation {
|
|
96
|
-
constructor(message, status, body, details) {
|
|
97
|
-
super(message, status, body, details);
|
|
98
|
-
this.name = "MemoryWriteBlocked";
|
|
99
|
-
Object.setPrototypeOf(this, _MemoryWriteBlocked.prototype);
|
|
100
|
-
}
|
|
101
|
-
/** The decision's memory block. */
|
|
102
|
-
get memory() {
|
|
103
|
-
return this.decision?.memory;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
var ShashuProviderError = class _ShashuProviderError extends ShashuError {
|
|
107
|
-
constructor(message, status, body, details) {
|
|
108
|
-
super(message, status, body, details);
|
|
109
|
-
this.name = "ShashuProviderError";
|
|
110
|
-
Object.setPrototypeOf(this, _ShashuProviderError.prototype);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
var ShashuContentFilterError = class _ShashuContentFilterError extends ShashuError {
|
|
114
|
-
constructor(message, body, finishReason = null, status = 200, details) {
|
|
115
|
-
super(message, status, body, details);
|
|
116
|
-
this.name = "ShashuContentFilterError";
|
|
117
|
-
this.finishReason = finishReason;
|
|
118
|
-
Object.setPrototypeOf(this, _ShashuContentFilterError.prototype);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
function rateLimitDetail(err) {
|
|
122
|
-
const inner = err?.details?.error;
|
|
123
|
-
return inner && typeof inner === "object" ? inner : {};
|
|
124
|
-
}
|
|
125
|
-
function gatewayRetryAfter(res, parsedBody) {
|
|
126
|
-
const fromHeader = parseRetryAfter(res.headers.get("retry-after"));
|
|
127
|
-
if (fromHeader !== void 0) return fromHeader;
|
|
128
|
-
if (!parsedBody || typeof parsedBody !== "object") return void 0;
|
|
129
|
-
const err = parsedBody.error;
|
|
130
|
-
const seconds = rateLimitDetail(err).retry_after_seconds;
|
|
131
|
-
return typeof seconds === "number" ? seconds : void 0;
|
|
132
|
-
}
|
|
133
|
-
var HTTP_SHAPED_CODE = /^[0-9]{3}$/;
|
|
134
|
-
function dispatchCode(code, status) {
|
|
135
|
-
if (typeof code !== "string" || !HTTP_SHAPED_CODE.test(code)) return status;
|
|
136
|
-
const parsed = Number.parseInt(code, 10);
|
|
137
|
-
return parsed >= 100 && parsed < 600 ? parsed : status;
|
|
138
|
-
}
|
|
139
|
-
function parseRetryAfter(value) {
|
|
140
|
-
if (!value) return void 0;
|
|
141
|
-
const trimmed = value.trim();
|
|
142
|
-
const asInt = Number(trimmed);
|
|
143
|
-
if (Number.isFinite(asInt)) return asInt;
|
|
144
|
-
const asDate = Date.parse(trimmed);
|
|
145
|
-
if (!Number.isNaN(asDate)) {
|
|
146
|
-
return Math.max(0, (asDate - Date.now()) / 1e3);
|
|
147
|
-
}
|
|
148
|
-
return void 0;
|
|
149
|
-
}
|
|
150
|
-
async function raiseForResponse(res, decision) {
|
|
151
|
-
if (res.ok) return;
|
|
152
|
-
const status = res.status;
|
|
153
|
-
let body;
|
|
154
|
-
let parsed = {};
|
|
155
|
-
try {
|
|
156
|
-
const text = await res.text();
|
|
157
|
-
body = text;
|
|
158
|
-
parsed = JSON.parse(text);
|
|
159
|
-
body = parsed;
|
|
160
|
-
} catch {
|
|
161
|
-
}
|
|
162
|
-
const err = parsed?.error ?? {};
|
|
163
|
-
const message = typeof err.message === "string" && err.message || typeof parsed?.message === "string" && parsed.message || `SHASHU gateway error (HTTP ${status}).`;
|
|
164
|
-
const type = err.type;
|
|
165
|
-
const code = err.code;
|
|
166
|
-
const details = { type, code, decision, responseHeaders: res.headers };
|
|
167
|
-
const kind = dispatchCode(code, status);
|
|
168
|
-
if (kind === 401) throw new ShashuAuthenticationError(message, status, body, details);
|
|
169
|
-
if (kind === 429) {
|
|
170
|
-
const detail = rateLimitDetail(err);
|
|
171
|
-
const retryAfterSeconds = detail.retry_after_seconds ?? parseRetryAfter(res.headers.get("retry-after"));
|
|
172
|
-
throw new ShashuRateLimitError(detail.message ?? message, status, body, {
|
|
173
|
-
...details,
|
|
174
|
-
scope: detail.scope,
|
|
175
|
-
retryAfterSeconds
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
if (kind === 403) {
|
|
179
|
-
if (decision !== void 0 && decision.memoryBlocked > 0) {
|
|
180
|
-
throw new MemoryWriteBlocked(message, status, body, details);
|
|
181
|
-
}
|
|
182
|
-
throw new ShashuPolicyViolation(message, status, body, details);
|
|
183
|
-
}
|
|
184
|
-
if (kind === 400) {
|
|
185
|
-
if (type === "context_window_exceeded") {
|
|
186
|
-
throw new ShashuContextWindowExceeded(message, status, body, details);
|
|
187
|
-
}
|
|
188
|
-
if (type === "content_filter") {
|
|
189
|
-
throw new ShashuContentFilterError(message, body, null, status, details);
|
|
190
|
-
}
|
|
191
|
-
throw new ShashuBadRequestError(message, status, body, details);
|
|
192
|
-
}
|
|
193
|
-
if (kind === 502 || kind === 503 || kind === 504) {
|
|
194
|
-
throw new ShashuProviderError(message, status, body, details);
|
|
195
|
-
}
|
|
196
|
-
throw new ShashuError(message, status, body, details);
|
|
197
|
-
}
|
|
198
|
-
function raiseIfContentFiltered(json, decision, headers) {
|
|
199
|
-
if (!json || typeof json !== "object") return;
|
|
200
|
-
const choices = json.choices;
|
|
201
|
-
if (!Array.isArray(choices) || choices.length === 0) return;
|
|
202
|
-
const first = choices[0];
|
|
203
|
-
if (first?.finish_reason === "content_filter") {
|
|
204
|
-
throw new ShashuContentFilterError(
|
|
205
|
-
"Response was blocked by the gateway content filter (finish_reason='content_filter').",
|
|
206
|
-
json,
|
|
207
|
-
"content_filter",
|
|
208
|
-
200,
|
|
209
|
-
{ decision, responseHeaders: headers }
|
|
210
|
-
);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// src/config.ts
|
|
215
|
-
var BASE_URL_ENV = "SHASHU_BASE_URL";
|
|
216
|
-
var API_KEY_ENV = "SHASHU_API_KEY";
|
|
217
|
-
var DISABLE_ENV = "SHASHU_DISABLE";
|
|
218
|
-
var TRUTHY = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
|
|
219
|
-
function env() {
|
|
220
|
-
return typeof process !== "undefined" && process.env ? process.env : {};
|
|
221
|
-
}
|
|
222
|
-
function envGet(current, _legacy) {
|
|
223
|
-
const now = (env()[current] ?? "").trim();
|
|
224
|
-
return now || void 0;
|
|
225
|
-
}
|
|
226
|
-
function isDisabled() {
|
|
227
|
-
return TRUTHY.has((envGet(DISABLE_ENV) ?? "").trim().toLowerCase());
|
|
228
|
-
}
|
|
229
|
-
function firstConfigured(baseUrl, envVars) {
|
|
230
|
-
if (baseUrl && baseUrl.trim()) return baseUrl.trim().replace(/\/+$/, "");
|
|
231
|
-
for (const name of envVars) {
|
|
232
|
-
const value = env()[name]?.trim();
|
|
233
|
-
if (value) return value.replace(/\/+$/, "");
|
|
234
|
-
}
|
|
235
|
-
return void 0;
|
|
236
|
-
}
|
|
237
|
-
function optionalBaseUrl(baseUrl, envVars = [BASE_URL_ENV]) {
|
|
238
|
-
return firstConfigured(baseUrl, envVars);
|
|
239
|
-
}
|
|
240
|
-
function requireBaseUrl(baseUrl, opts) {
|
|
241
|
-
const envVars = opts.envVars ?? [BASE_URL_ENV];
|
|
242
|
-
const resolved = firstConfigured(baseUrl, envVars);
|
|
243
|
-
if (resolved) return resolved;
|
|
244
|
-
const option = opts.option ?? "baseUrl";
|
|
245
|
-
const envHint = envVars.length === 1 ? `set the ${envVars[0]} environment variable` : `set one of the ${envVars.join(" or ")} environment variables`;
|
|
246
|
-
throw new ShashuConfigError(
|
|
247
|
-
`SHASHU gateway address is not configured, so ${opts.entryPoint} has nothing to route to. Pass ${option} to ${opts.entryPoint}, or ${envHint}. SHASHU is self-hosted: the SDK has no default address and will not guess one.`
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// src/tracer.ts
|
|
252
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
253
|
-
import { randomUUID } from "crypto";
|
|
254
|
-
var spanStorage = new AsyncLocalStorage();
|
|
255
|
-
var a2aStorage = new AsyncLocalStorage();
|
|
256
|
-
function coerceHeaderMap(headers) {
|
|
257
|
-
const out = {};
|
|
258
|
-
if (!headers) return out;
|
|
259
|
-
try {
|
|
260
|
-
if (Array.isArray(headers)) {
|
|
261
|
-
for (const pair of headers) {
|
|
262
|
-
if (Array.isArray(pair) && pair.length >= 2 && pair[0] != null) {
|
|
263
|
-
out[String(pair[0]).toLowerCase()] = String(pair[1]);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return out;
|
|
267
|
-
}
|
|
268
|
-
if (headers instanceof Map) {
|
|
269
|
-
for (const [k, v] of headers) out[String(k).toLowerCase()] = String(v);
|
|
270
|
-
return out;
|
|
271
|
-
}
|
|
272
|
-
if (typeof headers.forEach === "function") {
|
|
273
|
-
headers.forEach((v, k) => {
|
|
274
|
-
if (k != null) out[String(k).toLowerCase()] = String(v);
|
|
275
|
-
});
|
|
276
|
-
return out;
|
|
277
|
-
}
|
|
278
|
-
if (typeof headers === "object") {
|
|
279
|
-
for (const [k, v] of Object.entries(headers)) {
|
|
280
|
-
if (v !== void 0 && v !== null) out[k.toLowerCase()] = String(v);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
} catch {
|
|
284
|
-
return out;
|
|
285
|
-
}
|
|
286
|
-
return out;
|
|
287
|
-
}
|
|
288
|
-
function parseHopDepth(raw) {
|
|
289
|
-
const n = parseInt(String(raw ?? "").trim(), 10);
|
|
290
|
-
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
291
|
-
}
|
|
292
|
-
function captureFromHeaders(h) {
|
|
293
|
-
const trace = (h["x-shashu-trace-id"] ?? "").trim();
|
|
294
|
-
if (!trace) return void 0;
|
|
295
|
-
const session = (h["x-shashu-session-id"] ?? "").trim();
|
|
296
|
-
const caller = (h["x-shashu-caller-agent-id"] ?? "").trim();
|
|
297
|
-
return {
|
|
298
|
-
traceId: trace,
|
|
299
|
-
sessionId: session || void 0,
|
|
300
|
-
inboundHopDepth: parseHopDepth(h["x-shashu-hop-depth"]),
|
|
301
|
-
inboundCallerAgentId: caller || void 0
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
var Tracer = class {
|
|
305
|
-
/**
|
|
306
|
-
* Resolves the address OPTIONALLY, unlike every other entry point.
|
|
307
|
-
*
|
|
308
|
-
* The module exports a singleton (`export const tracer = new Tracer()`), so
|
|
309
|
-
* this constructor runs on `import "@shashu-ai/sdk"`. Throwing here would
|
|
310
|
-
* make importing the SDK fail for anyone who has not set the variable, which
|
|
311
|
-
* is a far worse failure than the one this is fixing. Instead the address
|
|
312
|
-
* stays undefined and {@link flush} posts nothing — the same shape as the
|
|
313
|
-
* Python SDK's telemetry path, which resolves with optional_base_url and
|
|
314
|
-
* no-ops the flush.
|
|
315
|
-
*/
|
|
316
|
-
constructor() {
|
|
317
|
-
this.buffer = [];
|
|
318
|
-
this.flushTimer = null;
|
|
319
|
-
this._gatewayUrl = optionalBaseUrl();
|
|
320
|
-
this._apiKey = envGet(API_KEY_ENV);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Current gateway base URL (respects configure()), or undefined when none is
|
|
324
|
-
* configured. Undefined means telemetry is not sent — never a default host.
|
|
325
|
-
*/
|
|
326
|
-
get gatewayUrl() {
|
|
327
|
-
return this._gatewayUrl;
|
|
328
|
-
}
|
|
329
|
-
/** Current API key (respects configure()). */
|
|
330
|
-
get apiKey() {
|
|
331
|
-
return this._apiKey;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Update gateway URL and/or API key at runtime (e.g. for scripts switching agents).
|
|
335
|
-
* baseUrl has its trailing slash stripped to match constructor behavior.
|
|
336
|
-
*/
|
|
337
|
-
configure(opts) {
|
|
338
|
-
if (opts.baseUrl !== void 0) {
|
|
339
|
-
this._gatewayUrl = opts.baseUrl.replace(/\/$/, "");
|
|
340
|
-
}
|
|
341
|
-
if (opts.apiKey !== void 0) {
|
|
342
|
-
this._apiKey = opts.apiKey;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
// --- Context Accessors ---
|
|
346
|
-
get traceId() {
|
|
347
|
-
return spanStorage.getStore()?.traceId ?? a2aStorage.getStore()?.traceId;
|
|
348
|
-
}
|
|
349
|
-
get currentSpanId() {
|
|
350
|
-
const store = spanStorage.getStore();
|
|
351
|
-
return store?.spanId;
|
|
352
|
-
}
|
|
353
|
-
/** The current span's PARENT span id; undefined at origin or for a root span. */
|
|
354
|
-
get parentSpanId() {
|
|
355
|
-
const store = spanStorage.getStore();
|
|
356
|
-
return store?.parentId;
|
|
357
|
-
}
|
|
358
|
-
get isActive() {
|
|
359
|
-
return !!spanStorage.getStore();
|
|
360
|
-
}
|
|
361
|
-
// --- A2A inbound-capture + outbound propagation (ADR-007 §0, §4.1 locked) ---
|
|
362
|
-
/** True when this context CAPTURED an inbound flow — so a downstream gateway call
|
|
363
|
-
* PROPAGATES the trace and attaches caller/session/hop lineage rather than originate
|
|
364
|
-
* a new flow. False = origin (header set unchanged). */
|
|
365
|
-
get isA2aHop() {
|
|
366
|
-
const s = a2aStorage.getStore();
|
|
367
|
-
return !!(s && s.traceId);
|
|
368
|
-
}
|
|
369
|
-
/** The captured inbound session id, or undefined when none was propagated. */
|
|
370
|
-
get sessionId() {
|
|
371
|
-
return a2aStorage.getStore()?.sessionId || void 0;
|
|
372
|
-
}
|
|
373
|
-
/** Advisory inbound hop depth captured from x-shashu-hop-depth (0 if absent). */
|
|
374
|
-
get inboundHopDepth() {
|
|
375
|
-
return a2aStorage.getStore()?.inboundHopDepth ?? 0;
|
|
376
|
-
}
|
|
377
|
-
/** Hop depth to advertise on the next downstream call = inbound + 1 (advisory; the
|
|
378
|
-
* gateway recounts authoritatively). */
|
|
379
|
-
get outboundHopDepth() {
|
|
380
|
-
return this.inboundHopDepth + 1;
|
|
381
|
-
}
|
|
382
|
-
/** The captured inbound x-shashu-caller-agent-id — the upstream agent that INVOKED
|
|
383
|
-
* this hop. The SDK FORWARDS this on the outbound gateway call so the gateway records
|
|
384
|
-
* the real (invoker -> this agent) edge, NEVER this agent's own id (§4.1). undefined at
|
|
385
|
-
* origin / caller-stripped. */
|
|
386
|
-
get inboundCallerAgentId() {
|
|
387
|
-
return a2aStorage.getStore()?.inboundCallerAgentId || void 0;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Capture an inbound flow from the headers of a request this agent is SERVING into the
|
|
391
|
-
* AsyncLocalStorage store, so a downstream call made through the SDK propagates the SAME
|
|
392
|
-
* flow (WP-A2A-4 / ADR-007 §0). Reads (case-insensitively) x-shashu-trace-id (the flow
|
|
393
|
-
* id), -session-id, -hop-depth, and -caller-agent-id (the upstream INVOKER). The captured
|
|
394
|
-
* trace is PROPAGATED on the next outbound call (never re-minted); the session, inbound hop
|
|
395
|
-
* depth, and inbound caller ride along — the caller is FORWARDED on the gateway call (§4.1),
|
|
396
|
-
* never replaced by self.
|
|
397
|
-
*
|
|
398
|
-
* Uses enterWith, so the capture persists for the remainder of the current async execution
|
|
399
|
-
* (one-shot, for a script serving a single inbound call). Servers handling many requests
|
|
400
|
-
* should prefer {@link incoming} so one flow's lineage never leaks into the next. No inbound
|
|
401
|
-
* trace ⇒ origin: the ambient capture is cleared and false is returned (non-A2A unaffected).
|
|
402
|
-
* Never throws — telemetry must not break a request.
|
|
403
|
-
*/
|
|
404
|
-
captureIncoming(headers) {
|
|
405
|
-
const capture = captureFromHeaders(coerceHeaderMap(headers));
|
|
406
|
-
a2aStorage.enterWith(capture);
|
|
407
|
-
return capture !== void 0;
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Scoped inbound capture: capture for the duration of serving ONE request, then restore
|
|
411
|
-
* the prior context on exit — so a long-lived worker does not leak one flow's lineage into
|
|
412
|
-
* the next. Prefer this in servers; {@link captureIncoming} is the one-shot for scripts.
|
|
413
|
-
*
|
|
414
|
-
* @example
|
|
415
|
-
* await tracer.incoming(req.headers, async () => {
|
|
416
|
-
* await tg.fetch("/v1/chat/completions", { ... }); // propagates the captured flow
|
|
417
|
-
* });
|
|
418
|
-
*/
|
|
419
|
-
incoming(headers, callback) {
|
|
420
|
-
const capture = captureFromHeaders(coerceHeaderMap(headers));
|
|
421
|
-
return a2aStorage.run(capture, callback);
|
|
422
|
-
}
|
|
423
|
-
// --- Main Logic ---
|
|
424
|
-
/**
|
|
425
|
-
* Wraps a callback in a new Span Context.
|
|
426
|
-
* Automatically handles Header injection for any internal calls.
|
|
427
|
-
*/
|
|
428
|
-
async span(name, callback, metadata) {
|
|
429
|
-
const parent = spanStorage.getStore();
|
|
430
|
-
const traceId = parent?.traceId ?? a2aStorage.getStore()?.traceId ?? randomUUID();
|
|
431
|
-
const spanId = randomUUID();
|
|
432
|
-
const parentId = parent?.spanId;
|
|
433
|
-
const context = { traceId, spanId, parentId };
|
|
434
|
-
const startTime = Date.now() / 1e3;
|
|
435
|
-
try {
|
|
436
|
-
return await spanStorage.run(context, async () => {
|
|
437
|
-
return await callback(spanId);
|
|
438
|
-
});
|
|
439
|
-
} finally {
|
|
440
|
-
const endTime = Date.now() / 1e3;
|
|
441
|
-
this.record({
|
|
442
|
-
trace_id: traceId,
|
|
443
|
-
span_id: spanId,
|
|
444
|
-
parent_span_id: parentId,
|
|
445
|
-
name,
|
|
446
|
-
start_time: startTime,
|
|
447
|
-
end_time: endTime,
|
|
448
|
-
duration: endTime - startTime,
|
|
449
|
-
metadata
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
// --- Telemetry Transport ---
|
|
454
|
-
record(span) {
|
|
455
|
-
if (isDisabled()) return;
|
|
456
|
-
this.buffer.push(span);
|
|
457
|
-
if (this.buffer.length >= 10) {
|
|
458
|
-
this.flush();
|
|
459
|
-
} else if (!this.flushTimer) {
|
|
460
|
-
this.flushTimer = setTimeout(() => this.flush(), 1e3);
|
|
461
|
-
this.flushTimer.unref();
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
async flush() {
|
|
465
|
-
if (this.flushTimer) {
|
|
466
|
-
clearTimeout(this.flushTimer);
|
|
467
|
-
this.flushTimer = null;
|
|
468
|
-
}
|
|
469
|
-
if (isDisabled()) return;
|
|
470
|
-
if (this.buffer.length === 0 || !this._apiKey || !this._gatewayUrl) return;
|
|
471
|
-
const batch = [...this.buffer];
|
|
472
|
-
this.buffer = [];
|
|
473
|
-
try {
|
|
474
|
-
await fetch(`${this._gatewayUrl}/api/telemetry/spans`, {
|
|
475
|
-
method: "POST",
|
|
476
|
-
headers: {
|
|
477
|
-
"Content-Type": "application/json",
|
|
478
|
-
Authorization: `Bearer ${this._apiKey}`
|
|
479
|
-
},
|
|
480
|
-
body: JSON.stringify(batch)
|
|
481
|
-
});
|
|
482
|
-
} catch {
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
var tracer = new Tracer();
|
|
487
|
-
function captureIncoming(headers) {
|
|
488
|
-
return tracer.captureIncoming(headers);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
// src/context.ts
|
|
492
|
-
import { randomUUID as randomUUID2 } from "crypto";
|
|
493
|
-
|
|
494
|
-
// src/version.ts
|
|
495
|
-
var SDK_VERSION = "1.1.1";
|
|
496
|
-
|
|
497
|
-
// src/context.ts
|
|
498
|
-
var HEADER_PREFIX = "x-shashu";
|
|
499
|
-
var SOURCE_TOOL_HEADER = "x-shashu-source-tool";
|
|
500
|
-
var DEFAULT_CONTRACT_VERSION = "2026-09-01";
|
|
501
|
-
var CONTRACT_VERSION_HEADER = "shashu-version";
|
|
502
|
-
function applyContractVersion(headers, contractVersion) {
|
|
503
|
-
if (contractVersion === null) return headers;
|
|
504
|
-
const named = Object.keys(headers).some((k) => k.toLowerCase() === CONTRACT_VERSION_HEADER);
|
|
505
|
-
if (!named) headers[CONTRACT_VERSION_HEADER] = contractVersion ?? DEFAULT_CONTRACT_VERSION;
|
|
506
|
-
return headers;
|
|
507
|
-
}
|
|
508
|
-
var N8N_KEYS = [
|
|
509
|
-
"N8N_WORKFLOW_ID",
|
|
510
|
-
"N8N_EXECUTION_ID",
|
|
511
|
-
"N8N_WORKFLOW_NAME",
|
|
512
|
-
"N8N_EXECUTION_MODE"
|
|
513
|
-
];
|
|
514
|
-
var VERCEL_KEYS = [
|
|
515
|
-
"VERCEL",
|
|
516
|
-
"VERCEL_ENV",
|
|
517
|
-
"VERCEL_URL",
|
|
518
|
-
"VERCEL_GIT_COMMIT_REF",
|
|
519
|
-
"VERCEL_GIT_REPO_ID",
|
|
520
|
-
"VERCEL_GIT_COMMIT_SHA"
|
|
521
|
-
];
|
|
522
|
-
var GITHUB_KEYS = [
|
|
523
|
-
"GITHUB_ACTION",
|
|
524
|
-
"GITHUB_ACTIONS",
|
|
525
|
-
"GITHUB_WORKFLOW",
|
|
526
|
-
"GITHUB_RUN_ID",
|
|
527
|
-
"GITHUB_RUN_NUMBER",
|
|
528
|
-
"GITHUB_REPOSITORY",
|
|
529
|
-
"GITHUB_SHA"
|
|
530
|
-
];
|
|
531
|
-
function pickEnv(keys) {
|
|
532
|
-
const out = {};
|
|
533
|
-
for (const key of keys) {
|
|
534
|
-
const v = process.env[key];
|
|
535
|
-
if (v !== void 0 && v !== "") out[key] = v;
|
|
536
|
-
}
|
|
537
|
-
return out;
|
|
538
|
-
}
|
|
539
|
-
function getBaseMetadata() {
|
|
540
|
-
return {
|
|
541
|
-
sdk_version: SDK_VERSION,
|
|
542
|
-
node_version: process.version,
|
|
543
|
-
os: process.platform,
|
|
544
|
-
arch: process.arch
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
function getWorkflowContextFromEnv() {
|
|
548
|
-
const baseMeta = getBaseMetadata();
|
|
549
|
-
const n8n = pickEnv(N8N_KEYS);
|
|
550
|
-
if (Object.keys(n8n).length > 0) {
|
|
551
|
-
return {
|
|
552
|
-
source: "n8n",
|
|
553
|
-
workflow_id: n8n.N8N_WORKFLOW_ID,
|
|
554
|
-
execution_id: n8n.N8N_EXECUTION_ID,
|
|
555
|
-
metadata: { ...baseMeta, ...n8n }
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
const vercel = pickEnv(VERCEL_KEYS);
|
|
559
|
-
if (Object.keys(vercel).length > 0) {
|
|
560
|
-
return {
|
|
561
|
-
source: "vercel",
|
|
562
|
-
workflow_id: vercel.VERCEL_GIT_REPO_ID || vercel.VERCEL_URL,
|
|
563
|
-
execution_id: vercel.VERCEL_GIT_COMMIT_SHA,
|
|
564
|
-
metadata: { ...baseMeta, ...vercel }
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
const github = pickEnv(GITHUB_KEYS);
|
|
568
|
-
if (Object.keys(github).length > 0) {
|
|
569
|
-
return {
|
|
570
|
-
source: "github",
|
|
571
|
-
workflow_id: github.GITHUB_WORKFLOW || github.GITHUB_REPOSITORY,
|
|
572
|
-
execution_id: github.GITHUB_RUN_ID || github.GITHUB_RUN_NUMBER,
|
|
573
|
-
metadata: { ...baseMeta, ...github }
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
return {
|
|
577
|
-
source: "local_script",
|
|
578
|
-
metadata: baseMeta
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
function buildSourceToolJson(ctx) {
|
|
582
|
-
const meta = ctx.metadata ?? getBaseMetadata();
|
|
583
|
-
const payload = {
|
|
584
|
-
source: ctx.source,
|
|
585
|
-
metadata: meta
|
|
586
|
-
};
|
|
587
|
-
if (ctx.workflow_id !== void 0) payload.workflow_id = ctx.workflow_id;
|
|
588
|
-
if (ctx.execution_id !== void 0) payload.execution_id = ctx.execution_id;
|
|
589
|
-
if (ctx.workflow_step !== void 0) payload.workflow_step = ctx.workflow_step;
|
|
590
|
-
return JSON.stringify(payload);
|
|
591
|
-
}
|
|
592
|
-
var TRUSTLOG_HEADER_PREFIX = "x-trustlog-";
|
|
593
|
-
function resolveOriginTraceId() {
|
|
594
|
-
const n8n = process.env.N8N_EXECUTION_ID;
|
|
595
|
-
if (n8n) return n8n;
|
|
596
|
-
const github = process.env.GITHUB_RUN_ID;
|
|
597
|
-
if (github) return github;
|
|
598
|
-
const gitlab = process.env.CI_PIPELINE_ID;
|
|
599
|
-
if (process.env.GITLAB_CI && gitlab) return gitlab;
|
|
600
|
-
return randomUUID2();
|
|
601
|
-
}
|
|
602
|
-
function lowercaseHeaderKeys(h) {
|
|
603
|
-
const out = {};
|
|
604
|
-
for (const [k, v] of Object.entries(h)) out[k.toLowerCase()] = v;
|
|
605
|
-
return out;
|
|
606
|
-
}
|
|
607
|
-
function buildContextHeaders(ctx, session) {
|
|
608
|
-
const meta = ctx.metadata ?? getBaseMetadata();
|
|
609
|
-
const h = {
|
|
610
|
-
[SOURCE_TOOL_HEADER]: buildSourceToolJson({ ...ctx, metadata: meta }),
|
|
611
|
-
[`${HEADER_PREFIX}-source`]: ctx.source
|
|
612
|
-
};
|
|
613
|
-
if (ctx.workflow_id) h[`${HEADER_PREFIX}-workflow-id`] = ctx.workflow_id;
|
|
614
|
-
if (ctx.execution_id) h[`${HEADER_PREFIX}-execution-id`] = ctx.execution_id;
|
|
615
|
-
if (ctx.workflow_step) h[`${HEADER_PREFIX}-workflow-step`] = ctx.workflow_step;
|
|
616
|
-
for (const [k, v] of Object.entries(meta)) {
|
|
617
|
-
if (v) h[`${TRUSTLOG_HEADER_PREFIX}${k.replace(/_/g, "-")}`] = String(v);
|
|
618
|
-
}
|
|
619
|
-
if (tracer.isActive) {
|
|
620
|
-
if (tracer.traceId) h["x-shashu-trace-id"] = tracer.traceId;
|
|
621
|
-
h["x-shashu-span-id"] = tracer.currentSpanId ?? "";
|
|
622
|
-
h["x-shashu-parent-id"] = tracer.parentSpanId ?? "";
|
|
623
|
-
} else if (tracer.isA2aHop) {
|
|
624
|
-
if (tracer.traceId) h["x-shashu-trace-id"] = tracer.traceId;
|
|
625
|
-
} else if (!h["x-shashu-trace-id"]) {
|
|
626
|
-
h["x-shashu-trace-id"] = resolveOriginTraceId();
|
|
627
|
-
}
|
|
628
|
-
const sessionId = resolveSessionId(session);
|
|
629
|
-
if (sessionId) h["x-shashu-session-id"] = sessionId;
|
|
630
|
-
if (tracer.isA2aHop) {
|
|
631
|
-
const inboundCaller = tracer.inboundCallerAgentId;
|
|
632
|
-
if (inboundCaller) h["x-shashu-caller-agent-id"] = inboundCaller;
|
|
633
|
-
h["x-shashu-hop-depth"] = String(tracer.outboundHopDepth);
|
|
634
|
-
}
|
|
635
|
-
return lowercaseHeaderKeys(h);
|
|
636
|
-
}
|
|
637
|
-
function resolveSessionId(opts) {
|
|
638
|
-
if (opts?.requestSessionId != null && String(opts.requestSessionId) !== "") {
|
|
639
|
-
return String(opts.requestSessionId);
|
|
640
|
-
}
|
|
641
|
-
const captured = tracer.sessionId;
|
|
642
|
-
if (captured) return captured;
|
|
643
|
-
if (opts?.defaultSessionId != null && String(opts.defaultSessionId) !== "") {
|
|
644
|
-
return String(opts.defaultSessionId);
|
|
645
|
-
}
|
|
646
|
-
return void 0;
|
|
647
|
-
}
|
|
648
|
-
function buildInvocationHeaders(opts) {
|
|
649
|
-
const trace = opts.traceId ?? tracer.traceId ?? randomUUID2();
|
|
650
|
-
const hop = opts.hopDepth ?? tracer.outboundHopDepth;
|
|
651
|
-
const session = resolveSessionId({ requestSessionId: opts.sessionId });
|
|
652
|
-
const h = {
|
|
653
|
-
"x-shashu-trace-id": String(trace),
|
|
654
|
-
"x-shashu-caller-agent-id": String(opts.callerAgentId),
|
|
655
|
-
"x-shashu-hop-depth": String(hop)
|
|
656
|
-
};
|
|
657
|
-
if (session) h["x-shashu-session-id"] = String(session);
|
|
658
|
-
return lowercaseHeaderKeys(h);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
// src/credential.ts
|
|
662
|
-
var BOTH_OR_NEITHER = "Give either a SHASHU key or a token provider, not both.";
|
|
663
|
-
var KEY_ONLY_FOR_NOW = "{name} is key only for now: pass a SHASHU key, not a token provider.";
|
|
664
|
-
var REFRESH_SKEW_SECONDS = 60;
|
|
665
|
-
var PASS_PROVIDER_NOT_SET_UP = "pass_provider_not_set_up";
|
|
666
|
-
var PASS_NOT_LICENSED = "pass_not_licensed";
|
|
667
|
-
var PASS_EXPIRED = "pass_expired";
|
|
668
|
-
var PASS_WRONG_AUDIENCE = "pass_wrong_audience";
|
|
669
|
-
var PASS_WRONG_ISSUER = "pass_wrong_issuer";
|
|
670
|
-
var PASS_UNKNOWN_AGENT = "pass_unknown_agent";
|
|
671
|
-
var PASS_CODES = [
|
|
672
|
-
PASS_PROVIDER_NOT_SET_UP,
|
|
673
|
-
PASS_NOT_LICENSED,
|
|
674
|
-
PASS_EXPIRED,
|
|
675
|
-
PASS_WRONG_AUDIENCE,
|
|
676
|
-
PASS_WRONG_ISSUER,
|
|
677
|
-
PASS_UNKNOWN_AGENT
|
|
678
|
-
];
|
|
679
|
-
var RETRY_CODES = /* @__PURE__ */ new Set([PASS_EXPIRED]);
|
|
680
|
-
function rejectKeyOnly(name, tokenProvider) {
|
|
681
|
-
if (tokenProvider != null) {
|
|
682
|
-
throw new ShashuConfigError(KEY_ONLY_FOR_NOW.replace("{name}", name));
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
function jwtExpUnverified(token) {
|
|
686
|
-
const parts = token.split(".");
|
|
687
|
-
if (parts.length !== 3) return null;
|
|
688
|
-
const payload = parts[1];
|
|
689
|
-
const pad = "=".repeat((4 - payload.length % 4) % 4);
|
|
690
|
-
try {
|
|
691
|
-
const json = Buffer.from(payload + pad, "base64url").toString("utf8");
|
|
692
|
-
const data = JSON.parse(json);
|
|
693
|
-
if (data.exp == null) return null;
|
|
694
|
-
const exp = Number(data.exp);
|
|
695
|
-
return Number.isFinite(exp) ? exp : null;
|
|
696
|
-
} catch {
|
|
697
|
-
return null;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
function passRefusalCodeFromText(text) {
|
|
701
|
-
try {
|
|
702
|
-
const parsed = JSON.parse(text);
|
|
703
|
-
const code = parsed?.error?.code;
|
|
704
|
-
return typeof code === "string" && PASS_CODES.includes(code) ? code : null;
|
|
705
|
-
} catch {
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
function shouldRetryPassRefused(opts) {
|
|
710
|
-
if (!opts.usesProvider || opts.bytesDelivered || opts.status !== 401) return false;
|
|
711
|
-
return opts.code != null && RETRY_CODES.has(opts.code);
|
|
712
|
-
}
|
|
713
|
-
var CredentialResolver = class {
|
|
714
|
-
constructor(opts) {
|
|
715
|
-
const envKey = envGet(API_KEY_ENV) ?? void 0;
|
|
716
|
-
const hasKeyArg = opts.apiKey !== void 0;
|
|
717
|
-
const hasProvider = opts.tokenProvider !== void 0;
|
|
718
|
-
if (hasKeyArg && hasProvider) throw new ShashuConfigError(BOTH_OR_NEITHER);
|
|
719
|
-
if (hasProvider && envKey && !hasKeyArg) throw new ShashuConfigError(BOTH_OR_NEITHER);
|
|
720
|
-
if (opts.requireOne && !hasProvider && !hasKeyArg && !envKey) {
|
|
721
|
-
throw new ShashuConfigError(BOTH_OR_NEITHER);
|
|
722
|
-
}
|
|
723
|
-
this.provider = opts.tokenProvider;
|
|
724
|
-
this.staticKey = hasProvider ? void 0 : hasKeyArg ? opts.apiKey : envKey;
|
|
725
|
-
}
|
|
726
|
-
get usesProvider() {
|
|
727
|
-
return this.provider !== void 0;
|
|
728
|
-
}
|
|
729
|
-
async get() {
|
|
730
|
-
if (!this.provider) return this.staticKey;
|
|
731
|
-
if (this.cached && !this.needsRefresh(this.cached)) return this.cached;
|
|
732
|
-
if (this.inflight) return this.inflight;
|
|
733
|
-
this.inflight = (async () => {
|
|
734
|
-
const token = await this.provider();
|
|
735
|
-
this.cached = String(token);
|
|
736
|
-
this.inflight = void 0;
|
|
737
|
-
return this.cached;
|
|
738
|
-
})().catch((err) => {
|
|
739
|
-
this.inflight = void 0;
|
|
740
|
-
throw err;
|
|
741
|
-
});
|
|
742
|
-
return this.inflight;
|
|
743
|
-
}
|
|
744
|
-
invalidate() {
|
|
745
|
-
this.cached = void 0;
|
|
746
|
-
}
|
|
747
|
-
needsRefresh(token) {
|
|
748
|
-
const exp = jwtExpUnverified(token);
|
|
749
|
-
if (exp == null) return true;
|
|
750
|
-
return Date.now() / 1e3 >= exp - REFRESH_SKEW_SECONDS;
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
|
|
754
|
-
export {
|
|
755
|
-
ShashuError,
|
|
756
|
-
ShashuConfigError,
|
|
757
|
-
ShashuAuthenticationError,
|
|
758
|
-
ShashuBadRequestError,
|
|
759
|
-
ShashuContextWindowExceeded,
|
|
760
|
-
ShashuRateLimitError,
|
|
761
|
-
ShashuPermissionError,
|
|
762
|
-
ShashuBudgetExceededError,
|
|
763
|
-
ShashuPolicyViolation,
|
|
764
|
-
MemoryWriteBlocked,
|
|
765
|
-
ShashuProviderError,
|
|
766
|
-
ShashuContentFilterError,
|
|
767
|
-
gatewayRetryAfter,
|
|
768
|
-
parseRetryAfter,
|
|
769
|
-
raiseForResponse,
|
|
770
|
-
raiseIfContentFiltered,
|
|
771
|
-
BASE_URL_ENV,
|
|
772
|
-
API_KEY_ENV,
|
|
773
|
-
envGet,
|
|
774
|
-
isDisabled,
|
|
775
|
-
requireBaseUrl,
|
|
776
|
-
SDK_VERSION,
|
|
777
|
-
tracer,
|
|
778
|
-
captureIncoming,
|
|
779
|
-
HEADER_PREFIX,
|
|
780
|
-
SOURCE_TOOL_HEADER,
|
|
781
|
-
DEFAULT_CONTRACT_VERSION,
|
|
782
|
-
CONTRACT_VERSION_HEADER,
|
|
783
|
-
applyContractVersion,
|
|
784
|
-
getWorkflowContextFromEnv,
|
|
785
|
-
buildSourceToolJson,
|
|
786
|
-
TRUSTLOG_HEADER_PREFIX,
|
|
787
|
-
buildContextHeaders,
|
|
788
|
-
buildInvocationHeaders,
|
|
789
|
-
PASS_PROVIDER_NOT_SET_UP,
|
|
790
|
-
PASS_NOT_LICENSED,
|
|
791
|
-
PASS_EXPIRED,
|
|
792
|
-
PASS_WRONG_AUDIENCE,
|
|
793
|
-
PASS_WRONG_ISSUER,
|
|
794
|
-
PASS_UNKNOWN_AGENT,
|
|
795
|
-
PASS_CODES,
|
|
796
|
-
rejectKeyOnly,
|
|
797
|
-
passRefusalCodeFromText,
|
|
798
|
-
shouldRetryPassRefused,
|
|
799
|
-
CredentialResolver
|
|
800
|
-
};
|