@teammy/server 0.2.23 → 0.2.24

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.
Files changed (166) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -7
  3. package/dist/main.js +20331 -13329
  4. package/dist/native-pi-entry.js +755 -19
  5. package/dist/project-pi-entry.js +758 -22
  6. package/dist/runtime/en/shared/system.md +9 -0
  7. package/dist/runtime/en/shared/tools.json +22 -0
  8. package/dist/runtime/en/workflows/directory-analysis/prompt.md +11 -0
  9. package/dist/runtime/en/workflows/file-summary/prompt.md +7 -0
  10. package/dist/runtime/en/workflows/session-handoff/prompt.md +31 -0
  11. package/dist/runtime/en/workflows/session-overview/prompt.md +26 -0
  12. package/dist/runtime/en/workflows/task-bootstrap/prompt.md +84 -0
  13. package/dist/runtime/shared/system.md +1 -1
  14. package/dist/runtime/workflows/session-handoff/prompt.md +1 -1
  15. package/dist/runtime/workflows/session-overview/prompt.md +1 -1
  16. package/dist/web/THIRD-PARTY-LICENSES.md +2025 -0
  17. package/dist/web/assets/Assistant-BeWIo88A.js +1 -0
  18. package/dist/web/assets/{Computers-BtcIsnDD.css → Computers-BJKv9oJv.css} +1 -1
  19. package/dist/web/assets/Computers-CEBC9xd4.js +14 -0
  20. package/dist/web/assets/Conversation-BMA0djTl.js +1 -0
  21. package/dist/web/assets/Dashboard-DtNpBYI5.js +1 -0
  22. package/dist/web/assets/Files-C-00txBh.js +1 -0
  23. package/dist/web/assets/Help-C5yLJzSE.js +2392 -0
  24. package/dist/web/assets/MessageComposer-D7ml-LaD.js +1 -0
  25. package/dist/web/assets/MessageComposer-DqcbXBIG.css +1 -0
  26. package/dist/web/assets/ResourceLibrary-Ceon9f0i.js +6 -0
  27. package/dist/web/assets/TerminalPane-CZYb0vIG.js +22 -0
  28. package/dist/web/assets/WorkspaceTree-C2sVptdG.js +1 -0
  29. package/dist/web/assets/file-links-CQ6ShuxD.js +1 -0
  30. package/dist/web/assets/index-B9gF6reY.css +1 -0
  31. package/dist/web/assets/index-BCj5CDtq.js +40 -0
  32. package/dist/web/assets/project-links-BwYckk7L.js +105 -0
  33. package/dist/web/assets/workflow-DR-M8YZx.svg +111 -0
  34. package/dist/web/downloads/teammy-inbox-skill.zip +0 -0
  35. package/dist/web/downloads/teammy-skill.zip +0 -0
  36. package/dist/web/index.html +4 -4
  37. package/dist/web/notification-worker.js +2 -10
  38. package/node_modules/i18next/LICENSE +21 -0
  39. package/node_modules/i18next/README.md +77 -0
  40. package/node_modules/i18next/dist/cjs/i18next.js +2495 -0
  41. package/node_modules/i18next/dist/esm/i18next.js +2505 -0
  42. package/node_modules/i18next/dist/esm/package.json +1 -0
  43. package/node_modules/i18next/dist/umd/i18next.js +2501 -0
  44. package/node_modules/i18next/dist/umd/i18next.min.js +1 -0
  45. package/node_modules/i18next/i18next.js +2501 -0
  46. package/node_modules/i18next/i18next.min.js +1 -0
  47. package/node_modules/i18next/index.d.mts +71 -0
  48. package/node_modules/i18next/index.d.ts +739 -0
  49. package/node_modules/i18next/package.json +125 -0
  50. package/node_modules/i18next/typescript/helpers.d.ts +73 -0
  51. package/node_modules/i18next/typescript/options.d.ts +871 -0
  52. package/node_modules/i18next/typescript/t.d.ts +1449 -0
  53. package/node_modules/jose/LICENSE.md +21 -0
  54. package/node_modules/jose/README.md +150 -0
  55. package/node_modules/jose/dist/types/index.d.ts +55 -0
  56. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +25 -0
  57. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +40 -0
  58. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +25 -0
  59. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +46 -0
  60. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +29 -0
  61. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +51 -0
  62. package/node_modules/jose/dist/types/jwk/embedded.d.ts +10 -0
  63. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +15 -0
  64. package/node_modules/jose/dist/types/jwks/local.d.ts +17 -0
  65. package/node_modules/jose/dist/types/jwks/remote.d.ts +94 -0
  66. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +21 -0
  67. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +25 -0
  68. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +23 -0
  69. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +26 -0
  70. package/node_modules/jose/dist/types/jws/general/sign.d.ts +41 -0
  71. package/node_modules/jose/dist/types/jws/general/verify.d.ts +31 -0
  72. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +38 -0
  73. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +57 -0
  74. package/node_modules/jose/dist/types/jwt/sign.d.ts +21 -0
  75. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +21 -0
  76. package/node_modules/jose/dist/types/jwt/verify.d.ts +36 -0
  77. package/node_modules/jose/dist/types/key/export.d.ts +19 -0
  78. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +33 -0
  79. package/node_modules/jose/dist/types/key/generate_secret.d.ts +30 -0
  80. package/node_modules/jose/dist/types/key/import.d.ts +67 -0
  81. package/node_modules/jose/dist/types/types.d.ts +802 -0
  82. package/node_modules/jose/dist/types/util/base64url.d.ts +16 -0
  83. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +9 -0
  84. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +10 -0
  85. package/node_modules/jose/dist/types/util/errors.d.ts +182 -0
  86. package/node_modules/jose/dist/webapi/index.js +70 -0
  87. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -0
  88. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +26 -0
  89. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +15 -0
  90. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +35 -0
  91. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +41 -0
  92. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +105 -0
  93. package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -0
  94. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +55 -0
  95. package/node_modules/jose/dist/webapi/jwks/local.js +60 -0
  96. package/node_modules/jose/dist/webapi/jwks/remote.js +103 -0
  97. package/node_modules/jose/dist/webapi/jws/compact/sign.js +20 -0
  98. package/node_modules/jose/dist/webapi/jws/compact/verify.js +8 -0
  99. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +23 -0
  100. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +12 -0
  101. package/node_modules/jose/dist/webapi/jws/general/sign.js +58 -0
  102. package/node_modules/jose/dist/webapi/jws/general/verify.js +42 -0
  103. package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -0
  104. package/node_modules/jose/dist/webapi/jwt/encrypt.js +42 -0
  105. package/node_modules/jose/dist/webapi/jwt/sign.js +19 -0
  106. package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -0
  107. package/node_modules/jose/dist/webapi/jwt/verify.js +13 -0
  108. package/node_modules/jose/dist/webapi/key/export.js +35 -0
  109. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +35 -0
  110. package/node_modules/jose/dist/webapi/key/generate_secret.js +36 -0
  111. package/node_modules/jose/dist/webapi/key/import.js +53 -0
  112. package/node_modules/jose/dist/webapi/lib/asn1.js +138 -0
  113. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +75 -0
  114. package/node_modules/jose/dist/webapi/lib/content_encryption.js +90 -0
  115. package/node_modules/jose/dist/webapi/lib/deflate.js +41 -0
  116. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +116 -0
  117. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +190 -0
  118. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +75 -0
  119. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +74 -0
  120. package/node_modules/jose/dist/webapi/lib/jws_sign.js +46 -0
  121. package/node_modules/jose/dist/webapi/lib/jws_verify.js +89 -0
  122. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +150 -0
  123. package/node_modules/jose/dist/webapi/lib/key.js +157 -0
  124. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +15 -0
  125. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +9 -0
  126. package/node_modules/jose/dist/webapi/lib/key_management.js +195 -0
  127. package/node_modules/jose/dist/webapi/lib/validate.js +122 -0
  128. package/node_modules/jose/dist/webapi/util/base64url.js +16 -0
  129. package/node_modules/jose/dist/webapi/util/decode_jwt.js +33 -0
  130. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +19 -0
  131. package/node_modules/jose/dist/webapi/util/errors.js +109 -0
  132. package/node_modules/jose/package.json +134 -0
  133. package/node_modules/oauth4webapi/LICENSE.md +21 -0
  134. package/node_modules/oauth4webapi/README.md +104 -0
  135. package/node_modules/oauth4webapi/build/index.d.ts +3046 -0
  136. package/node_modules/oauth4webapi/build/index.js +2530 -0
  137. package/node_modules/oauth4webapi/build/index.js.map +1 -0
  138. package/node_modules/oauth4webapi/package.json +112 -0
  139. package/node_modules/openid-client/LICENSE.md +21 -0
  140. package/node_modules/openid-client/README.md +258 -0
  141. package/node_modules/openid-client/build/index.d.ts +2478 -0
  142. package/node_modules/openid-client/build/index.js +1347 -0
  143. package/node_modules/openid-client/build/index.js.map +1 -0
  144. package/node_modules/openid-client/build/passport.d.ts +258 -0
  145. package/node_modules/openid-client/build/passport.js +264 -0
  146. package/node_modules/openid-client/build/passport.js.map +1 -0
  147. package/node_modules/openid-client/package.json +130 -0
  148. package/package.json +5 -1
  149. package/dist/web/assets/Assistant-Dks48Y5w.js +0 -1
  150. package/dist/web/assets/Computers-CaCzZeCc.js +0 -13
  151. package/dist/web/assets/Conversation-kAMzKADw.js +0 -1
  152. package/dist/web/assets/Dashboard-ComNJNOg.js +0 -1
  153. package/dist/web/assets/Dropdown-DGFI68Vd.js +0 -55
  154. package/dist/web/assets/Files-Blsq_C-B.js +0 -1
  155. package/dist/web/assets/Help-BM23uS-t.js +0 -1079
  156. package/dist/web/assets/Markdown-CXnZDm5J.js +0 -29
  157. package/dist/web/assets/MessageComposer-BoOgfyPA.js +0 -1
  158. package/dist/web/assets/MessageComposer-hKEluJsT.css +0 -1
  159. package/dist/web/assets/ResourceLibrary-C12_47kE.js +0 -6
  160. package/dist/web/assets/TerminalPane-BTRM-36z.js +0 -22
  161. package/dist/web/assets/WorkspaceTree-Co7XG2RG.js +0 -1
  162. package/dist/web/assets/file-links-CoVqmrXg.js +0 -1
  163. package/dist/web/assets/index-CeKzFsxV.css +0 -1
  164. package/dist/web/assets/index-mhJ33-bH.js +0 -10
  165. package/dist/web/assets/task-links-BE36-8mc.js +0 -1
  166. /package/dist/web/assets/{Dropdown-ktgqMqAD.css → project-links-ktgqMqAD.css} +0 -0
