@bigbinary/neeto-assist-frontend 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +430 -21
  2. package/app/javascript/src/translations/en.json +39 -2
  3. package/dist/.ready +1 -1
  4. package/dist/NeetoAssistButton.js +13 -6
  5. package/dist/NeetoAssistButton.js.map +1 -1
  6. package/dist/NeetoAssistPane.js +1469 -166
  7. package/dist/NeetoAssistPane.js.map +1 -1
  8. package/dist/cjs/NeetoAssistButton.js +16 -9
  9. package/dist/cjs/NeetoAssistButton.js.map +1 -1
  10. package/dist/cjs/NeetoAssistPane.js +1491 -188
  11. package/dist/cjs/NeetoAssistPane.js.map +1 -1
  12. package/dist/cjs/index.js +11 -5
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/useNeetoAssistAssistant.js +43 -0
  15. package/dist/cjs/useNeetoAssistAssistant.js.map +1 -0
  16. package/dist/cjs/useNeetoAssistStatus.js +3 -1
  17. package/dist/cjs/useNeetoAssistStatus.js.map +1 -1
  18. package/dist/index.js +10 -5
  19. package/dist/index.js.map +1 -1
  20. package/dist/neeto_assist-COp7BR77.js +249 -0
  21. package/dist/neeto_assist-COp7BR77.js.map +1 -0
  22. package/dist/neeto_assist-D1wzZ3ou.js +219 -0
  23. package/dist/neeto_assist-D1wzZ3ou.js.map +1 -0
  24. package/dist/useNeetoAssistAssistant.js +41 -0
  25. package/dist/useNeetoAssistAssistant.js.map +1 -0
  26. package/dist/useNeetoAssistStatus.js +3 -1
  27. package/dist/useNeetoAssistStatus.js.map +1 -1
  28. package/dist/useNeetoAssistStore-Bj6niQdc.js +103 -0
  29. package/dist/useNeetoAssistStore-Bj6niQdc.js.map +1 -0
  30. package/dist/useNeetoAssistStore-Dgt8aV52.js +101 -0
  31. package/dist/useNeetoAssistStore-Dgt8aV52.js.map +1 -0
  32. package/dist/{useNeetoAssistStore-InICsbe8.js → useRunsApi-BgsICthX.js} +228 -113
  33. package/dist/useRunsApi-BgsICthX.js.map +1 -0
  34. package/dist/{useNeetoAssistStore-VaZp3268.js → useRunsApi-Rh6xXOwm.js} +232 -112
  35. package/dist/useRunsApi-Rh6xXOwm.js.map +1 -0
  36. package/package.json +4 -4
  37. package/types.d.ts +81 -8
  38. package/dist/neeto_assist-CpUBA-3Z.js +0 -135
  39. package/dist/neeto_assist-CpUBA-3Z.js.map +0 -1
  40. package/dist/neeto_assist-CznTN_YY.js +0 -157
  41. package/dist/neeto_assist-CznTN_YY.js.map +0 -1
  42. package/dist/useNeetoAssistStore-InICsbe8.js.map +0 -1
  43. package/dist/useNeetoAssistStore-VaZp3268.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -2,31 +2,37 @@
2
2
 
3
3
  var NeetoAssistButton = require('./NeetoAssistButton.js');
4
4
  var NeetoAssistPane = require('./NeetoAssistPane.js');
5
+ var useNeetoAssistAssistant = require('./useNeetoAssistAssistant.js');
5
6
  var useNeetoAssistStatus = require('./useNeetoAssistStatus.js');
6
7
  require('@babel/runtime/helpers/defineProperty');
7
8
  require('react');
8
9
  require('@bigbinary/neeto-atoms');
9
10
  require('react-i18next');
10
- require('../useNeetoAssistStore-VaZp3268.js');
11
+ require('../neeto_assist-COp7BR77.js');
11
12
  require('@babel/runtime/helpers/objectWithoutProperties');
13
+ require('axios');
14
+ require('../useRunsApi-Rh6xXOwm.js');
12
15
  require('react/jsx-runtime');
16
+ require('@babel/runtime/helpers/asyncToGenerator');
17
+ require('@babel/runtime/helpers/toConsumableArray');
18
+ require('@babel/runtime/helpers/typeof');
19
+ require('@babel/runtime/regenerator');
13
20
  require('@tanstack/react-query');
21
+ require('@bigbinary/neeto-cist');
14
22
  require('@bigbinary/neeto-commons-frontend/v2/react-utils');
15
- require('../neeto_assist-CznTN_YY.js');
16
- require('axios');
17
- require('@babel/runtime/helpers/toConsumableArray');
18
23
  require('@babel/runtime/helpers/toArray');
19
24
  require('ramda');
25
+ require('../useNeetoAssistStore-Bj6niQdc.js');
20
26
  require('@bigbinary/neeto-commons-frontend/v2/utils');
21
27
  require('zustand');
22
28
  require('@babel/runtime/helpers/slicedToArray');
23
29
  require('classnames');
24
30
  require('lucide-react');
25
- require('@bigbinary/neeto-cist');
26
31
 
27
32
 
28
33
 
29
34
  exports.NeetoAssistButton = NeetoAssistButton;
30
35
  exports.NeetoAssistPane = NeetoAssistPane;
36
+ exports.useNeetoAssistAssistant = useNeetoAssistAssistant;
31
37
  exports.useNeetoAssistStatus = useNeetoAssistStatus;
