@warmhub/cli 0.52.0 → 0.52.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.
Files changed (2) hide show
  1. package/dist/wh.js +61 -18
  2. package/package.json +1 -1
package/dist/wh.js CHANGED
@@ -21273,7 +21273,7 @@ function findSystemComponent(componentId) {
21273
21273
  // ../../packages/sdk-ts/package.json
21274
21274
  var package_default = {
21275
21275
  name: "@warmhub/sdk-ts",
21276
- version: "0.51.0",
21276
+ version: "0.52.0",
21277
21277
  private: false,
21278
21278
  type: "module",
21279
21279
  description: "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -22832,6 +22832,17 @@ class WarmHubClient {
22832
22832
  throw toWarmHubError(error);
22833
22833
  }
22834
22834
  },
22835
+ reveal: async (orgName, repoName, name) => {
22836
+ try {
22837
+ return await this.trpc.subscription.reveal.query({
22838
+ orgName,
22839
+ repoName,
22840
+ name
22841
+ });
22842
+ } catch (error) {
22843
+ throw toWarmHubError(error);
22844
+ }
22845
+ },
22835
22846
  list: async (orgName, repoName) => {
22836
22847
  try {
22837
22848
  const result = await this.trpc.subscription.list.query({
@@ -25513,7 +25524,7 @@ function wantsStructuredLiveOutput(format) {
25513
25524
  }
25514
25525
  async function runLive(opts) {
25515
25526
  const auth = opts.auth ?? {
25516
- getToken: async () => await getValidToken() ?? undefined
25527
+ getToken: async () => await getValidToken(opts.profile) ?? undefined
25517
25528
  };
25518
25529
  const benchmarkId = process.env.WH_BENCHMARK_ID?.trim();
25519
25530
  const client = new WarmHubClient({
@@ -26207,6 +26218,7 @@ var handleAbout = async (ctx, { flags, args }) => {
26207
26218
  maxUpdates: ctx.maxUpdates,
26208
26219
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
26209
26220
  functionLogs: ctx.functionLogMode,
26221
+ profile: ctx.profile,
26210
26222
  signal: ctx.signal
26211
26223
  });
26212
26224
  return;
@@ -26635,6 +26647,7 @@ var handleHistory = async (ctx, { flags, args }) => {
26635
26647
  maxUpdates: ctx.maxUpdates,
26636
26648
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
26637
26649
  functionLogs: ctx.functionLogMode,
26650
+ profile: ctx.profile,
26638
26651
  signal: ctx.signal
26639
26652
  });
26640
26653
  return;
@@ -26903,6 +26916,7 @@ var handleHead = async (ctx, { flags, args }) => {
26903
26916
  maxUpdates: ctx.maxUpdates,
26904
26917
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
26905
26918
  functionLogs: ctx.functionLogMode,
26919
+ profile: ctx.profile,
26906
26920
  signal: ctx.signal
26907
26921
  });
26908
26922
  return;
@@ -27063,6 +27077,7 @@ var handleQuery = async (ctx, { flags }) => {
27063
27077
  maxUpdates: ctx.maxUpdates,
27064
27078
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
27065
27079
  functionLogs: ctx.functionLogMode,
27080
+ profile: ctx.profile,
27066
27081
  signal: ctx.signal
27067
27082
  });
27068
27083
  return;
@@ -27616,6 +27631,7 @@ async function runSingleView(ctx, wref, flags) {
27616
27631
  maxUpdates: ctx.maxUpdates,
27617
27632
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
27618
27633
  functionLogs: ctx.functionLogMode,
27634
+ profile: ctx.profile,
27619
27635
  signal: ctx.signal
27620
27636
  });
27621
27637
  return;
@@ -27990,6 +28006,7 @@ var handleView2 = async (ctx, { flags, args }) => {
27990
28006
  maxUpdates: ctx.maxUpdates,
27991
28007
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
27992
28008
  functionLogs: ctx.functionLogMode,
28009
+ profile: ctx.profile,
27993
28010
  signal: ctx.signal
27994
28011
  });
27995
28012
  return;
@@ -28118,6 +28135,7 @@ var handleHistory2 = async (ctx, { flags, args }) => {
28118
28135
  maxUpdates: ctx.maxUpdates,
28119
28136
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
28120
28137
  functionLogs: ctx.functionLogMode,
28138
+ profile: ctx.profile,
28121
28139
  signal: ctx.signal
28122
28140
  });
28123
28141
  return;
