@newheap/platform-ai-chat 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/admin/index.d.ts +31 -2
- package/fesm2022/newheap-platform-ai-chat-admin.mjs +85 -7
- package/fesm2022/newheap-platform-ai-chat-admin.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-agent-runs.mjs +2 -2
- package/fesm2022/newheap-platform-ai-chat-agent-runs.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-testing.mjs +139 -4
- package/fesm2022/newheap-platform-ai-chat-testing.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat.mjs +138 -9
- package/fesm2022/newheap-platform-ai-chat.mjs.map +1 -1
- package/i18n/en.json +52 -3
- package/i18n/nl.json +52 -3
- package/index.d.ts +83 -4
- package/package.json +1 -1
- package/testing/index.d.ts +6 -1
|
@@ -444,7 +444,11 @@ var en = {
|
|
|
444
444
|
"assistant-consult-limit-reached": "You reached the daily number of consultations.",
|
|
445
445
|
"assistant-consult-timeout": "The agent did not answer in time.",
|
|
446
446
|
"assistant-consult-failed": "The agent could not answer.",
|
|
447
|
-
"assistant-consult-read-only": "A consultation cannot change anything."
|
|
447
|
+
"assistant-consult-read-only": "A consultation cannot change anything.",
|
|
448
|
+
"assistant-moved-to-shadow": "The work went to the agent's shadow thread, where a run in shadow takes it.",
|
|
449
|
+
"assistant-shadow-variant": "A shadow variant always works in shadow.",
|
|
450
|
+
"assistant-service-account-not-used": "This agent does not answer to a technical account.",
|
|
451
|
+
"assistant-service-account-not-found": "No account that may sign in exists with this id."
|
|
448
452
|
},
|
|
449
453
|
notices: {
|
|
450
454
|
"no-answer": "The assistant finished without an answer. Try again or rephrase your question.",
|
|
@@ -597,6 +601,49 @@ var en = {
|
|
|
597
601
|
paused: "The skill {{skill}} starts no new runs: its events wait, triage no longer chooses it and running work finishes. The other skills keep working.",
|
|
598
602
|
stopped: "The runs of the skill {{skill}} are cancelled and its waiting events dropped; its triggers are refused. The other skills keep working."
|
|
599
603
|
}
|
|
604
|
+
},
|
|
605
|
+
shadow: {
|
|
606
|
+
badge: "Shadow",
|
|
607
|
+
hint: "Its work goes to shadow threads that only administrators see.",
|
|
608
|
+
changed: "Shadow mode set by {{user}} on {{date}}.",
|
|
609
|
+
locked: "A shadow variant always works in shadow.",
|
|
610
|
+
action: {
|
|
611
|
+
shadow: "Put in shadow",
|
|
612
|
+
live: "Put live",
|
|
613
|
+
code: "Follow the code"
|
|
614
|
+
},
|
|
615
|
+
explain: {
|
|
616
|
+
shadow: "New runs work in shadow threads that only administrators see: nobody is notified and nothing proposed there executes. Running work finishes as it started; the live threads and their open proposals stay.",
|
|
617
|
+
live: "New runs work live: people see them, are notified and decide their proposals.",
|
|
618
|
+
code: "The mode in code decides again."
|
|
619
|
+
},
|
|
620
|
+
"skill-explain": {
|
|
621
|
+
shadow: "Work that reaches the skill {{skill}} goes to the shadow threads; the other skills keep their mode.",
|
|
622
|
+
live: "The skill {{skill}} works live again, unless its agent works in shadow.",
|
|
623
|
+
code: "The mode in code decides again for the skill {{skill}}."
|
|
624
|
+
},
|
|
625
|
+
confirm: {
|
|
626
|
+
shadow: "Confirm shadow",
|
|
627
|
+
live: "Confirm live",
|
|
628
|
+
code: "Confirm"
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
"service-account": {
|
|
632
|
+
label: "Technical account: {{account}}",
|
|
633
|
+
configured: "In code: {{account}}",
|
|
634
|
+
"input-label": "Account id",
|
|
635
|
+
action: {
|
|
636
|
+
set: "Change technical account",
|
|
637
|
+
code: "Use the account in code"
|
|
638
|
+
},
|
|
639
|
+
explain: {
|
|
640
|
+
set: "New runs answer to this account and use its rights. Runs that started and their proposals keep their account.",
|
|
641
|
+
code: "New runs answer to the account in code again: {{account}}."
|
|
642
|
+
},
|
|
643
|
+
confirm: {
|
|
644
|
+
set: "Confirm account",
|
|
645
|
+
code: "Confirm"
|
|
646
|
+
}
|
|
600
647
|
}
|
|
601
648
|
},
|
|
602
649
|
"agent-editor": {
|
|
@@ -917,7 +964,8 @@ var en = {
|
|
|
917
964
|
ignored: "The agent is busy; nothing was started.",
|
|
918
965
|
deduplicated: "This was already started.",
|
|
919
966
|
rejected: "The agent could not be started."
|
|
920
|
-
}
|
|
967
|
+
},
|
|
968
|
+
shadow: "Shadow thread: only administrators see it, and nothing proposed here executes."
|
|
921
969
|
},
|
|
922
970
|
subject: {
|
|
923
971
|
title: "Agent suggestions",
|
|
@@ -1006,7 +1054,8 @@ var en = {
|
|
|
1006
1054
|
trigger: "by its trigger",
|
|
1007
1055
|
rules: "by the rules",
|
|
1008
1056
|
triage: "by triage",
|
|
1009
|
-
model: "by the model"
|
|
1057
|
+
model: "by the model",
|
|
1058
|
+
"follow-up": "as the follow-up of a decision"
|
|
1010
1059
|
},
|
|
1011
1060
|
"tool-calls": "{{count}} tool calls",
|
|
1012
1061
|
tokens: "{{count}} tokens",
|
|
@@ -1395,7 +1444,11 @@ var nl = {
|
|
|
1395
1444
|
"assistant-consult-limit-reached": "Je hebt het aantal raadplegingen voor vandaag bereikt.",
|
|
1396
1445
|
"assistant-consult-timeout": "De agent antwoordde niet op tijd.",
|
|
1397
1446
|
"assistant-consult-failed": "De agent kon niet antwoorden.",
|
|
1398
|
-
"assistant-consult-read-only": "Een raadpleging kan niets wijzigen."
|
|
1447
|
+
"assistant-consult-read-only": "Een raadpleging kan niets wijzigen.",
|
|
1448
|
+
"assistant-moved-to-shadow": "Het werk is naar de schaduwthread van de agent gegaan, waar een run in schaduw het oppakt.",
|
|
1449
|
+
"assistant-shadow-variant": "Een schaduwvariant werkt altijd in schaduw.",
|
|
1450
|
+
"assistant-service-account-not-used": "Deze agent werkt niet onder een technisch account.",
|
|
1451
|
+
"assistant-service-account-not-found": "Er bestaat geen account met deze id dat mag inloggen."
|
|
1399
1452
|
},
|
|
1400
1453
|
notices: {
|
|
1401
1454
|
"no-answer": "De assistent is klaar zonder antwoord. Probeer het opnieuw of stel je vraag anders.",
|
|
@@ -1548,6 +1601,49 @@ var nl = {
|
|
|
1548
1601
|
paused: "De vaardigheid {{skill}} start geen nieuwe runs: haar gebeurtenissen wachten, triage kiest haar niet meer en lopend werk wordt afgemaakt. De andere vaardigheden werken door.",
|
|
1549
1602
|
stopped: "De runs van de vaardigheid {{skill}} worden geannuleerd en haar wachtende gebeurtenissen vervallen; haar triggers worden geweigerd. De andere vaardigheden werken door."
|
|
1550
1603
|
}
|
|
1604
|
+
},
|
|
1605
|
+
shadow: {
|
|
1606
|
+
badge: "Schaduw",
|
|
1607
|
+
hint: "Het werk gaat naar schaduwthreads die alleen beheerders zien.",
|
|
1608
|
+
changed: "Schaduwmodus ingesteld door {{user}} op {{date}}.",
|
|
1609
|
+
locked: "Een schaduwvariant werkt altijd in schaduw.",
|
|
1610
|
+
action: {
|
|
1611
|
+
shadow: "In schaduw zetten",
|
|
1612
|
+
live: "Live zetten",
|
|
1613
|
+
code: "Code laten beslissen"
|
|
1614
|
+
},
|
|
1615
|
+
explain: {
|
|
1616
|
+
shadow: "Nieuwe runs werken in schaduwthreads die alleen beheerders zien: niemand krijgt een melding en niets wat daar wordt voorgesteld, wordt uitgevoerd. Lopend werk wordt afgemaakt zoals het begon; de live threads en hun open voorstellen blijven.",
|
|
1617
|
+
live: "Nieuwe runs werken live: mensen zien ze, krijgen meldingen en beslissen over de voorstellen.",
|
|
1618
|
+
code: "De modus in de code beslist weer."
|
|
1619
|
+
},
|
|
1620
|
+
"skill-explain": {
|
|
1621
|
+
shadow: "Werk dat bij de vaardigheid {{skill}} komt, gaat naar de schaduwthreads; de andere vaardigheden houden hun modus.",
|
|
1622
|
+
live: "De vaardigheid {{skill}} werkt weer live, tenzij haar agent in schaduw werkt.",
|
|
1623
|
+
code: "De modus in de code beslist weer voor de vaardigheid {{skill}}."
|
|
1624
|
+
},
|
|
1625
|
+
confirm: {
|
|
1626
|
+
shadow: "Schaduw bevestigen",
|
|
1627
|
+
live: "Live bevestigen",
|
|
1628
|
+
code: "Bevestigen"
|
|
1629
|
+
}
|
|
1630
|
+
},
|
|
1631
|
+
"service-account": {
|
|
1632
|
+
label: "Technisch account: {{account}}",
|
|
1633
|
+
configured: "In de code: {{account}}",
|
|
1634
|
+
"input-label": "Account-id",
|
|
1635
|
+
action: {
|
|
1636
|
+
set: "Technisch account wijzigen",
|
|
1637
|
+
code: "Account uit de code gebruiken"
|
|
1638
|
+
},
|
|
1639
|
+
explain: {
|
|
1640
|
+
set: "Nieuwe runs werken onder dit account en met zijn rechten. Runs die al begonnen en hun voorstellen houden hun account.",
|
|
1641
|
+
code: "Nieuwe runs werken weer onder het account uit de code: {{account}}."
|
|
1642
|
+
},
|
|
1643
|
+
confirm: {
|
|
1644
|
+
set: "Account bevestigen",
|
|
1645
|
+
code: "Bevestigen"
|
|
1646
|
+
}
|
|
1551
1647
|
}
|
|
1552
1648
|
},
|
|
1553
1649
|
"agent-editor": {
|
|
@@ -1868,7 +1964,8 @@ var nl = {
|
|
|
1868
1964
|
ignored: "De agent is bezig; er is niets gestart.",
|
|
1869
1965
|
deduplicated: "Dit was al gestart.",
|
|
1870
1966
|
rejected: "De agent kon niet starten."
|
|
1871
|
-
}
|
|
1967
|
+
},
|
|
1968
|
+
shadow: "Schaduwthread: alleen beheerders zien hem, en niets wat hier wordt voorgesteld, wordt uitgevoerd."
|
|
1872
1969
|
},
|
|
1873
1970
|
subject: {
|
|
1874
1971
|
title: "Voorstellen van agents",
|
|
@@ -1957,7 +2054,8 @@ var nl = {
|
|
|
1957
2054
|
trigger: "door de trigger",
|
|
1958
2055
|
rules: "door de regels",
|
|
1959
2056
|
triage: "door triage",
|
|
1960
|
-
model: "door het model"
|
|
2057
|
+
model: "door het model",
|
|
2058
|
+
"follow-up": "als vervolg op een besluit"
|
|
1961
2059
|
},
|
|
1962
2060
|
"tool-calls": "{{count}} tool-aanroepen",
|
|
1963
2061
|
tokens: "{{count}} tokens",
|
|
@@ -2013,6 +2111,18 @@ function mergeTrees(base, override) {
|
|
|
2013
2111
|
}
|
|
2014
2112
|
return result;
|
|
2015
2113
|
}
|
|
2114
|
+
/**
|
|
2115
|
+
* The bundle of a language: its own, else that of its base language, so a regional tag such as
|
|
2116
|
+
* `nl-NL`, `nl_BE` or `en-GB` gets the `nl` or `en` texts, else English.
|
|
2117
|
+
*/
|
|
2118
|
+
function bundleOf(language) {
|
|
2119
|
+
for (const candidate of [language, language.split(/[-_]/)[0]].map(tag => tag.toLowerCase())) {
|
|
2120
|
+
if (Object.hasOwn(NH_ASSISTANT_TRANSLATIONS, candidate)) {
|
|
2121
|
+
return NH_ASSISTANT_TRANSLATIONS[candidate];
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
return NH_ASSISTANT_TRANSLATIONS.en;
|
|
2125
|
+
}
|
|
2016
2126
|
function hasAllKeys(bundle, candidate) {
|
|
2017
2127
|
if (!isTree(candidate)) {
|
|
2018
2128
|
return false;
|
|
@@ -2023,7 +2133,8 @@ function hasAllKeys(bundle, candidate) {
|
|
|
2023
2133
|
* Merges the bundled texts into `TranslateService` whenever the host loads or replaces a
|
|
2024
2134
|
* language. Host loaders never lose the library texts, the library never pre-empts the
|
|
2025
2135
|
* host loader, and keys the host defines under `nh-assistant.` (agent names, overrides)
|
|
2026
|
-
* win over the bundle.
|
|
2136
|
+
* win over the bundle. A regional language such as `nl-NL` receives the texts of its base
|
|
2137
|
+
* language; languages without a bundle receive the English texts.
|
|
2027
2138
|
*/
|
|
2028
2139
|
class NhAssistantTranslationMerger {
|
|
2029
2140
|
constructor() {
|
|
@@ -2051,8 +2162,7 @@ class NhAssistantTranslationMerger {
|
|
|
2051
2162
|
}
|
|
2052
2163
|
}
|
|
2053
2164
|
ensure(language, existing) {
|
|
2054
|
-
const
|
|
2055
|
-
const bundleRoot = bundle[rootKey];
|
|
2165
|
+
const bundleRoot = bundleOf(language)[rootKey];
|
|
2056
2166
|
if (hasAllKeys(bundleRoot, existing)) {
|
|
2057
2167
|
return;
|
|
2058
2168
|
}
|
|
@@ -2283,6 +2393,25 @@ class NhAssistantAdminApiService {
|
|
|
2283
2393
|
setSkillState(agentId, skillId, request) {
|
|
2284
2394
|
return this.request('POST', `admin/agents/${encodeURIComponent(agentId)}/skills/${encodeURIComponent(skillId)}/state`, request);
|
|
2285
2395
|
}
|
|
2396
|
+
/**
|
|
2397
|
+
* Puts an agent in shadow, live, or back to the mode in code. A shadow variant cannot change
|
|
2398
|
+
* (`assistant-shadow-variant`).
|
|
2399
|
+
*/
|
|
2400
|
+
setAgentShadow(agentId, request) {
|
|
2401
|
+
return this.request('POST', `admin/agents/${encodeURIComponent(agentId)}/shadow`, request);
|
|
2402
|
+
}
|
|
2403
|
+
/** Puts one skill of an agent in shadow, live, or back to the mode in code. */
|
|
2404
|
+
setSkillShadow(agentId, skillId, request) {
|
|
2405
|
+
return this.request('POST', `admin/agents/${encodeURIComponent(agentId)}/skills/${encodeURIComponent(skillId)}/shadow`, request);
|
|
2406
|
+
}
|
|
2407
|
+
/**
|
|
2408
|
+
* Changes the technical account that answers for the agent's new runs, or with `actorId: null`
|
|
2409
|
+
* uses the account in code again. Fails with `assistant-service-account-not-found` for an
|
|
2410
|
+
* account that does not exist or may not sign in.
|
|
2411
|
+
*/
|
|
2412
|
+
setServiceAccount(agentId, request) {
|
|
2413
|
+
return this.request('POST', `admin/agents/${encodeURIComponent(agentId)}/service-account`, request);
|
|
2414
|
+
}
|
|
2286
2415
|
/** Deletes an admin agent. Code agents cannot be deleted; stop them instead. */
|
|
2287
2416
|
deleteAgent(agentId) {
|
|
2288
2417
|
return this.request('DELETE', `admin/agents/${encodeURIComponent(agentId)}`);
|