32
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var neeto_assist = require('../neeto_assist-COp7BR77.js');
4
+ var useNeetoAssistStatus = require('./useNeetoAssistStatus.js');
5
+ var useNeetoAssistStore = require('../useNeetoAssistStore-Bj6niQdc.js');
6
+ require('@babel/runtime/helpers/defineProperty');
7
+ require('@babel/runtime/helpers/objectWithoutProperties');
8
+ require('axios');
9
+ require('@tanstack/react-query');
10
+ require('@bigbinary/neeto-commons-frontend/v2/react-utils');
11
+ require('@bigbinary/neeto-commons-frontend/v2/utils');
12
+ require('zustand');
13
+
14
+ // For a host's own entry to the assistant, such as a sidebar item: whether the
15
+ // signed-in person may use it, whether the pane shows it, and the way to open
16
+ // and close it. The pane mounted in the layout shows it. Opening it takes the
17
+ // pane's place from a conversation, and a NeetoAssistButton takes it back.
18
+ var useNeetoAssistAssistant = function useNeetoAssistAssistant() {
19
+ var _useNeetoAssistStatus = useNeetoAssistStatus(),
20
+ status = _useNeetoAssistStatus.data;
21
+ var isOpen = useNeetoAssistStore.useNeetoAssistStore(function (state) {
22
+ return state.isOpen && state.mode === neeto_assist.PANE_MODES.ASSISTANT;
23
+ });
24
+ var open = useNeetoAssistStore.useNeetoAssistStore(function (state) {
25
+ return state.openAssistant;
26
+ });
27
+ var close = useNeetoAssistStore.useNeetoAssistStore(function (state) {
28
+ return state.closeAssistant;
29
+ });
30
+ var toggle = useNeetoAssistStore.useNeetoAssistStore(function (state) {
31
+ return state.toggleAssistant;
32
+ });
33
+ return {
34
+ isAvailable: (status === null || status === void 0 ? void 0 : status.assistant) === true,
35
+ isOpen: isOpen,
36
+ open: open,
37
+ close: close,
38
+ toggle: toggle
39
+ };
40
+ };
41
+
42
+ module.exports = useNeetoAssistAssistant;
43
+ //# sourceMappingURL=useNeetoAssistAssistant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNeetoAssistAssistant.js","sources":["../../app/javascript/src/hooks/useNeetoAssistAssistant.js"],"sourcesContent":["import { PANE_MODES } from \"common/constants\";\nimport useNeetoAssistStatus from \"hooks/useNeetoAssistStatus\";\nimport useNeetoAssistStore from \"stores/useNeetoAssistStore\";\n\n// For a host's own entry to the assistant, such as a sidebar item: whether the\n// signed-in person may use it, whether the pane shows it, and the way to open\n// and close it. The pane mounted in the layout shows it. Opening it takes the\n// pane's place from a conversation, and a NeetoAssistButton takes it back.\nconst useNeetoAssistAssistant = () => {\n const { data: status } = useNeetoAssistStatus();\n const isOpen = useNeetoAssistStore(\n state => state.isOpen && state.mode === PANE_MODES.ASSISTANT\n );\n const open = useNeetoAssistStore(state => state.openAssistant);\n const close = useNeetoAssistStore(state => state.closeAssistant);\n const toggle = useNeetoAssistStore(state => state.toggleAssistant);\n\n return {\n isAvailable: status?.assistant === true,\n isOpen,\n open,\n close,\n toggle,\n };\n};\n\nexport default useNeetoAssistAssistant;\n"],"names":["useNeetoAssistAssistant","_useNeetoAssistStatus","useNeetoAssistStatus","status","data","isOpen","useNeetoAssistStore","state","mode","PANE_MODES","ASSISTANT","open","openAssistant","close","closeAssistant","toggle","toggleAssistant","isAvailable","assistant"],"mappings":";;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,GAAS;AACpC,EAAA,IAAAC,qBAAA,GAAyBC,oBAAoB,EAAE;IAAjCC,MAAM,GAAAF,qBAAA,CAAZG,IAAI;AACZ,EAAA,IAAMC,MAAM,GAAGC,uCAAmB,CAChC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACF,MAAM,IAAIE,KAAK,CAACC,IAAI,KAAKC,uBAAU,CAACC,SAAS;AAAA,EAAA,CAC9D,CAAC;AACD,EAAA,IAAMC,IAAI,GAAGL,uCAAmB,CAAC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACK,aAAa;EAAA,CAAA,CAAC;AAC9D,EAAA,IAAMC,KAAK,GAAGP,uCAAmB,CAAC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACO,cAAc;EAAA,CAAA,CAAC;AAChE,EAAA,IAAMC,MAAM,GAAGT,uCAAmB,CAAC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACS,eAAe;EAAA,CAAA,CAAC;EAElE,OAAO;IACLC,WAAW,EAAE,CAAAd,MAAM,KAAA,IAAA,IAANA,MAAM,uBAANA,MAAM,CAAEe,SAAS,MAAK,IAAI;AACvCb,IAAAA,MAAM,EAANA,MAAM;AACNM,IAAAA,IAAI,EAAJA,IAAI;AACJE,IAAAA,KAAK,EAALA,KAAK;AACLE,IAAAA,MAAM,EAANA;GACD;AACH;;;;"}
@@ -1,7 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var reactQuery = require('@tanstack/react-query');
4
- var neeto_assist = require('../neeto_assist-CznTN_YY.js');
4
+ var neeto_assist = require('../neeto_assist-COp7BR77.js');
5
+ require('@babel/runtime/helpers/defineProperty');
6
+ require('@babel/runtime/helpers/objectWithoutProperties');
5
7
  require('axios');
