bamboo-agents 0.1.5-dev.45.7146777 → 0.1.5-dev.47.e6dcb2e

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5-dev.45.7146777
1
+ 0.1.5-dev.47.e6dcb2e
package/dist/index.js CHANGED
@@ -3037,7 +3037,7 @@ var VERSION;
3037
3037
  var init_version = __esm({
3038
3038
  "src/version.ts"() {
3039
3039
  "use strict";
3040
- VERSION = "0.1.5-dev.45.7146777";
3040
+ VERSION = "0.1.5-dev.47.e6dcb2e";
3041
3041
  }
3042
3042
  });
3043
3043
 
@@ -12187,7 +12187,7 @@ var init_save = __esm({
12187
12187
  });
12188
12188
 
12189
12189
  // ../../src/lib/api-contracts/cli/context-health.ts
12190
- var ScopeKindSchema, ScopeSchema, CriterionMetricsSchema, StatusSchema, CriterionContributionSchema, CriterionResultSchema, BucketScoresSchema, ResolvedScopeSchema, GapsSchema, ContextHealthResponseSchema;
12190
+ var ScopeKindSchema, ScopeSchema, CriterionMetricsSchema, StatusSchema, CriterionContributionSchema, CriterionResultSchema, BucketScoresSchema, ResolvedScopeSchema, GapsSchema, HealthyResponseSchema, UnavailableResponseSchema, ContextHealthResponseSchema;
12191
12191
  var init_context_health = __esm({
12192
12192
  "../../src/lib/api-contracts/cli/context-health.ts"() {
12193
12193
  init_zod();
@@ -12239,7 +12239,8 @@ var init_context_health = __esm({
12239
12239
  /** Criterion keys that are at "basic" status (partially filled). */
12240
12240
  basic: external_exports.array(external_exports.string())
12241
12241
  });
12242
- ContextHealthResponseSchema = external_exports.object({
12242
+ HealthyResponseSchema = external_exports.object({
12243
+ available: external_exports.literal(true),
12243
12244
  scope: ScopeSchema,
12244
12245
  grade: external_exports.enum(["A", "B", "C", "D", "F"]),
12245
12246
  score: external_exports.number(),
@@ -12250,6 +12251,15 @@ var init_context_health = __esm({
12250
12251
  * don't need to iterate the full results array. */
12251
12252
  gaps: GapsSchema
12252
12253
  });
12254
+ UnavailableResponseSchema = external_exports.object({
12255
+ available: external_exports.literal(false),
12256
+ /** Short, human-readable reason health is unavailable. */
12257
+ reason: external_exports.string()
12258
+ });
12259
+ ContextHealthResponseSchema = external_exports.discriminatedUnion("available", [
12260
+ HealthyResponseSchema,
12261
+ UnavailableResponseSchema
12262
+ ]);
12253
12263
  }
12254
12264
  });
12255
12265
 
@@ -16262,6 +16272,13 @@ async function runContextHealth(options) {
16262
16272
  console.log(JSON.stringify(data, null, 2));
16263
16273
  return;
16264
16274
  }
16275
+ if (!data.available) {
16276
+ console.log("");
16277
+ console.log(" Context health is unavailable right now.");
16278
+ console.log(` (${data.reason})`);
16279
+ console.log("");
16280
+ return;
16281
+ }
16265
16282
  printHealth(data);
16266
16283
  }
16267
16284
  var init_context = __esm({
@@ -16479,6 +16496,17 @@ async function buildCommandSchema(program3, cliVersion, commandName) {
16479
16496
  const manifest = await buildManifest(program3, cliVersion);
16480
16497
  return manifest.commands.find((c) => c.name === commandName) ?? null;
16481
16498
  }
16499
+ function resolveIntrospection(rawArgs, operands) {
16500
+ if (operands.length > 0) return null;
16501
+ if (rawArgs.includes("--describe")) return { mode: "describe" };
16502
+ const schemaIdx = rawArgs.indexOf("--schema");
16503
+ if (schemaIdx !== -1) {
16504
+ const command = rawArgs[schemaIdx + 1];
16505
+ if (!command || command.startsWith("--")) return { mode: "schema-missing" };
16506
+ return { mode: "schema", command };
16507
+ }
16508
+ return null;
16509
+ }
16482
16510
 
16483
16511
  // src/index.ts
16484
16512
  var program2 = new Command();
@@ -16578,29 +16606,29 @@ onboarding.command("status").description("Composite onboarding gate (activation
16578
16606
  await runOnboardingStatus2(options);
16579
16607
  });
16580
16608
  (async () => {
16581
- const { operands, unknown: unknownArgs } = program2.parseOptions(
16582
- process.argv.slice(2)
16583
- );
16584
16609
  const rawArgs = process.argv.slice(2);
16585
- const describeIdx = rawArgs.indexOf("--describe");
16586
- const schemaIdx = rawArgs.indexOf("--schema");
16587
- if (describeIdx !== -1) {
16610
+ const { operands } = program2.parseOptions(rawArgs);
16611
+ const introspection = resolveIntrospection(rawArgs, operands);
16612
+ if (introspection?.mode === "describe") {
16588
16613
  const manifest = await buildManifest(program2, VERSION);
16589
16614
  process.stdout.write(JSON.stringify(manifest, null, 2) + "\n");
16590
16615
  process.exit(0);
16591
16616
  }
16592
- if (schemaIdx !== -1) {
16593
- const commandName = rawArgs[schemaIdx + 1];
16594
- if (!commandName || commandName.startsWith("--")) {
16595
- process.stderr.write(
16596
- "bamboo-agents: --schema requires a command name, e.g. --schema history\n"
16597
- );
16598
- process.exit(1);
16599
- }
16600
- const entry = await buildCommandSchema(program2, VERSION, commandName);
16617
+ if (introspection?.mode === "schema-missing") {
16618
+ process.stderr.write(
16619
+ "bamboo-agents: --schema requires a command name, e.g. --schema history\n"
16620
+ );
16621
+ process.exit(1);
16622
+ }
16623
+ if (introspection?.mode === "schema") {
16624
+ const entry = await buildCommandSchema(
16625
+ program2,
16626
+ VERSION,
16627
+ introspection.command
16628
+ );
16601
16629
  if (entry === null) {
16602
16630
  process.stderr.write(
16603
- `bamboo-agents: unknown command '${commandName}'. Run --describe for the full list.
16631
+ `bamboo-agents: unknown command '${introspection.command}'. Run --describe for the full list.
16604
16632
  `
16605
16633
  );
16606
16634
  process.exit(1);