@linkshell/gateway 0.2.21 → 0.2.23
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/gateway/src/auth-middleware.d.ts +31 -0
- package/dist/gateway/src/auth-middleware.js +154 -0
- package/dist/gateway/src/auth-middleware.js.map +1 -0
- package/dist/gateway/src/index.js +92 -0
- package/dist/gateway/src/index.js.map +1 -1
- package/dist/gateway/src/sessions.d.ts +2 -0
- package/dist/gateway/src/sessions.js +2 -0
- package/dist/gateway/src/sessions.js.map +1 -1
- package/dist/gateway/src/tunnel.js +77 -61
- package/dist/gateway/src/tunnel.js.map +1 -1
- package/dist/gateway/tsconfig.tsbuildinfo +1 -1
- package/dist/shared-protocol/src/index.d.ts +70 -36
- package/dist/shared-protocol/src/index.js +10 -0
- package/dist/shared-protocol/src/index.js.map +1 -1
- package/package.json +1 -1
- package/src/auth-middleware.ts +195 -0
- package/src/index.ts +104 -0
- package/src/sessions.ts +4 -0
- package/src/tunnel.ts +69 -58
|
@@ -18,9 +18,9 @@ export declare const envelopeSchema: z.ZodObject<{
|
|
|
18
18
|
ack: z.ZodOptional<z.ZodNumber>;
|
|
19
19
|
payload: z.ZodUnknown;
|
|
20
20
|
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
sessionId: string;
|
|
22
|
-
type: string;
|
|
23
21
|
id: string;
|
|
22
|
+
type: string;
|
|
23
|
+
sessionId: string;
|
|
24
24
|
timestamp: string;
|
|
25
25
|
terminalId?: string | undefined;
|
|
26
26
|
deviceId?: string | undefined;
|
|
@@ -29,9 +29,9 @@ export declare const envelopeSchema: z.ZodObject<{
|
|
|
29
29
|
ack?: number | undefined;
|
|
30
30
|
payload?: unknown;
|
|
31
31
|
}, {
|
|
32
|
-
sessionId: string;
|
|
33
|
-
type: string;
|
|
34
32
|
id: string;
|
|
33
|
+
type: string;
|
|
34
|
+
sessionId: string;
|
|
35
35
|
timestamp: string;
|
|
36
36
|
terminalId?: string | undefined;
|
|
37
37
|
deviceId?: string | undefined;
|
|
@@ -89,7 +89,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
|
|
|
89
89
|
}, "strip", z.ZodTypeAny, {
|
|
90
90
|
role: "host" | "client";
|
|
91
91
|
clientName: string;
|
|
92
|
-
provider?: "
|
|
92
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
93
93
|
protocolVersion?: number | undefined;
|
|
94
94
|
hostname?: string | undefined;
|
|
95
95
|
platform?: string | undefined;
|
|
@@ -98,7 +98,7 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
|
|
|
98
98
|
}, {
|
|
99
99
|
role: "host" | "client";
|
|
100
100
|
clientName: string;
|
|
101
|
-
provider?: "
|
|
101
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
102
102
|
protocolVersion?: number | undefined;
|
|
103
103
|
hostname?: string | undefined;
|
|
104
104
|
platform?: string | undefined;
|
|
@@ -248,8 +248,8 @@ export declare const screenStatusPayloadSchema: z.ZodObject<{
|
|
|
248
248
|
error?: string | undefined;
|
|
249
249
|
}, {
|
|
250
250
|
active: boolean;
|
|
251
|
-
error?: string | undefined;
|
|
252
251
|
mode?: "webrtc" | "fallback" | "off" | undefined;
|
|
252
|
+
error?: string | undefined;
|
|
253
253
|
}>;
|
|
254
254
|
export declare const screenOfferPayloadSchema: z.ZodObject<{
|
|
255
255
|
sdp: z.ZodString;
|
|
@@ -283,10 +283,10 @@ export declare const terminalSpawnPayloadSchema: z.ZodObject<{
|
|
|
283
283
|
provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
|
|
284
284
|
}, "strip", z.ZodTypeAny, {
|
|
285
285
|
cwd: string;
|
|
286
|
-
provider?: "
|
|
286
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
287
287
|
}, {
|
|
288
288
|
cwd: string;
|
|
289
|
-
provider?: "
|
|
289
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
290
290
|
}>;
|
|
291
291
|
export declare const terminalInfoSchema: z.ZodObject<{
|
|
292
292
|
terminalId: z.ZodString;
|
|
@@ -295,14 +295,14 @@ export declare const terminalInfoSchema: z.ZodObject<{
|
|
|
295
295
|
provider: z.ZodString;
|
|
296
296
|
status: z.ZodEnum<["running", "exited"]>;
|
|
297
297
|
}, "strip", z.ZodTypeAny, {
|
|
298
|
-
status: "running" | "exited";
|
|
299
298
|
terminalId: string;
|
|
299
|
+
status: "running" | "exited";
|
|
300
300
|
provider: string;
|
|
301
301
|
cwd: string;
|
|
302
302
|
projectName: string;
|
|
303
303
|
}, {
|
|
304
|
-
status: "running" | "exited";
|
|
305
304
|
terminalId: string;
|
|
305
|
+
status: "running" | "exited";
|
|
306
306
|
provider: string;
|
|
307
307
|
cwd: string;
|
|
308
308
|
projectName: string;
|
|
@@ -315,30 +315,30 @@ export declare const terminalListPayloadSchema: z.ZodObject<{
|
|
|
315
315
|
provider: z.ZodString;
|
|
316
316
|
status: z.ZodEnum<["running", "exited"]>;
|
|
317
317
|
}, "strip", z.ZodTypeAny, {
|
|
318
|
-
status: "running" | "exited";
|
|
319
318
|
terminalId: string;
|
|
319
|
+
status: "running" | "exited";
|
|
320
320
|
provider: string;
|
|
321
321
|
cwd: string;
|
|
322
322
|
projectName: string;
|
|
323
323
|
}, {
|
|
324
|
-
status: "running" | "exited";
|
|
325
324
|
terminalId: string;
|
|
325
|
+
status: "running" | "exited";
|
|
326
326
|
provider: string;
|
|
327
327
|
cwd: string;
|
|
328
328
|
projectName: string;
|
|
329
329
|
}>, "many">;
|
|
330
330
|
}, "strip", z.ZodTypeAny, {
|
|
331
331
|
terminals: {
|
|
332
|
-
status: "running" | "exited";
|
|
333
332
|
terminalId: string;
|
|
333
|
+
status: "running" | "exited";
|
|
334
334
|
provider: string;
|
|
335
335
|
cwd: string;
|
|
336
336
|
projectName: string;
|
|
337
337
|
}[];
|
|
338
338
|
}, {
|
|
339
339
|
terminals: {
|
|
340
|
-
status: "running" | "exited";
|
|
341
340
|
terminalId: string;
|
|
341
|
+
status: "running" | "exited";
|
|
342
342
|
provider: string;
|
|
343
343
|
cwd: string;
|
|
344
344
|
projectName: string;
|
|
@@ -455,7 +455,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
|
|
|
455
455
|
}>>;
|
|
456
456
|
pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
|
|
457
457
|
}, "strip", z.ZodTypeAny, {
|
|
458
|
-
phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting"
|
|
458
|
+
phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
|
|
459
459
|
seq?: number | undefined;
|
|
460
460
|
toolName?: string | undefined;
|
|
461
461
|
toolInput?: string | undefined;
|
|
@@ -470,7 +470,7 @@ export declare const terminalStatusPayloadSchema: z.ZodObject<{
|
|
|
470
470
|
} | undefined;
|
|
471
471
|
pendingPermissionCount?: number | undefined;
|
|
472
472
|
}, {
|
|
473
|
-
phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting"
|
|
473
|
+
phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
|
|
474
474
|
seq?: number | undefined;
|
|
475
475
|
toolName?: string | undefined;
|
|
476
476
|
toolInput?: string | undefined;
|
|
@@ -523,17 +523,17 @@ export declare const tunnelRequestPayloadSchema: z.ZodObject<{
|
|
|
523
523
|
body: z.ZodNullable<z.ZodString>;
|
|
524
524
|
port: z.ZodNumber;
|
|
525
525
|
}, "strip", z.ZodTypeAny, {
|
|
526
|
-
headers: Record<string, string>;
|
|
527
526
|
requestId: string;
|
|
528
527
|
method: string;
|
|
529
528
|
url: string;
|
|
529
|
+
headers: Record<string, string>;
|
|
530
530
|
body: string | null;
|
|
531
531
|
port: number;
|
|
532
532
|
}, {
|
|
533
|
-
headers: Record<string, string>;
|
|
534
533
|
requestId: string;
|
|
535
534
|
method: string;
|
|
536
535
|
url: string;
|
|
536
|
+
headers: Record<string, string>;
|
|
537
537
|
body: string | null;
|
|
538
538
|
port: number;
|
|
539
539
|
}>;
|
|
@@ -544,15 +544,15 @@ export declare const tunnelResponsePayloadSchema: z.ZodObject<{
|
|
|
544
544
|
body: z.ZodString;
|
|
545
545
|
isFinal: z.ZodBoolean;
|
|
546
546
|
}, "strip", z.ZodTypeAny, {
|
|
547
|
-
headers: Record<string, string>;
|
|
548
547
|
isFinal: boolean;
|
|
549
548
|
requestId: string;
|
|
549
|
+
headers: Record<string, string>;
|
|
550
550
|
body: string;
|
|
551
551
|
statusCode: number;
|
|
552
552
|
}, {
|
|
553
|
-
headers: Record<string, string>;
|
|
554
553
|
isFinal: boolean;
|
|
555
554
|
requestId: string;
|
|
555
|
+
headers: Record<string, string>;
|
|
556
556
|
body: string;
|
|
557
557
|
statusCode: number;
|
|
558
558
|
}>;
|
|
@@ -582,6 +582,23 @@ export declare const tunnelWsClosePayloadSchema: z.ZodObject<{
|
|
|
582
582
|
code?: number | undefined;
|
|
583
583
|
reason?: string | undefined;
|
|
584
584
|
}>;
|
|
585
|
+
export declare const terminalHistoryRequestPayloadSchema: z.ZodObject<{
|
|
586
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
587
|
+
}, "strip", z.ZodTypeAny, {
|
|
588
|
+
count: number;
|
|
589
|
+
}, {
|
|
590
|
+
count?: number | undefined;
|
|
591
|
+
}>;
|
|
592
|
+
export declare const terminalHistoryResponsePayloadSchema: z.ZodObject<{
|
|
593
|
+
entries: z.ZodArray<z.ZodString, "many">;
|
|
594
|
+
shell: z.ZodOptional<z.ZodString>;
|
|
595
|
+
}, "strip", z.ZodTypeAny, {
|
|
596
|
+
entries: string[];
|
|
597
|
+
shell?: string | undefined;
|
|
598
|
+
}, {
|
|
599
|
+
entries: string[];
|
|
600
|
+
shell?: string | undefined;
|
|
601
|
+
}>;
|
|
585
602
|
export declare const protocolMessageSchemas: {
|
|
586
603
|
readonly "session.connect": z.ZodObject<{
|
|
587
604
|
role: z.ZodEnum<["host", "client"]>;
|
|
@@ -595,7 +612,7 @@ export declare const protocolMessageSchemas: {
|
|
|
595
612
|
}, "strip", z.ZodTypeAny, {
|
|
596
613
|
role: "host" | "client";
|
|
597
614
|
clientName: string;
|
|
598
|
-
provider?: "
|
|
615
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
599
616
|
protocolVersion?: number | undefined;
|
|
600
617
|
hostname?: string | undefined;
|
|
601
618
|
platform?: string | undefined;
|
|
@@ -604,7 +621,7 @@ export declare const protocolMessageSchemas: {
|
|
|
604
621
|
}, {
|
|
605
622
|
role: "host" | "client";
|
|
606
623
|
clientName: string;
|
|
607
|
-
provider?: "
|
|
624
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
608
625
|
protocolVersion?: number | undefined;
|
|
609
626
|
hostname?: string | undefined;
|
|
610
627
|
platform?: string | undefined;
|
|
@@ -800,8 +817,8 @@ export declare const protocolMessageSchemas: {
|
|
|
800
817
|
error?: string | undefined;
|
|
801
818
|
}, {
|
|
802
819
|
active: boolean;
|
|
803
|
-
error?: string | undefined;
|
|
804
820
|
mode?: "webrtc" | "fallback" | "off" | undefined;
|
|
821
|
+
error?: string | undefined;
|
|
805
822
|
}>;
|
|
806
823
|
readonly "screen.offer": z.ZodObject<{
|
|
807
824
|
sdp: z.ZodString;
|
|
@@ -845,10 +862,10 @@ export declare const protocolMessageSchemas: {
|
|
|
845
862
|
provider: z.ZodOptional<z.ZodEnum<["claude", "codex", "custom"]>>;
|
|
846
863
|
}, "strip", z.ZodTypeAny, {
|
|
847
864
|
cwd: string;
|
|
848
|
-
provider?: "
|
|
865
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
849
866
|
}, {
|
|
850
867
|
cwd: string;
|
|
851
|
-
provider?: "
|
|
868
|
+
provider?: "custom" | "claude" | "codex" | undefined;
|
|
852
869
|
}>;
|
|
853
870
|
readonly "terminal.spawned": z.ZodObject<{
|
|
854
871
|
terminalId: z.ZodString;
|
|
@@ -874,30 +891,30 @@ export declare const protocolMessageSchemas: {
|
|
|
874
891
|
provider: z.ZodString;
|
|
875
892
|
status: z.ZodEnum<["running", "exited"]>;
|
|
876
893
|
}, "strip", z.ZodTypeAny, {
|
|
877
|
-
status: "running" | "exited";
|
|
878
894
|
terminalId: string;
|
|
895
|
+
status: "running" | "exited";
|
|
879
896
|
provider: string;
|
|
880
897
|
cwd: string;
|
|
881
898
|
projectName: string;
|
|
882
899
|
}, {
|
|
883
|
-
status: "running" | "exited";
|
|
884
900
|
terminalId: string;
|
|
901
|
+
status: "running" | "exited";
|
|
885
902
|
provider: string;
|
|
886
903
|
cwd: string;
|
|
887
904
|
projectName: string;
|
|
888
905
|
}>, "many">;
|
|
889
906
|
}, "strip", z.ZodTypeAny, {
|
|
890
907
|
terminals: {
|
|
891
|
-
status: "running" | "exited";
|
|
892
908
|
terminalId: string;
|
|
909
|
+
status: "running" | "exited";
|
|
893
910
|
provider: string;
|
|
894
911
|
cwd: string;
|
|
895
912
|
projectName: string;
|
|
896
913
|
}[];
|
|
897
914
|
}, {
|
|
898
915
|
terminals: {
|
|
899
|
-
status: "running" | "exited";
|
|
900
916
|
terminalId: string;
|
|
917
|
+
status: "running" | "exited";
|
|
901
918
|
provider: string;
|
|
902
919
|
cwd: string;
|
|
903
920
|
projectName: string;
|
|
@@ -985,7 +1002,7 @@ export declare const protocolMessageSchemas: {
|
|
|
985
1002
|
}>>;
|
|
986
1003
|
pendingPermissionCount: z.ZodOptional<z.ZodNumber>;
|
|
987
1004
|
}, "strip", z.ZodTypeAny, {
|
|
988
|
-
phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting"
|
|
1005
|
+
phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
|
|
989
1006
|
seq?: number | undefined;
|
|
990
1007
|
toolName?: string | undefined;
|
|
991
1008
|
toolInput?: string | undefined;
|
|
@@ -1000,7 +1017,7 @@ export declare const protocolMessageSchemas: {
|
|
|
1000
1017
|
} | undefined;
|
|
1001
1018
|
pendingPermissionCount?: number | undefined;
|
|
1002
1019
|
}, {
|
|
1003
|
-
phase: "error" | "thinking" | "tool_use" | "outputting" | "waiting"
|
|
1020
|
+
phase: "idle" | "error" | "thinking" | "tool_use" | "outputting" | "waiting";
|
|
1004
1021
|
seq?: number | undefined;
|
|
1005
1022
|
toolName?: string | undefined;
|
|
1006
1023
|
toolInput?: string | undefined;
|
|
@@ -1033,17 +1050,17 @@ export declare const protocolMessageSchemas: {
|
|
|
1033
1050
|
body: z.ZodNullable<z.ZodString>;
|
|
1034
1051
|
port: z.ZodNumber;
|
|
1035
1052
|
}, "strip", z.ZodTypeAny, {
|
|
1036
|
-
headers: Record<string, string>;
|
|
1037
1053
|
requestId: string;
|
|
1038
1054
|
method: string;
|
|
1039
1055
|
url: string;
|
|
1056
|
+
headers: Record<string, string>;
|
|
1040
1057
|
body: string | null;
|
|
1041
1058
|
port: number;
|
|
1042
1059
|
}, {
|
|
1043
|
-
headers: Record<string, string>;
|
|
1044
1060
|
requestId: string;
|
|
1045
1061
|
method: string;
|
|
1046
1062
|
url: string;
|
|
1063
|
+
headers: Record<string, string>;
|
|
1047
1064
|
body: string | null;
|
|
1048
1065
|
port: number;
|
|
1049
1066
|
}>;
|
|
@@ -1054,15 +1071,15 @@ export declare const protocolMessageSchemas: {
|
|
|
1054
1071
|
body: z.ZodString;
|
|
1055
1072
|
isFinal: z.ZodBoolean;
|
|
1056
1073
|
}, "strip", z.ZodTypeAny, {
|
|
1057
|
-
headers: Record<string, string>;
|
|
1058
1074
|
isFinal: boolean;
|
|
1059
1075
|
requestId: string;
|
|
1076
|
+
headers: Record<string, string>;
|
|
1060
1077
|
body: string;
|
|
1061
1078
|
statusCode: number;
|
|
1062
1079
|
}, {
|
|
1063
|
-
headers: Record<string, string>;
|
|
1064
1080
|
isFinal: boolean;
|
|
1065
1081
|
requestId: string;
|
|
1082
|
+
headers: Record<string, string>;
|
|
1066
1083
|
body: string;
|
|
1067
1084
|
statusCode: number;
|
|
1068
1085
|
}>;
|
|
@@ -1092,6 +1109,23 @@ export declare const protocolMessageSchemas: {
|
|
|
1092
1109
|
code?: number | undefined;
|
|
1093
1110
|
reason?: string | undefined;
|
|
1094
1111
|
}>;
|
|
1112
|
+
readonly "terminal.history.request": z.ZodObject<{
|
|
1113
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
1114
|
+
}, "strip", z.ZodTypeAny, {
|
|
1115
|
+
count: number;
|
|
1116
|
+
}, {
|
|
1117
|
+
count?: number | undefined;
|
|
1118
|
+
}>;
|
|
1119
|
+
readonly "terminal.history.response": z.ZodObject<{
|
|
1120
|
+
entries: z.ZodArray<z.ZodString, "many">;
|
|
1121
|
+
shell: z.ZodOptional<z.ZodString>;
|
|
1122
|
+
}, "strip", z.ZodTypeAny, {
|
|
1123
|
+
entries: string[];
|
|
1124
|
+
shell?: string | undefined;
|
|
1125
|
+
}, {
|
|
1126
|
+
entries: string[];
|
|
1127
|
+
shell?: string | undefined;
|
|
1128
|
+
}>;
|
|
1095
1129
|
};
|
|
1096
1130
|
export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
|
|
1097
1131
|
export declare function createEnvelope<T>(input: {
|
|
@@ -237,6 +237,14 @@ export const tunnelWsClosePayloadSchema = z.object({
|
|
|
237
237
|
code: z.number().int().optional(),
|
|
238
238
|
reason: z.string().optional(),
|
|
239
239
|
});
|
|
240
|
+
// ── Terminal history payloads ─────────────────────────────────────
|
|
241
|
+
export const terminalHistoryRequestPayloadSchema = z.object({
|
|
242
|
+
count: z.number().int().min(1).max(500).default(100),
|
|
243
|
+
});
|
|
244
|
+
export const terminalHistoryResponsePayloadSchema = z.object({
|
|
245
|
+
entries: z.array(z.string()),
|
|
246
|
+
shell: z.string().optional(),
|
|
247
|
+
});
|
|
240
248
|
// ── Protocol message type registry ──────────────────────────────────
|
|
241
249
|
export const protocolMessageSchemas = {
|
|
242
250
|
"session.connect": sessionConnectPayloadSchema,
|
|
@@ -278,6 +286,8 @@ export const protocolMessageSchemas = {
|
|
|
278
286
|
"tunnel.response": tunnelResponsePayloadSchema,
|
|
279
287
|
"tunnel.ws.data": tunnelWsDataPayloadSchema,
|
|
280
288
|
"tunnel.ws.close": tunnelWsClosePayloadSchema,
|
|
289
|
+
"terminal.history.request": terminalHistoryRequestPayloadSchema,
|
|
290
|
+
"terminal.history.response": terminalHistoryResponsePayloadSchema,
|
|
281
291
|
};
|
|
282
292
|
// ── UUID helper (works in Node, Web, and Expo) ─────────────────────
|
|
283
293
|
function generateId() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../shared-protocol/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uEAAuE;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,uEAAuE;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,iBAAiB;IACjB,YAAY;IACZ,QAAQ;IACR,cAAc;IACd,MAAM;IACN,YAAY;CACb,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;CACf,CAAC,CAAC;AAGH,uEAAuE;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;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AQ,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,uEAAuE;AAEvE,MAAM,UAAU,cAAc,CAAI,KAUjC;IACC,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,UAAU,EAAE;QAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAiB;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,IAAW,EACX,OAAgB;IAEhB,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
|
|
3
|
+
const SUPABASE_URL = process.env.SUPABASE_URL ?? "";
|
|
4
|
+
const SUPABASE_ANON_KEY = process.env.SUPABASE_ANON_KEY ?? "";
|
|
5
|
+
const SUPABASE_SERVICE_ROLE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY ?? "";
|
|
6
|
+
const AUTH_REQUIRED = process.env.AUTH_REQUIRED === "true";
|
|
7
|
+
|
|
8
|
+
export { AUTH_REQUIRED, SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY };
|
|
9
|
+
|
|
10
|
+
export interface AuthResult {
|
|
11
|
+
authenticated: boolean;
|
|
12
|
+
userId?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
plan?: string;
|
|
15
|
+
subscribed?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Validate a Supabase JWT and check subscription via iTool's profiles table.
|
|
20
|
+
*/
|
|
21
|
+
async function validateToken(token: string): Promise<AuthResult> {
|
|
22
|
+
if (!SUPABASE_URL || !SUPABASE_ANON_KEY) {
|
|
23
|
+
return { authenticated: false };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const res = await fetch(`${SUPABASE_URL}/auth/v1/user`, {
|
|
28
|
+
headers: {
|
|
29
|
+
Authorization: `Bearer ${token}`,
|
|
30
|
+
apikey: SUPABASE_ANON_KEY,
|
|
31
|
+
},
|
|
32
|
+
signal: AbortSignal.timeout(5_000),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (!res.ok) return { authenticated: false };
|
|
36
|
+
|
|
37
|
+
const user = (await res.json()) as { id: string; email?: string };
|
|
38
|
+
|
|
39
|
+
// Check subscription from iTool's profiles table
|
|
40
|
+
let plan = "free";
|
|
41
|
+
let subscribed = false;
|
|
42
|
+
try {
|
|
43
|
+
const profileRes = await fetch(
|
|
44
|
+
`${SUPABASE_URL}/rest/v1/profiles?id=eq.${user.id}&select=plan,plan_expires_at&limit=1`,
|
|
45
|
+
{
|
|
46
|
+
headers: {
|
|
47
|
+
Authorization: `Bearer ${token}`,
|
|
48
|
+
apikey: SUPABASE_ANON_KEY,
|
|
49
|
+
},
|
|
50
|
+
signal: AbortSignal.timeout(5_000),
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
if (profileRes.ok) {
|
|
54
|
+
const profiles = (await profileRes.json()) as {
|
|
55
|
+
plan: string;
|
|
56
|
+
plan_expires_at: string | null;
|
|
57
|
+
}[];
|
|
58
|
+
if (profiles.length > 0) {
|
|
59
|
+
const p = profiles[0]!;
|
|
60
|
+
plan = p.plan;
|
|
61
|
+
subscribed =
|
|
62
|
+
p.plan === "pro" &&
|
|
63
|
+
!!p.plan_expires_at &&
|
|
64
|
+
new Date(p.plan_expires_at) > new Date();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch {}
|
|
68
|
+
|
|
69
|
+
return { authenticated: true, userId: user.id, email: user.email, plan, subscribed };
|
|
70
|
+
} catch {
|
|
71
|
+
return { authenticated: false };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Server-side subscription check using service role key (no user JWT needed).
|
|
77
|
+
*/
|
|
78
|
+
export async function checkSubscriptionByUserId(
|
|
79
|
+
userId: string,
|
|
80
|
+
): Promise<boolean> {
|
|
81
|
+
const key = SUPABASE_SERVICE_ROLE_KEY || SUPABASE_ANON_KEY;
|
|
82
|
+
if (!SUPABASE_URL || !key) return false;
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
const res = await fetch(
|
|
86
|
+
`${SUPABASE_URL}/rest/v1/profiles?id=eq.${userId}&select=plan,plan_expires_at&limit=1`,
|
|
87
|
+
{
|
|
88
|
+
headers: {
|
|
89
|
+
Authorization: `Bearer ${key}`,
|
|
90
|
+
apikey: SUPABASE_ANON_KEY,
|
|
91
|
+
},
|
|
92
|
+
signal: AbortSignal.timeout(5_000),
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
if (!res.ok) return false;
|
|
96
|
+
const profiles = (await res.json()) as {
|
|
97
|
+
plan: string;
|
|
98
|
+
plan_expires_at: string | null;
|
|
99
|
+
}[];
|
|
100
|
+
if (profiles.length === 0) return false;
|
|
101
|
+
const p = profiles[0]!;
|
|
102
|
+
return (
|
|
103
|
+
p.plan === "pro" &&
|
|
104
|
+
!!p.plan_expires_at &&
|
|
105
|
+
new Date(p.plan_expires_at) > new Date()
|
|
106
|
+
);
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function extractToken(req: IncomingMessage): string | null {
|
|
113
|
+
const auth = req.headers.authorization;
|
|
114
|
+
if (auth) {
|
|
115
|
+
const match = auth.match(/^Bearer\s+(.+)$/i);
|
|
116
|
+
if (match?.[1]) return match[1];
|
|
117
|
+
}
|
|
118
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
119
|
+
const token = url.searchParams.get("auth_token");
|
|
120
|
+
if (token) return token;
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Validate token and return auth result (exported for /sessions/mine).
|
|
126
|
+
*/
|
|
127
|
+
export async function validateRequest(
|
|
128
|
+
req: IncomingMessage,
|
|
129
|
+
): Promise<AuthResult | null> {
|
|
130
|
+
const token = extractToken(req);
|
|
131
|
+
if (!token) return null;
|
|
132
|
+
const result = await validateToken(token);
|
|
133
|
+
return result.authenticated ? result : null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Auth middleware for premium gateway HTTP endpoints.
|
|
138
|
+
* Rejects non-subscribers with a message pointing to itool.tech.
|
|
139
|
+
*/
|
|
140
|
+
export async function requireAuth(
|
|
141
|
+
req: IncomingMessage,
|
|
142
|
+
res: ServerResponse,
|
|
143
|
+
): Promise<AuthResult | null> {
|
|
144
|
+
if (!AUTH_REQUIRED) {
|
|
145
|
+
return { authenticated: true };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const token = extractToken(req);
|
|
149
|
+
if (!token) {
|
|
150
|
+
res.writeHead(401, { "Content-Type": "application/json" });
|
|
151
|
+
res.end(JSON.stringify({ error: "auth_required", message: "Authentication required" }));
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const result = await validateToken(token);
|
|
156
|
+
if (!result.authenticated) {
|
|
157
|
+
res.writeHead(401, { "Content-Type": "application/json" });
|
|
158
|
+
res.end(JSON.stringify({ error: "invalid_token", message: "Invalid or expired token" }));
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (!result.subscribed) {
|
|
163
|
+
res.writeHead(403, { "Content-Type": "application/json" });
|
|
164
|
+
res.end(
|
|
165
|
+
JSON.stringify({
|
|
166
|
+
error: "subscription_required",
|
|
167
|
+
message: "Pro subscription required. Subscribe at https://itool.tech",
|
|
168
|
+
}),
|
|
169
|
+
);
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Check auth for WebSocket upgrade requests.
|
|
178
|
+
* Returns AuthResult or null if unauthorized.
|
|
179
|
+
*/
|
|
180
|
+
export async function checkWsAuth(
|
|
181
|
+
req: IncomingMessage,
|
|
182
|
+
): Promise<AuthResult | null> {
|
|
183
|
+
if (!AUTH_REQUIRED) {
|
|
184
|
+
return { authenticated: true };
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const token = extractToken(req);
|
|
188
|
+
if (!token) return null;
|
|
189
|
+
|
|
190
|
+
const result = await validateToken(token);
|
|
191
|
+
if (!result.authenticated) return null;
|
|
192
|
+
if (!result.subscribed) return null;
|
|
193
|
+
|
|
194
|
+
return result;
|
|
195
|
+
}
|