@burdenoff/fe-libs 2026.1004.4 → 2026.1004.6
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/ContextSwitcher.d.ts.map +1 -1
- package/dist/chrome/ContextSwitcher.js +73 -50
- package/dist/chrome/GlobalSearch.d.ts.map +1 -1
- package/dist/chrome/GlobalSearch.js +76 -72
- package/dist/chrome/LanguageSwitcher.d.ts.map +1 -1
- package/dist/chrome/LanguageSwitcher.js +61 -40
- package/dist/chrome/NotificationCenter.d.ts.map +1 -1
- package/dist/chrome/NotificationCenter.js +71 -68
- package/dist/chrome/ProfileSwitcher.d.ts.map +1 -1
- package/dist/chrome/ProfileSwitcher.js +87 -81
- package/dist/chrome/SideNavigation.d.ts.map +1 -1
- package/dist/chrome/SideNavigation.js +120 -76
- package/dist/shared/assistant/appControls/copy.d.ts +12 -0
- package/dist/shared/assistant/appControls/copy.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/copy.js +98 -0
- package/dist/shared/assistant/appControls/grammar.d.ts +102 -0
- package/dist/shared/assistant/appControls/grammar.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/grammar.js +236 -0
- package/dist/shared/assistant/appControls/languages.d.ts +6 -0
- package/dist/shared/assistant/appControls/languages.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/languages.js +52 -0
- package/dist/shared/assistant/appControls/names.d.ts +22 -0
- package/dist/shared/assistant/appControls/names.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/names.js +29 -0
- package/dist/shared/assistant/appControls/pageAdapters.d.ts +59 -0
- package/dist/shared/assistant/appControls/pageAdapters.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/pageAdapters.js +87 -0
- package/dist/shared/assistant/appControls/plan.d.ts +148 -0
- package/dist/shared/assistant/appControls/plan.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/plan.js +511 -0
- package/dist/shared/assistant/appControls/registry.d.ts +9 -0
- package/dist/shared/assistant/appControls/registry.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/registry.js +38 -0
- package/dist/shared/assistant/appControls/snapshot.d.ts +42 -0
- package/dist/shared/assistant/appControls/snapshot.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/snapshot.js +40 -0
- package/dist/shared/assistant/appControls/text.d.ts +7 -0
- package/dist/shared/assistant/appControls/text.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/text.js +6 -0
- package/dist/shared/assistant/appControls/types.d.ts +183 -0
- package/dist/shared/assistant/appControls/types.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/types.js +25 -0
- package/dist/shared/assistant/appControls/useAssistantControl.d.ts +24 -0
- package/dist/shared/assistant/appControls/useAssistantControl.d.ts.map +1 -0
- package/dist/shared/assistant/appControls/useAssistantControl.js +13 -0
- package/dist/shared/assistant/conversation.d.ts +12 -1
- 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 +130 -114
- package/dist/shared/assistant/i18nManifest.d.ts +74 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +86 -12
- package/dist/shared/assistant/index.d.ts +16 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +7 -0
- package/dist/shared/assistant/localUiCommandCopy.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.js +1 -1
- package/dist/shared/assistant/localUiCommands.d.ts +16 -0
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommands.js +92 -84
- package/dist/shared/assistant/store.d.ts +10 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +52 -44
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AIAssistantPanel.js +57 -49
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +1085 -1016
- package/dist/shared/assistant/ui/AssistantControlConfirmDialog.d.ts +38 -0
- package/dist/shared/assistant/ui/AssistantControlConfirmDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantControlConfirmDialog.js +65 -0
- package/dist/shared/assistant/ui/AssistantMoreMenu.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMoreMenu.js +58 -56
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +106 -105
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.d.ts +20 -0
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.d.ts.map +1 -0
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.js +39 -0
- package/dist/shared/assistant/ui/controlConfirmDialog.d.ts +30 -0
- package/dist/shared/assistant/ui/controlConfirmDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/controlConfirmDialog.js +46 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +35 -2
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +232 -171
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +15 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +173 -150
- package/dist/shared/assistant/voice/handsFree.d.ts +160 -0
- package/dist/shared/assistant/voice/handsFree.d.ts.map +1 -0
- package/dist/shared/assistant/voice/handsFree.js +104 -0
- package/dist/shared/assistant/voice/supersededTurns.d.ts +29 -0
- package/dist/shared/assistant/voice/supersededTurns.d.ts.map +1 -0
- package/dist/shared/assistant/voice/supersededTurns.js +17 -0
- package/dist/shared/assistant/voice/useVoiceInput.d.ts +7 -0
- package/dist/shared/assistant/voice/useVoiceInput.d.ts.map +1 -1
- package/dist/shared/assistant/voice/useVoiceInput.js +13 -10
- package/dist/shared/assistant/voice/voiceSession.d.ts +64 -20
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +120 -67
- package/dist/shared/components/KeyboardHelpDialogWrapper.d.ts.map +1 -1
- package/dist/shared/components/KeyboardHelpDialogWrapper.js +11 -9
- package/dist/shared/providers/shell/GlobalUiProvider.d.ts +2 -0
- package/dist/shared/providers/shell/GlobalUiProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/GlobalUiProvider.js +4 -1
- package/dist/shared-assistant.js +219 -203
- package/package.json +1 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { canonical as e } from "./text.js";
|
|
2
|
+
import { uiLanguageFromWords as t } from "./languages.js";
|
|
3
|
+
import { resolveByLabel as n } from "./names.js";
|
|
4
|
+
//#region src/shared/assistant/appControls/grammar.ts
|
|
5
|
+
var r = "(?:(?:the|my|our|this) )?", i = "(?:open|show|show me|view|pull up|bring up|display|check)", a = (e) => ({
|
|
6
|
+
request: e,
|
|
7
|
+
weak: !1
|
|
8
|
+
}), o = (e) => ({
|
|
9
|
+
request: e,
|
|
10
|
+
weak: !0
|
|
11
|
+
}), s = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
12
|
+
function c(e, t) {
|
|
13
|
+
let n = t.split(" ").filter(Boolean);
|
|
14
|
+
if (n.length === 0) return t;
|
|
15
|
+
let r = new RegExp(n.map(s).join("[^\\p{L}\\p{N}]+"), "giu"), i = e.normalize("NFKC"), a = null;
|
|
16
|
+
for (let e of i.matchAll(r)) a = e[0];
|
|
17
|
+
return a ?? t;
|
|
18
|
+
}
|
|
19
|
+
var l = 60, u = /^(?:log ?out|sign ?out|(?:log|sign) (?:me )?out(?: of (?:the |my |this )?(?:app|application|account|session))?)$/, d = "(?:workspace|workspaces|context|contexts|organi[sz]ation|organi[sz]ations|org|project)", f = "(?:switcher|selector|picker|menu|dropdown|list)", p = /^(?:another|other|a different|different|a new|new|a|the|another one|other one)$/, m = RegExp(`^${i} ${r}(?:notification|notifications) (?:panel|bell|centre|center|menu|tray|drawer|list)$`), h = RegExp(`^${i} ${r}(?:notification )?bell$`), g = RegExp(`^${i} ${r}notifications?$`), _ = RegExp(`^${i} ${r}(?:help (?:menu|panel|dialog|dialogue|centre|center)|keyboard shortcuts|keyboard help|shortcuts)$`), v = RegExp(`^${i} ${r}help$`), y = RegExp(`^(?:open|show|start|use|pull up|bring up) ${r}(?:global |app )search(?: (?:bar|box|dialog|dialogue|panel))?$|^(?:open|show|start|use|pull up|bring up) ${r}search (?:bar|box|dialog|dialogue|panel)$`), b = /^(?:open|start|use|pull up|bring up) (?:(?:the|my) )?search$/, x = [
|
|
20
|
+
/^(?:open|start|use|pull up|bring up) (?:(?:the|my) )?(?:global |app )?search (?:for|with) (.+)$/,
|
|
21
|
+
/^(?:global search|search everything|search everywhere|search globally|search the app|search all|search across the app) (?:for )?(.+)$/,
|
|
22
|
+
/^search (?:the app|everything|everywhere|globally|all|across the app) for (.+)$/
|
|
23
|
+
], S = "(?:side ?bar|side menu|side navigation|side nav|navigation (?:bar|menu|panel|drawer)|nav (?:bar|menu|panel|drawer)|left (?:menu|sidebar|panel))", C = RegExp(`^(?:collapse|close|hide|minimi[sz]e|shrink|fold) ${r}${S}$`), w = RegExp(`^(?:expand|open|show|reveal|unhide|bring up|widen|unfold) ${r}${S}$`), T = "(?: (?:group|section|menu|folder|submenu|sub menu|list|dropdown))?", E = RegExp(`^(expand|unfold|open up|open|show) ${r}(.+?)${T}$`), D = RegExp(`^(collapse|fold up|close|hide) ${r}(.+?)${T}$`), O = [
|
|
24
|
+
RegExp(`^(?:change|switch|set|update|turn|put|make)(?: over)? ${r}(?:(?:app|ui|user interface|interface|screen|display|site|system|menu|application) )?language (?:to|into|as|over to) (.+)$`),
|
|
25
|
+
RegExp(`^(?:switch|change|set|put|turn) ${r}(?:app|ui|user interface|interface|screen|display|site|application|menus?) (?:language )?(?:to|into) (.+)$`),
|
|
26
|
+
RegExp(`^(?:show|display|use|run) ${r}(?:app|ui|user interface|interface|screen|display|site|application)(?: menus?)? in (.+)$`)
|
|
27
|
+
], k = RegExp(`^${i} ${r}(?:(?:assistant|ai|conversation|conversations|chat) history|history of (?:my )?(?:conversations|chats)|(?:past|previous|old|earlier) conversations)$`), A = RegExp(`^${i} ${r}history$`), j = RegExp(`^${i} ${r}(?:voice|spoken|speech) transcript$`), M = RegExp(`^${i} ${r}transcript$`), N = RegExp(`^${i} ${r}(?:ai|assistant) preview(?: panel| pane| surface)?$`), P = RegExp(`^${i} ${r}preview(?: panel| pane)?$`), F = /^(?:(?:start|begin|open) (?:a |an |another )?(?:new |fresh |blank )?conversation|new conversation|(?:start|begin) (?:a )?(?:new|fresh) conversation with you)$/, I = [RegExp(`^(?:go to|open|show|show me|switch to|select|view|change to|move to|take me to|bring up) ${r}(.+) tab$`), /^(?:switch|change|move) tabs? to (.+)$/], L = "(?:filter|narrow|limit)(?: down)?", R = [RegExp(`^${L}(?: ${r}(?:page|list|table|results|items|rows|view))? (?:by|to|for|on) ${r}(.+)$`)], z = [/^(?:show|display|list|keep) only (.+)$/, /^only (?:show|display|list|keep) (.+)$/], B = [
|
|
28
|
+
RegExp(`^(?:set|change|switch|put|make) ${r}(.+?) filter (?:to|as|on) (.+)$`),
|
|
29
|
+
RegExp(`^${L} ${r}(.+?) (?:by|to|for|on) (.+)$`),
|
|
30
|
+
RegExp(`^(?:use|apply) ${r}(.+?) filter (?:of|with|for|set to) (.+)$`)
|
|
31
|
+
], V = RegExp(`^(?:clear|remove|reset|drop|turn off) ${r}(?:(?:all|every) )?(?:(.+?) )?filters?$`), H = [
|
|
32
|
+
[/(?: in)? (?:ascending|asc)(?: order)?$/, "asc"],
|
|
33
|
+
[/(?: in)? (?:descending|desc)(?: order)?$/, "desc"],
|
|
34
|
+
[/ (?:a to z|low to high|lowest first|smallest first|oldest first)$/, "asc"],
|
|
35
|
+
[/ (?:z to a|high to low|highest first|largest first|biggest first|newest first|latest first)$/, "desc"]
|
|
36
|
+
], U = RegExp(`^(?:sort|order|arrange|rank)(?: ${r}(?:page|list|table|results|items|rows|view|it|them))? by (.+)$`), W = /^(?:sort|order)(?: it| them)? (ascending|descending|asc|desc)$/, G = [
|
|
37
|
+
/^(?:search|find|look)(?: (?:this page|the page|the list|the table|this list|this table|here|these|them))? for (.+)$/,
|
|
38
|
+
/^(?:find|search for) (.+?) (?:on|in) (?:this|the) (?:page|list|table)$/,
|
|
39
|
+
/^search (?:this page|the page|the list|the table|here) (?:for )?(.+)$/
|
|
40
|
+
], K = /^(?:clear|reset|empty|remove|stop) (?:the |my |this )?(?:page )?search(?:ing)?$/, q = [RegExp(`^(?:open|show|start|bring up|pull up) ${r}(.+?) (?:form|dialog|dialogue|modal)$`)], J = RegExp(`^(?:open|show|start|bring up|pull up) ${r}(.+)$`), Y = /\b(?:and then|then|and also|also|after that|afterwards|and open|and show|and go|and sort|and filter)\b/;
|
|
41
|
+
function X(e, t) {
|
|
42
|
+
for (let n of e) {
|
|
43
|
+
let e = n.exec(t);
|
|
44
|
+
if (e) return e;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
function Z(e) {
|
|
49
|
+
for (let [t, n] of H) {
|
|
50
|
+
let r = t.exec(e);
|
|
51
|
+
if (r) return {
|
|
52
|
+
field: e.slice(0, r.index).trim(),
|
|
53
|
+
direction: n
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
field: e,
|
|
58
|
+
direction: null
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function Q(e) {
|
|
62
|
+
let t = e.replace(/\b(?:please|pls)$/, "").trim();
|
|
63
|
+
return !t || t.length > l ? null : t;
|
|
64
|
+
}
|
|
65
|
+
function $(s, l, S) {
|
|
66
|
+
let T = S.registered;
|
|
67
|
+
if (Y.test(s)) return null;
|
|
68
|
+
if (T["account.logout"] && u.test(s)) return a({ control: "account.logout" });
|
|
69
|
+
if (T["header.workspace"] || T["header.context"]) {
|
|
70
|
+
let e = RegExp(`^(?:switch|change|move|go|jump|hop)(?: over)? to ${r}(.+?) ${d}$`).exec(s) ?? RegExp(`^(?:switch|change|move) ${r}${d} (?:to|over to) ${r}(.+)$`).exec(s);
|
|
71
|
+
if (e && T["header.workspace"]) {
|
|
72
|
+
let t = (e[1] ?? "").trim();
|
|
73
|
+
if (t && !p.test(t)) return a({
|
|
74
|
+
control: "header.workspace",
|
|
75
|
+
target: t
|
|
76
|
+
});
|
|
77
|
+
if (T["header.context"]) return a({ control: "header.context" });
|
|
78
|
+
}
|
|
79
|
+
if (T["header.context"] && (RegExp(`^${i} ${r}${d} ${f}$`).test(s) || RegExp(`^(?:switch|change) ${r}${d}$`).test(s))) return a({ control: "header.context" });
|
|
80
|
+
}
|
|
81
|
+
if (T["header.notifications"]) {
|
|
82
|
+
if (m.test(s) || h.test(s)) return a({ control: "header.notifications" });
|
|
83
|
+
if (g.test(s)) return o({ control: "header.notifications" });
|
|
84
|
+
}
|
|
85
|
+
if (T["header.help"]) {
|
|
86
|
+
if (_.test(s)) return a({ control: "header.help" });
|
|
87
|
+
if (v.test(s)) return o({ control: "header.help" });
|
|
88
|
+
}
|
|
89
|
+
if (T["header.search"]) {
|
|
90
|
+
for (let e of x) {
|
|
91
|
+
let t = e.exec(s), n = t ? Q(t[1] ?? "") : null;
|
|
92
|
+
if (n) return a({
|
|
93
|
+
control: "header.search",
|
|
94
|
+
query: c(l, n)
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (y.test(s)) return a({
|
|
98
|
+
control: "header.search",
|
|
99
|
+
query: null
|
|
100
|
+
});
|
|
101
|
+
if (b.test(s)) return o({
|
|
102
|
+
control: "header.search",
|
|
103
|
+
query: null
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (T.sidebar) {
|
|
107
|
+
if (C.test(s)) return a({
|
|
108
|
+
control: "sidebar",
|
|
109
|
+
collapsed: !0
|
|
110
|
+
});
|
|
111
|
+
if (w.test(s)) return a({
|
|
112
|
+
control: "sidebar",
|
|
113
|
+
collapsed: !1
|
|
114
|
+
});
|
|
115
|
+
let e = E.exec(s), t = e ? null : D.exec(s), r = e ?? t;
|
|
116
|
+
if (r && S.sidebarEntries.length > 0) {
|
|
117
|
+
let t = (r[2] ?? "").trim(), i = r[1] ?? "";
|
|
118
|
+
if (t && n(t, S.sidebarEntries).kind !== "none") return {
|
|
119
|
+
request: {
|
|
120
|
+
control: "sidebar.entry",
|
|
121
|
+
name: t,
|
|
122
|
+
expanded: e !== null
|
|
123
|
+
},
|
|
124
|
+
weak: !/^(?:expand|unfold|open up|collapse|fold up)$/.test(i)
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (T.language) for (let e of O) {
|
|
129
|
+
let n = e.exec(s);
|
|
130
|
+
if (!n) continue;
|
|
131
|
+
let r = t(n[1] ?? "");
|
|
132
|
+
if (r) return a({
|
|
133
|
+
control: "language",
|
|
134
|
+
code: r
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (T["assistant.history"]) {
|
|
138
|
+
if (k.test(s)) return a({ control: "assistant.history" });
|
|
139
|
+
if (A.test(s)) return o({ control: "assistant.history" });
|
|
140
|
+
}
|
|
141
|
+
if (T["assistant.transcript"]) {
|
|
142
|
+
if (j.test(s)) return a({ control: "assistant.transcript" });
|
|
143
|
+
if (M.test(s)) return o({ control: "assistant.transcript" });
|
|
144
|
+
}
|
|
145
|
+
if (T["assistant.preview"]) {
|
|
146
|
+
if (N.test(s)) return a({ control: "assistant.preview" });
|
|
147
|
+
if (P.test(s)) return o({ control: "assistant.preview" });
|
|
148
|
+
}
|
|
149
|
+
if (T["assistant.conversation.new"] && F.test(s)) return a({ control: "assistant.conversation.new" });
|
|
150
|
+
let L = S.page;
|
|
151
|
+
if (!L) return null;
|
|
152
|
+
if (L.tabs.length > 0) {
|
|
153
|
+
let e = X(I, s), t = e ? (e[1] ?? "").trim() : "";
|
|
154
|
+
if (t) {
|
|
155
|
+
let e = n(t, L.tabs).kind !== "none";
|
|
156
|
+
return {
|
|
157
|
+
request: {
|
|
158
|
+
control: "page.tab",
|
|
159
|
+
name: t
|
|
160
|
+
},
|
|
161
|
+
weak: !e
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (L.filters.length > 0) {
|
|
166
|
+
let e = V.exec(s);
|
|
167
|
+
if (e) return a({
|
|
168
|
+
control: "page.filter.clear",
|
|
169
|
+
filter: (e[1] ?? "").trim() || null
|
|
170
|
+
});
|
|
171
|
+
let t = X(B, s);
|
|
172
|
+
if (t) {
|
|
173
|
+
let e = (t[1] ?? "").trim(), r = (t[2] ?? "").trim();
|
|
174
|
+
if (e && r && n(e, L.filters).kind !== "none") return a({
|
|
175
|
+
control: "page.filter",
|
|
176
|
+
filter: e,
|
|
177
|
+
option: r
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
let r = X(R, s);
|
|
181
|
+
if (r && (r[1] ?? "").trim()) return a({
|
|
182
|
+
control: "page.filter",
|
|
183
|
+
filter: null,
|
|
184
|
+
option: (r[1] ?? "").trim()
|
|
185
|
+
});
|
|
186
|
+
let i = X(z, s);
|
|
187
|
+
if (i) {
|
|
188
|
+
let e = (i[1] ?? "").trim(), t = L.filters.some((t) => n(e, t.options).kind !== "none");
|
|
189
|
+
if (e && t) return a({
|
|
190
|
+
control: "page.filter",
|
|
191
|
+
filter: null,
|
|
192
|
+
option: e
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (L.sorts.length > 0) {
|
|
197
|
+
let e = W.exec(s);
|
|
198
|
+
if (e) return a({
|
|
199
|
+
control: "page.sort",
|
|
200
|
+
field: null,
|
|
201
|
+
direction: /^asc/.test(e[1] ?? "") ? "asc" : "desc"
|
|
202
|
+
});
|
|
203
|
+
let t = U.exec(s);
|
|
204
|
+
if (t) {
|
|
205
|
+
let { field: e, direction: n } = Z((t[1] ?? "").trim());
|
|
206
|
+
if (e) return a({
|
|
207
|
+
control: "page.sort",
|
|
208
|
+
field: e,
|
|
209
|
+
direction: n
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (L.searchable) {
|
|
214
|
+
if (K.test(s)) return a({ control: "page.search.clear" });
|
|
215
|
+
let e = X(G, s), t = e ? Q(e[1] ?? "") : null;
|
|
216
|
+
if (t) return a({
|
|
217
|
+
control: "page.search",
|
|
218
|
+
query: c(l, t)
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
if (L.openers.length > 0) {
|
|
222
|
+
let t = X(q, s), r = t ? (t[1] ?? "").trim() : "";
|
|
223
|
+
if (r && n(r, L.openers).kind !== "none") return a({
|
|
224
|
+
control: "page.open",
|
|
225
|
+
name: r
|
|
226
|
+
});
|
|
227
|
+
let i = J.exec(s), c = i ? (i[1] ?? "").trim() : "";
|
|
228
|
+
if (c && L.openers.filter((t) => e(t.label) === c).length > 0) return o({
|
|
229
|
+
control: "page.open",
|
|
230
|
+
name: c
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
export { $ as matchAppControl, c as queryAsSaid };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UiLanguageCode } from './types';
|
|
2
|
+
/** The UI language a phrase names ("Hindi", "the Tamil language"), or null. */
|
|
3
|
+
export declare function uiLanguageFromWords(said: string): UiLanguageCode | null;
|
|
4
|
+
/** The English name of a UI language, for saying that an app does not offer it. */
|
|
5
|
+
export declare function uiLanguageEnglishName(code: UiLanguageCode): string;
|
|
6
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/appControls/languages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAoB9C,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAMvE;AAWD,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAElE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { canonical as e } from "./text.js";
|
|
2
|
+
//#region src/shared/assistant/appControls/languages.ts
|
|
3
|
+
var t = {
|
|
4
|
+
en: [
|
|
5
|
+
"english",
|
|
6
|
+
"inglés",
|
|
7
|
+
"ingles"
|
|
8
|
+
],
|
|
9
|
+
ar: [
|
|
10
|
+
"arabic",
|
|
11
|
+
"عربي",
|
|
12
|
+
"العربية",
|
|
13
|
+
"عربى"
|
|
14
|
+
],
|
|
15
|
+
es: [
|
|
16
|
+
"spanish",
|
|
17
|
+
"español",
|
|
18
|
+
"espanol",
|
|
19
|
+
"castilian"
|
|
20
|
+
],
|
|
21
|
+
hi: [
|
|
22
|
+
"hindi",
|
|
23
|
+
"हिन्दी",
|
|
24
|
+
"हिंदी"
|
|
25
|
+
],
|
|
26
|
+
ta: ["tamil", "தமிழ்"],
|
|
27
|
+
zh: [
|
|
28
|
+
"chinese",
|
|
29
|
+
"mandarin",
|
|
30
|
+
"中文",
|
|
31
|
+
"简体中文",
|
|
32
|
+
"simplified chinese"
|
|
33
|
+
]
|
|
34
|
+
}, n = /* @__PURE__ */ new Map();
|
|
35
|
+
for (let [r, i] of Object.entries(t)) for (let t of i) n.set(e(t), r);
|
|
36
|
+
function r(t) {
|
|
37
|
+
let r = e(t).replace(/^(?:the|a) /, "").replace(/ language$/, "").trim();
|
|
38
|
+
return n.get(r) ?? null;
|
|
39
|
+
}
|
|
40
|
+
var i = {
|
|
41
|
+
en: "English",
|
|
42
|
+
ar: "Arabic",
|
|
43
|
+
es: "Spanish",
|
|
44
|
+
hi: "Hindi",
|
|
45
|
+
ta: "Tamil",
|
|
46
|
+
zh: "Chinese"
|
|
47
|
+
};
|
|
48
|
+
function a(e) {
|
|
49
|
+
return i[e];
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { a as uiLanguageEnglishName, r as uiLanguageFromWords };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type NameMatch<T> = {
|
|
2
|
+
kind: "one";
|
|
3
|
+
item: T;
|
|
4
|
+
} | {
|
|
5
|
+
kind: "many";
|
|
6
|
+
items: T[];
|
|
7
|
+
} | {
|
|
8
|
+
kind: "none";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Which of `items` a person means by `said`, judged on the product's own
|
|
12
|
+
* labels. Exact first; otherwise the saying is a whole-word part of the label
|
|
13
|
+
* ("overview" for "Overview & Metrics") or, where the caller allows it, the
|
|
14
|
+
* label is a part of the saying ("active crops" for "Active"). A name that
|
|
15
|
+
* several items share is `many` — never guessed at.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveByLabel<T extends {
|
|
18
|
+
label: string;
|
|
19
|
+
}>(said: string, items: readonly T[], options?: {
|
|
20
|
+
sayingMayContainLabel?: boolean;
|
|
21
|
+
}): NameMatch<T>;
|
|
22
|
+
//# sourceMappingURL=names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/appControls/names.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,CAAC,CAAC,IACnB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAQrB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACxD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,GAAE;IAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAAO,GAChD,SAAS,CAAC,CAAC,CAAC,CA4Bd"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { canonical as e } from "./text.js";
|
|
2
|
+
//#region src/shared/assistant/appControls/names.ts
|
|
3
|
+
var t = /^(?:the|my|our|this|that|a|an) /, n = (e, t) => t.length > 0 && ` ${e} `.includes(` ${t} `);
|
|
4
|
+
function r(r, i, a = {}) {
|
|
5
|
+
let o = e(r).replace(t, "").trim();
|
|
6
|
+
if (!o) return { kind: "none" };
|
|
7
|
+
let s = i.map((n) => ({
|
|
8
|
+
item: n,
|
|
9
|
+
label: e(n.label).replace(t, "")
|
|
10
|
+
})).filter((e) => e.label.length > 0), c = s.filter((e) => e.label === o), l = (e) => {
|
|
11
|
+
let [t, ...n] = e;
|
|
12
|
+
return t ? n.length === 0 ? {
|
|
13
|
+
kind: "one",
|
|
14
|
+
item: t.item
|
|
15
|
+
} : {
|
|
16
|
+
kind: "many",
|
|
17
|
+
items: e.map((e) => e.item)
|
|
18
|
+
} : { kind: "none" };
|
|
19
|
+
};
|
|
20
|
+
if (c.length > 0) return l(c);
|
|
21
|
+
let u = a.sayingMayContainLabel ? s.filter((e) => n(o, e.label) && e.label.length >= 3) : [];
|
|
22
|
+
if (u.length > 0) {
|
|
23
|
+
let e = Math.max(...u.map((e) => e.label.length));
|
|
24
|
+
return l(u.filter((t) => t.label.length === e));
|
|
25
|
+
}
|
|
26
|
+
return l(s.filter((e) => o.length >= 3 && n(e.label, o)));
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { r as resolveByLabel };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ControlResult, PageControlsAdapter, PageFilter } from './types';
|
|
2
|
+
export interface EnumFilterSpec<V extends string> {
|
|
3
|
+
id: string;
|
|
4
|
+
/** The filter's own name on the page ("Status"). */
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* The options the page offers, in its words. The NEUTRAL one ("All") may be
|
|
8
|
+
* included: it is not listed to the assistant (it is "clear the filter").
|
|
9
|
+
*/
|
|
10
|
+
options: readonly {
|
|
11
|
+
value: V;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
/** The value that means "no filter". */
|
|
15
|
+
neutral: V;
|
|
16
|
+
/** The value applied now. */
|
|
17
|
+
value: V;
|
|
18
|
+
/** The page's own setter. */
|
|
19
|
+
set: (value: V) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface EnumFilterEntry {
|
|
22
|
+
filter: PageFilter;
|
|
23
|
+
/** Apply `value` (null: clear). Reports `already` when it is what is applied. */
|
|
24
|
+
apply: (value: string | null) => ControlResult;
|
|
25
|
+
}
|
|
26
|
+
export declare function enumFilter<V extends string>(spec: EnumFilterSpec<V>): EnumFilterEntry;
|
|
27
|
+
export declare function filtersOf(entries: readonly EnumFilterEntry[]): NonNullable<PageControlsAdapter["filters"]>;
|
|
28
|
+
export interface SortFieldSpec<V extends string> {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
/** The page's sort value for this column ascending, and descending. */
|
|
32
|
+
asc: V;
|
|
33
|
+
desc: V;
|
|
34
|
+
}
|
|
35
|
+
export interface SortSpec<V extends string> {
|
|
36
|
+
/** Only columns the page can sort BOTH ways (and shows right now). */
|
|
37
|
+
fields: readonly SortFieldSpec<V>[];
|
|
38
|
+
value: V;
|
|
39
|
+
set: (value: V) => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function sortOf<V extends string>(spec: SortSpec<V>): NonNullable<PageControlsAdapter["sort"]>;
|
|
42
|
+
export interface TabsSpec<T extends string> {
|
|
43
|
+
items: readonly {
|
|
44
|
+
id: T;
|
|
45
|
+
label: string;
|
|
46
|
+
}[];
|
|
47
|
+
value: T;
|
|
48
|
+
set: (id: T) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare function tabsOf<T extends string>(spec: TabsSpec<T>): NonNullable<PageControlsAdapter["tabs"]>;
|
|
51
|
+
export declare function searchOf(set: (query: string) => void): NonNullable<PageControlsAdapter["search"]>;
|
|
52
|
+
/** One form or dialog the page can OPEN. `open` must only open it. */
|
|
53
|
+
export interface OpenerSpec {
|
|
54
|
+
id: string;
|
|
55
|
+
label: string;
|
|
56
|
+
open: () => void;
|
|
57
|
+
}
|
|
58
|
+
export declare function openersOf(specs: readonly OpenerSpec[]): NonNullable<PageControlsAdapter["openers"]>;
|
|
59
|
+
//# sourceMappingURL=pageAdapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageAdapters.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/appControls/pageAdapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EAGX,MAAM,SAAS,CAAC;AAoBjB,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,EAAE,SAAS;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChD,wCAAwC;IACxC,OAAO,EAAE,CAAC,CAAC;IACX,6BAA6B;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,6BAA6B;IAC7B,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,iFAAiF;IACjF,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,aAAa,CAAC;CAChD;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI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WjG;AAED,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,UAAU,EAAE,GAC3B,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAU7C"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region src/shared/assistant/appControls/pageAdapters.ts
|
|
2
|
+
var e = { status: "done" }, t = { status: "already" }, n = { status: "failed" };
|
|
3
|
+
function r(r) {
|
|
4
|
+
return {
|
|
5
|
+
filter: {
|
|
6
|
+
id: r.id,
|
|
7
|
+
label: r.label,
|
|
8
|
+
options: () => r.options.filter((e) => e.value !== r.neutral),
|
|
9
|
+
current: () => r.value === r.neutral ? null : r.value
|
|
10
|
+
},
|
|
11
|
+
apply: (i) => {
|
|
12
|
+
let a = i === null ? r.neutral : i, o = r.options.find((e) => e.value === a);
|
|
13
|
+
return o ? r.value === o.value ? t : (r.set(o.value), e) : n;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function i(r) {
|
|
18
|
+
return {
|
|
19
|
+
items: () => r.map((e) => e.filter),
|
|
20
|
+
set: (e, t) => {
|
|
21
|
+
let i = r.find((t) => t.filter.id === e);
|
|
22
|
+
return i ? i.apply(t) : n;
|
|
23
|
+
},
|
|
24
|
+
clearAll: () => {
|
|
25
|
+
let n = !1;
|
|
26
|
+
for (let e of r) e.apply(null).status === "done" && (n = !0);
|
|
27
|
+
return n ? e : t;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function a(r) {
|
|
32
|
+
return {
|
|
33
|
+
fields: () => r.fields.map(({ id: e, label: t }) => ({
|
|
34
|
+
id: e,
|
|
35
|
+
label: t
|
|
36
|
+
})),
|
|
37
|
+
current: () => {
|
|
38
|
+
for (let e of r.fields) {
|
|
39
|
+
if (e.asc === r.value) return {
|
|
40
|
+
field: e.id,
|
|
41
|
+
direction: "asc"
|
|
42
|
+
};
|
|
43
|
+
if (e.desc === r.value) return {
|
|
44
|
+
field: e.id,
|
|
45
|
+
direction: "desc"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
},
|
|
50
|
+
set: (i, a) => {
|
|
51
|
+
let o = r.fields.find((e) => e.id === i);
|
|
52
|
+
if (!o) return n;
|
|
53
|
+
let s = a === "asc" ? o.asc : o.desc;
|
|
54
|
+
return r.value === s ? t : (r.set(s), e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function o(r) {
|
|
59
|
+
return {
|
|
60
|
+
items: () => r.items,
|
|
61
|
+
current: () => r.value,
|
|
62
|
+
select: (i) => {
|
|
63
|
+
let a = r.items.find((e) => e.id === i);
|
|
64
|
+
return a ? r.value === a.id ? t : (r.set(a.id), e) : n;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function s(t) {
|
|
69
|
+
return {
|
|
70
|
+
set: (n) => (t(n), e),
|
|
71
|
+
clear: () => (t(""), e)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function c(t) {
|
|
75
|
+
return {
|
|
76
|
+
items: () => t.map(({ id: e, label: t }) => ({
|
|
77
|
+
id: e,
|
|
78
|
+
label: t
|
|
79
|
+
})),
|
|
80
|
+
open: (r) => {
|
|
81
|
+
let i = t.find((e) => e.id === r);
|
|
82
|
+
return i ? (i.open(), e) : n;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { r as enumFilter, i as filtersOf, c as openersOf, s as searchOf, a as sortOf, o as tabsOf };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { AppControlRequest } from './grammar';
|
|
2
|
+
import { ControlBlock, ControlKey, SortDirection } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ★ BOFF-8060: turn a matched request into what the panel does — against the
|
|
5
|
+
* handlers registered RIGHT NOW. Pure but for the handlers it calls; the panel
|
|
6
|
+
* owns the conversation, the speech and the confirmation dialog.
|
|
7
|
+
*/
|
|
8
|
+
/** What the panel says, as data. `appControlCopy.ts` turns it into words. */
|
|
9
|
+
export type ControlReply = {
|
|
10
|
+
code: "opened";
|
|
11
|
+
what: OpenedWhat;
|
|
12
|
+
} | {
|
|
13
|
+
code: "search-opened";
|
|
14
|
+
query: string | null;
|
|
15
|
+
} | {
|
|
16
|
+
code: "sidebar";
|
|
17
|
+
collapsed: boolean;
|
|
18
|
+
already: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
code: "sidebar-entry";
|
|
21
|
+
name: string;
|
|
22
|
+
expanded: boolean;
|
|
23
|
+
already: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
code: "language";
|
|
26
|
+
label: string;
|
|
27
|
+
already: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
code: "language-not-offered";
|
|
30
|
+
label: string;
|
|
31
|
+
} | {
|
|
32
|
+
code: "workspace-confirm";
|
|
33
|
+
name: string;
|
|
34
|
+
} | {
|
|
35
|
+
code: "workspace-switched";
|
|
36
|
+
name: string;
|
|
37
|
+
} | {
|
|
38
|
+
code: "workspace-already";
|
|
39
|
+
name: string;
|
|
40
|
+
} | {
|
|
41
|
+
code: "workspace-none";
|
|
42
|
+
} | {
|
|
43
|
+
code: "logout-confirm";
|
|
44
|
+
} | {
|
|
45
|
+
code: "logout-done";
|
|
46
|
+
} | {
|
|
47
|
+
code: "tab";
|
|
48
|
+
name: string;
|
|
49
|
+
already: boolean;
|
|
50
|
+
} | {
|
|
51
|
+
code: "filter-set";
|
|
52
|
+
filter: string;
|
|
53
|
+
option: string;
|
|
54
|
+
already: boolean;
|
|
55
|
+
} | {
|
|
56
|
+
code: "filter-cleared";
|
|
57
|
+
filter: string | null;
|
|
58
|
+
} | {
|
|
59
|
+
code: "sorted";
|
|
60
|
+
page: string;
|
|
61
|
+
field: string;
|
|
62
|
+
direction: SortDirection;
|
|
63
|
+
already: boolean;
|
|
64
|
+
} | {
|
|
65
|
+
code: "sort-needs-field";
|
|
66
|
+
} | {
|
|
67
|
+
code: "searched";
|
|
68
|
+
page: string;
|
|
69
|
+
query: string;
|
|
70
|
+
} | {
|
|
71
|
+
code: "search-cleared";
|
|
72
|
+
} | {
|
|
73
|
+
code: "form-opened";
|
|
74
|
+
name: string;
|
|
75
|
+
} | {
|
|
76
|
+
code: "not-found";
|
|
77
|
+
what: NotFoundKind;
|
|
78
|
+
page: string;
|
|
79
|
+
name: string;
|
|
80
|
+
options: string[];
|
|
81
|
+
filter?: string;
|
|
82
|
+
} | {
|
|
83
|
+
code: "ambiguous";
|
|
84
|
+
what: AmbiguousKind;
|
|
85
|
+
name: string;
|
|
86
|
+
options: string[];
|
|
87
|
+
} | {
|
|
88
|
+
code: "filter-choose";
|
|
89
|
+
filter: string;
|
|
90
|
+
options: string[];
|
|
91
|
+
} | {
|
|
92
|
+
code: "failed";
|
|
93
|
+
} | {
|
|
94
|
+
code: "blocked";
|
|
95
|
+
reason: ControlBlock;
|
|
96
|
+
};
|
|
97
|
+
export type OpenedWhat = "notifications" | "help" | "context" | "history" | "transcript" | "preview" | "conversation";
|
|
98
|
+
export type NotFoundKind = "tab" | "filter" | "filter-option" | "sort" | "form" | "workspace";
|
|
99
|
+
export type AmbiguousKind = "tab" | "filter" | "menu" | "workspace" | "column" | "form";
|
|
100
|
+
/** What is recorded on the exchange (`AssistantLocalAction`). */
|
|
101
|
+
export type ControlOutcome = "done" | "already" | "failed" | "blocked" | "not-found" | "ambiguous" | "confirm";
|
|
102
|
+
export interface ControlRun {
|
|
103
|
+
reply: ControlReply;
|
|
104
|
+
outcome: ControlOutcome;
|
|
105
|
+
}
|
|
106
|
+
/** What the stronger confirmation asks about. */
|
|
107
|
+
export type ConfirmPrompt = {
|
|
108
|
+
kind: "logout";
|
|
109
|
+
} | {
|
|
110
|
+
kind: "workspace";
|
|
111
|
+
name: string;
|
|
112
|
+
};
|
|
113
|
+
export type ControlPlan =
|
|
114
|
+
/** Nothing to run: say it. */
|
|
115
|
+
{
|
|
116
|
+
kind: "reply";
|
|
117
|
+
control: ControlKey | "page";
|
|
118
|
+
run: ControlRun;
|
|
119
|
+
}
|
|
120
|
+
/** Run it now and say what happened. `silent`: record nothing (a new conversation). */
|
|
121
|
+
| {
|
|
122
|
+
kind: "run";
|
|
123
|
+
control: ControlKey | "page";
|
|
124
|
+
run: () => ControlRun;
|
|
125
|
+
silent?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* ★ Stronger confirmation. `ask` is said now; `confirmed` runs ONLY from a
|
|
129
|
+
* trusted press on the dialog's button — never from anything typed or said.
|
|
130
|
+
*/
|
|
131
|
+
| {
|
|
132
|
+
kind: "confirm";
|
|
133
|
+
control: ControlKey;
|
|
134
|
+
ask: ControlRun;
|
|
135
|
+
prompt: ConfirmPrompt;
|
|
136
|
+
confirmed: () => ControlRun;
|
|
137
|
+
};
|
|
138
|
+
export interface ControlPlanEnv {
|
|
139
|
+
/** A live voice session (or a spoken command) — the voice screen is up. */
|
|
140
|
+
voiceLive: boolean;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The plan for `request`, or null when what it needs is no longer registered
|
|
144
|
+
* (the page moved on between the match and the run): the panel then leaves the
|
|
145
|
+
* sentence to the model, exactly as if nothing had matched.
|
|
146
|
+
*/
|
|
147
|
+
export declare function planAppControl(request: AppControlRequest, env: ControlPlanEnv): ControlPlan | null;
|
|
148
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/appControls/plan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,KAAK,EACV,YAAY,E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