@kortix/agent-tunnel 0.14.3 → 0.14.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kortix/agent-tunnel",
3
- "version": "0.14.3",
3
+ "version": "0.14.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/kortix-ai/suna.git",
@@ -38,12 +38,6 @@
38
38
  "hono": "^4.13.7",
39
39
  "ws": "^8.18.0"
40
40
  },
41
- "devDependencies": {
42
- "@types/bun": "^1.3.9",
43
- "@types/ws": "^8.5.13",
44
- "@typescript/native-preview": "7.0.0-dev.20260707.2",
45
- "typescript": "^5.4.0"
46
- },
47
41
  "keywords": [
48
42
  "tunnel",
49
43
  "relay",
@@ -0,0 +1,12 @@
1
+ import { expect, test } from 'bun:test';
2
+ import { anyFlag, isTruthyFlag } from './prompts';
3
+
4
+ test('flags accept only the existing lowercase truthy values', () => {
5
+ for (const value of ['true', '1', 'yes']) expect(isTruthyFlag(value)).toBe(true);
6
+ for (const value of [undefined, '', 'false', '0', 'no', 'TRUE', ' yes ']) {
7
+ expect(isTruthyFlag(value)).toBe(false);
8
+ }
9
+ expect(anyFlag({ yes: 'yes', no: 'false' }, ['missing', 'no', 'yes'])).toBe(true);
10
+ expect(anyFlag({ yes: 'yes', no: 'false' }, ['missing', 'no'])).toBe(false);
11
+ expect(anyFlag({ yes: 'yes' }, [])).toBe(false);
12
+ });
@@ -1,6 +1,3 @@
1
- import { createInterface } from 'readline/promises';
2
- import { c } from './terminal';
3
-
4
1
  export function isInteractiveTerminal(): boolean {
5
2
  return process.stdin.isTTY === true && process.stdout.isTTY === true;
6
3
  }
@@ -13,25 +10,3 @@ export function isTruthyFlag(value: string | undefined): boolean {
13
10
  export function anyFlag(flags: Record<string, string>, names: readonly string[]): boolean {
14
11
  return names.some((name) => isTruthyFlag(flags[name]));
15
12
  }
16
-
17
- export async function promptYesNo(question: string, defaultValue: boolean): Promise<boolean> {
18
- const suffix = defaultValue ? ' [Y/n] ' : ' [y/N] ';
19
- const rl = createInterface({ input: process.stdin, output: process.stdout });
20
- try {
21
- for (;;) {
22
- const answer = (await rl.question(`${question}${suffix}`)).trim().toLowerCase();
23
- if (!answer) return defaultValue;
24
- if (['y', 'yes'].includes(answer)) return true;
25
- if (['n', 'no'].includes(answer)) return false;
26
- console.log(` ${c.yellow}!${c.reset} Please answer yes or no.`);
27
- }
28
- } catch (error) {
29
- if (error instanceof Error && error.name === 'AbortError') {
30
- process.stdout.write('\n');
31
- process.exit(130);
32
- }
33
- throw error;
34
- } finally {
35
- rl.close();
36
- }
37
- }