@bringg/dashboard-sdk 9.81.0 → 9.82.0-pre.3
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/dist/Analyst/Analyst.consts.d.ts +37 -0
- package/dist/Analyst/Analyst.consts.js +41 -0
- package/dist/Analyst/Analyst.consts.js.map +1 -0
- package/dist/Analyst/Analyst.d.ts +91 -0
- package/dist/Analyst/Analyst.js +173 -0
- package/dist/Analyst/Analyst.js.map +1 -0
- package/dist/Analyst/Entity/AnalystEntity.d.ts +38 -0
- package/dist/Analyst/Entity/AnalystEntity.js +140 -0
- package/dist/Analyst/Entity/AnalystEntity.js.map +1 -0
- package/dist/Analyst/index.d.ts +1 -0
- package/dist/Analyst/index.js +18 -0
- package/dist/Analyst/index.js.map +1 -0
- package/dist/BringgDashboardSDK.d.ts +2 -0
- package/dist/BringgDashboardSDK.js +2 -0
- package/dist/BringgDashboardSDK.js.map +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +514 -2
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +94 -6
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -488,6 +488,406 @@ exports["default"] = AlertsEntity;
|
|
|
488
488
|
|
|
489
489
|
/***/ }),
|
|
490
490
|
|
|
491
|
+
/***/ 93359:
|
|
492
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
493
|
+
|
|
494
|
+
"use strict";
|
|
495
|
+
|
|
496
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
497
|
+
exports.Routes = exports.GRAPH = exports.GATEWAY_PATH = void 0;
|
|
498
|
+
/**
|
|
499
|
+
* api-gateway path prefix the analyst service is registered under.
|
|
500
|
+
*
|
|
501
|
+
* From `analyst-service/helm/service/_default.yaml`:
|
|
502
|
+
*
|
|
503
|
+
* service:
|
|
504
|
+
* endpoints:
|
|
505
|
+
* - path: /analyst-service
|
|
506
|
+
* stripPath: true
|
|
507
|
+
*
|
|
508
|
+
* `stripPath: true` means the gateway strips the prefix before forwarding, so the service receives
|
|
509
|
+
* `/analyst/threads` rather than `/analyst-service/analyst/threads`.
|
|
510
|
+
*/
|
|
511
|
+
exports.GATEWAY_PATH = '/analyst-service';
|
|
512
|
+
/**
|
|
513
|
+
* The graph this chat talks to, and the first segment of every path below.
|
|
514
|
+
*
|
|
515
|
+
* The service mounts one path per graph, so the URL - not a request field - is what selects the
|
|
516
|
+
* agent. That is why the old `agent_id` on the request body no longer exists.
|
|
517
|
+
*/
|
|
518
|
+
exports.GRAPH = 'analyst';
|
|
519
|
+
/**
|
|
520
|
+
* Routes from the ag-ui contract (Confluence 5278728195, §3).
|
|
521
|
+
*
|
|
522
|
+
* `CHAT` is declared here for completeness but is **not** called from this package: it is the ag-ui
|
|
523
|
+
* protocol endpoint, opened by the consumer's `HttpAgent` as a streaming POST. It is exposed through
|
|
524
|
+
* {@link AnalystClientConfig.chatUrl} instead, so the URL is still built in one place.
|
|
525
|
+
*
|
|
526
|
+
* Note the paths deliberately do not say `agui`. If the protocol is replaced again, these do not
|
|
527
|
+
* have to change.
|
|
528
|
+
*/
|
|
529
|
+
exports.Routes = {
|
|
530
|
+
CHAT: "".concat(exports.GATEWAY_PATH, "/").concat(exports.GRAPH, "/chat"),
|
|
531
|
+
CANCEL_RUN: "".concat(exports.GATEWAY_PATH, "/").concat(exports.GRAPH, "/chat/cancel"),
|
|
532
|
+
THREADS: "".concat(exports.GATEWAY_PATH, "/").concat(exports.GRAPH, "/threads"),
|
|
533
|
+
THREAD: "".concat(exports.GATEWAY_PATH, "/").concat(exports.GRAPH, "/threads/{:threadId}")
|
|
534
|
+
};
|
|
535
|
+
//# sourceMappingURL=Analyst.consts.js.map
|
|
536
|
+
|
|
537
|
+
/***/ }),
|
|
538
|
+
|
|
539
|
+
/***/ 68625:
|
|
540
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
541
|
+
|
|
542
|
+
"use strict";
|
|
543
|
+
|
|
544
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
545
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
546
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
547
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
548
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
549
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
550
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
554
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
555
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
556
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
557
|
+
function step(op) {
|
|
558
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
559
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
560
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
561
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
562
|
+
switch (op[0]) {
|
|
563
|
+
case 0: case 1: t = op; break;
|
|
564
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
565
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
566
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
567
|
+
default:
|
|
568
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
569
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
570
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
571
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
572
|
+
if (t[2]) _.ops.pop();
|
|
573
|
+
_.trys.pop(); continue;
|
|
574
|
+
}
|
|
575
|
+
op = body.call(thisArg, _);
|
|
576
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
577
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
581
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
582
|
+
};
|
|
583
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
584
|
+
exports.Analyst = void 0;
|
|
585
|
+
var Analyst_consts_1 = __webpack_require__(93359);
|
|
586
|
+
var AnalystEntity_1 = __importDefault(__webpack_require__(68485));
|
|
587
|
+
var isSameConfig = function (a, b) {
|
|
588
|
+
if (a.apiUrl !== b.apiUrl || a.chatUrl !== b.chatUrl) {
|
|
589
|
+
return false;
|
|
590
|
+
}
|
|
591
|
+
var keys = Object.keys(a.defaultHeaders);
|
|
592
|
+
return (keys.length === Object.keys(b.defaultHeaders).length &&
|
|
593
|
+
keys.every(function (key) { return a.defaultHeaders[key] === b.defaultHeaders[key]; }));
|
|
594
|
+
};
|
|
595
|
+
/**
|
|
596
|
+
* Where the dashboard reaches the Analyst agent, and how it authenticates.
|
|
597
|
+
*
|
|
598
|
+
* The browser never talks to analyst-service directly - it is reached through api-gateway under a
|
|
599
|
+
* path prefix, exactly like `data-query-service`. The service declares `bringg-jwt`, but no JWT
|
|
600
|
+
* exists client-side: the gateway performs the exchange from the ordinary Bringg session token, so
|
|
601
|
+
* we send the same `Authorization: Token token=...` plus `Client` that every other non-hagmonia
|
|
602
|
+
* call sends.
|
|
603
|
+
*
|
|
604
|
+
* **Why config and not a client.** Under ag-ui the chat is a single streaming POST, opened by
|
|
605
|
+
* `HttpAgent` from `@ag-ui/client` and answered with `text/event-stream` until the turn ends. A
|
|
606
|
+
* method returning a `Promise` cannot express that, and the client that can is a browser concern
|
|
607
|
+
* bound to a React lifecycle. So the split falls naturally: this package owns *where and how to
|
|
608
|
+
* connect*, which it already knows from `Session`, and the consumer owns the transport.
|
|
609
|
+
*
|
|
610
|
+
* ```ts
|
|
611
|
+
* const { chatUrl, defaultHeaders } = sdk.analyst.getClientConfig();
|
|
612
|
+
* const agent = new HttpAgent({ url: chatUrl, headers: defaultHeaders });
|
|
613
|
+
* ```
|
|
614
|
+
*
|
|
615
|
+
* Everything the dashboard requests *itself* - the thread list, one thread, cancelling a run - is an
|
|
616
|
+
* ordinary SDK call on this class, typed from the `AnalystChat` contract in `@bringg/types` so the
|
|
617
|
+
* shape is enforced by the compiler in both this repo and analyst-service.
|
|
618
|
+
*/
|
|
619
|
+
var Analyst = /** @class */ (function () {
|
|
620
|
+
function Analyst(session) {
|
|
621
|
+
this.session = session;
|
|
622
|
+
this.entity = new AnalystEntity_1.default(session);
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* The signed-in user's conversations, most recently active first.
|
|
626
|
+
*
|
|
627
|
+
* Carries no messages - the History list stays cheap, and opening a conversation hydrates it
|
|
628
|
+
* through {@link getThread}.
|
|
629
|
+
*/
|
|
630
|
+
Analyst.prototype.listThreads = function () {
|
|
631
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
632
|
+
return __generator(this, function (_a) {
|
|
633
|
+
return [2 /*return*/, this.entity.listThreads()];
|
|
634
|
+
});
|
|
635
|
+
});
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* One conversation, with its messages and whether a run is executing on it right now.
|
|
639
|
+
*
|
|
640
|
+
* `activeRun` is the load-bearing field: a run belongs to the server and outlives the connection
|
|
641
|
+
* that started it, so a caller opening a thread has to attach to that run rather than ask a new
|
|
642
|
+
* question - and must not accept typing meanwhile, because a normal post to a busy thread is
|
|
643
|
+
* answered with the running turn's feed and the typed message is discarded.
|
|
644
|
+
*
|
|
645
|
+
* Rejects on 404, which is also the answer for a thread belonging to someone else: the service
|
|
646
|
+
* deliberately does not distinguish "not yours" from "not there".
|
|
647
|
+
*/
|
|
648
|
+
Analyst.prototype.getThread = function (threadId) {
|
|
649
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
650
|
+
return __generator(this, function (_a) {
|
|
651
|
+
return [2 /*return*/, this.entity.getThread(threadId)];
|
|
652
|
+
});
|
|
653
|
+
});
|
|
654
|
+
};
|
|
655
|
+
/**
|
|
656
|
+
* Cancel the run in flight on a thread.
|
|
657
|
+
*
|
|
658
|
+
* Aborting the stream client-side stops events arriving but leaves the agent running, so Stop has
|
|
659
|
+
* to be this call rather than an abort. `cancelled: false` means the thread was already idle -
|
|
660
|
+
* a normal answer, not a failure.
|
|
661
|
+
*
|
|
662
|
+
* A cancelled run ends with no terminal event: the stream simply closes, with neither
|
|
663
|
+
* `RUN_FINISHED` nor `RUN_ERROR`. Callers that drive their loading state off terminal events
|
|
664
|
+
* alone will hang, and must treat stream close as its own case.
|
|
665
|
+
*/
|
|
666
|
+
Analyst.prototype.cancelRun = function (threadId) {
|
|
667
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
668
|
+
return __generator(this, function (_a) {
|
|
669
|
+
return [2 /*return*/, this.entity.cancelRun(threadId)];
|
|
670
|
+
});
|
|
671
|
+
});
|
|
672
|
+
};
|
|
673
|
+
/**
|
|
674
|
+
* Returns the **same object** while the values are unchanged.
|
|
675
|
+
*
|
|
676
|
+
* Referential stability is load-bearing, not a micro-optimisation: a protocol client treats its
|
|
677
|
+
* config as a dependency and rebuilds itself whenever the identity changes. A fresh object per
|
|
678
|
+
* call rebuilds on every render, which refetches, which renders again - a loop.
|
|
679
|
+
*
|
|
680
|
+
* Recomputed each call and compared by value, so a changed session (login, region switch,
|
|
681
|
+
* impersonation) still produces a new config rather than a stale one.
|
|
682
|
+
*/
|
|
683
|
+
Analyst.prototype.getClientConfig = function () {
|
|
684
|
+
// Resolved from the SIGNED-IN USER's region, not the environment default: a user's region can
|
|
685
|
+
// differ from it, and resolving against the default points them at the wrong cluster.
|
|
686
|
+
var apiEndpoint = this.session.config.getApiEndpoint().encode();
|
|
687
|
+
var next = {
|
|
688
|
+
apiUrl: "".concat(apiEndpoint).concat(Analyst_consts_1.GATEWAY_PATH),
|
|
689
|
+
chatUrl: "".concat(apiEndpoint).concat(Analyst_consts_1.Routes.CHAT),
|
|
690
|
+
defaultHeaders: this.getDefaultHeaders()
|
|
691
|
+
};
|
|
692
|
+
if (this.cached && isSameConfig(this.cached, next)) {
|
|
693
|
+
return this.cached;
|
|
694
|
+
}
|
|
695
|
+
this.cached = next;
|
|
696
|
+
return next;
|
|
697
|
+
};
|
|
698
|
+
/** Matches the headers `ServiceRequest` builds for every other service. */
|
|
699
|
+
Analyst.prototype.getDefaultHeaders = function () {
|
|
700
|
+
var _a;
|
|
701
|
+
var headers = {};
|
|
702
|
+
var token = (_a = this.session.user) === null || _a === void 0 ? void 0 : _a.authentication_token;
|
|
703
|
+
if (token) {
|
|
704
|
+
headers.Authorization = "Token token=".concat(token);
|
|
705
|
+
}
|
|
706
|
+
if (this.session.clientId) {
|
|
707
|
+
headers.Client = String(this.session.clientId);
|
|
708
|
+
}
|
|
709
|
+
return headers;
|
|
710
|
+
};
|
|
711
|
+
return Analyst;
|
|
712
|
+
}());
|
|
713
|
+
exports.Analyst = Analyst;
|
|
714
|
+
exports["default"] = Analyst;
|
|
715
|
+
//# sourceMappingURL=Analyst.js.map
|
|
716
|
+
|
|
717
|
+
/***/ }),
|
|
718
|
+
|
|
719
|
+
/***/ 68485:
|
|
720
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
721
|
+
|
|
722
|
+
"use strict";
|
|
723
|
+
|
|
724
|
+
var __extends = (this && this.__extends) || (function () {
|
|
725
|
+
var extendStatics = function (d, b) {
|
|
726
|
+
extendStatics = Object.setPrototypeOf ||
|
|
727
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
728
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
729
|
+
return extendStatics(d, b);
|
|
730
|
+
};
|
|
731
|
+
return function (d, b) {
|
|
732
|
+
if (typeof b !== "function" && b !== null)
|
|
733
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
734
|
+
extendStatics(d, b);
|
|
735
|
+
function __() { this.constructor = d; }
|
|
736
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
737
|
+
};
|
|
738
|
+
})();
|
|
739
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
740
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
741
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
742
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
743
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
744
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
745
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
746
|
+
});
|
|
747
|
+
};
|
|
748
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
749
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
750
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
751
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
752
|
+
function step(op) {
|
|
753
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
754
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
755
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
756
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
757
|
+
switch (op[0]) {
|
|
758
|
+
case 0: case 1: t = op; break;
|
|
759
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
760
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
761
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
762
|
+
default:
|
|
763
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
764
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
765
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
766
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
767
|
+
if (t[2]) _.ops.pop();
|
|
768
|
+
_.trys.pop(); continue;
|
|
769
|
+
}
|
|
770
|
+
op = body.call(thisArg, _);
|
|
771
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
772
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
776
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
777
|
+
};
|
|
778
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
779
|
+
var Entity_1 = __importDefault(__webpack_require__(7483));
|
|
780
|
+
var Analyst_consts_1 = __webpack_require__(93359);
|
|
781
|
+
/**
|
|
782
|
+
* The Analyst REST surface.
|
|
783
|
+
*
|
|
784
|
+
* **Why the chat endpoint is not here.** The ag-ui contract has four endpoints, and exactly one of
|
|
785
|
+
* them is the protocol: `POST /analyst/chat` is a streaming POST that answers with `text/event-stream`
|
|
786
|
+
* until the turn ends. A method returning a `Promise` cannot express that, and re-implementing SSE
|
|
787
|
+
* framing here would duplicate the transport we are deferring to - so the consumer's `HttpAgent`
|
|
788
|
+
* opens it, and this package's contribution is {@link Analyst.getClientConfig}: where to connect and
|
|
789
|
+
* how to authenticate.
|
|
790
|
+
*
|
|
791
|
+
* The other three carry no protocol content at all. They are ordinary JSON over REST, and the
|
|
792
|
+
* dashboard - not the protocol client - decides when to call them: the History tab asks for the
|
|
793
|
+
* list, opening a conversation asks for one thread, and pressing Stop cancels the run. That makes
|
|
794
|
+
* them ours.
|
|
795
|
+
*/
|
|
796
|
+
var AnalystEntity = /** @class */ (function (_super) {
|
|
797
|
+
__extends(AnalystEntity, _super);
|
|
798
|
+
function AnalystEntity(session) {
|
|
799
|
+
return _super.call(this, {
|
|
800
|
+
session: session,
|
|
801
|
+
entityName: 'threads',
|
|
802
|
+
routePrefix: 'analyst-service'
|
|
803
|
+
}) || this;
|
|
804
|
+
}
|
|
805
|
+
/** The signed-in user's threads, most recently active first. A bare array, no envelope. */
|
|
806
|
+
AnalystEntity.prototype.listThreads = function () {
|
|
807
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
808
|
+
var threads;
|
|
809
|
+
return __generator(this, function (_a) {
|
|
810
|
+
switch (_a.label) {
|
|
811
|
+
case 0: return [4 /*yield*/, this.service.routeGenerator
|
|
812
|
+
.get(Analyst_consts_1.Routes.THREADS)
|
|
813
|
+
.setException('Failed to fetch analyst chat threads')
|
|
814
|
+
.invoke()];
|
|
815
|
+
case 1:
|
|
816
|
+
threads = _a.sent();
|
|
817
|
+
return [2 /*return*/, threads !== null && threads !== void 0 ? threads : []];
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
});
|
|
821
|
+
};
|
|
822
|
+
/**
|
|
823
|
+
* One thread, with its messages and whether a run is currently executing on it.
|
|
824
|
+
*
|
|
825
|
+
* A thread belonging to another user answers **404**, never 403 - so a rejected id is
|
|
826
|
+
* indistinguishable from a missing one, by design.
|
|
827
|
+
*/
|
|
828
|
+
AnalystEntity.prototype.getThread = function (threadId) {
|
|
829
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
830
|
+
return __generator(this, function (_a) {
|
|
831
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
832
|
+
.get(Analyst_consts_1.Routes.THREAD)
|
|
833
|
+
.withRouteParams({ threadId: threadId })
|
|
834
|
+
.setException('Failed to fetch analyst chat thread')
|
|
835
|
+
.invoke()];
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* Cancel the run in flight on a thread.
|
|
841
|
+
*
|
|
842
|
+
* Needed because a run belongs to the server, not to the connection that started it: aborting the
|
|
843
|
+
* stream client-side stops the events arriving but leaves the agent working. `cancelled: false`
|
|
844
|
+
* means the thread was already idle, which is a normal answer rather than a failure.
|
|
845
|
+
*/
|
|
846
|
+
AnalystEntity.prototype.cancelRun = function (threadId) {
|
|
847
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
848
|
+
var payload;
|
|
849
|
+
return __generator(this, function (_a) {
|
|
850
|
+
payload = { threadId: threadId };
|
|
851
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
852
|
+
.post(Analyst_consts_1.Routes.CANCEL_RUN)
|
|
853
|
+
.withPayload(payload)
|
|
854
|
+
.setException('Failed to cancel the analyst chat run')
|
|
855
|
+
.invoke()];
|
|
856
|
+
});
|
|
857
|
+
});
|
|
858
|
+
};
|
|
859
|
+
return AnalystEntity;
|
|
860
|
+
}(Entity_1.default));
|
|
861
|
+
exports["default"] = AnalystEntity;
|
|
862
|
+
//# sourceMappingURL=AnalystEntity.js.map
|
|
863
|
+
|
|
864
|
+
/***/ }),
|
|
865
|
+
|
|
866
|
+
/***/ 82661:
|
|
867
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
868
|
+
|
|
869
|
+
"use strict";
|
|
870
|
+
|
|
871
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
872
|
+
if (k2 === undefined) k2 = k;
|
|
873
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
874
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
875
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
876
|
+
}
|
|
877
|
+
Object.defineProperty(o, k2, desc);
|
|
878
|
+
}) : (function(o, m, k, k2) {
|
|
879
|
+
if (k2 === undefined) k2 = k;
|
|
880
|
+
o[k2] = m[k];
|
|
881
|
+
}));
|
|
882
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
883
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
884
|
+
};
|
|
885
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
886
|
+
__exportStar(__webpack_require__(68625), exports);
|
|
887
|
+
//# sourceMappingURL=index.js.map
|
|
888
|
+
|
|
889
|
+
/***/ }),
|
|
890
|
+
|
|
491
891
|
/***/ 80034:
|
|
492
892
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
493
893
|
|
|
@@ -2680,6 +3080,7 @@ exports.newConfigurationProvider = exports.getFullConfiguration = exports.setEnv
|
|
|
2680
3080
|
var mobx = __importStar(__webpack_require__(68949));
|
|
2681
3081
|
var AddonsApi_1 = __importDefault(__webpack_require__(22464));
|
|
2682
3082
|
var AlertsApi_1 = __importDefault(__webpack_require__(86776));
|
|
3083
|
+
var Analyst_1 = __webpack_require__(82661);
|
|
2683
3084
|
var AnalyticsReportsApi_1 = __importDefault(__webpack_require__(80034));
|
|
2684
3085
|
var ApplicationApi_1 = __importDefault(__webpack_require__(50513));
|
|
2685
3086
|
var ApplicationMerchantConfigurationApi_1 = __importDefault(__webpack_require__(82996));
|
|
@@ -3200,6 +3601,7 @@ function init(session) {
|
|
|
3200
3601
|
bringg.parkingSpotApi = new ParkingSpotApi_1.default(session);
|
|
3201
3602
|
bringg.customAttributesApi = new CustomAttributesApi_1.default(session);
|
|
3202
3603
|
bringg.asyncOperationStatus = new AsyncOperationStatus_1.AsyncOperationStatus(session);
|
|
3604
|
+
bringg.analyst = new Analyst_1.Analyst(session);
|
|
3203
3605
|
bringg.addons = new AddonsApi_1.default(session);
|
|
3204
3606
|
bringg.supportTicket = new SupportTicketApi_1.default(session);
|
|
3205
3607
|
bringg.optimizationKpi = new OptimizationKpiApi_1.default(session);
|
|
@@ -24032,7 +24434,7 @@ var lodash_1 = __webpack_require__(96486);
|
|
|
24032
24434
|
var BringgException_1 = __webpack_require__(43605);
|
|
24033
24435
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
24034
24436
|
var abort_1 = __webpack_require__(34179);
|
|
24035
|
-
var version = '9.
|
|
24437
|
+
var version = '9.82.0-pre.3';
|
|
24036
24438
|
function logErrorResponse(response) {
|
|
24037
24439
|
var data = response.data, status = response.status;
|
|
24038
24440
|
try {
|
|
@@ -36001,6 +36403,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36001
36403
|
};
|
|
36002
36404
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
36003
36405
|
exports.WorkflowsApi = exports.VehicleTypeConsts = exports.VehicleCategoryConsts = exports.VehicleGroup = exports.VehiclesApi = exports.AbortUtils = exports.UsersApi = exports.UserGroupValues = exports.UserGroupTypes = exports.UploadApi = exports.UploadConsts = exports.TasksExplorerApi = exports.TaskRejectReasonsApi = exports.TaskInventoryConsts = exports.TasksApi = exports.TaskGroupValues = exports.TaskGroupTypes = exports.TagConsts = exports.ServiceAreaApi = exports.ServiceAreaFilterGroups = exports.RunsApi = exports.RunStatus = exports.RunConsts = exports.ResourceUploadType = exports.ReasonToChangeInventory = exports.PrivilegesConsts = exports.PlannedRoutesConsts = exports.PlannedDeliveryWindowsApi = exports.RecurrenceType = exports.PlannedDeliveryWindowsFilterGroups = exports.OptimizationResultApi = exports.NotificationTypesConsts = exports.NotificationTemplateConsts = exports.LookupConsts = exports.LanguageConsts = exports.ExclusionWindowApiV2 = exports.ExclusionWindowsFilterGroups = exports.DeliveryWindowsApi = exports.DeliveryBlockConsts = exports.CrewConsts = exports.Responses = exports.ChatMessageConsts = exports.ChatConversationConsts = void 0;
|
|
36406
|
+
__exportStar(__webpack_require__(82661), exports);
|
|
36004
36407
|
__exportStar(__webpack_require__(37360), exports);
|
|
36005
36408
|
__exportStar(__webpack_require__(5655), exports);
|
|
36006
36409
|
exports.ChatConversationConsts = __importStar(__webpack_require__(44448));
|
|
@@ -38044,6 +38447,7 @@ __exportStar(__webpack_require__(63725), exports);
|
|
|
38044
38447
|
__exportStar(__webpack_require__(26383), exports);
|
|
38045
38448
|
__exportStar(__webpack_require__(11168), exports);
|
|
38046
38449
|
__exportStar(__webpack_require__(82849), exports);
|
|
38450
|
+
__exportStar(__webpack_require__(76797), exports);
|
|
38047
38451
|
__exportStar(__webpack_require__(54581), exports);
|
|
38048
38452
|
__exportStar(__webpack_require__(21434), exports);
|
|
38049
38453
|
__exportStar(__webpack_require__(30983), exports);
|
|
@@ -38060,6 +38464,7 @@ __exportStar(__webpack_require__(51837), exports);
|
|
|
38060
38464
|
__exportStar(__webpack_require__(55936), exports);
|
|
38061
38465
|
__exportStar(__webpack_require__(58466), exports);
|
|
38062
38466
|
__exportStar(__webpack_require__(14570), exports);
|
|
38467
|
+
__exportStar(__webpack_require__(47551), exports);
|
|
38063
38468
|
__exportStar(__webpack_require__(29384), exports);
|
|
38064
38469
|
__exportStar(__webpack_require__(97935), exports);
|
|
38065
38470
|
__exportStar(__webpack_require__(18980), exports);
|
|
@@ -38480,6 +38885,93 @@ var AlertDisplayCategory;
|
|
|
38480
38885
|
|
|
38481
38886
|
/***/ }),
|
|
38482
38887
|
|
|
38888
|
+
/***/ 39625:
|
|
38889
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
38890
|
+
|
|
38891
|
+
"use strict";
|
|
38892
|
+
|
|
38893
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38894
|
+
exports.ToolName = exports.ChartKind = exports.toRole = exports.Role = void 0;
|
|
38895
|
+
var Role;
|
|
38896
|
+
(function (Role) {
|
|
38897
|
+
Role["Human"] = "human";
|
|
38898
|
+
Role["Ai"] = "ai";
|
|
38899
|
+
})(Role || (exports.Role = Role = {}));
|
|
38900
|
+
var toRole = function (role) { return (role === Role.Ai || role === 'assistant' ? Role.Ai : Role.Human); };
|
|
38901
|
+
exports.toRole = toRole;
|
|
38902
|
+
var ChartKind;
|
|
38903
|
+
(function (ChartKind) {
|
|
38904
|
+
ChartKind["Bar"] = "bar";
|
|
38905
|
+
ChartKind["Line"] = "line";
|
|
38906
|
+
ChartKind["Pie"] = "pie";
|
|
38907
|
+
ChartKind["Area"] = "area";
|
|
38908
|
+
ChartKind["Scatter"] = "scatter";
|
|
38909
|
+
ChartKind["StackedBar"] = "stacked_bar";
|
|
38910
|
+
})(ChartKind || (exports.ChartKind = ChartKind = {}));
|
|
38911
|
+
var ToolName;
|
|
38912
|
+
(function (ToolName) {
|
|
38913
|
+
ToolName["CreateVisualization"] = "create_visualization";
|
|
38914
|
+
ToolName["SuggestFollowupQuestions"] = "suggest_followup_questions";
|
|
38915
|
+
})(ToolName || (exports.ToolName = ToolName = {}));
|
|
38916
|
+
//# sourceMappingURL=analyst_chat.js.map
|
|
38917
|
+
|
|
38918
|
+
/***/ }),
|
|
38919
|
+
|
|
38920
|
+
/***/ 67823:
|
|
38921
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
38922
|
+
|
|
38923
|
+
"use strict";
|
|
38924
|
+
|
|
38925
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38926
|
+
exports.AnalystFindingTag = exports.AnalystFindingSeverity = void 0;
|
|
38927
|
+
var AnalystFindingSeverity;
|
|
38928
|
+
(function (AnalystFindingSeverity) {
|
|
38929
|
+
AnalystFindingSeverity[AnalystFindingSeverity["Critical"] = 0] = "Critical";
|
|
38930
|
+
AnalystFindingSeverity[AnalystFindingSeverity["High"] = 1] = "High";
|
|
38931
|
+
AnalystFindingSeverity[AnalystFindingSeverity["Medium"] = 2] = "Medium";
|
|
38932
|
+
AnalystFindingSeverity[AnalystFindingSeverity["Low"] = 3] = "Low";
|
|
38933
|
+
})(AnalystFindingSeverity || (exports.AnalystFindingSeverity = AnalystFindingSeverity = {}));
|
|
38934
|
+
var AnalystFindingTag;
|
|
38935
|
+
(function (AnalystFindingTag) {
|
|
38936
|
+
AnalystFindingTag[AnalystFindingTag["OnTimePerformance"] = 0] = "OnTimePerformance";
|
|
38937
|
+
AnalystFindingTag[AnalystFindingTag["DeliveryCost"] = 1] = "DeliveryCost";
|
|
38938
|
+
AnalystFindingTag[AnalystFindingTag["CustomerExperience"] = 2] = "CustomerExperience";
|
|
38939
|
+
AnalystFindingTag[AnalystFindingTag["OperationalEfficiency"] = 3] = "OperationalEfficiency";
|
|
38940
|
+
AnalystFindingTag[AnalystFindingTag["OrderFulfillment"] = 4] = "OrderFulfillment";
|
|
38941
|
+
AnalystFindingTag[AnalystFindingTag["PlanReliability"] = 5] = "PlanReliability";
|
|
38942
|
+
AnalystFindingTag[AnalystFindingTag["Compliance"] = 6] = "Compliance";
|
|
38943
|
+
})(AnalystFindingTag || (exports.AnalystFindingTag = AnalystFindingTag = {}));
|
|
38944
|
+
//# sourceMappingURL=analyst_finding.js.map
|
|
38945
|
+
|
|
38946
|
+
/***/ }),
|
|
38947
|
+
|
|
38948
|
+
/***/ 76797:
|
|
38949
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
38950
|
+
|
|
38951
|
+
"use strict";
|
|
38952
|
+
|
|
38953
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
38954
|
+
if (k2 === undefined) k2 = k;
|
|
38955
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
38956
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
38957
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
38958
|
+
}
|
|
38959
|
+
Object.defineProperty(o, k2, desc);
|
|
38960
|
+
}) : (function(o, m, k, k2) {
|
|
38961
|
+
if (k2 === undefined) k2 = k;
|
|
38962
|
+
o[k2] = m[k];
|
|
38963
|
+
}));
|
|
38964
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
38965
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
38966
|
+
};
|
|
38967
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38968
|
+
exports.AnalystChat = void 0;
|
|
38969
|
+
exports.AnalystChat = __webpack_require__(39625);
|
|
38970
|
+
__exportStar(__webpack_require__(67823), exports);
|
|
38971
|
+
//# sourceMappingURL=index.js.map
|
|
38972
|
+
|
|
38973
|
+
/***/ }),
|
|
38974
|
+
|
|
38483
38975
|
/***/ 9439:
|
|
38484
38976
|
/***/ ((__unused_webpack_module, exports) => {
|
|
38485
38977
|
|
|
@@ -39471,6 +39963,7 @@ var ApplicationUuid;
|
|
|
39471
39963
|
(function (ApplicationUuid) {
|
|
39472
39964
|
ApplicationUuid["AutoAssign"] = "7083ab3d-c7de-40fd-83bb-f2c10bd0fa88";
|
|
39473
39965
|
ApplicationUuid["AAA"] = "3ecfa3f6-1a21-11e8-accf-0ed5f89f718b";
|
|
39966
|
+
ApplicationUuid["Analyst"] = "b7faf917-4441-4c2e-ada4-fa5550d9dde4";
|
|
39474
39967
|
ApplicationUuid["CustomAttributeApplication"] = "eb377388-08b9-48e2-9752-5066b4446d50";
|
|
39475
39968
|
ApplicationUuid["ActOnTriggerApp"] = "8ebe8358-62d3-11ea-bc55-0242ac130003";
|
|
39476
39969
|
ApplicationUuid["AutoBreaks"] = "9310325e-d7d5-11ea-87d0-0242ac130003";
|
|
@@ -39989,6 +40482,23 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
39989
40482
|
|
|
39990
40483
|
/***/ }),
|
|
39991
40484
|
|
|
40485
|
+
/***/ 47551:
|
|
40486
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
40487
|
+
|
|
40488
|
+
"use strict";
|
|
40489
|
+
|
|
40490
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
40491
|
+
exports.ContactPhoneSource = void 0;
|
|
40492
|
+
var ContactPhoneSource;
|
|
40493
|
+
(function (ContactPhoneSource) {
|
|
40494
|
+
ContactPhoneSource["DRIVER"] = "driver";
|
|
40495
|
+
ContactPhoneSource["MERCHANT"] = "merchant";
|
|
40496
|
+
ContactPhoneSource["MANAGED_ATTRIBUTE"] = "managed_attribute";
|
|
40497
|
+
})(ContactPhoneSource || (exports.ContactPhoneSource = ContactPhoneSource = {}));
|
|
40498
|
+
//# sourceMappingURL=contact_phone_source.js.map
|
|
40499
|
+
|
|
40500
|
+
/***/ }),
|
|
40501
|
+
|
|
39992
40502
|
/***/ 29384:
|
|
39993
40503
|
/***/ ((__unused_webpack_module, exports) => {
|
|
39994
40504
|
|
|
@@ -44007,12 +44517,14 @@ var WebhookDefinitionDisabledOrigin;
|
|
|
44007
44517
|
"use strict";
|
|
44008
44518
|
|
|
44009
44519
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
44010
|
-
exports.WebhookKey = void 0;
|
|
44520
|
+
exports.ANALYTICS_WEBHOOK_UNASSIGNED_CONDITION_VALUE = exports.ANALYTICS_WEBHOOK_CONDITION_KEY = exports.WebhookKey = void 0;
|
|
44011
44521
|
var WebhookKey;
|
|
44012
44522
|
(function (WebhookKey) {
|
|
44013
44523
|
WebhookKey["AnalyticsScheduledReportReady"] = "AnalyticsScheduledReportReady";
|
|
44014
44524
|
WebhookKey["RealtimeDriverLocation"] = "RealtimeDriverLocation";
|
|
44015
44525
|
})(WebhookKey || (exports.WebhookKey = WebhookKey = {}));
|
|
44526
|
+
exports.ANALYTICS_WEBHOOK_CONDITION_KEY = 'scheduled_report.scheduled_job_id';
|
|
44527
|
+
exports.ANALYTICS_WEBHOOK_UNASSIGNED_CONDITION_VALUE = 'unassigned';
|
|
44016
44528
|
//# sourceMappingURL=webhooks.js.map
|
|
44017
44529
|
|
|
44018
44530
|
/***/ }),
|