@liquidmetal-ai/raindrop 0.6.4 → 0.8.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.
- package/README.md +440 -73
- package/bin/cjs-shims.js +7 -0
- package/bin/run.js +20 -2
- package/bundle/chunk-5GH4FS6C.js +12148 -0
- package/bundle/chunk-6B4I2CKP.js +231 -0
- package/bundle/chunk-6UE75KX2.js +4481 -0
- package/bundle/chunk-AU3EGGJP.js +44 -0
- package/bundle/chunk-CDQRD3JA.js +75 -0
- package/bundle/chunk-CMCEP64V.js +380 -0
- package/bundle/chunk-CW5ZHVPX.js +292 -0
- package/bundle/chunk-G6NE675D.js +238720 -0
- package/bundle/chunk-GLIYVKQA.js +48 -0
- package/bundle/chunk-KXEV6E63.js +133 -0
- package/bundle/chunk-MCRKUPJY.js +4515 -0
- package/bundle/chunk-MGM2L2T3.js +805 -0
- package/bundle/chunk-MVQYQJHI.js +502 -0
- package/bundle/chunk-NG7CZTTE.js +147 -0
- package/bundle/chunk-PU4RCSXF.js +22452 -0
- package/bundle/chunk-VXAZKB3J.js +292 -0
- package/bundle/chunk-W2L3MYN6.js +4480 -0
- package/bundle/chunk-XYJACVNA.js +231 -0
- package/bundle/commands/annotation/get.js +153 -0
- package/bundle/commands/annotation/list.js +226 -0
- package/bundle/commands/annotation/put.js +177 -0
- package/bundle/commands/auth/list.js +75 -0
- package/bundle/commands/auth/login.js +1654 -0
- package/bundle/commands/auth/logout.js +27 -0
- package/bundle/commands/auth/select.js +53 -0
- package/bundle/commands/bucket/create-credential.js +173 -0
- package/bundle/commands/bucket/delete-credential.js +140 -0
- package/bundle/commands/bucket/get-credential.js +151 -0
- package/bundle/commands/bucket/list-credentials.js +148 -0
- package/bundle/commands/build/branch.js +126 -0
- package/bundle/commands/build/checkout.js +198 -0
- package/bundle/commands/build/clone.js +153 -0
- package/bundle/commands/build/delete.js +227 -0
- package/bundle/commands/build/deploy.js +160 -0
- package/bundle/commands/build/env/get.js +105 -0
- package/bundle/commands/build/env/set.js +115 -0
- package/bundle/commands/build/find.js +333 -0
- package/bundle/commands/build/generate.js +75 -0
- package/bundle/commands/build/init.js +76 -0
- package/bundle/commands/build/list.js +11 -0
- package/bundle/commands/build/sandbox.js +65 -0
- package/bundle/commands/build/start.js +84 -0
- package/bundle/commands/build/status.js +1839 -0
- package/bundle/commands/build/stop.js +84 -0
- package/bundle/commands/build/tools/check.js +32 -0
- package/bundle/commands/build/tools/fmt.js +49 -0
- package/bundle/commands/build/unsandbox.js +65 -0
- package/bundle/commands/build/upload.js +83 -0
- package/bundle/commands/build/validate.js +71 -0
- package/bundle/commands/build/workos/delete.js +86 -0
- package/bundle/commands/build/workos/env/attach.js +134 -0
- package/bundle/commands/build/workos/env/create.js +176 -0
- package/bundle/commands/build/workos/env/delete.js +84 -0
- package/bundle/commands/build/workos/env/detach.js +115 -0
- package/bundle/commands/build/workos/env/get.js +117 -0
- package/bundle/commands/build/workos/env/list.js +139 -0
- package/bundle/commands/build/workos/env/set.js +138 -0
- package/bundle/commands/build/workos/invite.js +91 -0
- package/bundle/commands/build/workos/setup.js +124 -0
- package/bundle/commands/build/workos/status.js +93 -0
- package/bundle/commands/dns/create.js +128 -0
- package/bundle/commands/dns/delete.js +80 -0
- package/bundle/commands/dns/get.js +167 -0
- package/bundle/commands/dns/list.js +193 -0
- package/bundle/commands/dns/records/create.js +150 -0
- package/bundle/commands/dns/records/delete.js +76 -0
- package/bundle/commands/dns/records/get.js +118 -0
- package/bundle/commands/dns/records/list.js +153 -0
- package/bundle/commands/dns/records/update.js +146 -0
- package/bundle/commands/logs/query.js +237 -0
- package/bundle/commands/logs/tail.js +155 -0
- package/bundle/commands/mcp/install-claude.js +220 -0
- package/bundle/commands/mcp/install-gemini.js +220 -0
- package/bundle/commands/mcp/install-goose.js +232 -0
- package/bundle/commands/mcp/status.js +153 -0
- package/bundle/commands/object/delete.js +180 -0
- package/bundle/commands/object/get.js +209 -0
- package/bundle/commands/object/list.js +206 -0
- package/bundle/commands/object/put.js +211 -0
- package/bundle/commands/query/chunk-search.js +123 -0
- package/bundle/commands/query/document.js +126 -0
- package/bundle/commands/query/events.js +98 -0
- package/bundle/commands/query/reindex.js +147 -0
- package/bundle/commands/query/search.js +169 -0
- package/bundle/commands/tail.js +31 -0
- package/bundle/index.js +51 -0
- package/dist/base-command.d.ts +6 -0
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +21 -8
- package/dist/build.d.ts +2 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +169 -51
- package/dist/codegen.d.ts +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +20 -3
- package/dist/codegen.test.js +59 -1
- package/dist/commands/build/checkout.d.ts +17 -0
- package/dist/commands/build/checkout.d.ts.map +1 -1
- package/dist/commands/build/checkout.js +144 -7
- package/dist/commands/build/delete.d.ts +15 -0
- package/dist/commands/build/delete.d.ts.map +1 -1
- package/dist/commands/build/delete.js +133 -0
- package/dist/commands/build/deploy.d.ts.map +1 -1
- package/dist/commands/build/deploy.js +10 -2
- package/dist/commands/build/find.d.ts +1 -0
- package/dist/commands/build/find.d.ts.map +1 -1
- package/dist/commands/build/find.js +33 -2
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +0 -1
- package/dist/commands/build/workos/delete.d.ts +18 -0
- package/dist/commands/build/workos/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/delete.js +72 -0
- package/dist/commands/build/workos/env/attach.d.ts +24 -0
- package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/attach.js +111 -0
- package/dist/commands/build/workos/env/create.d.ts +26 -0
- package/dist/commands/build/workos/env/create.d.ts.map +1 -0
- package/dist/commands/build/workos/env/create.js +156 -0
- package/dist/commands/build/workos/env/delete.d.ts +20 -0
- package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/env/delete.js +61 -0
- package/dist/commands/build/workos/env/detach.d.ts +21 -0
- package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/detach.js +94 -0
- package/dist/commands/build/workos/env/get.d.ts +20 -0
- package/dist/commands/build/workos/env/get.d.ts.map +1 -0
- package/dist/commands/build/workos/env/get.js +94 -0
- package/dist/commands/build/workos/env/list.d.ts +18 -0
- package/dist/commands/build/workos/env/list.d.ts.map +1 -0
- package/dist/commands/build/workos/env/list.js +114 -0
- package/dist/commands/build/workos/env/set.d.ts +27 -0
- package/dist/commands/build/workos/env/set.d.ts.map +1 -0
- package/dist/commands/build/workos/env/set.js +115 -0
- package/dist/commands/build/workos/invite.d.ts +21 -0
- package/dist/commands/build/workos/invite.d.ts.map +1 -0
- package/dist/commands/build/workos/invite.js +68 -0
- package/dist/commands/build/workos/setup.d.ts +20 -0
- package/dist/commands/build/workos/setup.d.ts.map +1 -0
- package/dist/commands/build/workos/setup.js +106 -0
- package/dist/commands/build/workos/status.d.ts +18 -0
- package/dist/commands/build/workos/status.d.ts.map +1 -0
- package/dist/commands/build/workos/status.js +70 -0
- package/dist/commands/mcp/install-claude.d.ts.map +1 -1
- package/dist/commands/mcp/install-claude.js +2 -2
- package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
- package/dist/commands/mcp/install-gemini.js +2 -2
- package/dist/commands/mcp/install-goose.d.ts +22 -0
- package/dist/commands/mcp/install-goose.d.ts.map +1 -0
- package/dist/commands/mcp/install-goose.js +252 -0
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +20 -12
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +20 -12
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +20 -12
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +20 -12
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -4
- package/dist/index.test.js +54 -2
- package/oclif.manifest.json +4533 -2284
- package/package.json +8 -5
- package/templates/claude-code/debug-raindrop-app.md +89 -0
- package/templates/claude-code/new-raindrop-app.md +12 -4
- package/templates/claude-code/reattach-raindrop-session.md +50 -12
- package/templates/claude-code/update-raindrop-app.md +61 -9
- package/templates/db/node_modules/.bin/prisma +2 -2
- package/templates/db/node_modules/.bin/prisma-kysely +2 -2
- package/templates/db/node_modules/.bin/tsc +2 -2
- package/templates/db/node_modules/.bin/tsserver +2 -2
- package/templates/db/node_modules/.bin/zx +2 -2
- package/templates/gemini-code/debug-raindrop-app.toml +86 -0
- package/templates/gemini-code/new-raindrop-app.toml +10 -3
- package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
- package/templates/gemini-code/update-raindrop-app.toml +55 -10
- package/templates/goose/debug-raindrop-app.yaml +91 -0
- package/templates/goose/new-raindrop-app.yaml +21 -0
- package/templates/goose/reattach-raindrop-session.yaml +20 -0
- package/templates/goose/update-raindrop-app.yaml +65 -0
- package/templates/init/src/_app/auth.ts +18 -0
- package/templates/init/src/_app/cors.ts +64 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/templates/claude-code/raindrop-guidelines.md +0 -322
- package/templates/gemini-code/raindrop-guidelines.md +0 -322
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_cjs_shims
|
|
3
|
+
} from "./chunk-G6NE675D.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/dns-utils.ts
|
|
6
|
+
init_cjs_shims();
|
|
7
|
+
async function resolveDnsNameToZoneId(dnsClient, organizationId, userId, dnsName) {
|
|
8
|
+
try {
|
|
9
|
+
const normalizedDnsName = dnsName.endsWith(".") ? dnsName.slice(0, -1) : dnsName;
|
|
10
|
+
let pageToken;
|
|
11
|
+
do {
|
|
12
|
+
const response = await dnsClient.listDNSZones({
|
|
13
|
+
organizationId,
|
|
14
|
+
userId,
|
|
15
|
+
pageSize: 100,
|
|
16
|
+
// Use a larger page size for efficiency
|
|
17
|
+
pageToken
|
|
18
|
+
});
|
|
19
|
+
if (response.zones) {
|
|
20
|
+
const exactMatch = response.zones.find(
|
|
21
|
+
(zone) => zone.fullyQualifiedDomainName === normalizedDnsName
|
|
22
|
+
);
|
|
23
|
+
if (exactMatch?.zoneId) {
|
|
24
|
+
return exactMatch.zoneId;
|
|
25
|
+
}
|
|
26
|
+
const parentZone = response.zones.find((zone) => {
|
|
27
|
+
if (!zone.fullyQualifiedDomainName) return false;
|
|
28
|
+
const zoneFqdn = zone.fullyQualifiedDomainName;
|
|
29
|
+
return normalizedDnsName.endsWith(`.${zoneFqdn}`) || normalizedDnsName === zoneFqdn;
|
|
30
|
+
});
|
|
31
|
+
if (parentZone?.zoneId) {
|
|
32
|
+
return parentZone.zoneId;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
pageToken = response.nextPageToken;
|
|
36
|
+
} while (pageToken);
|
|
37
|
+
throw new Error(`No DNS zone found for domain name: ${dnsName}`);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (error instanceof Error) {
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
throw new Error(`Failed to resolve DNS name to zone ID: ${error}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
resolveDnsNameToZoneId
|
|
48
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_cjs_shims,
|
|
3
|
+
timestampMs
|
|
4
|
+
} from "./chunk-G6NE675D.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
|
+
};
|