koneck 2.72.0 → 2.73.1
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/clipboard.d.ts +46 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +81 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +37 -2
- package/dist/engine.js.map +1 -1
- package/dist/ink-chat.d.ts.map +1 -1
- package/dist/ink-chat.js +73 -6
- package/dist/ink-chat.js.map +1 -1
- package/dist/pace.d.ts +24 -3
- package/dist/pace.d.ts.map +1 -1
- package/dist/pace.js +81 -11
- package/dist/pace.js.map +1 -1
- package/dist/web/ui-client.d.ts.map +1 -1
- package/dist/web/ui-client.js +44 -10
- package/dist/web/ui-client.js.map +1 -1
- package/dist/web/ui.d.ts.map +1 -1
- package/dist/web/ui.js +16 -1
- package/dist/web/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/pace.d.ts
CHANGED
|
@@ -44,9 +44,30 @@ export declare function wireEffort(pace: Pace): 'low' | 'medium' | 'high';
|
|
|
44
44
|
/**
|
|
45
45
|
* Whether a refusal is about this parameter specifically.
|
|
46
46
|
*
|
|
47
|
-
* Only then is
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Only then is acting on it right. A 400 for something else — a context overflow, a malformed tool
|
|
48
|
+
* schema — must not be mistaken for "this model has no reasoning setting", or the setting would be
|
|
49
|
+
* quietly discarded for every model that ever had a bad day.
|
|
50
50
|
*/
|
|
51
51
|
export declare function looksLikeEffortUnsupported(err: unknown): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The values a provider says it will take, when it says so.
|
|
54
|
+
*
|
|
55
|
+
* Providers that refuse this parameter often name the alternatives in the same breath — "please use
|
|
56
|
+
* low, high or max" — and that is far more useful than knowing only that the value was wrong. It
|
|
57
|
+
* turns "drop the setting and hope" into "send one this model accepts".
|
|
58
|
+
*
|
|
59
|
+
* Read only after a cue that introduces a list, so a message merely containing the word "high"
|
|
60
|
+
* somewhere is not mistaken for an enumeration. The cues are in both languages for the same reason
|
|
61
|
+
* the refusal words are.
|
|
62
|
+
*/
|
|
63
|
+
export declare function acceptedEfforts(err: unknown): Pace[];
|
|
64
|
+
/**
|
|
65
|
+
* The accepted value closest to what was asked for, or null when none is.
|
|
66
|
+
*
|
|
67
|
+
* The paces form a ladder — low, medium, high, max — so "closest" is a distance along it. A tie
|
|
68
|
+
* goes to the lower rung on purpose: somebody who chose medium asked for balance rather than depth,
|
|
69
|
+
* and spending more than they asked for is the worse way to be wrong when the alternative is
|
|
70
|
+
* spending slightly less. Whatever is chosen is said out loud, so it can be overridden.
|
|
71
|
+
*/
|
|
72
|
+
export declare function nearestAccepted(pace: Pace, accepted: readonly Pace[]): Pace | null;
|
|
52
73
|
//# sourceMappingURL=pace.d.ts.map
|
package/dist/pace.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pace.d.ts","sourceRoot":"","sources":["../src/pace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,kGAAkG;AAClG,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAErD,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAAqC,CAAC;AAEvE,iFAAiF;AACjF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAS3C,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,IAAe,GAAG,IAAI,CAQxE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAEhE;
|
|
1
|
+
{"version":3,"file":"pace.d.ts","sourceRoot":"","sources":["../src/pace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,kGAAkG;AAClG,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAErD,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAAqC,CAAC;AAEvE,iFAAiF;AACjF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAS3C,CAAC;AAEF,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,IAAe,GAAG,IAAI,CAQxE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAEhE;AA0BD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAQhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,EAAE,CAWpD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,CAYlF"}
|
package/dist/pace.js
CHANGED
|
@@ -65,24 +65,94 @@ export function paceFrom(value, fallback = 'medium') {
|
|
|
65
65
|
export function wireEffort(pace) {
|
|
66
66
|
return pace === 'max' ? 'high' : pace;
|
|
67
67
|
}
|
|
68
|
+
/** Everything an error might be carrying, flattened into one lowercase string. */
|
|
69
|
+
function messageOf(err) {
|
|
70
|
+
const holder = err;
|
|
71
|
+
return [
|
|
72
|
+
typeof holder?.message === 'string' ? holder.message : '',
|
|
73
|
+
typeof holder?.error?.message === 'string' ? holder.error.message : '',
|
|
74
|
+
].join(' ').toLowerCase();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The words a provider uses for this parameter, in the languages they answer in.
|
|
78
|
+
*
|
|
79
|
+
* Chinese is here because a provider answered in it and the English-only test missed the refusal
|
|
80
|
+
* entirely: "该模型始终思考,不支持关闭思考;请使用 low、high 或 max。" is a refusal of exactly this
|
|
81
|
+
* parameter and contains no Latin letters until it lists the values it will take. 思考 is thinking,
|
|
82
|
+
* 推理 is reasoning. A detector that only reads English is a detector that works where it was
|
|
83
|
+
* written and nowhere else.
|
|
84
|
+
*/
|
|
85
|
+
const EFFORT_WORDS = /reasoning[_ ]?effort|reasoning|thinking|思考|推理/;
|
|
86
|
+
/** How a refusal is phrased, in either language. */
|
|
87
|
+
const REFUSAL_WORDS = /unsupported|not supported|unrecognized|unrecognised|unknown|invalid|unexpected|extra|not permitted|does not support|must be one of|不支持|无效|非法|请使用/;
|
|
68
88
|
/**
|
|
69
89
|
* Whether a refusal is about this parameter specifically.
|
|
70
90
|
*
|
|
71
|
-
* Only then is
|
|
72
|
-
*
|
|
73
|
-
*
|
|
91
|
+
* Only then is acting on it right. A 400 for something else — a context overflow, a malformed tool
|
|
92
|
+
* schema — must not be mistaken for "this model has no reasoning setting", or the setting would be
|
|
93
|
+
* quietly discarded for every model that ever had a bad day.
|
|
74
94
|
*/
|
|
75
95
|
export function looksLikeEffortUnsupported(err) {
|
|
76
|
-
const
|
|
77
|
-
const text = [
|
|
78
|
-
typeof holder?.message === 'string' ? holder.message : '',
|
|
79
|
-
typeof holder?.error?.message === 'string' ? holder.error.message : '',
|
|
80
|
-
].join(' ').toLowerCase();
|
|
96
|
+
const text = messageOf(err);
|
|
81
97
|
if (!text)
|
|
82
98
|
return false;
|
|
83
|
-
|
|
99
|
+
// A message that names the values it will accept is talking about this parameter whatever else
|
|
100
|
+
// it says, and is the clearest signal there is.
|
|
101
|
+
if (acceptedEfforts(err).length > 0)
|
|
102
|
+
return true;
|
|
103
|
+
if (!EFFORT_WORDS.test(text))
|
|
84
104
|
return false;
|
|
85
|
-
return
|
|
86
|
-
|
|
105
|
+
return REFUSAL_WORDS.test(text);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The values a provider says it will take, when it says so.
|
|
109
|
+
*
|
|
110
|
+
* Providers that refuse this parameter often name the alternatives in the same breath — "please use
|
|
111
|
+
* low, high or max" — and that is far more useful than knowing only that the value was wrong. It
|
|
112
|
+
* turns "drop the setting and hope" into "send one this model accepts".
|
|
113
|
+
*
|
|
114
|
+
* Read only after a cue that introduces a list, so a message merely containing the word "high"
|
|
115
|
+
* somewhere is not mistaken for an enumeration. The cues are in both languages for the same reason
|
|
116
|
+
* the refusal words are.
|
|
117
|
+
*/
|
|
118
|
+
export function acceptedEfforts(err) {
|
|
119
|
+
const text = messageOf(err);
|
|
120
|
+
if (!text)
|
|
121
|
+
return [];
|
|
122
|
+
const cue = /(?:please\s+)?use|must be one of|one of|supported values?(?:\s+are)?|请使用|仅支持|只支持/;
|
|
123
|
+
const at = text.search(cue);
|
|
124
|
+
if (at === -1)
|
|
125
|
+
return [];
|
|
126
|
+
// The tail after the cue, bounded: an enumeration follows its cue closely, and reading to the end
|
|
127
|
+
// of a long message would sweep up words from unrelated sentences.
|
|
128
|
+
const tail = text.slice(at, at + 120);
|
|
129
|
+
const found = PACES.filter(p => new RegExp('\\b' + p + '\\b').test(tail));
|
|
130
|
+
return found;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The accepted value closest to what was asked for, or null when none is.
|
|
134
|
+
*
|
|
135
|
+
* The paces form a ladder — low, medium, high, max — so "closest" is a distance along it. A tie
|
|
136
|
+
* goes to the lower rung on purpose: somebody who chose medium asked for balance rather than depth,
|
|
137
|
+
* and spending more than they asked for is the worse way to be wrong when the alternative is
|
|
138
|
+
* spending slightly less. Whatever is chosen is said out loud, so it can be overridden.
|
|
139
|
+
*/
|
|
140
|
+
export function nearestAccepted(pace, accepted) {
|
|
141
|
+
if (accepted.length === 0)
|
|
142
|
+
return null;
|
|
143
|
+
if (accepted.includes(pace))
|
|
144
|
+
return pace;
|
|
145
|
+
const rung = PACES.indexOf(pace);
|
|
146
|
+
let best = null;
|
|
147
|
+
let bestDistance = Infinity;
|
|
148
|
+
for (const candidate of accepted) {
|
|
149
|
+
const distance = Math.abs(PACES.indexOf(candidate) - rung);
|
|
150
|
+
// Strictly less, so the earlier — lower — candidate wins a tie, since PACES is in order.
|
|
151
|
+
if (distance < bestDistance) {
|
|
152
|
+
bestDistance = distance;
|
|
153
|
+
best = candidate;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return best;
|
|
87
157
|
}
|
|
88
158
|
//# sourceMappingURL=pace.js.map
|
package/dist/pace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pace.js","sourceRoot":"","sources":["../src/pace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,MAAM,CAAC,MAAM,KAAK,GAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvE,iFAAiF;AACjF,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,GAAG,EAAE,qFAAqF;UACrF,oDAAoD;IACzD,MAAM,EAAE,wFAAwF;UACxF,qBAAqB;IAC7B,IAAI,EAAE,2FAA2F;UAC3F,wCAAwC;IAC9C,GAAG,EAAE,uFAAuF;UACvF,kCAAkC;CACxC,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA2B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAE,WAAiB,QAAQ;IAChE,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,EAA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Ae,CAAC,IAAU,EAAE,QAAyB;IACnE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,IAAI,GAAgB,IAAI,CAAC;IAC7B,IAAI,YAAY,GAAG,QAAQ,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3D,yFAAyF;QACzF,IAAI,QAAQ,GAAG,YAAY,EAAE,CAAC;YAAC,YAAY,GAAG,QAAQ,CAAC;YAAC,IAAI,GAAG,SAAS,CAAC;QAAC,CAAC;IAC7E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-client.d.ts","sourceRoot":"","sources":["../../src/web/ui-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"ui-client.d.ts","sourceRoot":"","sources":["../../src/web/ui-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAgqKrC"}
|
package/dist/web/ui-client.js
CHANGED
|
@@ -4857,22 +4857,37 @@ async function fillProviders(selected) {
|
|
|
4857
4857
|
}
|
|
4858
4858
|
|
|
4859
4859
|
/**
|
|
4860
|
-
* The key field,
|
|
4860
|
+
* The key field, and how to reach it when a key is already there.
|
|
4861
4861
|
*
|
|
4862
|
-
* A provider that needs no credential should not be asked for one, and one
|
|
4863
|
-
*
|
|
4864
|
-
*
|
|
4865
|
-
*
|
|
4862
|
+
* A provider that needs no credential should not be asked for one, and one with a working key
|
|
4863
|
+
* should not be invited to overwrite it by accident. The second half of that was implemented by
|
|
4864
|
+
* hiding the field whenever a key was present — which also removed the only way to *replace* one.
|
|
4865
|
+
* A key that is wrong, expired, or being rotated after exposure could not be changed from the
|
|
4866
|
+
* browser at all: selecting the provider showed no field, no button and no message, which from the
|
|
4867
|
+
* outside is indistinguishable from the thing being broken.
|
|
4868
|
+
*
|
|
4869
|
+
* So the key in use is always named, and Replace reveals the field. Deliberate rather than
|
|
4870
|
+
* accidental, which is what hiding it was for.
|
|
4866
4871
|
*/
|
|
4867
4872
|
let keyRowFor = '';
|
|
4873
|
+
/** The provider whose field has been deliberately opened over an existing key. */
|
|
4874
|
+
let keyReplacing = '';
|
|
4868
4875
|
|
|
4869
4876
|
function showKeyRow(name) {
|
|
4870
4877
|
const row = providerRows.find((p) => p.name === name);
|
|
4871
|
-
const
|
|
4878
|
+
const missing = !!row && !row.keyless && !row.keyPresent;
|
|
4879
|
+
const needed = missing || (!!row && !row.keyless && keyReplacing === name);
|
|
4872
4880
|
$('keyrow').hidden = !needed;
|
|
4873
4881
|
// Only a change of provider clears what was said. This function also runs on the refresh that
|
|
4874
4882
|
// follows accepting a key, and clearing there would wipe the confirmation as it appeared.
|
|
4875
|
-
if (name !== keyRowFor) {
|
|
4883
|
+
if (name !== keyRowFor) {
|
|
4884
|
+
$('keysaid').textContent = '';
|
|
4885
|
+
keyRowFor = name;
|
|
4886
|
+
// Moving to another provider is not carrying on with the replacement you started on the last
|
|
4887
|
+
// one, and leaving the field open across the change is how a key gets filed against the wrong
|
|
4888
|
+
// provider — which has happened here before.
|
|
4889
|
+
keyReplacing = '';
|
|
4890
|
+
}
|
|
4876
4891
|
// A key already remembered is shown as remembered, with a way back out. Offering to enter one
|
|
4877
4892
|
// over the top of a working key is how somebody loses a key they still needed.
|
|
4878
4893
|
const remembered = !!row && row.keyRemembered;
|
|
@@ -4881,9 +4896,13 @@ function showKeyRow(name) {
|
|
|
4881
4896
|
// Which key this provider will use. A fingerprint, so the same key in the terminal and here can
|
|
4882
4897
|
// be recognised as the same key — the question that took a request capture to answer once.
|
|
4883
4898
|
const src = row && row.keySource;
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4899
|
+
const hasKey = !!row && !!row.keyPresent && !row.keyless;
|
|
4900
|
+
$('keywhich').hidden = !src || !hasKey;
|
|
4901
|
+
if (src && hasKey) {
|
|
4902
|
+
$('keywhichsays').textContent = 'Using ' + row.keyFingerprint + ', from ' + src + '. ';
|
|
4903
|
+
// Hidden while the field it opens is already open, so the button never sits above its own
|
|
4904
|
+
// effect saying "Replace it" at somebody who is mid-replacement.
|
|
4905
|
+
$('keyswap').hidden = keyReplacing === name;
|
|
4887
4906
|
}
|
|
4888
4907
|
if (!needed) return;
|
|
4889
4908
|
$('keywho').textContent = row.label || name;
|
|
@@ -4891,6 +4910,20 @@ function showKeyRow(name) {
|
|
|
4891
4910
|
$('keyin').value = '';
|
|
4892
4911
|
}
|
|
4893
4912
|
|
|
4913
|
+
/*
|
|
4914
|
+
* Replacing a key that is already there.
|
|
4915
|
+
*
|
|
4916
|
+
* Only ever reached by pressing the button, which is the difference between this and the field
|
|
4917
|
+
* simply always being open. Nothing is forgotten at this point — the existing key keeps working
|
|
4918
|
+
* until a new one is accepted, so a change of mind costs nothing.
|
|
4919
|
+
*/
|
|
4920
|
+
$('keyswap').onclick = () => {
|
|
4921
|
+
keyReplacing = $('mprov').value;
|
|
4922
|
+
$('keysaid').textContent = '';
|
|
4923
|
+
showKeyRow(keyReplacing);
|
|
4924
|
+
$('keyin').focus();
|
|
4925
|
+
};
|
|
4926
|
+
|
|
4894
4927
|
/*
|
|
4895
4928
|
* The failover policy: read when the dialog opens, written when Save is pressed.
|
|
4896
4929
|
*
|
|
@@ -4980,6 +5013,7 @@ $('keygo').onclick = async () => {
|
|
|
4980
5013
|
: 'Accepted for ' + who + ', this session only. To keep it, export ' + out.env
|
|
4981
5014
|
+ ' before starting KONECK.';
|
|
4982
5015
|
// The listing now reports it present, so the row goes away and the models can be asked again.
|
|
5016
|
+
keyReplacing = '';
|
|
4983
5017
|
await fillProviders($('mprov').value);
|
|
4984
5018
|
catalog.provider = null;
|
|
4985
5019
|
void loadModels($('mprov').value, state.model === '-' ? '' : state.model);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-client.js","sourceRoot":"","sources":["../../src/web/ui-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"ui-client.js","sourceRoot":"","sources":["../../src/web/ui-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8pKlB,CAAC;AACF,CAAC"}
|
package/dist/web/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,wBAAgB,IAAI,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,wBAAgB,IAAI,IAAI,MAAM,CAkgB7B"}
|
package/dist/web/ui.js
CHANGED
|
@@ -467,7 +467,22 @@ export function page() {
|
|
|
467
467
|
<span id="fosaid" class="mnote"></span>
|
|
468
468
|
</div>
|
|
469
469
|
</div>
|
|
470
|
-
|
|
470
|
+
<!--
|
|
471
|
+
Which key is in use, and the way to change it.
|
|
472
|
+
==============================================
|
|
473
|
+
The field above appears only when a provider has no key — on the reasoning that somebody with a
|
|
474
|
+
working key should not be invited to overwrite it by accident. That reasoning left no way to
|
|
475
|
+
replace a key at all: a key that is wrong, expired, or being rotated after exposure could not be
|
|
476
|
+
changed from here, and selecting the provider showed nothing whatsoever. Which is what "it is
|
|
477
|
+
not saved, not even an alert" looks like from the outside — there was nothing to save into.
|
|
478
|
+
|
|
479
|
+
So the key in use is always named, and Replace reveals the field. Deliberate rather than
|
|
480
|
+
accidental, which was the whole point of hiding it.
|
|
481
|
+
-->
|
|
482
|
+
<div id="keywhich" class="mnote" hidden>
|
|
483
|
+
<span id="keywhichsays"></span>
|
|
484
|
+
<button type="button" class="keydrop" id="keyswap">Replace it</button>
|
|
485
|
+
</div>
|
|
471
486
|
<div id="keyhas" class="mnote" hidden>
|
|
472
487
|
A key for <b id="keyhaswho"></b> is remembered on this machine.
|
|
473
488
|
<button type="button" class="keydrop" id="keydrop">Forget it</button>
|
package/dist/web/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,IAAI;IAClB,OAAO;;;;;;;SAOA,GAAG,CAAC,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/web/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,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