@alva-ai/toolkit 0.28.0 → 0.28.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/browser.global.js +52 -16
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +190 -8
- package/dist/cli.js +993 -44
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.d.ts +190 -8
- package/dist/dispatch.js +644 -20
- package/dist/dispatch.js.map +1 -1
- package/dist/index.cjs +613 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +189 -9
- package/dist/index.d.ts +189 -9
- package/dist/index.js +611 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,8 @@ __export(src_exports, {
|
|
|
33
33
|
SUBSCRIBE_PROPOSE_MESSAGE: () => SUBSCRIBE_PROPOSE_MESSAGE,
|
|
34
34
|
SUBSCRIBE_RESULT_MESSAGE: () => SUBSCRIBE_RESULT_MESSAGE,
|
|
35
35
|
SchedulesResource: () => SchedulesResource,
|
|
36
|
+
StewardResource: () => StewardResource,
|
|
37
|
+
ThesesResource: () => ThesesResource,
|
|
36
38
|
TradingPairsResource: () => TradingPairsResource,
|
|
37
39
|
UDF_AUTH_REQUIRED_MESSAGE: () => UDF_AUTH_REQUIRED_MESSAGE,
|
|
38
40
|
UDF_CONSENT_REQUEST_MESSAGE: () => UDF_CONSENT_REQUEST_MESSAGE,
|
|
@@ -3309,7 +3311,6 @@ var MarketsResource = class {
|
|
|
3309
3311
|
// src/resources/schedules.ts
|
|
3310
3312
|
var SCHEDULE_FIELDS = `
|
|
3311
3313
|
id
|
|
3312
|
-
channel { id }
|
|
3313
3314
|
name
|
|
3314
3315
|
rule { kind atMs everyIntervalSeconds cronExpression cronTimezone }
|
|
3315
3316
|
bounds { startsAtMs untilMs maxOccurrences }
|
|
@@ -3326,7 +3327,7 @@ var LIST_SCHEDULES = `
|
|
|
3326
3327
|
query ToolkitListAgentSchedules($channelId: ID!, $after: String) {
|
|
3327
3328
|
viewer { channel(id: $channelId) {
|
|
3328
3329
|
schedules(input: { first: 64, after: $after }) {
|
|
3329
|
-
edges { node { ${SCHEDULE_FIELDS} } }
|
|
3330
|
+
edges { node { channel { id } ${SCHEDULE_FIELDS} } }
|
|
3330
3331
|
pageInfo { hasNextPage endCursor }
|
|
3331
3332
|
}
|
|
3332
3333
|
} }
|
|
@@ -3334,6 +3335,20 @@ query ToolkitListAgentSchedules($channelId: ID!, $after: String) {
|
|
|
3334
3335
|
var UPDATE_SCHEDULE = `
|
|
3335
3336
|
mutation ToolkitUpdateAgentSchedule($input: UpdateChannelScheduleInput!) {
|
|
3336
3337
|
updateChannelSchedule(input: $input) {
|
|
3338
|
+
schedule { channel { id } ${SCHEDULE_FIELDS} }
|
|
3339
|
+
deleted
|
|
3340
|
+
}
|
|
3341
|
+
}`.trim();
|
|
3342
|
+
var LIST_SESSION_SCHEDULES = `
|
|
3343
|
+
query ToolkitListSessionSchedules($inboxPath: String!, $after: String) {
|
|
3344
|
+
viewer { sessionSchedules(inboxPath: $inboxPath, input: { first: 64, after: $after }) {
|
|
3345
|
+
edges { node { ${SCHEDULE_FIELDS} } }
|
|
3346
|
+
pageInfo { hasNextPage endCursor }
|
|
3347
|
+
} }
|
|
3348
|
+
}`.trim();
|
|
3349
|
+
var UPDATE_SESSION_SCHEDULE = `
|
|
3350
|
+
mutation ToolkitUpdateSessionSchedule($input: UpdateSessionScheduleInput!) {
|
|
3351
|
+
updateSessionSchedule(input: $input) {
|
|
3337
3352
|
schedule { ${SCHEDULE_FIELDS} }
|
|
3338
3353
|
deleted
|
|
3339
3354
|
}
|
|
@@ -3344,6 +3359,7 @@ query ToolkitAgentChannel {
|
|
|
3344
3359
|
}`.trim();
|
|
3345
3360
|
var SCHEDULE_NAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
3346
3361
|
var RFC3339 = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|[+-](\d{2}):(\d{2}))$/i;
|
|
3362
|
+
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;
|
|
3347
3363
|
var ISO_DURATION = /^P(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;
|
|
3348
3364
|
var GRAPHQL_STATUS_BY_CODE = {
|
|
3349
3365
|
INVALID_ARGUMENT: 400,
|
|
@@ -3367,16 +3383,17 @@ var SchedulesResource = class {
|
|
|
3367
3383
|
client;
|
|
3368
3384
|
async list(params) {
|
|
3369
3385
|
this.client._requireAuth();
|
|
3370
|
-
const
|
|
3386
|
+
const target = targetInput(params);
|
|
3387
|
+
const inbox = "inboxPath" in target;
|
|
3371
3388
|
const schedules = [];
|
|
3372
3389
|
let after = null;
|
|
3373
3390
|
const seenCursors = /* @__PURE__ */ new Set();
|
|
3374
3391
|
for (; ; ) {
|
|
3375
3392
|
const data = await this.graphql(
|
|
3376
|
-
LIST_SCHEDULES,
|
|
3377
|
-
{
|
|
3393
|
+
inbox ? LIST_SESSION_SCHEDULES : LIST_SCHEDULES,
|
|
3394
|
+
{ ...target, after }
|
|
3378
3395
|
);
|
|
3379
|
-
const connection2 = data.viewer?.channel?.schedules;
|
|
3396
|
+
const connection2 = inbox ? data.viewer?.sessionSchedules : data.viewer?.channel?.schedules;
|
|
3380
3397
|
if (!connection2?.edges) throw scheduleNotFound();
|
|
3381
3398
|
for (const edge of connection2.edges) {
|
|
3382
3399
|
if (!edge?.node) throw scheduleEmptyResponse();
|
|
@@ -3392,15 +3409,14 @@ var SchedulesResource = class {
|
|
|
3392
3409
|
async put(params) {
|
|
3393
3410
|
this.client._requireAuth();
|
|
3394
3411
|
const input = {
|
|
3395
|
-
|
|
3412
|
+
...targetInput(params),
|
|
3396
3413
|
name: requireName(params.name),
|
|
3397
3414
|
definition: {
|
|
3398
3415
|
...ruleInput(params.rule, params.bounds),
|
|
3399
3416
|
message: { text: requireText(params.text) }
|
|
3400
3417
|
}
|
|
3401
3418
|
};
|
|
3402
|
-
const
|
|
3403
|
-
const schedule = data.updateChannelSchedule?.schedule;
|
|
3419
|
+
const schedule = (await this.update(input))?.schedule;
|
|
3404
3420
|
if (!schedule) throw scheduleEmptyResponse();
|
|
3405
3421
|
return fromWireSchedule(schedule);
|
|
3406
3422
|
}
|
|
@@ -3412,11 +3428,11 @@ var SchedulesResource = class {
|
|
|
3412
3428
|
}
|
|
3413
3429
|
async delete(params) {
|
|
3414
3430
|
this.client._requireAuth();
|
|
3415
|
-
const
|
|
3416
|
-
|
|
3431
|
+
const result = await this.update({
|
|
3432
|
+
...managementInput(params),
|
|
3433
|
+
lifecycle: "REMOVED"
|
|
3417
3434
|
});
|
|
3418
|
-
if (
|
|
3419
|
-
throw scheduleEmptyResponse();
|
|
3435
|
+
if (result?.deleted !== true) throw scheduleEmptyResponse();
|
|
3420
3436
|
}
|
|
3421
3437
|
/** Resolve the authenticated viewer's unique Agent Channel for CLI defaults. */
|
|
3422
3438
|
async agentChannelId() {
|
|
@@ -3430,13 +3446,15 @@ var SchedulesResource = class {
|
|
|
3430
3446
|
}
|
|
3431
3447
|
async manage(lifecycle, params) {
|
|
3432
3448
|
this.client._requireAuth();
|
|
3433
|
-
const
|
|
3434
|
-
input: { ...managementInput(params), lifecycle }
|
|
3435
|
-
});
|
|
3436
|
-
const schedule = data.updateChannelSchedule?.schedule;
|
|
3449
|
+
const schedule = (await this.update({ ...managementInput(params), lifecycle }))?.schedule;
|
|
3437
3450
|
if (!schedule) throw scheduleEmptyResponse();
|
|
3438
3451
|
return fromWireSchedule(schedule);
|
|
3439
3452
|
}
|
|
3453
|
+
async update(input) {
|
|
3454
|
+
const inbox = "inboxPath" in input;
|
|
3455
|
+
const data = await this.graphql(inbox ? UPDATE_SESSION_SCHEDULE : UPDATE_SCHEDULE, { input });
|
|
3456
|
+
return inbox ? data.updateSessionSchedule : data.updateChannelSchedule;
|
|
3457
|
+
}
|
|
3440
3458
|
async graphql(query, variables) {
|
|
3441
3459
|
const response = await this.client._request("POST", "/query", {
|
|
3442
3460
|
body: variables === void 0 ? { query } : { query, variables }
|
|
@@ -3587,10 +3605,24 @@ function fromWireRule(rule) {
|
|
|
3587
3605
|
}
|
|
3588
3606
|
function managementInput(params) {
|
|
3589
3607
|
return {
|
|
3590
|
-
|
|
3608
|
+
...targetInput(params),
|
|
3591
3609
|
name: requireName(params.name)
|
|
3592
3610
|
};
|
|
3593
3611
|
}
|
|
3612
|
+
function targetInput(target) {
|
|
3613
|
+
if (target.channelId !== void 0 === (target.inboxPath !== void 0))
|
|
3614
|
+
throw invalid("exactly one of channelId or inboxPath is required");
|
|
3615
|
+
if (target.channelId !== void 0)
|
|
3616
|
+
return { channelId: channelID(target.channelId) };
|
|
3617
|
+
const path = target.inboxPath;
|
|
3618
|
+
const size = typeof path === "string" ? utf8Size(path) : void 0;
|
|
3619
|
+
if (typeof path !== "string" || size === void 0 || size > 2048 || !path.startsWith("/") || path.includes("\0") || path.slice(1).split("/").some((segment) => segment === "" || segment === "." || segment === ".."))
|
|
3620
|
+
throw invalid("inboxPath must be a canonical absolute ALFS Inbox path");
|
|
3621
|
+
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;
|
|
3622
|
+
if (transcript === void 0 || /\.inbox(?:\.jsonl)?$/.test(transcript) || /\.lock(?:\.recovery|\.heartbeat-[^/]+|\.stale-[^/]+)?$/.test(transcript) || transcript.endsWith("/.jsonl"))
|
|
3623
|
+
throw invalid("inboxPath must identify a standard Session Inbox sidecar");
|
|
3624
|
+
return { inboxPath: path };
|
|
3625
|
+
}
|
|
3594
3626
|
function channelID(value) {
|
|
3595
3627
|
if (typeof value === "number" && (!Number.isSafeInteger(value) || value <= 0)) {
|
|
3596
3628
|
throw invalid(
|
|
@@ -3635,8 +3667,8 @@ function durationMilliseconds(value, minimumSeconds) {
|
|
|
3635
3667
|
if (!Number.isSafeInteger(result)) throw invalid("duration is out of range");
|
|
3636
3668
|
return result;
|
|
3637
3669
|
}
|
|
3638
|
-
function timestampMilliseconds(value) {
|
|
3639
|
-
const match = RFC3339.exec(value);
|
|
3670
|
+
function timestampMilliseconds(value, fractional = false) {
|
|
3671
|
+
const match = (fractional ? RFC3339_FRACTIONAL : RFC3339).exec(value);
|
|
3640
3672
|
if (!match) throw invalid("timestamp must be RFC3339 with a timezone");
|
|
3641
3673
|
const [year, month, day, hour, minute, second] = match.slice(1, 7).map(Number);
|
|
3642
3674
|
const offsetHour = Number(match[8] ?? 0);
|
|
@@ -3679,6 +3711,243 @@ function scheduleEmptyResponse() {
|
|
|
3679
3711
|
);
|
|
3680
3712
|
}
|
|
3681
3713
|
|
|
3714
|
+
// src/resources/steward.ts
|
|
3715
|
+
var GRAPHQL_STATUS_BY_CODE2 = {
|
|
3716
|
+
INVALID_ARGUMENT: 400,
|
|
3717
|
+
UNAUTHENTICATED: 401,
|
|
3718
|
+
PERMISSION_DENIED: 403,
|
|
3719
|
+
NOT_FOUND: 404,
|
|
3720
|
+
ALREADY_EXISTS: 409,
|
|
3721
|
+
ABORTED: 409,
|
|
3722
|
+
FAILED_PRECONDITION: 412,
|
|
3723
|
+
RESOURCE_EXHAUSTED: 429,
|
|
3724
|
+
INTERNAL: 500,
|
|
3725
|
+
UNKNOWN: 500,
|
|
3726
|
+
DATA_LOSS: 500,
|
|
3727
|
+
UNAVAILABLE: 503,
|
|
3728
|
+
DEADLINE_EXCEEDED: 504
|
|
3729
|
+
};
|
|
3730
|
+
var DECIDE = `
|
|
3731
|
+
mutation ToolkitStewardDecide($input: UpdateStewardDeliveryInput!) {
|
|
3732
|
+
updateStewardDelivery(input: $input) { delivery { deliveryId state } }
|
|
3733
|
+
}`.trim();
|
|
3734
|
+
var FORWARD = `
|
|
3735
|
+
mutation ToolkitStewardForward($input: UpdateStewardDeliveryInput!) {
|
|
3736
|
+
updateStewardDelivery(input: $input) { delivery { deliveryId state channelMessageId } }
|
|
3737
|
+
}`.trim();
|
|
3738
|
+
var SEND = `
|
|
3739
|
+
mutation ToolkitStewardSend($input: PostStewardMessageInput!) {
|
|
3740
|
+
postStewardMessage(input: $input) { message { channelMessageId requestId } }
|
|
3741
|
+
}`.trim();
|
|
3742
|
+
var PENDING = `
|
|
3743
|
+
query ToolkitStewardPending($inboxPath: String!, $input: StewardDigestPendingInput) {
|
|
3744
|
+
viewer {
|
|
3745
|
+
stewardDigestPending(inboxPath: $inboxPath, input: $input) {
|
|
3746
|
+
edges {
|
|
3747
|
+
cursor
|
|
3748
|
+
node { deliveryId feedEntryId source { kind id } decisionReason consumedAtMs }
|
|
3749
|
+
}
|
|
3750
|
+
pageInfo { hasNextPage endCursor }
|
|
3751
|
+
windowSinceMs
|
|
3752
|
+
windowUntilMs
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
}`.trim();
|
|
3756
|
+
var BRIEFED = `
|
|
3757
|
+
mutation ToolkitStewardBriefed($input: CompleteStewardBriefInput!) {
|
|
3758
|
+
completeStewardBrief(input: $input) { ok }
|
|
3759
|
+
}`.trim();
|
|
3760
|
+
var DECISIONS = /* @__PURE__ */ new Set([
|
|
3761
|
+
"immediate",
|
|
3762
|
+
"digest",
|
|
3763
|
+
"suppress"
|
|
3764
|
+
]);
|
|
3765
|
+
var DELIVERY_ID = /^[1-9][0-9]{0,18}$/;
|
|
3766
|
+
function invalid2(message) {
|
|
3767
|
+
return new AlvaError("INVALID_ARGUMENT", message, 400);
|
|
3768
|
+
}
|
|
3769
|
+
function requireInboxPath(target) {
|
|
3770
|
+
if (!target || typeof target.inboxPath !== "string" || target.inboxPath === "")
|
|
3771
|
+
throw invalid2("steward commands require the steward Session Inbox path");
|
|
3772
|
+
return target.inboxPath;
|
|
3773
|
+
}
|
|
3774
|
+
function requireDeliveryId(value, label = "delivery id") {
|
|
3775
|
+
if (!DELIVERY_ID.test(value))
|
|
3776
|
+
throw invalid2(`${label} must be a positive integer`);
|
|
3777
|
+
return value;
|
|
3778
|
+
}
|
|
3779
|
+
function requireDeliveryIds(values) {
|
|
3780
|
+
if (values.length === 0)
|
|
3781
|
+
throw invalid2("at least one delivery id is required");
|
|
3782
|
+
const unique = /* @__PURE__ */ new Set();
|
|
3783
|
+
for (const value of values) {
|
|
3784
|
+
requireDeliveryId(value);
|
|
3785
|
+
if (unique.has(value)) throw invalid2(`duplicate delivery id ${value}`);
|
|
3786
|
+
unique.add(value);
|
|
3787
|
+
}
|
|
3788
|
+
return [...unique];
|
|
3789
|
+
}
|
|
3790
|
+
function requireDecision(value) {
|
|
3791
|
+
if (!DECISIONS.has(value))
|
|
3792
|
+
throw invalid2("decision must be one of immediate, digest, suppress");
|
|
3793
|
+
return value;
|
|
3794
|
+
}
|
|
3795
|
+
function generateRequestId() {
|
|
3796
|
+
const webcrypto = globalThis.crypto;
|
|
3797
|
+
if (typeof webcrypto?.randomUUID === "function")
|
|
3798
|
+
return webcrypto.randomUUID();
|
|
3799
|
+
const bytes = new Uint8Array(16);
|
|
3800
|
+
if (typeof webcrypto?.getRandomValues === "function") {
|
|
3801
|
+
webcrypto.getRandomValues(bytes);
|
|
3802
|
+
} else {
|
|
3803
|
+
for (let i = 0; i < bytes.length; i += 1)
|
|
3804
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
3805
|
+
}
|
|
3806
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
3807
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
3808
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join(
|
|
3809
|
+
""
|
|
3810
|
+
);
|
|
3811
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
3812
|
+
}
|
|
3813
|
+
function requireRequestId(value) {
|
|
3814
|
+
if (value === void 0) return generateRequestId();
|
|
3815
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(
|
|
3816
|
+
value
|
|
3817
|
+
))
|
|
3818
|
+
throw invalid2("request id must be a UUID");
|
|
3819
|
+
return value;
|
|
3820
|
+
}
|
|
3821
|
+
function emptyResponse() {
|
|
3822
|
+
return new AlvaError("EMPTY_RESPONSE", "steward response was empty", 502);
|
|
3823
|
+
}
|
|
3824
|
+
var StewardResource = class {
|
|
3825
|
+
constructor(client) {
|
|
3826
|
+
this.client = client;
|
|
3827
|
+
}
|
|
3828
|
+
client;
|
|
3829
|
+
async decide(params) {
|
|
3830
|
+
this.client._requireAuth();
|
|
3831
|
+
const reason = params.reason?.trim();
|
|
3832
|
+
if (!reason) throw invalid2("a decision reason is required");
|
|
3833
|
+
const data = await this.graphql(DECIDE, {
|
|
3834
|
+
input: {
|
|
3835
|
+
inboxPath: requireInboxPath(params),
|
|
3836
|
+
deliveryId: requireDeliveryId(params.deliveryId),
|
|
3837
|
+
decision: {
|
|
3838
|
+
decision: requireDecision(params.decision).toUpperCase(),
|
|
3839
|
+
reason
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
});
|
|
3843
|
+
const delivery = data.updateStewardDelivery?.delivery;
|
|
3844
|
+
if (!delivery) throw emptyResponse();
|
|
3845
|
+
return { state: delivery.state };
|
|
3846
|
+
}
|
|
3847
|
+
async forward(params) {
|
|
3848
|
+
this.client._requireAuth();
|
|
3849
|
+
const data = await this.graphql(FORWARD, {
|
|
3850
|
+
input: {
|
|
3851
|
+
inboxPath: requireInboxPath(params),
|
|
3852
|
+
deliveryId: requireDeliveryId(params.deliveryId),
|
|
3853
|
+
forward: { requestId: requireRequestId(params.requestId) }
|
|
3854
|
+
}
|
|
3855
|
+
});
|
|
3856
|
+
const delivery = data.updateStewardDelivery?.delivery;
|
|
3857
|
+
if (!delivery || !delivery.channelMessageId) throw emptyResponse();
|
|
3858
|
+
return {
|
|
3859
|
+
channelMessageId: delivery.channelMessageId,
|
|
3860
|
+
state: delivery.state
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
async send(params) {
|
|
3864
|
+
this.client._requireAuth();
|
|
3865
|
+
if (typeof params.body !== "string" || params.body.trim() === "")
|
|
3866
|
+
throw invalid2("a message body is required");
|
|
3867
|
+
const data = await this.graphql(SEND, {
|
|
3868
|
+
input: {
|
|
3869
|
+
inboxPath: requireInboxPath(params),
|
|
3870
|
+
requestId: requireRequestId(params.requestId),
|
|
3871
|
+
body: params.body,
|
|
3872
|
+
deliveryIds: requireDeliveryIds(params.deliveryIds)
|
|
3873
|
+
}
|
|
3874
|
+
});
|
|
3875
|
+
const message = data.postStewardMessage?.message;
|
|
3876
|
+
if (!message) throw emptyResponse();
|
|
3877
|
+
return message;
|
|
3878
|
+
}
|
|
3879
|
+
async pending(params) {
|
|
3880
|
+
this.client._requireAuth();
|
|
3881
|
+
const first = params.first ?? 50;
|
|
3882
|
+
if (!Number.isInteger(first) || first < 1 || first > 100)
|
|
3883
|
+
throw invalid2("first must be an integer between 1 and 100");
|
|
3884
|
+
const input = { first };
|
|
3885
|
+
if (params.after !== void 0 && params.after !== "") {
|
|
3886
|
+
input.after = params.after;
|
|
3887
|
+
} else {
|
|
3888
|
+
for (const [label, value] of [
|
|
3889
|
+
["sinceMs", params.sinceMs],
|
|
3890
|
+
["untilMs", params.untilMs]
|
|
3891
|
+
]) {
|
|
3892
|
+
if (value !== void 0 && (!Number.isSafeInteger(value) || value <= 0))
|
|
3893
|
+
throw invalid2(`${label} must be a positive safe integer timestamp`);
|
|
3894
|
+
}
|
|
3895
|
+
if (params.sinceMs !== void 0 && params.untilMs !== void 0 && params.untilMs <= params.sinceMs)
|
|
3896
|
+
throw invalid2("untilMs must be after sinceMs");
|
|
3897
|
+
if (params.sinceMs !== void 0) input.sinceMs = params.sinceMs;
|
|
3898
|
+
if (params.untilMs !== void 0) input.untilMs = params.untilMs;
|
|
3899
|
+
}
|
|
3900
|
+
const data = await this.graphql(PENDING, { inboxPath: requireInboxPath(params), input });
|
|
3901
|
+
const page = data.viewer?.stewardDigestPending;
|
|
3902
|
+
if (!page || !Array.isArray(page.edges)) throw emptyResponse();
|
|
3903
|
+
const windowSinceMs = page.windowSinceMs ?? 0;
|
|
3904
|
+
const windowUntilMs = page.windowUntilMs ?? 0;
|
|
3905
|
+
if (!Number.isSafeInteger(windowSinceMs) || !Number.isSafeInteger(windowUntilMs) || windowSinceMs <= 0 || windowUntilMs <= windowSinceMs)
|
|
3906
|
+
throw emptyResponse();
|
|
3907
|
+
const items = page.edges.map((edge) => edge.node);
|
|
3908
|
+
const nextCursor = page.pageInfo?.hasNextPage === true && page.pageInfo.endCursor ? page.pageInfo.endCursor : null;
|
|
3909
|
+
return {
|
|
3910
|
+
items,
|
|
3911
|
+
nextCursor,
|
|
3912
|
+
windowSinceMs,
|
|
3913
|
+
windowUntilMs
|
|
3914
|
+
};
|
|
3915
|
+
}
|
|
3916
|
+
async briefed(params) {
|
|
3917
|
+
this.client._requireAuth();
|
|
3918
|
+
const digestRunId = params.digestRunId?.trim();
|
|
3919
|
+
if (!digestRunId) throw invalid2("a digest run id is required");
|
|
3920
|
+
const data = await this.graphql(BRIEFED, {
|
|
3921
|
+
input: {
|
|
3922
|
+
inboxPath: requireInboxPath(params),
|
|
3923
|
+
deliveryIds: requireDeliveryIds(params.deliveryIds),
|
|
3924
|
+
digestRunId
|
|
3925
|
+
}
|
|
3926
|
+
});
|
|
3927
|
+
if (data.completeStewardBrief?.ok !== true) throw emptyResponse();
|
|
3928
|
+
return { ok: true };
|
|
3929
|
+
}
|
|
3930
|
+
async graphql(query, variables) {
|
|
3931
|
+
const response = await this.client._request("POST", "/query", {
|
|
3932
|
+
body: { query, variables }
|
|
3933
|
+
});
|
|
3934
|
+
if (!response || typeof response !== "object") throw emptyResponse();
|
|
3935
|
+
if (response.errors?.length) {
|
|
3936
|
+
const codes = response.errors.map((error) => error.extensions?.code);
|
|
3937
|
+
const canonicalCode = new Set(codes).size === 1 && typeof codes[0] === "string" ? codes[0] : void 0;
|
|
3938
|
+
const canonicalStatus = canonicalCode ? GRAPHQL_STATUS_BY_CODE2[canonicalCode] : void 0;
|
|
3939
|
+
throw new AlvaError(
|
|
3940
|
+
canonicalCode !== void 0 && canonicalStatus !== void 0 ? canonicalCode : "GRAPHQL_ERROR",
|
|
3941
|
+
response.errors.map((error) => error.message).filter((message) => typeof message === "string").join("; ") || "GraphQL request failed",
|
|
3942
|
+
canonicalStatus ?? 502,
|
|
3943
|
+
{ errors: response.errors }
|
|
3944
|
+
);
|
|
3945
|
+
}
|
|
3946
|
+
if (!response.data) throw emptyResponse();
|
|
3947
|
+
return response.data;
|
|
3948
|
+
}
|
|
3949
|
+
};
|
|
3950
|
+
|
|
3682
3951
|
// src/resources/tradingPairs.ts
|
|
3683
3952
|
function isRecord(value) {
|
|
3684
3953
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -3864,14 +4133,320 @@ var TradingPairsResource = class {
|
|
|
3864
4133
|
}
|
|
3865
4134
|
};
|
|
3866
4135
|
|
|
4136
|
+
// src/resources/theses.ts
|
|
4137
|
+
var MAX_SIGNED_INT64 = 9223372036854775807n;
|
|
4138
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4139
|
+
var UNPAIRED_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
|
|
4140
|
+
var encoder = new TextEncoder();
|
|
4141
|
+
var ThesesResource = class {
|
|
4142
|
+
constructor(client) {
|
|
4143
|
+
this.client = client;
|
|
4144
|
+
}
|
|
4145
|
+
client;
|
|
4146
|
+
async create(params) {
|
|
4147
|
+
this.client._requireAuth();
|
|
4148
|
+
const body = createBody(params);
|
|
4149
|
+
return thesisResponse(
|
|
4150
|
+
await this.client._request("POST", "/api/v1/theses", { body })
|
|
4151
|
+
);
|
|
4152
|
+
}
|
|
4153
|
+
async get(id) {
|
|
4154
|
+
this.client._requireAuth();
|
|
4155
|
+
return thesisGetResponse(
|
|
4156
|
+
await this.client._request("GET", `/api/v1/theses/${requireID(id, "id")}`)
|
|
4157
|
+
);
|
|
4158
|
+
}
|
|
4159
|
+
async update(id, params) {
|
|
4160
|
+
this.client._requireAuth();
|
|
4161
|
+
const body = updateBody(params);
|
|
4162
|
+
return thesisResponse(
|
|
4163
|
+
await this.client._request(
|
|
4164
|
+
"PUT",
|
|
4165
|
+
`/api/v1/theses/${requireID(id, "id")}`,
|
|
4166
|
+
{
|
|
4167
|
+
body
|
|
4168
|
+
}
|
|
4169
|
+
)
|
|
4170
|
+
);
|
|
4171
|
+
}
|
|
4172
|
+
async close(id, params) {
|
|
4173
|
+
this.client._requireAuth();
|
|
4174
|
+
const body = {
|
|
4175
|
+
expected_author_version_id: requireID(
|
|
4176
|
+
params.expected_author_version_id,
|
|
4177
|
+
"expected_author_version_id"
|
|
4178
|
+
)
|
|
4179
|
+
};
|
|
4180
|
+
if (params.note !== void 0) body.note = requireText2(params.note, "note");
|
|
4181
|
+
return thesisResponse(
|
|
4182
|
+
await this.client._request(
|
|
4183
|
+
"POST",
|
|
4184
|
+
`/api/v1/theses/${requireID(id, "id")}/close`,
|
|
4185
|
+
{ body }
|
|
4186
|
+
)
|
|
4187
|
+
);
|
|
4188
|
+
}
|
|
4189
|
+
async delete(id) {
|
|
4190
|
+
this.client._requireAuth();
|
|
4191
|
+
const response = await this.client._request(
|
|
4192
|
+
"DELETE",
|
|
4193
|
+
`/api/v1/theses/${requireID(id, "id")}`
|
|
4194
|
+
);
|
|
4195
|
+
if (response === void 0) return {};
|
|
4196
|
+
if (!isRecord2(response) || Object.keys(response).length !== 0) {
|
|
4197
|
+
throw invalidResponse2("delete response must be {}");
|
|
4198
|
+
}
|
|
4199
|
+
return {};
|
|
4200
|
+
}
|
|
4201
|
+
async rewrite(params) {
|
|
4202
|
+
this.client._requireAuth();
|
|
4203
|
+
const body = requireBody(params.body);
|
|
4204
|
+
const mode = params.mode === void 0 ? "reformat" : requireRewriteMode(params.mode);
|
|
4205
|
+
const response = await this.client._request(
|
|
4206
|
+
"POST",
|
|
4207
|
+
"/api/v1/theses/rewrite",
|
|
4208
|
+
{
|
|
4209
|
+
body: { body, mode }
|
|
4210
|
+
}
|
|
4211
|
+
);
|
|
4212
|
+
if (!isRecord2(response) || typeof response.body !== "string") {
|
|
4213
|
+
throw invalidResponse2("rewrite response must contain a string body");
|
|
4214
|
+
}
|
|
4215
|
+
return { body: responseBody(response.body) };
|
|
4216
|
+
}
|
|
4217
|
+
};
|
|
4218
|
+
function createBody(params) {
|
|
4219
|
+
return {
|
|
4220
|
+
request_id: requireRequestID(params.request_id),
|
|
4221
|
+
body: requireBody(params.body),
|
|
4222
|
+
title: requireTitle(params.title ?? ""),
|
|
4223
|
+
entity_ids: requireIDs(params.entity_ids ?? [], "entity_ids"),
|
|
4224
|
+
visibility: requireVisibility(params.visibility ?? "public")
|
|
4225
|
+
};
|
|
4226
|
+
}
|
|
4227
|
+
function updateBody(params) {
|
|
4228
|
+
return {
|
|
4229
|
+
request_id: requireRequestID(params.request_id),
|
|
4230
|
+
expected_author_version_id: requireID(
|
|
4231
|
+
params.expected_author_version_id,
|
|
4232
|
+
"expected_author_version_id"
|
|
4233
|
+
),
|
|
4234
|
+
body: requireBody(params.body),
|
|
4235
|
+
title: requireTitle(params.title ?? ""),
|
|
4236
|
+
entity_ids: requireIDs(params.entity_ids ?? [], "entity_ids"),
|
|
4237
|
+
visibility: requireVisibility(params.visibility),
|
|
4238
|
+
editorial: params.editorial ?? false
|
|
4239
|
+
};
|
|
4240
|
+
}
|
|
4241
|
+
function thesisResponse(response) {
|
|
4242
|
+
if (!isRecord2(response) || !isRecord2(response.thesis)) {
|
|
4243
|
+
throw invalidResponse2("response must contain thesis");
|
|
4244
|
+
}
|
|
4245
|
+
const thesis = response.thesis;
|
|
4246
|
+
const value = {
|
|
4247
|
+
id: responseID(thesis.id, "thesis.id"),
|
|
4248
|
+
author_version_id: responseID(
|
|
4249
|
+
thesis.author_version_id,
|
|
4250
|
+
"thesis.author_version_id"
|
|
4251
|
+
),
|
|
4252
|
+
material_version_id: responseID(
|
|
4253
|
+
thesis.material_version_id,
|
|
4254
|
+
"thesis.material_version_id"
|
|
4255
|
+
),
|
|
4256
|
+
title: responseTitle(thesis.title),
|
|
4257
|
+
body: responseBody(thesis.body),
|
|
4258
|
+
entity_ids: responseIDs(thesis.entity_ids, "thesis.entity_ids"),
|
|
4259
|
+
visibility: responseVisibility(thesis.visibility),
|
|
4260
|
+
closed: responseBoolean(thesis.closed, "thesis.closed"),
|
|
4261
|
+
closing_note: responseClosingNote(thesis.closing_note),
|
|
4262
|
+
author_kind: responseText(thesis.author_kind, "thesis.author_kind"),
|
|
4263
|
+
author_ref: responseText(thesis.author_ref, "thesis.author_ref")
|
|
4264
|
+
};
|
|
4265
|
+
return { thesis: value };
|
|
4266
|
+
}
|
|
4267
|
+
function thesisGetResponse(response) {
|
|
4268
|
+
const base = thesisResponse(response);
|
|
4269
|
+
if (!isRecord2(response) || !isRecord2(response.author)) {
|
|
4270
|
+
throw invalidResponse2("response must contain author");
|
|
4271
|
+
}
|
|
4272
|
+
const authorRecord = response.author;
|
|
4273
|
+
const author = {
|
|
4274
|
+
id: responseID(authorRecord.id, "author.id"),
|
|
4275
|
+
kind: responseText(authorRecord.kind, "author.kind"),
|
|
4276
|
+
display_name: responseText(
|
|
4277
|
+
authorRecord.display_name,
|
|
4278
|
+
"author.display_name"
|
|
4279
|
+
),
|
|
4280
|
+
avatar_url: responseText(authorRecord.avatar_url, "author.avatar_url"),
|
|
4281
|
+
username: responseText(authorRecord.username, "author.username")
|
|
4282
|
+
};
|
|
4283
|
+
if (!Array.isArray(response.entities)) {
|
|
4284
|
+
throw invalidResponse2("response must contain entities");
|
|
4285
|
+
}
|
|
4286
|
+
if (response.entities.length !== base.thesis.entity_ids.length) {
|
|
4287
|
+
throw invalidResponse2("entities must match thesis.entity_ids");
|
|
4288
|
+
}
|
|
4289
|
+
const entities = response.entities.map((item, index) => {
|
|
4290
|
+
if (!isRecord2(item))
|
|
4291
|
+
throw invalidResponse2(`entities[${index}] must be an object`);
|
|
4292
|
+
const entity = {
|
|
4293
|
+
id: responseID(item.id, `entities[${index}].id`),
|
|
4294
|
+
ticker: responseText(item.ticker, `entities[${index}].ticker`),
|
|
4295
|
+
name: responseText(item.name, `entities[${index}].name`),
|
|
4296
|
+
icon_url: responseText(item.icon_url, `entities[${index}].icon_url`),
|
|
4297
|
+
kind: responseText(item.kind, `entities[${index}].kind`)
|
|
4298
|
+
};
|
|
4299
|
+
if (entity.id !== base.thesis.entity_ids[index]) {
|
|
4300
|
+
throw invalidResponse2("entities must preserve thesis.entity_ids order");
|
|
4301
|
+
}
|
|
4302
|
+
return entity;
|
|
4303
|
+
});
|
|
4304
|
+
return { thesis: base.thesis, author, entities };
|
|
4305
|
+
}
|
|
4306
|
+
function requireRequestID(value) {
|
|
4307
|
+
if (!UUID.test(value) || /^0{8}-0{4}-0{4}-0{4}-0{12}$/i.test(value)) {
|
|
4308
|
+
throw invalidArgument("request_id must be a non-zero RFC 4122 UUID");
|
|
4309
|
+
}
|
|
4310
|
+
return value;
|
|
4311
|
+
}
|
|
4312
|
+
function requireID(value, field) {
|
|
4313
|
+
if (typeof value !== "string" || !/^[1-9]\d*$/.test(value)) {
|
|
4314
|
+
throw invalidArgument(`${field} must be a positive int64 decimal string`);
|
|
4315
|
+
}
|
|
4316
|
+
const parsed = BigInt(value);
|
|
4317
|
+
if (parsed > MAX_SIGNED_INT64) {
|
|
4318
|
+
throw invalidArgument(`${field} must be a positive int64 decimal string`);
|
|
4319
|
+
}
|
|
4320
|
+
return value;
|
|
4321
|
+
}
|
|
4322
|
+
function requireIDs(value, field) {
|
|
4323
|
+
if (!Array.isArray(value)) throw invalidArgument(`${field} must be an array`);
|
|
4324
|
+
if (value.length > 20) {
|
|
4325
|
+
throw invalidArgument(`${field} must contain at most 20 IDs`);
|
|
4326
|
+
}
|
|
4327
|
+
return value.map((item, index) => requireID(item, `${field}[${index}]`));
|
|
4328
|
+
}
|
|
4329
|
+
function requireBody(value) {
|
|
4330
|
+
const body = requireText2(value, "body");
|
|
4331
|
+
if (body.trim().length === 0) throw invalidArgument("body must not be blank");
|
|
4332
|
+
if (encoder.encode(body).byteLength > 65536) {
|
|
4333
|
+
throw invalidArgument("body must be at most 65536 UTF-8 bytes");
|
|
4334
|
+
}
|
|
4335
|
+
return body;
|
|
4336
|
+
}
|
|
4337
|
+
function requireTitle(value) {
|
|
4338
|
+
const title = requireText2(value, "title");
|
|
4339
|
+
if (encoder.encode(title).byteLength > 500) {
|
|
4340
|
+
throw invalidArgument("title must be at most 500 UTF-8 bytes");
|
|
4341
|
+
}
|
|
4342
|
+
return title;
|
|
4343
|
+
}
|
|
4344
|
+
function requireVisibility(value) {
|
|
4345
|
+
const visibility = requireText2(value, "visibility");
|
|
4346
|
+
if (visibility !== "public" && visibility !== "private") {
|
|
4347
|
+
throw invalidArgument("visibility must be public or private");
|
|
4348
|
+
}
|
|
4349
|
+
return visibility;
|
|
4350
|
+
}
|
|
4351
|
+
function requireRewriteMode(value) {
|
|
4352
|
+
const mode = requireText2(value, "mode");
|
|
4353
|
+
if (mode === "reformat" || mode === "shorten" || mode === "enrich") {
|
|
4354
|
+
return mode;
|
|
4355
|
+
}
|
|
4356
|
+
throw invalidArgument("mode must be reformat, shorten, or enrich");
|
|
4357
|
+
}
|
|
4358
|
+
function requireText2(value, field) {
|
|
4359
|
+
if (typeof value !== "string")
|
|
4360
|
+
throw invalidArgument(`${field} must be a string`);
|
|
4361
|
+
if (UNPAIRED_SURROGATE.test(value)) {
|
|
4362
|
+
throw invalidArgument(`${field} contains invalid Unicode`);
|
|
4363
|
+
}
|
|
4364
|
+
if ((field === "body" || field === "title" || field === "note") && value.includes("\0")) {
|
|
4365
|
+
throw invalidArgument(`${field} must not contain NUL`);
|
|
4366
|
+
}
|
|
4367
|
+
return value;
|
|
4368
|
+
}
|
|
4369
|
+
function responseID(value, field) {
|
|
4370
|
+
if (typeof value === "number") {
|
|
4371
|
+
throw invalidResponse2(
|
|
4372
|
+
`${field} must be a decimal string; numeric IDs are unsafe`
|
|
4373
|
+
);
|
|
4374
|
+
}
|
|
4375
|
+
try {
|
|
4376
|
+
return requireID(value, field);
|
|
4377
|
+
} catch {
|
|
4378
|
+
throw invalidResponse2(`${field} must be a positive int64 decimal string`);
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4381
|
+
function responseIDs(value, field) {
|
|
4382
|
+
if (!Array.isArray(value)) throw invalidResponse2(`${field} must be an array`);
|
|
4383
|
+
if (value.length > 20) {
|
|
4384
|
+
throw invalidResponse2(`${field} must contain at most 20 IDs`);
|
|
4385
|
+
}
|
|
4386
|
+
return value.map((item, index) => responseID(item, `${field}[${index}]`));
|
|
4387
|
+
}
|
|
4388
|
+
function responseText(value, field) {
|
|
4389
|
+
try {
|
|
4390
|
+
return requireText2(value, field);
|
|
4391
|
+
} catch {
|
|
4392
|
+
throw invalidResponse2(`${field} must be valid text`);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
function responseClosingNote(value) {
|
|
4396
|
+
try {
|
|
4397
|
+
return requireText2(value, "note");
|
|
4398
|
+
} catch {
|
|
4399
|
+
throw invalidResponse2("thesis.closing_note must be valid text");
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
function responseBoolean(value, field) {
|
|
4403
|
+
if (typeof value !== "boolean")
|
|
4404
|
+
throw invalidResponse2(`${field} must be boolean`);
|
|
4405
|
+
return value;
|
|
4406
|
+
}
|
|
4407
|
+
function responseVisibility(value) {
|
|
4408
|
+
try {
|
|
4409
|
+
return requireVisibility(value);
|
|
4410
|
+
} catch {
|
|
4411
|
+
throw invalidResponse2("thesis.visibility must be public or private");
|
|
4412
|
+
}
|
|
4413
|
+
}
|
|
4414
|
+
function responseBody(value) {
|
|
4415
|
+
try {
|
|
4416
|
+
return requireBody(value);
|
|
4417
|
+
} catch {
|
|
4418
|
+
throw invalidResponse2(
|
|
4419
|
+
"response body must be nonblank valid text at most 65536 UTF-8 bytes"
|
|
4420
|
+
);
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
function responseTitle(value) {
|
|
4424
|
+
try {
|
|
4425
|
+
return requireTitle(value);
|
|
4426
|
+
} catch {
|
|
4427
|
+
throw invalidResponse2(
|
|
4428
|
+
"response title must be valid text at most 500 UTF-8 bytes"
|
|
4429
|
+
);
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
function isRecord2(value) {
|
|
4433
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4434
|
+
}
|
|
4435
|
+
function invalidArgument(message) {
|
|
4436
|
+
return new AlvaError("INVALID_ARGUMENT", message, 400);
|
|
4437
|
+
}
|
|
4438
|
+
function invalidResponse2(message) {
|
|
4439
|
+
return new AlvaError("INVALID_RESPONSE", message, 502);
|
|
4440
|
+
}
|
|
4441
|
+
|
|
3867
4442
|
// src/client.ts
|
|
3868
4443
|
var DEFAULT_BASE_URL = "https://api-llm.prd.alva.ai";
|
|
3869
4444
|
var DEFAULT_ARRAYS_BASE_URL = "https://data-tools.prd.space.id";
|
|
3870
|
-
function
|
|
4445
|
+
function isRecord3(value) {
|
|
3871
4446
|
return typeof value === "object" && value !== null;
|
|
3872
4447
|
}
|
|
3873
4448
|
function stringField(value, field) {
|
|
3874
|
-
if (!
|
|
4449
|
+
if (!isRecord3(value)) return void 0;
|
|
3875
4450
|
const fieldValue = value[field];
|
|
3876
4451
|
return typeof fieldValue === "string" && fieldValue ? fieldValue : void 0;
|
|
3877
4452
|
}
|
|
@@ -3885,7 +4460,7 @@ function describeCause(cause) {
|
|
|
3885
4460
|
if (cause.message) details.message = cause.message;
|
|
3886
4461
|
const code = stringField(cause, "code");
|
|
3887
4462
|
if (code) details.code = code;
|
|
3888
|
-
} else if (
|
|
4463
|
+
} else if (isRecord3(cause)) {
|
|
3889
4464
|
const code = stringField(cause, "code");
|
|
3890
4465
|
const name = stringField(cause, "name");
|
|
3891
4466
|
const message = stringField(cause, "message");
|
|
@@ -3913,7 +4488,7 @@ function describeFetchFailure(err) {
|
|
|
3913
4488
|
details.message = String(err);
|
|
3914
4489
|
}
|
|
3915
4490
|
const { message: causeMessage, details: causeDetails } = describeCause(
|
|
3916
|
-
|
|
4491
|
+
isRecord3(err) ? err.cause : void 0
|
|
3917
4492
|
);
|
|
3918
4493
|
if (causeDetails) {
|
|
3919
4494
|
details.cause = causeDetails;
|
|
@@ -3944,6 +4519,8 @@ var AlvaClient = class {
|
|
|
3944
4519
|
originSessionId;
|
|
3945
4520
|
/** Session profile kind associated with originSessionId. */
|
|
3946
4521
|
originSessionKind;
|
|
4522
|
+
/** Host-attached file Session target, distinct from the chat origin header. */
|
|
4523
|
+
originInboxPath;
|
|
3947
4524
|
_fs;
|
|
3948
4525
|
_run;
|
|
3949
4526
|
_deploy;
|
|
@@ -3974,7 +4551,9 @@ var AlvaClient = class {
|
|
|
3974
4551
|
_credits;
|
|
3975
4552
|
_markets;
|
|
3976
4553
|
_schedules;
|
|
4554
|
+
_steward;
|
|
3977
4555
|
_tradingPairs;
|
|
4556
|
+
_theses;
|
|
3978
4557
|
constructor(config) {
|
|
3979
4558
|
this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
|
|
3980
4559
|
this.arraysBaseUrl = config.arraysBaseUrl ?? DEFAULT_ARRAYS_BASE_URL;
|
|
@@ -3987,6 +4566,7 @@ var AlvaClient = class {
|
|
|
3987
4566
|
this.signal = config.signal;
|
|
3988
4567
|
this.originSessionId = config.originSessionId;
|
|
3989
4568
|
this.originSessionKind = config.originSessionKind;
|
|
4569
|
+
this.originInboxPath = config.originInboxPath;
|
|
3990
4570
|
}
|
|
3991
4571
|
get fs() {
|
|
3992
4572
|
return this._fs ??= new FsResource(this);
|
|
@@ -4078,6 +4658,12 @@ var AlvaClient = class {
|
|
|
4078
4658
|
get schedules() {
|
|
4079
4659
|
return this._schedules ??= new SchedulesResource(this);
|
|
4080
4660
|
}
|
|
4661
|
+
get steward() {
|
|
4662
|
+
return this._steward ??= new StewardResource(this);
|
|
4663
|
+
}
|
|
4664
|
+
get theses() {
|
|
4665
|
+
return this._theses ??= new ThesesResource(this);
|
|
4666
|
+
}
|
|
4081
4667
|
_requireAuth() {
|
|
4082
4668
|
if (!this.pbsvToken && !this.viewer_token && !this.apiKey) {
|
|
4083
4669
|
throw new AlvaError(
|
|
@@ -4694,7 +5280,7 @@ var installPlaybookRuntime = (targetWindow) => {
|
|
|
4694
5280
|
};
|
|
4695
5281
|
|
|
4696
5282
|
// src/index.ts
|
|
4697
|
-
var VERSION = true ? "0.28.0" : "dev";
|
|
5283
|
+
var VERSION = true ? "0.28.1-beta.0" : "dev";
|
|
4698
5284
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4699
5285
|
0 && (module.exports = {
|
|
4700
5286
|
AlertsResource,
|
|
@@ -4710,6 +5296,8 @@ var VERSION = true ? "0.28.0" : "dev";
|
|
|
4710
5296
|
SUBSCRIBE_PROPOSE_MESSAGE,
|
|
4711
5297
|
SUBSCRIBE_RESULT_MESSAGE,
|
|
4712
5298
|
SchedulesResource,
|
|
5299
|
+
StewardResource,
|
|
5300
|
+
ThesesResource,
|
|
4713
5301
|
TradingPairsResource,
|
|
4714
5302
|
UDF_AUTH_REQUIRED_MESSAGE,
|
|
4715
5303
|
UDF_CONSENT_REQUEST_MESSAGE,
|