@@ -28261,6 +28279,7 @@ var handleList = async (ctx, { flags, args }) => {
28261
28279
  maxUpdates: ctx.maxUpdates,
28262
28280
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
28263
28281
  functionLogs: ctx.functionLogMode,
28282
+ profile: ctx.profile,
28264
28283
  signal: ctx.signal
28265
28284
  });
28266
28285
  return;
@@ -28299,6 +28318,7 @@ var handleList = async (ctx, { flags, args }) => {
28299
28318
  maxUpdates: ctx.maxUpdates,
28300
28319
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
28301
28320
  functionLogs: ctx.functionLogMode,
28321
+ profile: ctx.profile,
28302
28322
  signal: ctx.signal
28303
28323
  });
28304
28324
  return;
@@ -35694,6 +35714,7 @@ var handleHistory3 = async (ctx, { flags, args }) => {
35694
35714
  maxUpdates: ctx.maxUpdates,
35695
35715
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
35696
35716
  functionLogs: ctx.functionLogMode,
35717
+ profile: ctx.profile,
35697
35718
  signal: ctx.signal
35698
35719
  });
35699
35720
  return;
@@ -36008,6 +36029,11 @@ var logFlags = {
36008
36029
  var listFlags5 = {
36009
36030
  limit: flag.number({ description: "Max subscriptions to return" })
36010
36031
  };
36032
+ var viewFlags5 = {
36033
+ "show-secrets": flag.boolean({
36034
+ description: "Reveal the raw webhook URL(s) instead of the redacted origin (audit-logged)"
36035
+ })
36036
+ };
36011
36037
  function buildSubscriptionPatchArgs(flags, usage, example) {
36012
36038
  const args = {};
36013
36039
  if (typeof flags.on === "string" && flags.on) {
@@ -36121,14 +36147,15 @@ var handleUpdate4 = async (ctx, { flags, args }) => {
36121
36147
  ctx.status(`${c.green}Updated subscription${c.reset} ${c.cyan}${name}${c.reset} on ${c.cyan}${org}/${repo}${c.reset}`);
36122
36148
  });
36123
36149
  };
36124
- var handleView8 = async (ctx, { args }) => {
36150
+ var handleView8 = async (ctx, { args, flags }) => {
36125
36151
  const name = args[0];
36126
36152
  if (!name) {
36127
- usageError("Usage: wh sub view <name> [--repo org/repo]", "wh sub view signal-hook --repo myorg/myrepo");
36153
+ usageError("Usage: wh sub view <name> [--show-secrets] [--repo org/repo]", "wh sub view signal-hook --repo myorg/myrepo");
36128
36154
  }
36129
36155
  const { org, repo } = resolveRepoContext(ctx);
36130
36156
  const sub = await ctx.client.subscription.get(org, repo, name);
36131
- writeOutput(ctx, sub, () => {
36157
+ const revealed = flags["show-secrets"] ? await ctx.client.subscription.reveal(org, repo, name) : undefined;
36158
+ writeOutput(ctx, revealed ? { ...sub, ...revealed } : sub, () => {
36132
36159
  const c = ctx.colors;
36133
36160
  ctx.out(`${c.bold}${sub.name}${c.reset}`);
36134
36161
  ctx.out(` kind: ${c.cyan}${sub.kind}${c.reset}`);
@@ -36139,12 +36166,15 @@ var handleView8 = async (ctx, { args }) => {
36139
36166
  if (sub.allowTraceReentry) {
36140
36167
  ctx.out(` allowTraceReentry: ${c.green}${sub.allowTraceReentry}${c.reset}`);
36141
36168
  }
36142
- if (sub.webhookUrl) {
36143
- ctx.out(` webhookUrl: ${sub.webhookUrl}`);
36144
- }
36145
- if (sub.fallbackWebhookUrl) {
36146
- ctx.out(` fallbackWebhookUrl: ${sub.fallbackWebhookUrl}`);
36147
- }
36169
+ const renderHook = (rawLabel, originLabel, raw, origin) => {
36170
+ if (raw) {
36171
+ ctx.out(` ${rawLabel}: ${raw}`);
36172
+ } else if (origin) {
36173
+ ctx.out(` ${originLabel}: ${origin}${c.dim}/***${c.reset}`);
36174
+ }
36175
+ };
36176
+ renderHook("webhookUrl", "webhookOrigin", revealed?.webhookUrl, sub.webhookOrigin);
36177
+ renderHook("fallbackWebhookUrl", "fallbackWebhookOrigin", revealed?.fallbackWebhookUrl, sub.fallbackWebhookOrigin);
36148
36178
  if (sub.actionContainer) {
36149
36179
  ctx.out(` action container: ${c.cyan}${sub.actionContainer}${c.reset}`);
36150
36180
  }
@@ -36256,6 +36286,7 @@ var handleLog = async (ctx, { flags, args }) => {
36256
36286
  maxUpdates: ctx.maxUpdates,
36257
36287
  inactivityTimeoutMs: ctx.inactivityTimeoutMs,
36258
36288
  functionLogs: ctx.functionLogMode,
36289
+ profile: ctx.profile,
36259
36290
  signal: ctx.signal
36260
36291
  });
36261
36292
  return;
@@ -36340,7 +36371,11 @@ var SUB_DOMAIN = defineDomain({
36340
36371
  prime: true,
36341
36372
  summary: "View subscription details",
36342
36373
  args: "<name>",
36343
- examples: ["wh sub view signal-hook --repo myorg/myrepo"],
36374
+ flags: viewFlags5,
36375
+ examples: [
36376
+ "wh sub view signal-hook --repo myorg/myrepo",
36377
+ "wh sub view signal-hook --show-secrets --repo myorg/myrepo"
36378
+ ],
36344
36379
  handler: handleView8
36345
36380
  },
36346
36381
  list: {
@@ -38906,9 +38941,10 @@ async function runCli(argv, opts) {
38906
38941
  requestedMode: requestedFunctionLogs
38907
38942
  });
38908
38943
  const localOnlyCommand = isLocalOnlyInvocation(invocation);
38909
- const { config, client } = localOnlyCommand ? {
38944
+ const { config, client, profile } = localOnlyCommand ? {
38910
38945
  config: loadConfig(),
38911
- client: createLocalOnlyClient()
38946
+ client: createLocalOnlyClient(),
38947
+ profile: "default"
38912
38948
  } : resolveCliContext({
38913
38949
  invocation,
38914
38950
  format,
@@ -38936,6 +38972,7 @@ async function runCli(argv, opts) {
38936
38972
  client,
38937
38973
  config,
38938
38974
  invocation,
38975
+ profile,
38939
38976
  colors,
38940
38977
  chars,
38941
38978
  format,
@@ -39044,7 +39081,7 @@ function resolveLogLevel(flags, env) {
39044
39081
  // package.json
39045
39082
  var package_default3 = {
39046
39083
  name: "@warmhub/cli",
39047
- version: "0.52.0",
39084
+ version: "0.52.1",
39048
39085
  private: false,
39049
39086
  type: "module",
39050
39087
  description: "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
@@ -39149,12 +39186,18 @@ async function maybeHandleComponentShellBoundary(argv, deps = {}) {
39149
39186
  const writeOut = deps.out ?? out;
39150
39187
  const writeErr = deps.err ?? err;
39151
39188
  const debug = getBoolFlag(invocation.flags, "debug") || process.env.WARMHUB_DEBUG === "1";
39152
- const formatFlag = getStringFlag(invocation.flags, "format");
39153
- const format = formatFlag === "json" || formatFlag === "jsonl" ? formatFlag : getBoolFlag(invocation.flags, "json") ? "json" : "pretty";
39189
+ let format = "pretty";
39154
39190
  const installFromManifestImpl = deps.installFromManifest ?? installFromManifest;
39155
39191
  const resolveRegisteredInstallImpl = deps.resolveRegisteredInstall ?? resolveRegisteredInstall;
39156
39192
  const callRegisteredSetupImpl = deps.callRegisteredSetup ?? callRegisteredSetup;
39157
39193
  try {
39194
+ canonicalizeGlobalFlags({ invocation });
39195
+ const formatFlag = getStringFlag(invocation.flags, "format");
39196
+ format = formatFlag === "json" || formatFlag === "jsonl" ? formatFlag : "pretty";
39197
+ applyGlobalFlags({ invocation });
39198
+ if (getBoolFlag(invocation.flags, "dry-run")) {
39199
+ return;
39200
+ }
39158
39201
  const { config, client } = resolveCliContext({
39159
39202
  invocation,
39160
39203
  format,
@@ -39823,4 +39866,4 @@ if (!updateCheckSuppressedByArgv && shouldRunUpdateCheck(updateEligibility)) {
39823
39866
  var interceptedExitCode = await maybeHandleComponentShellBoundary(dispatchArgv);
39824
39867
  process.exitCode = interceptedExitCode === undefined ? await runCli(dispatchArgv, { version: package_default3.version }) : interceptedExitCode;
39825
39868
 
39826
- //# debugId=EA0B77423037747464756E2164756E21
39869
+ //# debugId=4117FD49D270041C64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/cli",
3
- "version": "0.52.0",
3
+ "version": "0.52.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The wh CLI for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",