@alva-ai/toolkit 0.28.0 → 0.28.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/browser.global.js +52 -16
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +196 -8
- package/dist/cli.js +1057 -44
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.d.ts +196 -8
- package/dist/dispatch.js +683 -20
- package/dist/dispatch.js.map +1 -1
- package/dist/index.cjs +650 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +195 -9
- package/dist/index.d.ts +195 -9
- package/dist/index.js +648 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3246,7 +3246,6 @@ var MarketsResource = class {
|
|
|
3246
3246
|
// src/resources/schedules.ts
|
|
3247
3247
|
var SCHEDULE_FIELDS = `
|
|
3248
3248
|
id
|
|
3249
|
-
channel { id }
|
|
3250
3249
|
name
|
|
3251
3250
|
rule { kind atMs everyIntervalSeconds cronExpression cronTimezone }
|
|
3252
3251
|
bounds { startsAtMs untilMs maxOccurrences }
|
|
@@ -3263,7 +3262,7 @@ var LIST_SCHEDULES = `
|
|
|
3263
3262
|
query ToolkitListAgentSchedules($channelId: ID!, $after: String) {
|
|
3264
3263
|
viewer { channel(id: $channelId) {
|
|
3265
3264
|
schedules(input: { first: 64, after: $after }) {
|
|
3266
|
-
edges { node { ${SCHEDULE_FIELDS} } }
|
|
3265
|
+
edges { node { channel { id } ${SCHEDULE_FIELDS} } }
|
|
3267
3266
|
pageInfo { hasNextPage endCursor }
|
|
3268
3267
|
}
|
|
3269
3268
|
} }
|
|
@@ -3271,6 +3270,20 @@ query ToolkitListAgentSchedules($channelId: ID!, $after: String) {
|
|
|
3271
3270
|
var UPDATE_SCHEDULE = `
|
|
3272
3271
|
mutation ToolkitUpdateAgentSchedule($input: UpdateChannelScheduleInput!) {
|
|
3273
3272
|
updateChannelSchedule(input: $input) {
|
|
3273
|
+
schedule { channel { id } ${SCHEDULE_FIELDS} }
|
|
3274
|
+
deleted
|
|
3275
|
+
}
|
|
3276
|
+
}`.trim();
|
|
3277
|
+
var LIST_SESSION_SCHEDULES = `
|
|
3278
|
+
query ToolkitListSessionSchedules($inboxPath: String!, $after: String) {
|
|
3279
|
+
viewer { sessionSchedules(inboxPath: $inboxPath, input: { first: 64, after: $after }) {
|
|
3280
|
+
edges { node { ${SCHEDULE_FIELDS} } }
|
|
3281
|
+
pageInfo { hasNextPage endCursor }
|
|
3282
|
+
} }
|
|
3283
|
+
}`.trim();
|
|
3284
|
+
var UPDATE_SESSION_SCHEDULE = `
|
|
3285
|
+
mutation ToolkitUpdateSessionSchedule($input: UpdateSessionScheduleInput!) {
|
|
3286
|
+
updateSessionSchedule(input: $input) {
|
|
3274
3287
|
schedule { ${SCHEDULE_FIELDS} }
|
|
3275
3288
|
deleted
|
|
3276
3289
|
}
|
|
@@ -3281,6 +3294,7 @@ query ToolkitAgentChannel {
|
|
|
3281
3294
|
}`.trim();
|
|
3282
3295
|
var SCHEDULE_NAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
3283
3296
|
var RFC3339 = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|[+-](\d{2}):(\d{2}))$/i;
|
|
3297
|
+
var RFC3339_FRACTIONAL = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d{1,9})?(Z|[+-](\d{2}):(\d{2}))$/i;
|
|
3284
3298
|
var ISO_DURATION = /^P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;
|
|
3285
3299
|
var GRAPHQL_STATUS_BY_CODE = {
|
|
3286
3300
|
INVALID_ARGUMENT: 400,
|
|
@@ -3304,16 +3318,17 @@ var SchedulesResource = class {
|
|
|
3304
3318
|
client;
|
|
3305
3319
|
async list(params) {
|
|
3306
3320
|
this.client._requireAuth();
|
|
3307
|
-
const
|
|
3321
|
+
const target = targetInput(params);
|
|
3322
|
+
const inbox = "inboxPath" in target;
|
|
3308
3323
|
const schedules = [];
|
|
3309
3324
|
let after = null;
|
|
3310
3325
|
const seenCursors = /* @__PURE__ */ new Set();
|
|
3311
3326
|
for (; ; ) {
|
|
3312
3327
|
const data = await this.graphql(
|
|
3313
|
-
LIST_SCHEDULES,
|
|
3314
|
-
{
|
|
3328
|
+
inbox ? LIST_SESSION_SCHEDULES : LIST_SCHEDULES,
|
|
3329
|
+
{ ...target, after }
|
|
3315
3330
|
);
|
|
3316
|
-
const connection2 = data.viewer?.channel?.schedules;
|
|
3331
|
+
const connection2 = inbox ? data.viewer?.sessionSchedules : data.viewer?.channel?.schedules;
|
|
3317
3332
|
if (!connection2?.edges) throw scheduleNotFound();
|
|
3318
3333
|
for (const edge of connection2.edges) {
|
|
3319
3334
|
if (!edge?.node) throw scheduleEmptyResponse();
|
|
@@ -3329,15 +3344,14 @@ var SchedulesResource = class {
|
|
|
3329
3344
|
async put(params) {
|
|
3330
3345
|
this.client._requireAuth();
|
|
3331
3346
|
const input = {
|
|
3332
|
-
|
|
3347
|
+
...targetInput(params),
|
|
3333
3348
|
name: requireName(params.name),
|
|
3334
3349
|
definition: {
|
|
3335
3350
|
...ruleInput(params.rule, params.bounds),
|
|
3336
3351
|
message: { text: requireText(params.text) }
|
|
3337
3352
|
}
|
|
3338
3353
|
};
|
|
3339
|
-
const
|
|
3340
|
-
const schedule = data.updateChannelSchedule?.schedule;
|
|
3354
|
+
const schedule = (await this.update(input))?.schedule;
|
|
3341
3355
|
if (!schedule) throw scheduleEmptyResponse();
|
|
3342
3356
|
return fromWireSchedule(schedule);
|
|
3343
3357
|
}
|
|
@@ -3349,11 +3363,11 @@ var SchedulesResource = class {
|
|
|
3349
3363
|
}
|
|
3350
3364
|
async delete(params) {
|
|
3351
3365
|
this.client._requireAuth();
|
|
3352
|
-
const
|
|
3353
|
-
|
|
3366
|
+
const result = await this.update({
|
|
3367
|
+
...managementInput(params),
|
|
3368
|
+
lifecycle: "REMOVED"
|
|
3354
3369
|
});
|
|
3355
|
-
if (
|
|
3356
|
-
throw scheduleEmptyResponse();
|
|
3370
|
+
if (result?.deleted !== true) throw scheduleEmptyResponse();
|
|
3357
3371
|
}
|
|
3358
3372
|
/** Resolve the authenticated viewer's unique Agent Channel for CLI defaults. */
|
|
3359
3373
|
async agentChannelId() {
|
|
@@ -3367,13 +3381,15 @@ var SchedulesResource = class {
|
|
|
3367
3381
|
}
|
|
3368
3382
|
async manage(lifecycle, params) {
|
|
3369
3383
|
this.client._requireAuth();
|
|
3370
|
-
const
|
|
3371
|
-
input: { ...managementInput(params), lifecycle }
|
|
3372
|
-
});
|
|
3373
|
-
const schedule = data.updateChannelSchedule?.schedule;
|
|
3384
|
+
const schedule = (await this.update({ ...managementInput(params), lifecycle }))?.schedule;
|
|
3374
3385
|
if (!schedule) throw scheduleEmptyResponse();
|
|
3375
3386
|
return fromWireSchedule(schedule);
|
|
3376
3387
|
}
|
|
3388
|
+
async update(input) {
|
|
3389
|
+
const inbox = "inboxPath" in input;
|
|
3390
|
+
const data = await this.graphql(inbox ? UPDATE_SESSION_SCHEDULE : UPDATE_SCHEDULE, { input });
|
|
3391
|
+
return inbox ? data.updateSessionSchedule : data.updateChannelSchedule;
|
|
3392
|
+
}
|
|
3377
3393
|
async graphql(query, variables) {
|
|
3378
3394
|
const response = await this.client._request("POST", "/query", {
|
|
3379
3395
|
body: variables === void 0 ? { query } : { query, variables }
|
|
@@ -3524,10 +3540,24 @@ function fromWireRule(rule) {
|
|
|
3524
3540
|
}
|
|
3525
3541
|
function managementInput(params) {
|
|
3526
3542
|
return {
|
|
3527
|
-
|
|
3543
|
+
...targetInput(params),
|
|
3528
3544
|
name: requireName(params.name)
|
|
3529
3545
|
};
|
|
3530
3546
|
}
|
|
3547
|
+
function targetInput(target) {
|
|
3548
|
+
if (target.channelId !== void 0 === (target.inboxPath !== void 0))
|
|
3549
|
+
throw invalid("exactly one of channelId or inboxPath is required");
|
|
3550
|
+
if (target.channelId !== void 0)
|
|
3551
|
+
return { channelId: channelID(target.channelId) };
|
|
3552
|
+
const path = target.inboxPath;
|
|
3553
|
+
const size = typeof path === "string" ? utf8Size(path) : void 0;
|
|
3554
|
+
if (typeof path !== "string" || size === void 0 || size > 2048 || !path.startsWith("/") || path.includes("\0") || path.slice(1).split("/").some((segment) => segment === "" || segment === "." || segment === ".."))
|
|
3555
|
+
throw invalid("inboxPath must be a canonical absolute ALFS Inbox path");
|
|
3556
|
+
const transcript = path.endsWith(".inbox.jsonl") ? path.slice(0, -".inbox.jsonl".length) + ".jsonl" : path.endsWith(".inbox") && !path.endsWith(".jsonl.inbox") ? path.slice(0, -".inbox".length) : void 0;
|
|
3557
|
+
if (transcript === void 0 || /\.inbox(?:\.jsonl)?$/.test(transcript) || /\.lock(?:\.recovery|\.heartbeat-[^/]+|\.stale-[^/]+)?$/.test(transcript) || transcript.endsWith("/.jsonl"))
|
|
3558
|
+
throw invalid("inboxPath must identify a standard Session Inbox sidecar");
|
|
3559
|
+
return { inboxPath: path };
|
|
3560
|
+
}
|
|
3531
3561
|
function channelID(value) {
|
|
3532
3562
|
if (typeof value === "number" && (!Number.isSafeInteger(value) || value <= 0)) {
|
|
3533
3563
|
throw invalid(
|
|
@@ -3572,8 +3602,8 @@ function durationMilliseconds(value, minimumSeconds) {
|
|
|
3572
3602
|
if (!Number.isSafeInteger(result)) throw invalid("duration is out of range");
|
|
3573
3603
|
return result;
|
|
3574
3604
|
}
|
|
3575
|
-
function timestampMilliseconds(value) {
|
|
3576
|
-
const match = RFC3339.exec(value);
|
|
3605
|
+
function timestampMilliseconds(value, fractional = false) {
|
|
3606
|
+
const match = (fractional ? RFC3339_FRACTIONAL : RFC3339).exec(value);
|
|
3577
3607
|
if (!match) throw invalid("timestamp must be RFC3339 with a timezone");
|
|
3578
3608
|
const [year, month, day, hour, minute, second] = match.slice(1, 7).map(Number);
|
|
3579
3609
|
const offsetHour = Number(match[8] ?? 0);
|
|
@@ -3616,6 +3646,243 @@ function scheduleEmptyResponse() {
|
|
|
3616
3646
|
);
|
|
3617
3647
|
}
|
|
3618
3648
|
|
|
3649
|
+
// src/resources/steward.ts
|
|
3650
|
+
var GRAPHQL_STATUS_BY_CODE2 = {
|
|
3651
|
+
INVALID_ARGUMENT: 400,
|
|
3652
|
+
UNAUTHENTICATED: 401,
|
|
3653
|
+
PERMISSION_DENIED: 403,
|
|
3654
|
+
NOT_FOUND: 404,
|
|
3655
|
+
ALREADY_EXISTS: 409,
|
|
3656
|
+
ABORTED: 409,
|
|
3657
|
+
FAILED_PRECONDITION: 412,
|
|
3658
|
+
RESOURCE_EXHAUSTED: 429,
|
|
3659
|
+
INTERNAL: 500,
|
|
3660
|
+
UNKNOWN: 500,
|
|
3661
|
+
DATA_LOSS: 500,
|
|
3662
|
+
UNAVAILABLE: 503,
|
|
3663
|
+
DEADLINE_EXCEEDED: 504
|
|
3664
|
+
};
|
|
3665
|
+
var DECIDE = `
|
|
3666
|
+
mutation ToolkitStewardDecide($input: UpdateStewardDeliveryInput!) {
|
|
3667
|
+
updateStewardDelivery(input: $input) { delivery { deliveryId state } }
|
|
3668
|
+
}`.trim();
|
|
3669
|
+
var FORWARD = `
|
|
3670
|
+
mutation ToolkitStewardForward($input: UpdateStewardDeliveryInput!) {
|
|
3671
|
+
updateStewardDelivery(input: $input) { delivery { deliveryId state channelMessageId } }
|
|
3672
|
+
}`.trim();
|
|
3673
|
+
var SEND = `
|
|
3674
|
+
mutation ToolkitStewardSend($input: PostStewardMessageInput!) {
|
|
3675
|
+
postStewardMessage(input: $input) { message { channelMessageId requestId } }
|
|
3676
|
+
}`.trim();
|
|
3677
|
+
var PENDING = `
|
|
3678
|
+
query ToolkitStewardPending($inboxPath: String!, $input: StewardDigestPendingInput) {
|
|
3679
|
+
viewer {
|
|
3680
|
+
stewardDigestPending(inboxPath: $inboxPath, input: $input) {
|
|
3681
|
+
edges {
|
|
3682
|
+
cursor
|
|
3683
|
+
node { deliveryId feedEntryId source { kind id } decisionReason consumedAtMs }
|
|
3684
|
+
}
|
|
3685
|
+
pageInfo { hasNextPage endCursor }
|
|
3686
|
+
windowSinceMs
|
|
3687
|
+
windowUntilMs
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
}`.trim();
|
|
3691
|
+
var BRIEFED = `
|
|
3692
|
+
mutation ToolkitStewardBriefed($input: CompleteStewardBriefInput!) {
|
|
3693
|
+
completeStewardBrief(input: $input) { ok }
|
|
3694
|
+
}`.trim();
|
|
3695
|
+
var DECISIONS = /* @__PURE__ */ new Set([
|
|
3696
|
+
"immediate",
|
|
3697
|
+
"digest",
|
|
3698
|
+
"suppress"
|
|
3699
|
+
]);
|
|
3700
|
+
var DELIVERY_ID = /^[1-9][0-9]{0,18}$/;
|
|
3701
|
+
function invalid2(message) {
|
|
3702
|
+
return new AlvaError("INVALID_ARGUMENT", message, 400);
|
|
3703
|
+
}
|
|
3704
|
+
function requireInboxPath(target) {
|
|
3705
|
+
if (!target || typeof target.inboxPath !== "string" || target.inboxPath === "")
|
|
3706
|
+
throw invalid2("steward commands require the steward Session Inbox path");
|
|
3707
|
+
return target.inboxPath;
|
|
3708
|
+
}
|
|
3709
|
+
function requireDeliveryId(value, label = "delivery id") {
|
|
3710
|
+
if (!DELIVERY_ID.test(value))
|
|
3711
|
+
throw invalid2(`${label} must be a positive integer`);
|
|
3712
|
+
return value;
|
|
3713
|
+
}
|
|
3714
|
+
function requireDeliveryIds(values) {
|
|
3715
|
+
if (values.length === 0)
|
|
3716
|
+
throw invalid2("at least one delivery id is required");
|
|
3717
|
+
const unique = /* @__PURE__ */ new Set();
|
|
3718
|
+
for (const value of values) {
|
|
3719
|
+
requireDeliveryId(value);
|
|
3720
|
+
if (unique.has(value)) throw invalid2(`duplicate delivery id ${value}`);
|
|
3721
|
+
unique.add(value);
|
|
3722
|
+
}
|
|
3723
|
+
return [...unique];
|
|
3724
|
+
}
|
|
3725
|
+
function requireDecision(value) {
|
|
3726
|
+
if (!DECISIONS.has(value))
|
|
3727
|
+
throw invalid2("decision must be one of immediate, digest, suppress");
|
|
3728
|
+
return value;
|
|
3729
|
+
}
|
|
3730
|
+
function generateRequestId() {
|
|
3731
|
+
const webcrypto = globalThis.crypto;
|
|
3732
|
+
if (typeof webcrypto?.randomUUID === "function")
|
|
3733
|
+
return webcrypto.randomUUID();
|
|
3734
|
+
const bytes = new Uint8Array(16);
|
|
3735
|
+
if (typeof webcrypto?.getRandomValues === "function") {
|
|
3736
|
+
webcrypto.getRandomValues(bytes);
|
|
3737
|
+
} else {
|
|
3738
|
+
for (let i = 0; i < bytes.length; i += 1)
|
|
3739
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
3740
|
+
}
|
|
3741
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
3742
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
3743
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join(
|
|
3744
|
+
""
|
|
3745
|
+
);
|
|
3746
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
3747
|
+
}
|
|
3748
|
+
function requireRequestId(value) {
|
|
3749
|
+
if (value === void 0) return generateRequestId();
|
|
3750
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
|
3751
|
+
value
|
|
3752
|
+
))
|
|
3753
|
+
throw invalid2("request id must be a UUID");
|
|
3754
|
+
return value;
|
|
3755
|
+
}
|
|
3756
|
+
function emptyResponse() {
|
|
3757
|
+
return new AlvaError("EMPTY_RESPONSE", "steward response was empty", 502);
|
|
3758
|
+
}
|
|
3759
|
+
var StewardResource = class {
|
|
3760
|
+
constructor(client) {
|
|
3761
|
+
this.client = client;
|
|
3762
|
+
}
|
|
3763
|
+
client;
|
|
3764
|
+
async decide(params) {
|
|
3765
|
+
this.client._requireAuth();
|
|
3766
|
+
const reason = params.reason?.trim();
|
|
3767
|
+
if (!reason) throw invalid2("a decision reason is required");
|
|
3768
|
+
const data = await this.graphql(DECIDE, {
|
|
3769
|
+
input: {
|
|
3770
|
+
inboxPath: requireInboxPath(params),
|
|
3771
|
+
deliveryId: requireDeliveryId(params.deliveryId),
|
|
3772
|
+
decision: {
|
|
3773
|
+
decision: requireDecision(params.decision).toUpperCase(),
|
|
3774
|
+
reason
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
});
|
|
3778
|
+
const delivery = data.updateStewardDelivery?.delivery;
|
|
3779
|
+
if (!delivery) throw emptyResponse();
|
|
3780
|
+
return { state: delivery.state };
|
|
3781
|
+
}
|
|
3782
|
+
async forward(params) {
|
|
3783
|
+
this.client._requireAuth();
|
|
3784
|
+
const data = await this.graphql(FORWARD, {
|
|
3785
|
+
input: {
|
|
3786
|
+
inboxPath: requireInboxPath(params),
|
|
3787
|
+
deliveryId: requireDeliveryId(params.deliveryId),
|
|
3788
|
+
forward: { requestId: requireRequestId(params.requestId) }
|
|
3789
|
+
}
|
|
3790
|
+
});
|
|
3791
|
+
const delivery = data.updateStewardDelivery?.delivery;
|
|
3792
|
+
if (!delivery || !delivery.channelMessageId) throw emptyResponse();
|
|
3793
|
+
return {
|
|
3794
|
+
channelMessageId: delivery.channelMessageId,
|
|
3795
|
+
state: delivery.state
|
|
3796
|
+
};
|
|
3797
|
+
}
|
|
3798
|
+
async send(params) {
|
|
3799
|
+
this.client._requireAuth();
|
|
3800
|
+
if (typeof params.body !== "string" || params.body.trim() === "")
|
|
3801
|
+
throw invalid2("a message body is required");
|
|
3802
|
+
const data = await this.graphql(SEND, {
|
|
3803
|
+
input: {
|
|
3804
|
+
inboxPath: requireInboxPath(params),
|
|
3805
|
+
requestId: requireRequestId(params.requestId),
|
|
3806
|
+
body: params.body,
|
|
3807
|
+
deliveryIds: requireDeliveryIds(params.deliveryIds)
|
|
3808
|
+
}
|
|
3809
|
+
});
|
|
3810
|
+
const message = data.postStewardMessage?.message;
|
|
3811
|
+
if (!message) throw emptyResponse();
|
|
3812
|
+
return message;
|
|
3813
|
+
}
|
|
3814
|
+
async pending(params) {
|
|
3815
|
+
this.client._requireAuth();
|
|
3816
|
+
const first = params.first ?? 50;
|
|
3817
|
+
if (!Number.isInteger(first) || first < 1 || first > 100)
|
|
3818
|
+
throw invalid2("first must be an integer between 1 and 100");
|
|
3819
|
+
const input = { first };
|
|
3820
|
+
if (params.after !== void 0 && params.after !== "") {
|
|
3821
|
+
input.after = params.after;
|
|
3822
|
+
} else {
|
|
3823
|
+
for (const [label, value] of [
|
|
3824
|
+
["sinceMs", params.sinceMs],
|
|
3825
|
+
["untilMs", params.untilMs]
|
|
3826
|
+
]) {
|
|
3827
|
+
if (value !== void 0 && (!Number.isSafeInteger(value) || value <= 0))
|
|
3828
|
+
throw invalid2(`${label} must be a positive safe integer timestamp`);
|
|
3829
|
+
}
|
|
3830
|
+
if (params.sinceMs !== void 0 && params.untilMs !== void 0 && params.untilMs <= params.sinceMs)
|
|
3831
|
+
throw invalid2("untilMs must be after sinceMs");
|
|
3832
|
+
if (params.sinceMs !== void 0) input.sinceMs = params.sinceMs;
|
|
3833
|
+
if (params.untilMs !== void 0) input.untilMs = params.untilMs;
|
|
3834
|
+
}
|
|
3835
|
+
const data = await this.graphql(PENDING, { inboxPath: requireInboxPath(params), input });
|
|
3836
|
+
const page = data.viewer?.stewardDigestPending;
|
|
3837
|
+
if (!page || !Array.isArray(page.edges)) throw emptyResponse();
|
|
3838
|
+
const windowSinceMs = page.windowSinceMs ?? 0;
|
|
3839
|
+
const windowUntilMs = page.windowUntilMs ?? 0;
|
|
3840
|
+
if (!Number.isSafeInteger(windowSinceMs) || !Number.isSafeInteger(windowUntilMs) || windowSinceMs <= 0 || windowUntilMs <= windowSinceMs)
|
|
3841
|
+
throw emptyResponse();
|
|
3842
|
+
const items = page.edges.map((edge) => edge.node);
|
|
3843
|
+
const nextCursor = page.pageInfo?.hasNextPage === true && page.pageInfo.endCursor ? page.pageInfo.endCursor : null;
|
|
3844
|
+
return {
|
|
3845
|
+
items,
|
|
3846
|
+
nextCursor,
|
|
3847
|
+
windowSinceMs,
|
|
3848
|
+
windowUntilMs
|
|
3849
|
+
};
|
|
3850
|
+
}
|
|
3851
|
+
async briefed(params) {
|
|
3852
|
+
this.client._requireAuth();
|
|
3853
|
+
const digestRunId = params.digestRunId?.trim();
|
|
3854
|
+
if (!digestRunId) throw invalid2("a digest run id is required");
|
|
3855
|
+
const data = await this.graphql(BRIEFED, {
|
|
3856
|
+
input: {
|
|
3857
|
+
inboxPath: requireInboxPath(params),
|
|
3858
|
+
deliveryIds: requireDeliveryIds(params.deliveryIds),
|
|
3859
|
+
digestRunId
|
|
3860
|
+
}
|
|
3861
|
+
});
|
|
3862
|
+
if (data.completeStewardBrief?.ok !== true) throw emptyResponse();
|
|
3863
|
+
return { ok: true };
|
|
3864
|
+
}
|
|
3865
|
+
async graphql(query, variables) {
|
|
3866
|
+
const response = await this.client._request("POST", "/query", {
|
|
3867
|
+
body: { query, variables }
|
|
3868
|
+
});
|
|
3869
|
+
if (!response || typeof response !== "object") throw emptyResponse();
|
|
3870
|
+
if (response.errors?.length) {
|
|
3871
|
+
const codes = response.errors.map((error) => error.extensions?.code);
|
|
3872
|
+
const canonicalCode = new Set(codes).size === 1 && typeof codes[0] === "string" ? codes[0] : void 0;
|
|
3873
|
+
const canonicalStatus = canonicalCode ? GRAPHQL_STATUS_BY_CODE2[canonicalCode] : void 0;
|
|
3874
|
+
throw new AlvaError(
|
|
3875
|
+
canonicalCode !== void 0 && canonicalStatus !== void 0 ? canonicalCode : "GRAPHQL_ERROR",
|
|
3876
|
+
response.errors.map((error) => error.message).filter((message) => typeof message === "string").join("; ") || "GraphQL request failed",
|
|
3877
|
+
canonicalStatus ?? 502,
|
|
3878
|
+
{ errors: response.errors }
|
|
3879
|
+
);
|
|
3880
|
+
}
|
|
3881
|
+
if (!response.data) throw emptyResponse();
|
|
3882
|
+
return response.data;
|
|
3883
|
+
}
|
|
3884
|
+
};
|
|
3885
|
+
|
|
3619
3886
|
// src/resources/tradingPairs.ts
|
|
3620
3887
|
function isRecord(value) {
|
|
3621
3888
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -3801,14 +4068,357 @@ var TradingPairsResource = class {
|
|
|
3801
4068
|
}
|
|
3802
4069
|
};
|
|
3803
4070
|
|
|
4071
|
+
// src/resources/theses.ts
|
|
4072
|
+
var MAX_SIGNED_INT64 = 9223372036854775807n;
|
|
4073
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4074
|
+
var UNPAIRED_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
|
|
4075
|
+
var encoder = new TextEncoder();
|
|
4076
|
+
var ThesesResource = class {
|
|
4077
|
+
constructor(client) {
|
|
4078
|
+
this.client = client;
|
|
4079
|
+
}
|
|
4080
|
+
client;
|
|
4081
|
+
async create(params) {
|
|
4082
|
+
this.client._requireAuth();
|
|
4083
|
+
const body = createBody(params);
|
|
4084
|
+
return thesisResponse(
|
|
4085
|
+
await this.client._request("POST", "/api/v1/theses", { body })
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
4088
|
+
async get(id) {
|
|
4089
|
+
this.client._requireAuth();
|
|
4090
|
+
return thesisGetResponse(
|
|
4091
|
+
await this.client._request("GET", `/api/v1/theses/${requireID(id, "id")}`)
|
|
4092
|
+
);
|
|
4093
|
+
}
|
|
4094
|
+
async update(id, params) {
|
|
4095
|
+
this.client._requireAuth();
|
|
4096
|
+
const body = updateBody(params);
|
|
4097
|
+
return thesisResponse(
|
|
4098
|
+
await this.client._request(
|
|
4099
|
+
"PUT",
|
|
4100
|
+
`/api/v1/theses/${requireID(id, "id")}`,
|
|
4101
|
+
{
|
|
4102
|
+
body
|
|
4103
|
+
}
|
|
4104
|
+
)
|
|
4105
|
+
);
|
|
4106
|
+
}
|
|
4107
|
+
async setVisibility(id, params) {
|
|
4108
|
+
this.client._requireAuth();
|
|
4109
|
+
if (!params) {
|
|
4110
|
+
throw invalidArgument("params is required");
|
|
4111
|
+
}
|
|
4112
|
+
const thesisID = requireID(id, "id");
|
|
4113
|
+
const visibility = requireVisibility(params.visibility);
|
|
4114
|
+
const response = thesisResponse(
|
|
4115
|
+
await this.client._request(
|
|
4116
|
+
"POST",
|
|
4117
|
+
`/api/v1/theses/${thesisID}/visibility`,
|
|
4118
|
+
{ body: { visibility } }
|
|
4119
|
+
)
|
|
4120
|
+
);
|
|
4121
|
+
if (response.thesis.id !== thesisID || response.thesis.visibility !== visibility) {
|
|
4122
|
+
throw invalidResponse2(
|
|
4123
|
+
"visibility response must match the requested thesis and visibility"
|
|
4124
|
+
);
|
|
4125
|
+
}
|
|
4126
|
+
return response;
|
|
4127
|
+
}
|
|
4128
|
+
async close(id, params) {
|
|
4129
|
+
this.client._requireAuth();
|
|
4130
|
+
const body = {
|
|
4131
|
+
expected_author_version_id: requireID(
|
|
4132
|
+
params.expected_author_version_id,
|
|
4133
|
+
"expected_author_version_id"
|
|
4134
|
+
)
|
|
4135
|
+
};
|
|
4136
|
+
if (params.note !== void 0) body.note = requireText2(params.note, "note");
|
|
4137
|
+
return thesisResponse(
|
|
4138
|
+
await this.client._request(
|
|
4139
|
+
"POST",
|
|
4140
|
+
`/api/v1/theses/${requireID(id, "id")}/close`,
|
|
4141
|
+
{ body }
|
|
4142
|
+
)
|
|
4143
|
+
);
|
|
4144
|
+
}
|
|
4145
|
+
async delete(id) {
|
|
4146
|
+
this.client._requireAuth();
|
|
4147
|
+
const response = await this.client._request(
|
|
4148
|
+
"DELETE",
|
|
4149
|
+
`/api/v1/theses/${requireID(id, "id")}`
|
|
4150
|
+
);
|
|
4151
|
+
if (response === void 0) return {};
|
|
4152
|
+
if (!isRecord2(response) || Object.keys(response).length !== 0) {
|
|
4153
|
+
throw invalidResponse2("delete response must be {}");
|
|
4154
|
+
}
|
|
4155
|
+
return {};
|
|
4156
|
+
}
|
|
4157
|
+
async rewrite(params) {
|
|
4158
|
+
this.client._requireAuth();
|
|
4159
|
+
const body = requireBody(params.body);
|
|
4160
|
+
const mode = params.mode === void 0 ? "reformat" : requireRewriteMode(params.mode);
|
|
4161
|
+
const response = await this.client._request(
|
|
4162
|
+
"POST",
|
|
4163
|
+
"/api/v1/theses/rewrite",
|
|
4164
|
+
{
|
|
4165
|
+
body: { body, mode }
|
|
4166
|
+
}
|
|
4167
|
+
);
|
|
4168
|
+
if (!isRecord2(response) || typeof response.body !== "string") {
|
|
4169
|
+
throw invalidResponse2("rewrite response must contain a string body");
|
|
4170
|
+
}
|
|
4171
|
+
return { body: responseBody(response.body) };
|
|
4172
|
+
}
|
|
4173
|
+
};
|
|
4174
|
+
function createBody(params) {
|
|
4175
|
+
const body = {
|
|
4176
|
+
request_id: requireRequestID(params.request_id),
|
|
4177
|
+
body: requireBody(params.body),
|
|
4178
|
+
title: requireTitle(params.title ?? ""),
|
|
4179
|
+
entity_ids: requireIDs(params.entity_ids ?? [], "entity_ids"),
|
|
4180
|
+
visibility: requireVisibility(params.visibility ?? "public")
|
|
4181
|
+
};
|
|
4182
|
+
if (params.tickers !== void 0)
|
|
4183
|
+
body.tickers = requireTickers(params.tickers);
|
|
4184
|
+
return body;
|
|
4185
|
+
}
|
|
4186
|
+
function updateBody(params) {
|
|
4187
|
+
return {
|
|
4188
|
+
request_id: requireRequestID(params.request_id),
|
|
4189
|
+
expected_author_version_id: requireID(
|
|
4190
|
+
params.expected_author_version_id,
|
|
4191
|
+
"expected_author_version_id"
|
|
4192
|
+
),
|
|
4193
|
+
body: requireBody(params.body),
|
|
4194
|
+
title: requireTitle(params.title ?? ""),
|
|
4195
|
+
entity_ids: requireIDs(params.entity_ids ?? [], "entity_ids"),
|
|
4196
|
+
visibility: requireVisibility(params.visibility),
|
|
4197
|
+
editorial: params.editorial ?? false
|
|
4198
|
+
};
|
|
4199
|
+
}
|
|
4200
|
+
function thesisResponse(response) {
|
|
4201
|
+
if (!isRecord2(response) || !isRecord2(response.thesis)) {
|
|
4202
|
+
throw invalidResponse2("response must contain thesis");
|
|
4203
|
+
}
|
|
4204
|
+
const thesis = response.thesis;
|
|
4205
|
+
const value = {
|
|
4206
|
+
id: responseID(thesis.id, "thesis.id"),
|
|
4207
|
+
author_version_id: responseID(
|
|
4208
|
+
thesis.author_version_id,
|
|
4209
|
+
"thesis.author_version_id"
|
|
4210
|
+
),
|
|
4211
|
+
material_version_id: responseID(
|
|
4212
|
+
thesis.material_version_id,
|
|
4213
|
+
"thesis.material_version_id"
|
|
4214
|
+
),
|
|
4215
|
+
title: responseTitle(thesis.title),
|
|
4216
|
+
body: responseBody(thesis.body),
|
|
4217
|
+
entity_ids: responseIDs(thesis.entity_ids, "thesis.entity_ids"),
|
|
4218
|
+
visibility: responseVisibility(thesis.visibility),
|
|
4219
|
+
closed: responseBoolean(thesis.closed, "thesis.closed"),
|
|
4220
|
+
closing_note: responseClosingNote(thesis.closing_note),
|
|
4221
|
+
author_kind: responseText(thesis.author_kind, "thesis.author_kind"),
|
|
4222
|
+
author_ref: responseText(thesis.author_ref, "thesis.author_ref")
|
|
4223
|
+
};
|
|
4224
|
+
return { thesis: value };
|
|
4225
|
+
}
|
|
4226
|
+
function thesisGetResponse(response) {
|
|
4227
|
+
const base = thesisResponse(response);
|
|
4228
|
+
if (!isRecord2(response) || !isRecord2(response.author)) {
|
|
4229
|
+
throw invalidResponse2("response must contain author");
|
|
4230
|
+
}
|
|
4231
|
+
const authorRecord = response.author;
|
|
4232
|
+
const author = {
|
|
4233
|
+
id: responseID(authorRecord.id, "author.id"),
|
|
4234
|
+
kind: responseText(authorRecord.kind, "author.kind"),
|
|
4235
|
+
display_name: responseText(
|
|
4236
|
+
authorRecord.display_name,
|
|
4237
|
+
"author.display_name"
|
|
4238
|
+
),
|
|
4239
|
+
avatar_url: responseText(authorRecord.avatar_url, "author.avatar_url"),
|
|
4240
|
+
username: responseText(authorRecord.username, "author.username")
|
|
4241
|
+
};
|
|
4242
|
+
if (!Array.isArray(response.entities)) {
|
|
4243
|
+
throw invalidResponse2("response must contain entities");
|
|
4244
|
+
}
|
|
4245
|
+
if (response.entities.length !== base.thesis.entity_ids.length) {
|
|
4246
|
+
throw invalidResponse2("entities must match thesis.entity_ids");
|
|
4247
|
+
}
|
|
4248
|
+
const entities = response.entities.map((item, index) => {
|
|
4249
|
+
if (!isRecord2(item))
|
|
4250
|
+
throw invalidResponse2(`entities[${index}] must be an object`);
|
|
4251
|
+
const entity = {
|
|
4252
|
+
id: responseID(item.id, `entities[${index}].id`),
|
|
4253
|
+
ticker: responseText(item.ticker, `entities[${index}].ticker`),
|
|
4254
|
+
name: responseText(item.name, `entities[${index}].name`),
|
|
4255
|
+
icon_url: responseText(item.icon_url, `entities[${index}].icon_url`),
|
|
4256
|
+
kind: responseText(item.kind, `entities[${index}].kind`)
|
|
4257
|
+
};
|
|
4258
|
+
if (entity.id !== base.thesis.entity_ids[index]) {
|
|
4259
|
+
throw invalidResponse2("entities must preserve thesis.entity_ids order");
|
|
4260
|
+
}
|
|
4261
|
+
return entity;
|
|
4262
|
+
});
|
|
4263
|
+
return { thesis: base.thesis, author, entities };
|
|
4264
|
+
}
|
|
4265
|
+
function requireRequestID(value) {
|
|
4266
|
+
if (!UUID.test(value) || /^0{8}-0{4}-0{4}-0{4}-0{12}$/i.test(value)) {
|
|
4267
|
+
throw invalidArgument("request_id must be a non-zero RFC 4122 UUID");
|
|
4268
|
+
}
|
|
4269
|
+
return value;
|
|
4270
|
+
}
|
|
4271
|
+
function requireID(value, field) {
|
|
4272
|
+
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value)) {
|
|
4273
|
+
throw invalidArgument(`${field} must be a positive int64 decimal string`);
|
|
4274
|
+
}
|
|
4275
|
+
const parsed = BigInt(value);
|
|
4276
|
+
if (parsed > MAX_SIGNED_INT64) {
|
|
4277
|
+
throw invalidArgument(`${field} must be a positive int64 decimal string`);
|
|
4278
|
+
}
|
|
4279
|
+
return value;
|
|
4280
|
+
}
|
|
4281
|
+
function requireIDs(value, field) {
|
|
4282
|
+
if (!Array.isArray(value)) throw invalidArgument(`${field} must be an array`);
|
|
4283
|
+
if (value.length > 20) {
|
|
4284
|
+
throw invalidArgument(`${field} must contain at most 20 IDs`);
|
|
4285
|
+
}
|
|
4286
|
+
return value.map((item, index) => requireID(item, `${field}[${index}]`));
|
|
4287
|
+
}
|
|
4288
|
+
function requireTickers(value) {
|
|
4289
|
+
if (!Array.isArray(value)) throw invalidArgument("tickers must be an array");
|
|
4290
|
+
if (value.length > 100) {
|
|
4291
|
+
throw invalidArgument("tickers must contain at most 100 values");
|
|
4292
|
+
}
|
|
4293
|
+
return value.map((item, index) => {
|
|
4294
|
+
const ticker = requireText2(item, `tickers[${index}]`);
|
|
4295
|
+
if (ticker.trim() === "" || ticker.includes("\0")) {
|
|
4296
|
+
throw invalidArgument(`tickers[${index}] must be non-empty`);
|
|
4297
|
+
}
|
|
4298
|
+
return ticker;
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4301
|
+
function requireBody(value) {
|
|
4302
|
+
const body = requireText2(value, "body");
|
|
4303
|
+
if (body.trim().length === 0) throw invalidArgument("body must not be blank");
|
|
4304
|
+
if (encoder.encode(body).byteLength > 65536) {
|
|
4305
|
+
throw invalidArgument("body must be at most 65536 UTF-8 bytes");
|
|
4306
|
+
}
|
|
4307
|
+
return body;
|
|
4308
|
+
}
|
|
4309
|
+
function requireTitle(value) {
|
|
4310
|
+
const title = requireText2(value, "title");
|
|
4311
|
+
if (encoder.encode(title).byteLength > 500) {
|
|
4312
|
+
throw invalidArgument("title must be at most 500 UTF-8 bytes");
|
|
4313
|
+
}
|
|
4314
|
+
return title;
|
|
4315
|
+
}
|
|
4316
|
+
function requireVisibility(value) {
|
|
4317
|
+
const visibility = requireText2(value, "visibility");
|
|
4318
|
+
if (visibility !== "public" && visibility !== "private") {
|
|
4319
|
+
throw invalidArgument("visibility must be public or private");
|
|
4320
|
+
}
|
|
4321
|
+
return visibility;
|
|
4322
|
+
}
|
|
4323
|
+
function requireRewriteMode(value) {
|
|
4324
|
+
const mode = requireText2(value, "mode");
|
|
4325
|
+
if (mode === "reformat" || mode === "shorten" || mode === "enrich") {
|
|
4326
|
+
return mode;
|
|
4327
|
+
}
|
|
4328
|
+
throw invalidArgument("mode must be reformat, shorten, or enrich");
|
|
4329
|
+
}
|
|
4330
|
+
function requireText2(value, field) {
|
|
4331
|
+
if (typeof value !== "string")
|
|
4332
|
+
throw invalidArgument(`${field} must be a string`);
|
|
4333
|
+
if (UNPAIRED_SURROGATE.test(value)) {
|
|
4334
|
+
throw invalidArgument(`${field} contains invalid Unicode`);
|
|
4335
|
+
}
|
|
4336
|
+
if ((field === "body" || field === "title" || field === "note") && value.includes("\0")) {
|
|
4337
|
+
throw invalidArgument(`${field} must not contain NUL`);
|
|
4338
|
+
}
|
|
4339
|
+
return value;
|
|
4340
|
+
}
|
|
4341
|
+
function responseID(value, field) {
|
|
4342
|
+
if (typeof value === "number") {
|
|
4343
|
+
throw invalidResponse2(
|
|
4344
|
+
`${field} must be a decimal string; numeric IDs are unsafe`
|
|
4345
|
+
);
|
|
4346
|
+
}
|
|
4347
|
+
try {
|
|
4348
|
+
return requireID(value, field);
|
|
4349
|
+
} catch {
|
|
4350
|
+
throw invalidResponse2(`${field} must be a positive int64 decimal string`);
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
function responseIDs(value, field) {
|
|
4354
|
+
if (!Array.isArray(value)) throw invalidResponse2(`${field} must be an array`);
|
|
4355
|
+
if (value.length > 20) {
|
|
4356
|
+
throw invalidResponse2(`${field} must contain at most 20 IDs`);
|
|
4357
|
+
}
|
|
4358
|
+
return value.map((item, index) => responseID(item, `${field}[${index}]`));
|
|
4359
|
+
}
|
|
4360
|
+
function responseText(value, field) {
|
|
4361
|
+
try {
|
|
4362
|
+
return requireText2(value, field);
|
|
4363
|
+
} catch {
|
|
4364
|
+
throw invalidResponse2(`${field} must be valid text`);
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4367
|
+
function responseClosingNote(value) {
|
|
4368
|
+
try {
|
|
4369
|
+
return requireText2(value, "note");
|
|
4370
|
+
} catch {
|
|
4371
|
+
throw invalidResponse2("thesis.closing_note must be valid text");
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
function responseBoolean(value, field) {
|
|
4375
|
+
if (typeof value !== "boolean")
|
|
4376
|
+
throw invalidResponse2(`${field} must be boolean`);
|
|
4377
|
+
return value;
|
|
4378
|
+
}
|
|
4379
|
+
function responseVisibility(value) {
|
|
4380
|
+
try {
|
|
4381
|
+
return requireVisibility(value);
|
|
4382
|
+
} catch {
|
|
4383
|
+
throw invalidResponse2("thesis.visibility must be public or private");
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
function responseBody(value) {
|
|
4387
|
+
try {
|
|
4388
|
+
return requireBody(value);
|
|
4389
|
+
} catch {
|
|
4390
|
+
throw invalidResponse2(
|
|
4391
|
+
"response body must be nonblank valid text at most 65536 UTF-8 bytes"
|
|
4392
|
+
);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
function responseTitle(value) {
|
|
4396
|
+
try {
|
|
4397
|
+
return requireTitle(value);
|
|
4398
|
+
} catch {
|
|
4399
|
+
throw invalidResponse2(
|
|
4400
|
+
"response title must be valid text at most 500 UTF-8 bytes"
|
|
4401
|
+
);
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
function isRecord2(value) {
|
|
4405
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4406
|
+
}
|
|
4407
|
+
function invalidArgument(message) {
|
|
4408
|
+
return new AlvaError("INVALID_ARGUMENT", message, 400);
|
|
4409
|
+
}
|
|
4410
|
+
function invalidResponse2(message) {
|
|
4411
|
+
return new AlvaError("INVALID_RESPONSE", message, 502);
|
|
4412
|
+
}
|
|
4413
|
+
|
|
3804
4414
|
// src/client.ts
|
|
3805
4415
|
var DEFAULT_BASE_URL = "https://api-llm.prd.alva.ai";
|
|
3806
4416
|
var DEFAULT_ARRAYS_BASE_URL = "https://data-tools.prd.space.id";
|
|
3807
|
-
function
|
|
4417
|
+
function isRecord3(value) {
|
|
3808
4418
|
return typeof value === "object" && value !== null;
|
|
3809
4419
|
}
|
|
3810
4420
|
function stringField(value, field) {
|
|
3811
|
-
if (!
|
|
4421
|
+
if (!isRecord3(value)) return void 0;
|
|
3812
4422
|
const fieldValue = value[field];
|
|
3813
4423
|
return typeof fieldValue === "string" && fieldValue ? fieldValue : void 0;
|
|
3814
4424
|
}
|
|
@@ -3822,7 +4432,7 @@ function describeCause(cause) {
|
|
|
3822
4432
|
if (cause.message) details.message = cause.message;
|
|
3823
4433
|
const code = stringField(cause, "code");
|
|
3824
4434
|
if (code) details.code = code;
|
|
3825
|
-
} else if (
|
|
4435
|
+
} else if (isRecord3(cause)) {
|
|
3826
4436
|
const code = stringField(cause, "code");
|
|
3827
4437
|
const name = stringField(cause, "name");
|
|
3828
4438
|
const message = stringField(cause, "message");
|
|
@@ -3850,7 +4460,7 @@ function describeFetchFailure(err) {
|
|
|
3850
4460
|
details.message = String(err);
|
|
3851
4461
|
}
|
|
3852
4462
|
const { message: causeMessage, details: causeDetails } = describeCause(
|
|
3853
|
-
|
|
4463
|
+
isRecord3(err) ? err.cause : void 0
|
|
3854
4464
|
);
|
|
3855
4465
|
if (causeDetails) {
|
|
3856
4466
|
details.cause = causeDetails;
|
|
@@ -3881,6 +4491,8 @@ var AlvaClient = class {
|
|
|
3881
4491
|
originSessionId;
|
|
3882
4492
|
/** Session profile kind associated with originSessionId. */
|
|
3883
4493
|
originSessionKind;
|
|
4494
|
+
/** Host-attached file Session target, distinct from the chat origin header. */
|
|
4495
|
+
originInboxPath;
|
|
3884
4496
|
_fs;
|
|
3885
4497
|
_run;
|
|
3886
4498
|
_deploy;
|
|
@@ -3911,7 +4523,9 @@ var AlvaClient = class {
|
|
|
3911
4523
|
_credits;
|
|
3912
4524
|
_markets;
|
|
3913
4525
|
_schedules;
|
|
4526
|
+
_steward;
|
|
3914
4527
|
_tradingPairs;
|
|
4528
|
+
_theses;
|
|
3915
4529
|
constructor(config) {
|
|
3916
4530
|
this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
3917
4531
|
this.arraysBaseUrl = config.arraysBaseUrl ?? DEFAULT_ARRAYS_BASE_URL;
|
|
@@ -3924,6 +4538,7 @@ var AlvaClient = class {
|
|
|
3924
4538
|
this.signal = config.signal;
|
|
3925
4539
|
this.originSessionId = config.originSessionId;
|
|
3926
4540
|
this.originSessionKind = config.originSessionKind;
|
|
4541
|
+
this.originInboxPath = config.originInboxPath;
|
|
3927
4542
|
}
|
|
3928
4543
|
get fs() {
|
|
3929
4544
|
return this._fs ??= new FsResource(this);
|
|
@@ -4015,6 +4630,12 @@ var AlvaClient = class {
|
|
|
4015
4630
|
get schedules() {
|
|
4016
4631
|
return this._schedules ??= new SchedulesResource(this);
|
|
4017
4632
|
}
|
|
4633
|
+
get steward() {
|
|
4634
|
+
return this._steward ??= new StewardResource(this);
|
|
4635
|
+
}
|
|
4636
|
+
get theses() {
|
|
4637
|
+
return this._theses ??= new ThesesResource(this);
|
|
4638
|
+
}
|
|
4018
4639
|
_requireAuth() {
|
|
4019
4640
|
if (!this.pbsvToken && !this.viewer_token && !this.apiKey) {
|
|
4020
4641
|
throw new AlvaError(
|
|
@@ -4631,7 +5252,7 @@ var installPlaybookRuntime = (targetWindow) => {
|
|
|
4631
5252
|
};
|
|
4632
5253
|
|
|
4633
5254
|
// src/index.ts
|
|
4634
|
-
var VERSION = true ? "0.28.
|
|
5255
|
+
var VERSION = true ? "0.28.1-beta.1" : "dev";
|
|
4635
5256
|
export {
|
|
4636
5257
|
AlertsResource,
|
|
4637
5258
|
AlvaClient,
|
|
@@ -4646,6 +5267,8 @@ export {
|
|
|
4646
5267
|
SUBSCRIBE_PROPOSE_MESSAGE,
|
|
4647
5268
|
SUBSCRIBE_RESULT_MESSAGE,
|
|
4648
5269
|
SchedulesResource,
|
|
5270
|
+
StewardResource,
|
|
5271
|
+
ThesesResource,
|
|
4649
5272
|
TradingPairsResource,
|
|
4650
5273
|
UDF_AUTH_REQUIRED_MESSAGE,
|
|
4651
5274
|
UDF_CONSENT_REQUEST_MESSAGE,
|