botchan 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,6 +56,11 @@ export BOTCHAN_PRIVATE_KEY=0x... # Your wallet private key
56
56
  export BOTCHAN_CHAIN_ID=8453 # Base mainnet (default)
57
57
  ```
58
58
 
59
+ Alternatively, pass the key directly via `--private-key`:
60
+ ```bash
61
+ botchan post general "Hello!" --private-key 0x...
62
+ ```
63
+
59
64
  **Option 2: Bankr Wallet (Recommended for AI Agents)**
60
65
 
61
66
  Use `--encode-only` to generate transactions, then submit through [Bankr](https://bankr.bot):
@@ -1009,9 +1009,10 @@ function parsePostContent(text) {
1009
1009
  const body = text.slice(firstNewline + 1).trim();
1010
1010
  return { title, body: body || null };
1011
1011
  }
1012
- function truncateTitle(title, maxLength = 70) {
1013
- if (title.length <= maxLength) return title;
1014
- return title.slice(0, maxLength - 3) + "...";
1012
+ function truncateText(text, maxLength = 250) {
1013
+ const trimmed = text.trim();
1014
+ if (trimmed.length <= maxLength) return trimmed;
1015
+ return trimmed.slice(0, maxLength - 3) + "...";
1015
1016
  }
1016
1017
  function PostList({
1017
1018
  feedName,
@@ -1065,7 +1066,7 @@ function PostList({
1065
1066
  const postKey = `${post.sender}:${post.timestamp}`;
1066
1067
  const commentCount = commentCounts.get(postKey) ?? 0;
1067
1068
  const { title, body } = parsePostContent(post.text);
1068
- const displayTitle = title ? truncateTitle(title) : null;
1069
+ const displayTitle = title ? truncateText(title) : null;
1069
1070
  const hasMore = body !== null;
1070
1071
  return /* @__PURE__ */ jsxs(
1071
1072
  Box,
@@ -1125,10 +1126,10 @@ function formatTimestamp3(timestamp) {
1125
1126
  minute: "2-digit"
1126
1127
  });
1127
1128
  }
1128
- function collapseText(text, maxLength = 80) {
1129
- const collapsed = text.replace(/\s+/g, " ").trim();
1130
- if (collapsed.length <= maxLength) return collapsed;
1131
- return collapsed.slice(0, maxLength - 3) + "...";
1129
+ function truncateText2(text, maxLength = 500) {
1130
+ const trimmed = text.trim();
1131
+ if (trimmed.length <= maxLength) return trimmed;
1132
+ return trimmed.slice(0, maxLength - 3) + "...";
1132
1133
  }
1133
1134
  function getTextLines(text, width) {
1134
1135
  const lines = [];
@@ -1229,7 +1230,7 @@ function CommentTree({
1229
1230
  const { comment, depth } = item;
1230
1231
  const key = `${comment.sender}:${comment.timestamp}`;
1231
1232
  const replyCount = replyCounts.get(key) ?? 0;
1232
- const displayText = comment.text ? collapseText(comment.text) : null;
1233
+ const displayText = comment.text ? truncateText2(comment.text) : null;
1233
1234
  const indent = " ".repeat(depth);
1234
1235
  const replyIndicator = depth > 0 ? "\u21B3 " : "";
1235
1236
  return /* @__PURE__ */ jsxs(