@bigbinary/neeto-assist-frontend 1.1.0 → 1.2.0-beta1

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 (59) hide show
  1. package/README.md +193 -41
  2. package/app/javascript/src/translations/ar.json +27 -4
  3. package/app/javascript/src/translations/bg.json +27 -4
  4. package/app/javascript/src/translations/ca.json +27 -4
  5. package/app/javascript/src/translations/cs.json +27 -4
  6. package/app/javascript/src/translations/da.json +27 -4
  7. package/app/javascript/src/translations/de.json +27 -4
  8. package/app/javascript/src/translations/en.json +6 -0
  9. package/app/javascript/src/translations/es-MX.json +27 -4
  10. package/app/javascript/src/translations/es.json +27 -4
  11. package/app/javascript/src/translations/et.json +27 -4
  12. package/app/javascript/src/translations/fi.json +27 -4
  13. package/app/javascript/src/translations/fil.json +27 -4
  14. package/app/javascript/src/translations/fr.json +27 -4
  15. package/app/javascript/src/translations/he.json +27 -4
  16. package/app/javascript/src/translations/hi.json +27 -4
  17. package/app/javascript/src/translations/hr.json +27 -4
  18. package/app/javascript/src/translations/hu.json +27 -4
  19. package/app/javascript/src/translations/id.json +27 -4
  20. package/app/javascript/src/translations/it.json +27 -4
  21. package/app/javascript/src/translations/ja.json +27 -4
  22. package/app/javascript/src/translations/ko.json +27 -4
  23. package/app/javascript/src/translations/lv.json +27 -4
  24. package/app/javascript/src/translations/nl.json +27 -4
  25. package/app/javascript/src/translations/pl.json +27 -4
  26. package/app/javascript/src/translations/pt-BR.json +27 -4
  27. package/app/javascript/src/translations/pt.json +27 -4
  28. package/app/javascript/src/translations/ro.json +27 -4
  29. package/app/javascript/src/translations/ru.json +27 -4
  30. package/app/javascript/src/translations/sk.json +27 -4
  31. package/app/javascript/src/translations/sl.json +27 -4
  32. package/app/javascript/src/translations/sv.json +27 -4
  33. package/app/javascript/src/translations/th.json +27 -4
  34. package/app/javascript/src/translations/tr.json +27 -4
  35. package/app/javascript/src/translations/uk.json +27 -4
  36. package/app/javascript/src/translations/vi.json +27 -4
  37. package/app/javascript/src/translations/zh-CN.json +27 -4
  38. package/app/javascript/src/translations/zh-TW.json +27 -4
  39. package/dist/.ready +1 -1
  40. package/dist/NeetoAssistButton.js +3 -1
  41. package/dist/NeetoAssistButton.js.map +1 -1
  42. package/dist/NeetoAssistPane.js +586 -329
  43. package/dist/NeetoAssistPane.js.map +1 -1
  44. package/dist/cjs/NeetoAssistButton.js +3 -1
  45. package/dist/cjs/NeetoAssistButton.js.map +1 -1
  46. package/dist/cjs/NeetoAssistPane.js +575 -318
  47. package/dist/cjs/NeetoAssistPane.js.map +1 -1
  48. package/dist/cjs/index.js +3 -1
  49. package/dist/cjs/index.js.map +1 -1
  50. package/dist/index.js +3 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/{useNeetoAssistStore--JwP_Upt.js → useNeetoAssistStore-InICsbe8.js} +89 -6
  53. package/dist/useNeetoAssistStore-InICsbe8.js.map +1 -0
  54. package/dist/{useNeetoAssistStore-CGEUMbes.js → useNeetoAssistStore-VaZp3268.js} +91 -4
  55. package/dist/useNeetoAssistStore-VaZp3268.js.map +1 -0
  56. package/package.json +1 -1
  57. package/types.d.ts +31 -6
  58. package/dist/useNeetoAssistStore--JwP_Upt.js.map +0 -1
  59. package/dist/useNeetoAssistStore-CGEUMbes.js.map +0 -1
package/README.md CHANGED
@@ -5,7 +5,8 @@ package. A host product, NeetoChat first, installs both to give its support reps
5
5
  It shows what NeetoAssist would reply to a visitor, answers a rep's questions about the conversation, looks things up
6
6
  in the host as that rep while it answers, and suggests actions such as assigning the conversation, which run only
7
7
  when a rep clicks. NeetoAssist never writes into the conversation by itself and never talks to the visitor: a rep
8
- decides what to send and what to do.
8
+ decides what to send and what to do. It also suggests actions of its own, in systems a workspace has connected to
9
+ it, such as saving a help article draft in NeetoKB. Those need nothing from a host and run only on a click too.
9
10
 
10
11
  The engine calls NeetoAssist's product API (`https://{subdomain}.neetoassist.com`) for the workspace the rep works
11
12
  in and passes NeetoAssist's answers through to the pane. It also answers NeetoAssist's own servers when they look
@@ -76,6 +77,9 @@ NeetoAssistEngine.configure do |config|
76
77
  # Optional, in seconds. These are the defaults.
77
78
  config.open_timeout = 2
78
79
  config.read_timeout = 10
80
+ # Optional, in seconds. How long a click on one of NeetoAssist's own actions
81
+ # waits for NeetoAssist to run it. This is the default.
82
+ config.own_action_read_timeout = 20
79
83
  # Optional. How long NeetoAssist may look things up as the rep who asked.
80
84
  # 15 minutes is the default and the most: a host can only shorten it.
81
85
  config.grant_ttl = 15.minutes
@@ -87,8 +91,13 @@ nothing, the status endpoint answers `{ "enabled": false }`, the conversation en
87
91
  endpoints answer 401.
88
92
 
89
93
  After a call times out or cannot connect, the engine's calls fail at once for 30 seconds, so a NeetoAssist that stops
