@liquidmetal-ai/raindrop 0.9.6 → 0.9.7

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 (90) hide show
  1. package/README.md +69 -69
  2. package/bundle/chunk-2HWWLWLM.js +74 -0
  3. package/bundle/chunk-6AU7I5YZ.js +44 -0
  4. package/bundle/chunk-6VCATADU.js +384 -0
  5. package/bundle/chunk-BC3Z5E5X.js +502 -0
  6. package/bundle/chunk-DSP542FN.js +12148 -0
  7. package/bundle/chunk-FFKINGT5.js +231 -0
  8. package/bundle/chunk-FV4QERYA.js +48 -0
  9. package/bundle/chunk-KYP4ZWG7.js +292 -0
  10. package/bundle/chunk-O75RZNCU.js +4539 -0
  11. package/bundle/chunk-QN2OJEAL.js +238746 -0
  12. package/bundle/chunk-RUORC7A6.js +315 -0
  13. package/bundle/chunk-T7WFDN3I.js +805 -0
  14. package/bundle/chunk-VW5YPIKL.js +4458 -0
  15. package/bundle/chunk-WTTFYUHL.js +133 -0
  16. package/bundle/chunk-XN52RPCA.js +75 -0
  17. package/bundle/chunk-ZEKMKKMJ.js +22452 -0
  18. package/bundle/commands/annotation/get.js +3 -3
  19. package/bundle/commands/annotation/list.js +3 -3
  20. package/bundle/commands/annotation/put.js +3 -3
  21. package/bundle/commands/auth/list.js +2 -2
  22. package/bundle/commands/auth/login.js +3 -3
  23. package/bundle/commands/auth/logout.js +2 -2
  24. package/bundle/commands/auth/select.js +3 -3
  25. package/bundle/commands/bucket/create-credential.js +2 -2
  26. package/bundle/commands/bucket/delete-credential.js +2 -2
  27. package/bundle/commands/bucket/get-credential.js +2 -2
  28. package/bundle/commands/bucket/list-credentials.js +2 -2
  29. package/bundle/commands/build/branch.js +9 -9
  30. package/bundle/commands/build/checkout.js +6 -6
  31. package/bundle/commands/build/clone.js +5 -5
  32. package/bundle/commands/build/delete.js +6 -6
  33. package/bundle/commands/build/deploy.js +9 -9
  34. package/bundle/commands/build/env/get.js +2 -2
  35. package/bundle/commands/build/env/set.js +2 -2
  36. package/bundle/commands/build/find.js +4 -4
  37. package/bundle/commands/build/generate.js +3 -3
  38. package/bundle/commands/build/init-workspace.js +3 -3
  39. package/bundle/commands/build/init.js +3 -3
  40. package/bundle/commands/build/list.js +5 -5
  41. package/bundle/commands/build/sandbox.js +7 -7
  42. package/bundle/commands/build/start.js +2 -2
  43. package/bundle/commands/build/status.js +5 -5
  44. package/bundle/commands/build/stop.js +2 -2
  45. package/bundle/commands/build/tools/check.js +2 -2
  46. package/bundle/commands/build/tools/fmt.js +2 -2
  47. package/bundle/commands/build/unsandbox.js +7 -7
  48. package/bundle/commands/build/upload.js +5 -5
  49. package/bundle/commands/build/validate.js +4 -4
  50. package/bundle/commands/build/workos/delete.js +4 -4
  51. package/bundle/commands/build/workos/env/attach.js +3 -3
  52. package/bundle/commands/build/workos/env/create.js +3 -3
  53. package/bundle/commands/build/workos/env/delete.js +3 -3
  54. package/bundle/commands/build/workos/env/detach.js +3 -3
  55. package/bundle/commands/build/workos/env/get.js +3 -3
  56. package/bundle/commands/build/workos/env/list.js +3 -3
  57. package/bundle/commands/build/workos/env/set.js +3 -3
  58. package/bundle/commands/build/workos/invite.js +3 -3
  59. package/bundle/commands/build/workos/setup.js +3 -3
  60. package/bundle/commands/build/workos/status.js +3 -3
  61. package/bundle/commands/dns/create.js +2 -2
  62. package/bundle/commands/dns/delete.js +4 -4
  63. package/bundle/commands/dns/get.js +4 -4
  64. package/bundle/commands/dns/list.js +3 -3
  65. package/bundle/commands/dns/records/create.js +2 -2
  66. package/bundle/commands/dns/records/delete.js +3 -3
  67. package/bundle/commands/dns/records/get.js +2 -2
  68. package/bundle/commands/dns/records/list.js +2 -2
  69. package/bundle/commands/dns/records/update.js +2 -2
  70. package/bundle/commands/logs/query.js +3 -3
  71. package/bundle/commands/logs/tail.js +3 -3
  72. package/bundle/commands/mcp/install-claude.js +2 -2
  73. package/bundle/commands/mcp/install-gemini.js +2 -2
  74. package/bundle/commands/mcp/install-goose.js +2 -2
  75. package/bundle/commands/mcp/status.js +2 -2
  76. package/bundle/commands/object/delete.js +2 -2
  77. package/bundle/commands/object/get.js +2 -2
  78. package/bundle/commands/object/list.js +2 -2
  79. package/bundle/commands/object/put.js +2 -2
  80. package/bundle/commands/query/chunk-search.js +3 -3
  81. package/bundle/commands/query/document.js +3 -3
  82. package/bundle/commands/query/events.js +2 -2
  83. package/bundle/commands/query/reindex.js +2 -2
  84. package/bundle/commands/query/search.js +3 -3
  85. package/bundle/commands/tail.js +2 -2
  86. package/bundle/index.js +1 -1
  87. package/oclif.manifest.json +2807 -2807
  88. package/package.json +4 -4
  89. package/templates/init/RAINDROP.md.hbs +21 -25
  90. package/templates/init/src/_app/cors.ts +4 -5
