@indigoai-us/hq-cli 5.252.0 → 5.253.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.253.0] — 2026-09-27
6
+
7
+ ### Added
8
+
9
+ - `hq publish --handle <handle>` publishes a pack under one of the creator handles your
10
+ account owns, for accounts that own more than one. The server refuses a handle you do
11
+ not own with a plain message. `--as` is unchanged and cannot be combined with `--handle`.
12
+
5
13
  ## [5.252.0] — 2026-09-27
6
14
  ### Added
7
15
 
@@ -418,6 +418,9 @@ export declare const COMMAND_CATALOG: readonly [{
418
418
  }, {
419
419
  readonly flags: "--on-behalf <handle>";
420
420
  readonly description: "Alias for --as.";
421
+ }, {
422
+ readonly flags: "--handle <handle>";
423
+ readonly description: "Publish as one of your own claimed creator handles (for accounts that own more than one). Defaults to your first claimed handle.";
421
424
  }];
422
425
  readonly subcommands: readonly [];
423
426
  }, {
@@ -530,6 +530,10 @@ export const COMMAND_CATALOG = [
530
530
  {
531
531
  "flags": "--on-behalf <handle>",
532
532
  "description": "Alias for --as."
533
+ },
534
+ {
535
+ "flags": "--handle <handle>",
536
+ "description": "Publish as one of your own claimed creator handles (for accounts that own more than one). Defaults to your first claimed handle."
533
537
  }
534
538
  ],
535
539
  "subcommands": []
@@ -130,7 +130,7 @@ export declare function unwrapListing(body: Record<string, unknown>): ListingRes
130
130
  * locally-resolved author handle — falling back gracefully when the server
131
131
  * omits either field.
132
132
  */
133
- export declare function buildListingNotice(status: number, body: Record<string, unknown>, packName: string, packVersion: string): string;
133
+ export declare function buildListingNotice(status: number, body: Record<string, unknown>, packName: string, packVersion: string, selectedHandle?: string): string;
134
134
  /**
135
135
  * The exact JSON body the deployed `POST /v1/listings` handler expects. Field
136
136
  * shapes mirror the server contract: `type` ∈ {skill,worker}, `contributes` is
@@ -151,6 +151,12 @@ export interface ListingRequest {
151
151
  * caller is staff (`@getindigo.ai`) and the server has the capability enabled.
152
152
  */
153
153
  publishAsHandle?: string;
154
+ /**
155
+ * OPTIONAL explicit choice among the caller's OWN claimed creator handles
156
+ * (`hq publish --handle <h>`). The server refuses a handle the caller does
157
+ * not own (403 CREATOR_HANDLE_NOT_OWNED) instead of falling back.
158
+ */
159
+ ownedCreatorHandle?: string;
154
160
  /** Base64-encoded gzip pack tarball (pack.tar.gz bytes). */
155
161
  tarball: string;
156
162
  }
