bamboo-agents 0.1.12-dev.116.b57862a → 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 +1 -1
- package/dist/index.js +75 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.12-dev.
|
|
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.
|
|
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(),
|
|
@@ -15456,6 +15474,18 @@ async function listInboxOrganizations(session) {
|
|
|
15456
15474
|
);
|
|
15457
15475
|
}
|
|
15458
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
|
+
}
|
|
15459
15489
|
async function callInboxManagement(session, orgId, call) {
|
|
15460
15490
|
const res = await cliApiFetch(`${apiBase()}/api/v1/inbox/manage`, {
|
|
15461
15491
|
method: "POST",
|
|
@@ -20679,6 +20709,7 @@ var init_organization_selection = __esm({
|
|
|
20679
20709
|
var inbox_management_exports = {};
|
|
20680
20710
|
__export(inbox_management_exports, {
|
|
20681
20711
|
runInboxManage: () => runInboxManage,
|
|
20712
|
+
runInboxMembers: () => runInboxMembers,
|
|
20682
20713
|
runInboxOperations: () => runInboxOperations,
|
|
20683
20714
|
runInboxOrganizations: () => runInboxOrganizations
|
|
20684
20715
|
});
|
|
@@ -20752,6 +20783,44 @@ async function runInboxOrganizations(options) {
|
|
|
20752
20783
|
fail(error, options);
|
|
20753
20784
|
}
|
|
20754
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
|
+
}
|
|
20755
20824
|
async function runInboxManage(options) {
|
|
20756
20825
|
try {
|
|
20757
20826
|
const session = await inboxSession();
|
|
@@ -23268,6 +23337,10 @@ inbox.command("organizations [query]").description("List or search customer orga
|
|
|
23268
23337
|
const { runInboxOrganizations: runInboxOrganizations2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
|
|
23269
23338
|
await runInboxOrganizations2({ query, ...options });
|
|
23270
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
|
+
});
|
|
23271
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) => {
|
|
23272
23345
|
const { runInboxManage: runInboxManage2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
|
|
23273
23346
|
await runInboxManage2({ operation, ...options });
|