@astralbeam/sdk 0.17.0 → 0.19.0

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 (50) hide show
  1. package/README.md +8 -1
  2. package/dist/{api-BaIPbj-Q.js → api-B3UxSTtl.js} +135 -1
  3. package/dist/api.d.ts +2 -2
  4. package/dist/api.js +1 -2
  5. package/dist/auth-lifecycle-B0BXyDr7.js +25 -0
  6. package/dist/badge-B9WuChHI.js +1 -0
  7. package/dist/client.d.ts +57 -8
  8. package/dist/client.js +1 -1
  9. package/dist/constants-C-Yp0Vhg.js +1 -0
  10. package/dist/{core-DeMY6_wQ.js → core-CLWlvgYl.js} +203 -72
  11. package/dist/core.d.ts +2 -2
  12. package/dist/core.js +1 -2
  13. package/dist/css-BGIxQoYs.js +1 -0
  14. package/dist/css-DgaLhXQH.js +1 -0
  15. package/dist/{debug-qLts7gEt.js → debug-DLDY8CZb.js} +1 -1
  16. package/dist/diff-woXpYk--.js +1 -0
  17. package/dist/github-dark-C-LZuMrd.js +1 -0
  18. package/dist/github-light-EUqPIrTm.js +1 -0
  19. package/dist/highlighter-Bd_oZUcA.js +152 -0
  20. package/dist/html-B3xvRgDO.js +1 -0
  21. package/dist/{index-NT05_Yw_.d.ts → index-DDfmeUeU.d.ts} +76 -50
  22. package/dist/{index-CfGnT6Od.d.ts → index-DFxtXIXy.d.ts} +104 -3
  23. package/dist/item-a9y_9nk7.js +1 -0
  24. package/dist/javascript-BzbQS41l.js +1 -0
  25. package/dist/javascript-CpIGwZ_Y.js +1 -0
  26. package/dist/json-qhed-kSA.js +1 -0
  27. package/dist/jsx-Bz0zcwM4.js +1 -0
  28. package/dist/listings-DzxJtGCD.js +1 -0
  29. package/dist/markdown-BYOwaDjH.js +1 -0
  30. package/dist/mcp-servers-ESbOt00F.js +1 -0
  31. package/dist/python-gzcpVVnB.js +1 -0
  32. package/dist/react.d.ts +23 -16
  33. package/dist/react.js +46 -8
  34. package/dist/server.d.ts +14 -26
  35. package/dist/server.js +190 -347
  36. package/dist/shellscript-CLZ0U2zV.js +1 -0
  37. package/dist/sql-CEbI0hMM.js +1 -0
  38. package/dist/styles.generated-D4k7izMB.js +80 -0
  39. package/dist/tsx-udAQXfEw.js +1 -0
  40. package/dist/typescript-bsJCZSQ-.js +1 -0
  41. package/dist/validate-BOw-BAyv.js +140 -0
  42. package/dist/widget-DGmCPqzk.js +24 -0
  43. package/dist/yaml-rwi0_p6S.js +1 -0
  44. package/package.json +18 -15
  45. package/dist/constants-enyqxaJi.js +0 -1
  46. package/dist/listings-BH_hPkxx.js +0 -1
  47. package/dist/rolldown-runtime-QTnfLwEv.js +0 -1
  48. package/dist/styles.generated-D8sDOLu3.js +0 -98
  49. package/dist/type_checks-C-WTHaWs.js +0 -117
  50. package/dist/widget-BdiuWvPf.js +0 -24
