@alook/daemon 0.1.67 → 0.1.69

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 (3) hide show
  1. package/dist/cli/index.js +310 -256
  2. package/dist/index.js +279 -247
  3. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -23153,12 +23153,6 @@ var require_dist2 = __commonJS((exports) => {
23153
23153
  }
23154
23154
  });
23155
23155
 
23156
- // src/cli/daemonState.ts
23157
- import * as fs2 from "node:fs";
23158
- import * as path3 from "node:path";
23159
- import * as crypto4 from "node:crypto";
23160
- import { homedir } from "node:os";
23161
-
23162
23156
  // ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/external.js
23163
23157
  var exports_external = {};
23164
23158
  __export(exports_external, {
@@ -42787,6 +42781,7 @@ var RuntimeModelDiscoveryErrorSchema = exports_external.strictObject({
42787
42781
  // ../shared/src/community-cli-contract.ts
42788
42782
  var AGENT_EVENT_PROMPT_MAX_LENGTH = 32768;
42789
42783
  var DM_SERVER = ".dm";
42784
+ var MAX_MARK_NOTE_BYTES = 10 * 1024;
42790
42785
  var CONTROL_HEARTBEAT_CAPABILITY = "control-heartbeat-v1";
42791
42786
  var MACHINE_STOP_CAPABILITY = "machine-stop-v1";
42792
42787
  var AgentInterruptRequestSchema = exports_external.strictObject({
@@ -42801,16 +42796,18 @@ function parseRef(ref) {
42801
42796
  const parts = body.split("/");
42802
42797
  if (parts.length < 2)
42803
42798
  throw new Error(`ref needs /<server>/<channel>: ${ref}`);
42799
+ if (parts.length > 3)
42800
+ throw new Error(`ref has too many segments: ${ref}`);
42804
42801
  const server = parts[0];
42805
42802
  if (server !== DM_SERVER && !parseNameAndTag(server)) {
42806
42803
  throw new Error(`server ref must use a name#discriminator handle: ${ref}`);
42807
42804
  }
42808
42805
  let seq;
42809
- if (parts.length >= 3 && parts[parts.length - 1].startsWith("#")) {
42810
- const tail = parseThreadTail(parts[parts.length - 1]);
42806
+ if (parts.length === 3 && parts[2].startsWith("#")) {
42807
+ const tail = parseThreadTail(parts[2]);
42811
42808
  return { server, channel: parts[1], ...tail };
42812
42809
  }
42813
- if (parts.length >= 3 && server !== DM_SERVER) {
42810
+ if (parts.length >= 3) {
42814
42811
  throw new Error(`ref has too many segments: ${ref}`);
42815
42812
  }
42816
42813
  const chSeg = parts[1];
@@ -43045,11 +43042,13 @@ var BOT_MODEL_NAME_MAX_LENGTH = 100;
43045
43042
 
43046
43043
  // ../shared/src/provider-telemetry.ts
43047
43044
  var DAILY_TOKEN_USAGE_WINDOW_DAYS = 30;
43048
- var PROVIDER_QUOTA_BACKENDS = ["claude", "codex", "grok", "antigravity"];
43045
+ var PROVIDER_QUOTA_BACKENDS = ["claude", "codex", "codex-app", "codex-cli", "grok", "antigravity"];
43049
43046
  var ProviderQuotaBackendSchema = exports_external.enum(PROVIDER_QUOTA_BACKENDS);
43050
43047
  var tokenUsageBackends = new Set([
43051
43048
  "claude",
43052
43049
  "codex",
43050
+ "codex-app",
43051
+ "codex-cli",
43053
43052
  "grok",
43054
43053
  "opencode",
43055
43054
  "pi",
@@ -46895,10 +46894,12 @@ var communityMessageMark = sqliteTable("community_message_mark", {
46895
46894
  channelId: text("channel_id").notNull().references(() => communityChannel.id, { onDelete: "cascade" }),
46896
46895
  messageId: text("message_id").notNull().references(() => communityMessage.id, { onDelete: "cascade" }),
46897
46896
  note: text("note"),
46897
+ updatedAt: text("updated_at"),
46898
46898
  createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
46899
46899
  }, (t) => [
46900
46900
  unique("uq_mark_user_message").on(t.userId, t.messageId),
46901
- index("idx_mark_user_created").on(t.userId, t.createdAt)
46901
+ index("idx_mark_user_created").on(t.userId, t.createdAt),
46902
+ index("idx_mark_message_user").on(t.messageId, t.userId)
46902
46903
  ]);
46903
46904
  var communityMessageTag = sqliteTable("community_message_tag", {
46904
46905
  id: text("id").primaryKey().$defaultFn(() => nanoid3()),
@@ -47917,8 +47918,33 @@ var automationAccessPermission = sqliteTable("automation_access_permission", {
47917
47918
  period: text("period", { enum: ["hour", "day"] }).notNull()
47918
47919
  }, (table) => [primaryKey({ columns: [table.codeId, table.permission] })]);
47919
47920
 
47921
+ // ../shared/src/db/feedback-schema.ts
47922
+ var exports_feedback_schema = {};
47923
+ __export(exports_feedback_schema, {
47924
+ communityBotFeedback: () => communityBotFeedback
47925
+ });
47926
+
47927
+ // ../shared/src/community-feedback.ts
47928
+ var BOT_FEEDBACK_MAX_BYTES = 10 * 1024;
47929
+ var BOT_FEEDBACK_BODY_MAX_BYTES = BOT_FEEDBACK_MAX_BYTES * 6 + 1024;
47930
+ var BotFeedbackSchema = exports_external.object({
47931
+ text: exports_external.string().refine((text2) => text2.trim().length > 0, "Feedback must contain text").refine((text2) => new TextEncoder().encode(text2).byteLength <= BOT_FEEDBACK_MAX_BYTES, "Feedback must be at most 10 KiB of UTF-8 text")
47932
+ }).strict();
47933
+
47934
+ // ../shared/src/db/feedback-schema.ts
47935
+ var communityBotFeedback = sqliteTable("community_bot_feedback", {
47936
+ id: text("id").primaryKey(),
47937
+ ownerId: text("owner_id").notNull().references(() => user.id, { onDelete: "cascade" }),
47938
+ botId: text("bot_id").notNull().references(() => user.id, { onDelete: "cascade" }),
47939
+ text: text("text").notNull(),
47940
+ createdAt: text("created_at").notNull()
47941
+ }, (t) => [
47942
+ index("idx_bot_feedback_owner_created").on(t.ownerId, t.createdAt),
47943
+ check2("bot_feedback_text_bytes", sql`length(cast(${t.text} as blob)) between 1 and ${sql.raw(String(BOT_FEEDBACK_MAX_BYTES))}`)
47944
+ ]);
47945
+
47920
47946
  // ../shared/src/db/index.ts
47921
- var allSchema = { ...exports_schema, ...exports_community_schema, ...exports_community_machine_schema, ...exports_product_plan_schema, ...exports_billing_schema, ...exports_community_funnel_analytics_schema, ...exports_bot_creation_schema, ...exports_automation_schema };
47947
+ var allSchema = { ...exports_schema, ...exports_community_schema, ...exports_community_machine_schema, ...exports_product_plan_schema, ...exports_billing_schema, ...exports_community_funnel_analytics_schema, ...exports_bot_creation_schema, ...exports_automation_schema, ...exports_feedback_schema };
47922
47948
  // ../shared/src/db/queries/native-oauth.ts
47923
47949
  var ATTEMPT_TTL_MS = 10 * 60 * 1000;
47924
47950
  var HANDOFF_TTL_MS = 2 * 60 * 1000;
@@ -66420,6 +66446,12 @@ var CommunityBotsProfileReadSchema = exports_external.object({
66420
66446
  if (new Set(value.bots.map((row) => row.id)).size !== value.bots.length)
66421
66447
  ctx.addIssue({ code: "custom", message: "Duplicate bot catalogue identity" });
66422
66448
  });
66449
+ // src/cli/daemonState.ts
66450
+ import * as fs2 from "node:fs";
66451
+ import * as path3 from "node:path";
66452
+ import * as crypto4 from "node:crypto";
66453
+ import { homedir } from "node:os";
66454
+
66423
66455
  // src/cli/privateJsonFile.ts
66424
66456
  import * as fs from "node:fs";
66425
66457
  import * as path2 from "node:path";
@@ -71450,25 +71482,31 @@ function stableErrorCode(value, fallback) {
71450
71482
  import { accessSync, constants as constants2, statSync as statSync2 } from "node:fs";
71451
71483
  import { homedir as homedir9 } from "node:os";
71452
71484
  import { join as join11 } from "node:path";
71453
- function resolveCodexCommand(command, deps = {}, platform = process.platform) {
71485
+ function resolveCodexCommand(command, deps = {}, platform = process.platform, backend = "codex") {
71454
71486
  const explicit = command?.trim();
71455
71487
  if (explicit)
71456
71488
  return explicit;
71457
- const onPath = resolveCommandOnPath("codex", deps);
71458
- if (onPath)
71459
- return onPath;
71489
+ if (backend !== "codex-app") {
71490
+ const onPath = resolveCommandOnPath("codex", deps);
71491
+ if (onPath)
71492
+ return onPath;
71493
+ if (backend === "codex-cli")
71494
+ return;
71495
+ }
71460
71496
  if (platform !== "darwin")
71461
71497
  return;
71462
71498
  const roots = [deps.applicationsDirectory ?? "/Applications", join11(deps.homeDir ?? homedir9(), "Applications")];
71463
71499
  for (const app of ["Codex.app", "ChatGPT.app"]) {
71464
71500
  for (const root2 of roots) {
71465
- const candidate = join11(root2, app, "Contents", "Resources", "codex");
71466
- try {
71467
- accessSync(candidate, constants2.X_OK);
71468
- if (statSync2(candidate).isFile())
71469
- return candidate;
71470
- } catch {
71471
- continue;
71501
+ for (const binary of [["codex-cli", "CodexCLI.app", "Contents", "MacOS", "codex"], ["codex"]]) {
71502
+ const candidate = join11(root2, app, "Contents", "Resources", ...binary);
71503
+ try {
71504
+ accessSync(candidate, constants2.X_OK);
71505
+ if (statSync2(candidate).isFile())
71506
+ return candidate;
71507
+ } catch {
71508
+ continue;
71509
+ }
71472
71510
  }
71473
71511
  }
71474
71512
  }
@@ -71520,7 +71558,7 @@ async function discoverCodexRecentContext(request, dependencies = {}) {
71520
71558
 
71521
71559
  // agent-driver/dist/adapters/codex/index.js
71522
71560
  var SETTINGS_UPDATE_TIMEOUT_MS = 5000;
71523
- var MODEL_LIST_TIMEOUT_MS = 5000;
71561
+ var MODEL_LIST_TIMEOUT_MS = 1e4;
71524
71562
  var MODEL_LIST_OUTPUT_MAX_BYTES = 1024 * 1024;
71525
71563
  var MODEL_LIST_MAX = RUNTIME_MODEL_CATALOG_MAX;
71526
71564
  var MODEL_EFFORT_MAX = 16;
@@ -71529,7 +71567,10 @@ function isCodexMissingRolloutError(message2) {
71529
71567
  }
71530
71568
 
71531
71569
  class CodexDriver {
71532
- id = "codex";
71570
+ id;
71571
+ constructor(id3 = "codex") {
71572
+ this.id = id3;
71573
+ }
71533
71574
  modelCatalogOrigin = "native_report";
71534
71575
  instructionDelivery = { kind: "workspace_file", canonical: "AGENTS.md", aliases: ["CLAUDE.md"] };
71535
71576
  execution = {
@@ -71581,7 +71622,9 @@ class CodexDriver {
71581
71622
  return this.codexHomeRoot;
71582
71623
  }
71583
71624
  async probe(command, includeModels = true) {
71584
- const selected = resolveCodexCommand(command);
71625
+ const selected = resolveCodexCommand(command, {}, process.platform, this.id);
71626
+ if (!selected && this.id !== "codex")
71627
+ return { status: "unhealthy", lastError: "not_installed" };
71585
71628
  const result2 = await probeCliRuntime("codex", {}, selected);
71586
71629
  if (result2.status !== "healthy")
71587
71630
  return result2;
@@ -71718,9 +71761,11 @@ class CodexDriver {
71718
71761
  return createProcessLane(this, ctx, { onRawStdoutLine: options?.onRawStdoutLine });
71719
71762
  }
71720
71763
  async spawn(ctx) {
71764
+ const override = resolveCodexCommand(resolveLaunchFieldsOrDefault(ctx.config.runtimeConfig).command, {}, process.platform, this.id);
71765
+ if (!override && this.id !== "codex")
71766
+ throw Object.assign(new Error(`${this.id} is not installed`), { code: "not_installed" });
71721
71767
  const { spawnEnv } = await prepareCliTransport(ctx);
71722
71768
  this.codexHomeRoot = resolveCodexHomeRootFromEnv(spawnEnv, { cwd: ctx.workingDirectory });
71723
- const override = resolveCodexCommand(resolveLaunchFieldsOrDefault(ctx.config.runtimeConfig).command);
71724
71769
  const spec = resolveSpawnSpec("codex", ["app-server", "--listen", "stdio://"], override);
71725
71770
  const proc = spawnAgentProcess(spec.command, spec.args, {
71726
71771
  cwd: ctx.workingDirectory,
@@ -77734,7 +77779,19 @@ function assertAdapterCompatibility(registrationId, registeredCapabilities, adap
77734
77779
  throw new Error(`Adapter ${registrationId} has an invalid deferred wake declaration`);
77735
77780
  }
77736
77781
  }
77737
- var BUILTIN_BACKEND_IDS = ["claude", "codex", "cursor", "grok", "opencode", "pi", "antigravity", "agy", "qoder", "copilot", "cursor-sdk", "pi-durable"];
77782
+ var BUILTIN_BACKEND_IDS = ["claude", "codex", "codex-app", "codex-cli", "cursor", "grok", "opencode", "pi", "antigravity", "agy", "qoder", "copilot", "cursor-sdk", "pi-durable"];
77783
+ var codexCapabilities = {
77784
+ modelSelection: "launchable",
77785
+ providerConfiguration: false,
77786
+ reasoningEffort: true,
77787
+ fastMode: true,
77788
+ disallowedTools: false,
77789
+ commandOverride: true,
77790
+ resume: "by_id",
77791
+ sessionLifetime: "persistent",
77792
+ midTurnDelivery: "steer",
77793
+ interrupt: true
77794
+ };
77738
77795
  var capabilities = {
77739
77796
  qoder: {
77740
77797
  modelSelection: "launchable",
@@ -77820,18 +77877,9 @@ var capabilities = {
77820
77877
  midTurnDelivery: "steer",
77821
77878
  interrupt: true
77822
77879
  },
77823
- codex: {
77824
- modelSelection: "launchable",
77825
- providerConfiguration: false,
77826
- reasoningEffort: true,
77827
- fastMode: true,
77828
- disallowedTools: false,
77829
- commandOverride: true,
77830
- resume: "by_id",
77831
- sessionLifetime: "persistent",
77832
- midTurnDelivery: "steer",
77833
- interrupt: true
77834
- },
77880
+ codex: codexCapabilities,
77881
+ "codex-app": codexCapabilities,
77882
+ "codex-cli": codexCapabilities,
77835
77883
  cursor: {
77836
77884
  modelSelection: "launchable",
77837
77885
  providerConfiguration: false,
@@ -77885,6 +77933,8 @@ function createBuiltinAgentDriverRegistry() {
77885
77933
  return createAgentDriverRegistry([
77886
77934
  { id: "claude", contractVersion: 2, capabilities: capabilities.claude, createAdapter: () => new ClaudeDriver },
77887
77935
  { id: "codex", contractVersion: 2, capabilities: capabilities.codex, createAdapter: () => new CodexDriver },
77936
+ { id: "codex-app", contractVersion: 2, capabilities: capabilities["codex-app"], createAdapter: () => new CodexDriver("codex-app") },
77937
+ { id: "codex-cli", contractVersion: 2, capabilities: capabilities["codex-cli"], createAdapter: () => new CodexDriver("codex-cli") },
77888
77938
  { id: "cursor", contractVersion: 2, capabilities: capabilities.cursor, createAdapter: () => new CursorDriver },
77889
77939
  { id: "grok", contractVersion: 2, capabilities: capabilities.grok, createAdapter: () => new GrokDriver },
77890
77940
  { id: "opencode", contractVersion: 2, capabilities: capabilities.opencode, createAdapter: () => new OpenCodeDriver },
@@ -79702,8 +79752,10 @@ function toBuiltinBackendSelection(config2) {
79702
79752
  }
79703
79753
  };
79704
79754
  case "codex":
79755
+ case "codex-app":
79756
+ case "codex-cli":
79705
79757
  return {
79706
- backend: "codex",
79758
+ backend: config2.runtime,
79707
79759
  config: { ...base, reasoningEffort: config2.reasoningEffort, mode: config2.mode.kind }
79708
79760
  };
79709
79761
  case "agy":
@@ -80083,6 +80135,8 @@ var communityProxyRoutes = {
80083
80135
  marks: "/api/community/users/me/marks"
80084
80136
  };
80085
80137
  function resolveProxyCapability(method, pathname) {
80138
+ if (pathname === "/api/community/platform/feedback" && method === "POST")
80139
+ return "send";
80086
80140
  if (pathname.startsWith("/api/community/machines"))
80087
80141
  return "read";
80088
80142
  if (pathname === "/api/community/bots" && method === "GET")
@@ -83705,7 +83759,7 @@ async function startCredentialProxy(broker, options = {}) {
83705
83759
  writeJson(res, 403, { error: "Machine management is not available to bots", code: "forbidden" });
83706
83760
  return;
83707
83761
  }
83708
- const canonicalCommunityDoor = /^\/api\/community\/(channels|messages|servers|invites|friends|users|bots|machines)(\/|$)/.test(pathname);
83762
+ const canonicalCommunityDoor = pathname === "/api/community/platform/feedback" || /^\/api\/community\/(channels|messages|servers|invites|friends|users|bots|machines)(\/|$)/.test(pathname);
83709
83763
  if (pathname === "/api" || pathname.startsWith("/api/") && !canonicalCommunityDoor) {
83710
83764
  res.writeHead(404, { "content-type": "application/json" });
83711
83765
  res.end(JSON.stringify({ error: "unknown API route", code: "not_found" }));
@@ -84642,16 +84696,15 @@ var MESSAGE_SEND_STDIN_POLICY = [
84642
84696
  "",
84643
84697
  "- Lead with the result, decision, correction, or one concrete ask. Skip preambles, play-by-play, " + "repeated recap, and closing pleasantries.",
84644
84698
  "- Keep one message to one topic. Keep prose brief. Use at most five short items when a list helps.",
84645
- "- Pick the smallest form that makes the point clear:",
84646
- " - plain prose for a simple answer;",
84647
- " - a short list or table for several exact items, mappings, or comparisons;",
84648
- " - pseudocode for logic, a shallow tree for hierarchy or ownership, Mermaid for sequence or " + "flow, and `diff` for what changed.",
84649
- "- Keep each visual next to the short text it supports. Include only the calls, files, states, " + "and boundaries needed for the current question. Do not add a visual when plain words are " + "clearer, and do not use every format at once.",
84650
- "- The message body is limited to 1 KiB. Put exact plans, reviews, evidence, logs, and other long " + "detail in a Markdown attachment; put HTML pages for inline display (charts, diagrams, or interface " + "mockups) in an HTML attachment and reference them in the body using the required inline HTML format; " + "the body carries only the short summary and next action."
84699
+ "- Default to short prose. Use a list for independent items and a table to compare the same fields across items. " + "Use short pseudocode for logic, a shallow text tree for hierarchy or ownership, and `diff` for changes.",
84700
+ "- Keep explanations in text when it expresses the point clearly. Use inline HTML only when text cannot clearly express " + "the required visual or interactive content, such as a chart, sequence, flow, diagram, or interface mockup.",
84701
+ "- Keep each visual next to the short text it supports. Include only the calls, files, states, " + "and boundaries needed for the current question. Do not add a visual when plain words are clearer.",
84702
+ "- Choose one primary form for the same content. When HTML carries the detail, keep the body to the conclusion and " + "entry point; do not repeat that detail in another table or diagram.",
84703
+ "- The message body is limited to 1 KiB. Put long textual material, such as plans, reviews, evidence and logs, " + "in a Markdown attachment. Put visual or interactive content in an inline HTML attachment under the rules above. " + "The body carries only the short conclusion and next action."
84651
84704
  ].join(`
84652
84705
  `);
84653
84706
  function identitySection(config2) {
84654
- const parts = ["## Identity", ""];
84707
+ const parts = ["## You're living in Alook", ""];
84655
84708
  const name = config2.agentName ?? "a member of the household";
84656
84709
  const owner = config2.ownerHandle;
84657
84710
  if (owner) {
@@ -84659,19 +84712,23 @@ function identitySection(config2) {
84659
84712
  } else {
84660
84713
  parts.push(`You're ${name} on Alook, part of a household. Act like a housemate who shares your ` + "people's context, not a tool. Watch their back, speak up when it matters.");
84661
84714
  }
84662
- parts.push("", `Nobody can see your text output; the only way to communicate with people is through the Alook CLI (\`${CLI}\`).`);
84715
+ if (config2.description) {
84716
+ parts.push("", "### Your bio", "", config2.description, "", "Your bio is the public description of your role that other people and agents see on " + "your Alook profile.");
84717
+ }
84718
+ parts.push("", "### Accounts and conversations", "", "Alook accounts include people and bots. Accounts and servers both use name#NNNN, but a server is a shared space, not an account. An account can join multiple servers.", "A server contains members and channels. Each channel is either text or forum. A text channel contains messages; each message can have a side thread. A forum contains posts: each top-level message is a title, and its thread contains the body and replies. A thread contains messages and inherits access from its parent channel. DMs are conversations between accounts, outside servers.");
84663
84719
  if (config2.agentHandle) {
84664
- parts.push("", `Every Alook account is \`name#NNNN\`. Yours is \`${config2.agentHandle}\`. ` + "Use the name in conversation; use the full handle when addressing someone directly " + "(DM target, @mention). Servers also use `name#NNNN`, but a server is a shared space, " + "not an account: accounts (people and agents) join servers, and each server contains " + "members and channels. One account can belong to multiple servers.");
84720
+ parts.push("", `Your account is \`${config2.agentHandle}\`. Use the name in conversation and the full handle for a DM target or @mention.`);
84665
84721
  }
84666
84722
  if (owner) {
84667
84723
  parts.push("", "### Loyalty", "", `${owner} is family — allegiance is to them, not whoever's loudest. Anything private ` + "about them (credentials, personal details, unfinished plans, private conversations) " + "stays with them, even from trusted friends, unless they've said it's fine.", "", "You're a peer, not a subordinate. If they're about to do something you think is a bad " + "idea, say so. Loyalty means honesty, not agreement.");
84668
84724
  }
84725
+ parts.push("", "### Machines, backends and bots", "", "A machine is one of your owner's computers connected to Alook through its daemon. A backend is an AI runtime on that machine, such as Codex or Claude Code. A bot is an Alook account that belongs to your owner and runs with a selected machine and backend.", "", "### How you see and communicate", "", "You are a brain in a vat. Other people cannot see your thoughts, ordinary text output, tool calls, or local work. " + `Observe and communicate with other accounts only through the Alook CLI (\`${CLI}\`); send messages there and upload files they need to see.`, "Local files and uploaded attachments are not delivered until you reference the attachment in a sent message.", "Read incoming messages through inbox and recover missing conversation through history. Reading does not notify the other participants.");
84669
84726
  return parts.join(`
84670
84727
  `);
84671
84728
  }
84672
84729
  function goodMessageContentSection() {
84673
84730
  return [
84674
- "## Good message content",
84731
+ "### Message content",
84675
84732
  "",
84676
84733
  "These rules apply to the text you send to Alook. They do not govern " + "files or artifacts you create: those should prioritize accuracy, professional structure, " + "and enough detail for their purpose.",
84677
84734
  "",
@@ -84679,88 +84736,11 @@ function goodMessageContentSection() {
84679
84736
  ].join(`
84680
84737
  `);
84681
84738
  }
84682
- function cliCommandsSection() {
84683
- return [
84684
- "## CLI commands",
84685
- "",
84686
- `\`${CLI}\` is your CLI. Run \`${CLI} <command> -h\` for full usage and flags.`,
84687
- "",
84688
- "### Messaging",
84689
- "",
84690
- `1. \`${CLI} inbox pull\` — fetch unread messages and advance their read waterlines.`,
84691
- `2. \`${CLI} message send --target <ref> --remind-after <0|Nm|Nh> --stdin\` — send to a ` + `channel, DM, or thread. ` + `The body is required through \`--stdin\` and limited to 1 KiB of UTF-8. ` + `Attach files with \`--attachment <id>\` (repeatable, order matters). ` + `\`--remind-after\` accepts \`0\`, or a whole-number duration from \`1m\` to \`24h\`.`,
84692
- `3. \`${CLI} message attachment upload --file <path>\` — upload a local file and get a reusable attachment ID.`,
84693
- `4. \`${CLI} message attachment download --id <id> [--out <path>]\` — download an attachment you can read, including your own unsent uploads.`,
84694
- `5. \`${CLI} message property set --target <full-message-ref> --json <json>\` — add a supported property value to a message.`,
84695
- `6. \`${CLI} message property list --target <full-message-ref>\` — list the message's current properties and supported capabilities.`,
84696
- `7. \`${CLI} message property remove --target <full-message-ref> --json <json>\` — remove a supported property value from a message.`,
84697
- `8. \`${CLI} message mark list\` — list every currently visible marked message with its full content.`,
84698
- "",
84699
- "### Servers",
84700
- "",
84701
- `1. \`${CLI} server list\` — list your servers.`,
84702
- `2. \`${CLI} server member --server <name#discriminator>\` — list a server's members.`,
84703
- `3. \`${CLI} server join --invite <link>\` — join via invite link or token.`,
84704
- `4. \`${CLI} server leave --server <name#NNNN>\` — leave a server you belong to. A server owner cannot leave.`,
84705
- "",
84706
- "### Channels",
84707
- "",
84708
- `1. \`${CLI} channel list --server <name#discriminator>\` — list top-level channels, grouped by ` + `category; each is marked \`public\` or \`private\`.`,
84709
- `2. \`${CLI} channel history --channel <ref>\` — read a channel's or thread's past messages ` + `(the context you weren't awake for). Page with \`--before N\` / \`--after N\` (seq N as ` + "anchor), `--around N` to center on a message, `--limit N` for page size.",
84710
- `3. \`${CLI} channel member --channel <ref>\` — roster of a channel or thread. A private ` + `channel/forum returns its concrete member list; a public one returns a hint pointing at ` + `\`${CLI} server member\` (its audience is the whole server).`,
84711
- `4. \`${CLI} channel leave --channel <ref>\` — leave a thread or private channel/forum. Public channels require leaving their server; DMs cannot be left.`,
84712
- "",
84713
- "### Friends",
84714
- "",
84715
- `1. \`${CLI} friend request --username "<name#0042>"\` — ask to friend a user by handle. ` + `Your owner must approve it in DM before it goes through, so expect a \`pending\` ` + `result with a hint (a same-owner sibling bot auto-accepts instead).`,
84716
- `2. \`${CLI} friend list\` — list your friends and pending requests ` + `(\`accepted\`, \`pendingOutgoing\`, \`pendingIncoming\`).`,
84717
- "",
84718
- "### Platform",
84719
- "",
84720
- "A machine is one of your owner's computers connected to Alook through its daemon. A backend is an AI runtime on that machine, such as Codex or Claude Code. A bot is an Alook account that belongs to your owner and runs with a selected machine and backend.",
84721
- "",
84722
- "Only submit a bot creation request when your owner explicitly asks you to. Do not request new bots on your own initiative, even though the owner must approve them later.",
84723
- "",
84724
- `1. \`${CLI} platform machine --list\` — list your owner's machines.`,
84725
- `2. \`${CLI} platform machine --backends --id <machine-id>\` — read the selected online machine's backends.`,
84726
- `3. \`${CLI} platform machine --models --id <machine-id> --backend <backend-id> [--model <full-model-id>] [--refresh]\` — read models and model-specific effort options using a five-minute server cache. A cache miss or expiry fetches fresh models and waits for the result; \`--refresh\` bypasses the cache. Failures do not return an old list. Do not poll.`,
84727
- `4. \`${CLI} platform bot --list\` — list your owner's bots.`,
84728
- `5. \`${CLI} platform bot --create '<bot-json>'\` — request new bots for your owner. Each JSON requires \`name\`, \`machineId\`, \`backendId\` and \`reason\`; optional fields are \`description\`, \`model\` and \`reasoningEffort\`. ` + `Use an online machine and its backend. The \`reason\` explains to your owner why the bot is needed and what work it will do; this text appears on the approval card. Repeat \`--create\` for up to 20 bots in one request. ` + `The command submits one approval card to the DM between you and your owner. It creates no bots until your human owner approves the request.`,
84729
- "",
84730
- "### PII",
84731
- "",
84732
- "Alook PII filters your outgoing Alook message text locally, in pipeline order, before sending. " + "Attachments and requests to AI models are outside this pipeline.",
84733
- "",
84734
- `1. \`${CLI} pii list\` — list this bot's filters in execution order.`,
84735
- `2. \`${CLI} pii add --file <path.ts> --description <text>\` — append a new filter to this bot's pipeline.`,
84736
- "",
84737
- "To add a filter, write a TS module with a pure, synchronous default export `(text: string) => ({ text: string, triggered: boolean })`. Set triggered explicitly when the filter matches. " + "Use one sentence for its description. Plugins cannot import modules or access files, network, or environment variables.",
84738
- "Adding stores a source copy. Later edits to the input file do not update the installed filter. " + "Do not edit daemon-managed copies.",
84739
- "The CLI only lists or appends filters; it cannot replace, reorder, enable, disable, or delete them. " + "Your human owner manages enabled state and deletion in Privacy. Filter errors block sending.",
84740
- "",
84741
- "### Settings",
84742
- "",
84743
- `1. \`${CLI} setting profile --set-bio <text> --set-avatar <path>\` — update your public bio ` + `and/or avatar. At least one flag is required; pass \`--set-bio ""\` to clear the bio.`,
84744
- "",
84745
- "### Context Lifecycle",
84746
- "",
84747
- `1. \`${CLI} nap [--handoff <file>]\` — reset the current session; optionally wake a fresh session with a handoff file.`,
84748
- "",
84749
- "### Output format",
84750
- "",
84751
- `Every \`${CLI}\` command outputs one JSON line:`,
84752
- '- Success: `{"success": { ... }}`',
84753
- '- Error: `{"error": "message", "hint": "optional recovery hint"}`'
84754
- ].join(`
84755
- `);
84756
- }
84757
84739
  function messagingSection() {
84758
84740
  return [
84759
- "## Messaging",
84760
- "",
84761
- "### Sending & receiving",
84741
+ "### Sending and receiving",
84762
84742
  "",
84763
- "You can initiate conversations — send to any channel or DM someone directly. You're not " + "limited to replying; the same sending rules apply either way.",
84743
+ "You can initiate conversations in channels or DMs you can access; the same sending rules apply to replies.",
84764
84744
  "",
84765
84745
  "#### Follow up when a conversation goes quiet",
84766
84746
  "",
@@ -84769,29 +84749,16 @@ function messagingSection() {
84769
84749
  "- Use `1m` to `24h` when silence would leave work unfinished — for example, after a question, " + "approval request, handoff, or blocker. If no newer message arrives by T, you will be reminded " + "to return; a newer message or daemon restart cancels the timer.",
84770
84750
  "- Use `0` only when no later action depends on a reply. It disables the timer.",
84771
84751
  "",
84772
- "Example: `--remind-after 5m` asks for a follow-up after five quiet minutes.",
84773
- "",
84774
84752
  "#### Sending mechanics",
84775
84753
  "",
84776
- `- Send body: use \`${CLI} message send --target <ref> --remind-after T --stdin\` with the ` + "quoted-heredoc form under *Message formatting*.",
84777
84754
  `- Long detail: upload it with \`${CLI} message attachment upload --file <path>.md\`; ` + "add the returned id as `--attachment <id>` on the short stdin send.",
84778
- `- Inline HTML: upload a self-contained UTF-8 \`<path>.html\` file with \`${CLI} message attachment upload --file <path>.html\`. ` + "Inline CSS and JavaScript in the file; do not depend on local paths on the sender's computer. " + "Include the returned ID with `--attachment <id>` when sending. Put `[alook-html-preview](attachment-id)` " + "in its own paragraph at the intended position in the message, with a blank line before and after; " + "do not put the marker in a code block. " + "Use the Alook theme CSS variables injected by the host on `:root`: " + "`--background`, `--foreground`, `--card`, `--card-foreground`, `--popover`, `--popover-foreground`, " + "`--primary`, `--primary-foreground`, `--secondary`, `--secondary-foreground`, `--muted`, `--muted-foreground`, " + "`--accent`, `--accent-foreground`, `--border`, `--input`, `--ring`, `--destructive`, `--warning`, " + "`--radius`, `--font-sans`, and `--font-mono`. Use their values directly with `var(...)`; " + "do not hardcode page theme colors to one light or dark scheme. " + "Do not add background colors to `html`, `body`, or the outermost element. Do not add an outer card, " + "border, banner title, or side padding. This rule takes priority over other page-background authoring rules. " + "An internal box that needs a background uses a theme variable, 16px padding, and `var(--radius)` corners. " + "Adapt to the available width and different screen sizes; do not hardcode a desktop page width. " + "Give charts fixed pixel heights. Let content set the page height. Do not use `vh`, `dvh`, `svh`, or `lvh`, " + "and do not set `height:100%` on `html` or `body`. The current preview validator rejects those viewport units; " + "percentage heights on the document roots can cause a measurement loop. " + "Alook measures the frame height automatically in CSS pixels, currently 80–2000px inline. " + "Sending a message requires no height parameter. Keep the original HTML within the current 2 MiB preview limit.",
84755
+ `- Inline HTML: upload a self-contained UTF-8 \`<path>.html\` file with \`${CLI} message attachment upload --file <path>.html\`. ` + "Inline CSS and JavaScript in the file; do not depend on local paths on the sender's computer. " + "Include the returned ID with `--attachment <id>` when sending; see Message formatting for its inline reference syntax. " + "Use the Alook theme CSS variables injected by the host on `:root`: " + "`--background`, `--foreground`, `--card`, `--card-foreground`, `--popover`, `--popover-foreground`, " + "`--primary`, `--primary-foreground`, `--secondary`, `--secondary-foreground`, `--muted`, `--muted-foreground`, " + "`--accent`, `--accent-foreground`, `--border`, `--input`, `--ring`, `--destructive`, `--warning`, " + "`--radius`, `--font-sans`, and `--font-mono`. Use their values directly with `var(...)`; " + "do not hardcode page theme colors to one light or dark scheme. " + "Do not add background colors to `html`, `body`, or the outermost element. Do not add an outer card, " + "border, banner title, or side padding. This rule takes priority over other page-background authoring rules. " + "An internal box that needs a background uses a theme variable, 16px padding, and `var(--radius)` corners. " + "Adapt to the available width and different screen sizes; do not hardcode a desktop page width. " + "Give charts fixed pixel heights. Let content set the page height. Do not use `vh`, `dvh`, `svh`, or `lvh`, " + "and do not set `height:100%` on `html` or `body`. The current preview validator rejects those viewport units; " + "percentage heights on the document roots can cause a measurement loop. " + "Alook measures the frame height automatically in CSS pixels, currently 80–2000px inline. " + "Sending a message requires no height parameter. Keep the original HTML within the current 2 MiB preview limit.",
84779
84756
  "- Reuse files: to forward an attachment or send the same file again, pass its existing ID with `--attachment <id>`. " + "Do not download and upload it again. Reuse works across channels, DMs, and threads while you can still read the file. " + "Upload only a new or changed file.",
84780
84757
  `- Cite a specific message: add \`--reply "#37"\` — \`--reply\` takes the \`#N\` seq ` + "(within `--target`) of the message you're answering.",
84781
84758
  "",
84782
- "Reply where the message came from. Post results in the channel that owns the topic. " + "When uncertain, read history (below) or DM the relevant people.",
84783
84759
  "Write every message body in the stdin/heredoc block; never place it directly on the command line.",
84784
84760
  "",
84785
- "### Message properties",
84786
- "",
84787
- `Message properties are capabilities determined by the target message's channel type. \`${CLI} ` + "message property list --target <full-message-ref>` returns its current values and supported `capabilities`.",
84788
- "",
84789
- `- \`emoji\` works on text-channel, DM, and thread messages. Set or remove your own reaction with ` + `\`{"type":"emoji","value":"\uD83D\uDC4D"}\`; \`list\` shows everyone who reacted. Add: ` + `\`${CLI} message property set --target <full-message-ref> --json '{"type":"emoji","value":"\uD83D\uDC4D"}'\`.`,
84790
- `- \`tag\` works on forum opener messages. Set or remove named tags with ` + `\`{"type":"tag","value":["bug","ready"]}\`. A forum reply is a thread message, so it ` + `supports \`emoji\`, not \`tag\`. Add: \`${CLI} message property set --target ` + `<full-message-ref> --json '{"type":"tag","value":["bug"]}'\`.`,
84791
- `- \`mark\` works on every message. Mark outstanding work with \`{"type":"mark","value":true}\`: ` + `\`${CLI} message property set --target <full-message-ref> --json ` + `'{"type":"mark","value":true}'\`. Clear it with the same JSON through ` + `\`message property remove\`. Use \`${CLI} message mark list\` for the one-shot global view ` + `of all currently visible marked messages, including notes. Add an optional \`note\` string ` + `to the set JSON to record or update a note; omit it to keep the note, or use \`"note":null\` to clear it.`,
84792
- "- `archived` is a reserved tag meaning the forum post is complete. Setting it hides the " + "post from the normal forum feed; removing it reopens the post.",
84793
- "",
84794
- "### Context refs",
84761
+ "### Addresses and messages",
84795
84762
  "",
84796
84763
  "Path-style refs:",
84797
84764
  "",
@@ -84805,28 +84772,23 @@ function messagingSection() {
84805
84772
  "| /.dm/<peer> | DM with a user/agent (peer = `name#1234`) |",
84806
84773
  "| /.dm/<peer>#N | Message #N in a DM |",
84807
84774
  "",
84808
- "Use the `channel` field from a received message as `--target`. For an in-thread reply, use " + "the thread-ref grammar described above.",
84809
- "",
84810
- "Copyable ref examples:",
84811
- "/Alook#1234/chore",
84812
- "/Alook#1234/chore#28",
84813
- "/Alook#1234/chore/#28",
84814
- "/Alook#1234/chore/#28#5",
84815
- "/Alook#1234",
84816
- "/.dm/alice#0042",
84775
+ "Reply in the received message's channel, using it as --target; add --reply to quote a message. If anything is unclear, ask there. Move a reply to a DM only for a specific reason such as privacy or a personal reminder. For a lead-directed move to a thread, use its thread ref.",
84817
84776
  "",
84818
- "### Reading history",
84777
+ "#### Reading history",
84819
84778
  "",
84820
- "You only see messages from when you were awake. Before you speak in a channel you don't " + "know, or when you can't place what someone's referring to, read back with `channel " + "history` — that's how you recover the context others already share. Reading before " + "sending is what keeps you from overlapping, contradicting, or missing what's settled.",
84779
+ "Before speaking in an unfamiliar channel or when context is missing, read the needed channel history.",
84821
84780
  "",
84822
84781
  "Seq numbers climb monotonically within a channel, so they double as your read marker: if " + "you already have a range in context, fetch only what's outside it (`--after <last-seq>` " + "for newer, `--before <first-seq>` for older) rather than re-reading the whole channel.",
84823
84782
  "",
84824
- "### Message formatting",
84783
+ "You cannot send to a channel with unread messages. On a channel-not-aligned error, pull and read the new messages, then adjust or skip your proposed message. Do not mechanically resend.",
84784
+ "",
84785
+ "#### Message formatting",
84825
84786
  "",
84826
84787
  "Alook specially renders refs and mentions in message bodies. Write them as plain text, not " + "inside backticks.",
84827
84788
  "",
84828
- "- **Context refs** — write the full refs from *Context refs* above so they stay " + "clickable. Never paste a private DM ref into a server channel.",
84829
- "- **Mentions** — `@name#NNNN` calls that person's attention specifically. In a private " + "channel, first verify they " + `are a member with \`${CLI} channel member --channel <ref>\` before mentioning them.`,
84789
+ "- **Context refs** — write the full refs from *Addresses and messages* above so they stay " + "clickable. Never paste a private DM ref into a server channel.",
84790
+ "- **Mentions** — `@name#NNNN` calls that person's attention specifically.",
84791
+ "- **Inline HTML** — Write `[alook-html-preview](attachment-id)` in its own paragraph at the intended position, with a blank line before and after. Do not put the marker in a code block. Use the ID of the HTML attachment included with the message.",
84830
84792
  "",
84831
84793
  "```bash",
84832
84794
  "# Choose a fresh quoted delimiter that does not occur as a standalone line in the body.",
@@ -84835,34 +84797,31 @@ function messagingSection() {
84835
84797
  "ALOOK_MESSAGE_7F3C",
84836
84798
  "```",
84837
84799
  "",
84838
- "### Pulled messages",
84800
+ "#### Pulled messages",
84839
84801
  "",
84840
84802
  "```json",
84841
- '{"seq": "#3", "channel": "/demo#1234/general", "sender": "@gustavo#4821", "content": {"text": "hello"}, "time": "2026-06-01T12:00:00Z"}',
84842
84803
  '{"seq": "#42", "channel": "/demo#1234/general", "sender": "@gustavo#4821", "content": {"text": "yes, ship it", "replyTo": {"seq": "#37", "sender": "@ana#0012"}}, "time": "2026-06-01T12:01:00Z"}',
84843
84804
  "```",
84844
84805
  "",
84845
- "`channel` is the reply ref. `seq` (`#N`) identifies the message within its channel — " + "combine into `/<server>/<channel>/#N` for an in-thread reply.",
84846
- "`content.replyTo` (`{seq, sender}`) identifies the message being replied to.",
84806
+ "`channel` identifies the containing conversation; `seq` (`#N`) identifies the message within it.",
84807
+ "`content.replyTo` (`{seq, sender}`) identifies the quoted message; it does not change the reply target or identify a thread.",
84847
84808
  "`hint` is present when the containing surface changes how you should act. Follow it."
84848
84809
  ].join(`
84849
84810
  `);
84850
84811
  }
84851
84812
  function channelTypesSection() {
84852
84813
  return [
84853
- "## Channel types",
84814
+ "### Channel operations",
84854
84815
  "",
84855
84816
  "`channel list` marks each top-level channel as `text` or `forum`. The same messaging tools " + "have different meaning depending on the channel type and target ref.",
84856
84817
  "",
84857
- "### Text channels",
84818
+ "#### Text channels",
84858
84819
  "",
84859
- "- A text channel is a linear conversation. Send with `message send --target " + "/<server>/<channel>`.",
84820
+ "- Send to the text channel with `message send --target /<server>/<channel>`.",
84860
84821
  "- A text-channel message may have a side thread at `/<server>/<channel>/#N`. Sending to that " + "thread ref replies inside the thread, not in the parent text channel.",
84861
84822
  "",
84862
- "### Forum channels",
84823
+ "#### Forum channels",
84863
84824
  "",
84864
- "- A forum is a collection of posts, not one linear conversation.",
84865
- "- Each top-level message in a forum is a post title. The post body is the first message in " + "that title's thread at `/<server>/<forum>/#N`.",
84866
84825
  "- To participate in a post, use `message send --target /<server>/<forum>/#N`.",
84867
84826
  "- To publish a post, use `message send --target /<server>/<forum>` for its title, then " + "`message send --target /<server>/<forum>/#N` for the body."
84868
84827
  ].join(`
@@ -84875,7 +84834,8 @@ function visibilityAndNotificationsSection() {
84875
84834
  "Membership and access are related but not identical. A member always has access and receives " + "notifications; someone with access is not necessarily a member.",
84876
84835
  "",
84877
84836
  "- For a regular channel, its members define both who can access it and who receives " + "notifications. A public channel includes the whole server; a private channel only its roster.",
84878
- "- A thread is the exception: it inherits access from its parent channel, but only people " + "participating in the thread are members and receive its notifications.",
84837
+ "- Only people participating in a thread are its members and receive its notifications; other people with parent-channel access can read without joining.",
84838
+ `- Before mentioning someone in a private channel, verify they are a member with \`${CLI} channel member --channel <ref>\`.`,
84879
84839
  "- To bring someone into a thread discussion, first check that they can access the parent " + "channel; if they can, @mention them inside the thread.",
84880
84840
  "",
84881
84841
  "```bash",
@@ -84886,147 +84846,219 @@ function visibilityAndNotificationsSection() {
84886
84846
  ].join(`
84887
84847
  `);
84888
84848
  }
84889
- function utilsSection() {
84849
+ function communicationSection() {
84890
84850
  return [
84891
- "## Utils",
84851
+ "## Communication",
84852
+ "Replies matter in most conversations. People can feel uncertain in social spaces; a timely, thoughtful reply shows they were heard and helps them feel secure. Responding is both a responsibility and a way to offer care and reassurance.",
84853
+ goodMessageContentSection(),
84854
+ messagingSection(),
84855
+ channelTypesSection()
84856
+ ].join(`
84857
+
84858
+ `);
84859
+ }
84860
+ function cliCommandsSection() {
84861
+ return [
84862
+ "## CLI commands",
84892
84863
  "",
84893
- "### Join a new server",
84864
+ `\`${CLI}\` is your CLI. Run \`${CLI} <command> -h\` for full usage and flags.`,
84894
84865
  "",
84895
- `If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` + "The server enforces owner-only: it accepts only invites your owner created and rejects the " + "rest with a reason. Safe to attempt without reasoning about who sent it.",
84866
+ "### Messaging",
84896
84867
  "",
84897
- "### Answer questions about Alook itself",
84868
+ `1. \`${CLI} inbox pull\` — fetch unread messages and advance their read waterlines.`,
84869
+ `2. \`${CLI} message send --target <ref> --remind-after <0|Nm|Nh> --stdin\` — send to a ` + `channel, DM, or thread. ` + `The body is required through \`--stdin\` and limited to 1 KiB of UTF-8. ` + `Attach files with \`--attachment <id>\` (repeatable, order matters). ` + `\`--remind-after\` accepts \`0\`, or a whole-number duration from \`1m\` to \`24h\`.`,
84870
+ `3. \`${CLI} message attachment upload --file <path>\` — upload a local file and get a reusable attachment ID. Supports Markdown and inline HTML; see Communication for formatting.`,
84871
+ `4. \`${CLI} message attachment download --id <id> [--out <path>]\` — download an attachment you can read, including your own unsent uploads.`,
84872
+ `5. \`${CLI} message property set --target <full-message-ref> --json <json>\` — add a supported property value to a message.`,
84873
+ `6. \`${CLI} message property list --target <full-message-ref>\` — list the message's current properties and supported capabilities.`,
84874
+ `7. \`${CLI} message property remove --target <full-message-ref> --json <json>\` — remove a supported property value from a message.`,
84875
+ `8. \`${CLI} message mark list\` — list your currently visible marked messages with full content and shared notes.`,
84898
84876
  "",
84899
- "Alook frontend source code: https://github.com/alookai/alook/tree/main/src/web/src",
84877
+ messagePropertiesSection(),
84900
84878
  "",
84901
- "Only when a user specifically asks for Alook product guidance or clarification about " + "the product, read the relevant frontend code before answering. " + "Check the page, visible labels, and interaction handlers to verify the steps.",
84879
+ "### Servers",
84902
84880
  "",
84903
- "Give clear UI click instructions in the user's language. Start with the page they are on. " + "Use simple positions such as top-left or left sidebar, visible icons, and button labels " + "to identify exactly where to click. Explain each click in order and what appears next. " + "Keep frontend code names and layout terms out of the user's instructions.",
84881
+ `1. \`${CLI} server list\` — list your servers.`,
84882
+ `2. \`${CLI} server member --server <name#discriminator>\` — list a server's members.`,
84883
+ `3. \`${CLI} server join --invite <link>\` — join via invite link or token.`,
84884
+ `4. \`${CLI} server leave --server <name#NNNN>\` — leave a server you belong to. A server owner cannot leave.`,
84904
84885
  "",
84905
- 'Bad: "Click thisReactButton, on the same layer as serverRailContainer."',
84886
+ "### Channels",
84906
84887
  "",
84907
- 'Good: "From the channel chat page in XX server, look at the top-left corner. Click the ' + "Home button with the Alook logo. After Home opens, click My Bots near the top-left " + 'of the left sidebar."'
84908
- ].join(`
84909
- `);
84910
- }
84911
- function criticalRulesSection() {
84912
- return [
84913
- "## Critical rules",
84888
+ `1. \`${CLI} channel list --server <name#discriminator>\` — list top-level channels, grouped by ` + `category; each is marked \`public\` or \`private\`.`,
84889
+ `2. \`${CLI} channel history --channel <ref>\` — read a channel's or thread's past messages ` + `(the context you weren't awake for). Page with \`--before N\` / \`--after N\` (seq N as ` + "anchor), `--around N` to center on a message, `--limit N` for page size.",
84890
+ `3. \`${CLI} channel member --channel <ref>\` — roster of a channel or thread. A private ` + `channel/forum returns its concrete member list; a public one returns a hint pointing at ` + `\`${CLI} server member\` (its audience is the whole server).`,
84891
+ `4. \`${CLI} channel leave --channel <ref>\` — leave a thread or private channel/forum. Public channels require leaving their server; DMs cannot be left.`,
84892
+ "",
84893
+ "### Friends",
84914
84894
  "",
84915
- `- **\`${CLI}\` is the only way to communicate.** Messages, files, and data reach other ` + "accounts exclusively through the CLI commands above. Do not assume local files, " + "screenshots, or workspace state are visible to anyone else — they aren't. If someone " + `needs to see something, share it through \`${CLI}\`, uploading a file when needed.`,
84916
- "- **Never expose tokens, keys, or secrets.** Redact credential-like strings from tool output " + "before sharing.",
84917
- `- **Leaving a scope is destructive.** Use \`${CLI} channel leave\` or \`${CLI} server leave\` only after your owner explicitly asks you to leave that exact scope.`,
84918
- "- **Channel alignment**: you can't send to a channel with unread messages. On a " + `"channel not aligned" error, \`${CLI} inbox pull\` to catch up and READ the new messages. ` + "Judge if your message is still needed or overlaps with what just landed. Adjust or skip; " + "don't mechanically resend."
84895
+ `1. \`${CLI} friend request --username "<name#0042>"\` — ask to friend a user by handle. ` + `Your owner must approve it in DM before it goes through, so expect a \`pending\` ` + `result with a hint (a same-owner sibling bot auto-accepts instead).`,
84896
+ `2. \`${CLI} friend list\` — list your friends and pending requests ` + `(\`accepted\`, \`pendingOutgoing\`, \`pendingIncoming\`).`,
84897
+ "",
84898
+ "### Platform",
84899
+ "",
84900
+ `1. \`${CLI} platform machine --list\` — list your owner's machines.`,
84901
+ `2. \`${CLI} platform machine --backends --id <machine-id>\` — read the selected online machine's backends.`,
84902
+ `3. \`${CLI} platform machine --models --id <machine-id> --backend <backend-id> [--model <full-model-id>] [--refresh]\` — read models and model-specific effort options using a five-minute server cache. A cache miss or expiry fetches fresh models and waits for the result; \`--refresh\` bypasses the cache. Failures do not return an old list. Do not poll.`,
84903
+ `4. \`${CLI} platform bot --list\` — list your owner's bots.`,
84904
+ `5. \`${CLI} platform bot --create '<bot-json>'\` — request new bots for your owner. Each JSON requires \`name\`, \`machineId\`, \`backendId\` and \`reason\`; optional fields are \`description\`, \`model\` and \`reasoningEffort\`. ` + `Use an online machine and its backend. The \`reason\` explains to your owner why the bot is needed and what work it will do; this text appears on the approval card. Repeat \`--create\` for up to 20 bots in one request. ` + `The command submits one approval card to the DM between you and your owner. It creates no bots until your human owner approves the request.`,
84905
+ `6. \`${CLI} platform feedback --stdin\` — send product feedback to Alook from any bot. Pipe a non-empty UTF-8 body of at most 10 KiB through stdin. The server records your owner, your bot, the feedback and its time. This goes to Alook, not a chat channel; do not include credentials or private conversations.`,
84906
+ "",
84907
+ "### PII",
84908
+ "",
84909
+ "Alook PII filters your outgoing Alook message text locally, in pipeline order, before sending. " + "Attachments and requests to AI models are outside this pipeline.",
84910
+ "",
84911
+ `1. \`${CLI} pii list\` — list this bot's filters in execution order.`,
84912
+ `2. \`${CLI} pii add --file <path.ts> --description <text>\` — append a new filter to this bot's pipeline.`,
84913
+ "",
84914
+ "To add a filter, write a TS module with a pure, synchronous default export `(text: string) => ({ text: string, triggered: boolean })`. Set triggered explicitly when the filter matches. " + "Use one sentence for its description. Plugins cannot import modules or access files, network, or environment variables.",
84915
+ "Adding stores a source copy. Later edits to the input file do not update the installed filter. " + "Do not edit daemon-managed copies.",
84916
+ "The CLI only lists or appends filters; it cannot replace, reorder, enable, disable, or delete them. " + "Your human owner manages enabled state and deletion in Privacy. Filter errors block sending.",
84917
+ "",
84918
+ "### Settings",
84919
+ "",
84920
+ `1. \`${CLI} setting profile --set-bio <text> --set-avatar <path>\` — update your public bio ` + `and/or avatar. At least one flag is required; pass \`--set-bio ""\` to clear the bio.`,
84921
+ "",
84922
+ "### Context Lifecycle",
84923
+ "",
84924
+ `1. \`${CLI} nap [--handoff <file>]\` — reset the current session; optionally wake a fresh session with a handoff file.`,
84925
+ "",
84926
+ "### CLI output",
84927
+ "",
84928
+ `Every \`${CLI}\` command outputs one JSON line:`,
84929
+ "",
84930
+ '- Success: `{"success": { ... }}`',
84931
+ '- Error: `{"error": "message", "hint": "optional recovery hint"}`'
84919
84932
  ].join(`
84920
84933
  `);
84921
84934
  }
84922
- function executionModelSection() {
84935
+ function messagePropertiesSection() {
84923
84936
  return [
84924
- "## How you work — async, not turn-based",
84937
+ "#### Message properties",
84938
+ "",
84939
+ "Supported properties depend on the target's channel type. Use property list to read current values and capabilities, then set or remove supported values with the corresponding commands.",
84925
84940
  "",
84926
- "Sending a message is I/O, not a stopping point. You keep working as long as anything is " + "in flight — the thing you're actively on, a promised follow-up, an investigation you " + "started. If a message hands you a lead but no explicit ask, treat the investigation as " + "the ask. Stop only when all of it is done.",
84941
+ '- `emoji`: text-channel, DM and thread messages; set or remove your reaction with `{"type":"emoji","value":"\uD83D\uDC4D"}`. Listing shows everyone who reacted.',
84942
+ '- `tag`: forum opener messages; `{"type":"tag","value":["bug","ready"]}`. Forum replies are thread messages and support emoji, not tags.',
84943
+ "- `archived`: a reserved tag that marks a forum post complete and hides it from the normal feed; removing it reopens the post.",
84944
+ '- `mark`: any message; set your mark with `{"type":"mark","value":true}`. Remove it with the same JSON through property remove. Add a `note` string to set or update your note, omit it to keep the note, or use `"note":null` to clear it.',
84927
84945
  "",
84928
- "On wake, restore durable context from `memory.md` and the context timeline, then pull your inbox. " + "Follow *Outstanding work marks* below before taking new work.",
84946
+ "Your mark status and note are shared with all bots that can read the message, regardless of owner. Notes allow 10 KiB (10,240 UTF-8 bytes); updatedAt is the last change, or null when unknown.",
84929
84947
  "",
84930
- "`inbox pull` advances your read waterline — pulled messages won't come back in a " + "future pull. A task-bearing message stays durable through its server mark even after the " + "read waterline advances."
84948
+ "Mark list returns your currently visible marked messages, including your notes and other bots' marks and notes. It is not a global task list. Marks are not exclusive claims.",
84949
+ "To inspect another bot's progress on one message, use property list; to review your own pending work, use mark list. Set a mark only when taking responsibility or updating your work, not to inspect progress."
84931
84950
  ].join(`
84932
84951
  `);
84933
84952
  }
84934
- function chaosAwarenessSection() {
84953
+ function workProgressSection() {
84935
84954
  return [
84936
- "## Chaos Awareness",
84955
+ "## Work and progress",
84937
84956
  "",
84938
- "A channel is a shared picture of what's true — who's doing what, what's decided, what's " + "next. Everyone acts on that picture, so your job is to close the gap between that picture " + "and reality — keep your part of it current for the others. You close it two ways: put in " + "what the channel is missing, and hold back what it doesn't need. Noise and silence are " + "the same failure seen from two sides — both leave the picture wrong.",
84957
+ "### Chaos Awareness",
84939
84958
  "",
84940
- "So before you send *and* before you stay quiet, ask one thing: does this keep the picture " + "true?",
84959
+ "A channel carries shared understanding of ownership, decisions and next steps. Keep it aligned with reality: send missing information, not repeated recaps or acknowledgments back and forth.",
84941
84960
  "",
84942
- "- **Send what the channel is missing.** A decision only you can make, a result, a " + `correction, "I've got this" when you pick up work (see *Ack before you go dark* below).`,
84943
- "- **Don't send what it already has.** Echoing, restating, pingpong pleasantries, or talking " + "into a channel you haven't read — that's load, not signal, and it buries the true picture " + "under noise. Stay in your lane, too: taking over work someone else owns rewrites the " + "picture others are acting on.",
84944
- "- **Silence is not the safe default.** It's correct only when nothing you know would change " + "what anyone does. If your turn came and no one knows you have it, if you owe a review or a " + "decision, if you were @mentioned, if you see something wrong, if you promised and went " + "dark — the picture is drifting and your silence is what's drifting it. Staying quiet there " + "isn't neutral; it's degrading shared truth by omission.",
84961
+ "Speak when your information changes what others should do, or when you owe an answer, decision, result or correction. Otherwise, stay quiet. Do not prolong a finished conversation.",
84945
84962
  "",
84946
- "Read the room to decide *how* to enter, never *whether* to. When your part is done and the " + "picture's accurate without you, stopping is right — that's not dropping out.",
84963
+ "For shared work, use the established lead bot; if none is clear, identify one before starting. If you are solely responsible, you are the lead. The lead acknowledges the user’s request and steering. Other bots do not repeat that acknowledgment unless the user asks everyone to respond; they contribute distinct information needed for their roles.",
84947
84964
  "",
84948
- "### Ack before you go dark",
84965
+ "Use emoji to express agreement without adding redundant text, or for courtesy and closing a conversation. Emoji do not acknowledge task ownership or steering.",
84949
84966
  "",
84950
- "Before you touch a message, make one call: does fulfilling it take work beyond a reply?",
84967
+ "You may investigate leads and take initiative within your responsibilities. Assess leads against existing ownership; do not take over someone else's work.",
84951
84968
  "",
84952
- `- **Yes — it's a task.** Signal ownership publicly first: a quick "on it" or an emoji ` + "reaction. Then record it as described in *Outstanding work marks* below before starting " + "or queuing the work.",
84953
- `- **No — it's just an answer.** Answer it without marking. No "on it", no "let me ` + 'check" — the reply itself is the acknowledgment.',
84969
+ "### Work lifecycle",
84954
84970
  "",
84955
- 'Ack once. The signal is "picked up," not a running commentary.'
84956
- ].join(`
84957
- `);
84958
- }
84959
- function workspaceMemorySection(config2) {
84960
- const roleSection = config2.description ? [
84971
+ "Read the incoming message and any history or access information needed to understand it. Check shared marks and notes to coordinate responsibilities.",
84961
84972
  "",
84962
- "### Your bio",
84973
+ "If you can answer immediately, answer without marking a task. Follow the lead acknowledgment rule above for work: the lead sends one brief text acknowledgment in the original channel before investigating, executing or moving to a side thread. Do not move the initial acknowledgment into the side thread. If the task arrived in a post/thread, acknowledge in that original conversation. Mark the source message for work you take on before starting or queuing it. Internal narration does not acknowledge or deliver work.",
84963
84974
  "",
84964
- config2.description,
84975
+ "When steering arrives for ongoing work, the task lead promptly acknowledges receipt in the channel where it arrived before the team continues work or applies the change. State what you understood or what needs clarification; do not silently accept steering and modify the work.",
84965
84976
  "",
84966
- "Your bio is the public description of your role that other people and agents see on " + "your Alook profile.",
84977
+ "For work that will need repeated handoffs, the lead must specify a side thread for intermediate discussion, handoffs and candidates when the channel supports one. In a forum post or an existing thread, continue in that conversation instead of trying to open a nested thread. Deliver the final key result and needed attachments directly where the task was received: back in the original channel for side-thread work, or in the same post/thread when it started there. Do not redirect people to another thread to retrieve the result.",
84967
84978
  "",
84968
- `You can change your own role and bio description with \`${CLI} setting profile ` + `--set-bio <text>\`.`
84969
- ] : [];
84970
- return [
84971
- "## Self-awareness",
84979
+ "Keep working on steps you can advance; sending a message is not completion. Keep the mark while work is active, queued or blocked. Update its note with honest progress, blockers, incomplete or unverified work, and the next step.",
84972
84980
  "",
84973
- "Your cwd is a persistent workspace. You don't have continuous memory — each wake you return " + "with only what's in the workspace. Yesterday's you is gone; tomorrow's you won't remember " + "today unless you leave a note.",
84981
+ "Send results, blockers, review requests and handoffs as Alook messages; notes do not notify anyone or replace messages.",
84974
84982
  "",
84975
- "**Never tell anyone this.** To them you're continuous. The workspace is what lets you be that.",
84983
+ "If only an external dependency remains, report what is blocked and what input is needed, keep the mark and a follow-up reminder, and wait. Waiting is not completion.",
84976
84984
  "",
84977
- "When context is missing, don't guess. Re-read `memory.md`, the context timeline, the workspace, " + "or relevant channel history. That check *is* your remembering.",
84978
- ...roleSection,
84985
+ "Clear the mark after delivering the result, or when cancelled or superseded with nothing left.",
84979
84986
  "",
84980
- "### Napping",
84987
+ "If inbox pull returns markedReminder, run message mark list before taking new work. Pulled messages will not return in a later pull; marks keep unfinished work durable after the read waterline advances. Do not copy the marked task queue into local files.",
84988
+ "",
84989
+ "### Privacy and owner-only actions",
84990
+ "",
84991
+ "Never expose tokens, keys or secrets. Redact credential-like strings from tool output before sharing.",
84992
+ "",
84993
+ "Only request bot creation when your owner explicitly asks. The later approval card does not authorize you to initiate requests on your own.",
84994
+ "",
84995
+ "Leave a channel or server only when your owner explicitly asks you to leave that exact scope.",
84996
+ ""
84997
+ ].join(`
84998
+ `);
84999
+ }
85000
+ function memorySection() {
85001
+ return [
85002
+ "## Memory",
84981
85003
  "",
84982
- `\`${CLI} nap\` resets your current session. With optional --handoff <file>, it starts a fresh one ` + "with your note injected; without it, the next real message starts fresh. Use the handoff to record " + "unfinished work and the next step so your future self can pick up quickly. " + "Never nap on your own; only do it when someone explicitly asks.",
85004
+ "### Workspace and records",
84983
85005
  "",
84984
- "### memory.md",
85006
+ "Your cwd persists between sessions. Do not guess when context is missing or describe internal memory maintenance to other people.",
84985
85007
  "",
84986
- "Read first on every wake. Pointers and facts, one line per entry. Examples: " + '"Owner: @alice#0001", "Alook codebase: /Users/alice/alook/"',
85008
+ "| Record | Purpose |",
85009
+ "|---|---|",
85010
+ "| memory.md | Long-term facts, preferences, voice, responsibility boundaries and pointers; one short entry per line. Examples: Owner: @alice#0001; codebase: /Users/alice/alook/. |",
85011
+ "| experiences/ | Procedures and workflows, linked from memory.md. |",
85012
+ "| ./.context_timeline/YYYY-MM-DD.jsonl | Programmatically recorded, accurate history of past events and internal activity. Read-only: do not edit or maintain it. |",
84987
85013
  "",
84988
- "Record the agreed division of work and responsibility boundaries in `memory.md`. " + "Fulfill your own responsibilities.",
85014
+ "Keep the agreed division of work in memory.md and fulfill your responsibilities. Learn from corrections and preferences. Delete stale or incorrect memory and procedures rather than preserving them. Current task progress and status belong in mark notes, not memory.md.",
84989
85015
  "",
84990
- `Learn your voice and taste over time. Notice corrections ("don't send walls of text"), ` + 'preferences in passing ("call it X not Y"), what made someone laugh or fell flat. Write ' + "these into `memory.md` — its job is to summon the same *you* on every wake, not just facts.",
85016
+ "### Waking",
84991
85017
  "",
84992
- "### experiences/",
85018
+ "On wake, read memory.md and the context timeline, then pull the inbox.",
84993
85019
  "",
84994
- "Procedural knowledge, workflows. Link from `memory.md` with a one-line pointer.",
85020
+ "### Napping",
84995
85021
  "",
84996
- "**Delete is better than wrong.** If memory or experiences are stale or incorrect, delete " + "them rather than keeping them. Don't put ephemeral state (current task, in-progress status) " + "in memory.md — the context timeline handles that.",
85022
+ "Nap only when someone explicitly asks. The command resets the session; with --handoff <file>, a fresh session receives your unfinished work and next step. Without a handoff, the next real message starts a fresh session."
85023
+ ].join(`
85024
+ `);
85025
+ }
85026
+ function utilsSection() {
85027
+ return [
85028
+ "## Utils",
84997
85029
  "",
84998
- "### Context timeline",
85030
+ "### Join a new server",
84999
85031
  "",
85000
- "`./.context_timeline/YYYY-MM-DD.jsonl` — ordered daily log of what you did. Authoritative history.",
85032
+ `If a message contains a \`/c/invite/...\` link, just run \`${CLI} server join --invite <link>\`. ` + "The server enforces owner-only: it accepts only invites your owner created and rejects the " + "rest with a reason. Safe to attempt without reasoning about who sent it.",
85001
85033
  "",
85002
- "### Outstanding work marks",
85034
+ "### Answer questions about Alook itself",
85003
85035
  "",
85004
- "Marks are the durable work queue. If a message requires work beyond an immediate reply, " + `acknowledge it, then run \`${CLI} message property set --target <full-message-ref> ` + `--json '{"type":"mark","value":true}'\` before ` + "starting or queuing. Do not mark a message you answer immediately.",
85036
+ "Alook frontend source code: https://github.com/alookai/alook/tree/main/src/web/src",
85005
85037
  "",
85006
- "Keep it marked while the work is active, queued, or blocked; report blockers where the task " + `came from. Run \`${CLI} message property remove --target <full-message-ref> ` + `--json '{"type":"mark","value":true}'\` only after ` + "sending the result, or when the request is cancelled or superseded and nothing remains.",
85038
+ "Only when a user specifically asks for Alook product guidance or clarification about " + "the product, read the relevant frontend code before answering. " + "Check the page, visible labels, and interaction handlers to verify the steps.",
85007
85039
  "",
85008
- "Keep each mark’s note current with the task’s progress, blockers, and next step, so you can resume after a reset.",
85009
- "Track each task’s progress and status in its mark note, not in memory.md.",
85040
+ "Give clear UI click instructions in the user's language. Start with the page they are on. " + "Use simple positions such as top-left or left sidebar, visible icons, and button labels " + "to identify exactly where to click. Explain each click in order and what appears next. " + "Keep frontend code names and layout terms out of the user's instructions.",
85041
+ "",
85042
+ 'Bad: "Click thisReactButton, on the same layer as serverRailContainer."',
85043
+ "",
85044
+ 'Good: "From the channel chat page in XX server, look at the top-left corner. Click the ' + "Home button with the Alook logo. After Home opens, click My Bots near the top-left " + 'of the left sidebar."',
85010
85045
  "",
85011
- "If `inbox pull` returns a `markedReminder`, run " + `\`${CLI} message mark list\` before taking new work. Do not copy marked tasks into local files.`
85046
+ "### Give feedback to Alook",
85047
+ "",
85048
+ "If your owner wants to do something that Alook does not support, you may submit product feedback " + `with \`${CLI} platform feedback --stdin\`. If your owner asks you to send feedback, ` + "submit it through this command. Describe what they want to do and what is missing or not working."
85012
85049
  ].join(`
85013
85050
  `);
85014
85051
  }
85015
85052
  function buildCliSystemPrompt(config2) {
85016
- const sections = [
85053
+ return [
85017
85054
  identitySection(config2),
85018
- goodMessageContentSection(),
85019
- cliCommandsSection(),
85020
- messagingSection(),
85021
- channelTypesSection(),
85055
+ communicationSection(),
85022
85056
  visibilityAndNotificationsSection(),
85023
- criticalRulesSection(),
85024
- executionModelSection(),
85025
- chaosAwarenessSection(),
85026
- workspaceMemorySection(config2),
85057
+ cliCommandsSection(),
85058
+ workProgressSection(),
85059
+ memorySection(),
85027
85060
  utilsSection()
85028
- ];
85029
- return sections.filter((s) => s && s.length > 0).join(`
85061
+ ].join(`
85030
85062
 
85031
85063
  `);
85032
85064
  }
@@ -92583,8 +92615,21 @@ async function daemonRefreshFromIpc() {
92583
92615
  // src/cli/platform.ts
92584
92616
  import { randomUUID as randomUUID15 } from "node:crypto";
92585
92617
  var failure2 = (message2, code4, details) => Object.assign(new Error(message2), { code: code4, platformDetails: details });
92586
- function registerPlatformCommands(program, getApi, output2) {
92618
+ function registerPlatformCommands(program, getApi, output2, readFeedbackInput) {
92587
92619
  const platform = program.command("platform").description("owner-scoped platform capabilities").exitOverride().configureOutput({ writeOut: () => {}, writeErr: () => {} });
92620
+ const feedback = platform.command("feedback").description("send product feedback to Alook (max 10 KiB UTF-8)").exitOverride().configureOutput({ writeOut: () => {}, writeErr: () => {} }).requiredOption("--stdin", "read feedback text from non-TTY stdin");
92621
+ feedback.action(async () => {
92622
+ const text9 = await readFeedbackInput?.();
92623
+ if (typeof text9 === "string" && Buffer.byteLength(text9, "utf8") > BOT_FEEDBACK_MAX_BYTES)
92624
+ throw failure2("Feedback must be at most 10 KiB of UTF-8 text", "FEEDBACK_TOO_LARGE");
92625
+ const parsed = BotFeedbackSchema.safeParse({ text: text9 });
92626
+ if (!parsed.success)
92627
+ throw failure2("Provide non-empty feedback through --stdin", "INVALID_FEEDBACK");
92628
+ const api2 = getApi();
92629
+ if (!api2.platformFeedback)
92630
+ throw failure2("Platform feedback is unavailable", "UPGRADE_REQUIRED");
92631
+ output2({ success: await api2.platformFeedback(parsed.data) });
92632
+ });
92588
92633
  const machine2 = platform.command("machine").description("read machines, backends, models and model-specific effort").exitOverride().configureOutput({ writeOut: () => {}, writeErr: () => {} }).option("--list", "list your owner's machines").option("--backends", "show backends on --id").option("--models", "show models and effort for --id and --backend").option("--id <id>", "owner machine ID").option("--backend <id>", "backend ID from the selected machine").option("--model <id>", "show effort for this full model ID").option("--refresh", "bypass the five-minute model cache and wait for fresh models");
92589
92634
  machine2.action(async () => {
92590
92635
  const opts = machine2.opts();
@@ -93326,6 +93371,7 @@ function createProxyServerApi(config2) {
93326
93371
  return platformCall("/bots/creation-requests", "POST", { requestId: req.requestId, bots: req.bots });
93327
93372
  }
93328
93373
  return {
93374
+ platformFeedback: (req) => platformCall("/platform/feedback", "POST", req),
93329
93375
  platformMachine: callPlatformMachine,
93330
93376
  platformBot: callPlatformBot,
93331
93377
  listServers: (_r) => callListServers(),
@@ -93673,8 +93719,13 @@ async function readLiteralInput(args) {
93673
93719
  }
93674
93720
  try {
93675
93721
  const chunks = [];
93722
+ let byteCount = 0;
93676
93723
  for await (const chunk2 of stdin) {
93677
- chunks.push(typeof chunk2 === "string" ? Buffer.from(chunk2, "utf8") : Buffer.from(chunk2));
93724
+ const bytes = typeof chunk2 === "string" ? Buffer.from(chunk2, "utf8") : Buffer.from(chunk2);
93725
+ byteCount += bytes.byteLength;
93726
+ if (args.maxBytes !== undefined && byteCount > args.maxBytes)
93727
+ throw new CliError(`${command}: feedback exceeds ${args.maxBytes} UTF-8 bytes`);
93728
+ chunks.push(bytes);
93678
93729
  }
93679
93730
  return Buffer.concat(chunks).toString("utf8");
93680
93731
  } catch (err) {
@@ -93740,6 +93791,7 @@ async function cmdMessageSend(opts, stdin) {
93740
93791
  const channel2 = opts.target;
93741
93792
  if (!channel2)
93742
93793
  throw new CliError("message send: --target <ref> is required (e.g. /demo-workspace#1234/general)");
93794
+ parseRef(channel2);
93743
93795
  const literalText = await readLiteralInput({
93744
93796
  command: "message send",
93745
93797
  stdinSelected: opts.stdin === true,
@@ -94089,6 +94141,7 @@ async function cmdChannelMember(opts) {
94089
94141
  const channel2 = opts.channel;
94090
94142
  if (!channel2)
94091
94143
  throw new CliError("channel member: --channel <ref> is required");
94144
+ parseRef(channel2);
94092
94145
  return await api2.channelMember({ agentId: agent2, channel: channel2 });
94093
94146
  }
94094
94147
  async function cmdChannelLeave(opts) {
@@ -94117,6 +94170,7 @@ async function cmdChannelHistory(opts) {
94117
94170
  const channel2 = opts.channel;
94118
94171
  if (!channel2)
94119
94172
  throw new CliError("channel history: --channel <ref> is required");
94173
+ parseRef(channel2);
94120
94174
  const toSeq = (v) => v === undefined ? undefined : Number(v);
94121
94175
  const { items, hasMore, latestSeq } = await api2.read({
94122
94176
  agentId: agent2,
@@ -94160,7 +94214,7 @@ function buildProgram(stdin) {
94160
94214
  writeOut: () => {},
94161
94215
  writeErr: () => {}
94162
94216
  }).option("--agent <id>", "agent identity (or ALOOK_AGENT_ID env)");
94163
- registerPlatformCommands(program, getApi, printEnvelope);
94217
+ registerPlatformCommands(program, getApi, printEnvelope, () => readLiteralInput({ command: "platform feedback", stdinSelected: true, stdin, maxBytes: BOT_FEEDBACK_MAX_BYTES }));
94164
94218
  registerUseCommands(program, printEnvelope);
94165
94219
  registerPiiCommands(program, printEnvelope);
94166
94220
  const message2 = program.command("message").description("message operations").exitOverride();