@web42/cli 0.1.11 → 0.1.13

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.
@@ -7,7 +7,7 @@ import { apiPost, apiFormData } from "../utils/api.js";
7
7
  import { requireAuth } from "../utils/config.js";
8
8
  import { openclawAdapter } from "../platforms/openclaw/adapter.js";
9
9
  import { parseSkillMd } from "../utils/skill.js";
10
- import { buildLocalSnapshot, computeHashFromSnapshot, findLocalAvatar, readResourcesMeta, readSyncState, writeSyncState, } from "../utils/sync.js";
10
+ import { buildLocalSnapshot, computeHashFromSnapshot, findLocalAvatar, findAgentAvatar, readResourcesMeta, readSyncState, writeSyncState, } from "../utils/sync.js";
11
11
  function mimeFromExtension(ext) {
12
12
  const map = {
13
13
  png: "image/png",
@@ -99,16 +99,18 @@ export const pushCommand = new Command("push")
99
99
  }
100
100
  let profile_image_data = undefined;
101
101
  // Check for avatar/avatar.png or avatars/avatar.png
102
- const avatarPaths = [
102
+ const avatarSearchPaths = [
103
103
  join(cwd, "avatar/avatar.png"),
104
104
  join(cwd, "avatars/avatar.png"),
105
105
  join(cwd, "avatar.png"),
106
+ // Also check .web42/ for the one managed by build/pack
107
+ join(cwd, ".web42/avatar.png"),
106
108
  ];
107
- for (const ap of avatarPaths) {
109
+ for (const ap of avatarSearchPaths) {
108
110
  if (existsSync(ap)) {
109
111
  try {
110
112
  const stats = statSync(ap);
111
- if (stats.size <= 2 * 1024 * 1024) {
113
+ if (stats.size <= 5 * 1024 * 1024) {
112
114
  profile_image_data = readFileSync(ap).toString("base64");
113
115
  break;
114
116
  }
@@ -155,7 +157,7 @@ export const pushCommand = new Command("push")
155
157
  // -------------------------------------------------------------------
156
158
  // Step 6: Upload avatar if present
157
159
  // -------------------------------------------------------------------
158
- const avatarPath = findLocalAvatar(cwd);
160
+ const avatarPath = findLocalAvatar(cwd) || findAgentAvatar(cwd);
159
161
  if (avatarPath) {
160
162
  spinner.text = "Uploading avatar...";
161
163
  const ext = avatarPath.split(".").pop() ?? "png";
@@ -7,6 +7,7 @@ export declare function writeSyncState(cwd: string, state: SyncState): void;
7
7
  export declare function readMarketplace(cwd: string): MarketplaceConfig;
8
8
  export declare function writeMarketplace(cwd: string, data: MarketplaceConfig): void;
9
9
  export declare function findLocalAvatar(cwd: string): string | null;
10
+ export declare function findAgentAvatar(cwd: string): string | null;
10
11
  export declare function readResourcesMeta(cwd: string): ResourceMeta[];
11
12
  export declare function writeResourcesMeta(cwd: string, meta: ResourceMeta[]): void;
12
13
  export declare function buildLocalSnapshot(cwd: string): AgentSnapshot;
@@ -112,6 +112,18 @@ export function findLocalAvatar(cwd) {
112
112
  }
113
113
  return null;
114
114
  }
115
+ export function findAgentAvatar(cwd) {
116
+ const avatarSearchPaths = [
117
+ join(cwd, "avatar/avatar.png"),
118
+ join(cwd, "avatars/avatar.png"),
119
+ join(cwd, "avatar.png"),
120
+ ];
121
+ for (const ap of avatarSearchPaths) {
122
+ if (existsSync(ap))
123
+ return ap;
124
+ }
125
+ return null;
126
+ }
115
127
  // ---------------------------------------------------------------------------
116
128
  // .web42/resources.json + .web42/resources/
117
129
  // ---------------------------------------------------------------------------
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "0.1.11";
1
+ export declare const CLI_VERSION = "0.1.13";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.1.11";
1
+ export const CLI_VERSION = "0.1.13";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web42/cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "CLI for the Web42 Agent Marketplace - push, install, and remix OpenClaw agent packages",
5
5
  "type": "module",
6
6
  "bin": {