@@ -196,6 +202,7 @@ export interface PublishResult {
196
202
  */
197
203
  export declare function runPublish(targetPath: string, deps: PublishDeps, opts?: {
198
204
  publishAsHandle?: string;
205
+ creatorHandle?: string;
199
206
  }): Promise<PublishResult>;
200
207
  export declare function registerPublishCommand(program: Command): void;
201
208
  //# sourceMappingURL=publish.d.ts.map
@@ -231,7 +231,7 @@ export function unwrapListing(body) {
231
231
  * locally-resolved author handle — falling back gracefully when the server
232
232
  * omits either field.
233
233
  */
234
- export function buildListingNotice(status, body, packName, packVersion) {
234
+ export function buildListingNotice(status, body, packName, packVersion, selectedHandle) {
235
235
  if (status === 409) {
236
236
  throw new Error(`${packName}@${packVersion} is already published (duplicate version). ` +
237
237
  `Bump the version in package.yaml and re-run \`hq publish\`.`);
@@ -246,6 +246,10 @@ export function buildListingNotice(status, body, packName, packVersion) {
246
246
  }
247
247
  if (status === 401 || status === 403) {
248
248
  const code = typeof body.code === 'string' ? body.code : '';
249
+ if (code === 'CREATOR_HANDLE_NOT_OWNED') {
250
+ const h = selectedHandle ?? '(unknown)';
251
+ throw new Error(`You do not own the creator handle ${h}. Claim it first with hq creators apply --handle ${h}.`);
252
+ }
249
253
  if (code === 'NOT_VERIFIED_CREATOR') {
250
254
  throw new Error('Only verified creators can publish to the marketplace. ' +
251
255
  'Run `hq creators apply --reason "..."` to request verified-creator access; ' +
@@ -287,6 +291,12 @@ export async function runPublish(targetPath, deps, opts = {}) {
287
291
  const publishAsHandle = typeof opts.publishAsHandle === 'string' && opts.publishAsHandle.length > 0
288
292
  ? opts.publishAsHandle
289
293
  : undefined;
294
+ const selectedHandle = typeof opts.creatorHandle === 'string' && opts.creatorHandle.trim().length > 0
295
+ ? opts.creatorHandle.trim().replace(/^@/, '')
296
+ : undefined;
297
+ if (publishAsHandle && selectedHandle) {
298
+ throw new Error('Use either --as or --handle, not both. Nothing was uploaded.');
299
+ }
290
300
  // Resolve a payload dir. We stamp/validate against a temp copy so we never
291
301
  // mutate the user's working tree's package.yaml.
292
302
  const absTarget = path.resolve(process.cwd(), targetPath);
@@ -335,12 +345,13 @@ export async function runPublish(targetPath, deps, opts = {}) {
335
345
  // server is authoritative for attribution either way). Normal: our
336
346
  // resolved handle is a backwards-compat fallback under the server's
337
347
  // claimed-handle lookup.
338
- creatorHandle: publishAsHandle ?? author.handle,
348
+ creatorHandle: publishAsHandle ?? selectedHandle ?? author.handle,
339
349
  ...(publishAsHandle ? { publishAsHandle } : {}),
350
+ ...(selectedHandle ? { ownedCreatorHandle: selectedHandle } : {}),
340
351
  tarball: Buffer.from(tarballBytes).toString('base64'),
341
352
  };
342
353
  const { status, body } = await deps.upload({ token, listing });
343
- const notice = buildListingNotice(status, body, pkg.name, pkg.version);
354
+ const notice = buildListingNotice(status, body, pkg.name, pkg.version, selectedHandle);
344
355
  // Unwrap the `{ listing }` success envelope the server sends so attribution
345
356
  // reads the server's resolved handle (fall back to top-level for compat).
346
357
  const serverHandle = unwrapListing(body).creatorHandle?.trim();
@@ -362,6 +373,8 @@ export function registerPublishCommand(program) {
362
373
  .option('--as <handle>', 'Publish on behalf of a seeded, unclaimed creator by handle (HQ staff only). ' +
363
374
  'The listing is attributed to that creator instead of you.')
364
375
  .option('--on-behalf <handle>', 'Alias for --as.')
376
+ .option('--handle <handle>', 'Publish as one of your own claimed creator handles (for accounts that own more than one). ' +
377
+ 'Defaults to your first claimed handle.')
365
378
  .action(async (targetPath, options) => {
366
379
  try {
367
380
  const publishAsHandle = options.as ?? options.onBehalf;
@@ -390,7 +403,7 @@ export function registerPublishCommand(program) {
390
403
  },
391
404
  hqRoot,
392
405
  hqVersion: readHqVersion(hqRoot),
393
- }, { publishAsHandle });
406
+ }, { publishAsHandle, creatorHandle: options.handle });
394
407
  console.log(chalk.green(result.notice));
395
408
  // Only print the locally-resolved author as a fallback when the server
396
409
  // did NOT return its own resolved handle (already in the notice).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.252.0",
3
+ "version": "5.253.0",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {