@alook/cli 0.0.138 → 0.0.140
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 +28 -10
- 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) => [
|
|
@@ -20717,15 +20720,15 @@ async function startDaemon(profile, serverUrl) {
|
|
|
20717
20720
|
const allEntries = cliConfig.watched_workspaces || [];
|
|
20718
20721
|
const workspaces = allEntries.filter((ws) => ws.status !== "deleted" && !!ws.id);
|
|
20719
20722
|
if (workspaces.length === 0) {
|
|
20720
|
-
log10.
|
|
20721
|
-
process.exit(1);
|
|
20722
|
-
return;
|
|
20723
|
+
log10.info("No workspaces configured — daemon starting in standby mode. Register a workspace to begin.");
|
|
20723
20724
|
}
|
|
20724
|
-
|
|
20725
|
-
|
|
20726
|
-
|
|
20727
|
-
|
|
20728
|
-
|
|
20725
|
+
if (workspaces.length > 0) {
|
|
20726
|
+
const hasPerWorkspaceTokens = workspaces.every((ws) => !!ws.token);
|
|
20727
|
+
if (!hasPerWorkspaceTokens) {
|
|
20728
|
+
log10.error(`Config uses old format. Run '${cmdPrefix()} register --token <token>' for each workspace to upgrade.`);
|
|
20729
|
+
process.exit(1);
|
|
20730
|
+
return;
|
|
20731
|
+
}
|
|
20729
20732
|
}
|
|
20730
20733
|
if (cliConfig.server_url)
|
|
20731
20734
|
config2.serverURL = cliConfig.server_url;
|
|
@@ -20750,7 +20753,7 @@ async function startDaemon(profile, serverUrl) {
|
|
|
20750
20753
|
log10.info(`Detected providers: ${providers.map((p) => `${p.type}@${p.version}`).join(", ")}`);
|
|
20751
20754
|
const workspaceStates = [];
|
|
20752
20755
|
const runtimeIndex = new Map;
|
|
20753
|
-
|
|
20756
|
+
let hadWorkspaces = workspaces.length > 0;
|
|
20754
20757
|
for (const ws of workspaces) {
|
|
20755
20758
|
const runtimes = providers.map((p) => ({
|
|
20756
20759
|
type: p.type,
|
|
@@ -20786,7 +20789,7 @@ async function startDaemon(profile, serverUrl) {
|
|
|
20786
20789
|
});
|
|
20787
20790
|
}
|
|
20788
20791
|
}
|
|
20789
|
-
if (workspaceStates.length === 0 &&
|
|
20792
|
+
if (workspaceStates.length === 0 && hadWorkspaces) {
|
|
20790
20793
|
log10.error("No workspaces registered successfully.");
|
|
20791
20794
|
process.exit(1);
|
|
20792
20795
|
return;
|
|
@@ -21152,6 +21155,7 @@ async function startDaemon(profile, serverUrl) {
|
|
|
21152
21155
|
}
|
|
21153
21156
|
}
|
|
21154
21157
|
if (newWorkspaces.length > 0) {
|
|
21158
|
+
hadWorkspaces = true;
|
|
21155
21159
|
health.setRuntimeCount(workspaceStates.reduce((sum, w) => sum + w.runtimeIds.length, 0));
|
|
21156
21160
|
if (!wsClient && workspaceStates.length > 0) {
|
|
21157
21161
|
const token = workspaceStates[0].token;
|
|
@@ -23178,8 +23182,22 @@ function syncCommand() {
|
|
|
23178
23182
|
}
|
|
23179
23183
|
const filename = basename3(opts.file);
|
|
23180
23184
|
const contentType = guessContentType(filename);
|
|
23185
|
+
let thumbnailBytes = null;
|
|
23186
|
+
const isRasterImage = contentType.startsWith("image/") && contentType !== "image/svg+xml";
|
|
23187
|
+
if (isRasterImage) {
|
|
23188
|
+
try {
|
|
23189
|
+
const sharpMod = await import("sharp");
|
|
23190
|
+
const sharp = sharpMod.default;
|
|
23191
|
+
thumbnailBytes = await sharp(bytes).resize(200, 200, { fit: "inside" }).jpeg({ quality: 70 }).toBuffer();
|
|
23192
|
+
} catch (err) {
|
|
23193
|
+
console.error(`Warning: thumbnail generation skipped: ${err.message}`);
|
|
23194
|
+
}
|
|
23195
|
+
}
|
|
23181
23196
|
const form = new FormData;
|
|
23182
23197
|
form.append("file", new Blob([new Uint8Array(bytes)], { type: contentType }), filename);
|
|
23198
|
+
if (thumbnailBytes) {
|
|
23199
|
+
form.append("thumbnail", new Blob([new Uint8Array(thumbnailBytes)], { type: "image/jpeg" }), `thumb_${filename}.jpg`);
|
|
23200
|
+
}
|
|
23183
23201
|
form.append("agent_id", agentId);
|
|
23184
23202
|
form.append("conversation_id", opts.conversation_id);
|
|
23185
23203
|
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.140",
|
|
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:*",
|