@neta-art/cohub-cli 2.3.0 → 2.3.1

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/avatar.d.ts CHANGED
@@ -16,8 +16,8 @@ export declare function uploadAvatarAsset(input: {
16
16
  export declare function normalizeChatImageFile(path: string): Promise<Buffer>;
17
17
  export declare function uploadChatImageAsset(input: {
18
18
  client: CohubHttpClient;
19
- spaceId: string;
20
- sessionId: string;
19
+ spaceId?: string;
20
+ sessionId?: string;
21
21
  path: string;
22
22
  }): Promise<{
23
23
  purpose: PublicAssetPurpose;
@@ -336,10 +336,13 @@ Examples:
336
336
  if (result.requestId || result.cost !== undefined || result.billing) {
337
337
  const details = [
338
338
  result.requestId ? `request ID: ${result.requestId}` : null,
339
- result.cost !== undefined ? `cost: ${result.cost}` : null,
340
- result.billing
341
- ? `billing: ${result.billing.status}${result.billing.amountUsd > 0 ? ` ${result.billing.amountUsd}` : ""}${result.billing.reason ? ` (${result.billing.reason})` : ""}`
339
+ result.cost !== undefined ? `official cost: ${result.cost}` : null,
340
+ result.billing ? `billing: ${result.billing.status}` : null,
341
+ result.billing ? `effective amount: ${result.billing.amountUsd}` : null,
342
+ result.billing?.discountMultiplier !== undefined
343
+ ? `multiplier: ${result.billing.discountMultiplier}`
342
344
  : null,
345
+ result.billing?.reason ? `billing reason: ${result.billing.reason}` : null,
343
346
  ].filter(Boolean).join(", ");
344
347
  if (details)
345
348
  process.stderr.write(` ${details}\n`);
@@ -146,6 +146,9 @@ async function uploadFiles(command, paths, opts) {
146
146
  const file = byId.get(entry.id);
147
147
  if (!file)
148
148
  throw new Error(`Missing upload entry: ${entry.id}`);
149
+ // Remote downloadUrl entries have no uploadUrl; complete pulls them server-side.
150
+ if (!entry.uploadUrl)
151
+ continue;
149
152
  await putUploadEntry(file, entry.uploadUrl, entry.headers);
150
153
  }
151
154
  const result = await client.space(spaceId).files.completeUpload(plan.uploadId, {
@@ -205,12 +208,14 @@ async function sendPrompt(command, words, opts) {
205
208
  : undefined;
206
209
  const sessionId = opts.session;
207
210
  const imagePaths = opts.image ?? [];
208
- const imageSessionId = imagePaths.length
209
- ? sessionId ?? error("Missing session", "Pass --session when attaching images.")
210
- : "";
211
211
  const imageBlocks = imagePaths.length
212
212
  ? await Promise.all(imagePaths.map(async (path) => {
213
- const asset = await uploadChatImageAsset({ client, spaceId, sessionId: imageSessionId, path });
213
+ const asset = await uploadChatImageAsset({
214
+ client,
215
+ spaceId,
216
+ sessionId,
217
+ path,
218
+ });
214
219
  return {
215
220
  type: "image",
216
221
  source: { type: "url", url: asset.publicUrl },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub-cli",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -16,7 +16,7 @@
16
16
  "@neta-art/generation": "^0.1.13",
17
17
  "commander": "^14.0.3",
18
18
  "sharp": "^0.34.5",
19
- "@neta-art/cohub": "2.10.0"
19
+ "@neta-art/cohub": "2.11.0"
20
20
  },
21
21
  "publishConfig": {
22
22
  "access": "public"