@celljs/ta-web 4.32.1 → 4.34.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.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/assistant/assistant-ask-book.d.ts +10 -17
- package/esm/browser/assistant/assistant-ask-book.js +24 -61
- package/esm/browser/assistant/assistant-conversation.js +0 -2
- package/esm/browser/assistant/assistant-protocol.d.ts +4 -2
- package/esm/browser/assistant/assistant-role.d.ts +1 -1
- package/esm/browser/assistant/assistant-role.js +1 -1
- package/esm/browser/assistant/assistant-thread.js +3 -1
- package/esm/browser/assistant/assistant-view.js +8 -4
- package/esm/browser/assistant/assistant.d.ts +7 -2
- package/esm/browser/assistant/assistant.js +39 -8
- package/esm/browser/assistant/web-voice.d.ts +14 -0
- package/esm/browser/assistant/web-voice.js +36 -0
- package/esm/browser/components/chat-home-util.d.ts +5 -2
- package/esm/browser/components/chat-home-util.js +6 -3
- package/esm/browser/components/chat-list.js +1 -1
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/context-act.d.ts +4 -0
- package/esm/browser/components/context-act.js +8 -0
- package/esm/browser/components/context-line.d.ts +19 -0
- package/esm/browser/components/context-line.js +71 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/message-list.js +12 -6
- package/esm/browser/components/message-steps.js +1 -1
- package/esm/browser/components/session-settings.d.ts +8 -4
- package/esm/browser/components/session-settings.js +10 -5
- package/esm/browser/components/session-view.js +12 -8
- package/esm/browser/extension/web-api-components.d.ts +19 -0
- package/esm/browser/extension/web-extension-context.js +2 -8
- package/esm/browser/i18n/en/chat.d.ts +16 -2
- package/esm/browser/i18n/en/chat.js +16 -2
- package/esm/browser/i18n/en/settings.d.ts +26 -0
- package/esm/browser/i18n/en/settings.js +29 -3
- package/esm/browser/i18n/en/tools.d.ts +1 -0
- package/esm/browser/i18n/en/tools.js +1 -0
- package/esm/browser/i18n/ja/chat.js +16 -2
- package/esm/browser/i18n/ja/settings.js +29 -3
- package/esm/browser/i18n/ja/tools.js +1 -0
- package/esm/browser/i18n/locales.d.ts +44 -3
- package/esm/browser/i18n/messages.d.ts +43 -2
- package/esm/browser/i18n/zh/chat.js +16 -2
- package/esm/browser/i18n/zh/settings.js +29 -3
- package/esm/browser/i18n/zh/tools.js +1 -0
- package/esm/browser/i18n/zh-tw/chat.js +16 -2
- package/esm/browser/i18n/zh-tw/settings.js +29 -3
- package/esm/browser/i18n/zh-tw/tools.js +1 -0
- package/esm/browser/settings/agent-settings.js +12 -2
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +20 -1
- package/esm/browser/util/context-view.d.ts +16 -0
- package/esm/browser/util/context-view.js +42 -0
- package/esm/browser/util/progress.d.ts +4 -0
- package/esm/browser/util/progress.js +9 -3
- package/esm/browser/util/transcription.d.ts +29 -0
- package/esm/browser/util/transcription.js +83 -0
- package/lib/browser/assistant/assistant-ask-book.d.ts +10 -17
- package/lib/browser/assistant/assistant-ask-book.js +24 -61
- package/lib/browser/assistant/assistant-conversation.js +0 -2
- package/lib/browser/assistant/assistant-protocol.d.ts +4 -2
- package/lib/browser/assistant/assistant-role.d.ts +1 -1
- package/lib/browser/assistant/assistant-role.js +1 -1
- package/lib/browser/assistant/assistant-thread.js +3 -1
- package/lib/browser/assistant/assistant-view.js +8 -4
- package/lib/browser/assistant/assistant.d.ts +7 -2
- package/lib/browser/assistant/assistant.js +39 -8
- package/lib/browser/assistant/web-voice.d.ts +15 -0
- package/lib/browser/assistant/web-voice.js +40 -0
- package/lib/browser/components/chat-home-util.d.ts +5 -2
- package/lib/browser/components/chat-home-util.js +6 -3
- package/lib/browser/components/chat-list.js +1 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/context-act.d.ts +5 -0
- package/lib/browser/components/context-act.js +44 -0
- package/lib/browser/components/context-line.d.ts +20 -0
- package/lib/browser/components/context-line.js +109 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/message-list.js +12 -6
- package/lib/browser/components/message-steps.js +1 -1
- package/lib/browser/components/session-settings.d.ts +8 -4
- package/lib/browser/components/session-settings.js +10 -5
- package/lib/browser/components/session-view.js +12 -8
- package/lib/browser/extension/web-api-components.d.ts +19 -0
- package/lib/browser/extension/web-extension-context.js +2 -8
- package/lib/browser/i18n/en/chat.d.ts +16 -2
- package/lib/browser/i18n/en/chat.js +16 -2
- package/lib/browser/i18n/en/settings.d.ts +26 -0
- package/lib/browser/i18n/en/settings.js +29 -3
- package/lib/browser/i18n/en/tools.d.ts +1 -0
- package/lib/browser/i18n/en/tools.js +1 -0
- package/lib/browser/i18n/ja/chat.js +16 -2
- package/lib/browser/i18n/ja/settings.js +29 -3
- package/lib/browser/i18n/ja/tools.js +1 -0
- package/lib/browser/i18n/locales.d.ts +44 -3
- package/lib/browser/i18n/messages.d.ts +43 -2
- package/lib/browser/i18n/zh/chat.js +16 -2
- package/lib/browser/i18n/zh/settings.js +29 -3
- package/lib/browser/i18n/zh/tools.js +1 -0
- package/lib/browser/i18n/zh-tw/chat.js +16 -2
- package/lib/browser/i18n/zh-tw/settings.js +29 -3
- package/lib/browser/i18n/zh-tw/tools.js +1 -0
- package/lib/browser/settings/agent-settings.js +12 -2
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +20 -1
- package/lib/browser/util/context-view.d.ts +17 -0
- package/lib/browser/util/context-view.js +45 -0
- package/lib/browser/util/progress.d.ts +4 -0
- package/lib/browser/util/progress.js +9 -3
- package/lib/browser/util/transcription.d.ts +30 -0
- package/lib/browser/util/transcription.js +86 -0
- package/package.json +7 -7
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Transcription = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Writes down what is said until stopped, a meeting long (WebVoice.transcribe): a listening after another, each the
|
|
6
|
+
* words of a stretch of speech. A recognizer ends a listening on a silence, an utterance or a limit of its own; the
|
|
7
|
+
* next starts at once. The words of a listening come as they grow (`final` false), then once as they ended.
|
|
8
|
+
*/
|
|
9
|
+
var Transcription;
|
|
10
|
+
(function (Transcription) {
|
|
11
|
+
/** A listening that ends this soon having heard nothing counts as a quick one. */
|
|
12
|
+
Transcription.QUICK_MS = 1000;
|
|
13
|
+
/** Quick ones this many in a row end it: the recognizer cannot hear, and would be started again without end. */
|
|
14
|
+
Transcription.QUICK_TIMES = 5;
|
|
15
|
+
/** Starts it; undefined when the voice cannot listen. */
|
|
16
|
+
function start(voice, language, events, options = {}, now = Date.now) {
|
|
17
|
+
let ended = false;
|
|
18
|
+
let listening;
|
|
19
|
+
let heard = '';
|
|
20
|
+
let quick = 0;
|
|
21
|
+
const end = (error) => {
|
|
22
|
+
if (!ended) {
|
|
23
|
+
ended = true;
|
|
24
|
+
events.onEnd(error);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const commit = () => {
|
|
28
|
+
const text = heard.trim();
|
|
29
|
+
heard = '';
|
|
30
|
+
if (text) {
|
|
31
|
+
events.onText(text, true);
|
|
32
|
+
}
|
|
33
|
+
return text !== '';
|
|
34
|
+
};
|
|
35
|
+
const next = () => {
|
|
36
|
+
const at = now();
|
|
37
|
+
heard = '';
|
|
38
|
+
let done = false;
|
|
39
|
+
listening = voice.listen(language, text => {
|
|
40
|
+
if (!ended && !done) {
|
|
41
|
+
heard = text;
|
|
42
|
+
events.onText(text, false);
|
|
43
|
+
}
|
|
44
|
+
}, error => {
|
|
45
|
+
if (ended || done) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
done = true;
|
|
49
|
+
listening = undefined;
|
|
50
|
+
if (commit()) {
|
|
51
|
+
quick = 0;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
quick = now() - at < Transcription.QUICK_MS ? quick + 1 : 0;
|
|
55
|
+
}
|
|
56
|
+
if (error) {
|
|
57
|
+
end(error);
|
|
58
|
+
}
|
|
59
|
+
else if (quick >= Transcription.QUICK_TIMES) {
|
|
60
|
+
end('no-speech');
|
|
61
|
+
}
|
|
62
|
+
else if (!next()) {
|
|
63
|
+
end('unavailable');
|
|
64
|
+
}
|
|
65
|
+
}, { continuous: true, ...(options.hints ? { hints: options.hints } : {}) });
|
|
66
|
+
return listening !== undefined;
|
|
67
|
+
};
|
|
68
|
+
if (!next()) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
stop: () => {
|
|
73
|
+
if (ended) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
commit();
|
|
77
|
+
const stopping = listening;
|
|
78
|
+
listening = undefined;
|
|
79
|
+
end();
|
|
80
|
+
stopping === null || stopping === void 0 ? void 0 : stopping.stop();
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
Transcription.start = start;
|
|
85
|
+
})(Transcription || (exports.Transcription = Transcription = {}));
|
|
86
|
+
//# sourceMappingURL=transcription.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-web",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.34.0",
|
|
4
4
|
"description": "The web client of ta serve: sessions, streaming messages, tool runs with diffs, and dialogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@celljs/core": "4.
|
|
37
|
-
"@celljs/react": "4.
|
|
38
|
-
"@celljs/ta-client": "4.
|
|
39
|
-
"@celljs/ta-protocol": "4.
|
|
40
|
-
"@celljs/ta-relay": "4.
|
|
41
|
-
"@celljs/widget": "4.
|
|
36
|
+
"@celljs/core": "4.34.0",
|
|
37
|
+
"@celljs/react": "4.34.0",
|
|
38
|
+
"@celljs/ta-client": "4.34.0",
|
|
39
|
+
"@celljs/ta-protocol": "4.34.0",
|
|
40
|
+
"@celljs/ta-relay": "4.34.0",
|
|
41
|
+
"@celljs/widget": "4.34.0",
|
|
42
42
|
"@types/three": "^0.187.0",
|
|
43
43
|
"@xterm/addon-fit": "^0.11.0",
|
|
44
44
|
"@xterm/addon-unicode11": "^0.9.0",
|