90
- answering cannot tie up the host's threads. The cool off is kept in `Rails.cache`. One call is sent all the same:
91
- the report on how an action a rep applied ended, which NeetoAssist has to hear.
94
+ answering cannot tie up the host's threads. The cool off is kept in `Rails.cache`. Two calls are sent all the same,
95
+ and both only ever follow a claim NeetoAssist answered a moment before: the report on how an action a rep applied
96
+ ended, which NeetoAssist has to hear, and the click on one of
97
+ [NeetoAssist's own actions](#neetoassists-own-actions). That click waits `own_action_read_timeout` for its answer,
98
+ since NeetoAssist writes to another system meanwhile, and when no answer comes it starts no cool off. Keep
99
+ `own_action_read_timeout` inside the time the host gives a request, which rack-timeout sets to 30 seconds in a Neeto
100
+ product.
92
101
 
93
102
  ### Host adapter
94
103
 
@@ -287,7 +296,7 @@ NeetoAssist offers it to the model as `suggest_<name>` and a model takes a name
287
296
  never the model's account of it. Raise `InvalidArguments` when it cannot be done, in words NeetoAssist can act
288
297
  on. It only reads. The engine calls it when NeetoAssist suggests the action and again right before the action
289
298
  runs, since things change between a suggestion and a click. The action runs only if `preview` then still
290
- returns the title and the details the card was made from (rule 4).
299
+ returns the title, the details and the content the card was made from (rule 4).
291
300
  - `call` makes the change as `user`, the rep who clicked, and returns a sentence that says what was done. Raise
292
301
  `Failed` with a sentence when it could not be done.
293
302
 
@@ -300,13 +309,97 @@ Four rules here too:
300
309
  2. **Nothing an action does may reach the customer.** NeetoAssist must not put anything in front of a customer, so
301
310
  leave out whatever sends a message or an email, or changes what the customer sees.
302
311
  3. **Refuse in `preview` what `call` would refuse.** A rep should not get a card for something that cannot be done.
303
- 4. **Keep what changes by itself out of a card's words.** A card runs only if `preview` still returns the title and
304
- the details it returned when the card was made. If either reads differently at the click, nothing runs and the
305
- card says so, since the rep agreed to the words on the card and not to what the same arguments mean by now. So
306
- name in them what will change and for whom ("Unassign Priya Sharma", not "Unassign"), and leave out the time of
307
- day, a running count, or anything else that differs from one call to the next. `preview` runs once for
308
- NeetoAssist's servers and once in the rep's own request, and has to give the same words both times, so do not
309
- lean on what only a signed-in request sets, such as the rep's time zone, and list things in a fixed order.
312
+ 4. **Keep what changes by itself out of a card's words.** A card runs only if `preview` still returns the title,
313
+ the details and the content it returned when the card was made. If any of them reads differently at the click,
314
+ nothing runs and the card says so, since the rep agreed to the words on the card and not to what the same
315
+ arguments mean by now. So name in them what will change and for whom ("Unassign Priya Sharma", not
316
+ "Unassign"), and leave out the time of day, a running count, or anything else that differs from one call to the
317
+ next. `preview` runs once for NeetoAssist's servers and once in the rep's own request, and has to give the same
318
+ words both times, so do not lean on what only a signed-in request sets, such as the rep's time zone, and list
319
+ things in a fixed order.
320
+
321
+ #### An action that writes text, or leaves something to open
322
+
323
+ ```ruby
324
+ module NeetoAssist
325
+ module Actions
326
+ class CreateGithubIssue < NeetoAssistEngine::Action
327
+ description "Creates an issue in the workspace's GitHub repository."
328
+ label "Create GitHub issue"
329
+ param :title, :string, max_length: 256, description: "The issue's title."
330
+ param :body, :string, max_length: 8_000, description: "What is wrong and how to see it, in GitHub markdown."
331
+ writes :github_issue, :title, :body
332
+
333
+ def preview(title:, body:)
334
+ Preview.new(title: "Create a GitHub issue in #{repository.name}", details: ["Title: #{title}"], content: body)
335
+ end
336
+
337
+ def call(title:, body:)
338
+ issue = Github::IssueService.new(conversation, title:, body:, performer: user).process
339
+ Done.new(
340
+ "Created issue ##{issue.number} in #{repository.name}.", link_label: "Open the issue",
341
+ link_url: issue.url)
342
+ end
343
+ end
344
+ end
345
+ end
346
+ ```
347
+
348
+ Three things are for an action like this one. Each is optional, and an action that uses none of them works as
349
+ before.
350
+
351
+ - `writes kind, *fields` says which of the action's params are text written for people, and what kind of text it
352
+ is. A workspace can tell NeetoAssist, in NeetoAssist's settings, how it wants a kind of text written: its GitHub
353
+ issues, its help articles, its feature requests. NeetoAssist then writes these params that way before it asks for
354
+ the card, and a kind it has no guide for changes nothing. The kind is a name like `github_issue`: a lower case
355
+ letter, then letters, digits and underscores, 2 to 31 characters in all. The fields are one to five of the
356
+ action's own `:string` params. A subclass writes what its parent writes, unless it calls `writes` itself.
357
+ - A `Preview` takes a `content`: the long text the action will save or send, such as the body of the issue, in plain
358
+ text or in the light markdown the pane shows (paragraphs, `**bold**`, lists, `##` headings). At most 20,000
359
+ characters. The card shows all of it in a box under the details, since a rep reads it before clicking, and it is
360
+ part of what the card says: a click runs only if `preview` still returns the same content. Leave it out for an
361
+ action that writes nothing long.
362
+ - `call` can return a `Done` in place of a sentence, when it made something a rep can open:
363
+ `Done.new(sentence, link_label:, link_url:)`. The card then shows the link under the sentence. NeetoAssist keeps
364
+ a link with a label of 1 to 60 characters and an `http` or `https` address of at most 2,000. A link that is
365
+ anything else is left out and reported to Honeybadger, and the action is applied all the same, since by then it
366
+ has run.
367
+
368
+ #### A command for an action
369
+
370
+ A rep who types `/` in NeetoAssist's box is shown what they can ask for by name: the commands. NeetoAssist has
371
+ commands of its own for its own actions (`/fr` for a feature request, `/kb` for a help article draft), and an action
372
+ of the host's can name one:
373
+
374
+ ```ruby
375
+ module NeetoAssist
376
+ module Actions
377
+ class CreateGithubIssue < NeetoAssistEngine::Action
378
+ command "gh", title: "Create a GitHub issue",
379
+ description: "File an issue in your connected repository from this conversation."
380
+ end
381
+ end
382
+ end
383
+ ```
384
+
385
+ - The rep picks `/gh` in the menu, may add a few words (`/gh only the export part`) and sends. NeetoAssist then
386
+ works towards exactly this action and ends in its card, which runs only when the rep clicks "Apply", as every
387
+ card does. Plain words go on working: "file a GitHub issue for this" needs no command.
388
+ - The menu shows the name, the title and the description. The name is a lower case letter, then lower case
389
+ letters, digits and hyphens, at most 20 characters. The title is 1 to 60 characters and the description 1 to 160,
390
+ one line each.
391
+ - The title and the description can each be something that responds to `call`, such as
392
+ `title: -> { I18n.t("neeto_assist.actions.create_github_issue.command.title") }`. It is read whenever the action
393
+ is described, in the rep's own request, so it comes out in the language of the rep's screen, as a `label` block
394
+ does.
395
+ - A subclass has its parent's command, unless it names its own. Several actions can name the same command, which
396
+ then stands for all of them, and the menu lists it once.
397
+ - `fr` and `kb` are NeetoAssist's own. An action of the host's that names one of them stays, and NeetoAssist drops
398
+ its command.
399
+ - The pane fetches the commands with the list of runs, as often as every two seconds. For that list the engine
400
+ builds the host's tools and actions the way it does for a question, so that the menu lists exactly the commands
401
+ a question can use, and asks each of them `available?`, whether or not it names a command. So keep every
402
+ `available?` cheap: no call to another service, and as few queries as it can do with.
310
403
 
311
404
  #### What the engine does with them
312
405
 
@@ -321,11 +414,35 @@ Four rules here too:
321
414
  - a label that is not a text of at most 120 characters;
322
415
  - params over 4,000 bytes as JSON;
323
416
  - being the 25th tool or the 25th action;
324
- - for an action: a name over 56 characters, or a param called `reason`.
417
+ - for an action: a name over 56 characters, or a param called `reason`;
418
+ - for an action that `writes`: a kind whose name is not like `github_issue`, no field or more than five, or a
419
+ field that is not one of the action's own `:string` params;
420
+ - for an action that names a `command`: a name that is not like `gh`, or a title or a description that is blank
421
+ or too long.
422
+ - A `preview` without a title, or with a content over 20,000 characters, is the host's mistake too: NeetoAssist
423
+ is told nothing, no card is made, and the error goes to Honeybadger.
325
424
  - An `Action` listed among `tools` is left out: nothing that changes the host is ever run as a lookup.
326
425
  - When NeetoAssist calls a tool or a rep clicks a card, the engine finds the class by name among the same list, for
327
426
  the rep it is acting for, and asks `available?` again.
328
427
 
428
+ #### NeetoAssist's own actions
429
+
430
+ NeetoAssist has actions of its own, in the systems a workspace connects to it in NeetoAssist's settings: filing or
431
+ upvoting a feature request in NeetoEngage, saving a help article draft in NeetoKB. They need nothing from a host:
432
+ no class, no adapter method and no setup.
433
+
434
+ - With every question the engine tells NeetoAssist that it can pass a click on one of them back
435
+ (`capabilities.own_actions`), whether or not the host has tools or actions of its own. NeetoAssist offers its own
436
+ actions only to an engine that says so.
437
+ - Their cards look and work like any other card. When a rep clicks "Apply", the engine claims the action as it
438
+ claims a host's, and NeetoAssist's answer says who runs it. For one of its own, the engine asks NeetoAssist to
439
+ run it for that rep, waits `config.own_action_read_timeout`, and passes the answer to the pane.
440
+ - The host runs nothing for such a click and reports nothing. Its catalog is not even looked at, so an action of the
441
+ host's that happens to have the same name is never run in its place.
442
+ - NeetoAssist makes the change with the workspace's own connection and ends the action itself. If the engine gets
443
+ no answer in time, the rep is told that NeetoAssist cannot be reached, and the card says what became of the
444
+ action once NeetoAssist knows.
445
+
329
446
  ### The grant, and what a host trusts
330
447
 
331
448
  NeetoAssist's servers are not signed in to the host. What lets them look something up is a grant.
@@ -355,8 +472,10 @@ What a host is trusting when it installs the engine:
355
472
  grant. With both it can call the tools the host wrote, for 15 minutes after a rep asked, as that rep, on the
356
473
  conversation that rep asked about. What it can read is what those tools return, so a tool is as careful as its
357
474
  queries.
358
- - **NeetoAssist cannot change anything.** The two server endpoints only read, with writes to the database refused.
359
- An action runs only from a rep's click, in the host's own session, after `available?` said that rep may.
475
+ - **NeetoAssist cannot change anything in the host.** The two server endpoints only read, with writes to the
476
+ database refused. An action runs only from a rep's click, in the host's own session, after `available?` said that
477
+ rep may. NeetoAssist's own actions change the systems a workspace connected to NeetoAssist, never the host, and
478
+ they too run only when a rep clicks.
360
479
  - **The product token is the secret to guard.** Whoever holds it and a grant can read as that rep. A grant alone
361
480
  opens nothing, and neither does the token alone. NeetoAssist keeps a grant encrypted and erases it when it has
362
481
  answered.
@@ -377,12 +496,12 @@ NeetoAssist (`conversation_external_id`) needs nothing extra.
377
496
 
378
497
  #### The language of a lookup and a card
379
498
 
380
- A lookup's `summary` and a card's `title` and `details` are read by the rep, and NeetoAssist's servers have no
381
- screen and no language of their own. So the grant carries the language the host had set for the rep's request when
382
- they asked (`I18n.locale`), and the engine runs a call from NeetoAssist's servers inside `I18n.with_locale` with
383
- it. A language that is not among the host's `I18n.available_locales` means the host's default one. In `summary`
384
- and `preview`, use `I18n.t` as on any of the host's screens. A `label` is read when the rep asks, in the rep's own
385
- request, so a `label` block is translated too.
499
+ A lookup's `summary` and a card's `title`, `details` and `content` are read by the rep, and NeetoAssist's servers
500
+ have no screen and no language of their own. So the grant carries the language the host had set for the rep's
501
+ request when they asked (`I18n.locale`), and the engine runs a call from NeetoAssist's servers inside
502
+ `I18n.with_locale` with it. A language that is not among the host's `I18n.available_locales` means the host's
503
+ default one. In `summary` and `preview`, use `I18n.t` as on any of the host's screens. A `label` is read when the
504
+ rep asks, in the rep's own request, so a `label` block is translated too.
386
505
 
387
506
  A click on a card is the rep's own request, so `preview` then runs in the language the host has set for that
388
507
  request. For a rep who has not changed their language since they asked, that is the card's language, and the words
@@ -396,10 +515,10 @@ The pane calls these for the signed-in rep, under the mount path:
396
515
  | Endpoint | Does |
397
516
  | --- | --- |
398
517
  | `GET /neeto_assist/api/v1/status` | `200 { "enabled": true }` or `{ "enabled": false }`, for any signed-in rep. |
399
- | `GET /neeto_assist/api/v1/conversations/:conversation_id/runs` | NeetoAssist's runs for the conversation as the signed-in rep may see them, newest first: every reply suggestion, and the rep's own questions, each with the lookups it made (`steps`) and the actions it suggested (`actions`). Another rep's questions are not among them. With them come the workspace's credits: `{ "runs": [...], "credits": { "exhausted", "remaining", "buy_url" } }`. `buy_url` is `null` unless `can_buy_credits?` is true for the rep. |
518
+ | `GET /neeto_assist/api/v1/conversations/:conversation_id/runs` | NeetoAssist's runs for the conversation as the signed-in rep may see them, newest first: every reply suggestion, and the rep's own questions, each with the lookups it made (`steps`) and the actions it suggested (`actions`). Another rep's questions are not among them. With them come the workspace's credits and the commands the rep can pick in the box: `{ "runs": [...], "credits": { "exhausted", "remaining", "buy_url" }, "commands": [{ "name", "title", "description" }] }`. `buy_url` is `null` unless `can_buy_credits?` is true for the rep. |
400
519
  | `POST /neeto_assist/api/v1/conversations/:conversation_id/runs` | Asks NeetoAssist the rep's question: `{ "run": { "question": "..." } }`. The engine adds the rep's role, the tools and actions the rep may use, a grant and the `context`. |
401
520
  | `PUT /neeto_assist/api/v1/conversations/:conversation_id/runs/:run_id/feedback` | Rates a run: `{ "feedback": { "rating": "up", "note": "..." } }`. |
402
- | `POST /neeto_assist/api/v1/conversations/:conversation_id/actions/:id/apply` | Runs a suggested action as the signed-in rep. |
521
+ | `POST /neeto_assist/api/v1/conversations/:conversation_id/actions/:id/apply` | Runs a suggested action as the signed-in rep, or has NeetoAssist run one of its own for that rep. |
403
522
  | `POST /neeto_assist/api/v1/conversations/:conversation_id/actions/:id/dismiss` | Dismisses a suggested action. |
404
523
 
405
524
  - The conversation endpoints answer 404 unless `enabled?`, `find_conversation` and `can_use?` all pass.
@@ -408,6 +527,11 @@ The pane calls these for the signed-in rep, under the mount path:
408
527
  - An answer to a question is built from lookups made with the asker's access, so only the rep who asked is shown
409
528
  it. The engine tells NeetoAssist who is looking with every list (`requested_by_id`, the signed-in rep's id as
410
529
  it was sent when they asked), and NeetoAssist leaves out the questions of everyone else.
530
+ - The `commands` of the list are NeetoAssist's own, as it lists them for the workspace, then those of the host's
531
+ actions this rep is offered on this conversation, each name once. NeetoAssist's own come first and keep a name
532
+ the host names too. Only a name, a title and a description of the right shape reach the browser. A NeetoAssist
533
+ from before it had commands lists none, and the rep then gets the host's alone. If the host's part cannot be
534
+ built, the rep still gets the runs and NeetoAssist's commands, and the error goes to Honeybadger.
411
535
  - A blank question, one over 2,000 characters, or a rating other than `up` or `down` is
412
536
  `422 { "error": "invalid", "details": { ... } }`, without calling NeetoAssist.
413
537
  - NeetoAssist being down, slow, answering with a 5xx, or refusing the product token is
@@ -415,27 +539,34 @@ The pane calls these for the signed-in rep, under the mount path:
415
539
  host.
416
540
  - Any other answer from NeetoAssist passes through with its status and body, such as `404 not_found`,
417
541
  `409 disabled` or `422 invalid`.
418
- - A suggested action's `arguments` never reach the browser. The card shows the host's own `title` and `details`.
542
+ - A suggested action's `arguments` never reach the browser. The card shows the host's own `title`, `details` and
543
+ `content`.
419
544
 
420
545
  Applying an action takes these steps:
421
546
 
422
547
  1. The engine claims the action at NeetoAssist, so two clicks cannot both run it. A refusal passes through, such as
423
548
  `409 not_suggested` for an action that was applied or dismissed already, or `409 expired`.
424
- 2. It finds the action among `actions(current_user, conversation)` and asks `available?`. A rep who may not do it
549
+ 2. NeetoAssist's answer says who runs the action. One of [its own](#neetoassists-own-actions) is run by
550
+ NeetoAssist: the engine asks it to, and its answer passes through to the pane, as `200 { "action": { ... } }`,
551
+ as `422 { "error": "failed", "message": "...", "action": { ... } }`, or as a refusal. The steps below are for
552
+ the host's actions only.
553
+ 3. It finds the action among `actions(current_user, conversation)` and asks `available?`. A rep who may not do it
425
554
  gets `403 { "error": "forbidden" }`, and the action goes back to being a suggestion, since nothing ran.
426
- 3. It calls `preview` again and compares the title and the details with the card's. When they are no longer the
427
- same, nothing runs and the action fails with "This has changed since it was suggested, so nothing was done. Ask
428
- NeetoAssist again." A card with no details matches a preview with none. Otherwise it calls `call`.
429
- 4. The answer is `200 { "action": { ... } }` with the action as applied. When the action refused or broke, it is
555
+ 4. It calls `preview` again and compares the title, the details and the content with the card's. When they are no
556
+ longer the same, nothing runs and the action fails with "This has changed since it was suggested, so nothing was
557
+ done. Ask NeetoAssist again." A card with no details matches a preview with none, and so does a card with no
558
+ content. Otherwise it calls `call`.
559
+ 5. The answer is `200 { "action": { ... } }` with the action as applied. When the action refused or broke, it is
430
560
  `422 { "error": "failed", "message": "...", "action": { ... } }`. The message is the action's own sentence, or
431
561
  "Something went wrong." for an error nobody expected, which goes to Honeybadger.
432
- 5. NeetoAssist is told how it ended. If that report does not get through, the rep is still told what happened in
433
- the host, and `NeetoAssistEngine::ReportActionJob` sends the same report again from the `within_5_seconds`
434
- queue, with five retries over seven to nine and a half minutes. It carries ids, the host's sentence and who
435
- clicked, never the action's arguments. Until NeetoAssist hears, it shows the action as being applied. If it
436
- never does, it marks the action after ten minutes as one nobody could confirm. Every report names the claim it
437
- is for (`claim`, as NeetoAssist answered the claim), so a report that arrives after the rep clicked once more
438
- is not taken for the new click's.
562
+ 6. NeetoAssist is told how it ended, with the link the action ended with when `call` returned a `Done`. If that
563
+ report does not get through, the rep is still told what happened in the host, and
564
+ `NeetoAssistEngine::ReportActionJob` sends the same report again from the `within_5_seconds` queue, with five
565
+ retries over seven to nine and a half minutes. It carries ids, the host's sentence, the link and who clicked,
566
+ never the action's arguments. Until NeetoAssist hears, it shows the action as being applied. If it never does,
567
+ it marks the action after ten minutes as one nobody could confirm. Every report names the claim it is for
568
+ (`claim`, as NeetoAssist answered the claim), so a report that arrives after the rep clicked once more is not
569
+ taken for the new click's.
439
570
 
440
571
  NeetoAssist's own servers call the next two, with `Authorization: Bearer <product token>` and
441
572
  `X-Neeto-Assist-Grant: <grant>`:
@@ -443,7 +574,7 @@ NeetoAssist's own servers call the next two, with `Authorization: Bearer <produc
443
574
  | Endpoint | Body | Answer |
444
575
  | --- | --- | --- |
445
576
  | `POST /neeto_assist/api/v1/server/tool_calls` | `{ "tool": "list_teammates", "arguments": { ... }, "run_id": "..." }` | `200 { "result": ..., "summary": "3 people" }`. `summary` is `null` when the tool has none. |
446
- | `POST /neeto_assist/api/v1/server/action_previews` | `{ "name": "assign_conversation", "arguments": { ... }, "run_id": "..." }` | `200 { "preview": { "title": "Assign to Priya Sharma", "details": ["Team: Billing"] } }` |
577
+ | `POST /neeto_assist/api/v1/server/action_previews` | `{ "name": "assign_conversation", "arguments": { ... }, "run_id": "..." }` | `200 { "preview": { "title": "Assign to Priya Sharma", "details": ["Team: Billing"] } }`. The preview has a `content` too when the action's `Preview` has one. |
447
578
 
448
579
  Both only read, and neither looks at a session or a cookie. Their errors are
449
580
  `{ "error": "<code>", "message": "<a sentence, for some>" }`:
@@ -534,6 +665,16 @@ const TicketHeader = ({
534
665
  questions. It polls every 2 seconds while NeetoAssist is working on a run and every 30 seconds otherwise, and
535
666
  shows its errors inside the pane, never as a toast or an error page. A card that is being applied does not speed
536
667
  the polling up: the rep who clicked reads what became of it from the answer to the click.
668
+ - The box takes commands. A `/` as the first character opens a menu right above the box, with what this rep can ask
669
+ for by name: each row is the command (`/fr`), its title, and its description in muted text. Typing on narrows
670
+ the menu, by the name and by the words of the title. The arrow keys move the mark, Enter or Tab picks the marked
671
+ command and Escape closes the menu. A click picks too. While the menu is open Enter picks and does not send.
672
+ Picking writes the command and a space into the box (`/fr `) and leaves the cursor after it, so the rep adds a
673
+ few words or sends it as it is. The menu closes at the space after a full name, and there is none when nothing
674
+ fits. While the box is empty, "Type / for commands" stands in the place of the character count. A workspace
675
+ without commands gets no menu and no such line, and the box is the plain one it always was.
676
+ - A question that NeetoAssist read as a command shows as it was typed, with the command a little heavier than the
677
+ words after it.
537
678
  - What NeetoAssist looked up shows as a quiet list while it works: each lookup's label with a spinner, a check or a
538
679
  cross, and a few words on what it found. Once the answer is there the list folds into one line, such as "Looked at 3
539
680
  things", that opens to the same list.
@@ -544,14 +685,25 @@ const TicketHeader = ({
544
685
  done and who applied it. A card that failed says why and has no retry: the rep can ask again. A dismissed or expired
545
686
  card steps back to a muted line, and a dismissed one says who dismissed it. A card never shows the action's
546
687
  arguments or an id, and everything on it is shown as text, never as HTML.
688
+ - A card for an action that saves or sends a long text, such as the body of an issue or a help article, shows that
689
+ text too: the `content`, under the details and above the reason, as light markdown in a box about twelve lines tall
690
+ that scrolls. When the text is taller than the box, "Show all" under it opens the box all the way and "Show less"
691
+ folds it again. The rep reads what will be written before clicking "Apply". The muted line of a dismissed or
692
+ expired card leaves the content out.
693
+ - An applied card whose action ended with a link, such as "Open the issue", shows it under the sentence on what was
694
+ done. It opens in a new tab. Only an `http` or `https` address becomes a link, and its label is shown as text.
695
+ - A card for one of [NeetoAssist's own actions](#neetoassists-own-actions) looks and works the same. Its words are
696
+ written by NeetoAssist's code, and NeetoAssist makes the change when the rep clicks "Apply".
547
697
  - `onActionApplied(action)` is called once after "Apply" worked. The change was made on the server by the host's own
548
698
  code, so the page still shows what was there before: fetch the conversation again (with React Query, invalidate its
549
699
  queries), or whatever `action.name` says was changed, so the rep sees it without a reload. `action` is the applied
550
- action with `id`, `name`, `title`, `details`, `reason`, `status`, `result`, `actedBy`, `actedAt` and `expiresAt`,
551
- and never its arguments. It is not called for an action that failed or was dismissed. It is called even when the
552
- rep has opened another conversation before the answer to the click arrived. The handler called is then the one
553
- the host last gave for the conversation the action was applied on, so let a handler refresh the conversation it
554
- was given for, which need not be the one on screen any more.
700
+ action with `id`, `name`, `title`, `details`, `content`, `reason`, `runner`, `status`, `result`, `link`,
701
+ `actedBy`, `actedAt` and `expiresAt`, and never its arguments. It is not called for an action that failed or was
702
+ dismissed. It is called even when the rep has opened another conversation before the answer to the click arrived.
703
+ The handler called is then the one the host last gave for the conversation the action was applied on, so let a
704
+ handler refresh the conversation it was given for, which need not be the one on screen any more. It is called for
705
+ one of NeetoAssist's own actions too, which changed nothing in the host: `action.runner` is then `neeto_assist`,
706
+ and `action.name` is none of the host's.
555
707
  - `onUseReply(text, html)` is called when the rep clicks "Use reply". Put the reply in the composer and send
556
708
  nothing. `text` is the reply as NeetoAssist wrote it, in light markdown (paragraphs split by blank lines,
557
709
  `**bold**`, `1.` numbered and `-` bulleted lists, `##` headings). `html` is the same reply for a rich-text
@@ -5,7 +5,7 @@
5
5
  "neetoAssist": {
6
6
  "title": "نيتو أسيست",
7
7
  "beta": "بيتا",
8
- "betaNote": "يقوم نيتو أسيست بصياغة الردود من مقالات المساعدة الخاصة بك لممثليك. يعمل بجانب إعدادك الحالي أبداً ولا يكتب إلى العميل.",
8
+ "betaNote": "يقوم NeetoAssist بصياغة الردود، يبحث عن الأشياء ويقترح إجراءات لمندوبينكم. إنه لا يكتب أبداً إلى عميل، ولا يحدث أي شيء حتى يضغط مندوب على زر التقديم.",
9
9
  "askButton": "اسأل نيتو أسيست",
10
10
  "draftReady": "رد مقترح جاهز",
11
11
  "expand": "توسيع",
@@ -14,12 +14,14 @@
14
14
  "shadowNote": "العملاء لا يرون هذه المحادثة.",
15
15
  "intro": {
16
16
  "title": "مرحبًا، أنا نيتو أسيست.",
17
- "description": "عندما يكتب العميل، أقوم بصياغة رد من مقالات المساعدة الخاصة بك. اسألني أي شيء عن هذه المحادثة، أو جرب أحد هذه."
17
+ "description": "عندما يكتب العميل، أعد مسودة رد من مقالات المساعدة الخاصة بك. اسألني أي شيء عن هذه المحادثة، أو قل لي ماذا تحتاج إلى القيام به. لا يتغير شيء حتى تضغط على تقديم."
18
18
  },
19
19
  "suggestions": {
20
20
  "summarize": "تلخيص هذه المحادثة",
21
21
  "whatToReply": "ماذا أجب؟",
22
- "whatToCheck": "ماذا يجب أن أتحقق أولاً؟"
22
+ "whatToCheck": "ماذا يجب أن أتحقق أولاً؟",
23
+ "writtenBefore": "هل كتب هذا العميل من قبل؟",
24
+ "whatNext": "ماذا يجب أن أفعل بعد ذلك؟"
23
25
  },
24
26
  "run": {
25
27
  "repAsked": "{{name, anyCase}} سأل",
@@ -64,7 +66,7 @@
64
66
  "ratedNotHelpful": "{{name, anyCase}} وجد ذلك غير مفيد"
65
67
  },
66
68
  "ask": {
67
- "placeholder": "اسأل عن هذه المحادثة...",
69
+ "placeholder": "اسأل أي شيء، أو قل ما تحتاج إلى القيام به",
68
70
  "submit": "إرسال إلى نيتو أسيست"
69
71
  },
70
72
  "errors": {
@@ -73,6 +75,27 @@
73
75
  "notFound": "نيتو أسيست غير متوفر لهذه المحادثة.",
74
76
  "invalid": "لم يتمكن نيتو أسيست من أخذ ذلك. تحقق منه وحاول مرة أخرى.",
75
77
  "generic": "حدث شيء خاطئ مع نيتو أسيست. حاول مرة أخرى."
78
+ },
79
+ "lookingAt": "تنظر إلى {{label, anyCase}}",
80
+ "steps": {
81
+ "lookedAt_one": "تم النظر إلى {{count}} شيئ",
82
+ "lookedAt_other": "تم النظر إلى {{count}} أشياء",
83
+ "completed": "تم",
84
+ "failed": "فشل"
85
+ },
86
+ "actions": {
87
+ "apply": "تقديم",
88
+ "dismiss": "رفض",
89
+ "applying": "يتم التقديم...",
90
+ "applied": "تم التقديم",
91
+ "by": "بواسطة {{name, anyCase}}",
92
+ "failed": "لم يمكن تنفيذ هذا.",
93
+ "dismissed": "تم الرفض",
94
+ "expired": "منتهي",
95
+ "errors": {
96
+ "forbidden": "ليس لديك إذن للقيام بذلك. اطلب من مسؤول.",
97
+ "unavailable": "لا يمكن الوصول إلى NeetoAssist الآن. حاول مرة أخرى بعد قليل."
98
+ }
76
99
  }
77
100
  }
78
101
  }
@@ -5,7 +5,7 @@
5
5
  "neetoAssist": {
6
6
  "title": "NeetoAssist",
7
7
  "beta": "БЕТА",
8
- "betaNote": "NeetoAssist разработва отговори от вашите помощни статии за вашите представители. Работи до вашата текуща настройка и никога не пише на клиент.",
8
+ "betaNote": "NeetoAssist изготвя отговори, търси неща и предлага действия за вашите представители. Никога не пише на клиент и нищо не се променя, докато представителят не кликне.",
9
9
  "askButton": "Попитайте NeetoAssist",
10
10
  "draftReady": "Предложен отговор е готов",
11
11
  "expand": "Разширяване",
@@ -14,12 +14,14 @@
14
14
  "shadowNote": "Клиентите никога не виждат този чат.",
15
15
  "intro": {
16
16
  "title": "Здравейте, аз съм NeetoAssist.",
17
- "description": "Когато клиентът пише, аз изготвям отговор от вашите помощни статии. Попитайте ме всичко за този разговор или опитайте едно от тези."
17
+ "description": "Когато клиентът пише, аз изготвям отговор от вашите помощни статии. Попитайте ме всичко за този разговор или кажете какво искате да бъде направено. Нищо не се променя, докато не кликнете Прилагане."
18
18
  },
19
19
  "suggestions": {
20
20
  "summarize": "Обобщи този разговор",
21
21
  "whatToReply": "Какво трябва да отговоря?",
22
- "whatToCheck": "Какво трябва да проверя първо?"
22
+ "whatToCheck": "Какво трябва да проверя първо?",
23
+ "writtenBefore": "Писал ли е този клиент преди?",
24
+ "whatNext": "Какво трябва да направя след това?"
23
25
  },
24
26
  "run": {
25
27
  "repAsked": "{{name, anyCase}} попита",
@@ -64,7 +66,7 @@
64
66
  "ratedNotHelpful": "{{name, anyCase}} намери това не полезно"
65
67
  },
66
68
  "ask": {
67
- "placeholder": "Запитайте за този разговор...",
69
+ "placeholder": "Попитайте нещо или кажете какво искате да бъде направено",
68
70
  "submit": "Изпрати на NeetoAssist"
69
71
  },
70
72
  "errors": {
@@ -73,6 +75,27 @@
73
75
  "notFound": "NeetoAssist не е наличен за този разговор.",
74
76
  "invalid": "NeetoAssist не можа да приеме това. Проверете и опитайте отново.",
75
77
  "generic": "Нещо се обърка с NeetoAssist. Опитайте отново."
78
+ },
79
+ "lookingAt": "Гледам на {{label, anyCase}}",
80
+ "steps": {
81
+ "lookedAt_one": "Гледах на {{count}} нещо",
82
+ "lookedAt_other": "Гледах на {{count}} неща",
83
+ "completed": "Готово",
84
+ "failed": "Неуспешно"
85
+ },
86
+ "actions": {
87
+ "apply": "Приложи",
88
+ "dismiss": "Отхвърли",
89
+ "applying": "Приложение...",
90
+ "applied": "Приложено",
91
+ "by": "от {{name, anyCase}}",
92
+ "failed": "Това не можа да бъде направено.",
93
+ "dismissed": "Отхвърлено",
94
+ "expired": "Изтекло",
95
+ "errors": {
96
+ "forbidden": "Нямате разрешение да направите това. Попитайте администратор.",
97
+ "unavailable": "NeetoAssist не може да бъде достигнат в момента. Опитайте отново след малко."
98
+ }
76
99
  }
77
100
  }
78
101
  }
@@ -5,7 +5,7 @@
5
5
  "neetoAssist": {
6
6
  "title": "NeetoAssist",
7
7
  "beta": "BETA",
8
- "betaNote": "NeetoAssist redacta respostes dels teus articles d'ajuda per als teus agents. Funciona al costat de la teva configuració actual i mai escriu a un client.",
8
+ "betaNote": "NeetoAssist redacta respostes, busca informació i suggereix accions per als teus representants. Mai escriu a un client, i res no canvia fins que un representant fa clic.",
9
9
  "askButton": "Preguntar a NeetoAssist",
10
10
  "draftReady": "Una resposta suggerida està a punt",
11
11
  "expand": "Expandir",
@@ -14,12 +14,14 @@
14
14
  "shadowNote": "Els clients mai veuen aquesta conversa.",
15
15
  "intro": {
16
16
  "title": "Hola, sóc NeetoAssist.",
17
- "description": "Quan el client escriu, redacto una resposta dels teus articles d'ajuda. Pregunta'm qualsevol cosa sobre aquesta conversa, o prova una d'aquestes."
17
+ "description": "Cuando el cliente escribe, redacto una respuesta a partir dels teus articles d'ajuda. Pregunta'm qualsevol cosa sobre aquesta conversa o digues-me què necessites fer. Res no canvia fins que facis clic a Aplicar."
18
18
  },
19
19
  "suggestions": {
20
20
  "summarize": "Resumir aquesta conversa",
21
21
  "whatToReply": "Què hauria de respondre?",
22
- "whatToCheck": "Què hauria de comprovar primer?"
22
+ "whatToCheck": "Què hauria de comprovar primer?",
23
+ "writtenBefore": "Ha escrit aquest client anteriorment?",
24
+ "whatNext": "Què haig de fer a continuació?"
23
25
  },
24
26
  "run": {
25
27
  "repAsked": "{{name, anyCase}} va preguntar",
@@ -64,7 +66,7 @@
64
66
  "ratedNotHelpful": "{{name, anyCase}} va trobar això no útil"
65
67
  },
66
68
  "ask": {
67
- "placeholder": "Preguntar sobre aquesta conversa...",
69
+ "placeholder": "Pregunta qualsevol cosa o digues què necessites fer",
68
70
  "submit": "Enviar a NeetoAssist"
69
71
  },
70
72
  "errors": {
@@ -73,6 +75,27 @@
73
75
  "notFound": "NeetoAssist no està disponible per a aquesta conversa.",
74
76
  "invalid": "NeetoAssist no va poder acceptar això. Comprova-ho i torna-ho a intentar.",
75
77
  "generic": "Alguna cosa va anar malament amb NeetoAssist. Torna a intentar-ho."
78
+ },
79
+ "lookingAt": "Mirant {{label, anyCase}}",
80
+ "steps": {
81
+ "lookedAt_one": "S'ha mirat {{count}} cosa",
82
+ "lookedAt_other": "S'han mirat {{count}} coses",
83
+ "completed": "Fet",
84
+ "failed": "Ha fallat"
85
+ },
86
+ "actions": {
87
+ "apply": "Aplicar",
88
+ "dismiss": "Descartar",
89
+ "applying": "Aplicant...",
90
+ "applied": "Aplicat",
91
+ "by": "per {{name, anyCase}}",
92
+ "failed": "No s'ha pogut fer.",
93
+ "dismissed": "Descartat",
94
+ "expired": "Caducat",
95
+ "errors": {
96
+ "forbidden": "No tens permís per fer això. Pregunta a un administrador.",
97
+ "unavailable": "NeetoAssist no es pot accedir ara mateix. Torna a provar-ho més tard."
98
+ }
76
99
  }
77
100
  }
78
101
  }
@@ -5,7 +5,7 @@
5
5
  "neetoAssist": {
6
6
  "title": "NeetoAssist",
7
7
  "beta": "BETA",
8
- "betaNote": "NeetoAssist vytváří návrhy odpovědí z vašich článků nápovědy pro vaše zástupce. Spustí se vedle vašeho aktuálního nastavení a nikdy nepíše zákazníkovi.",
8
+ "betaNote": "NeetoAssist navrhuje odpovědi, vyhledává informace a navrhuje akce pro vaše zástupce. Nikdy nepíše zákazníkovi, a nic se nezmění, dokud zástupce neklikne.",
9
9
  "askButton": "Zeptejte se NeetoAssist",
10
10
  "draftReady": "Návrh odpovědi je připraven",
11
11
  "expand": "Rozbalit",
@@ -14,12 +14,14 @@
14
14
  "shadowNote": "Zákazníci tuto konverzaci nikdy nevidí.",
15
15
  "intro": {
16
16
  "title": "Ahoj, já jsem NeetoAssist.",
17
- "description": "Když zákazník píše, vytvářím odpověď z vašich článků nápovědy. Zeptejte se mě na cokoliv ohledně této konverzace, nebo zkuste jednu z těchto možností."
17
+ "description": "Když zákazník napíše, připravím odpověď podle vašich pomocných článků. Zeptejte se mě na cokoliv ohledně této konverzace, nebo mi řekněte, co potřebujete udělat. Nic se nezmění, dokud nekliknete na Použít."
18
18
  },
19
19
  "suggestions": {
20
20
  "summarize": "Shrnout tuto konverzaci",
21
21
  "whatToReply": "Co bych měl odpovědět?",
22
- "whatToCheck": "Co bych měl nejprve zkontrolovat?"
22
+ "whatToCheck": "Co bych měl nejprve zkontrolovat?",
23
+ "writtenBefore": "Psali už tento zákazník předtím?",
24
+ "whatNext": "Co bych měl dělat dál?"
23
25
  },
24
26
  "run": {
25
27
  "repAsked": "{{name, anyCase}} se ptal",
@@ -64,7 +66,7 @@
64
66
  "ratedNotHelpful": "{{name, anyCase}} to považoval za neužitečné"
65
67
  },
66
68
  "ask": {
67
- "placeholder": "Zeptejte se na tuto konverzaci...",
69
+ "placeholder": "Zeptejte se na cokoliv, nebo řekněte, co potřebujete udělat",
68
70
  "submit": "Odeslat do NeetoAssist"
69
71
  },
70
72
  "errors": {
@@ -73,6 +75,27 @@
73
75
  "notFound": "NeetoAssist není pro tuto konverzaci dostupný.",
74
76
  "invalid": "NeetoAssist to nemohl přijmout. Zkontrolujte to a zkuste to znovu.",
75
77
  "generic": "Něco se pokazilo s NeetoAssist. Zkuste to znovu."
78
+ },
79
+ "lookingAt": "Dívám se na {{label, anyCase}}",
80
+ "steps": {
81
+ "lookedAt_one": "Díval se na {{count}} věc",
82
+ "lookedAt_other": "Díval se na {{count}} věcí",
83
+ "completed": "Hotovo",
84
+ "failed": "Nebyl úspěšný"
85
+ },
86
+ "actions": {
87
+ "apply": "Použít",
88
+ "dismiss": "Zamítnout",
89
+ "applying": "Aplikuji...",
90
+ "applied": "Aplikováno",
91
+ "by": "od {{name, anyCase}}",
92
+ "failed": "Toto se nepodařilo provést.",
93
+ "dismissed": "Zamítnuto",
94
+ "expired": "Vypršelo",
95
+ "errors": {
96
+ "forbidden": "Nemáte oprávnění to provést. Zeptejte se administrátora.",
97
+ "unavailable": "NeetoAssist není momentálně k dispozici. Zkuste to znovu za chvíli."
98
+ }
76
99
  }
77
100
  }
78
101
  }