@@ -0,0 +1,23 @@
1
+ import type * as t from '../../types.d.ts';
2
+ /** Produces flattened JWS JSON Serialization using a digital signature or MAC. */
3
+ export declare class FlattenedSign {
4
+ #private;
5
+ /**
6
+ * Creates a signer for flattened JWS JSON Serialization.
7
+ *
8
+ * @param payload JWS Payload bytes to sign or MAC.
9
+ */
10
+ constructor(payload: Uint8Array);
11
+ /** Sets the JWS Protected Header. May only be called once. */
12
+ setProtectedHeader(protectedHeader: t.JWSHeaderParameters): this;
13
+ /** Sets the JWS Unprotected Header. May only be called once. */
14
+ setUnprotectedHeader(unprotectedHeader: t.JWSHeaderParameters): this;
15
+ /**
16
+ * Computes the JWS Signature (digital signature or MAC) and returns the flattened JWS JSON
17
+ * Serialization.
18
+ *
19
+ * @param key Private key or shared secret. See
20
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
21
+ */
22
+ sign(key: t.KeyInput, options?: t.SignOptions): Promise<t.FlattenedJWS>;
23
+ }
@@ -0,0 +1,26 @@
1
+ import type * as t from '../../types.d.ts';
2
+ /** Resolves a key for Flattened JWS verification from unverified headers and token data. */
3
+ export interface FlattenedVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
4
+ }
5
+ /**
6
+ * Validates a flattened JWS JSON Serialization (digital signature or MAC) and decodes its JWS
7
+ * Payload.
8
+ *
9
+ * @param key Public key or shared secret. See
10
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
11
+ */
12
+ export declare function flattenedVerify(jws: t.FlattenedJWSInput, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult>;
13
+ /**
14
+ * Validates a flattened JWS JSON Serialization (digital signature or MAC) and decodes its JWS
15
+ * Payload with a dynamically resolved key, included in the result.
16
+ *
17
+ * @param getKey Resolves a public key or shared secret from unverified token data.
18
+ */
19
+ export declare function flattenedVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: t.FlattenedJWSInput, getKey: FlattenedVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult & t.ResolvedKey<KeyType>>;
20
+ /**
21
+ * Validates a flattened JWS JSON Serialization (digital signature or MAC) and decodes its JWS
22
+ * Payload using a key or key resolver. The result includes `key` only when a resolver is used.
23
+ *
24
+ * @param key Public key or shared secret, or a function resolving one.
25
+ */
26
+ export declare function flattenedVerify(jws: t.FlattenedJWSInput, key: t.KeyInput | FlattenedVerifyGetKey, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult & Partial<t.ResolvedKey>>;
@@ -0,0 +1,41 @@
1
+ import type * as t from '../../types.d.ts';
2
+ /** Configures an individual JWS Signature (digital signature or MAC) in a General JWS. */
3
+ export interface Signature {
4
+ /** Sets the JWS Protected Header. May only be called once. */
5
+ setProtectedHeader(protectedHeader: t.JWSHeaderParameters): Signature;
6
+ /** Sets the JWS Unprotected Header. May only be called once. */
7
+ setUnprotectedHeader(unprotectedHeader: t.JWSHeaderParameters): Signature;
8
+ /**
9
+ * Adds another signature to the enclosing {@link GeneralSign} and returns its configuration.
10
+ *
11
+ * @param key Private key or shared secret. See
12
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
13
+ */
14
+ addSignature(key: t.KeyInput, options?: t.SignOptions): Signature;
15
+ /** Computes all JWS Signatures on the enclosing {@link GeneralSign}, using their configured keys. */
16
+ sign(): Promise<t.GeneralJWS>;
17
+ /** Returns the enclosing {@link GeneralSign} instance. */
18
+ done(): GeneralSign;
19
+ }
20
+ /** Produces general JWS JSON Serialization using digital signatures or MACs. */
21
+ export declare class GeneralSign {
22
+ #private;
23
+ /**
24
+ * Creates a signer for general JWS JSON Serialization.
25
+ *
26
+ * @param payload JWS Payload bytes to sign or MAC.
27
+ */
28
+ constructor(payload: Uint8Array);
29
+ /**
30
+ * Adds a signature and returns its configuration.
31
+ *
32
+ * @param key Private key or shared secret. See
33
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
34
+ */
35
+ addSignature(key: t.KeyInput, options?: t.SignOptions): Signature;
36
+ /**
37
+ * Computes each JWS Signature (digital signature or MAC) and returns the general JWS JSON
38
+ * Serialization.
39
+ */
40
+ sign(): Promise<t.GeneralJWS>;
41
+ }
@@ -0,0 +1,31 @@
1
+ import type * as t from '../../types.d.ts';
2
+ /** Resolves a key for General JWS verification from unverified headers and token data. */
3
+ export interface GeneralVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
4
+ }
5
+ /**
6
+ * Validates a JWS Signature (digital signature or MAC) from a general JWS JSON Serialization and
7
+ * decodes its JWS Payload.
8
+ *
9
+ * > Note: Returns payload and headers from the first signature that verifies successfully. Other entries'
10
+ * > headers may be inspected to reject inconsistent use of the JWS Unencoded Payload Option, but are
11
+ * > not included in the result. Rely only on the returned data.
12
+ *
13
+ * @param key Public key or shared secret. See
14
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
15
+ */
16
+ export declare function generalVerify(jws: t.GeneralJWSInput, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult>;
17
+ /**
18
+ * Validates a JWS Signature (digital signature or MAC) from a general JWS JSON Serialization and
19
+ * decodes its JWS Payload with a dynamically resolved key, included in the result.
20
+ *
21
+ * @param getKey Resolves a public key or shared secret from unverified token data.
22
+ */
23
+ export declare function generalVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: t.GeneralJWSInput, getKey: GeneralVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult & t.ResolvedKey<KeyType>>;
24
+ /**
25
+ * Validates a JWS Signature (digital signature or MAC) from a general JWS JSON Serialization and
26
+ * decodes its JWS Payload using a key or key resolver. The result includes `key` only when a
27
+ * resolver is used.
28
+ *
29
+ * @param key Public key or shared secret, or a function resolving one.
30
+ */
31
+ export declare function generalVerify(jws: t.GeneralJWSInput, key: t.KeyInput | GeneralVerifyGetKey, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult & Partial<t.ResolvedKey>>;
@@ -0,0 +1,38 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** JWE decryption and JWT Claims Set validation options. */
3
+ export interface JWTDecryptOptions extends t.DecryptOptions, t.JWTClaimVerificationOptions {
4
+ }
5
+ /**
6
+ * Resolves a JWT decryption key. No token components have been authenticated when this function is
7
+ * called.
8
+ */
9
+ export interface JWTDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWEHeaderParameters, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
10
+ }
11
+ export declare function jwtDecrypt<PayloadType, KeyType extends t.KeyInput, InferredPayloadType>(jwt: string | Uint8Array, key: KeyType, options?: JWTDecryptOptions): Promise<t.InferredJWTResult<t.JWTDecryptResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)>>;
12
+ export declare function jwtDecrypt<PayloadType, KeyType extends t.CryptoKey | Uint8Array, InferredPayloadType>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey<KeyType>, options?: JWTDecryptOptions): Promise<t.InferredJWTResult<t.JWTDecryptResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)> & t.ResolvedKey<KeyType>>;
13
+ export declare function jwtDecrypt<PayloadType, KeyType extends t.KeyInput | JWTDecryptGetKey, InferredPayloadType>(jwt: string | Uint8Array, key: KeyType, options?: JWTDecryptOptions): Promise<t.InferredJWTResult<t.JWTDecryptResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)> & Partial<t.ResolvedKey>>;
14
+ /**
15
+ * Authenticates and decrypts a JWT in JWE Compact Serialization and validates its JWT Claims Set.
16
+ *
17
+ * @param key Private key or shared secret to authenticate and decrypt the JWT with. See
18
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
19
+ */
20
+ export declare function jwtDecrypt<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType>>;
21
+ /**
22
+ * Decrypts a JWT and validates its claims, returning the dynamically
23
+ * {@link t.ResolvedKey.key resolved key}.
24
+ *
25
+ * @param getKey Function resolving a private key or shared secret to authenticate and decrypt the
26
+ * JWT with. See
27
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
28
+ */
29
+ export declare function jwtDecrypt<PayloadType = t.JWTPayload, KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey<KeyType>, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType> & t.ResolvedKey<KeyType>>;
30
+ /**
31
+ * Accepts a key or key resolver. Use this overload when forwarding either form; the result includes
32
+ * `key` only when a resolver was used.
33
+ *
34
+ * @param key Private key or shared secret, or a function resolving one, to authenticate and decrypt
35
+ * the JWT with. See
36
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
37
+ */
38
+ export declare function jwtDecrypt<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput | JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType> & Partial<t.ResolvedKey>>;
@@ -0,0 +1,57 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** @param payload Initial JWT Claims Set. Defaults to an empty object. */
3
+ declare const EncryptJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
4
+ /** Produces encrypted JWTs in JWE Compact Serialization. */
5
+ export declare class EncryptJWT extends EncryptJWT_base {
6
+ #private;
7
+ /**
8
+ * Sets the JWE Protected Header. May only be called once.
9
+ *
10
+ * @param protectedHeader JWE Protected Header. Must contain an "alg" (JWE Algorithm) and "enc"
11
+ * (JWE Encryption Algorithm) properties.
12
+ */
13
+ setProtectedHeader(protectedHeader: t.CompactJWEHeaderParameters): this;
14
+ /**
15
+ * Sets JWE Key Management parameters, such as ECDH-ES "apu" and "apv" or PBES2 "p2c", and adds
16
+ * them to the appropriate JOSE Header. Use this instead of the header setters for algorithm
17
+ * inputs. May only be called once.
18
+ */
19
+ setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): this;
20
+ /**
21
+ * Sets the content encryption key. By default, a suitable random key is generated for the JWE
22
+ * "enc" (Encryption Algorithm). May only be called once.
23
+ *
24
+ * @deprecated For testing and vector validation only; allow random generation in production.
25
+ */
26
+ setContentEncryptionKey(cek: Uint8Array): this;
27
+ /**
28
+ * Sets the Initialization Vector for content encryption. By default, a suitable random IV is
29
+ * generated for the JWE "enc" (Encryption Algorithm). May only be called once.
30
+ *
31
+ * @deprecated For testing and vector validation only; allow random generation in production.
32
+ */
33
+ setInitializationVector(iv: Uint8Array): this;
34
+ /**
35
+ * Replicates the "iss" (Issuer) Claim in the JWE Protected Header, exposing it without
36
+ * decryption.
37
+ */
38
+ replicateIssuerAsHeader(): this;
39
+ /**
40
+ * Replicates the "sub" (Subject) Claim in the JWE Protected Header, exposing it without
41
+ * decryption.
42
+ */
43
+ replicateSubjectAsHeader(): this;
44
+ /**
45
+ * Replicates the "aud" (Audience) Claim in the JWE Protected Header, exposing it without
46
+ * decryption.
47
+ */
48
+ replicateAudienceAsHeader(): this;
49
+ /**
50
+ * Encrypts and returns the JWT.
51
+ *
52
+ * @param key Public key or shared secret to encrypt the JWT with. See
53
+ * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
54
+ */
55
+ encrypt(key: t.KeyInput, options?: t.EncryptOptions): Promise<string>;
56
+ }
57
+ export {};
@@ -0,0 +1,21 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** @param payload Initial JWT Claims Set. Defaults to an empty object. */
3
+ declare const SignJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
4
+ /** Produces JWTs in JWS Compact Serialization using a digital signature or MAC. */
5
+ export declare class SignJWT extends SignJWT_base {
6
+ #private;
7
+ /**
8
+ * Sets the JWS Protected Header. May only be called once.
9
+ *
10
+ * @param protectedHeader JWS Protected Header. Must contain an "alg" (JWS Algorithm) property.
11
+ */
12
+ setProtectedHeader(protectedHeader: t.JWTHeaderParameters): this;
13
+ /**
14
+ * Signs and returns the JWT.
15
+ *
16
+ * @param key Private key or shared secret to sign the JWT with. See
17
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
18
+ */
19
+ sign(key: t.KeyInput, options?: t.SignOptions): Promise<string>;
20
+ }
21
+ export {};
@@ -0,0 +1,21 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** Decoded Unsecured JWT. */
3
+ export interface UnsecuredResult<PayloadType = t.JWTPayload> {
4
+ /** JWT Claims Set. */
5
+ payload: PayloadType & t.JWTPayload & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never);
6
+ /** The decoded JOSE Header; its "alg" (Algorithm) Header Parameter is "none". */
7
+ header: t.JWSHeaderParameters;
8
+ }
9
+ /** @param payload Initial JWT Claims Set. Defaults to an empty object. */
10
+ declare const UnsecuredJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
11
+ /** Encodes and decodes `{ "alg": "none" }` Unsecured JWTs. */
12
+ export declare class UnsecuredJWT extends UnsecuredJWT_base {
13
+ private jwt;
14
+ /** Encodes the Unsecured JWT. */
15
+ encode(): string;
16
+ /** Decodes an unsecured JWT and validates its claims without authenticating the token. */
17
+ static decode<PayloadType, InferredPayloadType>(jwt: string, options?: t.JWTClaimVerificationOptions): t.InferredJWTResult<UnsecuredResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)>;
18
+ /** Decodes an unsecured JWT and validates its claims without authenticating the token. */
19
+ static decode<PayloadType = t.JWTPayload>(jwt: string, options?: t.JWTClaimVerificationOptions): UnsecuredResult<PayloadType>;
20
+ }
21
+ export {};
@@ -0,0 +1,36 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** JWS verification and JWT Claims Set validation options. */
3
+ export interface JWTVerifyOptions extends t.VerifyOptions, t.JWTClaimVerificationOptions {
4
+ }
5
+ /**
6
+ * Resolves a JWT verification key. No token components have been authenticated when this function
7
+ * is called.
8
+ */
9
+ export interface JWTVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
10
+ }
11
+ export declare function jwtVerify<PayloadType, KeyType extends t.KeyInput, InferredPayloadType>(jwt: string | Uint8Array, key: KeyType, options?: JWTVerifyOptions): Promise<t.InferredJWTResult<t.JWTVerifyResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)>>;
12
+ export declare function jwtVerify<PayloadType, KeyType extends t.CryptoKey | Uint8Array, InferredPayloadType>(jwt: string | Uint8Array, getKey: JWTVerifyGetKey<KeyType>, options?: JWTVerifyOptions): Promise<t.InferredJWTResult<t.JWTVerifyResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)> & t.ResolvedKey<KeyType>>;
13
+ export declare function jwtVerify<PayloadType, KeyType extends t.KeyInput | JWTVerifyGetKey, InferredPayloadType>(jwt: string | Uint8Array, key: KeyType, options?: JWTVerifyOptions): Promise<t.InferredJWTResult<t.JWTVerifyResult<unknown>, InferredPayloadType & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never)> & Partial<t.ResolvedKey>>;
14
+ /**
15
+ * Validates a JWT in JWS Compact Serialization (digital signature or MAC) and its JWT Claims Set.
16
+ *
17
+ * @param key Public key or shared secret to verify the JWT with. See
18
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
19
+ */
20
+ export declare function jwtVerify<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput, options?: JWTVerifyOptions): Promise<t.JWTVerifyResult<PayloadType>>;
21
+ /**
22
+ * Validates the JWT's JWS Signature (digital signature or MAC) and JWT Claims Set, returning the
23
+ * resolved key.
24
+ *
25
+ * @param getKey Function resolving a public key or shared secret to verify the JWT with. See
26
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
27
+ */
28
+ export declare function jwtVerify<PayloadType = t.JWTPayload, KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTVerifyGetKey<KeyType>, options?: JWTVerifyOptions): Promise<t.JWTVerifyResult<PayloadType> & t.ResolvedKey<KeyType>>;
29
+ /**
30
+ * Accepts a key or key resolver. Use this overload when forwarding either form; the result includes
31
+ * `key` only when a resolver was used.
32
+ *
33
+ * @param key Key, or function resolving a key, to verify the JWT with. See
34
+ * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
35
+ */
36
+ export declare function jwtVerify<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput | JWTVerifyGetKey, options?: JWTVerifyOptions): Promise<t.JWTVerifyResult<PayloadType> & Partial<t.ResolvedKey>>;
@@ -0,0 +1,19 @@
1
+ import type * as t from '../types.d.ts';
2
+ /**
3
+ * Exports a public key to PEM-encoded SPKI. CryptoKey inputs must be extractable.
4
+ *
5
+ * @param key Key to export.
6
+ */
7
+ export declare function exportSPKI(key: t.CryptoKey | t.KeyObject): Promise<string>;
8
+ /**
9
+ * Exports a private key to PEM-encoded PKCS #8. CryptoKey inputs must be extractable.
10
+ *
11
+ * @param key Key to export.
12
+ */
13
+ export declare function exportPKCS8(key: t.CryptoKey | t.KeyObject): Promise<string>;
14
+ /**
15
+ * Exports a key to JWK. CryptoKey inputs must be extractable.
16
+ *
17
+ * @param key Key to export.
18
+ */
19
+ export declare function exportJWK(key: t.CryptoKey | t.KeyObject | Uint8Array): Promise<t.JWK>;
@@ -0,0 +1,33 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** Algorithms supported by {@link generateKeyPair}, subject to runtime support. */
3
+ export type GenerateKeyPairAlgorithm = 'PS256' | 'PS384' | 'PS512' | 'RS256' | 'RS384' | 'RS512' | 'RSA-OAEP' | 'RSA-OAEP-256' | 'RSA-OAEP-384' | 'RSA-OAEP-512' | 'ES256' | 'ES384' | 'ES512' | 'Ed25519' | 'EdDSA' | 'ML-DSA-44' | 'ML-DSA-65' | 'ML-DSA-87' | 'ECDH-ES' | 'ECDH-ES+A128KW' | 'ECDH-ES+A192KW' | 'ECDH-ES+A256KW' | (string & {});
4
+ /** Generated asymmetric key pair. */
5
+ export interface GenerateKeyPairResult {
6
+ privateKey: t.CryptoKey;
7
+ publicKey: t.CryptoKey;
8
+ }
9
+ /** Asymmetric key pair generation options. */
10
+ export interface GenerateKeyPairOptions {
11
+ /**
12
+ * EC curve or OKP key subtype. Must be supported by the algorithm and runtime. ECDH-ES defaults
13
+ * to P-256.
14
+ */
15
+ crv?: string;
16
+ /** RSA modulus length in bits. Must be an integer of at least 2048; defaults to 2048. */
17
+ modulusLength?: number;
18
+ /**
19
+ * Whether the private key is extractable. Defaults to false; the public key is always
20
+ * extractable.
21
+ */
22
+ extractable?: boolean;
23
+ }
24
+ /**
25
+ * Generates an asymmetric key pair for a JWA algorithm identifier.
26
+ *
27
+ * > Note: Private keys are not extractable by default. Set {@link GenerateKeyPairOptions.extractable} to
28
+ * > export them; public keys are always extractable.
29
+ *
30
+ * @param alg JWA Algorithm Identifier to be used with the generated key pair. See
31
+ * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
32
+ */
33
+ export declare function generateKeyPair(alg: GenerateKeyPairAlgorithm, options?: GenerateKeyPairOptions): Promise<GenerateKeyPairResult>;
@@ -0,0 +1,30 @@
1
+ import type * as t from '../types.d.ts';
2
+ /** Algorithms supported by {@link generateSecret}, subject to runtime support. */
3
+ export type GenerateSecretAlgorithm = 'HS256' | 'HS384' | 'HS512' | 'A128CBC-HS256' | 'A192CBC-HS384' | 'A256CBC-HS512' | 'A128KW' | 'A192KW' | 'A256KW' | 'A128GCMKW' | 'A192GCMKW' | 'A256GCMKW' | 'A128GCM' | 'A192GCM' | 'A256GCM' | (string & {});
4
+ /**
5
+ * Maps a JWA algorithm identifier to the value returned by {@link generateSecret}. AES_CBC_HMAC_SHA2
6
+ * algorithms return {@link !Uint8Array}; other supported algorithms return
7
+ * {@link t.CryptoKey CryptoKey}. When the algorithm is not statically known, the result is their
8
+ * union.
9
+ */
10
+ export type GeneratedSecret<Alg extends string> = Alg extends 'A128CBC-HS256' | 'A192CBC-HS384' | 'A256CBC-HS512' ? Uint8Array : string extends Alg ? t.CryptoKey | Uint8Array : t.CryptoKey;
11
+ /** Secret generation options. */
12
+ export interface GenerateSecretOptions {
13
+ /**
14
+ * Whether the generated CryptoKey is extractable. Defaults to false; has no effect for
15
+ * A128CBC-HS256, A192CBC-HS384, and A256CBC-HS512, which return raw bytes.
16
+ */
17
+ extractable?: boolean;
18
+ }
19
+ /**
20
+ * Generates a symmetric secret key for a given JWA algorithm identifier.
21
+ *
22
+ * > Note: The secret key is generated with `extractable` set to `false` by default.
23
+ *
24
+ * > Note: A128CBC-HS256, A192CBC-HS384, and A256CBC-HS512 return {@link !Uint8Array} because these secrets
25
+ * > have no CryptoKey representation.
26
+ *
27
+ * @param alg JWA Algorithm Identifier to be used with the generated secret. See
28
+ * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
29
+ */
30
+ export declare function generateSecret<Alg extends GenerateSecretAlgorithm>(alg: Alg, options?: GenerateSecretOptions): Promise<GeneratedSecret<Alg>>;
@@ -0,0 +1,67 @@
1
+ import type * as t from '../types.d.ts';
2
+ /**
3
+ * Maps a JWK key type to the value returned by {@link importJWK}. An "oct" JWK returns
4
+ * {@link !Uint8Array}; other supported key types return {@link t.CryptoKey CryptoKey}. A JWK
5
+ * whose "kty" is not statically known resolves to their union.
6
+ */
7
+ export type ImportedJWK<JWKType extends t.JWK> = JWKType extends {
8
+ kty: 'oct';
9
+ } ? Uint8Array : JWKType extends {
10
+ kty: 'AKP' | 'EC' | 'OKP' | 'RSA';
11
+ } ? t.CryptoKey : t.CryptoKey | Uint8Array;
12
+ /** Key import options. */
13
+ export interface KeyImportOptions {
14
+ /**
15
+ * Whether the imported CryptoKey is extractable. Overrides JWK "ext" when set. Without either,
16
+ * defaults to false for private keys, true otherwise.
17
+ */
18
+ extractable?: boolean;
19
+ }
20
+ /**
21
+ * Imports a PEM-encoded SPKI string as a {@link !CryptoKey}.
22
+ *
23
+ * > Note: For RSA keys, use the rsaEncryption OID (1.2.840.113549.1.1.1). The id-RSASSA-PSS OID
24
+ * > (1.2.840.113549.1.1.10) is not supported by the Web Cryptography API.
25
+ *
26
+ * @param spki PEM-encoded SPKI string
27
+ * @param alg JSON Web Algorithm identifier to be used with the imported key. See
28
+ * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
29
+ */
30
+ export declare function importSPKI(spki: string, alg: string, options?: KeyImportOptions): Promise<t.CryptoKey>;
31
+ /**
32
+ * Imports a PEM-encoded X.509 certificate's public key as a {@link !CryptoKey}.
33
+ *
34
+ * > Note: For RSA keys, use the rsaEncryption OID (1.2.840.113549.1.1.1). The id-RSASSA-PSS OID
35
+ * > (1.2.840.113549.1.1.10) is not supported by the Web Cryptography API.
36
+ *
37
+ * @param x509 X.509 certificate string
38
+ * @param alg JSON Web Algorithm identifier to be used with the imported key. See
39
+ * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
40
+ */
41
+ export declare function importX509(x509: string, alg: string, options?: KeyImportOptions): Promise<t.CryptoKey>;
42
+ /**
43
+ * Imports a PEM-encoded PKCS #8 string as a {@link !CryptoKey}.
44
+ *
45
+ * > Note: For RSA keys, use the rsaEncryption OID (1.2.840.113549.1.1.1). The id-RSASSA-PSS OID
46
+ * > (1.2.840.113549.1.1.10) is not supported by the Web Cryptography API.
47
+ *
48
+ * @param pkcs8 PEM-encoded PKCS #8 string
49
+ * @param alg JSON Web Algorithm identifier to be used with the imported key. See
50
+ * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
51
+ */
52
+ export declare function importPKCS8(pkcs8: string, alg: string, options?: KeyImportOptions): Promise<t.CryptoKey>;
53
+ /**
54
+ * Imports a JWK as a {@link !CryptoKey} or {@link !Uint8Array}. Asymmetric imports require either the
55
+ * "alg" argument or JWK "alg" parameter. For AKP keys, the JWK "alg" parameter is required and must
56
+ * match the argument when provided.
57
+ *
58
+ * > Note: CryptoKey imports honor the JWK "key_ops" and "ext" parameters.
59
+ *
60
+ * > Note: Symmetric JWKs (`kty: "oct"`) return {@link !Uint8Array} instead of CryptoKey.
61
+ *
62
+ * @param jwk JSON Web Key.
63
+ * @param alg JSON Web Algorithm identifier to be used with the imported key. Default is the "alg"
64
+ * property on the JWK. See
65
+ * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
66
+ */
67
+ export declare function importJWK<JWKType extends t.JWK>(jwk: JWKType, alg?: string, options?: KeyImportOptions): Promise<ImportedJWK<JWKType>>;