@raindrop-ai/opencode-plugin 0.0.18 → 0.0.19

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
@@ -24,7 +24,7 @@ __export(index_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(index_exports);
26
26
 
27
- // ../core/dist/chunk-WKRW55KX.js
27
+ // ../core/dist/chunk-267IXHO5.js
28
28
  function getCrypto() {
29
29
  const c = globalThis.crypto;
30
30
  return c;
@@ -39,6 +39,17 @@ function randomBytes(length) {
39
39
  for (let i = 0; i < out.length; i++) out[i] = Math.floor(Math.random() * 256);
40
40
  return out;
41
41
  }
42
+ function randomUUID() {
43
+ const cryptoObj = getCrypto();
44
+ if (cryptoObj && typeof cryptoObj.randomUUID === "function") {
45
+ return cryptoObj.randomUUID();
46
+ }
47
+ const b = randomBytes(16);
48
+ b[6] = b[6] & 15 | 64;
49
+ b[8] = b[8] & 63 | 128;
50
+ const hex = [...b].map((x) => x.toString(16).padStart(2, "0")).join("");
51
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
52
+ }
42
53
  function base64Encode(bytes) {
43
54
  const maybeBuffer = globalThis.Buffer;
44
55
  if (maybeBuffer) {
@@ -69,7 +80,7 @@ function base64Encode(bytes) {
69
80
  return out;
70
81
  }
71
82
  function generateId() {
72
- return base64Encode(randomBytes(12)).replace(/[+/=]/g, "").slice(0, 16);
83
+ return randomUUID();
73
84
  }
74
85
  function runWithTracingSuppressed(fn) {
75
86
  const hook = globalThis.RAINDROP_SUPPRESS_TRACING;
@@ -406,13 +417,16 @@ function projectIdHeaders(projectId) {
406
417
  var SHUTDOWN_DEADLINE_MS = 1e4;
407
418
  var POST_SHUTDOWN_TIMEOUT_MS = 5e3;
408
419
  function mergePatches(target, source) {
409
- var _a, _b, _c, _d;
420
+ var _a, _b, _c, _d, _e, _f;
410
421
  const out = { ...target, ...source };
411
422
  if (target.properties || source.properties) {
412
423
  out.properties = { ...(_a = target.properties) != null ? _a : {}, ...(_b = source.properties) != null ? _b : {} };
413
424
  }
425
+ if (target.featureFlags || source.featureFlags) {
426
+ out.featureFlags = { ...(_c = target.featureFlags) != null ? _c : {}, ...(_d = source.featureFlags) != null ? _d : {} };
427
+ }
414
428
  if (target.attachments || source.attachments) {
415
- out.attachments = [...(_c = target.attachments) != null ? _c : [], ...(_d = source.attachments) != null ? _d : []];
429
+ out.attachments = [...(_e = target.attachments) != null ? _e : [], ...(_f = source.attachments) != null ? _f : []];
416
430
  }
417
431
  return out;
418
432
  }
@@ -682,6 +696,7 @@ var EventShipper = class {
682
696
  ...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
683
697
  $context: this.context
684
698
  },
699
+ ...accumulated.featureFlags && Object.keys(accumulated.featureFlags).length > 0 ? { feature_flags: accumulated.featureFlags } : {},
685
700
  attachments: accumulated.attachments,
686
701
  is_pending: isPending
687
702
  };
@@ -1233,7 +1248,7 @@ function resolveLocalWorkshopUrl(fileValue) {
1233
1248
  // package.json
1234
1249
  var package_default = {
1235
1250
  name: "@raindrop-ai/opencode-plugin",
1236
- version: "0.0.18",
1251
+ version: "0.0.19",
1237
1252
  description: "Raindrop observability plugin for OpenCode \u2014 automatic session/event/span tracing",
1238
1253
  type: "module",
1239
1254
  main: "dist/index.js",
@@ -1898,11 +1913,12 @@ type: ${name != null ? name : "UnknownError"}`;
1898
1913
  if (!state.parentId) {
1899
1914
  await eventShipper.finish(state.currentEventId, {
1900
1915
  userId: (_d = (_c = state.eventMetadata) == null ? void 0 : _c.userId) != null ? _d : state.sessionId,
1901
- model: modelName,
1916
+ model: modelID,
1902
1917
  output: outputText,
1903
1918
  properties: {
1904
1919
  plugin_version: PLUGIN_VERSION,
1905
1920
  message_id: messageId,
1921
+ "ai.provider": providerID,
1906
1922
  ...isCompaction ? { is_compaction: true } : {}
1907
1923
  }
1908
1924
  });
@@ -2010,7 +2026,7 @@ type: ${errorName != null ? errorName : "UnknownError"}`;
2010
2026
  promptMeta.properties = m["properties"];
2011
2027
  }
2012
2028
  } else if (part["type"] === "file") {
2013
- const mimeType = part["mediaType"];
2029
+ const mimeType = part["mime"];
2014
2030
  const filename = part["filename"];
2015
2031
  const url = part["url"];
2016
2032
  if (url && (mimeType == null ? void 0 : mimeType.startsWith("image/"))) {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
5
5
  throw Error('Dynamic require of "' + x + '" is not supported');
6
6
  });
7
7
 
8
- // ../core/dist/chunk-WKRW55KX.js
8
+ // ../core/dist/chunk-267IXHO5.js
9
9
  function getCrypto() {
10
10
  const c = globalThis.crypto;
11
11
  return c;
@@ -20,6 +20,17 @@ function randomBytes(length) {
20
20
  for (let i = 0; i < out.length; i++) out[i] = Math.floor(Math.random() * 256);
21
21
  return out;
22
22
  }
23
+ function randomUUID() {
24
+ const cryptoObj = getCrypto();
25
+ if (cryptoObj && typeof cryptoObj.randomUUID === "function") {
26
+ return cryptoObj.randomUUID();
27
+ }
28
+ const b = randomBytes(16);
29
+ b[6] = b[6] & 15 | 64;
30
+ b[8] = b[8] & 63 | 128;
31
+ const hex = [...b].map((x) => x.toString(16).padStart(2, "0")).join("");
32
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
33
+ }
23
34
  function base64Encode(bytes) {
24
35
  const maybeBuffer = globalThis.Buffer;
25
36
  if (maybeBuffer) {
@@ -50,7 +61,7 @@ function base64Encode(bytes) {
50
61
  return out;
51
62
  }
52
63
  function generateId() {
53
- return base64Encode(randomBytes(12)).replace(/[+/=]/g, "").slice(0, 16);
64
+ return randomUUID();
54
65
  }
55
66
  function runWithTracingSuppressed(fn) {
56
67
  const hook = globalThis.RAINDROP_SUPPRESS_TRACING;
@@ -387,13 +398,16 @@ function projectIdHeaders(projectId) {
387
398
  var SHUTDOWN_DEADLINE_MS = 1e4;
388
399
  var POST_SHUTDOWN_TIMEOUT_MS = 5e3;
389
400
  function mergePatches(target, source) {
390
- var _a, _b, _c, _d;
401
+ var _a, _b, _c, _d, _e, _f;
391
402
  const out = { ...target, ...source };
392
403
  if (target.properties || source.properties) {
393
404
  out.properties = { ...(_a = target.properties) != null ? _a : {}, ...(_b = source.properties) != null ? _b : {} };
394
405
  }
406
+ if (target.featureFlags || source.featureFlags) {
407
+ out.featureFlags = { ...(_c = target.featureFlags) != null ? _c : {}, ...(_d = source.featureFlags) != null ? _d : {} };
408
+ }
395
409
  if (target.attachments || source.attachments) {
396
- out.attachments = [...(_c = target.attachments) != null ? _c : [], ...(_d = source.attachments) != null ? _d : []];
410
+ out.attachments = [...(_e = target.attachments) != null ? _e : [], ...(_f = source.attachments) != null ? _f : []];
397
411
  }
398
412
  return out;
399
413
  }
@@ -663,6 +677,7 @@ var EventShipper = class {
663
677
  ...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
664
678
  $context: this.context
665
679
  },
680
+ ...accumulated.featureFlags && Object.keys(accumulated.featureFlags).length > 0 ? { feature_flags: accumulated.featureFlags } : {},
666
681
  attachments: accumulated.attachments,
667
682
  is_pending: isPending
668
683
  };
@@ -1214,7 +1229,7 @@ function resolveLocalWorkshopUrl(fileValue) {
1214
1229
  // package.json
1215
1230
  var package_default = {
1216
1231
  name: "@raindrop-ai/opencode-plugin",
1217
- version: "0.0.18",
1232
+ version: "0.0.19",
1218
1233
  description: "Raindrop observability plugin for OpenCode \u2014 automatic session/event/span tracing",
1219
1234
  type: "module",
1220
1235
  main: "dist/index.js",
@@ -1879,11 +1894,12 @@ type: ${name != null ? name : "UnknownError"}`;
1879
1894
  if (!state.parentId) {
1880
1895
  await eventShipper.finish(state.currentEventId, {
1881
1896
  userId: (_d = (_c = state.eventMetadata) == null ? void 0 : _c.userId) != null ? _d : state.sessionId,
1882
- model: modelName,
1897
+ model: modelID,
1883
1898
  output: outputText,
1884
1899
  properties: {
1885
1900
  plugin_version: PLUGIN_VERSION,
1886
1901
  message_id: messageId,
1902
+ "ai.provider": providerID,
1887
1903
  ...isCompaction ? { is_compaction: true } : {}
1888
1904
  }
1889
1905
  });
@@ -1991,7 +2007,7 @@ type: ${errorName != null ? errorName : "UnknownError"}`;
1991
2007
  promptMeta.properties = m["properties"];
1992
2008
  }
1993
2009
  } else if (part["type"] === "file") {
1994
- const mimeType = part["mediaType"];
2010
+ const mimeType = part["mime"];
1995
2011
  const filename = part["filename"];
1996
2012
  const url = part["url"];
1997
2013
  if (url && (mimeType == null ? void 0 : mimeType.startsWith("image/"))) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raindrop-ai/opencode-plugin",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Raindrop observability plugin for OpenCode — automatic session/event/span tracing",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "@types/node": "^20.11.17",
38
38
  "tsup": "^8.4.0",
39
39
  "typescript": "^5.3.3",
40
- "@raindrop-ai/core": "0.0.5"
40
+ "@raindrop-ai/core": "0.1.2"
41
41
  },
42
42
  "tsup": {
43
43
  "entry": [