@atlaskit/editor-plugin-autocomplete 9.0.0 → 9.2.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/CHANGELOG.md +133 -0
- package/dist/cjs/pm-plugins/autocomplete-plugin.js +564 -67
- package/dist/cjs/pm-plugins/debug-mode.js +28 -2
- package/dist/cjs/pm-plugins/inline-code-harvester.js +576 -0
- package/dist/cjs/pm-plugins/text-predictor.js +437 -178
- package/dist/es2019/pm-plugins/autocomplete-plugin.js +515 -52
- package/dist/es2019/pm-plugins/debug-mode.js +27 -1
- package/dist/es2019/pm-plugins/inline-code-harvester.js +455 -0
- package/dist/es2019/pm-plugins/text-predictor.js +223 -3
- package/dist/esm/pm-plugins/autocomplete-plugin.js +562 -67
- package/dist/esm/pm-plugins/debug-mode.js +27 -1
- package/dist/esm/pm-plugins/inline-code-harvester.js +572 -0
- package/dist/esm/pm-plugins/text-predictor.js +437 -178
- package/dist/types/pm-plugins/autocomplete-plugin.d.ts +37 -0
- package/dist/types/pm-plugins/debug-mode.d.ts +34 -0
- package/dist/types/pm-plugins/inline-code-harvester.d.ts +146 -0
- package/dist/types/pm-plugins/text-predictor.d.ts +105 -3
- package/package.json +2 -2
- package/src/pm-plugins/autocomplete-plugin.ts +589 -48
- package/src/pm-plugins/debug-mode.ts +47 -1
- package/src/pm-plugins/inline-code-harvester.ts +561 -0
- package/src/pm-plugins/text-predictor.ts +274 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,138 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-autocomplete
|
|
2
2
|
|
|
3
|
+
## 9.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`027dc05ee4e0d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/027dc05ee4e0d) -
|
|
8
|
+
Suggest inline-code identifiers the session has seen, for hosts that opt in with the new
|
|
9
|
+
`harvestInlineCode` plugin option — which Rovo Chat now does.
|
|
10
|
+
|
|
11
|
+
A term like `ml-studio` cannot be suggested today whatever the session does with it:
|
|
12
|
+
`incrementSessionFreq` only touches trie nodes that already exist, so a word the shipped
|
|
13
|
+
vocabulary does not hold is silently discarded. The new harvester collects backticked spans from
|
|
14
|
+
ingested reply and page text and code-marked spans from the live document, drops anything with
|
|
15
|
+
internal whitespace, over 50 characters, not starting with a letter, or already served by L2/L3,
|
|
16
|
+
and holds the result to 200 surfaces with the least-mentioned evicted first.
|
|
17
|
+
|
|
18
|
+
A harvested surface has no frequency, no vector and no canonical token ids, so what stands in for
|
|
19
|
+
a score is where it is allowed to speak. It is offered only where the scored path has finished and
|
|
20
|
+
recorded that no vocabulary reaches the prefix at all — not when the 100ms budget expires, since
|
|
21
|
+
that means the ranker was still working. It asks for four typed characters rather than three,
|
|
22
|
+
respects the post-accept cooldown and the no-repeat check, and on accept rewrites the typed prefix
|
|
23
|
+
in the surface's own casing and marks it as code, because casing is load-bearing in code and being
|
|
24
|
+
marked as code is what authorized the suggestion. The stored mark is dropped straight after, since
|
|
25
|
+
the backtick input rule never ran and nothing else would close the span. It reports itself as a
|
|
26
|
+
new `harvest` value on `CompletionSource`, so its views and acceptances cannot move the headline
|
|
27
|
+
rate unattributed.
|
|
28
|
+
|
|
29
|
+
The harvester is a separate chunk, requested on first focus and only for a host that opted in, so
|
|
30
|
+
a host that has not stays exactly as it was and never downloads it. What it holds is readable at
|
|
31
|
+
any time with `__atlCtcDebug__.harvest()`, or `__atlCtcDebug__.harvest('ml-s')` to ask what a
|
|
32
|
+
prefix would be offered.
|
|
33
|
+
|
|
34
|
+
Both the harvested set and the L1 session boosts are now dropped when the session they describe
|
|
35
|
+
ends. A host whose editor does not last as long as what it is writing about can say so with the
|
|
36
|
+
new `contextScopeKey` on the context it returns: when the key changes, both stores are emptied and
|
|
37
|
+
the context reported with the new key is ingested as if it were the first, so anything still
|
|
38
|
+
current is primed again. The key is tracked beside the data it guards rather than per editor,
|
|
39
|
+
because a host may answer a navigation by replacing the editor instead of keeping it — read from a
|
|
40
|
+
new editor alone, every scope looks like the first one, while the previous scope's terms carry on
|
|
41
|
+
in the state they share. Teardown clears both stores as well, once the last editor has gone:
|
|
42
|
+
Confluence mounts several, and closing one reply must not wipe what the others primed.
|
|
43
|
+
`resetSessionBoosts` is exported for the same purpose, and `__atlCtcDebug__.session()` now lists
|
|
44
|
+
100 boosted words rather than 50.
|
|
45
|
+
|
|
46
|
+
Because those stores are shared, an editor that reported no scope is put back in the same tick an
|
|
47
|
+
eviction empties them, from the context it is already holding rather than a second read. A comment
|
|
48
|
+
box under a chat panel that switched conversation never asked to lose its page, and without this
|
|
49
|
+
it could not get it back either: the record of what an editor has ingested is per editor, so its
|
|
50
|
+
own page would read as already seen from then on. An editor that did report a scope is left alone,
|
|
51
|
+
since the scope being dropped may be its own — a page transition mounts the editor arriving before
|
|
52
|
+
tearing down the one leaving.
|
|
53
|
+
|
|
54
|
+
A context read requested while another is still open is now deferred until that one settles, where
|
|
55
|
+
before it was dropped. A scope change reaches the plugin as a context read, and a host that pushes
|
|
56
|
+
its context has no other channel to raise one on, so a read refused mid-navigation was an eviction
|
|
57
|
+
that never happened.
|
|
58
|
+
|
|
59
|
+
On the Rovo Chat side, chat messages now reach autocomplete through `extractCodeAwareTextFromAdf`,
|
|
60
|
+
the same extractor the page already uses. Assistant replies keep their backticks by arriving as
|
|
61
|
+
markdown, but a user's own inline code arrives as ADF and was being flattened by
|
|
62
|
+
`extractPlainTextFromAdf`, which drops the `code` mark — the only thing distinguishing an
|
|
63
|
+
identifier from a word. The L1 boost is unaffected, since its tokenizer strips backticks as
|
|
64
|
+
boundary punctuation. Each context read is stamped with the conversation and the page the body in
|
|
65
|
+
it came from, and the stamp is reported even when there is nothing else to report: arriving at an
|
|
66
|
+
empty new chat is exactly when the previous one's terms most need dropping.
|
|
67
|
+
|
|
68
|
+
The page in that stamp is taken from the body rather than from where the host says the reader is,
|
|
69
|
+
and a host that publishes the page it is on has its empty answer read as "no page" rather than as
|
|
70
|
+
no answer. Confluence in-app navigation is why: it clears the page it was holding immediately, but
|
|
71
|
+
the content id the chat reads can lag it by a long way and sometimes never arrives, and a body
|
|
72
|
+
accepted only when the two agree is a page that is never read at all. Attributing a body to the
|
|
73
|
+
page it came from cannot offer one page's text under another's, which is what agreement was being
|
|
74
|
+
required for.
|
|
75
|
+
|
|
76
|
+
A body published by an editor is no longer attributed to a page it was already attributed
|
|
77
|
+
elsewhere for. The published document carries no page id, so the page has to come from where the
|
|
78
|
+
reader is, and that is the same answer whether the editor has just published or the store is still
|
|
79
|
+
holding the document from the page before. Two live docs in a row is where it showed: arriving at
|
|
80
|
+
the second turns editor publishing back on and asks again, while the first one's body is the only
|
|
81
|
+
one there is.
|
|
82
|
+
|
|
83
|
+
Dropping the boosts when the last editor goes is limited to hosts that scope their context, which
|
|
84
|
+
are the ones asking for their learning to end with the conversation. A host that sends no scope
|
|
85
|
+
has boosts belonging to the page it is on, and a comment box closes far more often than that page
|
|
86
|
+
changes.
|
|
87
|
+
|
|
88
|
+
A host that cannot answer a page read now reports it, once per chat input, as an operational
|
|
89
|
+
event. The read still succeeds without a page, which is the right thing for a keystroke to do and
|
|
90
|
+
also the reason the failure is otherwise invisible: the editor's own monitoring only sees reads
|
|
91
|
+
that reject, and the symptom of this one — no page context on viewed pages — looks the same as a
|
|
92
|
+
page with nothing worth learning in it.
|
|
93
|
+
|
|
94
|
+
Dropping the session boosts now reads an index of the nodes that were boosted rather than walking
|
|
95
|
+
the whole word trie for them, since it runs on every page change rather than only at teardown:
|
|
96
|
+
about 10ms of main thread on a large tenant vocabulary, twice per navigation, for a few hundred
|
|
97
|
+
words.
|
|
98
|
+
|
|
99
|
+
Both the option and the extraction carry the same
|
|
100
|
+
`platform_editor_ai_autocomplete_rovo_chat_editor` decision the rest of the chat's autocomplete
|
|
101
|
+
wiring does. With the experiment off no context is collected and the harvester chunk is never
|
|
102
|
+
requested.
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- Updated dependencies
|
|
107
|
+
|
|
108
|
+
## 9.1.0
|
|
109
|
+
|
|
110
|
+
### Minor Changes
|
|
111
|
+
|
|
112
|
+
- [`a164c6d8e7de6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a164c6d8e7de6) -
|
|
113
|
+
Offer the Confluence page the chat is open on to autocomplete as context, so words already written
|
|
114
|
+
on it carry an L1 session boost in the chat input. This reads the editor context the page editor
|
|
115
|
+
already publishes, so no host wiring is needed, and covers a page being edited; reaching a page
|
|
116
|
+
that is being viewed needs a host bridge that comes separately. The page text is held together
|
|
117
|
+
with the page it was read from, so navigating invalidates it in the same render that changes the
|
|
118
|
+
page rather than just after — the context store keeps the last published document until another
|
|
119
|
+
publisher replaces it, and that document does not say which page it came from.
|
|
120
|
+
|
|
121
|
+
Both the page and the chat transcript sit behind
|
|
122
|
+
`platform_editor_ai_autocomplete_rovo_chat_editor`, and the editor context subscription that reads
|
|
123
|
+
the page lives in a component the chat input only mounts once enrolled. An unenrolled session
|
|
124
|
+
therefore neither parses a page document for context it cannot use nor re-renders the input on a
|
|
125
|
+
publish, which the editor does on blur and on selection change.
|
|
126
|
+
|
|
127
|
+
Context text now waits for the vocabulary load to settle before it is applied. Session boosts were
|
|
128
|
+
previously spent against an empty trie whenever the page resolved first, which silently dropped
|
|
129
|
+
every word in it. What the session holds is readable from the console with
|
|
130
|
+
`__atlCtcDebug__.session()`.
|
|
131
|
+
|
|
132
|
+
### Patch Changes
|
|
133
|
+
|
|
134
|
+
- Updated dependencies
|
|
135
|
+
|
|
3
136
|
## 9.0.0
|
|
4
137
|
|
|
5
138
|
### Major Changes
|