@xbbg/langgraph 1.2.6 → 1.2.7
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/LICENSE +190 -190
- package/README.md +222 -182
- package/dist/index.js +489 -365
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var tools = require('@langchain/core/tools');
|
|
4
|
-
var
|
|
4
|
+
var zodToJsonSchema = require('zod-to-json-schema');
|
|
5
|
+
var z = require('zod/v3');
|
|
5
6
|
|
|
6
7
|
function _interopNamespace(e) {
|
|
7
8
|
if (e && e.__esModule) return e;
|
|
@@ -21,7 +22,7 @@ function _interopNamespace(e) {
|
|
|
21
22
|
return Object.freeze(n);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
var
|
|
25
|
+
var z__namespace = /*#__PURE__*/_interopNamespace(z);
|
|
25
26
|
|
|
26
27
|
// src/options.ts
|
|
27
28
|
var BLOOMBERG_TOOL_NAMES = [
|
|
@@ -125,22 +126,40 @@ function createCoreResolver(options = {}) {
|
|
|
125
126
|
const normalized = normalizeBloombergToolsOptions(options);
|
|
126
127
|
let corePromise;
|
|
127
128
|
let enginePromise;
|
|
129
|
+
async function cacheCoreImport() {
|
|
130
|
+
const promise = importCore();
|
|
131
|
+
corePromise = promise;
|
|
132
|
+
promise.catch(() => {
|
|
133
|
+
if (corePromise === promise) {
|
|
134
|
+
corePromise = void 0;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
return await promise;
|
|
138
|
+
}
|
|
139
|
+
async function cacheEngineConnect() {
|
|
140
|
+
const promise = (async () => {
|
|
141
|
+
const core = await getCore();
|
|
142
|
+
return await core.connect(normalized.engineConfig);
|
|
143
|
+
})();
|
|
144
|
+
enginePromise = promise;
|
|
145
|
+
promise.catch(() => {
|
|
146
|
+
if (enginePromise === promise) {
|
|
147
|
+
enginePromise = void 0;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
return await promise;
|
|
151
|
+
}
|
|
128
152
|
async function getCore() {
|
|
129
153
|
if (normalized.core !== void 0) {
|
|
130
154
|
return normalized.core;
|
|
131
155
|
}
|
|
132
|
-
corePromise
|
|
133
|
-
return await corePromise;
|
|
156
|
+
return await (corePromise ?? cacheCoreImport());
|
|
134
157
|
}
|
|
135
158
|
async function getEngine() {
|
|
136
159
|
if (normalized.engine !== void 0) {
|
|
137
160
|
return normalized.engine;
|
|
138
161
|
}
|
|
139
|
-
|
|
140
|
-
const core = await getCore();
|
|
141
|
-
return await core.connect(normalized.engineConfig);
|
|
142
|
-
})();
|
|
143
|
-
return await enginePromise;
|
|
162
|
+
return await (enginePromise ?? cacheEngineConnect());
|
|
144
163
|
}
|
|
145
164
|
return {
|
|
146
165
|
getCore,
|
|
@@ -148,6 +167,33 @@ function createCoreResolver(options = {}) {
|
|
|
148
167
|
options: normalized
|
|
149
168
|
};
|
|
150
169
|
}
|
|
170
|
+
function inputJsonSchema(schema) {
|
|
171
|
+
const jsonSchema = zodToJsonSchema.zodToJsonSchema(schema, {
|
|
172
|
+
$refStrategy: "none",
|
|
173
|
+
effectStrategy: "input",
|
|
174
|
+
pipeStrategy: "input"
|
|
175
|
+
});
|
|
176
|
+
delete jsonSchema.$schema;
|
|
177
|
+
delete jsonSchema.definitions;
|
|
178
|
+
return jsonSchema;
|
|
179
|
+
}
|
|
180
|
+
function createBloombergStructuredTool(func, fields) {
|
|
181
|
+
const providerToolDefinition = {
|
|
182
|
+
type: "function",
|
|
183
|
+
function: {
|
|
184
|
+
description: fields.description,
|
|
185
|
+
name: fields.name,
|
|
186
|
+
parameters: inputJsonSchema(fields.schema)
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
return tools.tool(
|
|
190
|
+
func,
|
|
191
|
+
{
|
|
192
|
+
...fields,
|
|
193
|
+
extras: { providerToolDefinition }
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
151
197
|
|
|
152
198
|
// src/cdx-fields.ts
|
|
153
199
|
var CDX_INFO_FIELDS = Object.freeze([
|
|
@@ -189,27 +235,27 @@ var REQUIRED_TOOL_INSTRUCTIONS = [
|
|
|
189
235
|
"- Do not invent Bloomberg tickers, field mnemonics, overrides, or BQL functions. If the user gives a field description rather than a confident mnemonic, call xbbg_bflds first.",
|
|
190
236
|
"",
|
|
191
237
|
"## Security identifiers",
|
|
192
|
-
"- Prefer fully qualified Bloomberg securities
|
|
193
|
-
"- For raw security identifiers, request or pass Bloomberg identifier syntax directly: /isin
|
|
238
|
+
"- Prefer fully qualified Bloomberg securities supplied by the user, such as <TICKER> <MARKET_SECTOR>, <INDEX_TICKER> <MARKET_SECTOR>, or <CREDIT_INDEX_TICKER> <MARKET_SECTOR>.",
|
|
239
|
+
"- For raw security identifiers, request or pass Bloomberg identifier syntax directly: /isin/<ISIN> for ISINs or /cusip/<CUSIP> for CUSIPs.",
|
|
194
240
|
"- Do not pass raw ISIN or CUSIP strings when the request is meant to identify a security. Do not use xbbg_bsrch as a replacement for a known ticker, ISIN, or CUSIP.",
|
|
195
|
-
"- For dealer quote / BQR workflows, use xbbg_bqr with a fixed-income identifier plus a dealer quote source such as /isin
|
|
241
|
+
"- For dealer quote / BQR workflows, use xbbg_bqr with a fixed-income identifier plus a dealer quote source such as /isin/<ISIN>@<QUOTE_SOURCE> <MARKET_SECTOR>. For raw intraday ticks, use xbbg_bdtick.",
|
|
196
242
|
"",
|
|
197
243
|
"## Core request tools",
|
|
198
|
-
"- xbbg_bdp: current or reference point-in-time fields
|
|
244
|
+
"- xbbg_bdp: current or reference point-in-time fields. Use a small explicit securities list and a small explicit fields list. Use includeSecurityErrors only when the caller wants Bloomberg security errors in the response.",
|
|
199
245
|
"- xbbg_bdh: historical daily or periodic time series. Always provide explicit start and end dates in YYYY-MM-DD or YYYYMMDD form. Ask before choosing periodicity, currency, fill behavior, adjustment overrides, or a wide output table.",
|
|
200
|
-
"- xbbg_bds: Bloomberg bulk/table fields
|
|
201
|
-
"- xbbg_bdib: intraday bars only. Provide one ticker, explicit ISO start/end datetimes, a positive interval in minutes, and timezone context when datetimes are naive.
|
|
202
|
-
"- xbbg_bdtick: intraday tick data. Provide one ticker, explicit ISO start/end datetimes, and explicit eventTypes
|
|
246
|
+
"- xbbg_bds: Bloomberg bulk/table fields. Provide exactly one bulk field; do not use bds for ordinary multi-field reference data.",
|
|
247
|
+
"- xbbg_bdib: intraday bars only. Provide one ticker, explicit ISO start/end datetimes with time components, a positive interval in minutes, and timezone context when datetimes are naive.",
|
|
248
|
+
"- xbbg_bdtick: intraday tick data. Provide one ticker, explicit ISO start/end datetimes with time components, and explicit eventTypes unless the default event stream is intended. Use includeBrokerCodes or includeConditionCodes only when those columns are needed.",
|
|
203
249
|
"- xbbg_bql: BQL expressions only when the user asks for BQL or the request is naturally expressed as a bounded BQL query. Keep queries short, explicit, and scoped to the requested universe.",
|
|
204
|
-
"- xbbg_bsrch: Bloomberg search-grid or saved-search workflows only
|
|
205
|
-
"- xbbg_bqr: Bloomberg Quote Request / dealer quotes. Prefer fixed-income
|
|
250
|
+
"- xbbg_bsrch: Bloomberg search-grid or saved-search workflows only. Do not use it for ordinary security lookup.",
|
|
251
|
+
"- xbbg_bqr: Bloomberg Quote Request / dealer quotes. Prefer fixed-income identifier inputs with a dealer quote source such as /isin/<ISIN>@<QUOTE_SOURCE> <MARKET_SECTOR>, explicit start/end datetimes with time components, and explicit event types.",
|
|
206
252
|
"- xbbg_bflds: Bloomberg field metadata/search. Provide exactly one of fields or searchSpec; use searchSpec for natural-language field names and fields for known mnemonics.",
|
|
207
253
|
"- xbbg_beqs: Bloomberg equity screening by named BEQS screen. Prefer this over hand-written BQL when the user names an existing Bloomberg screen.",
|
|
208
|
-
"- xbbg_yas: fixed-income YAS recipe fields
|
|
254
|
+
"- xbbg_yas: fixed-income YAS recipe fields. Prefer this over manual YAS-style BDP requests when the user asks for yield, duration, spread, or price analytics.",
|
|
209
255
|
"- xbbg_preferreds: preferred stock discovery from an equity ticker. Prefer this over xbbg_ext_bql_builder plus xbbg_bql when the user wants the actual preferreds result.",
|
|
210
256
|
"- xbbg_corporate_bonds: bounded corporate bond universe query for a company ticker. Prefer this over generic BQL for company debt discovery.",
|
|
211
257
|
"- xbbg_index_members: index constituents through the core index recipe. Prefer this over generic BDS/BQL members when the user asks for constituents.",
|
|
212
|
-
"- xbbg_resolve_isins: resolves supplied ISIN strings to Bloomberg securities. Pass raw ISIN strings only for this recipe; otherwise use /isin
|
|
258
|
+
"- xbbg_resolve_isins: resolves supplied ISIN strings to Bloomberg securities. Pass raw ISIN strings only for this recipe; otherwise use /isin/<ISIN> syntax with data tools.",
|
|
213
259
|
"- xbbg_issuer_isins: issuer/bond ISIN workflow for supplied bond ISIN strings.",
|
|
214
260
|
"- xbbg_etf_holdings: ETF holdings recipe for a single ETF ticker. Prefer this over generic BQL holdings when the user asks for ETF constituents.",
|
|
215
261
|
"- xbbg_stream_snapshot: bounded live market-data observation from //blp/mktdata. Requires explicit maxUpdates and always terminates/unsubscribes.",
|
|
@@ -218,13 +264,13 @@ var REQUIRED_TOOL_INSTRUCTIONS = [
|
|
|
218
264
|
"",
|
|
219
265
|
"## BQL guidance",
|
|
220
266
|
"- BQL is a complete Bloomberg Query Language expression sent as one query string; the tool does not assemble get/for/with clauses for you.",
|
|
221
|
-
"- Basic shape: get(
|
|
222
|
-
"- Use BQL for universe-oriented analytics and screens
|
|
267
|
+
"- Basic shape: get(<FIELD_1>, <FIELD_2>) for(<UNIVERSE>). Use placeholders such as '<TICKER> <MARKET_SECTOR>', holdings('<ETF_TICKER> <MARKET_SECTOR>'), or members('<INDEX_TICKER> <MARKET_SECTOR>') until the user supplies real inputs.",
|
|
268
|
+
"- Use BQL for universe-oriented analytics and screens only when the user provides a bounded universe, filters, and date range.",
|
|
223
269
|
"- Prefer xbbg_ext_bql_builder instead of hand-writing BQL for supported workflows: preferred stocks, corporate bonds, and ETF holdings.",
|
|
224
270
|
"- Do not use BQL just because the user asks for normal reference data; xbbg_bdp is simpler for current fields and xbbg_bdh is simpler for historical time series.",
|
|
225
271
|
"",
|
|
226
272
|
"## Output handling",
|
|
227
|
-
"- Tool results use LangChain content_and_artifact output: content
|
|
273
|
+
"- Tool results use LangChain content_and_artifact output: content starts with a compact summary and then includes bounded model-readable JSON; artifact is the structured bounded envelope with tool, rowCount, truncated, and data for application code.",
|
|
228
274
|
"- If a response is empty, truncated, or contains Bloomberg/security errors, say that directly. Do not fill gaps from memory or assumptions."
|
|
229
275
|
];
|
|
230
276
|
var OPTIONAL_EXTENSION_INSTRUCTIONS = [
|
|
@@ -265,17 +311,17 @@ function getBloombergToolInstructions(options = {}) {
|
|
|
265
311
|
}
|
|
266
312
|
return lines.join("\n");
|
|
267
313
|
}
|
|
268
|
-
var BDP_DESCRIPTION = 'Bloomberg reference data for current or point-in-time fields
|
|
269
|
-
var BDH_DESCRIPTION = 'Bloomberg historical time series. Requires explicit start and end dates; ask before using if the date range or periodicity is ambiguous. Use /isin
|
|
270
|
-
var BDS_DESCRIPTION = 'Bloomberg bulk/table reference data
|
|
271
|
-
var BDIB_DESCRIPTION = 'Bloomberg intraday bars. Requires one ticker plus explicit ISO start/end datetimes and a positive interval in minutes. Use /isin
|
|
272
|
-
var BDTICK_DESCRIPTION = 'Bloomberg intraday tick data. Requires one ticker plus explicit ISO start/end datetimes.
|
|
273
|
-
var BQL_DESCRIPTION = "Bloomberg Query Language expression sent as one complete query string. Use for bounded universe analytics
|
|
274
|
-
var BSRCH_DESCRIPTION = 'Bloomberg search/grid request. Use for saved-search or ExcelGetGrid-style Bloomberg searches, not ordinary security lookup. Example searchSpec "
|
|
275
|
-
var BQR_DESCRIPTION = 'Bloomberg Quote Request / dealer quotes. Use for fixed-income dealer quote ticks, preferably with an ISIN plus dealer source such as "/isin
|
|
276
|
-
var BFLDS_DESCRIPTION = 'Bloomberg field metadata and field search. Use first when a field mnemonic is uncertain. Provide exactly one of fields or searchSpec. Example: fields ["
|
|
314
|
+
var BDP_DESCRIPTION = 'Bloomberg reference data for current or point-in-time fields. Use for a small bounded list of fully qualified securities. Use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs. Example: securities ["<TICKER> <MARKET_SECTOR>"], fields ["<FIELD>"].';
|
|
315
|
+
var BDH_DESCRIPTION = 'Bloomberg historical time series. Requires explicit start and end dates; ask before using if the date range or periodicity is ambiguous. Use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs. Example: securities ["<TICKER> <MARKET_SECTOR>"], fields ["<FIELD>"], start "<START_DATE>", end "<END_DATE>".';
|
|
316
|
+
var BDS_DESCRIPTION = 'Bloomberg bulk/table reference data. Requires exactly one bulk field, not a field list. Use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs. Example: securities ["<INDEX_TICKER> <MARKET_SECTOR>"], field "<BULK_FIELD>".';
|
|
317
|
+
var BDIB_DESCRIPTION = 'Bloomberg intraday bars. Requires one ticker plus explicit ISO start/end datetimes with time components and a positive interval in minutes. Use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs. Example: ticker "<TICKER> <MARKET_SECTOR>", start "<START_DATETIME>", end "<END_DATETIME>", interval <MINUTES>.';
|
|
318
|
+
var BDTICK_DESCRIPTION = 'Bloomberg intraday tick data. Requires one ticker plus explicit ISO start/end datetimes with time components. Set eventTypes explicitly, for example ["<EVENT_TYPE>"], and includeBrokerCodes/includeConditionCodes only when needed.';
|
|
319
|
+
var BQL_DESCRIPTION = "Bloomberg Query Language expression sent as one complete query string. Use for bounded universe analytics with placeholder-shaped syntax such as get(<FIELD>) for('<TICKER> <MARKET_SECTOR>'), holdings('<ETF_TICKER> <MARKET_SECTOR>'), members('<INDEX_TICKER> <MARKET_SECTOR>'), filters with with(...), or dates=range(...). Prefer xbbg_bdp/xbbg_bdh for simple reference or historical requests.";
|
|
320
|
+
var BSRCH_DESCRIPTION = 'Bloomberg search/grid request. Use for saved-search or ExcelGetGrid-style Bloomberg searches, not ordinary security lookup. Example searchSpec "<SEARCH_SPEC>".';
|
|
321
|
+
var BQR_DESCRIPTION = 'Bloomberg Quote Request / dealer quotes. Use for fixed-income dealer quote ticks, preferably with an ISIN plus dealer source such as "/isin/<ISIN>@<QUOTE_SOURCE> <MARKET_SECTOR>"; requires explicit ISO start/end datetimes with time components. Set eventTypes explicitly, for example ["<EVENT_TYPE>"].';
|
|
322
|
+
var BFLDS_DESCRIPTION = 'Bloomberg field metadata and field search. Use first when a field mnemonic is uncertain. Provide exactly one of fields or searchSpec. Example: fields ["<FIELD>"] or searchSpec "<FIELD_SEARCH_TEXT>".';
|
|
277
323
|
var BEQS_DESCRIPTION = "Bloomberg equity screening by named BEQS screen. Use when the user names an existing Bloomberg screen and wants its bounded result set. Prefer this over hand-written BQL for saved Bloomberg screens.";
|
|
278
|
-
var YAS_DESCRIPTION = "Bloomberg fixed-income YAS recipe fields for one or more bonds. Use for
|
|
324
|
+
var YAS_DESCRIPTION = "Bloomberg fixed-income YAS recipe fields for one or more bonds. Use for yield, duration, spread, benchmark, or price analytics; provide explicit fields and optional settlement/yield/price inputs.";
|
|
279
325
|
var PREFERREDS_DESCRIPTION = "Preferred stock discovery for one equity ticker. Use when the user asks for preferred shares or preferred stock securities related to an issuer.";
|
|
280
326
|
var CORPORATE_BONDS_DESCRIPTION = "Corporate bond universe query for one issuer/company ticker, with optional currency, active-only filter, and result fields. Prefer this over generic BQL for company debt discovery.";
|
|
281
327
|
var INDEX_MEMBERS_DESCRIPTION = "Index constituent recipe for one Bloomberg index. Use for bounded member lists and optional historical/as-of constituent membership.";
|
|
@@ -291,7 +337,7 @@ var EXT_CDX_DESCRIPTION = "CDX helpers for parsing, series rolling/resolution, a
|
|
|
291
337
|
var EXT_CURRENCY_DESCRIPTION = "Currency planning helpers: build FX pairs, test same-currency requests, and find currencies needing conversion.";
|
|
292
338
|
var EXT_BQL_BUILDER_DESCRIPTION = "BQL builders for preferred stocks, corporate bonds, and ETF holdings. Prefer to construct those bounded BQL shapes before xbbg_bql.";
|
|
293
339
|
var EXT_MARKET_SESSION_DESCRIPTION = "Market session and timezone helpers for deriving sessions, UTC windows, market rules, exchange metadata, turnover defaults, and BQR datetime defaults.";
|
|
294
|
-
var EXT_YAS_OVERRIDES_DESCRIPTION = "Build flat Bloomberg YAS override maps for fixed
|
|
340
|
+
var EXT_YAS_OVERRIDES_DESCRIPTION = "Build flat Bloomberg YAS override maps for fixed-income analytics fields.";
|
|
295
341
|
var EXT_CONSTANTS_DESCRIPTION = "Static Bloomberg helper constants for date parsing/formatting, futures months, dividend types, and ETF/dividend columns.";
|
|
296
342
|
var EXT_COLUMNS_DESCRIPTION = "Column rename helpers for dividend, ETF, and earnings-shaped Bloomberg responses.";
|
|
297
343
|
var EXT_CALCULATE_DESCRIPTION = "Small numeric helper operations for Bloomberg workflows, including level percentage calculations.";
|
|
@@ -367,12 +413,41 @@ function rowCountOf(value) {
|
|
|
367
413
|
}
|
|
368
414
|
return null;
|
|
369
415
|
}
|
|
416
|
+
var ERROR_SHAPE_KEYS = /* @__PURE__ */ new Set([
|
|
417
|
+
"error",
|
|
418
|
+
"errors",
|
|
419
|
+
"fielderrors",
|
|
420
|
+
"fieldexception",
|
|
421
|
+
"fieldexceptions",
|
|
422
|
+
"responseerror",
|
|
423
|
+
"securityerror"
|
|
424
|
+
]);
|
|
370
425
|
function hasErrorShape(value) {
|
|
371
|
-
|
|
372
|
-
|
|
426
|
+
const pending = [value];
|
|
427
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
428
|
+
while (pending.length > 0) {
|
|
429
|
+
const entry = pending.pop();
|
|
430
|
+
if (typeof entry !== "object" || entry === null) {
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
if (seen.has(entry)) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
seen.add(entry);
|
|
437
|
+
if (Array.isArray(entry)) {
|
|
438
|
+
for (const child of entry) {
|
|
439
|
+
pending.push(child);
|
|
440
|
+
}
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
for (const [key, child] of Object.entries(entry)) {
|
|
444
|
+
if (ERROR_SHAPE_KEYS.has(key.toLowerCase()) && child !== void 0) {
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
pending.push(child);
|
|
448
|
+
}
|
|
373
449
|
}
|
|
374
|
-
|
|
375
|
-
return record2.error !== void 0 || record2.errors !== void 0 || record2.securityError !== void 0;
|
|
450
|
+
return false;
|
|
376
451
|
}
|
|
377
452
|
function limitResult(value, maxRows, maxStringChars) {
|
|
378
453
|
const state = { truncated: false };
|
|
@@ -394,23 +469,39 @@ function summarizeEnvelope(envelope) {
|
|
|
394
469
|
notes.push("artifact truncated to configured limits");
|
|
395
470
|
}
|
|
396
471
|
if (hasErrorShape(envelope.data)) {
|
|
397
|
-
notes.push("inspect
|
|
472
|
+
notes.push("inspect result payload for Bloomberg error details");
|
|
398
473
|
}
|
|
399
474
|
const noteText = notes.length === 0 ? "" : `; ${notes.join("; ")}`;
|
|
400
475
|
return `${envelope.tool}: ${rowText}; truncated=${String(envelope.truncated)}${noteText}`;
|
|
401
476
|
}
|
|
402
|
-
function
|
|
477
|
+
function resultJsonReplacer(_key, value) {
|
|
478
|
+
if (typeof value === "bigint") {
|
|
479
|
+
return value.toString();
|
|
480
|
+
}
|
|
481
|
+
return value;
|
|
482
|
+
}
|
|
483
|
+
function formatToolContent(envelope) {
|
|
484
|
+
const payload = {
|
|
485
|
+
tool: envelope.tool,
|
|
486
|
+
rowCount: envelope.rowCount,
|
|
487
|
+
truncated: envelope.truncated,
|
|
488
|
+
data: envelope.data
|
|
489
|
+
};
|
|
490
|
+
return `${summarizeEnvelope(envelope)}
|
|
491
|
+
${JSON.stringify(payload, resultJsonReplacer)}`;
|
|
492
|
+
}
|
|
493
|
+
function createToolResult(tool2, value, maxRows, maxStringChars) {
|
|
403
494
|
const limited = limitResult(value, maxRows, maxStringChars);
|
|
404
495
|
const envelope = {
|
|
405
|
-
tool:
|
|
496
|
+
tool: tool2,
|
|
406
497
|
rowCount: limited.rowCount,
|
|
407
498
|
truncated: limited.truncated,
|
|
408
499
|
data: limited.value
|
|
409
500
|
};
|
|
410
|
-
return [
|
|
501
|
+
return [formatToolContent(envelope), envelope];
|
|
411
502
|
}
|
|
412
|
-
function throwWithToolContext(
|
|
413
|
-
const prefix = `${
|
|
503
|
+
function throwWithToolContext(tool2, error) {
|
|
504
|
+
const prefix = `${tool2} failed`;
|
|
414
505
|
if (error instanceof Error) {
|
|
415
506
|
if (!error.message.startsWith(prefix)) {
|
|
416
507
|
Object.defineProperty(error, "message", {
|
|
@@ -422,57 +513,55 @@ function throwWithToolContext(tool3, error) {
|
|
|
422
513
|
}
|
|
423
514
|
throw new Error(`${prefix}: ${String(error)}`);
|
|
424
515
|
}
|
|
425
|
-
var stringPairSchema =
|
|
426
|
-
key:
|
|
427
|
-
value:
|
|
516
|
+
var stringPairSchema = z__namespace.object({
|
|
517
|
+
key: z__namespace.string().trim().min(1).describe("String pair key."),
|
|
518
|
+
value: z__namespace.string().trim().min(1).describe("String pair value.")
|
|
428
519
|
});
|
|
429
|
-
var futuresCandidateSchema =
|
|
430
|
-
month:
|
|
431
|
-
ticker:
|
|
432
|
-
year:
|
|
520
|
+
var futuresCandidateSchema = z__namespace.object({
|
|
521
|
+
month: z__namespace.number().int().min(1).max(12).describe("Contract month number, 1-12."),
|
|
522
|
+
ticker: z__namespace.string().trim().min(1).describe("Specific Bloomberg futures ticker."),
|
|
523
|
+
year: z__namespace.number().int().min(1900).describe("Contract year.")
|
|
433
524
|
});
|
|
434
525
|
function nonEmptyString(options, description) {
|
|
435
|
-
return
|
|
526
|
+
return z__namespace.string().trim().pipe(z__namespace.string().min(1).max(options.maxStringChars).describe(description));
|
|
436
527
|
}
|
|
437
528
|
function stringArray(options, description, maxItems = options.maxFields) {
|
|
438
|
-
return
|
|
529
|
+
return z__namespace.array(nonEmptyString(options, description)).min(1).max(maxItems).describe(description);
|
|
439
530
|
}
|
|
440
531
|
function optionalString(options, description) {
|
|
441
532
|
return nonEmptyString(options, description).optional();
|
|
442
533
|
}
|
|
443
534
|
function tickerSchema(options) {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
),
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
).optional()
|
|
461
|
-
});
|
|
535
|
+
const ticker = nonEmptyString(
|
|
536
|
+
options,
|
|
537
|
+
"One Bloomberg ticker for parse/contract validation operations."
|
|
538
|
+
);
|
|
539
|
+
const tickers = stringArray(
|
|
540
|
+
options,
|
|
541
|
+
"Bloomberg tickers to normalize or filter.",
|
|
542
|
+
options.maxSecurities
|
|
543
|
+
);
|
|
544
|
+
return z__namespace.discriminatedUnion("operation", [
|
|
545
|
+
z__namespace.object({ operation: z__namespace.literal("parse_ticker"), ticker }).strict(),
|
|
546
|
+
z__namespace.object({ operation: z__namespace.literal("is_specific_contract"), ticker }).strict(),
|
|
547
|
+
z__namespace.object({ operation: z__namespace.literal("validate_generic_ticker"), ticker }).strict(),
|
|
548
|
+
z__namespace.object({ operation: z__namespace.literal("normalize_tickers"), tickers }).strict(),
|
|
549
|
+
z__namespace.object({ operation: z__namespace.literal("filter_equity_tickers"), tickers }).strict()
|
|
550
|
+
]);
|
|
462
551
|
}
|
|
463
552
|
function futuresSchema(options) {
|
|
464
|
-
return
|
|
465
|
-
asset: optionalString(options, "Bloomberg asset class suffix
|
|
466
|
-
candidates:
|
|
467
|
-
contracts:
|
|
468
|
-
count:
|
|
553
|
+
return z__namespace.object({
|
|
554
|
+
asset: optionalString(options, "Bloomberg asset class suffix supplied by the user."),
|
|
555
|
+
candidates: z__namespace.array(futuresCandidateSchema).min(1).max(options.maxFields).optional().describe("Candidate futures contracts."),
|
|
556
|
+
contracts: z__namespace.array(stringPairSchema).min(1).max(options.maxFields).optional().describe("Contract pairs for validity filtering."),
|
|
557
|
+
count: z__namespace.number().int().positive().optional().describe("Maximum number of futures candidates to generate."),
|
|
469
558
|
cycle: optionalString(options, "Futures cycle code to filter candidates by."),
|
|
470
|
-
day:
|
|
559
|
+
day: z__namespace.number().int().min(1).max(31).optional().describe("Day number for contract filtering."),
|
|
471
560
|
freq: optionalString(options, "Futures frequency/cycle hint."),
|
|
472
561
|
genTicker: optionalString(options, "Generic Bloomberg futures ticker."),
|
|
473
|
-
month:
|
|
562
|
+
month: z__namespace.number().int().min(1).max(12).optional().describe("Month number, 1-12."),
|
|
474
563
|
monthCode: optionalString(options, "Bloomberg futures month code, for example H."),
|
|
475
|
-
operation:
|
|
564
|
+
operation: z__namespace.enum([
|
|
476
565
|
"build_futures_ticker",
|
|
477
566
|
"generate_candidates",
|
|
478
567
|
"contract_index",
|
|
@@ -481,13 +570,13 @@ function futuresSchema(options) {
|
|
|
481
570
|
"get_futures_months"
|
|
482
571
|
]).describe("Futures helper operation to run."),
|
|
483
572
|
prefix: optionalString(options, "Futures ticker root prefix."),
|
|
484
|
-
year:
|
|
573
|
+
year: z__namespace.union([z__namespace.string().trim().min(1), z__namespace.number().int()]).optional().describe("Contract year.")
|
|
485
574
|
});
|
|
486
575
|
}
|
|
487
576
|
function cdxSchema(options) {
|
|
488
|
-
return
|
|
577
|
+
return z__namespace.object({
|
|
489
578
|
genTicker: optionalString(options, "Generic CDX ticker."),
|
|
490
|
-
operation:
|
|
579
|
+
operation: z__namespace.enum([
|
|
491
580
|
"parse_cdx_ticker",
|
|
492
581
|
"previous_cdx_series",
|
|
493
582
|
"cdx_gen_to_specific",
|
|
@@ -495,35 +584,35 @@ function cdxSchema(options) {
|
|
|
495
584
|
"cdx_pricing",
|
|
496
585
|
"cdx_risk"
|
|
497
586
|
]).describe("CDX helper operation to run."),
|
|
498
|
-
recoveryRate:
|
|
499
|
-
series:
|
|
587
|
+
recoveryRate: z__namespace.number().optional().describe("Optional recovery rate override for pricing/risk lookups."),
|
|
588
|
+
series: z__namespace.number().int().positive().optional().describe("Specific CDX series number."),
|
|
500
589
|
ticker: optionalString(options, "CDX ticker.")
|
|
501
590
|
});
|
|
502
591
|
}
|
|
503
592
|
function currencySchema(options) {
|
|
504
|
-
return
|
|
593
|
+
return z__namespace.object({
|
|
505
594
|
ccy1: optionalString(options, "First ISO currency code."),
|
|
506
595
|
ccy2: optionalString(options, "Second ISO currency code."),
|
|
507
596
|
currencies: stringArray(options, "ISO currency codes.").optional(),
|
|
508
597
|
fromCcy: optionalString(options, "Source ISO currency code."),
|
|
509
|
-
operation:
|
|
598
|
+
operation: z__namespace.enum(["build_fx_pair", "same_currency", "currencies_needing_conversion"]).describe("Currency helper operation to run."),
|
|
510
599
|
target: optionalString(options, "Target ISO currency code."),
|
|
511
600
|
toCcy: optionalString(options, "Destination ISO currency code.")
|
|
512
601
|
});
|
|
513
602
|
}
|
|
514
603
|
function bqlBuilderSchema(options) {
|
|
515
|
-
return
|
|
516
|
-
activeOnly:
|
|
604
|
+
return z__namespace.object({
|
|
605
|
+
activeOnly: z__namespace.boolean().optional().describe("Restrict corporate bond query to active bonds."),
|
|
517
606
|
ccy: optionalString(options, "Currency filter for corporate bond query."),
|
|
518
607
|
equityTicker: optionalString(options, "Equity ticker for preferreds query."),
|
|
519
608
|
etfTicker: optionalString(options, "ETF ticker for holdings query."),
|
|
520
609
|
extraFields: stringArray(options, "Extra BQL fields to include.").optional(),
|
|
521
|
-
operation:
|
|
610
|
+
operation: z__namespace.enum(["build_preferreds_query", "build_corporate_bonds_query", "build_etf_holdings_query"]).describe("BQL builder operation to run."),
|
|
522
611
|
ticker: optionalString(options, "Ticker for corporate bond query.")
|
|
523
612
|
});
|
|
524
613
|
}
|
|
525
614
|
function marketSessionSchema(options) {
|
|
526
|
-
return
|
|
615
|
+
return z__namespace.object({
|
|
527
616
|
countryIso: optionalString(options, "ISO country code for timezone inference."),
|
|
528
617
|
date: optionalString(options, "Date for UTC session conversion, YYYY-MM-DD or YYYYMMDD."),
|
|
529
618
|
dayEnd: optionalString(options, "Exchange day end time, for example 16:00."),
|
|
@@ -534,7 +623,7 @@ function marketSessionSchema(options) {
|
|
|
534
623
|
exchCode: optionalString(options, "Bloomberg exchange code."),
|
|
535
624
|
exchangeTz: optionalString(options, "IANA exchange timezone."),
|
|
536
625
|
mic: optionalString(options, "Market Identifier Code."),
|
|
537
|
-
operation:
|
|
626
|
+
operation: z__namespace.enum([
|
|
538
627
|
"derive_sessions",
|
|
539
628
|
"get_market_rule",
|
|
540
629
|
"infer_timezone",
|
|
@@ -551,25 +640,25 @@ function marketSessionSchema(options) {
|
|
|
551
640
|
});
|
|
552
641
|
}
|
|
553
642
|
function yasOverridesSchema(options) {
|
|
554
|
-
return
|
|
643
|
+
return z__namespace.object({
|
|
555
644
|
benchmark: optionalString(options, "Optional YAS benchmark."),
|
|
556
|
-
price:
|
|
645
|
+
price: z__namespace.number().optional().describe("YAS price override."),
|
|
557
646
|
settleDt: optionalString(options, "YAS settlement date."),
|
|
558
|
-
spread:
|
|
559
|
-
yieldType:
|
|
560
|
-
yieldVal:
|
|
647
|
+
spread: z__namespace.number().optional().describe("YAS spread override."),
|
|
648
|
+
yieldType: z__namespace.number().int().optional().describe("YAS yield type override."),
|
|
649
|
+
yieldVal: z__namespace.number().optional().describe("YAS yield value override.")
|
|
561
650
|
});
|
|
562
651
|
}
|
|
563
652
|
function constantsSchema(options) {
|
|
564
|
-
return
|
|
653
|
+
return z__namespace.object({
|
|
565
654
|
code: optionalString(options, "Month code."),
|
|
566
655
|
dateStr: optionalString(options, "Date string to parse."),
|
|
567
|
-
day:
|
|
656
|
+
day: z__namespace.number().int().min(1).max(31).optional().describe("Day number."),
|
|
568
657
|
dvdType: optionalString(options, "Dividend type code or label."),
|
|
569
658
|
fmt: optionalString(options, "Date output format."),
|
|
570
|
-
month:
|
|
659
|
+
month: z__namespace.number().int().min(1).max(12).optional().describe("Month number."),
|
|
571
660
|
monthName: optionalString(options, "Month name."),
|
|
572
|
-
operation:
|
|
661
|
+
operation: z__namespace.enum([
|
|
573
662
|
"parse_date",
|
|
574
663
|
"fmt_date",
|
|
575
664
|
"get_month_code",
|
|
@@ -580,22 +669,22 @@ function constantsSchema(options) {
|
|
|
580
669
|
"get_dvd_cols",
|
|
581
670
|
"get_etf_cols"
|
|
582
671
|
]).describe("Constants helper operation to run."),
|
|
583
|
-
year:
|
|
672
|
+
year: z__namespace.number().int().min(1).optional().describe("Year number.")
|
|
584
673
|
});
|
|
585
674
|
}
|
|
586
675
|
function columnsSchema(options) {
|
|
587
|
-
return
|
|
676
|
+
return z__namespace.object({
|
|
588
677
|
columns: stringArray(options, "Column names to rename.").optional(),
|
|
589
678
|
dataColumns: stringArray(options, "Earnings data column names.").optional(),
|
|
590
|
-
headerRow:
|
|
591
|
-
operation:
|
|
679
|
+
headerRow: z__namespace.array(stringPairSchema).min(1).max(options.maxFields).optional().describe("Earnings header row key/value pairs."),
|
|
680
|
+
operation: z__namespace.enum(["rename_dividend_columns", "rename_etf_columns", "build_earning_header_rename"]).describe("Column helper operation to run.")
|
|
592
681
|
});
|
|
593
682
|
}
|
|
594
683
|
function calculateSchema(options) {
|
|
595
|
-
return
|
|
596
|
-
levels:
|
|
597
|
-
operation:
|
|
598
|
-
values:
|
|
684
|
+
return z__namespace.object({
|
|
685
|
+
levels: z__namespace.array(z__namespace.number().nullable()).min(1).max(options.maxFields).describe("Reference level values."),
|
|
686
|
+
operation: z__namespace.literal("calculate_level_percentages").describe("Numeric helper operation to run."),
|
|
687
|
+
values: z__namespace.array(z__namespace.number().nullable()).min(1).max(options.maxFields).describe("Observed values.")
|
|
599
688
|
});
|
|
600
689
|
}
|
|
601
690
|
|
|
@@ -669,7 +758,7 @@ var BLOOMBERG_EXT_TOOL_NAMES = Object.freeze(
|
|
|
669
758
|
);
|
|
670
759
|
function extTickerWithResolver(resolver) {
|
|
671
760
|
const name = "xbbg_ext_ticker";
|
|
672
|
-
return
|
|
761
|
+
return createBloombergStructuredTool(
|
|
673
762
|
async (input) => {
|
|
674
763
|
try {
|
|
675
764
|
const core = await resolver.getCore();
|
|
@@ -719,7 +808,7 @@ function extTickerWithResolver(resolver) {
|
|
|
719
808
|
}
|
|
720
809
|
function extFuturesWithResolver(resolver) {
|
|
721
810
|
const name = "xbbg_ext_futures";
|
|
722
|
-
return
|
|
811
|
+
return createBloombergStructuredTool(
|
|
723
812
|
async (input) => {
|
|
724
813
|
try {
|
|
725
814
|
const core = await resolver.getCore();
|
|
@@ -798,7 +887,7 @@ function extFuturesWithResolver(resolver) {
|
|
|
798
887
|
}
|
|
799
888
|
function extCdxWithResolver(resolver) {
|
|
800
889
|
const name = "xbbg_ext_cdx";
|
|
801
|
-
return
|
|
890
|
+
return createBloombergStructuredTool(
|
|
802
891
|
async (input) => {
|
|
803
892
|
try {
|
|
804
893
|
const args = asRecord(input);
|
|
@@ -850,7 +939,7 @@ function extCdxWithResolver(resolver) {
|
|
|
850
939
|
}
|
|
851
940
|
function extCurrencyWithResolver(resolver) {
|
|
852
941
|
const name = "xbbg_ext_currency";
|
|
853
|
-
return
|
|
942
|
+
return createBloombergStructuredTool(
|
|
854
943
|
async (input) => {
|
|
855
944
|
try {
|
|
856
945
|
const core = await resolver.getCore();
|
|
@@ -898,7 +987,7 @@ function extCurrencyWithResolver(resolver) {
|
|
|
898
987
|
}
|
|
899
988
|
function extBqlBuilderWithResolver(resolver) {
|
|
900
989
|
const name = "xbbg_ext_bql_builder";
|
|
901
|
-
return
|
|
990
|
+
return createBloombergStructuredTool(
|
|
902
991
|
async (input) => {
|
|
903
992
|
try {
|
|
904
993
|
const core = await resolver.getCore();
|
|
@@ -948,7 +1037,7 @@ function extBqlBuilderWithResolver(resolver) {
|
|
|
948
1037
|
}
|
|
949
1038
|
function extMarketSessionWithResolver(resolver) {
|
|
950
1039
|
const name = "xbbg_ext_market_session";
|
|
951
|
-
return
|
|
1040
|
+
return createBloombergStructuredTool(
|
|
952
1041
|
async (input) => {
|
|
953
1042
|
try {
|
|
954
1043
|
const core = await resolver.getCore();
|
|
@@ -1019,7 +1108,7 @@ function extMarketSessionWithResolver(resolver) {
|
|
|
1019
1108
|
}
|
|
1020
1109
|
function extYasOverridesWithResolver(resolver) {
|
|
1021
1110
|
const name = "xbbg_ext_yas_overrides";
|
|
1022
|
-
return
|
|
1111
|
+
return createBloombergStructuredTool(
|
|
1023
1112
|
async (input) => {
|
|
1024
1113
|
try {
|
|
1025
1114
|
const core = await resolver.getCore();
|
|
@@ -1049,7 +1138,7 @@ function extYasOverridesWithResolver(resolver) {
|
|
|
1049
1138
|
}
|
|
1050
1139
|
function extConstantsWithResolver(resolver) {
|
|
1051
1140
|
const name = "xbbg_ext_constants";
|
|
1052
|
-
return
|
|
1141
|
+
return createBloombergStructuredTool(
|
|
1053
1142
|
async (input) => {
|
|
1054
1143
|
try {
|
|
1055
1144
|
const core = await resolver.getCore();
|
|
@@ -1113,7 +1202,7 @@ function extConstantsWithResolver(resolver) {
|
|
|
1113
1202
|
}
|
|
1114
1203
|
function extColumnsWithResolver(resolver) {
|
|
1115
1204
|
const name = "xbbg_ext_columns";
|
|
1116
|
-
return
|
|
1205
|
+
return createBloombergStructuredTool(
|
|
1117
1206
|
async (input) => {
|
|
1118
1207
|
try {
|
|
1119
1208
|
const core = await resolver.getCore();
|
|
@@ -1158,7 +1247,7 @@ function extColumnsWithResolver(resolver) {
|
|
|
1158
1247
|
}
|
|
1159
1248
|
function extCalculateWithResolver(resolver) {
|
|
1160
1249
|
const name = "xbbg_ext_calculate";
|
|
1161
|
-
return
|
|
1250
|
+
return createBloombergStructuredTool(
|
|
1162
1251
|
async (input) => {
|
|
1163
1252
|
try {
|
|
1164
1253
|
if (input.values.length !== input.levels.length) {
|
|
@@ -1231,11 +1320,11 @@ var HISTORICAL_FORMATS = [
|
|
|
1231
1320
|
var ISO_DATE_RE = /^\d{4}-\d{2}-\d{2}$/u;
|
|
1232
1321
|
var BBG_DATE_RE = /^\d{8}$/u;
|
|
1233
1322
|
var AMBIGUOUS_DATE_RE = /^\d{1,2}[-/]\d{1,2}[-/]\d{2,4}([T \D]|$)/u;
|
|
1234
|
-
var ISO_DATE_TIME_RE = /^\d{4}-\d{2}-\d{2}
|
|
1235
|
-
var primitiveSchema =
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1323
|
+
var ISO_DATE_TIME_RE = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/u;
|
|
1324
|
+
var primitiveSchema = z__namespace.union([
|
|
1325
|
+
z__namespace.string().transform((value) => value.trim()),
|
|
1326
|
+
z__namespace.number(),
|
|
1327
|
+
z__namespace.boolean()
|
|
1239
1328
|
]);
|
|
1240
1329
|
function dateFromParts(year, month, day) {
|
|
1241
1330
|
const formatted = `${year}${month}${day}`;
|
|
@@ -1289,27 +1378,29 @@ function normalizeDateTime(value) {
|
|
|
1289
1378
|
if (AMBIGUOUS_DATE_RE.test(text)) {
|
|
1290
1379
|
throw new TypeError(`Ambiguous datetime ${JSON.stringify(text)}; use ISO 8601`);
|
|
1291
1380
|
}
|
|
1292
|
-
if (BBG_DATE_RE.test(text)) {
|
|
1293
|
-
|
|
1381
|
+
if (BBG_DATE_RE.test(text) || ISO_DATE_RE.test(text)) {
|
|
1382
|
+
throw new TypeError(
|
|
1383
|
+
`Invalid datetime ${JSON.stringify(text)}; include an explicit time component such as YYYY-MM-DDT09:30:00`
|
|
1384
|
+
);
|
|
1294
1385
|
}
|
|
1295
1386
|
if (!ISO_DATE_TIME_RE.test(text)) {
|
|
1296
1387
|
throw new TypeError(`Invalid datetime ${JSON.stringify(text)}; use ISO 8601`);
|
|
1297
1388
|
}
|
|
1298
1389
|
return text.replace(" ", "T");
|
|
1299
1390
|
}
|
|
1300
|
-
function nonEmptyString2(
|
|
1301
|
-
return
|
|
1302
|
-
|
|
1391
|
+
function nonEmptyString2(tool2, field, maxChars, example) {
|
|
1392
|
+
return z__namespace.string().transform((value) => value.trim()).pipe(
|
|
1393
|
+
z__namespace.string().min(1, `${tool2}: ${field} must be a non-empty string. Example: ${example}`).max(
|
|
1303
1394
|
maxChars,
|
|
1304
|
-
`${
|
|
1395
|
+
`${tool2}: ${field} is too long; expected at most ${maxChars} characters. Example: ${example}`
|
|
1305
1396
|
)
|
|
1306
1397
|
);
|
|
1307
1398
|
}
|
|
1308
|
-
function stringArray2(
|
|
1309
|
-
return
|
|
1399
|
+
function stringArray2(tool2, field, maxItems, maxChars, example) {
|
|
1400
|
+
return z__namespace.array(nonEmptyString2(tool2, field, maxChars, example)).min(1, `${tool2}: ${field} must contain at least one non-empty string. Example: ${example}`).max(maxItems, `${tool2}: ${field} can contain at most ${maxItems} values`);
|
|
1310
1401
|
}
|
|
1311
|
-
function primitiveMap(
|
|
1312
|
-
return
|
|
1402
|
+
function primitiveMap(tool2, field) {
|
|
1403
|
+
return z__namespace.record(z__namespace.string().min(1), primitiveSchema).optional().transform((value) => {
|
|
1313
1404
|
if (value === void 0) {
|
|
1314
1405
|
return void 0;
|
|
1315
1406
|
}
|
|
@@ -1317,169 +1408,187 @@ function primitiveMap(tool3, field) {
|
|
|
1317
1408
|
for (const [key, entry] of Object.entries(value)) {
|
|
1318
1409
|
const normalizedKey = key.trim();
|
|
1319
1410
|
if (normalizedKey.length === 0) {
|
|
1320
|
-
throw new TypeError(`${
|
|
1411
|
+
throw new TypeError(`${tool2}: ${field} contains an empty key`);
|
|
1321
1412
|
}
|
|
1322
1413
|
if (typeof entry === "string" && entry.length === 0) {
|
|
1323
|
-
throw new TypeError(`${
|
|
1414
|
+
throw new TypeError(`${tool2}: ${field}.${normalizedKey} must not be an empty string`);
|
|
1324
1415
|
}
|
|
1325
1416
|
normalized[normalizedKey] = entry;
|
|
1326
1417
|
}
|
|
1327
1418
|
return normalized;
|
|
1328
1419
|
});
|
|
1329
1420
|
}
|
|
1330
|
-
function dateField(
|
|
1331
|
-
return
|
|
1421
|
+
function dateField(tool2, field) {
|
|
1422
|
+
return z__namespace.union([z__namespace.string(), z__namespace.date(), z__namespace.number()]).transform((value) => normalizeDate(value)).describe(
|
|
1332
1423
|
`${field} date. Use YYYY-MM-DD or Bloomberg-native YYYYMMDD, never ambiguous MM/DD/YYYY.`
|
|
1333
1424
|
);
|
|
1334
1425
|
}
|
|
1335
|
-
function dateTimeField(
|
|
1336
|
-
return
|
|
1426
|
+
function dateTimeField(tool2, field) {
|
|
1427
|
+
return z__namespace.union([z__namespace.string(), z__namespace.date(), z__namespace.number()]).superRefine((value, context) => {
|
|
1428
|
+
if (typeof value !== "string") {
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
const text = value.trim();
|
|
1432
|
+
if (BBG_DATE_RE.test(text) || ISO_DATE_RE.test(text)) {
|
|
1433
|
+
context.addIssue({
|
|
1434
|
+
code: "custom",
|
|
1435
|
+
message: `${tool2}: ${field} datetime requires an explicit time component; use ISO 8601 such as YYYY-MM-DDT09:30:00`
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
}).transform((value) => normalizeDateTime(value)).describe(`${field} datetime. Use ISO 8601 with an explicit time component.`);
|
|
1337
1439
|
}
|
|
1338
|
-
function referenceFormat(
|
|
1339
|
-
return
|
|
1340
|
-
|
|
1440
|
+
function referenceFormat(tool2) {
|
|
1441
|
+
return z__namespace.enum(REFERENCE_FORMATS, {
|
|
1442
|
+
errorMap: () => ({
|
|
1443
|
+
message: `${tool2}: format must be one of ${REFERENCE_FORMATS.join(", ")}`
|
|
1444
|
+
})
|
|
1341
1445
|
}).optional();
|
|
1342
1446
|
}
|
|
1343
|
-
function historicalFormat(
|
|
1344
|
-
return
|
|
1345
|
-
|
|
1447
|
+
function historicalFormat(tool2) {
|
|
1448
|
+
return z__namespace.enum(HISTORICAL_FORMATS, {
|
|
1449
|
+
errorMap: () => ({
|
|
1450
|
+
message: `${tool2}: format must be one of ${HISTORICAL_FORMATS.join(", ")}`
|
|
1451
|
+
})
|
|
1346
1452
|
}).optional();
|
|
1347
1453
|
}
|
|
1348
1454
|
function createBdpSchema(options) {
|
|
1349
|
-
const
|
|
1350
|
-
return
|
|
1455
|
+
const tool2 = "xbbg_bdp";
|
|
1456
|
+
return z__namespace.object({
|
|
1351
1457
|
fields: stringArray2(
|
|
1352
|
-
|
|
1458
|
+
tool2,
|
|
1353
1459
|
"fields",
|
|
1354
1460
|
options.maxFields,
|
|
1355
1461
|
options.maxStringChars,
|
|
1356
|
-
'["
|
|
1357
|
-
).describe(
|
|
1358
|
-
|
|
1359
|
-
),
|
|
1360
|
-
format: referenceFormat(tool3).describe(
|
|
1462
|
+
'["<FIELD>"]'
|
|
1463
|
+
).describe("Bloomberg field mnemonics to retrieve. Use xbbg_bflds first if uncertain."),
|
|
1464
|
+
format: referenceFormat(tool2).describe(
|
|
1361
1465
|
"JSON output shape. Usually omit; use long_typed if downstream needs Bloomberg value types."
|
|
1362
1466
|
),
|
|
1363
|
-
includeSecurityErrors:
|
|
1364
|
-
kwargs: primitiveMap(
|
|
1467
|
+
includeSecurityErrors: z__namespace.boolean().optional().describe("Include Bloomberg security errors in the response when supported."),
|
|
1468
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1365
1469
|
"Advanced Bloomberg request kwargs as flat string/number/boolean values only."
|
|
1366
1470
|
),
|
|
1367
|
-
overrides: primitiveMap(
|
|
1471
|
+
overrides: primitiveMap(tool2, "overrides").describe(
|
|
1368
1472
|
"Bloomberg field overrides as flat string/number/boolean values only."
|
|
1369
1473
|
),
|
|
1370
1474
|
securities: stringArray2(
|
|
1371
|
-
|
|
1475
|
+
tool2,
|
|
1372
1476
|
"securities",
|
|
1373
1477
|
options.maxSecurities,
|
|
1374
1478
|
options.maxStringChars,
|
|
1375
|
-
'["
|
|
1479
|
+
'["<TICKER> <MARKET_SECTOR>"]'
|
|
1376
1480
|
).describe(
|
|
1377
|
-
|
|
1481
|
+
"Fully qualified Bloomberg securities supplied by the user; use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs. Do not invent tickers."
|
|
1378
1482
|
),
|
|
1379
|
-
validateFields:
|
|
1483
|
+
validateFields: z__namespace.boolean().optional().describe("Override field validation for this request.")
|
|
1380
1484
|
});
|
|
1381
1485
|
}
|
|
1382
1486
|
function createBdhSchema(options) {
|
|
1383
|
-
const
|
|
1384
|
-
return
|
|
1385
|
-
end: dateField(
|
|
1487
|
+
const tool2 = "xbbg_bdh";
|
|
1488
|
+
return z__namespace.object({
|
|
1489
|
+
end: dateField(tool2, "end").describe("Required end date. Use YYYY-MM-DD or YYYYMMDD."),
|
|
1386
1490
|
fields: stringArray2(
|
|
1387
|
-
|
|
1491
|
+
tool2,
|
|
1388
1492
|
"fields",
|
|
1389
1493
|
options.maxFields,
|
|
1390
1494
|
options.maxStringChars,
|
|
1391
|
-
'["
|
|
1392
|
-
).describe(
|
|
1393
|
-
format: historicalFormat(
|
|
1495
|
+
'["<FIELD>"]'
|
|
1496
|
+
).describe("Bloomberg historical field mnemonics supplied by the user."),
|
|
1497
|
+
format: historicalFormat(tool2).describe(
|
|
1394
1498
|
"Historical JSON output shape. Use wide only when the user asks for a table by date."
|
|
1395
1499
|
),
|
|
1396
|
-
kwargs: primitiveMap(
|
|
1500
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1397
1501
|
"Advanced Bloomberg request kwargs as flat string/number/boolean values only."
|
|
1398
1502
|
),
|
|
1399
|
-
overrides: primitiveMap(
|
|
1503
|
+
overrides: primitiveMap(tool2, "overrides").describe(
|
|
1400
1504
|
"Bloomberg overrides as flat string/number/boolean values only."
|
|
1401
1505
|
),
|
|
1402
1506
|
securities: stringArray2(
|
|
1403
|
-
|
|
1507
|
+
tool2,
|
|
1404
1508
|
"securities",
|
|
1405
1509
|
options.maxSecurities,
|
|
1406
1510
|
options.maxStringChars,
|
|
1407
|
-
'["
|
|
1511
|
+
'["<TICKER> <MARKET_SECTOR>"]'
|
|
1408
1512
|
).describe(
|
|
1409
|
-
|
|
1513
|
+
"Fully qualified Bloomberg securities supplied by the user; use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs."
|
|
1410
1514
|
),
|
|
1411
|
-
start: dateField(
|
|
1412
|
-
validateFields:
|
|
1515
|
+
start: dateField(tool2, "start").describe("Required start date. Use YYYY-MM-DD or YYYYMMDD."),
|
|
1516
|
+
validateFields: z__namespace.boolean().optional().describe("Override field validation for this request.")
|
|
1413
1517
|
}).superRefine((value, ctx) => {
|
|
1414
1518
|
if (value.start > value.end) {
|
|
1415
1519
|
ctx.addIssue({
|
|
1416
1520
|
code: "custom",
|
|
1417
|
-
message: `${
|
|
1521
|
+
message: `${tool2}: start must be on or before end. Use an explicit start/end date range.`,
|
|
1418
1522
|
path: ["start"]
|
|
1419
1523
|
});
|
|
1420
1524
|
}
|
|
1421
1525
|
});
|
|
1422
1526
|
}
|
|
1423
1527
|
function createBdsSchema(options) {
|
|
1424
|
-
const
|
|
1425
|
-
return
|
|
1426
|
-
field: nonEmptyString2(
|
|
1427
|
-
"Exactly one Bloomberg bulk/table field
|
|
1528
|
+
const tool2 = "xbbg_bds";
|
|
1529
|
+
return z__namespace.object({
|
|
1530
|
+
field: nonEmptyString2(tool2, "field", options.maxStringChars, "<BULK_FIELD>").describe(
|
|
1531
|
+
"Exactly one Bloomberg bulk/table field supplied by the user."
|
|
1428
1532
|
),
|
|
1429
|
-
format: referenceFormat(
|
|
1430
|
-
kwargs: primitiveMap(
|
|
1533
|
+
format: referenceFormat(tool2).describe("JSON output shape. Usually omit."),
|
|
1534
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1431
1535
|
"Advanced Bloomberg request kwargs as flat string/number/boolean values only."
|
|
1432
1536
|
),
|
|
1433
|
-
overrides: primitiveMap(
|
|
1537
|
+
overrides: primitiveMap(tool2, "overrides").describe(
|
|
1434
1538
|
"Bloomberg overrides as flat string/number/boolean values only."
|
|
1435
1539
|
),
|
|
1436
1540
|
securities: stringArray2(
|
|
1437
|
-
|
|
1541
|
+
tool2,
|
|
1438
1542
|
"securities",
|
|
1439
1543
|
options.maxSecurities,
|
|
1440
1544
|
options.maxStringChars,
|
|
1441
|
-
'["
|
|
1545
|
+
'["<INDEX_TICKER> <MARKET_SECTOR>"]'
|
|
1442
1546
|
).describe(
|
|
1443
|
-
|
|
1547
|
+
"Fully qualified Bloomberg securities supplied by the user; use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs."
|
|
1444
1548
|
),
|
|
1445
|
-
validateFields:
|
|
1549
|
+
validateFields: z__namespace.boolean().optional().describe("Override field validation for this request.")
|
|
1446
1550
|
});
|
|
1447
1551
|
}
|
|
1448
1552
|
function createBdibSchema(options) {
|
|
1449
|
-
const
|
|
1450
|
-
return
|
|
1451
|
-
end: dateTimeField(
|
|
1553
|
+
const tool2 = "xbbg_bdib";
|
|
1554
|
+
return z__namespace.object({
|
|
1555
|
+
end: dateTimeField(tool2, "end").describe(
|
|
1452
1556
|
"Required intraday end datetime. Use ISO 8601 with timezone when possible."
|
|
1453
1557
|
),
|
|
1454
|
-
eventType: nonEmptyString2(
|
|
1455
|
-
interval:
|
|
1456
|
-
kwargs: primitiveMap(
|
|
1558
|
+
eventType: nonEmptyString2(tool2, "eventType", options.maxStringChars, "<EVENT_TYPE>").optional().describe("Bloomberg event type supplied by the user."),
|
|
1559
|
+
interval: z__namespace.number().int(`${tool2}: interval must be a positive integer number of minutes. Example: 5`).positive(`${tool2}: interval must be greater than zero. Example: 5`).describe("Bar interval in minutes. Must be a positive integer."),
|
|
1560
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1457
1561
|
"Advanced Bloomberg request kwargs as flat string/number/boolean values only."
|
|
1458
1562
|
),
|
|
1459
|
-
outputTz: nonEmptyString2(
|
|
1460
|
-
requestTz: nonEmptyString2(
|
|
1461
|
-
start: dateTimeField(
|
|
1563
|
+
outputTz: nonEmptyString2(tool2, "outputTz", options.maxStringChars, "<TIMEZONE>").optional().describe("Optional output timezone."),
|
|
1564
|
+
requestTz: nonEmptyString2(tool2, "requestTz", options.maxStringChars, "<TIMEZONE>").optional().describe("Timezone for naive start/end datetimes."),
|
|
1565
|
+
start: dateTimeField(tool2, "start").describe(
|
|
1462
1566
|
"Required intraday start datetime. Use ISO 8601 with timezone when possible."
|
|
1463
1567
|
),
|
|
1464
|
-
ticker: nonEmptyString2(
|
|
1465
|
-
|
|
1568
|
+
ticker: nonEmptyString2(
|
|
1569
|
+
tool2,
|
|
1570
|
+
"ticker",
|
|
1571
|
+
options.maxStringChars,
|
|
1572
|
+
"<TICKER> <MARKET_SECTOR>"
|
|
1573
|
+
).describe(
|
|
1574
|
+
"One fully qualified Bloomberg security supplied by the user; use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs."
|
|
1466
1575
|
)
|
|
1467
1576
|
});
|
|
1468
1577
|
}
|
|
1469
1578
|
function createBdtickSchema(options) {
|
|
1470
|
-
const
|
|
1471
|
-
const includeFlag =
|
|
1472
|
-
return
|
|
1473
|
-
end: dateTimeField(
|
|
1579
|
+
const tool2 = "xbbg_bdtick";
|
|
1580
|
+
const includeFlag = z__namespace.boolean().optional().describe("Optional IntradayTickRequest include flag.");
|
|
1581
|
+
return z__namespace.object({
|
|
1582
|
+
end: dateTimeField(tool2, "end").describe(
|
|
1474
1583
|
"Required intraday tick end datetime. Use ISO 8601 with timezone when possible."
|
|
1475
1584
|
),
|
|
1476
1585
|
eventTypes: stringArray2(
|
|
1477
|
-
|
|
1586
|
+
tool2,
|
|
1478
1587
|
"eventTypes",
|
|
1479
1588
|
options.maxFields,
|
|
1480
1589
|
options.maxStringChars,
|
|
1481
|
-
'["
|
|
1482
|
-
).optional().describe('Bloomberg tick event types, for example ["
|
|
1590
|
+
'["<EVENT_TYPE>"]'
|
|
1591
|
+
).optional().describe('Bloomberg tick event types, for example ["<EVENT_TYPE>"].'),
|
|
1483
1592
|
includeBicMicCodes: includeFlag,
|
|
1484
1593
|
includeBloombergStandardConditionCodes: includeFlag,
|
|
1485
1594
|
includeBrokerCodes: includeFlag,
|
|
@@ -1487,94 +1596,99 @@ function createBdtickSchema(options) {
|
|
|
1487
1596
|
includeExchangeCodes: includeFlag,
|
|
1488
1597
|
includeNonPlottableEvents: includeFlag,
|
|
1489
1598
|
includeRpsCodes: includeFlag,
|
|
1490
|
-
kwargs: primitiveMap(
|
|
1599
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1491
1600
|
"Advanced IntradayTickRequest kwargs as flat string/number/boolean values only."
|
|
1492
1601
|
),
|
|
1493
|
-
outputTz: nonEmptyString2(
|
|
1494
|
-
requestTz: nonEmptyString2(
|
|
1495
|
-
start: dateTimeField(
|
|
1602
|
+
outputTz: nonEmptyString2(tool2, "outputTz", options.maxStringChars, "<TIMEZONE>").optional().describe("Optional output timezone."),
|
|
1603
|
+
requestTz: nonEmptyString2(tool2, "requestTz", options.maxStringChars, "<TIMEZONE>").optional().describe("Timezone for naive start/end datetimes."),
|
|
1604
|
+
start: dateTimeField(tool2, "start").describe(
|
|
1496
1605
|
"Required intraday tick start datetime. Use ISO 8601 with timezone when possible."
|
|
1497
1606
|
),
|
|
1498
|
-
ticker: nonEmptyString2(
|
|
1499
|
-
|
|
1607
|
+
ticker: nonEmptyString2(
|
|
1608
|
+
tool2,
|
|
1609
|
+
"ticker",
|
|
1610
|
+
options.maxStringChars,
|
|
1611
|
+
"<TICKER> <MARKET_SECTOR>"
|
|
1612
|
+
).describe(
|
|
1613
|
+
"One fully qualified Bloomberg security supplied by the user; use /isin/<ISIN> for ISINs and /cusip/<CUSIP> for CUSIPs."
|
|
1500
1614
|
)
|
|
1501
1615
|
});
|
|
1502
1616
|
}
|
|
1503
1617
|
function createBqlSchema(options) {
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
1506
|
-
format: referenceFormat(
|
|
1507
|
-
kwargs: primitiveMap(
|
|
1618
|
+
const tool2 = "xbbg_bql";
|
|
1619
|
+
return z__namespace.object({
|
|
1620
|
+
format: referenceFormat(tool2).describe("JSON output shape. Usually omit."),
|
|
1621
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1508
1622
|
"Advanced Bloomberg request kwargs as flat string/number/boolean values only."
|
|
1509
1623
|
),
|
|
1510
|
-
query: nonEmptyString2(
|
|
1511
|
-
|
|
1512
|
-
"query",
|
|
1513
|
-
options.maxBqlQueryChars,
|
|
1514
|
-
"get(px_last) for('AAPL US Equity')"
|
|
1515
|
-
).describe(
|
|
1516
|
-
"Complete BQL expression string. Use get(...) for(...) with an explicit bounded universe; prefer BDP/BDH for simple reference or historical requests."
|
|
1624
|
+
query: nonEmptyString2(tool2, "query", options.maxBqlQueryChars, "<BQL_QUERY>").describe(
|
|
1625
|
+
"Complete BQL expression string with an explicit bounded universe; prefer BDP/BDH for simple reference or historical requests."
|
|
1517
1626
|
)
|
|
1518
1627
|
});
|
|
1519
1628
|
}
|
|
1520
1629
|
function createBqrSchema(options) {
|
|
1521
|
-
const
|
|
1522
|
-
return
|
|
1523
|
-
end: dateTimeField(
|
|
1630
|
+
const tool2 = "xbbg_bqr";
|
|
1631
|
+
return z__namespace.object({
|
|
1632
|
+
end: dateTimeField(tool2, "end").describe(
|
|
1524
1633
|
"Required BQR end datetime. Use ISO 8601 with timezone when possible."
|
|
1525
1634
|
),
|
|
1526
1635
|
eventTypes: stringArray2(
|
|
1527
|
-
|
|
1636
|
+
tool2,
|
|
1528
1637
|
"eventTypes",
|
|
1529
1638
|
options.maxFields,
|
|
1530
1639
|
options.maxStringChars,
|
|
1531
|
-
'["
|
|
1532
|
-
).optional().describe('BQR event types
|
|
1533
|
-
includeBrokerCodes:
|
|
1534
|
-
start: dateTimeField(
|
|
1640
|
+
'["<EVENT_TYPE>"]'
|
|
1641
|
+
).optional().describe('BQR event types, for example ["<EVENT_TYPE>"].'),
|
|
1642
|
+
includeBrokerCodes: z__namespace.boolean().optional().describe("Include broker/dealer attribution columns. Defaults to true in @xbbg/core."),
|
|
1643
|
+
start: dateTimeField(tool2, "start").describe(
|
|
1535
1644
|
"Required BQR start datetime. Use ISO 8601 with timezone when possible."
|
|
1536
1645
|
),
|
|
1537
1646
|
ticker: nonEmptyString2(
|
|
1538
|
-
|
|
1647
|
+
tool2,
|
|
1539
1648
|
"ticker",
|
|
1540
1649
|
options.maxStringChars,
|
|
1541
|
-
"/isin
|
|
1650
|
+
"/isin/<ISIN>@<QUOTE_SOURCE> <MARKET_SECTOR>"
|
|
1542
1651
|
).describe(
|
|
1543
|
-
"Fixed-income ticker or identifier with dealer quote source, for example /isin
|
|
1652
|
+
"Fixed-income ticker or identifier with dealer quote source, for example /isin/<ISIN>@<QUOTE_SOURCE> <MARKET_SECTOR>."
|
|
1544
1653
|
)
|
|
1545
1654
|
});
|
|
1546
1655
|
}
|
|
1547
1656
|
function createBsrchSchema(options) {
|
|
1548
|
-
const
|
|
1549
|
-
return
|
|
1550
|
-
format: referenceFormat(
|
|
1551
|
-
kwargs: primitiveMap(
|
|
1657
|
+
const tool2 = "xbbg_bsrch";
|
|
1658
|
+
return z__namespace.object({
|
|
1659
|
+
format: referenceFormat(tool2).describe("JSON output shape. Usually omit."),
|
|
1660
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1552
1661
|
"Search-grid kwargs as flat string/number/boolean values only."
|
|
1553
1662
|
),
|
|
1554
|
-
overrides: primitiveMap(
|
|
1663
|
+
overrides: primitiveMap(tool2, "overrides").describe(
|
|
1555
1664
|
"Search-grid overrides as flat string/number/boolean values only."
|
|
1556
1665
|
),
|
|
1557
1666
|
searchSpec: nonEmptyString2(
|
|
1558
|
-
|
|
1667
|
+
tool2,
|
|
1559
1668
|
"searchSpec",
|
|
1560
1669
|
options.maxSearchSpecChars,
|
|
1561
|
-
"
|
|
1670
|
+
"<SEARCH_SPEC>"
|
|
1562
1671
|
).describe(
|
|
1563
1672
|
"Bloomberg search/grid domain or saved-search spec. Not for normal security lookup."
|
|
1564
1673
|
)
|
|
1565
1674
|
});
|
|
1566
1675
|
}
|
|
1567
1676
|
function createBfldsSchema(options) {
|
|
1568
|
-
const
|
|
1569
|
-
return
|
|
1570
|
-
fields: stringArray2(
|
|
1571
|
-
|
|
1677
|
+
const tool2 = "xbbg_bflds";
|
|
1678
|
+
return z__namespace.object({
|
|
1679
|
+
fields: stringArray2(tool2, "fields", options.maxFields, options.maxStringChars, '["<FIELD>"]').optional().describe(
|
|
1680
|
+
"Specific field mnemonics to inspect. Provide either fields or searchSpec, not both."
|
|
1572
1681
|
),
|
|
1573
|
-
format: referenceFormat(
|
|
1574
|
-
kwargs: primitiveMap(
|
|
1682
|
+
format: referenceFormat(tool2).describe("JSON output shape. Usually omit."),
|
|
1683
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1575
1684
|
"Advanced Bloomberg request kwargs as flat string/number/boolean values only."
|
|
1576
1685
|
),
|
|
1577
|
-
searchSpec: nonEmptyString2(
|
|
1686
|
+
searchSpec: nonEmptyString2(
|
|
1687
|
+
tool2,
|
|
1688
|
+
"searchSpec",
|
|
1689
|
+
options.maxSearchSpecChars,
|
|
1690
|
+
"<FIELD_SEARCH_TEXT>"
|
|
1691
|
+
).optional().describe(
|
|
1578
1692
|
"Field search text when the field mnemonic is unknown. Provide either searchSpec or fields, not both."
|
|
1579
1693
|
)
|
|
1580
1694
|
}).superRefine((value, ctx) => {
|
|
@@ -1583,188 +1697,198 @@ function createBfldsSchema(options) {
|
|
|
1583
1697
|
if (hasFields === hasSearchSpec) {
|
|
1584
1698
|
ctx.addIssue({
|
|
1585
1699
|
code: "custom",
|
|
1586
|
-
message: `${
|
|
1700
|
+
message: `${tool2}: provide exactly one of fields or searchSpec. Example: {"fields":["<FIELD>"]}`,
|
|
1587
1701
|
path: ["fields"]
|
|
1588
1702
|
});
|
|
1589
1703
|
}
|
|
1590
1704
|
});
|
|
1591
1705
|
}
|
|
1592
1706
|
function createBeqsSchema(options) {
|
|
1593
|
-
const
|
|
1594
|
-
return
|
|
1595
|
-
asof: dateField(
|
|
1596
|
-
format: referenceFormat(
|
|
1597
|
-
group: nonEmptyString2(
|
|
1598
|
-
kwargs: primitiveMap(
|
|
1707
|
+
const tool2 = "xbbg_beqs";
|
|
1708
|
+
return z__namespace.object({
|
|
1709
|
+
asof: dateField(tool2, "asof").optional().describe("Optional as-of date for the screen."),
|
|
1710
|
+
format: referenceFormat(tool2).describe("JSON output shape. Usually omit."),
|
|
1711
|
+
group: nonEmptyString2(tool2, "group", options.maxStringChars, "<BEQS_GROUP>").optional().describe("Bloomberg BEQS group when required by the screen."),
|
|
1712
|
+
kwargs: primitiveMap(tool2, "kwargs").describe(
|
|
1599
1713
|
"Advanced BEQS request kwargs as flat string/number/boolean values only."
|
|
1600
1714
|
),
|
|
1601
|
-
overrides: primitiveMap(
|
|
1715
|
+
overrides: primitiveMap(tool2, "overrides").describe(
|
|
1602
1716
|
"BEQS overrides as flat string/number/boolean values only."
|
|
1603
1717
|
),
|
|
1604
|
-
screen: nonEmptyString2(
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
"Core Capital Goods Makers"
|
|
1609
|
-
).describe("Existing Bloomberg BEQS screen name."),
|
|
1610
|
-
screenType: nonEmptyString2(tool3, "screenType", options.maxStringChars, "PRIVATE").optional().describe("Bloomberg BEQS screen type. Defaults to PRIVATE in @xbbg/core.")
|
|
1718
|
+
screen: nonEmptyString2(tool2, "screen", options.maxStringChars, "<BEQS_SCREEN>").describe(
|
|
1719
|
+
"Existing Bloomberg BEQS screen name supplied by the user."
|
|
1720
|
+
),
|
|
1721
|
+
screenType: nonEmptyString2(tool2, "screenType", options.maxStringChars, "<SCREEN_TYPE>").optional().describe("Bloomberg BEQS screen type when required by the screen.")
|
|
1611
1722
|
});
|
|
1612
1723
|
}
|
|
1613
1724
|
function createYasSchema(options) {
|
|
1614
|
-
const
|
|
1615
|
-
return
|
|
1616
|
-
benchmark: nonEmptyString2(
|
|
1725
|
+
const tool2 = "xbbg_yas";
|
|
1726
|
+
return z__namespace.object({
|
|
1727
|
+
benchmark: nonEmptyString2(tool2, "benchmark", options.maxStringChars, "<BENCHMARK_TICKER>").optional().describe("Optional YAS benchmark supplied by the user."),
|
|
1617
1728
|
fields: stringArray2(
|
|
1618
|
-
|
|
1729
|
+
tool2,
|
|
1619
1730
|
"fields",
|
|
1620
1731
|
options.maxFields,
|
|
1621
1732
|
options.maxStringChars,
|
|
1622
|
-
'["
|
|
1623
|
-
).describe(
|
|
1624
|
-
price:
|
|
1625
|
-
settleDt: dateField(
|
|
1626
|
-
spread:
|
|
1733
|
+
'["<YAS_FIELD>"]'
|
|
1734
|
+
).describe("YAS field mnemonics supplied by the user."),
|
|
1735
|
+
price: z__namespace.number().optional().describe("Optional YAS price input."),
|
|
1736
|
+
settleDt: dateField(tool2, "settleDt").optional().describe("Optional YAS settlement date."),
|
|
1737
|
+
spread: z__namespace.number().optional().describe("Optional YAS spread input."),
|
|
1627
1738
|
tickers: stringArray2(
|
|
1628
|
-
|
|
1739
|
+
tool2,
|
|
1629
1740
|
"tickers",
|
|
1630
1741
|
options.maxSecurities,
|
|
1631
1742
|
options.maxStringChars,
|
|
1632
|
-
'["/isin
|
|
1633
|
-
).describe(
|
|
1634
|
-
|
|
1635
|
-
)
|
|
1636
|
-
yieldType: z2__namespace.number().int().optional().describe("Optional YAS yield type."),
|
|
1637
|
-
yieldVal: z2__namespace.number().optional().describe("Optional YAS yield value input.")
|
|
1743
|
+
'["/isin/<ISIN> <MARKET_SECTOR>"]'
|
|
1744
|
+
).describe("Fully qualified fixed-income Bloomberg securities supplied by the user."),
|
|
1745
|
+
yieldType: z__namespace.number().int().optional().describe("Optional YAS yield type."),
|
|
1746
|
+
yieldVal: z__namespace.number().optional().describe("Optional YAS yield value input.")
|
|
1638
1747
|
});
|
|
1639
1748
|
}
|
|
1640
1749
|
function createPreferredsSchema(options) {
|
|
1641
|
-
const
|
|
1642
|
-
return
|
|
1750
|
+
const tool2 = "xbbg_preferreds";
|
|
1751
|
+
return z__namespace.object({
|
|
1643
1752
|
equityTicker: nonEmptyString2(
|
|
1644
|
-
|
|
1753
|
+
tool2,
|
|
1645
1754
|
"equityTicker",
|
|
1646
1755
|
options.maxStringChars,
|
|
1647
|
-
"
|
|
1648
|
-
).describe("One fully qualified issuer equity ticker."),
|
|
1649
|
-
fields: stringArray2(
|
|
1756
|
+
"<ISSUER_TICKER> <MARKET_SECTOR>"
|
|
1757
|
+
).describe("One fully qualified issuer equity ticker supplied by the user."),
|
|
1758
|
+
fields: stringArray2(tool2, "fields", options.maxFields, options.maxStringChars, '["<FIELD>"]').optional().describe("Optional fields to include in the preferreds recipe result.")
|
|
1650
1759
|
});
|
|
1651
1760
|
}
|
|
1652
1761
|
function createCorporateBondsSchema(options) {
|
|
1653
|
-
const
|
|
1654
|
-
return
|
|
1655
|
-
activeOnly:
|
|
1656
|
-
ccy: nonEmptyString2(
|
|
1657
|
-
fields: stringArray2(
|
|
1658
|
-
ticker: nonEmptyString2(
|
|
1659
|
-
|
|
1660
|
-
|
|
1762
|
+
const tool2 = "xbbg_corporate_bonds";
|
|
1763
|
+
return z__namespace.object({
|
|
1764
|
+
activeOnly: z__namespace.boolean().optional().describe("Restrict to active bonds. Defaults to true in @xbbg/core."),
|
|
1765
|
+
ccy: nonEmptyString2(tool2, "ccy", options.maxStringChars, "<CCY>").optional().describe("Optional currency filter supplied by the user."),
|
|
1766
|
+
fields: stringArray2(tool2, "fields", options.maxFields, options.maxStringChars, '["<FIELD>"]').optional().describe("Optional fields to include in the corporate bond result."),
|
|
1767
|
+
ticker: nonEmptyString2(
|
|
1768
|
+
tool2,
|
|
1769
|
+
"ticker",
|
|
1770
|
+
options.maxStringChars,
|
|
1771
|
+
"<ISSUER_TICKER> <MARKET_SECTOR>"
|
|
1772
|
+
).describe("One fully qualified issuer/company ticker supplied by the user.")
|
|
1661
1773
|
});
|
|
1662
1774
|
}
|
|
1663
1775
|
function createIndexMembersSchema(options) {
|
|
1664
|
-
const
|
|
1665
|
-
return
|
|
1666
|
-
asof: dateField(
|
|
1667
|
-
field:
|
|
1668
|
-
index: nonEmptyString2(
|
|
1669
|
-
|
|
1670
|
-
|
|
1776
|
+
const tool2 = "xbbg_index_members";
|
|
1777
|
+
return z__namespace.object({
|
|
1778
|
+
asof: dateField(tool2, "asof").optional().describe("Optional index membership as-of date."),
|
|
1779
|
+
field: z__namespace.enum(["INDX_MWEIGHT", "INDX_MEMBERS", "INDX_MEMBERS3"]).optional().describe("Bloomberg index members field. Omit for @xbbg/core default."),
|
|
1780
|
+
index: nonEmptyString2(
|
|
1781
|
+
tool2,
|
|
1782
|
+
"index",
|
|
1783
|
+
options.maxStringChars,
|
|
1784
|
+
"<INDEX_TICKER> <MARKET_SECTOR>"
|
|
1785
|
+
).describe("One fully qualified Bloomberg index ticker supplied by the user.")
|
|
1671
1786
|
});
|
|
1672
1787
|
}
|
|
1673
1788
|
function createResolveIsinsSchema(options) {
|
|
1674
|
-
const
|
|
1675
|
-
return
|
|
1789
|
+
const tool2 = "xbbg_resolve_isins";
|
|
1790
|
+
return z__namespace.object({
|
|
1676
1791
|
isins: stringArray2(
|
|
1677
|
-
|
|
1792
|
+
tool2,
|
|
1678
1793
|
"isins",
|
|
1679
1794
|
options.maxSecurities,
|
|
1680
1795
|
options.maxStringChars,
|
|
1681
|
-
'["
|
|
1796
|
+
'["<ISIN>"]'
|
|
1682
1797
|
).describe("Raw ISIN strings to resolve. Do not add /isin/ prefixes for this recipe.")
|
|
1683
1798
|
});
|
|
1684
1799
|
}
|
|
1685
1800
|
function createIssuerIsinsSchema(options) {
|
|
1686
|
-
const
|
|
1687
|
-
return
|
|
1801
|
+
const tool2 = "xbbg_issuer_isins";
|
|
1802
|
+
return z__namespace.object({
|
|
1688
1803
|
bondIsins: stringArray2(
|
|
1689
|
-
|
|
1804
|
+
tool2,
|
|
1690
1805
|
"bondIsins",
|
|
1691
1806
|
options.maxSecurities,
|
|
1692
1807
|
options.maxStringChars,
|
|
1693
|
-
'["
|
|
1808
|
+
'["<BOND_ISIN>"]'
|
|
1694
1809
|
).describe("Raw bond ISIN strings for issuer-level ISIN discovery.")
|
|
1695
1810
|
});
|
|
1696
1811
|
}
|
|
1697
1812
|
function createEtfHoldingsSchema(options) {
|
|
1698
|
-
const
|
|
1699
|
-
return
|
|
1700
|
-
etfTicker: nonEmptyString2(
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1813
|
+
const tool2 = "xbbg_etf_holdings";
|
|
1814
|
+
return z__namespace.object({
|
|
1815
|
+
etfTicker: nonEmptyString2(
|
|
1816
|
+
tool2,
|
|
1817
|
+
"etfTicker",
|
|
1818
|
+
options.maxStringChars,
|
|
1819
|
+
"<ETF_TICKER> <MARKET_SECTOR>"
|
|
1820
|
+
).describe("One fully qualified Bloomberg ETF ticker supplied by the user."),
|
|
1821
|
+
fields: stringArray2(tool2, "fields", options.maxFields, options.maxStringChars, '["<FIELD>"]').optional().describe("Optional fields to include in the ETF holdings recipe result.")
|
|
1704
1822
|
});
|
|
1705
1823
|
}
|
|
1706
|
-
function snapshotControlFields(
|
|
1824
|
+
function snapshotControlFields(tool2, options) {
|
|
1707
1825
|
return {
|
|
1708
|
-
allFields:
|
|
1709
|
-
conflate:
|
|
1710
|
-
drain:
|
|
1826
|
+
allFields: z__namespace.boolean().optional().describe("Request all Bloomberg fields when supported."),
|
|
1827
|
+
conflate: z__namespace.boolean().optional().describe("Enable Bloomberg conflated streaming when supported."),
|
|
1828
|
+
drain: z__namespace.boolean().optional().describe(
|
|
1711
1829
|
"Pass drain=true to unsubscribe. Defaults to false; collected output remains bounded."
|
|
1712
1830
|
),
|
|
1713
|
-
flushThreshold:
|
|
1714
|
-
maxUpdates:
|
|
1831
|
+
flushThreshold: z__namespace.number().int().positive().optional().describe("Optional stream flush threshold."),
|
|
1832
|
+
maxUpdates: z__namespace.number().int(`${tool2}: maxUpdates must be a positive integer.`).positive(`${tool2}: maxUpdates must be greater than zero.`).max(
|
|
1715
1833
|
options.maxStreamUpdates,
|
|
1716
|
-
`${
|
|
1834
|
+
`${tool2}: maxUpdates can be at most ${options.maxStreamUpdates}.`
|
|
1717
1835
|
).describe("Required maximum number of updates to collect before unsubscribing."),
|
|
1718
1836
|
options: stringArray2(
|
|
1719
|
-
|
|
1837
|
+
tool2,
|
|
1720
1838
|
"options",
|
|
1721
1839
|
options.maxFields,
|
|
1722
1840
|
options.maxStringChars,
|
|
1723
1841
|
'["interval=5"]'
|
|
1724
1842
|
).optional().describe("Advanced Bloomberg subscription options."),
|
|
1725
|
-
overflowPolicy: nonEmptyString2(
|
|
1726
|
-
streamCapacity:
|
|
1727
|
-
timeoutMs:
|
|
1843
|
+
overflowPolicy: nonEmptyString2(tool2, "overflowPolicy", options.maxStringChars, "drop_oldest").optional().describe("Optional stream overflow policy."),
|
|
1844
|
+
streamCapacity: z__namespace.number().int().positive().optional().describe("Optional stream capacity."),
|
|
1845
|
+
timeoutMs: z__namespace.number().int().positive().max(options.maxStreamWaitMs, `${tool2}: timeoutMs can be at most ${options.maxStreamWaitMs}.`).optional().default(options.maxStreamWaitMs).describe("Maximum total wait in milliseconds before unsubscribing.")
|
|
1728
1846
|
};
|
|
1729
1847
|
}
|
|
1730
1848
|
function createStreamSnapshotSchema(options) {
|
|
1731
|
-
const
|
|
1732
|
-
return
|
|
1849
|
+
const tool2 = "xbbg_stream_snapshot";
|
|
1850
|
+
return z__namespace.object({
|
|
1733
1851
|
fields: stringArray2(
|
|
1734
|
-
|
|
1852
|
+
tool2,
|
|
1735
1853
|
"fields",
|
|
1736
1854
|
options.maxFields,
|
|
1737
1855
|
options.maxStringChars,
|
|
1738
|
-
'["
|
|
1856
|
+
'["<FIELD>"]'
|
|
1739
1857
|
).describe("Bloomberg market-data fields to observe."),
|
|
1740
1858
|
tickers: stringArray2(
|
|
1741
|
-
|
|
1859
|
+
tool2,
|
|
1742
1860
|
"tickers",
|
|
1743
1861
|
options.maxSecurities,
|
|
1744
1862
|
options.maxStringChars,
|
|
1745
|
-
'["
|
|
1746
|
-
).describe("Fully qualified Bloomberg securities to observe."),
|
|
1747
|
-
...snapshotControlFields(
|
|
1863
|
+
'["<TICKER> <MARKET_SECTOR>"]'
|
|
1864
|
+
).describe("Fully qualified Bloomberg securities supplied by the user to observe."),
|
|
1865
|
+
...snapshotControlFields(tool2, options)
|
|
1748
1866
|
});
|
|
1749
1867
|
}
|
|
1750
1868
|
function createMktbarSnapshotSchema(options) {
|
|
1751
|
-
const
|
|
1752
|
-
return
|
|
1753
|
-
fields: stringArray2(
|
|
1754
|
-
ticker: nonEmptyString2(
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1869
|
+
const tool2 = "xbbg_mktbar_snapshot";
|
|
1870
|
+
return z__namespace.object({
|
|
1871
|
+
fields: stringArray2(tool2, "fields", options.maxFields, options.maxStringChars, '["<FIELD>"]').optional().describe("Optional market-bar fields. Omit for Bloomberg defaults."),
|
|
1872
|
+
ticker: nonEmptyString2(
|
|
1873
|
+
tool2,
|
|
1874
|
+
"ticker",
|
|
1875
|
+
options.maxStringChars,
|
|
1876
|
+
"<TICKER> <MARKET_SECTOR>"
|
|
1877
|
+
).describe("One fully qualified Bloomberg security supplied by the user to observe."),
|
|
1878
|
+
...snapshotControlFields(tool2, options)
|
|
1758
1879
|
});
|
|
1759
1880
|
}
|
|
1760
1881
|
function createDepthSnapshotSchema(options) {
|
|
1761
|
-
const
|
|
1762
|
-
return
|
|
1763
|
-
fields: stringArray2(
|
|
1764
|
-
ticker: nonEmptyString2(
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1882
|
+
const tool2 = "xbbg_depth_snapshot";
|
|
1883
|
+
return z__namespace.object({
|
|
1884
|
+
fields: stringArray2(tool2, "fields", options.maxFields, options.maxStringChars, '["<FIELD>"]').optional().describe("Optional market-depth fields. Omit for Bloomberg defaults."),
|
|
1885
|
+
ticker: nonEmptyString2(
|
|
1886
|
+
tool2,
|
|
1887
|
+
"ticker",
|
|
1888
|
+
options.maxStringChars,
|
|
1889
|
+
"<TICKER> <MARKET_SECTOR>"
|
|
1890
|
+
).describe("One fully qualified Bloomberg security supplied by the user to observe."),
|
|
1891
|
+
...snapshotControlFields(tool2, options)
|
|
1768
1892
|
});
|
|
1769
1893
|
}
|
|
1770
1894
|
|
|
@@ -1907,7 +2031,7 @@ function enabledTool(resolver, name, creator) {
|
|
|
1907
2031
|
}
|
|
1908
2032
|
function bdpWithResolver(resolver) {
|
|
1909
2033
|
const name = "xbbg_bdp";
|
|
1910
|
-
return
|
|
2034
|
+
return createBloombergStructuredTool(
|
|
1911
2035
|
async (input) => {
|
|
1912
2036
|
try {
|
|
1913
2037
|
const engine = await resolver.getEngine();
|
|
@@ -1934,7 +2058,7 @@ function bdpWithResolver(resolver) {
|
|
|
1934
2058
|
}
|
|
1935
2059
|
function bdhWithResolver(resolver) {
|
|
1936
2060
|
const name = "xbbg_bdh";
|
|
1937
|
-
return
|
|
2061
|
+
return createBloombergStructuredTool(
|
|
1938
2062
|
async (input) => {
|
|
1939
2063
|
try {
|
|
1940
2064
|
const engine = await resolver.getEngine();
|
|
@@ -1962,7 +2086,7 @@ function bdhWithResolver(resolver) {
|
|
|
1962
2086
|
}
|
|
1963
2087
|
function bdsWithResolver(resolver) {
|
|
1964
2088
|
const name = "xbbg_bds";
|
|
1965
|
-
return
|
|
2089
|
+
return createBloombergStructuredTool(
|
|
1966
2090
|
async (input) => {
|
|
1967
2091
|
try {
|
|
1968
2092
|
const engine = await resolver.getEngine();
|
|
@@ -1988,7 +2112,7 @@ function bdsWithResolver(resolver) {
|
|
|
1988
2112
|
}
|
|
1989
2113
|
function bdibWithResolver(resolver) {
|
|
1990
2114
|
const name = "xbbg_bdib";
|
|
1991
|
-
return
|
|
2115
|
+
return createBloombergStructuredTool(
|
|
1992
2116
|
async (input) => {
|
|
1993
2117
|
try {
|
|
1994
2118
|
const engine = await resolver.getEngine();
|
|
@@ -2017,7 +2141,7 @@ function bdibWithResolver(resolver) {
|
|
|
2017
2141
|
}
|
|
2018
2142
|
function bdtickWithResolver(resolver) {
|
|
2019
2143
|
const name = "xbbg_bdtick";
|
|
2020
|
-
return
|
|
2144
|
+
return createBloombergStructuredTool(
|
|
2021
2145
|
async (input) => {
|
|
2022
2146
|
try {
|
|
2023
2147
|
const engine = await resolver.getEngine();
|
|
@@ -2052,7 +2176,7 @@ function bdtickWithResolver(resolver) {
|
|
|
2052
2176
|
}
|
|
2053
2177
|
function bqlWithResolver(resolver) {
|
|
2054
2178
|
const name = "xbbg_bql";
|
|
2055
|
-
return
|
|
2179
|
+
return createBloombergStructuredTool(
|
|
2056
2180
|
async (input) => {
|
|
2057
2181
|
try {
|
|
2058
2182
|
const engine = await resolver.getEngine();
|
|
@@ -2076,7 +2200,7 @@ function bqlWithResolver(resolver) {
|
|
|
2076
2200
|
}
|
|
2077
2201
|
function bsrchWithResolver(resolver) {
|
|
2078
2202
|
const name = "xbbg_bsrch";
|
|
2079
|
-
return
|
|
2203
|
+
return createBloombergStructuredTool(
|
|
2080
2204
|
async (input) => {
|
|
2081
2205
|
try {
|
|
2082
2206
|
const engine = await resolver.getEngine();
|
|
@@ -2101,7 +2225,7 @@ function bsrchWithResolver(resolver) {
|
|
|
2101
2225
|
}
|
|
2102
2226
|
function bqrWithResolver(resolver) {
|
|
2103
2227
|
const name = "xbbg_bqr";
|
|
2104
|
-
return
|
|
2228
|
+
return createBloombergStructuredTool(
|
|
2105
2229
|
async (input) => {
|
|
2106
2230
|
try {
|
|
2107
2231
|
const engine = await resolver.getEngine();
|
|
@@ -2127,7 +2251,7 @@ function bqrWithResolver(resolver) {
|
|
|
2127
2251
|
}
|
|
2128
2252
|
function bfldsWithResolver(resolver) {
|
|
2129
2253
|
const name = "xbbg_bflds";
|
|
2130
|
-
return
|
|
2254
|
+
return createBloombergStructuredTool(
|
|
2131
2255
|
async (input) => {
|
|
2132
2256
|
try {
|
|
2133
2257
|
const engine = await resolver.getEngine();
|
|
@@ -2153,7 +2277,7 @@ function bfldsWithResolver(resolver) {
|
|
|
2153
2277
|
}
|
|
2154
2278
|
function beqsWithResolver(resolver) {
|
|
2155
2279
|
const name = "xbbg_beqs";
|
|
2156
|
-
return
|
|
2280
|
+
return createBloombergStructuredTool(
|
|
2157
2281
|
async (input) => {
|
|
2158
2282
|
try {
|
|
2159
2283
|
const engine = await resolver.getEngine();
|
|
@@ -2181,7 +2305,7 @@ function beqsWithResolver(resolver) {
|
|
|
2181
2305
|
}
|
|
2182
2306
|
function yasWithResolver(resolver) {
|
|
2183
2307
|
const name = "xbbg_yas";
|
|
2184
|
-
return
|
|
2308
|
+
return createBloombergStructuredTool(
|
|
2185
2309
|
async (input) => {
|
|
2186
2310
|
try {
|
|
2187
2311
|
const engine = await resolver.getEngine();
|
|
@@ -2209,7 +2333,7 @@ function yasWithResolver(resolver) {
|
|
|
2209
2333
|
}
|
|
2210
2334
|
function preferredsWithResolver(resolver) {
|
|
2211
2335
|
const name = "xbbg_preferreds";
|
|
2212
|
-
return
|
|
2336
|
+
return createBloombergStructuredTool(
|
|
2213
2337
|
async (input) => {
|
|
2214
2338
|
try {
|
|
2215
2339
|
const engine = await resolver.getEngine();
|
|
@@ -2232,7 +2356,7 @@ function preferredsWithResolver(resolver) {
|
|
|
2232
2356
|
}
|
|
2233
2357
|
function corporateBondsWithResolver(resolver) {
|
|
2234
2358
|
const name = "xbbg_corporate_bonds";
|
|
2235
|
-
return
|
|
2359
|
+
return createBloombergStructuredTool(
|
|
2236
2360
|
async (input) => {
|
|
2237
2361
|
try {
|
|
2238
2362
|
const engine = await resolver.getEngine();
|
|
@@ -2257,7 +2381,7 @@ function corporateBondsWithResolver(resolver) {
|
|
|
2257
2381
|
}
|
|
2258
2382
|
function indexMembersWithResolver(resolver) {
|
|
2259
2383
|
const name = "xbbg_index_members";
|
|
2260
|
-
return
|
|
2384
|
+
return createBloombergStructuredTool(
|
|
2261
2385
|
async (input) => {
|
|
2262
2386
|
try {
|
|
2263
2387
|
const engine = await resolver.getEngine();
|
|
@@ -2281,7 +2405,7 @@ function indexMembersWithResolver(resolver) {
|
|
|
2281
2405
|
}
|
|
2282
2406
|
function resolveIsinsWithResolver(resolver) {
|
|
2283
2407
|
const name = "xbbg_resolve_isins";
|
|
2284
|
-
return
|
|
2408
|
+
return createBloombergStructuredTool(
|
|
2285
2409
|
async (input) => {
|
|
2286
2410
|
try {
|
|
2287
2411
|
const engine = await resolver.getEngine();
|
|
@@ -2301,7 +2425,7 @@ function resolveIsinsWithResolver(resolver) {
|
|
|
2301
2425
|
}
|
|
2302
2426
|
function issuerIsinsWithResolver(resolver) {
|
|
2303
2427
|
const name = "xbbg_issuer_isins";
|
|
2304
|
-
return
|
|
2428
|
+
return createBloombergStructuredTool(
|
|
2305
2429
|
async (input) => {
|
|
2306
2430
|
try {
|
|
2307
2431
|
const engine = await resolver.getEngine();
|
|
@@ -2321,7 +2445,7 @@ function issuerIsinsWithResolver(resolver) {
|
|
|
2321
2445
|
}
|
|
2322
2446
|
function etfHoldingsWithResolver(resolver) {
|
|
2323
2447
|
const name = "xbbg_etf_holdings";
|
|
2324
|
-
return
|
|
2448
|
+
return createBloombergStructuredTool(
|
|
2325
2449
|
async (input) => {
|
|
2326
2450
|
try {
|
|
2327
2451
|
const engine = await resolver.getEngine();
|
|
@@ -2344,7 +2468,7 @@ function etfHoldingsWithResolver(resolver) {
|
|
|
2344
2468
|
}
|
|
2345
2469
|
function streamSnapshotWithResolver(resolver) {
|
|
2346
2470
|
const name = "xbbg_stream_snapshot";
|
|
2347
|
-
return
|
|
2471
|
+
return createBloombergStructuredTool(
|
|
2348
2472
|
async (input) => {
|
|
2349
2473
|
try {
|
|
2350
2474
|
const engine = await resolver.getEngine();
|
|
@@ -2365,7 +2489,7 @@ function streamSnapshotWithResolver(resolver) {
|
|
|
2365
2489
|
}
|
|
2366
2490
|
function mktbarSnapshotWithResolver(resolver) {
|
|
2367
2491
|
const name = "xbbg_mktbar_snapshot";
|
|
2368
|
-
return
|
|
2492
|
+
return createBloombergStructuredTool(
|
|
2369
2493
|
async (input) => {
|
|
2370
2494
|
try {
|
|
2371
2495
|
const engine = await resolver.getEngine();
|
|
@@ -2386,7 +2510,7 @@ function mktbarSnapshotWithResolver(resolver) {
|
|
|
2386
2510
|
}
|
|
2387
2511
|
function depthSnapshotWithResolver(resolver) {
|
|
2388
2512
|
const name = "xbbg_depth_snapshot";
|
|
2389
|
-
return
|
|
2513
|
+
return createBloombergStructuredTool(
|
|
2390
2514
|
async (input) => {
|
|
2391
2515
|
try {
|
|
2392
2516
|
const engine = await resolver.getEngine();
|