@burdenoff/fe-libs 2026.1003.2 → 2026.1003.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrome/mobileTabBar/selectTabs.d.ts.map +1 -1
- package/dist/chrome/mobileTabBar/selectTabs.js +9 -8
- package/dist/chrome/sideNavigation/NavItemRenderer.d.ts.map +1 -1
- package/dist/chrome/sideNavigation/NavItemRenderer.js +62 -61
- package/dist/shared/assistant/conversation.d.ts +20 -6
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.js +43 -24
- package/dist/shared/assistant/i18nManifest.d.ts +9 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +9 -0
- package/dist/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +28 -0
- package/dist/shared/assistant/localUiCommandCopy.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.js +54 -1
- package/dist/shared/assistant/localUiCommands.d.ts +33 -3
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommands.js +110 -59
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +788 -656
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +18 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +2 -1
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts.map +1 -1
- package/dist/shared/assistant/ui/assistantOverlayState.js +1 -7
- package/dist/shared/assistant/uiActions/backStack.d.ts +35 -0
- package/dist/shared/assistant/uiActions/backStack.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/backStack.js +28 -0
- package/dist/shared/assistant/uiActions/navigateAction.d.ts +41 -0
- package/dist/shared/assistant/uiActions/navigateAction.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/navigateAction.js +40 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts +52 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.js +61 -0
- package/dist/shared/navigation/navTargetPath.d.ts +23 -0
- package/dist/shared/navigation/navTargetPath.d.ts.map +1 -0
- package/dist/shared/navigation/navTargetPath.js +6 -0
- package/dist/shared-assistant.js +19 -16
- package/package.json +1 -1
|
@@ -33,5 +33,58 @@ function c(e, t, i) {
|
|
|
33
33
|
return `${r(e ?? "", { page: a(t) })}\n\n${n.join("\n")}`;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
var l = (e) => [e("localCommand.opened", "Opened {{page}}."), "Opened {{page}}."], u = (e) => [e("localCommand.redirected", "{{page}} didn't open. You're on {{landed}} instead."), "{{page}} didn't open. You're on {{landed}} instead."], d = (e) => [e("localCommand.notOpened", "Couldn't open {{page}}."), "Couldn't open {{page}}."], f = (e) => [e("localCommand.newTab", "{{page}} opens in a separate tab. If nothing opened, use this link: {{link}}"), "{{page}} opens in a separate tab. If nothing opened, use this link: {{link}}"], p = (e) => [e("localCommand.backDone", "Back on {{page}}."), "Back on {{page}}."], m = (e) => [e("localCommand.linkNotOpenable", "I can't open that link from here."), "I can't open that link from here."], h = (e) => [e("localCommand.chooseLinked", "My last reply links more than one page. Which one?"), "My last reply links more than one page. Which one?"], g = (e) => [e("localCommand.pickFromList", "Pick one of the pages listed above."), "Pick one of the pages listed above."], _ = (e) => [e("localCommand.previousPage", "the previous page"), "the previous page"], v = (e) => [e("localCommand.anotherPage", "another page"), "another page"];
|
|
37
|
+
function y(e, t, i, o = () => ({})) {
|
|
38
|
+
let s = [t], c = Object.entries(i).map(([t, { label: n, fallback: r }]) => ({
|
|
39
|
+
name: t,
|
|
40
|
+
label: n,
|
|
41
|
+
index: n ? -1 : s.push(r(e)) - 1
|
|
42
|
+
}));
|
|
43
|
+
return n(s, (e) => {
|
|
44
|
+
let t = {};
|
|
45
|
+
for (let n of c) t[n.name] = a(n.label ? n.label : e[n.index] ?? "");
|
|
46
|
+
return r(e[0] ?? "", {
|
|
47
|
+
...t,
|
|
48
|
+
...o(t)
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function b(e, t, n) {
|
|
53
|
+
let r = {
|
|
54
|
+
label: n.page,
|
|
55
|
+
fallback: v
|
|
56
|
+
};
|
|
57
|
+
switch (t.status) {
|
|
58
|
+
case "arrived": return y(e, l(e), { page: r });
|
|
59
|
+
case "redirected": return y(e, u(e), {
|
|
60
|
+
page: r,
|
|
61
|
+
landed: {
|
|
62
|
+
label: n.landed,
|
|
63
|
+
fallback: v
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
case "new-tab": return y(e, f(e), { page: r }, ({ page: e }) => ({ link: n.path ? `[${e ?? ""}](${o(n.path)})` : e ?? "" }));
|
|
67
|
+
case "refused":
|
|
68
|
+
case "unconfirmed": return y(e, d(e), { page: r });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function x(e, t) {
|
|
72
|
+
return y(e, p(e), { page: {
|
|
73
|
+
label: t,
|
|
74
|
+
fallback: _
|
|
75
|
+
} });
|
|
76
|
+
}
|
|
77
|
+
function S(e) {
|
|
78
|
+
return n([m(e)], ([e]) => e ?? "");
|
|
79
|
+
}
|
|
80
|
+
function C(e, t) {
|
|
81
|
+
return n([h(e)], ([e]) => {
|
|
82
|
+
let n = t.map((e, t) => `${t + 1}. [${a(e.label)}](${o(e.path)})${e.context ? ` — ${a(e.context)}` : ""}`);
|
|
83
|
+
return `${e ?? ""}\n\n${n.join("\n")}`;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function w(e) {
|
|
87
|
+
return n([g(e)], ([e]) => e ?? "");
|
|
88
|
+
}
|
|
36
89
|
//#endregion
|
|
37
|
-
export { c as chooseDestinationCopy, s as navigationCommandCopy, i as themeCommandCopy };
|
|
90
|
+
export { x as backDoneCopy, c as chooseDestinationCopy, C as chooseLinkedCopy, S as linkNotOpenableCopy, s as navigationCommandCopy, b as navigationOutcomeCopy, w as pickFromListCopy, i as themeCommandCopy };
|
|
@@ -37,7 +37,13 @@ export type ThemeRequest = {
|
|
|
37
37
|
export interface LocalDestination {
|
|
38
38
|
id: string;
|
|
39
39
|
label: string;
|
|
40
|
+
/**
|
|
41
|
+
* Where the SIDEBAR takes the person (`navTargetPath`): a parent entry opens
|
|
42
|
+
* its home path or first child, not necessarily its own `path`.
|
|
43
|
+
*/
|
|
40
44
|
path: string;
|
|
45
|
+
/** The entry's own `path`, when it differs from `path` ("you are here" matches either). */
|
|
46
|
+
aliases?: string[];
|
|
41
47
|
/** The parent entry's label, shown when two destinations share a label. */
|
|
42
48
|
context?: string;
|
|
43
49
|
/** The sidebar group's id: a word a person may say ("workspace settings"), never shown. */
|
|
@@ -61,6 +67,14 @@ export type LocalUiCommand = {
|
|
|
61
67
|
*/
|
|
62
68
|
| {
|
|
63
69
|
kind: "conversation-delete";
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* ★ BOFF-8060 (R2): "go back" — undo the assistant's OWN last navigation.
|
|
73
|
+
* Only ever returned when the caller said it is runnable
|
|
74
|
+
* (`LocalUiCommandContext.backRunnable`).
|
|
75
|
+
*/
|
|
76
|
+
| {
|
|
77
|
+
kind: "back";
|
|
64
78
|
};
|
|
65
79
|
/**
|
|
66
80
|
* `canonical`, with courtesy words at either end removed, so "Could you switch
|
|
@@ -70,6 +84,7 @@ export type LocalUiCommand = {
|
|
|
70
84
|
export declare function normaliseUtterance(text: string, options?: {
|
|
71
85
|
keepEnding?: boolean;
|
|
72
86
|
}): string;
|
|
87
|
+
export declare function singularVariants(words: string): string[];
|
|
73
88
|
/** Per-product tuning of the grammar (see `AssistantProductCapabilities`). */
|
|
74
89
|
export interface LocalUiCommandOptions {
|
|
75
90
|
/**
|
|
@@ -79,19 +94,34 @@ export interface LocalUiCommandOptions {
|
|
|
79
94
|
* theme. Default `any`.
|
|
80
95
|
*/
|
|
81
96
|
themeWords?: "any" | "mode-only";
|
|
97
|
+
/**
|
|
98
|
+
* The language the sentence was typed or said in (a BCP-47 tag or the
|
|
99
|
+
* assistant's code). Plural/singular page matching (BOFF-8247) is English
|
|
100
|
+
* grammar: it applies only when this is absent or English.
|
|
101
|
+
*/
|
|
102
|
+
locale?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* What only the panel knows at the moment of sending. Optional, so every
|
|
106
|
+
* caller without one behaves exactly as v1 did.
|
|
107
|
+
*/
|
|
108
|
+
export interface LocalUiCommandContext {
|
|
109
|
+
/** "go back" can be carried out now (see `isBackRunnable`). */
|
|
110
|
+
backRunnable?: boolean;
|
|
82
111
|
}
|
|
83
112
|
/**
|
|
84
113
|
* The command this whole utterance is, or null to send it to the model.
|
|
85
114
|
* `destinations` is what the person can see in the app's navigation.
|
|
86
115
|
*/
|
|
87
|
-
export declare function matchLocalUiCommand(text: string, destinations: readonly LocalDestination[], options?: LocalUiCommandOptions): LocalUiCommand | null;
|
|
116
|
+
export declare function matchLocalUiCommand(text: string, destinations: readonly LocalDestination[], options?: LocalUiCommandOptions, context?: LocalUiCommandContext): LocalUiCommand | null;
|
|
88
117
|
/** The shape of a navigation entry this needs (`VisibleNavItem` fits it). */
|
|
89
118
|
export interface NavEntryLike {
|
|
90
119
|
id: string;
|
|
91
120
|
label: string;
|
|
92
121
|
path: string;
|
|
93
|
-
|
|
94
|
-
|
|
122
|
+
homePath?: string | undefined;
|
|
123
|
+
group?: string | undefined;
|
|
124
|
+
children?: readonly NavEntryLike[] | undefined;
|
|
95
125
|
}
|
|
96
126
|
/**
|
|
97
127
|
* Every in-app place in a navigation tree, children included. Only real
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localUiCommands.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/localUiCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"localUiCommands.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/localUiCommands.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { navTargetPath as e } from "../navigation/navTargetPath.js";
|
|
1
2
|
//#region src/shared/assistant/localUiCommands.ts
|
|
2
|
-
var
|
|
3
|
-
function
|
|
3
|
+
var t = /^(?:(?:hey|hi|so|now|and|then|you know|just|actually|basically)\b ?|(?:please|pls|kindly)\b ?|(?:can|could|would|will) (?:you|u)\b(?: please)? ?|i (?:want|would like|d like)(?: you)?(?: to)?\b ?|let s\b ?)/, n = /^(?:(?:hey|hi|so|ok|okay)\W+)*(?:please\W+)?(?:can|could|would|will) (?:you|u)\b/i, r = / (?:please|pls|for me|now|thanks|thank you|right now)$/;
|
|
4
|
+
function i(e) {
|
|
4
5
|
return e.normalize("NFKC").toLowerCase().replace(/&/g, " and ").replace(/[^\p{L}\p{N}\s]/gu, " ").replace(/\s+/g, " ").trim();
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
let a =
|
|
7
|
+
function a(e, n = {}) {
|
|
8
|
+
let a = i(e).replace(/\b(?:um+|uh+|erm|er|hmm+)\b/g, " ").replace(/\s+/g, " ").replace(/\b(\w+)(?: \1\b)+/g, "$1").trim();
|
|
8
9
|
for (;;) {
|
|
9
|
-
let
|
|
10
|
-
if (
|
|
11
|
-
a =
|
|
10
|
+
let e = a.replace(t, "");
|
|
11
|
+
if (n.keepEnding || (e = e.replace(r, "")), e = e.trim(), e === a) return a;
|
|
12
|
+
a = e;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
var
|
|
15
|
+
var o = {
|
|
15
16
|
light: {
|
|
16
17
|
kind: "family",
|
|
17
18
|
family: "light"
|
|
@@ -52,27 +53,27 @@ var a = {
|
|
|
52
53
|
kind: "named",
|
|
53
54
|
theme: "system"
|
|
54
55
|
}
|
|
55
|
-
},
|
|
56
|
-
{ pattern: RegExp(`^(?:${
|
|
57
|
-
{ pattern: RegExp(`^${
|
|
56
|
+
}, s = "(light|dark|forest|ocean|sunset|high contrast|highcontrast|system|device)", c = "(?:(?:the|my) )?(?:(?:app|ui|screen|display|interface|site) )?(?:theme|colou?r scheme|colou?r mode|appearance)", l = "(mode|theme|colou?r scheme|colou?r mode|appearance)", u = "(?:switch|change|set|turn|put|make|flip)", d = [
|
|
57
|
+
{ pattern: RegExp(`^(?:${u}(?: (?:over|back))? (?:to|into) |go (?:back )?to |(?:turn|switch) on |(?:use|enable|activate|apply|try|turn|switch|set) )?(?:(?:the|a) )?${s} ${l}(?: on)?$`) },
|
|
58
|
+
{ pattern: RegExp(`^${u} ${c} (?:to|into|back to) (?:(?:the|a) )?${s}(?: ${l})?$`) },
|
|
58
59
|
{ pattern: /^(?:switch|change|go)(?: back)? to (light|dark)()$/ },
|
|
59
60
|
{
|
|
60
|
-
pattern: RegExp(`^(?:(?:turn|switch) off|disable|deactivate|exit|leave) (?:the )?(light|dark) ${
|
|
61
|
+
pattern: RegExp(`^(?:(?:turn|switch) off|disable|deactivate|exit|leave) (?:the )?(light|dark) ${l}$`),
|
|
61
62
|
invert: !0
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
|
-
pattern: RegExp(`^(?:(?:turn|switch|set) )?(?:the )?(light|dark) ${
|
|
65
|
+
pattern: RegExp(`^(?:(?:turn|switch|set) )?(?:the )?(light|dark) ${l} off$`),
|
|
65
66
|
invert: !0
|
|
66
67
|
},
|
|
67
68
|
{ pattern: /^(?:set|make|change) (?:the |my )?(?:theme|appearance) (?:to )?(?:follow|match|use) (?:my|the) (device|system|os)()(?: (?:theme|appearance))?$/ },
|
|
68
69
|
{ pattern: /^(?:follow|match|use) (?:my|the) (device|system|os)() (?:theme|appearance)$/ },
|
|
69
70
|
{ pattern: /^(?:turn on|switch on|enable|use|activate|switch to) (?:the )?(high contrast|highcontrast)()$/ }
|
|
70
71
|
];
|
|
71
|
-
function
|
|
72
|
-
for (let { pattern: t, invert: n } of
|
|
72
|
+
function f(e) {
|
|
73
|
+
for (let { pattern: t, invert: n } of d) {
|
|
73
74
|
let r = t.exec(e);
|
|
74
75
|
if (!r) continue;
|
|
75
|
-
let i =
|
|
76
|
+
let i = o[r[1] ?? ""];
|
|
76
77
|
if (i) return i.kind === "named" && i.theme === "system" && r[2] === "mode" ? null : n ? i.kind === "family" ? {
|
|
77
78
|
kind: "family",
|
|
78
79
|
family: i.family === "dark" ? "light" : "dark"
|
|
@@ -80,63 +81,112 @@ function d(e) {
|
|
|
80
81
|
}
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
83
|
-
var
|
|
84
|
-
|
|
84
|
+
var p = /^(?:delete|remove|erase) (?:this|the|my|the current) conversation$/, m = [
|
|
85
|
+
/^go back$/,
|
|
86
|
+
/^(?:take|bring) me back$/,
|
|
87
|
+
/^(?:(?:go|take me) )?back to the (?:previous|last) (?:page|screen)$/,
|
|
88
|
+
/^(?:the )?previous page$/,
|
|
89
|
+
/^go back to where i was$/
|
|
90
|
+
], h = /^(?:(?:(?:go|navigate|take me|bring me|jump|head|get me|move|switch)(?: back| over)?|back) (?:to|too)|open(?: up)?|(?:pull|bring) up|visit|show me)\s+(.+)$/, g = /^(?:the )?(.+) (?:page|screen)$/, _ = /(?:^| )(?:tasks?|issues?|tickets?|orders?|invoices?|alerts?|requests?|jobs?|incidents?|bugs?|cases?|deals?|items?|questions?|sessions?|positions?|pull requests?|prs?|work orders?|approvals?|actions?|applications?)$/, v = /^(?:ai|a i|api|a p i|id|data|source|access|banking|graph|search|telemetry|stack|house|field|fields|space|market|mic)$/, y = / (?:page|screen|section|tab)$/;
|
|
91
|
+
function b(e) {
|
|
85
92
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
86
93
|
if (!e) return;
|
|
87
94
|
let r = t.get(e) ?? [];
|
|
88
95
|
r.some((e) => e.path === n.path) || r.push(n), t.set(e, r);
|
|
89
96
|
};
|
|
90
97
|
for (let t of e) {
|
|
91
|
-
let e =
|
|
92
|
-
n(e, t), t.context && n(`${
|
|
98
|
+
let e = i(t.label);
|
|
99
|
+
n(e, t), t.context && n(`${i(t.context)} ${e}`, t), t.group && n(`${i(t.group)} ${e}`, t);
|
|
93
100
|
}
|
|
94
101
|
for (let [e, r] of [...t]) for (let t of r) n(`\u0000${e.replace(/ /g, "")}`, t);
|
|
95
102
|
return t;
|
|
96
103
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
var x = new Set([
|
|
105
|
+
"news",
|
|
106
|
+
"series",
|
|
107
|
+
"species",
|
|
108
|
+
"lens",
|
|
109
|
+
"bus",
|
|
110
|
+
"gas",
|
|
111
|
+
"plus",
|
|
112
|
+
"this",
|
|
113
|
+
"analysis",
|
|
114
|
+
"status",
|
|
115
|
+
"campus",
|
|
116
|
+
"canvas",
|
|
117
|
+
"access",
|
|
118
|
+
"business",
|
|
119
|
+
"address",
|
|
120
|
+
"process",
|
|
121
|
+
"progress"
|
|
122
|
+
]);
|
|
123
|
+
function S(e) {
|
|
124
|
+
let t = e.split(" "), n = t.pop() ?? "";
|
|
125
|
+
if (n.length < 3) return [];
|
|
126
|
+
let r = /* @__PURE__ */ new Set();
|
|
127
|
+
return x.has(n) || (/[^aeiou]ies$/.test(n) && n.length > 4 ? r.add(`${n.slice(0, -3)}y`) : /(?:sses|shes|ches|xes|zes)$/.test(n) ? r.add(n.slice(0, -2)) : n.length >= 4 && /s$/.test(n) && !/(?:ss|us|is)$/.test(n) && r.add(n.slice(0, -1))), [...r].map((e) => [...t, e].join(" "));
|
|
128
|
+
}
|
|
129
|
+
function C(e, t, n) {
|
|
130
|
+
let r = h.exec(e) ?? g.exec(e);
|
|
131
|
+
if (!r) return null;
|
|
132
|
+
let i = r[1] ?? "", a = e.startsWith("show me "), o = /^open /.test(e), s = i.replace(/^(?:the|my|our) /, ""), c = s.replace(y, ""), l = c !== s || g.test(e);
|
|
133
|
+
if (a && !l || o && s === i && !l && (_.test(s) || v.test(s) || /^\w{1,3}$/.test(s))) return null;
|
|
134
|
+
let u = b(t), d = (e) => {
|
|
135
|
+
let t = u.get(e);
|
|
136
|
+
if (t) return {
|
|
137
|
+
key: e,
|
|
138
|
+
list: t
|
|
139
|
+
};
|
|
140
|
+
let n = `\u0000${e.replace(/ /g, "")}`, r = u.get(n);
|
|
141
|
+
return r ? {
|
|
142
|
+
key: n,
|
|
143
|
+
list: r
|
|
144
|
+
} : void 0;
|
|
145
|
+
}, f = c === s ? [s] : [s, c], p = f.reduce((e, t) => e ?? d(t), void 0);
|
|
146
|
+
if (!p && n && (p = f.flatMap(S).reduce((e, t) => e ?? d(t), void 0)), !p || p.list.length === 0) return null;
|
|
147
|
+
let m = p.list;
|
|
148
|
+
return m.length === 1 ? {
|
|
104
149
|
kind: "navigate",
|
|
105
|
-
destination:
|
|
150
|
+
destination: m[0]
|
|
106
151
|
} : {
|
|
107
152
|
kind: "choose-destination",
|
|
108
|
-
query:
|
|
109
|
-
candidates:
|
|
153
|
+
query: c,
|
|
154
|
+
candidates: m
|
|
110
155
|
};
|
|
111
156
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
|
|
157
|
+
var w = (e) => e === void 0 || /^en(?:[-_]|$)/i.test(e.trim());
|
|
158
|
+
function T(e, t, r = {}, i = {}) {
|
|
159
|
+
let o = e.normalize("NFKC").trim();
|
|
160
|
+
if (/[\p{Extended_Pictographic}\p{So}]/u.test(o) || /(?:^|\s)>?[:;=][-'^]?[()[\]/\\|pPdDoO3*@$]+(?=\s|$)/.test(o) || /(?:^|\s)(?:xD|XD|-_-|T_T|<\/?3)(?=\s|$)/.test(o) || /[?¿؟][^\p{L}\p{N}]*$/u.test(o) && !n.test(o)) return null;
|
|
161
|
+
let s = a(e);
|
|
162
|
+
if (!s || s.length > 80) return null;
|
|
163
|
+
if (p.test(s)) return { kind: "conversation-delete" };
|
|
164
|
+
let c = f(s);
|
|
165
|
+
if (c) return r.themeWords === "mode-only" && /\b(?:theme|appearance|colou?r scheme)\b/.test(s) && !/\b(?:app|ui|interface)\b/.test(s) ? null : {
|
|
120
166
|
kind: "theme",
|
|
121
|
-
request:
|
|
122
|
-
}
|
|
167
|
+
request: c
|
|
168
|
+
};
|
|
169
|
+
if (i.backRunnable && m.some((e) => e.test(s))) return { kind: "back" };
|
|
170
|
+
let l = w(r.locale);
|
|
171
|
+
return C(a(e, { keepEnding: !0 }), t, l) ?? C(s, t, l);
|
|
123
172
|
}
|
|
124
|
-
var
|
|
125
|
-
function
|
|
126
|
-
let
|
|
127
|
-
for (let
|
|
128
|
-
let
|
|
129
|
-
!
|
|
130
|
-
id:
|
|
131
|
-
label:
|
|
132
|
-
path:
|
|
133
|
-
...
|
|
134
|
-
...
|
|
135
|
-
|
|
173
|
+
var E = /^__nav_more__:/;
|
|
174
|
+
function D(t, n) {
|
|
175
|
+
let r = [];
|
|
176
|
+
for (let i of t) {
|
|
177
|
+
let t = E.test(i.id), a = e(i);
|
|
178
|
+
!t && i.path.startsWith("/") && !i.path.startsWith("//") && a.startsWith("/") && !a.startsWith("//") && i.label.trim() && r.push({
|
|
179
|
+
id: i.id,
|
|
180
|
+
label: i.label,
|
|
181
|
+
path: a,
|
|
182
|
+
...a === i.path ? {} : { aliases: [i.path] },
|
|
183
|
+
...n ? { context: n } : {},
|
|
184
|
+
...i.group ? { group: i.group } : {}
|
|
185
|
+
}), i.children?.length && r.push(...D(i.children, t ? n : i.label));
|
|
136
186
|
}
|
|
137
|
-
return
|
|
187
|
+
return r;
|
|
138
188
|
}
|
|
139
|
-
function
|
|
189
|
+
function O(e, t) {
|
|
140
190
|
return e.kind === "family" ? {
|
|
141
191
|
alreadyApplied: t.resolvedTheme === e.family,
|
|
142
192
|
mode: e.family
|
|
@@ -145,7 +195,7 @@ function C(e, t) {
|
|
|
145
195
|
mode: e.theme
|
|
146
196
|
};
|
|
147
197
|
}
|
|
148
|
-
function
|
|
198
|
+
function k(e, t) {
|
|
149
199
|
let n = (e) => {
|
|
150
200
|
let [t = ""] = e.split("#"), [n = "", r = ""] = t.split("?"), i = n.length > 1 ? n.replace(/\/+$/, "") : n, a = new URLSearchParams(r);
|
|
151
201
|
return a.sort(), {
|
|
@@ -155,10 +205,11 @@ function w(e, t) {
|
|
|
155
205
|
}, r = n(e), i = n(t);
|
|
156
206
|
return r.pathname === i.pathname ? r.query === "" || r.query === i.query : !1;
|
|
157
207
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
208
|
+
function A(e, t, n) {
|
|
209
|
+
let r = [e.path, ...e.aliases ?? []].find((e) => k(e, t));
|
|
210
|
+
return r === void 0 ? !1 : r.includes("?") ? !0 : !n.some((e) => e.path !== r && e.path.includes("?") && j(e.path, t));
|
|
160
211
|
}
|
|
161
|
-
function
|
|
212
|
+
function j(e, t) {
|
|
162
213
|
let n = (e) => {
|
|
163
214
|
let [t = ""] = e.split("#"), [n = "", r = ""] = t.split("?");
|
|
164
215
|
return {
|
|
@@ -171,4 +222,4 @@ function E(e, t) {
|
|
|
171
222
|
return !0;
|
|
172
223
|
}
|
|
173
224
|
//#endregion
|
|
174
|
-
export {
|
|
225
|
+
export { A as isAlreadyThere, k as isCurrentPath, T as matchLocalUiCommand, D as navDestinations, a as normaliseUtterance, O as planThemeChange, S as singularVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAoOf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAoOf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AA8IvE;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAmyKxD,CAAC"}
|