@@ -0,0 +1,140 @@
1
+ //#region ../node_modules/.bun/jose@6.2.12/node_modules/jose/dist/webapi/lib/buffer_utils.js
2
+ const encoder = new TextEncoder();
3
+ const decoder = new TextDecoder();
4
+ const strictDecoder = new TextDecoder("utf-8", { fatal: !0 });
5
+ function concat(...buffers) {
6
+ const size = buffers.reduce((acc, { length }) => acc + length, 0), buf = new Uint8Array(size);
7
+ let i = 0;
8
+ for (const buffer of buffers) buf.set(buffer, i), i += buffer.length;
9
+ return buf;
10
+ }
11
+ const NON_ASCII = /[^\x00-\x7f]/;
12
+ function encode$1(string) {
13
+ if (typeof string == "string" && string.length >= 128) {
14
+ if (NON_ASCII.test(string)) throw new TypeError("non-ASCII string encountered in encode()");
15
+ return encoder.encode(string);
16
+ }
17
+ const bytes = new Uint8Array(string.length);
18
+ for (let i = 0; i < string.length; i++) {
19
+ const code = string.charCodeAt(i);
20
+ if (code > 127) throw new TypeError("non-ASCII string encountered in encode()");
21
+ bytes[i] = code;
22
+ }
23
+ return bytes;
24
+ }
25
+ function encodeBase64(input, url = !1) {
26
+ if (Uint8Array.prototype.toBase64) return input.toBase64({
27
+ alphabet: url ? "base64url" : "base64",
28
+ omitPadding: url
29
+ });
30
+ const CHUNK_SIZE = 32768, arr = [];
31
+ for (let i = 0; i < input.length; i += CHUNK_SIZE) arr.push(String.fromCharCode.apply(null, input.subarray(i, i + CHUNK_SIZE)));
32
+ const encoded = btoa(arr.join(""));
33
+ return url ? encoded.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_") : encoded;
34
+ }
35
+ function decodeBase64(encoded, url = !1) {
36
+ if (Uint8Array.fromBase64) return Uint8Array.fromBase64(encoded, { alphabet: url ? "base64url" : "base64" });
37
+ if (url) {
38
+ if (encoded.includes("+") || encoded.includes("/")) throw new TypeError("Invalid base64url");
39
+ encoded = encoded.replace(/-/g, "+").replace(/_/g, "/");
40
+ }
41
+ const binary = atob(encoded), bytes = new Uint8Array(binary.length);
42
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
43
+ return bytes;
44
+ }
45
+ //#endregion
46
+ //#region ../node_modules/.bun/jose@6.2.12/node_modules/jose/dist/webapi/util/errors.js
47
+ var JOSEError = class extends Error {
48
+ static code = "ERR_JOSE_GENERIC";
49
+ code = "ERR_JOSE_GENERIC";
50
+ constructor(message, options) {
51
+ super(message, options), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
52
+ }
53
+ };
54
+ var JOSENotSupported = class extends JOSEError {
55
+ static code = "ERR_JOSE_NOT_SUPPORTED";
56
+ code = "ERR_JOSE_NOT_SUPPORTED";
57
+ };
58
+ var JWSInvalid = class extends JOSEError {
59
+ static code = "ERR_JWS_INVALID";
60
+ code = "ERR_JWS_INVALID";
61
+ };
62
+ var JWTInvalid = class extends JOSEError {
63
+ static code = "ERR_JWT_INVALID";
64
+ code = "ERR_JWT_INVALID";
65
+ };
66
+ //#endregion
67
+ //#region ../node_modules/.bun/jose@6.2.12/node_modules/jose/dist/webapi/util/base64url.js
68
+ const invalid = "The input to be decoded is not correctly encoded.";
69
+ function decode(input) {
70
+ try {
71
+ return decodeBase64(typeof input == "string" ? input : decoder.decode(input), !0);
72
+ } catch (cause) {
73
+ throw new TypeError(invalid, { cause });
74
+ }
75
+ }
76
+ function encode(input) {
77
+ return encodeBase64(typeof input == "string" ? encoder.encode(input) : input, !0);
78
+ }
79
+ //#endregion
80
+ //#region ../node_modules/.bun/jose@6.2.12/node_modules/jose/dist/webapi/lib/validate.js
81
+ function isObject(input) {
82
+ if (typeof input != "object" || input === null || Object.prototype.toString.call(input) !== "[object Object]") return !1;
83
+ const prototype = Object.getPrototypeOf(input);
84
+ return prototype === null || Object.getPrototypeOf(prototype) === null;
85
+ }
86
+ function isDisjoint(...headers) {
87
+ const parameters = /* @__PURE__ */ new Set();
88
+ for (const header of headers) if (header) for (const parameter of Object.keys(header)) {
89
+ if (parameters.has(parameter)) return !1;
90
+ parameters.add(parameter);
91
+ }
92
+ return !0;
93
+ }
94
+ function assertNotSet(value, name) {
95
+ if (value !== void 0) throw new TypeError(`${name} can only be called once`);
96
+ }
97
+ const JWS_RECOGNIZED = {
98
+ __proto__: null,
99
+ b64: !0
100
+ };
101
+ function validateCritDuplicates(Err, protectedHeader) {
102
+ const { crit } = protectedHeader ?? {};
103
+ if (Array.isArray(crit) && new Set(crit).size !== crit.length) throw new Err("\"crit\" (Critical) Header Parameter MUST NOT contain duplicate values");
104
+ }
105
+ function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
106
+ if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) throw new Err("\"crit\" (Critical) Header Parameter MUST be integrity protected");
107
+ if (!protectedHeader || protectedHeader.crit === void 0) return [];
108
+ if (!Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some((input) => typeof input != "string" || input.length === 0)) throw new Err("\"crit\" (Critical) Header Parameter MUST be an array of non-empty strings when present");
109
+ const recognized = recognizedOption === void 0 ? recognizedDefault : {
110
+ __proto__: null,
111
+ ...recognizedOption,
112
+ ...recognizedDefault
113
+ };
114
+ for (const parameter of protectedHeader.crit) {
115
+ if (!(parameter in recognized)) throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);
116
+ if (!Object.hasOwn(joseHeader, parameter) || joseHeader[parameter] === void 0) throw new Err(`Extension Header Parameter "${parameter}" is missing`);
117
+ if (recognized[parameter] && (!Object.hasOwn(protectedHeader, parameter) || protectedHeader[parameter] === void 0)) throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`);
118
+ }
119
+ return protectedHeader.crit;
120
+ }
121
+ function validateB64(protectedHeader, extensions) {
122
+ if (extensions.includes("b64")) {
123
+ const b64 = protectedHeader.b64;
124
+ if (typeof b64 != "boolean") throw new JWSInvalid("The \"b64\" (base64url-encode payload) Header Parameter must be a boolean");
125
+ return b64;
126
+ }
127
+ return !0;
128
+ }
129
+ function serializeJoseHeader(Err, header) {
130
+ let serialized, parsed;
131
+ try {
132
+ serialized = JSON.stringify(header), parsed = JSON.parse(serialized);
133
+ } catch (cause) {
134
+ throw new Err("JOSE Header is not valid JSON", { cause });
135
+ }
136
+ if (!isObject(parsed)) throw new Err("JOSE Header is not a JSON object");
137
+ return [parsed, serialized];
138
+ }
139
+ //#endregion
140
+ export { strictDecoder as _, serializeJoseHeader as a, validateCritDuplicates as c, JOSENotSupported as d, JWSInvalid as f, encoder as g, encode$1 as h, isObject as i, decode as l, concat as m, assertNotSet as n, validateB64 as o, JWTInvalid as p, isDisjoint as r, validateCrit as s, JWS_RECOGNIZED as t, encode as u };