bamboo-agents 0.1.12-dev.115.ee669df → 0.1.12-dev.117.3e4cbee

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.12-dev.115.ee669df
1
+ 0.1.12-dev.117.3e4cbee
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.12-dev.115.ee669df";
3040
+ VERSION = "0.1.12-dev.117.3e4cbee";
3041
3041
  }
3042
3042
  });
3043
3043
 
@@ -12790,7 +12790,7 @@ function inboxSourceVersionsMatch(current, reviewed) {
12790
12790
  const canonicalUtc = (value) => value.replace(/\+00:00$/i, "Z");
12791
12791
  return canonicalUtc(current) === canonicalUtc(reviewed);
12792
12792
  }
12793
- var InboxUtcTimestampSchema, InboxOperationSchema, InboxManageOperationSchema, InboxOperationBindingSchema, common, INBOX_MANAGEMENT_BINDINGS, INBOX_EXISTING_COMMAND_BINDINGS, changeCommon, CHANGE_MANAGEMENT_BINDINGS, opportunityCommon, graphDecisionErrorCodes, OPPORTUNITY_MANAGEMENT_BINDINGS, annotationCommon, ANNOTATION_MANAGEMENT_BINDINGS, lifecycleMutationInputs, FDE_ACTION_MANAGEMENT_BINDINGS, GRAPH_RECOVERY_MANAGEMENT_BINDINGS, InboxManagementCatalogResponseSchema, InboxOrganizationsResponseSchema, OpportunityDecisionInputBaseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, UnknownMutationReceiptSchema, ChangeReadBackSchema, OpportunitySnapshotSchema, OpportunityUnknownReceiptSchema, OpportunityCommandSchema, FdeActionSnapshotSchema, GraphRecoverySnapshotSchema, LifecycleUnknownReceiptSchema, AnnotationSnapshotSchema, AnnotationUnknownReceiptSchema, InboxOperationEnvelopeSchema;
12793
+ var InboxUtcTimestampSchema, InboxOperationSchema, InboxManageOperationSchema, InboxOperationBindingSchema, common, INBOX_MANAGEMENT_BINDINGS, INBOX_EXISTING_COMMAND_BINDINGS, changeCommon, CHANGE_MANAGEMENT_BINDINGS, opportunityCommon, graphDecisionErrorCodes, OPPORTUNITY_MANAGEMENT_BINDINGS, annotationCommon, ANNOTATION_MANAGEMENT_BINDINGS, lifecycleMutationInputs, FDE_ACTION_MANAGEMENT_BINDINGS, GRAPH_RECOVERY_MANAGEMENT_BINDINGS, InboxManagementCatalogResponseSchema, InboxOrganizationsResponseSchema, InboxMembersResponseSchema, OpportunityDecisionInputBaseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, UnknownMutationReceiptSchema, ChangeReadBackSchema, OpportunitySnapshotSchema, OpportunityUnknownReceiptSchema, OpportunityCommandSchema, FdeActionSnapshotSchema, GraphRecoverySnapshotSchema, LifecycleUnknownReceiptSchema, AnnotationSnapshotSchema, AnnotationUnknownReceiptSchema, InboxOperationEnvelopeSchema;
12794
12794
  var init_inbox_management = __esm({
12795
12795
  "../../src/lib/api-contracts/cli/inbox-management.ts"() {
12796
12796
  init_zod();
@@ -13607,6 +13607,24 @@ var init_inbox_management = __esm({
13607
13607
  status: external_exports.string()
13608
13608
  }))
13609
13609
  });
