@envseal/prompters 0.1.0 → 0.1.2
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/ide.d.ts +1 -1
- package/dist/loopback.d.ts +1 -1
- package/dist/loopback.js +5 -4
- package/dist/native.d.ts +1 -1
- package/dist/none.d.ts +1 -1
- package/dist/tty.d.ts +1 -1
- package/dist/tty.js +0 -1
- package/package.json +11 -2
package/dist/ide.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PromptRequest, PromptResponse } from './types.js';
|
|
2
2
|
export declare class IdePrompter {
|
|
3
|
-
readonly id:
|
|
3
|
+
readonly id: "ide";
|
|
4
4
|
available(): Promise<boolean>;
|
|
5
5
|
cancel(ticket: string): Promise<void>;
|
|
6
6
|
prompt(req: PromptRequest): Promise<PromptResponse>;
|
package/dist/loopback.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface LoopbackPrompterOptions {
|
|
|
12
12
|
}) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare class LoopbackPrompter implements Prompter {
|
|
15
|
-
readonly id:
|
|
15
|
+
readonly id: "loopback-browser";
|
|
16
16
|
private readonly options;
|
|
17
17
|
private openerProbe;
|
|
18
18
|
private current;
|
package/dist/loopback.js
CHANGED
|
@@ -230,7 +230,7 @@ export class LoopbackPrompter {
|
|
|
230
230
|
const promptPromise = new Promise((resolve) => {
|
|
231
231
|
resolvePrompt = resolve;
|
|
232
232
|
});
|
|
233
|
-
|
|
233
|
+
const state = {};
|
|
234
234
|
let complete = () => { };
|
|
235
235
|
let teardown = () => { };
|
|
236
236
|
const sockets = new Set();
|
|
@@ -262,8 +262,8 @@ export class LoopbackPrompter {
|
|
|
262
262
|
settled = true;
|
|
263
263
|
clearTimeout(timer);
|
|
264
264
|
teardown();
|
|
265
|
-
if (launchedUrl !== undefined) {
|
|
266
|
-
resolvePrompt({ ticket: req.ticket, results, url: launchedUrl });
|
|
265
|
+
if (state.launchedUrl !== undefined) {
|
|
266
|
+
resolvePrompt({ ticket: req.ticket, results, url: state.launchedUrl });
|
|
267
267
|
}
|
|
268
268
|
else {
|
|
269
269
|
resolvePrompt({ ticket: req.ticket, results });
|
|
@@ -299,7 +299,8 @@ export class LoopbackPrompter {
|
|
|
299
299
|
const launched = this.options.openBrowser === false
|
|
300
300
|
? { ok: false, url: fallbackUrl }
|
|
301
301
|
: await openBrowser(address.port, pathNonce);
|
|
302
|
-
|
|
302
|
+
if (!launched.ok)
|
|
303
|
+
state.launchedUrl = launched.url;
|
|
303
304
|
const result = await promptPromise;
|
|
304
305
|
if (this.current !== null && this.current.ticket === req.ticket) {
|
|
305
306
|
this.current = null;
|
package/dist/native.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Prompter, PromptRequest, PromptResponse } from './types.js';
|
|
2
2
|
export declare class NativePrompter implements Prompter {
|
|
3
|
-
readonly id:
|
|
3
|
+
readonly id: "native-dialog";
|
|
4
4
|
private adapter;
|
|
5
5
|
available(): Promise<boolean>;
|
|
6
6
|
cancel(_ticket: string): Promise<void>;
|
package/dist/none.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Prompter, PromptRequest, PromptResponse } from './types.js';
|
|
|
4
4
|
* MUST NOT fall back to asking in chat.
|
|
5
5
|
*/
|
|
6
6
|
export declare class NonePrompter implements Prompter {
|
|
7
|
-
readonly id:
|
|
7
|
+
readonly id: "none";
|
|
8
8
|
available(): Promise<boolean>;
|
|
9
9
|
cancel(_ticket: string): Promise<void>;
|
|
10
10
|
prompt(req: PromptRequest): Promise<PromptResponse>;
|
package/dist/tty.d.ts
CHANGED
package/dist/tty.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envseal/prompters",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,11 +20,20 @@
|
|
|
20
20
|
"provenance": true
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@envseal/protocol": "0.1.
|
|
23
|
+
"@envseal/protocol": "0.1.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"undici": "^7.2.0"
|
|
27
27
|
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/NDilanka/envseal.git",
|
|
31
|
+
"directory": "prompters/package.json"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/NDilanka/envseal#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/NDilanka/envseal/issues"
|
|
36
|
+
},
|
|
28
37
|
"scripts": {
|
|
29
38
|
"build": "tsc -p tsconfig.json",
|
|
30
39
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|