6
8
 
7
9
  // Answers every signed-in rep with { enabled }. A failure shows nothing to the
@@ -1 +1 @@
1
- {"version":3,"file":"useNeetoAssistStatus.js","sources":["../../app/javascript/src/hooks/useNeetoAssistStatus.js"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\n\nimport neetoAssistApi from \"apis/neeto_assist\";\nimport { QUERY_KEYS } from \"common/constants\";\n\n// Answers every signed-in rep with { enabled }. A failure shows nothing to the\n// rep and leaves data empty, so the host reads it as not enabled.\nconst useNeetoAssistStatus = () =>\n useQuery({\n queryKey: [QUERY_KEYS.STATUS],\n queryFn: neetoAssistApi.fetchStatus,\n retry: false,\n });\n\nexport default useNeetoAssistStatus;\n"],"names":["useNeetoAssistStatus","useQuery","queryKey","QUERY_KEYS","STATUS","queryFn","neetoAssistApi","fetchStatus","retry"],"mappings":";;;;;;AAKA;AACA;AACA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;AAAA,EAAA,OACxBC,mBAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAE,CAACC,uBAAU,CAACC,MAAM,CAAC;IAC7BC,OAAO,EAAEC,2BAAc,CAACC,WAAW;AACnCC,IAAAA,KAAK,EAAE;AACT,GAAC,CAAC;AAAA;;;;"}
1
+ {"version":3,"file":"useNeetoAssistStatus.js","sources":["../../app/javascript/src/hooks/useNeetoAssistStatus.js"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\n\nimport neetoAssistApi from \"apis/neeto_assist\";\nimport { QUERY_KEYS } from \"common/constants\";\n\n// Answers every signed-in rep with { enabled }. A failure shows nothing to the\n// rep and leaves data empty, so the host reads it as not enabled.\nconst useNeetoAssistStatus = () =>\n useQuery({\n queryKey: [QUERY_KEYS.STATUS],\n queryFn: neetoAssistApi.fetchStatus,\n retry: false,\n });\n\nexport default useNeetoAssistStatus;\n"],"names":["useNeetoAssistStatus","useQuery","queryKey","QUERY_KEYS","STATUS","queryFn","neetoAssistApi","fetchStatus","retry"],"mappings":";;;;;;;;AAKA;AACA;AACA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;AAAA,EAAA,OACxBC,mBAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAE,CAACC,uBAAU,CAACC,MAAM,CAAC;IAC7BC,OAAO,EAAEC,2BAAc,CAACC,WAAW;AACnCC,IAAAA,KAAK,EAAE;AACT,GAAC,CAAC;AAAA;;;;"}
package/dist/index.js CHANGED
@@ -1,24 +1,29 @@
1
1
  export { default as NeetoAssistButton } from './NeetoAssistButton.js';
2
2
  export { default as NeetoAssistPane } from './NeetoAssistPane.js';
3
+ export { default as useNeetoAssistAssistant } from './useNeetoAssistAssistant.js';
3
4
  export { default as useNeetoAssistStatus } from './useNeetoAssistStatus.js';
4
5
  import '@babel/runtime/helpers/defineProperty';
5
6
  import 'react';
6
7
  import '@bigbinary/neeto-atoms';
7
8
  import 'react-i18next';
8
- import './useNeetoAssistStore-InICsbe8.js';
9
+ import './neeto_assist-D1wzZ3ou.js';
9
10
  import '@babel/runtime/helpers/objectWithoutProperties';
11
+ import 'axios';
12
+ import './useRunsApi-BgsICthX.js';
10
13
  import 'react/jsx-runtime';
14
+ import '@babel/runtime/helpers/asyncToGenerator';
15
+ import '@babel/runtime/helpers/toConsumableArray';
16
+ import '@babel/runtime/helpers/typeof';
17
+ import '@babel/runtime/regenerator';
11
18
  import '@tanstack/react-query';
19
+ import '@bigbinary/neeto-cist';
12
20
  import '@bigbinary/neeto-commons-frontend/v2/react-utils';
13
- import './neeto_assist-CpUBA-3Z.js';
14
- import 'axios';
15
- import '@babel/runtime/helpers/toConsumableArray';
16
21
  import '@babel/runtime/helpers/toArray';
17
22
  import 'ramda';
23
+ import './useNeetoAssistStore-Dgt8aV52.js';
18
24
  import '@bigbinary/neeto-commons-frontend/v2/utils';
19
25
  import 'zustand';
20
26
  import '@babel/runtime/helpers/slicedToArray';
21
27
  import 'classnames';
22
28
  import 'lucide-react';
