@alook/cli 0.0.137 → 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 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) => [
@@ -18781,6 +18784,7 @@ Your email addresses:
18781
18784
  ${emailLines.join(`
18782
18785
  `)}
18783
18786
 
18787
+ These are YOUR OWN agent email addresses — not the user's. You can only send and receive emails through your own addresses. You do NOT have access to the user's personal email inbox.
18784
18788
 
18785
18789
  ### Email command quick reference
18786
18790
  | Action | Command |
@@ -19336,12 +19340,12 @@ function releaseSteeringLock(baseDir, contextKey) {
19336
19340
  }
19337
19341
 
19338
19342
  // daemon/prompt.ts
19339
- var DM_RESPONSE_NOTICE = "Reply with `alook sync send-dm` — that's the only thing the user sees; your task output and reasoning are not shown." + " Talk to them at milestones like a colleague would, and don't end your turn without sending what they need." + " If this task will take more than 30 seconds, send a quick ack first so the user knows you're on it.";
19343
+ var DM_RESPONSE_NOTICE = "Reply with `alook sync send-dm` — that's the only thing the user sees; your task output and reasoning are not shown." + " Talk to them at milestones like a colleague would, and don't end your turn without sending what they need." + " If this task will take more than 30 seconds, send a quick ack first so the user knows you're on it." + " IMPORTANT: If you were working on a previous task before this message arrived, do NOT silently drop it. After handling this message, return to any prior unfinished work and report the result to the user.";
19340
19344
  var EMAIL_NOTICE = "This task was triggered by an incoming email. Reply to the sender via email — use the email sending tool to respond." + " If you need more information or confirmation, email them and then exit." + " Do not wait — when they reply, a new task will be triggered automatically and you will be woken up with their response." + " IMPORTANT: Do not let this email interrupt any task you were previously working on. After handling this email, return to your original task and make sure it reaches completion.";
19341
19345
  var CALENDAR_NOTICE = "This task was triggered by a scheduled calendar event." + " If you need to communicate with someone, send an email using the email sending tool." + " If you need more information or confirmation, email them and then exit." + " Do not wait — when they reply, a new task will be triggered automatically and you will be woken up with their response.";
19342
19346
  var ISSUE_NOTICE = "This task was triggered by an assigned issue. The issue_id is provided in this message." + " Use `alook issue show --issue_id <issue_id>` to read full context." + " Use `alook issue update --issue_id <issue_id> --status <status>` to change status." + " Use `alook issue comment --issue_id <issue_id> --body <text>` to leave a comment." + " CRITICAL — You MUST manage the issue status correctly. This is NOT optional:" + " 1. Set status to 'in_progress' when you start working." + " 2. If you complete the work yourself: leave a summary comment, then set status to 'review' as your last action. 'review' means there is actual completed work (code, artifact, result) ready for the owner to look at." + " 3. If you delegated work to colleagues and are waiting for their response: KEEP status as 'in_progress' and exit. This is expected — you will be woken up when they reply. Set 'review' only after all delegated work is confirmed complete." + " 4. NEVER set 'review' unless there is concrete completed work for the owner to review. Sending a plan to a colleague is NOT completed work." + " NEVER exit without doing at least one of: updating the status, or leaving a comment explaining what you did and what you're waiting for.";
19343
- function buildDmNotice(name, email3) {
19344
- return `This task was triggered by an incoming email on a conversation with ${name} (${email3}).` + ` ${name} is present in this session — reply to them directly.` + ` If you need to communicate with anyone else, use the email sending tool.`;
19347
+ function buildEmailDmNotice(name, email3) {
19348
+ return `This task was triggered by an incoming email on a conversation with ${name} (${email3}).` + ` ${name} is present in this session — reply to them directly.` + ` If you need to communicate with anyone else, use the email sending tool.` + ` IMPORTANT: Do not let this email interrupt any task you were previously working on. After handling this email, return to your original task and make sure it reaches completion — report the result to the user.`;
19345
19349
  }
19346
19350
  function buildTaskObject(task, attachments) {
19347
19351
  const createdAt = new Date(task.createdAt);
@@ -19372,7 +19376,7 @@ function buildTaskObject(task, attachments) {
19372
19376
  const ctx = task.context;
19373
19377
  const dmUser = ctx?.dmUser;
19374
19378
  if (ctx?.conversationType === "user_dm_message" && dmUser) {
19375
- obj.notice = buildDmNotice(dmUser.name, dmUser.email);
19379
+ obj.notice = buildEmailDmNotice(dmUser.name, dmUser.email);
19376
19380
  } else {
19377
19381
  obj.notice = EMAIL_NOTICE;
19378
19382
  }
@@ -23177,8 +23181,22 @@ function syncCommand() {
23177
23181
  }
23178
23182
  const filename = basename3(opts.file);
23179
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
+ }
23180
23195
  const form = new FormData;
23181
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
+ }
23182
23200
  form.append("agent_id", agentId);
23183
23201
  form.append("conversation_id", opts.conversation_id);
23184
23202
  try {
@@ -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) => [
@@ -18361,6 +18362,7 @@ Your email addresses:
18361
18362
  ${emailLines.join(`
18362
18363
  `)}
18363
18364
 
18365
+ These are YOUR OWN agent email addresses — not the user's. You can only send and receive emails through your own addresses. You do NOT have access to the user's personal email inbox.
18364
18366
 
18365
18367
  ### Email command quick reference
18366
18368
  | Action | Command |
@@ -18833,12 +18835,12 @@ function clearKillIntent(baseDir, taskId) {
18833
18835
  }
18834
18836
 
18835
18837
  // daemon/prompt.ts
18836
- var DM_RESPONSE_NOTICE = "Reply with `alook sync send-dm` — that's the only thing the user sees; your task output and reasoning are not shown." + " Talk to them at milestones like a colleague would, and don't end your turn without sending what they need." + " If this task will take more than 30 seconds, send a quick ack first so the user knows you're on it.";
18838
+ var DM_RESPONSE_NOTICE = "Reply with `alook sync send-dm` — that's the only thing the user sees; your task output and reasoning are not shown." + " Talk to them at milestones like a colleague would, and don't end your turn without sending what they need." + " If this task will take more than 30 seconds, send a quick ack first so the user knows you're on it." + " IMPORTANT: If you were working on a previous task before this message arrived, do NOT silently drop it. After handling this message, return to any prior unfinished work and report the result to the user.";
18837
18839
  var EMAIL_NOTICE = "This task was triggered by an incoming email. Reply to the sender via email — use the email sending tool to respond." + " If you need more information or confirmation, email them and then exit." + " Do not wait — when they reply, a new task will be triggered automatically and you will be woken up with their response." + " IMPORTANT: Do not let this email interrupt any task you were previously working on. After handling this email, return to your original task and make sure it reaches completion.";
18838
18840
  var CALENDAR_NOTICE = "This task was triggered by a scheduled calendar event." + " If you need to communicate with someone, send an email using the email sending tool." + " If you need more information or confirmation, email them and then exit." + " Do not wait — when they reply, a new task will be triggered automatically and you will be woken up with their response.";
18839
18841
  var ISSUE_NOTICE = "This task was triggered by an assigned issue. The issue_id is provided in this message." + " Use `alook issue show --issue_id <issue_id>` to read full context." + " Use `alook issue update --issue_id <issue_id> --status <status>` to change status." + " Use `alook issue comment --issue_id <issue_id> --body <text>` to leave a comment." + " CRITICAL — You MUST manage the issue status correctly. This is NOT optional:" + " 1. Set status to 'in_progress' when you start working." + " 2. If you complete the work yourself: leave a summary comment, then set status to 'review' as your last action. 'review' means there is actual completed work (code, artifact, result) ready for the owner to look at." + " 3. If you delegated work to colleagues and are waiting for their response: KEEP status as 'in_progress' and exit. This is expected — you will be woken up when they reply. Set 'review' only after all delegated work is confirmed complete." + " 4. NEVER set 'review' unless there is concrete completed work for the owner to review. Sending a plan to a colleague is NOT completed work." + " NEVER exit without doing at least one of: updating the status, or leaving a comment explaining what you did and what you're waiting for.";
18840
- function buildDmNotice(name, email3) {
18841
- return `This task was triggered by an incoming email on a conversation with ${name} (${email3}).` + ` ${name} is present in this session — reply to them directly.` + ` If you need to communicate with anyone else, use the email sending tool.`;
18842
+ function buildEmailDmNotice(name, email3) {
18843
+ return `This task was triggered by an incoming email on a conversation with ${name} (${email3}).` + ` ${name} is present in this session — reply to them directly.` + ` If you need to communicate with anyone else, use the email sending tool.` + ` IMPORTANT: Do not let this email interrupt any task you were previously working on. After handling this email, return to your original task and make sure it reaches completion — report the result to the user.`;
18842
18844
  }
18843
18845
  function buildTaskObject(task, attachments) {
18844
18846
  const createdAt = new Date(task.createdAt);
@@ -18869,7 +18871,7 @@ function buildTaskObject(task, attachments) {
18869
18871
  const ctx = task.context;
18870
18872
  const dmUser = ctx?.dmUser;
18871
18873
  if (ctx?.conversationType === "user_dm_message" && dmUser) {
18872
- obj.notice = buildDmNotice(dmUser.name, dmUser.email);
18874
+ obj.notice = buildEmailDmNotice(dmUser.name, dmUser.email);
18873
18875
  } else {
18874
18876
  obj.notice = EMAIL_NOTICE;
18875
18877
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alook/cli",
3
- "version": "0.0.137",
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:*",