@arbidocs/sdk 0.5.75 → 0.5.76

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/index.cjs CHANGED
@@ -5181,6 +5181,39 @@ function buildChunkLookup(tools) {
5181
5181
  return lookup;
5182
5182
  }
5183
5183
 
5184
+ // src/operations/support.ts
5185
+ var support_exports = {};
5186
+ __export(support_exports, {
5187
+ createSupportTicket: () => createSupportTicket
5188
+ });
5189
+
5190
+ // src/operations/mail-encoding.ts
5191
+ function bytesToBase64(bytes) {
5192
+ let binary = "";
5193
+ for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
5194
+ binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
5195
+ }
5196
+ return btoa(binary);
5197
+ }
5198
+
5199
+ // src/operations/support.ts
5200
+ async function createSupportTicket(arbi, input) {
5201
+ if (!input.description.trim()) throw new ArbiError("Describe what you need help with.");
5202
+ if (input.screenshot && (input.screenshot.type !== "image/png" || input.screenshot.size > 2 * 1024 * 1024))
5203
+ throw new ArbiError("The screenshot must be a PNG image no larger than 2 MB.");
5204
+ const screenshot = input.screenshot ? bytesToBase64(new Uint8Array(await input.screenshot.arrayBuffer())) : void 0;
5205
+ return requireData(
5206
+ await arbi.fetch.POST("/v1/support/tickets", {
5207
+ body: {
5208
+ description: input.description.trim(),
5209
+ idempotency_key: input.idempotencyKey ?? crypto.randomUUID(),
5210
+ ...screenshot ? { screenshot_png: screenshot } : {}
5211
+ }
5212
+ }),
5213
+ "Could not send your support request."
5214
+ );
5215
+ }
5216
+
5184
5217
  // src/diagnostics.ts
5185
5218
  async function diagnoseSetup(options) {
5186
5219
  const checks = [];
@@ -6735,15 +6768,6 @@ __export(secure_mail_exports, {
6735
6768
  prepareSecureMail: () => prepareSecureMail,
6736
6769
  secureMime: () => secureMime
6737
6770
  });
6738
-
6739
- // src/operations/mail-encoding.ts
6740
- function bytesToBase64(bytes) {
6741
- let binary = "";
6742
- for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
6743
- binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
6744
- }
6745
- return btoa(binary);
6746
- }
6747
6771
  var MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
6748
6772
  var utf8 = new TextEncoder();
6749
6773
  var encodedWord = (value) => `=?UTF-8?B?${bytesToBase64(utf8.encode(value))}?=`;
@@ -13854,6 +13878,12 @@ var Arbi = class {
13854
13878
  getModels: () => getModels(this.requireClient())
13855
13879
  };
13856
13880
  // ── Health ────────────────────────────────────────────────────────────
13881
+ support = {
13882
+ create: (input) => {
13883
+ const request = { ...input, idempotencyKey: input.idempotencyKey ?? crypto.randomUUID() };
13884
+ return this.recovering(() => createSupportTicket(this.requireClient(), request));
13885
+ }
13886
+ };
13857
13887
  health = {
13858
13888
  check: () => getHealth(this.requireClient()),
13859
13889
  models: () => getHealthModels(this.requireClient()),
@@ -16037,6 +16067,7 @@ exports.streamSSE = streamSSE;
16037
16067
  exports.stripCitationMarkdown = stripCitationMarkdown;
16038
16068
  exports.subagentJobLabel = subagentJobLabel;
16039
16069
  exports.summarizeCitations = summarizeCitations;
16070
+ exports.support = support_exports;
16040
16071
  exports.tagUseCount = tagUseCount;
16041
16072
  exports.tags = tags_exports;
16042
16073
  exports.tagsForScope = tagsForScope;