@@ -0,0 +1,133 @@
1
+ import {
2
+ init_cjs_shims,
3
+ timestampMs
4
+ } from "./chunk-QN2OJEAL.js";
5
+
6
+ // src/log-helpers.ts
7
+ init_cjs_shims();
8
+ function formatLogAttribute(key, value, displayValue) {
9
+ if (key === "http.status") {
10
+ const statusCode = parseInt(value);
11
+ const statusEmoji = statusCode >= 200 && statusCode < 300 ? "\u2705" : statusCode >= 400 ? "\u274C" : "\u26A0\uFE0F";
12
+ return `${key}: ${statusEmoji} ${value}`;
13
+ } else if (key === "http.method" || key === "http.url") {
14
+ return `${key}: ${value}`;
15
+ } else if (key === "query") {
16
+ return `\u{1F5C4}\uFE0F SQL Query: ${value}`;
17
+ } else if (key === "rows_read") {
18
+ return `\u{1F4CA} Rows Read: ${value}`;
19
+ } else if (key === "rows_written") {
20
+ return `\u270D\uFE0F Rows Written: ${value}`;
21
+ } else if (key === "db") {
22
+ return `\u{1F3E6} Database: ${value}`;
23
+ } else if (key === "error") {
24
+ if (value && value !== "undefined") {
25
+ return `\u274C Error: ${value}`;
26
+ }
27
+ return null;
28
+ } else if (key === "fields" || key === "meta") {
29
+ try {
30
+ const parsed = JSON.parse(displayValue);
31
+ if (key === "meta" && parsed) {
32
+ const metrics = [];
33
+ if (parsed.duration) metrics.push(`${parsed.duration}ms`);
34
+ if (parsed.rows_read) metrics.push(`${parsed.rows_read} rows read`);
35
+ if (parsed.rows_written && parsed.rows_written > 0) metrics.push(`${parsed.rows_written} rows written`);
36
+ if (parsed.served_by_region) metrics.push(`${parsed.served_by_region}`);
37
+ if (parsed.size_after) metrics.push(`DB: ${(parsed.size_after / 1024).toFixed(1)}KB`);
38
+ if (metrics.length > 0) {
39
+ return `\u{1F4CA} ${key}: ${metrics.join(", ")}`;
40
+ } else {
41
+ return `${key}: ${JSON.stringify(parsed, (_, v) => typeof v === "bigint" ? v.toString() : v)}`;
42
+ }
43
+ } else {
44
+ return `${key}: ${JSON.stringify(parsed, (_, v) => typeof v === "bigint" ? v.toString() : v)}`;
45
+ }
46
+ } catch {
47
+ return `${key}: ${displayValue}`;
48
+ }
49
+ } else {
50
+ return `${key}: ${displayValue}`;
51
+ }
52
+ }
53
+ function displayEventAttributes(event, logger, indentLevel = " ") {
54
+ if (event.attributes && Object.keys(event.attributes).length > 0) {
55
+ Object.entries(event.attributes).forEach(([key, value]) => {
56
+ if (value !== void 0 && value !== null) {
57
+ let displayValue = value;
58
+ try {
59
+ const parsed = JSON.parse(value);
60
+ if (typeof parsed === "object" && parsed !== null) {
61
+ displayValue = JSON.stringify(parsed, (_, v) => {
62
+ if (typeof v === "bigint") {
63
+ return v.toString();
64
+ }
65
+ return v;
66
+ }, 2);
67
+ }
68
+ } catch {
69
+ }
70
+ const formattedAttribute = formatLogAttribute(key, value, displayValue);
71
+ if (formattedAttribute) {
72
+ logger.log(`${indentLevel}${formattedAttribute}`);
73
+ }
74
+ }
75
+ });
76
+ }
77
+ }
78
+ function displayTraceGroupedEvents(events, logger) {
79
+ const eventsByTrace = /* @__PURE__ */ new Map();
80
+ events.forEach((event) => {
81
+ const traceId = event.trace?.eventId || "unknown";
82
+ if (!eventsByTrace.has(traceId)) {
83
+ eventsByTrace.set(traceId, []);
84
+ }
85
+ const traceEvents = eventsByTrace.get(traceId);
86
+ if (traceEvents) {
87
+ traceEvents.push(event);
88
+ }
89
+ });
90
+ for (const [traceId, traceEvents] of eventsByTrace) {
91
+ if (traceEvents.length === 0) continue;
92
+ traceEvents.sort((a, b) => {
93
+ if (a.eventOrder !== void 0 && b.eventOrder !== void 0) {
94
+ return a.eventOrder - b.eventOrder;
95
+ }
96
+ const aTime = a.trace?.startTime ? timestampMs(a.trace.startTime) : 0;
97
+ const bTime = b.trace?.startTime ? timestampMs(b.trace.startTime) : 0;
98
+ return aTime - bTime;
99
+ });
100
+ const firstEvent = traceEvents[0];
101
+ const lastEvent = traceEvents[traceEvents.length - 1];
102
+ const startTime = firstEvent.trace?.startTime ? timestampMs(firstEvent.trace.startTime) : 0;
103
+ const endTime = lastEvent.trace?.endTime ? timestampMs(lastEvent.trace.endTime) : lastEvent.trace?.startTime ? timestampMs(lastEvent.trace.startTime) : 0;
104
+ const traceDuration = endTime > startTime ? ` (${endTime - startTime}ms total)` : "";
105
+ const timestamp = firstEvent.trace?.startTime ? new Date(timestampMs(firstEvent.trace.startTime)).toLocaleString() : "Unknown time";
106
+ logger.log(`[${timestamp}] \u{1F517} Trace: ${traceId}${traceDuration}`);
107
+ if (firstEvent.organization?.id || firstEvent.application?.name) {
108
+ const contextParts = [];
109
+ if (firstEvent.organization?.id) contextParts.push(`Org: ${firstEvent.organization.id}`);
110
+ if (firstEvent.application?.name) contextParts.push(`App: ${firstEvent.application.name}`);
111
+ if (firstEvent.application?.version?.id) contextParts.push(`v${firstEvent.application.version.id}`);
112
+ if (firstEvent.script?.name) contextParts.push(`Script: ${firstEvent.script.name}`);
113
+ logger.log(` ${contextParts.join(", ")}`);
114
+ }
115
+ traceEvents.forEach((event, index) => {
116
+ const eventName = event.name || "Event";
117
+ const status = event.status || "ok";
118
+ const statusEmoji = status === "error" ? "\u274C" : "\u2705";
119
+ let duration = "";
120
+ if (event.trace?.endTime && event.trace?.startTime) {
121
+ const durationMs = timestampMs(event.trace.endTime) - timestampMs(event.trace.startTime);
122
+ duration = ` (${durationMs}ms)`;
123
+ }
124
+ logger.log(` ${index + 1}. ${statusEmoji} ${eventName}${duration}`);
125
+ displayEventAttributes(event, logger, " ");
126
+ });
127
+ logger.log("");
128
+ }
129
+ }
130
+
131
+ export {
132
+ displayTraceGroupedEvents
133
+ };
@@ -0,0 +1,75 @@
1
+ import {
2
+ init_cjs_shims
3
+ } from "./chunk-QN2OJEAL.js";
4
+
5
+ // ../../node_modules/.pnpm/@liquidmetal-ai+drizzle@0.9.2/node_modules/@liquidmetal-ai/drizzle/dist/ulid.js
6
+ init_cjs_shims();
7
+ var BASE32_ENCODING = "0123456789abcdefghjkmnpqrstvwxyz";
8
+ var ENCODING_LEN = BASE32_ENCODING.length;
9
+ var TIME_MAX = Math.pow(2, 48) - 1;
10
+ var TIME_LEN = 10;
11
+ var RANDOM_LEN = 16;
12
+ function monotonic() {
13
+ let lastTime = 0;
14
+ let lastRandom;
15
+ return function ulid2() {
16
+ const seed = (/* @__PURE__ */ new Date()).getTime();
17
+ if (seed <= lastTime) {
18
+ lastRandom = incrementBase32(lastRandom);
19
+ return encodeTime(lastTime) + lastRandom;
20
+ }
21
+ lastTime = seed;
22
+ lastRandom = encodeRandom();
23
+ return encodeTime(seed) + lastRandom;
24
+ };
25
+ }
26
+ var ulid = monotonic();
27
+ function encodeRandom() {
28
+ const bytes = crypto.getRandomValues(new Uint8Array(RANDOM_LEN));
29
+ let str = "";
30
+ for (let i = 0; i < RANDOM_LEN; i++) {
31
+ str = str + BASE32_ENCODING[bytes[i] % ENCODING_LEN];
32
+ }
33
+ return str;
34
+ }
35
+ function encodeTime(ms) {
36
+ if (ms > TIME_MAX)
37
+ throw new Error("cannot encode time greater than " + TIME_MAX);
38
+ if (ms < 0)
39
+ throw new Error("time must be positive");
40
+ let mod;
41
+ let str = "";
42
+ for (let len = TIME_LEN; len > 0; len--) {
43
+ mod = ms % ENCODING_LEN;
44
+ str = BASE32_ENCODING[mod] + str;
45
+ ms = (ms - mod) / ENCODING_LEN;
46
+ }
47
+ return str;
48
+ }
49
+ function incrementBase32(str) {
50
+ function replaceCharAt(str2, index2, char2) {
51
+ if (index2 > str2.length - 1)
52
+ return str2;
53
+ return str2.substring(0, index2) + char2 + str2.substring(index2 + 1);
54
+ }
55
+ const maxCharIndex = ENCODING_LEN - 1;
56
+ let index = str ? str.length : 0;
57
+ let char;
58
+ let charIndex;
59
+ while (index-- >= 0) {
60
+ char = str[index];
61
+ charIndex = BASE32_ENCODING.indexOf(char);
62
+ if (charIndex === -1)
63
+ throw new Error("incorrectly encoded string");
64
+ if (charIndex === maxCharIndex) {
65
+ str = replaceCharAt(str, index, BASE32_ENCODING[0]);
66
+ continue;
67
+ }
68
+ return replaceCharAt(str, index, BASE32_ENCODING[charIndex + 1]);
69
+ }
70
+ return str;
71
+ }
72
+
73
+ export {
74
+ ulid
75
+ };