bamboo-agents 0.1.15 → 0.1.16-dev.135.bad28cb

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.15
1
+ 0.1.16-dev.135.bad28cb
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.15";
3040
+ VERSION = "0.1.16-dev.135.bad28cb";
3041
3041
  }
3042
3042
  });
3043
3043
 
@@ -7212,7 +7212,7 @@ var init_knowledge_slots = __esm({
7212
7212
  "../../src/lib/api-contracts/cli/knowledge-slots.ts"() {
7213
7213
  init_zod();
7214
7214
  KnowledgeSlotKindSchema = external_exports.object({
7215
- /** Directory taxonomy: knowledge | memory | context | skills | scheduled_tasks | instructions | identity */
7215
+ /** Directory taxonomy: knowledge | memory | context | skills | scheduled_tasks | identity */
7216
7216
  kind: external_exports.string(),
7217
7217
  /** Scope this kind may be written at. */
7218
7218
  scope: external_exports.enum(["org", "brand", "agent"]),
@@ -7224,8 +7224,8 @@ var init_knowledge_slots = __esm({
7224
7224
  */
7225
7225
  example_path: external_exports.string(),
7226
7226
  /**
7227
- * True when the filename is pinned by the server (instructions/identity)
7228
- * and the caller's filename is ignored.
7227
+ * True when the filename is pinned by the server (identity) and the
7228
+ * caller's filename is ignored.
7229
7229
  */
7230
7230
  filename_pinned: external_exports.boolean()
7231
7231
  });
@@ -12493,7 +12493,9 @@ var init_auth_status = __esm({
12493
12493
  OrgRefSchema = external_exports.object({
12494
12494
  id: external_exports.string(),
12495
12495
  name: external_exports.string(),
12496
- workspace_repo: external_exports.string().nullable()
12496
+ workspace_repo: external_exports.string().nullable(),
12497
+ /** Present when Bamboo's shared installation serves this workspace. */
12498
+ workspace_managed: external_exports.boolean().optional()
12497
12499
  });
12498
12500
  MembershipSchema = external_exports.object({
12499
12501
  org: OrgRefSchema,
@@ -13433,6 +13435,10 @@ var init_eval_management = __esm({
13433
13435
  effective_org_id: external_exports.string(),
13434
13436
  real_actor_user_id: external_exports.string().nullable().optional(),
13435
13437
  effective_actor_user_id: external_exports.string().nullable().optional(),
13438
+ actor_kind: external_exports.enum(["agent", "fde"]).optional(),
13439
+ actor_agent_id: external_exports.string().nullable().optional(),
13440
+ operator_key_id: external_exports.string().nullable().optional(),
13441
+ issuer_user_id: external_exports.string().nullable().optional(),
13436
13442
  credential_kind: external_exports.enum(["user_session", "api_key"]).optional(),
13437
13443
  impersonating: external_exports.boolean().optional(),
13438
13444
  acting_in_org: external_exports.boolean().optional(),
@@ -13571,6 +13577,7 @@ var init_eval_management = __esm({
13571
13577
  source_path: external_exports.string().min(1),
13572
13578
  command_id: external_exports.string().min(1),
13573
13579
  already_retired: external_exports.boolean(),
13580
+ set_retired: external_exports.boolean().optional(),
13574
13581
  publication: InvestigationPublicationReceiptSchema
13575
13582
  }).passthrough();
13576
13583
  CaseRefsReceiptSchema = external_exports.object({
@@ -13792,6 +13799,8 @@ var init_inbox_management = __esm({
13792
13799
  "recipient_mismatch",
13793
13800
  "proposal_failed",
13794
13801
  "graph_decision_conflict",
13802
+ "audit_opportunity_requires_customer_wording",
13803
+ "shaping_pending",
13795
13804
  "opportunity_not_decidable",
13796
13805
  "opportunity_applied_receipt_unavailable",
13797
13806
  "opportunity_preflight_failed",
@@ -13820,7 +13829,7 @@ var init_inbox_management = __esm({
13820
13829
  cli_command: "bamboo-agents inbox manage",
13821
13830
  work_item_family: "inbox",
13822
13831
  supported_runtimes: ["cli", "api"],
13823
- authority: "Superadmin session with an explicit customer organization",
13832
+ authority: "Superadmin session with explicit customer organization, or organization-bound operator key",
13824
13833
  approval_required: false,
13825
13834
  side_effect: "none",
13826
13835
  minimum_cli_version: "0.1.8",
@@ -14143,7 +14152,8 @@ var init_inbox_management = __esm({
14143
14152
  "graph_decision_assignee_invalid",
14144
14153
  "graph_decision_invalid",
14145
14154
  "graph_decision_command_id_required",
14146
- "graph_decision_command_id_too_long"
14155
+ "graph_decision_command_id_too_long",
14156
+ "shaping_pending"
14147
14157
  ];
14148
14158
  OPPORTUNITY_MANAGEMENT_BINDINGS = [
14149
14159
  {
@@ -14207,6 +14217,7 @@ var init_inbox_management = __esm({
14207
14217
  "brain_opportunity_stale",
14208
14218
  "brain_opportunity_assignment_target_invalid",
14209
14219
  "missing_assignment",
14220
+ "audit_opportunity_requires_customer_wording",
14210
14221
  "wording_mismatch",
14211
14222
  "recipient_mismatch",
14212
14223
  "graph_decision_conflict",
@@ -14266,6 +14277,7 @@ var init_inbox_management = __esm({
14266
14277
  ...opportunityCommon.error_codes,
14267
14278
  "brain_opportunity_answer_stale_source",
14268
14279
  "brain_opportunity_answer_idempotency_conflict",
14280
+ "shaping_pending",
14269
14281
  "unknown_outcome"
14270
14282
  ]
14271
14283
  }
@@ -14861,7 +14873,13 @@ var init_inbox_management = __esm({
14861
14873
  brand_id: external_exports.string().nullable(),
14862
14874
  brand_name: external_exports.string().nullable()
14863
14875
  }),
14864
- actor: external_exports.object({ user_id: external_exports.string(), role: external_exports.string() }),
14876
+ actor: external_exports.object({
14877
+ user_id: external_exports.string(),
14878
+ role: external_exports.string(),
14879
+ actor_kind: external_exports.enum(["agent", "fde"]).optional(),
14880
+ agent_id: external_exports.string().nullable().optional(),
14881
+ key_id: external_exports.string().optional()
14882
+ }),
14865
14883
  command_id: external_exports.string().nullable(),
14866
14884
  outcome: external_exports.enum(["succeeded", "no_change", "pending", "unknown"])
14867
14885
  });
@@ -15571,6 +15589,7 @@ var init_eval_baseline_promote = __esm({
15571
15589
  demote: external_exports.literal(true),
15572
15590
  brand_id: external_exports.string().uuid(),
15573
15591
  qrels_version: external_exports.string().min(1).describe("The key to empty: its current baseline is tombstoned."),
15592
+ question_set_kind: external_exports.enum(["qrels", "sync_brain"]).default("qrels").describe("The baseline key to tombstone. Absent on an un-upgraded CLI, which means qrels."),
15574
15593
  reason: Reason,
15575
15594
  pr_url: PrUrl
15576
15595
  });
@@ -15583,6 +15602,7 @@ var init_eval_baseline_promote = __esm({
15583
15602
  kind: external_exports.enum(["promote", "demote"]),
15584
15603
  brand_id: external_exports.string().uuid(),
15585
15604
  qrels_version: external_exports.string(),
15605
+ question_set_kind: external_exports.enum(["qrels", "sync_brain"]),
15586
15606
  /** Null after a demotion. */
15587
15607
  run_id: external_exports.string().uuid().nullable(),
15588
15608
  /** What the head pointed at before this row; null when the version had no baseline. */
@@ -15715,12 +15735,19 @@ async function getCliOrganizationScope(session, orgId) {
15715
15735
  });
15716
15736
  if (!res.ok) throw await parseError(res);
15717
15737
  const json = await res.json();
15718
- return external_exports.object({
15738
+ const parsed = external_exports.object({
15719
15739
  scope: external_exports.object({
15720
15740
  effective_org_id: external_exports.string().uuid(),
15721
15741
  effective_org_name: external_exports.string()
15722
- })
15723
- }).parse(json).scope;
15742
+ }),
15743
+ operator: external_exports.object({
15744
+ capability: external_exports.literal("org_operator"),
15745
+ agent_id: external_exports.string().uuid(),
15746
+ key_id: external_exports.string().uuid(),
15747
+ expires_at: external_exports.string()
15748
+ }).optional()
15749
+ }).parse(json);
15750
+ return { ...parsed.scope, ...parsed.operator ? { operator: parsed.operator } : {} };
15724
15751
  }
15725
15752
  async function callInboxManagement(session, orgId, call) {
15726
15753
  const res = await cliApiFetch(`${apiBase()}/api/v1/inbox/manage`, {
@@ -15783,11 +15810,27 @@ async function cliApiFetch(url, init = {}) {
15783
15810
  const headers = new Headers(init.headers);
15784
15811
  headers.set("User-Agent", userAgent());
15785
15812
  headers.set("Bamboo-CLI-Version", VERSION);
15786
- return fetch(url, {
15813
+ const response = await fetch(url, {
15787
15814
  ...init,
15788
15815
  headers,
15789
15816
  signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
15790
15817
  });
15818
+ warnIfOperatorKeyNearExpiry(response);
15819
+ return response;
15820
+ }
15821
+ function warnIfOperatorKeyNearExpiry(response) {
15822
+ if (operatorExpiryWarningEmitted) return;
15823
+ const expiresAt = response.headers.get("Bamboo-Operator-Key-Expires-At");
15824
+ if (!expiresAt) return;
15825
+ const remainingMs = Date.parse(expiresAt) - Date.now();
15826
+ if (!Number.isFinite(remainingMs) || remainingMs > 14 * 864e5) return;
15827
+ operatorExpiryWarningEmitted = true;
15828
+ console.error(JSON.stringify({
15829
+ warning: "operator_key_expiring",
15830
+ expires_at: expiresAt,
15831
+ days_remaining: Math.max(0, Math.ceil(remainingMs / 864e5)),
15832
+ action: "Ask an FDE to rotate this agent's organization operator key."
15833
+ }));
15791
15834
  }
15792
15835
  async function getGithubToken(bambooSession) {
15793
15836
  const res = await cliApiFetch(`${apiBase()}/api/auth/github/token`, {
@@ -16505,7 +16548,7 @@ async function postRecEpisode(bambooSession, body) {
16505
16548
  const json = await res.json();
16506
16549
  return CliRecEpisodeResponseSchema.parse(json);
16507
16550
  }
16508
- var PROD_DEFAULT_BASE, DEV_DEFAULT_BASE, REQUEST_TIMEOUT_MS, ApiError, OAuthRelinkStartResponseSchema, ProvisionWorkspaceResponseSchema, FirstAutoInstalledAgentResponseSchema, SkillCatalogEntrySchema, SkillCatalogResponseSchema, SkillSubscriptionsResponseSchema;
16551
+ var PROD_DEFAULT_BASE, DEV_DEFAULT_BASE, REQUEST_TIMEOUT_MS, ApiError, operatorExpiryWarningEmitted, OAuthRelinkStartResponseSchema, ProvisionWorkspaceResponseSchema, FirstAutoInstalledAgentResponseSchema, SkillCatalogEntrySchema, SkillCatalogResponseSchema, SkillSubscriptionsResponseSchema;
16509
16552
  var init_api = __esm({
16510
16553
  "src/lib/api.ts"() {
16511
16554
  "use strict";
@@ -16548,6 +16591,7 @@ var init_api = __esm({
16548
16591
  this.name = "ApiError";
16549
16592
  }
16550
16593
  };
16594
+ operatorExpiryWarningEmitted = false;
16551
16595
  OAuthRelinkStartResponseSchema = external_exports.object({
16552
16596
  relink_url: external_exports.string().url()
16553
16597
  });
@@ -16827,7 +16871,7 @@ async function fetchGithubTokenForLogin(bambooSession) {
16827
16871
  return handleMissingGithubToken(bambooSession);
16828
16872
  }
16829
16873
  }
16830
- async function finishLogin(bambooSession, tokenResp) {
16874
+ async function finishLogin(bambooSession, tokenResp, options = {}) {
16831
16875
  await writeCredentials({
16832
16876
  bamboo_session: bambooSession,
16833
16877
  github_token: tokenResp?.access_token ?? "",
@@ -16835,6 +16879,13 @@ async function finishLogin(bambooSession, tokenResp) {
16835
16879
  github_username: tokenResp?.github_username ?? null,
16836
16880
  written_at: (/* @__PURE__ */ new Date()).toISOString()
16837
16881
  });
16882
+ if (options.managedWorkspace) {
16883
+ console.log("");
16884
+ console.log(" \u2713 Logged in to your Bamboo-managed workspace.");
16885
+ console.log(" Local git cloning may require separate GitHub access.");
16886
+ console.log("");
16887
+ return;
16888
+ }
16838
16889
  if (!tokenResp) {
16839
16890
  console.log("");
16840
16891
  console.log(" Your Bamboo session is saved \u2014 GitHub isn't linked yet.");
@@ -16860,7 +16911,7 @@ async function runLogin() {
16860
16911
  console.log("");
16861
16912
  console.log(" bamboo-agents will:");
16862
16913
  console.log(" \u2022 open your browser so you can sign in to Bamboo");
16863
- console.log(" \u2022 capture your session + GitHub token to ~/.bamboo/");
16914
+ console.log(" \u2022 save your Bamboo session to ~/.bamboo/");
16864
16915
  console.log("");
16865
16916
  console.log(` Verification code: ${code}`);
16866
16917
  console.log(" (the browser page should show the same code)");
@@ -16876,6 +16927,14 @@ async function runLogin() {
16876
16927
  process.exit(1);
16877
16928
  }
16878
16929
  spinner.succeed("Bamboo session captured");
16930
+ try {
16931
+ const status = await getCliAuthStatus(bambooSession);
16932
+ if (status.memberships.length > 0 && status.pending_invites.length === 0 && status.memberships.every((membership) => membership.org.workspace_managed === true)) {
16933
+ await finishLogin(bambooSession, null, { managedWorkspace: true });
16934
+ return;
16935
+ }
16936
+ } catch {
16937
+ }
16879
16938
  const tokenResp = await fetchGithubTokenForLogin(bambooSession);
16880
16939
  await finishLogin(bambooSession, tokenResp);
16881
16940
  }
@@ -18590,6 +18649,45 @@ var init_orchestrator = __esm({
18590
18649
  }
18591
18650
  });
18592
18651
 
18652
+ // src/commands/auth-status.ts
18653
+ var auth_status_exports = {};
18654
+ __export(auth_status_exports, {
18655
+ runAuthStatus: () => runAuthStatus
18656
+ });
18657
+ async function runAuthStatus(options) {
18658
+ try {
18659
+ const credential = await resolveSession();
18660
+ if (!credential) {
18661
+ emitError({ code: "authentication_required", message: "Set BAMBOO_API_TOKEN or run bamboo-agents login." }, options, 1);
18662
+ return;
18663
+ }
18664
+ const scope = await getCliOrganizationScope(credential);
18665
+ const status = {
18666
+ credential_kind: credential.startsWith("bam_") ? "api_key" : "user_session",
18667
+ organization: { id: scope.effective_org_id, name: scope.effective_org_name },
18668
+ operator: scope.operator ?? null
18669
+ };
18670
+ human(`Organization: ${scope.effective_org_name} (${scope.effective_org_id})`, options);
18671
+ if (scope.operator) {
18672
+ human(`Agent: ${scope.operator.agent_id}`, options);
18673
+ human(`Capability: ${scope.operator.capability}`, options);
18674
+ human(`Key: ${scope.operator.key_id} (expires ${scope.operator.expires_at})`, options);
18675
+ }
18676
+ emitSuccess(status, options);
18677
+ } catch (error) {
18678
+ const value = error;
18679
+ emitError({ code: value.code ?? value.errorCode ?? "auth_status_failed", message: value.message ?? "Could not verify Bamboo authentication." }, options, 1);
18680
+ }
18681
+ }
18682
+ var init_auth_status2 = __esm({
18683
+ "src/commands/auth-status.ts"() {
18684
+ "use strict";
18685
+ init_api();
18686
+ init_credentials();
18687
+ init_output();
18688
+ }
18689
+ });
18690
+
18593
18691
  // src/lib/claude-desktop.ts
18594
18692
  import { execFile as execFile7 } from "node:child_process";
18595
18693
  import { platform as platform4 } from "node:os";
@@ -20952,10 +21050,25 @@ async function resolveOrganizationSelection(requested, listOrganizations) {
20952
21050
  { code: "organization_scope_ambiguous" }
20953
21051
  );
20954
21052
  }
21053
+ async function resolveCredentialOrganization(session, selector) {
21054
+ if (!session.startsWith("bam_")) {
21055
+ if (!selector) throw Object.assign(new Error("Pass the customer organization with --org."), { code: "organization_scope_required" });
21056
+ return resolveOrganizationSelection(selector, () => listInboxOrganizations(session));
21057
+ }
21058
+ const bound = await getCliOrganizationScope(session);
21059
+ if (selector) {
21060
+ const requested = selector.trim().toLowerCase();
21061
+ if (requested !== bound.effective_org_id.toLowerCase() && requested !== bound.effective_org_name.toLowerCase()) {
21062
+ throw Object.assign(new Error("This API key is bound to a different organization."), { code: "organization_scope_mismatch" });
21063
+ }
21064
+ }
21065
+ return { id: bound.effective_org_id, name: bound.effective_org_name };
21066
+ }
20955
21067
  var UUID;
20956
21068
  var init_organization_selection = __esm({
20957
21069
  "src/lib/organization-selection.ts"() {
20958
21070
  "use strict";
21071
+ init_api();
20959
21072
  UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
20960
21073
  }
20961
21074
  });
@@ -20975,13 +21088,6 @@ async function inboxSession() {
20975
21088
  throw Object.assign(new Error("Run `bamboo-agents login` first."), {
20976
21089
  code: "authentication_required"
20977
21090
  });
20978
- if (token.startsWith("bam_"))
20979
- throw Object.assign(
20980
- new Error(
20981
- "Cross-customer Inbox operations require a user session; API keys cannot switch organizations."
20982
- ),
20983
- { code: "organization_scope_required" }
20984
- );
20985
21091
  return token;
20986
21092
  }
20987
21093
  async function inputObject(value) {
@@ -21028,7 +21134,7 @@ async function runInboxOperations(options) {
21028
21134
  async function runInboxOrganizations(options) {
21029
21135
  try {
21030
21136
  const session = await inboxSession();
21031
- const { orgs } = await listInboxOrganizations(session);
21137
+ const { orgs } = session.startsWith("bam_") ? { orgs: [await getCliOrganizationScope(session)].map((scope) => ({ id: scope.effective_org_id, name: scope.effective_org_name, status: "bound" })) } : await listInboxOrganizations(session);
21032
21138
  const query = options.query?.trim() ?? "";
21033
21139
  const normalized = query.toLowerCase();
21034
21140
  const organizations = query ? orgs.filter((org) => org.name.toLowerCase().includes(normalized) || org.id.toLowerCase().includes(normalized)) : orgs;
@@ -21041,10 +21147,7 @@ async function runInboxOrganizations(options) {
21041
21147
  async function runInboxMembers(options) {
21042
21148
  try {
21043
21149
  const session = await inboxSession();
21044
- const organization = await resolveOrganizationSelection(
21045
- options.org,
21046
- () => listInboxOrganizations(session)
21047
- );
21150
+ const organization = await resolveCredentialOrganization(session, options.org);
21048
21151
  const result = await listInboxMembers(session, organization.id);
21049
21152
  if (result.scope.org_id !== organization.id) {
21050
21153
  throw Object.assign(
@@ -21080,10 +21183,7 @@ async function runInboxMembers(options) {
21080
21183
  async function runInboxManage(options) {
21081
21184
  try {
21082
21185
  const session = await inboxSession();
21083
- const organization = await resolveOrganizationSelection(
21084
- options.org,
21085
- () => listInboxOrganizations(session)
21086
- );
21186
+ const organization = await resolveCredentialOrganization(session, options.org);
21087
21187
  const orgId = organization.id;
21088
21188
  if (organization.name) human(`Operating as organization: ${organization.name} (${orgId})`, options);
21089
21189
  if (!InboxManageOperationSchema.safeParse(options.operation).success) {
@@ -21187,7 +21287,7 @@ async function runInboxManage(options) {
21187
21287
  if (!options.approve) {
21188
21288
  throw Object.assign(
21189
21289
  new Error(
21190
- `${options.quiet ? `${previewSummary}. ` : ""}This operation changes customer state. Review the preview, obtain approval for its exact scope, source version, effect, and reversibility, then re-run with --approve.`
21290
+ `${options.quiet ? `${previewSummary}. ` : ""}This operation changes customer state. Review the preview and re-run with --approve to acknowledge its exact scope, source version, effect, and reversibility.`
21191
21291
  ),
21192
21292
  { code: "approval_required" }
21193
21293
  );
@@ -22710,10 +22810,7 @@ import { readFile as readFile10 } from "node:fs/promises";
22710
22810
  async function runEvalScope(options) {
22711
22811
  const session = await requireSession12(options);
22712
22812
  try {
22713
- const organization = await resolveOrganizationSelection(
22714
- options.org,
22715
- () => listInboxOrganizations(session)
22716
- );
22813
+ const organization = await resolveCredentialOrganization(session, options.org);
22717
22814
  const [brandResult, agentResult] = await Promise.all([
22718
22815
  listCliBrands(session, organization.id),
22719
22816
  listCliAgents(session, organization.id)
@@ -22771,10 +22868,7 @@ async function parseInput(value) {
22771
22868
  async function runEvalOperations(options) {
22772
22869
  const session = await requireSession12(options);
22773
22870
  try {
22774
- const organization = options.org ? await resolveOrganizationSelection(
22775
- options.org,
22776
- () => listInboxOrganizations(session)
22777
- ) : null;
22871
+ const organization = options.org || session.startsWith("bam_") ? await resolveCredentialOrganization(session, options.org) : null;
22778
22872
  const catalog = organization ? await getEvalManagementOperations(session, organization.id) : await getEvalManagementOperations(session);
22779
22873
  human("", options);
22780
22874
  for (const binding of catalog.bindings) {
@@ -22813,10 +22907,7 @@ async function runEvalManage(options) {
22813
22907
  const session = await requireSession12(output);
22814
22908
  try {
22815
22909
  const input = await parseInput(options.input);
22816
- const organization = options.org ? await resolveOrganizationSelection(
22817
- options.org,
22818
- () => listInboxOrganizations(session)
22819
- ) : null;
22910
+ const organization = options.org || session.startsWith("bam_") ? await resolveCredentialOrganization(session, options.org) : null;
22820
22911
  const call = EvalManagementCallSchema.parse({
22821
22912
  operation: options.operation,
22822
22913
  input
@@ -22932,9 +23023,10 @@ function caseOutcomeLine(operation, data, publication) {
22932
23023
  if (operation === "case.retire") {
22933
23024
  if (data.already_retired === true)
22934
23025
  return `${sourcePath} was already retired; nothing was written.`;
23026
+ const category = data.set_retired === true ? " and its category (last case)" : "";
22935
23027
  if (status === "pending")
22936
- return `Retirement of ${sourcePath} is queued for publication; the projected case stays active until it merges.`;
22937
- return projected ? `Retired ${sourcePath}: the file is removed and the projected case is inactive.` : `Retired ${sourcePath}: the file is removed, but the projected case has not been marked inactive yet.`;
23028
+ return `Retirement of ${sourcePath}${category} is queued for publication; the projected case stays active until it merges.`;
23029
+ return projected ? `Retired ${sourcePath}${category}: the file is removed and the projected case is inactive.` : `Retired ${sourcePath}${category}: the file is removed, but the projected case has not been marked inactive yet.`;
22938
23030
  }
22939
23031
  const verb = operation === "case.create" ? "Authored" : "Updated";
22940
23032
  const caseId = typeof data.case_id === "string" ? ` (eval_cases ${data.case_id})` : "";
@@ -23100,7 +23192,7 @@ function render(data, opts) {
23100
23192
  human("", opts);
23101
23193
  if (data.kind === "demote") {
23102
23194
  human(
23103
- ` Baseline demoted for qrels_version ${short(data.qrels_version)} (was run ${data.previous_run_id}).`,
23195
+ ` Baseline demoted for qrels_version ${short(data.qrels_version)} (${data.question_set_kind}, was run ${data.previous_run_id}).`,
23104
23196
  opts
23105
23197
  );
23106
23198
  human(
@@ -23109,7 +23201,7 @@ function render(data, opts) {
23109
23201
  );
23110
23202
  } else {
23111
23203
  human(
23112
- ` Baseline promoted: run ${data.run_id} is the reference for qrels_version ${short(data.qrels_version)}` + (data.previous_run_id ? ` (was ${data.previous_run_id}).` : " (the version had none)."),
23204
+ ` Baseline promoted: run ${data.run_id} is the reference for qrels_version ${short(data.qrels_version)} (${data.question_set_kind})` + (data.previous_run_id ? ` (was ${data.previous_run_id}).` : " (the version had none)."),
23113
23205
  opts
23114
23206
  );
23115
23207
  human(" Re-run the PR's retrieval-evals check: it compares flat against its own run.", opts);
@@ -23132,10 +23224,24 @@ async function runEvalPromote(options) {
23132
23224
  );
23133
23225
  return;
23134
23226
  }
23227
+ const kind = options.kind;
23228
+ if (kind !== void 0 && kind !== "qrels" && kind !== "sync_brain") {
23229
+ emitError(
23230
+ {
23231
+ code: "invalid_kind",
23232
+ message: `--kind must be "qrels" or "sync_brain", got "${kind}".`,
23233
+ hint: "Omit --kind to demote the qrels baseline."
23234
+ },
23235
+ opts,
23236
+ 1
23237
+ );
23238
+ return;
23239
+ }
23135
23240
  body = {
23136
23241
  demote: true,
23137
23242
  brand_id: options.brand,
23138
23243
  qrels_version: options.qrelsVersion,
23244
+ ...kind ? { question_set_kind: kind } : {},
23139
23245
  reason: options.reason,
23140
23246
  ...options.pr ? { pr_url: options.pr } : {}
23141
23247
  };
@@ -23691,6 +23797,10 @@ program2.command("login").description("Sign in to Bamboo via your browser (or us
23691
23797
  const { runLogin: runLogin2 } = await Promise.resolve().then(() => (init_login(), login_exports));
23692
23798
  await runLogin2();
23693
23799
  });
23800
+ program2.command("auth").description("Inspect the active Bamboo credential").command("status").description("Show the bound organization, agent, capability, and key expiry").option("--json", "Emit a JSON envelope").option("--quiet", "Suppress human chatter").action(async (options) => {
23801
+ const { runAuthStatus: runAuthStatus2 } = await Promise.resolve().then(() => (init_auth_status2(), auth_status_exports));
23802
+ await runAuthStatus2(options);
23803
+ });
23694
23804
  program2.command("init").description("Clone your workspace + set up git credentials").option(
23695
23805
  "--reset",
23696
23806
  "Delete the existing workspace clone and start over (prompts for confirmation)"
@@ -23768,11 +23878,11 @@ inbox.command("organizations [query]").description("List or search customer orga
23768
23878
  const { runInboxOrganizations: runInboxOrganizations2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
23769
23879
  await runInboxOrganizations2({ query, ...options });
23770
23880
  });
23771
- inbox.command("members").description("Find a customer organization's members before assigning an Inbox opportunity").requiredOption("--org <uuid-or-name>", "Explicit customer organization UUID or unique name").option("--query <person>", "Find one member by name, email, or auth user ID").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (options) => {
23881
+ inbox.command("members").description("Find a customer organization's members before assigning an Inbox opportunity").option("--org <uuid-or-name>", "Customer organization UUID or unique name (required for user sessions)").option("--query <person>", "Find one member by name, email, or auth user ID").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (options) => {
23772
23882
  const { runInboxMembers: runInboxMembers2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
23773
23883
  await runInboxMembers2(options);
23774
23884
  });
23775
- inbox.command("manage").description("Call one catalog-advertised customer Inbox operation").argument("<operation>", "Exact operation name").requiredOption("--input <json-or-@file>", "JSON object, inline or loaded from @path").requiredOption("--org <uuid-or-name>", "Explicit customer organization UUID or unique name").option("--approve", "Confirm the exact displayed mutation after user approval").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (operation, options) => {
23885
+ inbox.command("manage").description("Call one catalog-advertised customer Inbox operation").argument("<operation>", "Exact operation name").requiredOption("--input <json-or-@file>", "JSON object, inline or loaded from @path").option("--org <uuid-or-name>", "Customer organization UUID or unique name (required for user sessions)").option("--approve", "Confirm the exact displayed mutation after user approval").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (operation, options) => {
23776
23886
  const { runInboxManage: runInboxManage2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
23777
23887
  await runInboxManage2({ operation, ...options });
23778
23888
  });
@@ -23895,7 +24005,7 @@ episode.command("log-rec").description(
23895
24005
  await runEpisodeLogRec2(options);
23896
24006
  });
23897
24007
  var evals = program2.command("eval").description("Evaluation surface \u2014 A/B a candidate skill against its baseline");
23898
- evals.command("scope").description("Resolve one organization and list its authoritative brands and agents").requiredOption("--org <uuid-or-name>", "Customer organization UUID, exact name, or unique name fragment").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (options) => {
24008
+ evals.command("scope").description("Resolve one organization and list its authoritative brands and agents").option("--org <uuid-or-name>", "Customer organization UUID or name (required for user sessions)").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (options) => {
23899
24009
  const { runEvalScope: runEvalScope2 } = await Promise.resolve().then(() => (init_eval_management2(), eval_management_exports));
23900
24010
  await runEvalScope2(options);
23901
24011
  });
@@ -23923,7 +24033,7 @@ evals.command("ablate").description(
23923
24033
  );
23924
24034
  evals.command("promote").description(
23925
24035
  "Promote a correctness run as the baseline for its qrels version, or --demote the current one"
23926
- ).argument("[run-id]", "Run id printed by the correctness gate (omit with --demote)").requiredOption("--reason <text>", "Why this run is the reference now \u2014 recorded on the row").option("--pr <url>", "PR URL to record as the promotion's source").option("--demote", "Write a tombstone: the version has no baseline until a human promotes one").option("--brand <id>", "Brand id (with --demote)").option("--qrels-version <hash>", "qrels version to demote (with --demote)").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").option("--no-sync", "Skip the auto-sync git pull on this command").action(
24036
+ ).argument("[run-id]", "Run id printed by the correctness gate (omit with --demote)").requiredOption("--reason <text>", "Why this run is the reference now \u2014 recorded on the row").option("--pr <url>", "PR URL to record as the promotion's source").option("--demote", "Write a tombstone: the version has no baseline until a human promotes one").option("--brand <id>", "Brand id (with --demote)").option("--qrels-version <hash>", "qrels version to demote (with --demote)").option("--kind <kind>", "Question set kind to demote: qrels | sync_brain (with --demote)").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").option("--no-sync", "Skip the auto-sync git pull on this command").action(
23927
24037
  async (runId, options) => {
23928
24038
  const { runEvalPromote: runEvalPromote2 } = await Promise.resolve().then(() => (init_eval_promote(), eval_promote_exports));
23929
24039
  await runEvalPromote2({ runId, ...options });