23
- import '@bigbinary/neeto-cist';
24
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,249 @@
1
+ 'use strict';
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
+ var axios = require('axios');
6
+
7
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ var BASE_URL = "/neeto_assist/api/v1";
10
+
11
+ // The pane shows NeetoAssist's errors itself. Without these, the host's axios
12
+ // setup would raise a toast, or swap the page for an error page on a 403, 404
13
+ // or 429.
14
+ var REQUEST_OPTIONS = {
15
+ showToastr: false,
16
+ show403ErrorPage: false,
17
+ show404ErrorPage: false,
18
+ show429ErrorPage: false
19
+ };
20
+ var QUERY_KEYS = {
21
+ STATUS: "neeto-assist-status",
22
+ RUNS: "neeto-assist-runs",
23
+ ASSISTANT_THREAD: "neeto-assist-assistant-thread"
24
+ };
25
+
26
+ // What the pane shows: the conversation a NeetoAssistButton opened it on, or
27
+ // the signed-in person's own assistant. A host that never opens the assistant
28
+ // only ever has the first.
29
+ var PANE_MODES = {
30
+ CONVERSATION: "conversation",
31
+ ASSISTANT: "assistant"
32
+ };
33
+
34
+ // The engine sends at most six first questions for an empty thread.
35
+ var MAX_ASSISTANT_SUGGESTIONS = 6;
36
+ var PENDING_POLL_INTERVAL = 2000;
37
+ var IDLE_POLL_INTERVAL = 30000;
38
+ var PENDING_STATUSES = ["queued", "running"];
39
+ var RATEABLE_STATUSES = ["completed", "skipped"];
40
+
41
+ // A person stopped their ask before NeetoAssist answered it.
42
+ var STOPPED_STATUS = "stopped";
43
+
44
+ // How long a copy button shows that it copied.
45
+ var COPIED_FOR = 1500;
46
+
47
+ // The word before a source's title for what kind of thing it is, for the kinds
48
+ // that have one. A conversation's title already says it is one, as in
49
+ // "Conversation with Priya Nair on 3 November 2026", so it gets none, nor does
50
+ // a record. A lookup is named by the product it read. A map, so that only these
51
+ // kinds have a word, and no name an object has of its own, such as
52
+ // "constructor", reads as one.
53
+ var SOURCE_KIND_KEYS = new Map([["help_article", "neetoAssist.sources.helpArticle"], ["api_doc", "neetoAssist.sources.apiDoc"]]);
54
+
55
+ // The kind of a source from an older NeetoAssist, which cited nothing else.
56
+ var DEFAULT_SOURCE_KIND = "help_article";
57
+ var LOOKUP_SOURCE_KIND = "lookup";
58
+
59
+ // What became of a suggested action. NeetoAssist has the last word on an
60
+ // action in one of these: nothing a click says can be newer.
61
+ var SETTLED_ACTION_STATUSES = ["applied", "failed", "dismissed", "expired"];
62
+
63
+ // A suggestion nobody took up steps back to one muted line.
64
+ var QUIET_ACTION_STATUS_KEYS = {
65
+ dismissed: "neetoAssist.actions.dismissed",
66
+ expired: "neetoAssist.actions.expired"
67
+ };
68
+
69
+ // The skips from the workspace's quiet rules, in NeetoAssist's settings. Each
70
+ // one holds for every visitor message until something changes, such as the
71
+ // agent who owns the conversation handing it back.
72
+ var QUIET_SKIPPED_REASONS = ["assigned_to_human", "handed_off", "no_answer_cooldown"];
73
+
74
+ // These skips come from the workspace's state, not from reading the
75
+ // conversation, so there is nothing for a rep to judge.
76
+ var UNRATEABLE_SKIPPED_REASONS = ["disabled", "no_knowledge_source", "out_of_credits"].concat(QUIET_SKIPPED_REASONS);
77
+ var MAX_QUESTION_LENGTH = 2000;
78
+ var MAX_NOTE_LENGTH = 2000;
79
+
80
+ // The same widths as Neeti's pane in NeetoCal, so Neeto's assistants feel alike.
81
+ var COLLAPSED_PANE_WIDTH = "min(100vw, 400px)";
82
+ var EXPANDED_PANE_WIDTH = "min(50vw, 800px)";
83
+ var EXPANDED_STORAGE_KEY = "neetoAssist.isExpanded";
84
+ var REPLY_SUGGESTION = "reply_suggestion";
85
+ var RUN_TEST_ID = "neeto-assist-run";
86
+ var SUGGESTION_KEYS = ["neetoAssist.suggestions.summarize", "neetoAssist.suggestions.whatToReply", "neetoAssist.suggestions.writtenBefore", "neetoAssist.suggestions.whatNext"];
87
+ var SKIPPED_REASON_MESSAGE_KEYS = {
88
+ greeting: "neetoAssist.skippedReasons.greeting",
89
+ acknowledgment: "neetoAssist.skippedReasons.acknowledgment",
90
+ agent_handoff: "neetoAssist.skippedReasons.agentHandoff",
91
+ unclear: "neetoAssist.skippedReasons.unclear",
92
+ other_product: "neetoAssist.skippedReasons.otherProduct",
93
+ no_knowledge_source: "neetoAssist.skippedReasons.noKnowledgeSource",
94
+ disabled: "neetoAssist.skippedReasons.disabled",
95
+ no_question: "neetoAssist.skippedReasons.noQuestion",
96
+ out_of_credits: "neetoAssist.skippedReasons.outOfCredits",
97
+ assigned_to_human: "neetoAssist.skippedReasons.assignedToHuman",
98
+ handed_off: "neetoAssist.skippedReasons.handedOff",
99
+ no_answer_cooldown: "neetoAssist.skippedReasons.noAnswerCooldown"
100
+ };
101
+ var ERROR_MESSAGE_KEYS = {
102
+ 404: "neetoAssist.errors.notFound",
103
+ 409: "neetoAssist.errors.disabled",
104
+ 422: "neetoAssist.errors.invalid",
105
+ 503: "neetoAssist.errors.unavailable"
106
+ };
107
+
108
+ // The assistant is no conversation, so a 404 there says so in its own words.
109
+ var ASSISTANT_ERROR_MESSAGE_KEYS = _objectSpread$1(_objectSpread$1({}, ERROR_MESSAGE_KEYS), {}, {
110
+ 404: "neetoAssist.assistant.errors.notFound"
111
+ });
112
+
113
+ // A click on a card that changed nothing. The other answers fall back to the
114
+ // keys above.
115
+ var ACTION_ERROR_MESSAGE_KEYS = {
116
+ 403: "neetoAssist.actions.errors.forbidden",
117
+ 503: "neetoAssist.actions.errors.unavailable"
118
+ };
119
+
120
+ var _excluded = ["question", "requestId"],
121
+ _excluded2 = ["runId", "rating", "note"],
122
+ _excluded3 = ["runId"];
123
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
124
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
125
+
126
+ // Runs live on a conversation, or on one of the signed-in person's own
127
+ // assistant threads. The engine builds the thread's id at NeetoAssist from the
128
+ // session's person, so the key is all the browser sends.
129
+ var threadUrl = function threadUrl(_ref) {
130
+ var conversationId = _ref.conversationId,
131
+ threadId = _ref.threadId;
132
+ return threadId ? "".concat(BASE_URL, "/assistant/threads/").concat(encodeURIComponent(threadId)) : "".concat(BASE_URL, "/conversations/").concat(encodeURIComponent(conversationId));
133
+ };
134
+ var runsUrl = function runsUrl(where) {
135
+ return "".concat(threadUrl(where), "/runs");
136
+ };
137
+
138
+ // Cards are only ever on a conversation: an assistant thread has none.
139
+ var actionUrl = function actionUrl(_ref2) {
140
+ var conversationId = _ref2.conversationId,
141
+ actionId = _ref2.actionId;
142
+ return "".concat(BASE_URL, "/conversations/").concat(encodeURIComponent(conversationId), "/actions/").concat(encodeURIComponent(actionId));
143
+ };
144
+ var fetchStatus = function fetchStatus() {
145
+ return axios.get("".concat(BASE_URL, "/status"), REQUEST_OPTIONS);
146
+ };
147
+ var fetchAssistantThread = function fetchAssistantThread() {
148
+ return axios.get("".concat(BASE_URL, "/assistant/thread"), REQUEST_OPTIONS);
149
+ };
150
+ var createAssistantThread = function createAssistantThread() {
151
+ return axios.post("".concat(BASE_URL, "/assistant/thread"), {}, REQUEST_OPTIONS);
152
+ };
153
+ var fetchRuns = function fetchRuns(where) {
154
+ return axios.get(runsUrl(where), REQUEST_OPTIONS);
155
+ };
156
+
157
+ // The page a person asks the assistant on, read at the moment they ask, so
158
+ // NeetoAssist knows what they are looking at: the pathname and the page's
159
+ // title. Search terms and fragments can name a customer, so neither goes.
160
+ var currentPage = function currentPage() {
161
+ return {
162
+ path: globalThis.location.pathname,
163
+ title: globalThis.document.title
164
+ };
165
+ };
166
+ var createRun = function createRun(_ref3) {
167
+ var question = _ref3.question,
168
+ requestId = _ref3.requestId,
169
+ where = _objectWithoutProperties(_ref3, _excluded);
170
+ return axios.post(runsUrl(where), _objectSpread({
171
+ run: {
172
+ question: question,
173
+ request_id: requestId
174
+ }
175
+ }, where.threadId ? {
176
+ page: currentPage()
177
+ } : {}), REQUEST_OPTIONS);
178
+ };
179
+ var updateFeedback = function updateFeedback(_ref4) {
180
+ var runId = _ref4.runId,
181
+ rating = _ref4.rating,
182
+ note = _ref4.note,
183
+ where = _objectWithoutProperties(_ref4, _excluded2);
184
+ return axios.put("".concat(runsUrl(where), "/").concat(encodeURIComponent(runId), "/feedback"), {
185
+ feedback: {
186
+ rating: rating,
187
+ note: note
188
+ }
189
+ }, REQUEST_OPTIONS);
190
+ };
191
+
192
+ // Stops the person's own ask while NeetoAssist is still on it. The engine says
193
+ // who is asking, so the request names only the run.
194
+ var stopRun = function stopRun(_ref5) {
195
+ var runId = _ref5.runId,
196
+ where = _objectWithoutProperties(_ref5, _excluded3);
197
+ return axios.post("".concat(runsUrl(where), "/").concat(encodeURIComponent(runId), "/stop"), {}, REQUEST_OPTIONS);
198
+ };
199
+
200
+ // The host makes the change as the signed-in rep, so the request says only
201
+ // which action. Nothing about the change itself comes from the browser.
202
+ var applyAction = function applyAction(action) {
203
+ return axios.post("".concat(actionUrl(action), "/apply"), {}, REQUEST_OPTIONS);
204
+ };
205
+ var dismissAction = function dismissAction(action) {
206
+ return axios.post("".concat(actionUrl(action), "/dismiss"), {}, REQUEST_OPTIONS);
207
+ };
208
+ var neetoAssistApi = {
209
+ fetchStatus: fetchStatus,
210
+ fetchAssistantThread: fetchAssistantThread,
211
+ createAssistantThread: createAssistantThread,
212
+ fetchRuns: fetchRuns,
213
+ createRun: createRun,
214
+ updateFeedback: updateFeedback,
215
+ stopRun: stopRun,
216
+ applyAction: applyAction,
217
+ dismissAction: dismissAction
218
+ };
219
+
220
+ exports.ACTION_ERROR_MESSAGE_KEYS = ACTION_ERROR_MESSAGE_KEYS;
221
+ exports.ASSISTANT_ERROR_MESSAGE_KEYS = ASSISTANT_ERROR_MESSAGE_KEYS;
222
+ exports.COLLAPSED_PANE_WIDTH = COLLAPSED_PANE_WIDTH;
223
+ exports.COPIED_FOR = COPIED_FOR;
224
+ exports.DEFAULT_SOURCE_KIND = DEFAULT_SOURCE_KIND;
225
+ exports.ERROR_MESSAGE_KEYS = ERROR_MESSAGE_KEYS;
226
+ exports.EXPANDED_PANE_WIDTH = EXPANDED_PANE_WIDTH;
227
+ exports.EXPANDED_STORAGE_KEY = EXPANDED_STORAGE_KEY;
228
+ exports.IDLE_POLL_INTERVAL = IDLE_POLL_INTERVAL;
229
+ exports.LOOKUP_SOURCE_KIND = LOOKUP_SOURCE_KIND;
230
+ exports.MAX_ASSISTANT_SUGGESTIONS = MAX_ASSISTANT_SUGGESTIONS;
231
+ exports.MAX_NOTE_LENGTH = MAX_NOTE_LENGTH;
232
+ exports.MAX_QUESTION_LENGTH = MAX_QUESTION_LENGTH;
233
+ exports.PANE_MODES = PANE_MODES;
234
+ exports.PENDING_POLL_INTERVAL = PENDING_POLL_INTERVAL;
235
+ exports.PENDING_STATUSES = PENDING_STATUSES;
236
+ exports.QUERY_KEYS = QUERY_KEYS;
237
+ exports.QUIET_ACTION_STATUS_KEYS = QUIET_ACTION_STATUS_KEYS;
238
+ exports.QUIET_SKIPPED_REASONS = QUIET_SKIPPED_REASONS;
239
+ exports.RATEABLE_STATUSES = RATEABLE_STATUSES;
240
+ exports.REPLY_SUGGESTION = REPLY_SUGGESTION;
241
+ exports.RUN_TEST_ID = RUN_TEST_ID;
242
+ exports.SETTLED_ACTION_STATUSES = SETTLED_ACTION_STATUSES;
243
+ exports.SKIPPED_REASON_MESSAGE_KEYS = SKIPPED_REASON_MESSAGE_KEYS;
244
+ exports.SOURCE_KIND_KEYS = SOURCE_KIND_KEYS;
245
+ exports.STOPPED_STATUS = STOPPED_STATUS;
246
+ exports.SUGGESTION_KEYS = SUGGESTION_KEYS;
247
+ exports.UNRATEABLE_SKIPPED_REASONS = UNRATEABLE_SKIPPED_REASONS;
248
+ exports.neetoAssistApi = neetoAssistApi;
249
+ //# sourceMappingURL=neeto_assist-COp7BR77.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neeto_assist-COp7BR77.js","sources":["../app/javascript/src/common/constants.js","../app/javascript/src/apis/neeto_assist.js"],"sourcesContent":["export const BASE_URL = \"/neeto_assist/api/v1\";\n\n// The pane shows NeetoAssist's errors itself. Without these, the host's axios\n// setup would raise a toast, or swap the page for an error page on a 403, 404\n// or 429.\nexport const REQUEST_OPTIONS = {\n showToastr: false,\n show403ErrorPage: false,\n show404ErrorPage: false,\n show429ErrorPage: false,\n};\n\nexport const QUERY_KEYS = {\n STATUS: \"neeto-assist-status\",\n RUNS: \"neeto-assist-runs\",\n ASSISTANT_THREAD: \"neeto-assist-assistant-thread\",\n};\n\n// What the pane shows: the conversation a NeetoAssistButton opened it on, or\n// the signed-in person's own assistant. A host that never opens the assistant\n// only ever has the first.\nexport const PANE_MODES = {\n CONVERSATION: \"conversation\",\n ASSISTANT: \"assistant\",\n};\n\n// The engine sends at most six first questions for an empty thread.\nexport const MAX_ASSISTANT_SUGGESTIONS = 6;\n\nexport const PENDING_POLL_INTERVAL = 2_000;\n\nexport const IDLE_POLL_INTERVAL = 30_000;\n\nexport const PENDING_STATUSES = [\"queued\", \"running\"];\n\nexport const RATEABLE_STATUSES = [\"completed\", \"skipped\"];\n\n// A person stopped their ask before NeetoAssist answered it.\nexport const STOPPED_STATUS = \"stopped\";\n\n// How long a copy button shows that it copied.\nexport const COPIED_FOR = 1_500;\n\n// The word before a source's title for what kind of thing it is, for the kinds\n// that have one. A conversation's title already says it is one, as in\n// \"Conversation with Priya Nair on 3 November 2026\", so it gets none, nor does\n// a record. A lookup is named by the product it read. A map, so that only these\n// kinds have a word, and no name an object has of its own, such as\n// \"constructor\", reads as one.\nexport const SOURCE_KIND_KEYS = new Map([\n [\"help_article\", \"neetoAssist.sources.helpArticle\"],\n [\"api_doc\", \"neetoAssist.sources.apiDoc\"],\n]);\n\n// The kind of a source from an older NeetoAssist, which cited nothing else.\nexport const DEFAULT_SOURCE_KIND = \"help_article\";\n\nexport const LOOKUP_SOURCE_KIND = \"lookup\";\n\n// What became of a suggested action. NeetoAssist has the last word on an\n// action in one of these: nothing a click says can be newer.\nexport const SETTLED_ACTION_STATUSES = [\n \"applied\",\n \"failed\",\n \"dismissed\",\n \"expired\",\n];\n\n// A suggestion nobody took up steps back to one muted line.\nexport const QUIET_ACTION_STATUS_KEYS = {\n dismissed: \"neetoAssist.actions.dismissed\",\n expired: \"neetoAssist.actions.expired\",\n};\n\n// The skips from the workspace's quiet rules, in NeetoAssist's settings. Each\n// one holds for every visitor message until something changes, such as the\n// agent who owns the conversation handing it back.\nexport const QUIET_SKIPPED_REASONS = [\n \"assigned_to_human\",\n \"handed_off\",\n \"no_answer_cooldown\",\n];\n\n// These skips come from the workspace's state, not from reading the\n// conversation, so there is nothing for a rep to judge.\nexport const UNRATEABLE_SKIPPED_REASONS = [\n \"disabled\",\n \"no_knowledge_source\",\n \"out_of_credits\",\n ...QUIET_SKIPPED_REASONS,\n];\n\nexport const MAX_QUESTION_LENGTH = 2_000;\n\nexport const MAX_NOTE_LENGTH = 2_000;\n\n// The same widths as Neeti's pane in NeetoCal, so Neeto's assistants feel alike.\nexport const COLLAPSED_PANE_WIDTH = \"min(100vw, 400px)\";\n\nexport const EXPANDED_PANE_WIDTH = \"min(50vw, 800px)\";\n\nexport const EXPANDED_STORAGE_KEY = \"neetoAssist.isExpanded\";\n\nexport const REPLY_SUGGESTION = \"reply_suggestion\";\n\nexport const RUN_TEST_ID = \"neeto-assist-run\";\n\nexport const SUGGESTION_KEYS = [\n \"neetoAssist.suggestions.summarize\",\n \"neetoAssist.suggestions.whatToReply\",\n \"neetoAssist.suggestions.writtenBefore\",\n \"neetoAssist.suggestions.whatNext\",\n];\n\nexport const SKIPPED_REASON_MESSAGE_KEYS = {\n greeting: \"neetoAssist.skippedReasons.greeting\",\n acknowledgment: \"neetoAssist.skippedReasons.acknowledgment\",\n agent_handoff: \"neetoAssist.skippedReasons.agentHandoff\",\n unclear: \"neetoAssist.skippedReasons.unclear\",\n other_product: \"neetoAssist.skippedReasons.otherProduct\",\n no_knowledge_source: \"neetoAssist.skippedReasons.noKnowledgeSource\",\n disabled: \"neetoAssist.skippedReasons.disabled\",\n no_question: \"neetoAssist.skippedReasons.noQuestion\",\n out_of_credits: \"neetoAssist.skippedReasons.outOfCredits\",\n assigned_to_human: \"neetoAssist.skippedReasons.assignedToHuman\",\n handed_off: \"neetoAssist.skippedReasons.handedOff\",\n no_answer_cooldown: \"neetoAssist.skippedReasons.noAnswerCooldown\",\n};\n\nexport const ERROR_MESSAGE_KEYS = {\n 404: \"neetoAssist.errors.notFound\",\n 409: \"neetoAssist.errors.disabled\",\n 422: \"neetoAssist.errors.invalid\",\n 503: \"neetoAssist.errors.unavailable\",\n};\n\n// The assistant is no conversation, so a 404 there says so in its own words.\nexport const ASSISTANT_ERROR_MESSAGE_KEYS = {\n ...ERROR_MESSAGE_KEYS,\n 404: \"neetoAssist.assistant.errors.notFound\",\n};\n\n// A click on a card that changed nothing. The other answers fall back to the\n// keys above.\nexport const ACTION_ERROR_MESSAGE_KEYS = {\n 403: \"neetoAssist.actions.errors.forbidden\",\n 503: \"neetoAssist.actions.errors.unavailable\",\n};\n","import axios from \"axios\";\n\nimport { BASE_URL, REQUEST_OPTIONS } from \"common/constants\";\n\n// Runs live on a conversation, or on one of the signed-in person's own\n// assistant threads. The engine builds the thread's id at NeetoAssist from the\n// session's person, so the key is all the browser sends.\nconst threadUrl = ({ conversationId, threadId }) =>\n threadId\n ? `${BASE_URL}/assistant/threads/${encodeURIComponent(threadId)}`\n : `${BASE_URL}/conversations/${encodeURIComponent(conversationId)}`;\n\nconst runsUrl = where => `${threadUrl(where)}/runs`;\n\n// Cards are only ever on a conversation: an assistant thread has none.\nconst actionUrl = ({ conversationId, actionId }) =>\n `${BASE_URL}/conversations/${encodeURIComponent(\n conversationId\n )}/actions/${encodeURIComponent(actionId)}`;\n\nconst fetchStatus = () => axios.get(`${BASE_URL}/status`, REQUEST_OPTIONS);\n\nconst fetchAssistantThread = () =>\n axios.get(`${BASE_URL}/assistant/thread`, REQUEST_OPTIONS);\n\nconst createAssistantThread = () =>\n axios.post(`${BASE_URL}/assistant/thread`, {}, REQUEST_OPTIONS);\n\nconst fetchRuns = where => axios.get(runsUrl(where), REQUEST_OPTIONS);\n\n// The page a person asks the assistant on, read at the moment they ask, so\n// NeetoAssist knows what they are looking at: the pathname and the page's\n// title. Search terms and fragments can name a customer, so neither goes.\nconst currentPage = () => ({\n path: globalThis.location.pathname,\n title: globalThis.document.title,\n});\n\nconst createRun = ({ question, requestId, ...where }) =>\n axios.post(\n runsUrl(where),\n {\n run: { question, request_id: requestId },\n ...(where.threadId ? { page: currentPage() } : {}),\n },\n REQUEST_OPTIONS\n );\n\nconst updateFeedback = ({ runId, rating, note, ...where }) =>\n axios.put(\n `${runsUrl(where)}/${encodeURIComponent(runId)}/feedback`,\n { feedback: { rating, note } },\n REQUEST_OPTIONS\n );\n\n// Stops the person's own ask while NeetoAssist is still on it. The engine says\n// who is asking, so the request names only the run.\nconst stopRun = ({ runId, ...where }) =>\n axios.post(\n `${runsUrl(where)}/${encodeURIComponent(runId)}/stop`,\n {},\n REQUEST_OPTIONS\n );\n\n// The host makes the change as the signed-in rep, so the request says only\n// which action. Nothing about the change itself comes from the browser.\nconst applyAction = action =>\n axios.post(`${actionUrl(action)}/apply`, {}, REQUEST_OPTIONS);\n\nconst dismissAction = action =>\n axios.post(`${actionUrl(action)}/dismiss`, {}, REQUEST_OPTIONS);\n\nconst neetoAssistApi = {\n fetchStatus,\n fetchAssistantThread,\n createAssistantThread,\n fetchRuns,\n createRun,\n updateFeedback,\n stopRun,\n applyAction,\n dismissAction,\n};\n\nexport default neetoAssistApi;\n"],"names":["BASE_URL","REQUEST_OPTIONS","showToastr","show403ErrorPage","show404ErrorPage","show429ErrorPage","QUERY_KEYS","STATUS","RUNS","ASSISTANT_THREAD","PANE_MODES","CONVERSATION","ASSISTANT","MAX_ASSISTANT_SUGGESTIONS","PENDING_POLL_INTERVAL","IDLE_POLL_INTERVAL","PENDING_STATUSES","RATEABLE_STATUSES","STOPPED_STATUS","COPIED_FOR","SOURCE_KIND_KEYS","Map","DEFAULT_SOURCE_KIND","LOOKUP_SOURCE_KIND","SETTLED_ACTION_STATUSES","QUIET_ACTION_STATUS_KEYS","dismissed","expired","QUIET_SKIPPED_REASONS","UNRATEABLE_SKIPPED_REASONS","concat","MAX_QUESTION_LENGTH","MAX_NOTE_LENGTH","COLLAPSED_PANE_WIDTH","EXPANDED_PANE_WIDTH","EXPANDED_STORAGE_KEY","REPLY_SUGGESTION","RUN_TEST_ID","SUGGESTION_KEYS","SKIPPED_REASON_MESSAGE_KEYS","greeting","acknowledgment","agent_handoff","unclear","other_product","no_knowledge_source","disabled","no_question","out_of_credits","assigned_to_human","handed_off","no_answer_cooldown","ERROR_MESSAGE_KEYS","ASSISTANT_ERROR_MESSAGE_KEYS","_objectSpread","ACTION_ERROR_MESSAGE_KEYS","threadUrl","_ref","conversationId","threadId","encodeURIComponent","runsUrl","where","actionUrl","_ref2","actionId","fetchStatus","axios","get","fetchAssistantThread","createAssistantThread","post","fetchRuns","currentPage","path","globalThis","location","pathname","title","document","createRun","_ref3","question","requestId","_objectWithoutProperties","_excluded","run","request_id","page","updateFeedback","_ref4","runId","rating","note","_excluded2","put","feedback","stopRun","_ref5","_excluded3","applyAction","action","dismissAction","neetoAssistApi"],"mappings":";;;;;;;;AAAO,IAAMA,QAAQ,GAAG,sBAAsB;;AAE9C;AACA;AACA;AACO,IAAMC,eAAe,GAAG;AAC7BC,EAAAA,UAAU,EAAE,KAAK;AACjBC,EAAAA,gBAAgB,EAAE,KAAK;AACvBC,EAAAA,gBAAgB,EAAE,KAAK;AACvBC,EAAAA,gBAAgB,EAAE;AACpB,CAAC;AAEM,IAAMC,UAAU,GAAG;AACxBC,EAAAA,MAAM,EAAE,qBAAqB;AAC7BC,EAAAA,IAAI,EAAE,mBAAmB;AACzBC,EAAAA,gBAAgB,EAAE;AACpB;;AAEA;AACA;AACA;AACO,IAAMC,UAAU,GAAG;AACxBC,EAAAA,YAAY,EAAE,cAAc;AAC5BC,EAAAA,SAAS,EAAE;AACb;;AAEA;AACO,IAAMC,yBAAyB,GAAG;AAElC,IAAMC,qBAAqB,GAAG;AAE9B,IAAMC,kBAAkB,GAAG;IAErBC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,SAAS;IAEvCC,iBAAiB,GAAG,CAAC,WAAW,EAAE,SAAS;;AAExD;AACO,IAAMC,cAAc,GAAG;;AAE9B;AACO,IAAMC,UAAU,GAAG;;AAE1B;AACA;AACA;AACA;AACA;AACA;IACaC,gBAAgB,GAAG,IAAIC,GAAG,CAAC,CACtC,CAAC,cAAc,EAAE,iCAAiC,CAAC,EACnD,CAAC,SAAS,EAAE,4BAA4B,CA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