13610
+ InboxMembersResponseSchema = external_exports.object({
13611
+ scope: external_exports.object({
13612
+ org_id: external_exports.string().uuid(),
13613
+ org_name: external_exports.string().min(1),
13614
+ brand_id: external_exports.null(),
13615
+ brand_name: external_exports.null()
13616
+ }),
13617
+ members: external_exports.array(external_exports.object({
13618
+ user_id: external_exports.string().uuid(),
13619
+ display_name: external_exports.string().min(1),
13620
+ email: external_exports.string().email().nullable(),
13621
+ membership_role: external_exports.string().min(1),
13622
+ brand_roles: external_exports.array(external_exports.object({
13623
+ brand_id: external_exports.string().uuid(),
13624
+ role: external_exports.enum(["editor", "viewer"])
13625
+ }))
13626
+ }))
13627
+ });
13610
13628
  OpportunityDecisionInputBaseSchema = external_exports.object({
13611
13629
  opportunity_id: external_exports.string().uuid(),
13612
13630
  brand_id: external_exports.string().uuid().optional(),
@@ -14013,6 +14031,7 @@ var init_inbox_management = __esm({
14013
14031
  instruction: external_exports.literal("inspect_source_before_retry"),
14014
14032
  reason: external_exports.enum([
14015
14033
  "response_unproven",
14034
+ "transport_failed",
14016
14035
  "read_back_unavailable",
14017
14036
  "postcondition_not_observed"
14018
14037
  ]).default("response_unproven"),
@@ -14083,7 +14102,9 @@ var init_inbox_management = __esm({
14083
14102
  LifecycleUnknownReceiptSchema = external_exports.object({
14084
14103
  state: external_exports.literal("unknown"),
14085
14104
  command_id: external_exports.string(),
14086
- instruction: external_exports.literal("inspect_source_before_retry")
14105
+ instruction: external_exports.literal("inspect_source_before_retry"),
14106
+ reason: external_exports.enum(["transport_failed", "read_back_unavailable", "postcondition_not_observed"]).optional(),
14107
+ read_back: external_exports.unknown().optional()
14087
14108
  });
14088
14109
  AnnotationSnapshotSchema = external_exports.object({
14089
14110
  id: external_exports.string().uuid(),
@@ -15453,6 +15474,18 @@ async function listInboxOrganizations(session) {
15453
15474
  );
15454
15475
  }
15455
15476
  }
15477
+ async function listInboxMembers(session, orgId) {
15478
+ const res = await cliApiFetch(`${apiBase()}/api/v1/inbox/members`, {
15479
+ headers: { Authorization: `Bearer ${session}`, "bamboo-active-org": orgId }
15480
+ });
15481
+ if (!res.ok) throw await parseError(res);
15482
+ const json = await res.json();
15483
+ try {
15484
+ return InboxMembersResponseSchema.parse(json.data);
15485
+ } catch {
15486
+ throw new ApiError("The Inbox member list response was malformed.", 502, "malformed_response");
15487
+ }
15488
+ }
15456
15489
  async function callInboxManagement(session, orgId, call) {
15457
15490
  const res = await cliApiFetch(`${apiBase()}/api/v1/inbox/manage`, {
15458
15491
  method: "POST",
@@ -20676,6 +20709,7 @@ var init_organization_selection = __esm({
20676
20709
  var inbox_management_exports = {};
20677
20710
  __export(inbox_management_exports, {
20678
20711
  runInboxManage: () => runInboxManage,
20712
+ runInboxMembers: () => runInboxMembers,
20679
20713
  runInboxOperations: () => runInboxOperations,
20680
20714
  runInboxOrganizations: () => runInboxOrganizations
20681
20715
  });
@@ -20749,6 +20783,44 @@ async function runInboxOrganizations(options) {
20749
20783
  fail(error, options);
20750
20784
  }
20751
20785
  }
20786
+ async function runInboxMembers(options) {
20787
+ try {
20788
+ const session = await inboxSession();
20789
+ const organization = await resolveOrganizationSelection(
20790
+ options.org,
20791
+ () => listInboxOrganizations(session)
20792
+ );
20793
+ const result = await listInboxMembers(session, organization.id);
20794
+ if (result.scope.org_id !== organization.id) {
20795
+ throw Object.assign(
20796
+ new Error("The member list belongs to a different organization."),
20797
+ { code: "organization_scope_mismatch" }
20798
+ );
20799
+ }
20800
+ const query = options.query?.trim() ?? "";
20801
+ const normalized = query.toLowerCase();
20802
+ const exact = result.members.filter((member) => member.display_name.toLowerCase() === normalized || member.email?.toLowerCase() === normalized || member.user_id.toLowerCase() === normalized);
20803
+ const matches = query ? exact.length > 0 ? exact : result.members.filter((member) => member.display_name.toLowerCase().includes(normalized) || member.email?.toLowerCase().includes(normalized) || member.user_id.toLowerCase().includes(normalized)) : result.members;
20804
+ if (query && matches.length !== 1) {
20805
+ const candidates = matches.map((member) => `${member.display_name} (${member.email ?? "no email"}; ${member.user_id})`).join(", ");
20806
+ throw Object.assign(
20807
+ new Error(matches.length === 0 ? `No member of ${result.scope.org_name} matches "${query}".` : `Member "${query}" is ambiguous: ${candidates}. Use an exact email or user ID.`),
20808
+ { code: matches.length === 0 ? "member_not_found" : "member_ambiguous" }
20809
+ );
20810
+ }
20811
+ human(`Members of ${result.scope.org_name} (${result.scope.org_id})`, options);
20812
+ for (const member of matches)
20813
+ human(` ${member.display_name} (${member.email ?? "no email"}) \u2014 ${member.user_id} [${member.membership_role}]`, options);
20814
+ emitSuccess({
20815
+ scope: result.scope,
20816
+ members: matches,
20817
+ count: matches.length,
20818
+ query: query || null
20819
+ }, options);
20820
+ } catch (error) {
20821
+ fail(error, options);
20822
+ }
20823
+ }
20752
20824
  async function runInboxManage(options) {
20753
20825
  try {
20754
20826
  const session = await inboxSession();
@@ -22391,7 +22463,13 @@ async function runEvalManage(options) {
22391
22463
  }
22392
22464
  }
22393
22465
  function managementOutcomeLine(result, readOnly) {
22394
- if (readOnly) return `Read ${result.operation}.`;
22466
+ if (readOnly) {
22467
+ const investigation = result.data && typeof result.data === "object" ? result.data : null;
22468
+ if (result.operation === "investigation.get" && investigation?.lifecycle_state === "retired" && typeof investigation.retired_at === "string") {
22469
+ return `Read investigation.get. Retired on ${investigation.retired_at.slice(0, 10)}.`;
22470
+ }
22471
+ return `Read ${result.operation}.`;
22472
+ }
22395
22473
  const data = result.data && typeof result.data === "object" ? result.data : {};
22396
22474
  const publication = data.publication && typeof data.publication === "object" ? data.publication : null;
22397
22475
  if (publication?.status === "failed") {
@@ -23259,6 +23337,10 @@ inbox.command("organizations [query]").description("List or search customer orga
23259
23337
  const { runInboxOrganizations: runInboxOrganizations2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
23260
23338
  await runInboxOrganizations2({ query, ...options });
23261
23339
  });
23340
+ 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) => {
23341
+ const { runInboxMembers: runInboxMembers2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
23342
+ await runInboxMembers2(options);
23343
+ });
23262
23344
  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) => {
23263
23345
  const { runInboxManage: runInboxManage2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
23264
23346
  await runInboxManage2({ operation, ...options });