@alook/cli 0.0.138 → 0.0.139
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.js +17 -0
- package/dist/session-runner.js +1 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __returnValue = (v) => v;
|
|
4
5
|
function __exportSetter(name, newValue) {
|
|
@@ -13,6 +14,7 @@ var __export = (target, all) => {
|
|
|
13
14
|
set: __exportSetter.bind(all, name)
|
|
14
15
|
});
|
|
15
16
|
};
|
|
17
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
16
18
|
|
|
17
19
|
// src/index.ts
|
|
18
20
|
import { Command as Command14 } from "commander";
|
|
@@ -16674,6 +16676,7 @@ var artifact = sqliteTable("artifact", {
|
|
|
16674
16676
|
contentType: text("content_type").notNull().default("application/octet-stream"),
|
|
16675
16677
|
size: integer2("size").notNull(),
|
|
16676
16678
|
r2Key: text("r2_key").notNull(),
|
|
16679
|
+
thumbnailR2Key: text("thumbnail_r2_key"),
|
|
16677
16680
|
source: text("source").notNull().default("agent"),
|
|
16678
16681
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16679
16682
|
}, (t) => [
|
|
@@ -23178,8 +23181,22 @@ function syncCommand() {
|
|
|
23178
23181
|
}
|
|
23179
23182
|
const filename = basename3(opts.file);
|
|
23180
23183
|
const contentType = guessContentType(filename);
|
|
23184
|
+
let thumbnailBytes = null;
|
|
23185
|
+
const isRasterImage = contentType.startsWith("image/") && contentType !== "image/svg+xml";
|
|
23186
|
+
if (isRasterImage) {
|
|
23187
|
+
try {
|
|
23188
|
+
const sharpMod = await import("sharp");
|
|
23189
|
+
const sharp = sharpMod.default;
|
|
23190
|
+
thumbnailBytes = await sharp(bytes).resize(200, 200, { fit: "inside" }).jpeg({ quality: 70 }).toBuffer();
|
|
23191
|
+
} catch (err) {
|
|
23192
|
+
console.error(`Warning: thumbnail generation skipped: ${err.message}`);
|
|
23193
|
+
}
|
|
23194
|
+
}
|
|
23181
23195
|
const form = new FormData;
|
|
23182
23196
|
form.append("file", new Blob([new Uint8Array(bytes)], { type: contentType }), filename);
|
|
23197
|
+
if (thumbnailBytes) {
|
|
23198
|
+
form.append("thumbnail", new Blob([new Uint8Array(thumbnailBytes)], { type: "image/jpeg" }), `thumb_${filename}.jpg`);
|
|
23199
|
+
}
|
|
23183
23200
|
form.append("agent_id", agentId);
|
|
23184
23201
|
form.append("conversation_id", opts.conversation_id);
|
|
23185
23202
|
try {
|
package/dist/session-runner.js
CHANGED
|
@@ -16585,6 +16585,7 @@ var artifact = sqliteTable("artifact", {
|
|
|
16585
16585
|
contentType: text("content_type").notNull().default("application/octet-stream"),
|
|
16586
16586
|
size: integer2("size").notNull(),
|
|
16587
16587
|
r2Key: text("r2_key").notNull(),
|
|
16588
|
+
thumbnailR2Key: text("thumbnail_r2_key"),
|
|
16588
16589
|
source: text("source").notNull().default("agent"),
|
|
16589
16590
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16590
16591
|
}, (t) => [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alook/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.139",
|
|
4
4
|
"description": "Alook CLI — Enable Your Person Colleague",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/alookai/alook#readme",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"dev": "bun run src/index.ts",
|
|
41
|
-
"build": "bun build src/index.ts --outdir dist --target node --format esm --external citty --external commander --external postal-mime --external playwright-core && bun build daemon/session-runner.ts --outdir dist --target node --format esm --external citty --external commander --external postal-mime && bun build daemon/meeting-runner.ts --outdir dist --target node --format esm --external playwright-core && node scripts/prepare-dist.mjs",
|
|
41
|
+
"build": "bun build src/index.ts --outdir dist --target node --format esm --external citty --external commander --external postal-mime --external playwright-core --external sharp && bun build daemon/session-runner.ts --outdir dist --target node --format esm --external citty --external commander --external postal-mime && bun build daemon/meeting-runner.ts --outdir dist --target node --format esm --external playwright-core && node scripts/prepare-dist.mjs",
|
|
42
42
|
"prepack": "pnpm run build",
|
|
43
43
|
"knip": "knip",
|
|
44
44
|
"test": "vitest run",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"citty": "^0.2.2",
|
|
51
51
|
"commander": "^14.0.3",
|
|
52
52
|
"playwright-core": "^1.60.0",
|
|
53
|
-
"postal-mime": "^2.7.4"
|
|
53
|
+
"postal-mime": "^2.7.4",
|
|
54
|
+
"sharp": "^0.33.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@alook/shared": "workspace:*",
|