bamboo-agents 0.1.5-dev.51.78fa2ce → 0.1.5-dev.52.cc9d1f5
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 +148 -13
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.5-dev.
|
|
1
|
+
0.1.5-dev.52.cc9d1f5
|
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.
|
|
3040
|
+
VERSION = "0.1.5-dev.52.cc9d1f5";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -12284,6 +12284,30 @@ var init_onboarding_next_prompt = __esm({
|
|
|
12284
12284
|
}
|
|
12285
12285
|
});
|
|
12286
12286
|
|
|
12287
|
+
// ../../src/lib/api-contracts/cli/brand.ts
|
|
12288
|
+
var BrandUpdateRequestSchema, BrandUpdateResponseSchema, BrandEditorRequestSchema, BrandEditorResponseSchema;
|
|
12289
|
+
var init_brand = __esm({
|
|
12290
|
+
"../../src/lib/api-contracts/cli/brand.ts"() {
|
|
12291
|
+
init_zod();
|
|
12292
|
+
BrandUpdateRequestSchema = external_exports.object({
|
|
12293
|
+
website_url: external_exports.string().url().max(2048)
|
|
12294
|
+
});
|
|
12295
|
+
BrandUpdateResponseSchema = external_exports.object({
|
|
12296
|
+
brand_id: external_exports.string(),
|
|
12297
|
+
website_url: external_exports.string()
|
|
12298
|
+
});
|
|
12299
|
+
BrandEditorRequestSchema = external_exports.object({
|
|
12300
|
+
action: external_exports.enum(["add", "remove"]),
|
|
12301
|
+
user_id: external_exports.string().uuid()
|
|
12302
|
+
});
|
|
12303
|
+
BrandEditorResponseSchema = external_exports.object({
|
|
12304
|
+
brand_id: external_exports.string(),
|
|
12305
|
+
user_id: external_exports.string(),
|
|
12306
|
+
action: external_exports.enum(["add", "remove"])
|
|
12307
|
+
});
|
|
12308
|
+
}
|
|
12309
|
+
});
|
|
12310
|
+
|
|
12287
12311
|
// ../../src/lib/api-contracts/cli/context-health.ts
|
|
12288
12312
|
var ScopeKindSchema, ScopeSchema, CriterionMetricsSchema, StatusSchema, CriterionContributionSchema, CriterionResultSchema, BucketScoresSchema, ResolvedScopeSchema, GapsSchema, HealthyResponseSchema, UnavailableResponseSchema, ContextHealthResponseSchema;
|
|
12289
12313
|
var init_context_health = __esm({
|
|
@@ -12694,6 +12718,36 @@ async function scaffoldSkill(bambooSession, args) {
|
|
|
12694
12718
|
const json = await res.json();
|
|
12695
12719
|
return ScaffoldSkillResponseSchema.parse(json.data);
|
|
12696
12720
|
}
|
|
12721
|
+
async function patchBrand(bambooSession, brandId, websiteUrl) {
|
|
12722
|
+
const res = await cliApiFetch(
|
|
12723
|
+
`${apiBase()}/api/v1/cli/brands/${encodeURIComponent(brandId)}`,
|
|
12724
|
+
{
|
|
12725
|
+
method: "PATCH",
|
|
12726
|
+
headers: {
|
|
12727
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12728
|
+
"Content-Type": "application/json"
|
|
12729
|
+
},
|
|
12730
|
+
body: JSON.stringify({ website_url: websiteUrl })
|
|
12731
|
+
}
|
|
12732
|
+
);
|
|
12733
|
+
if (!res.ok) throw await parseError(res);
|
|
12734
|
+
return BrandUpdateResponseSchema.parse(await res.json());
|
|
12735
|
+
}
|
|
12736
|
+
async function postBrandEditor(bambooSession, brandId, body) {
|
|
12737
|
+
const res = await cliApiFetch(
|
|
12738
|
+
`${apiBase()}/api/v1/cli/brands/${encodeURIComponent(brandId)}/editors`,
|
|
12739
|
+
{
|
|
12740
|
+
method: "POST",
|
|
12741
|
+
headers: {
|
|
12742
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12743
|
+
"Content-Type": "application/json"
|
|
12744
|
+
},
|
|
12745
|
+
body: JSON.stringify(body)
|
|
12746
|
+
}
|
|
12747
|
+
);
|
|
12748
|
+
if (!res.ok) throw await parseError(res);
|
|
12749
|
+
return BrandEditorResponseSchema.parse(await res.json());
|
|
12750
|
+
}
|
|
12697
12751
|
async function uploadClaudeMdFromCli(bambooSession, body) {
|
|
12698
12752
|
const res = await cliApiFetch(
|
|
12699
12753
|
`${apiBase()}/api/v1/cli/agents/upload-claude-md`,
|
|
@@ -12720,6 +12774,7 @@ var init_api = __esm({
|
|
|
12720
12774
|
init_billing_status();
|
|
12721
12775
|
init_agent_health();
|
|
12722
12776
|
init_onboarding_next_prompt();
|
|
12777
|
+
init_brand();
|
|
12723
12778
|
init_agents();
|
|
12724
12779
|
init_knowledge_slots();
|
|
12725
12780
|
init_knowledge_save();
|
|
@@ -13789,13 +13844,13 @@ async function runCreateFlow(ctx) {
|
|
|
13789
13844
|
console.log("");
|
|
13790
13845
|
const name = await promptStdin(" Agent name (e.g. Paid Ads Agent): ");
|
|
13791
13846
|
if (!name) return null;
|
|
13792
|
-
const
|
|
13793
|
-
if (!
|
|
13847
|
+
const brand2 = await resolveBrand(ctx);
|
|
13848
|
+
if (!brand2) return null;
|
|
13794
13849
|
console.log("");
|
|
13795
13850
|
console.log(" Creating your agent\u2026");
|
|
13796
13851
|
try {
|
|
13797
13852
|
const created = await createAgentFromCli(ctx.credentials.bamboo_session, {
|
|
13798
|
-
brand_id:
|
|
13853
|
+
brand_id: brand2.id,
|
|
13799
13854
|
name
|
|
13800
13855
|
});
|
|
13801
13856
|
console.log("");
|
|
@@ -13847,15 +13902,15 @@ async function runUploadFlow(ctx) {
|
|
|
13847
13902
|
" Name this agent (e.g. My Existing Agent): "
|
|
13848
13903
|
);
|
|
13849
13904
|
if (!name) return null;
|
|
13850
|
-
const
|
|
13851
|
-
if (!
|
|
13905
|
+
const brand2 = await resolveBrand(ctx);
|
|
13906
|
+
if (!brand2) return null;
|
|
13852
13907
|
console.log("");
|
|
13853
13908
|
console.log(" Uploading\u2026");
|
|
13854
13909
|
try {
|
|
13855
13910
|
const uploaded = await uploadClaudeMdFromCli(
|
|
13856
13911
|
ctx.credentials.bamboo_session,
|
|
13857
13912
|
{
|
|
13858
|
-
brand_id:
|
|
13913
|
+
brand_id: brand2.id,
|
|
13859
13914
|
name,
|
|
13860
13915
|
claude_md_content: content
|
|
13861
13916
|
}
|
|
@@ -16908,6 +16963,72 @@ var init_onboarding = __esm({
|
|
|
16908
16963
|
}
|
|
16909
16964
|
});
|
|
16910
16965
|
|
|
16966
|
+
// src/commands/brand.ts
|
|
16967
|
+
var brand_exports = {};
|
|
16968
|
+
__export(brand_exports, {
|
|
16969
|
+
runBrandEditor: () => runBrandEditor,
|
|
16970
|
+
runBrandUpdate: () => runBrandUpdate
|
|
16971
|
+
});
|
|
16972
|
+
async function requireSession7() {
|
|
16973
|
+
const creds = await readCredentials();
|
|
16974
|
+
if (!creds) {
|
|
16975
|
+
console.error("bamboo-agents: not signed in. Run `bamboo-agents login` first.");
|
|
16976
|
+
process.exit(1);
|
|
16977
|
+
}
|
|
16978
|
+
return creds.bamboo_session;
|
|
16979
|
+
}
|
|
16980
|
+
async function runBrandUpdate(brandId, options) {
|
|
16981
|
+
if (!brandId) {
|
|
16982
|
+
console.error("bamboo-agents: `brand update` requires a brand id.");
|
|
16983
|
+
process.exit(2);
|
|
16984
|
+
}
|
|
16985
|
+
const session = await requireSession7();
|
|
16986
|
+
let result;
|
|
16987
|
+
try {
|
|
16988
|
+
result = await patchBrand(session, brandId, options.website);
|
|
16989
|
+
} catch (err) {
|
|
16990
|
+
console.error(`bamboo-agents: brand update failed: ${err.message}`);
|
|
16991
|
+
process.exit(1);
|
|
16992
|
+
}
|
|
16993
|
+
if (options.json) {
|
|
16994
|
+
console.log(JSON.stringify(result));
|
|
16995
|
+
return;
|
|
16996
|
+
}
|
|
16997
|
+
console.log("");
|
|
16998
|
+
console.log(` \u2713 Updated brand ${result.brand_id} \u2014 website ${result.website_url}`);
|
|
16999
|
+
console.log("");
|
|
17000
|
+
}
|
|
17001
|
+
async function runBrandEditor(action, brandId, userId, options) {
|
|
17002
|
+
if (!brandId || !userId) {
|
|
17003
|
+
console.error(`bamboo-agents: \`brand editor ${action}\` requires <brand-id> <user-id>.`);
|
|
17004
|
+
process.exit(2);
|
|
17005
|
+
}
|
|
17006
|
+
const session = await requireSession7();
|
|
17007
|
+
let result;
|
|
17008
|
+
try {
|
|
17009
|
+
result = await postBrandEditor(session, brandId, { action, user_id: userId });
|
|
17010
|
+
} catch (err) {
|
|
17011
|
+
console.error(`bamboo-agents: brand editor ${action} failed: ${err.message}`);
|
|
17012
|
+
process.exit(1);
|
|
17013
|
+
}
|
|
17014
|
+
if (options.json) {
|
|
17015
|
+
console.log(JSON.stringify(result));
|
|
17016
|
+
return;
|
|
17017
|
+
}
|
|
17018
|
+
console.log("");
|
|
17019
|
+
console.log(
|
|
17020
|
+
action === "add" ? ` \u2713 Granted editor ${result.user_id} on brand ${result.brand_id}` : ` \u2713 Revoked editor ${result.user_id} on brand ${result.brand_id}`
|
|
17021
|
+
);
|
|
17022
|
+
console.log("");
|
|
17023
|
+
}
|
|
17024
|
+
var init_brand2 = __esm({
|
|
17025
|
+
"src/commands/brand.ts"() {
|
|
17026
|
+
"use strict";
|
|
17027
|
+
init_credentials();
|
|
17028
|
+
init_api();
|
|
17029
|
+
}
|
|
17030
|
+
});
|
|
17031
|
+
|
|
16911
17032
|
// src/commands/agents.ts
|
|
16912
17033
|
var agents_exports2 = {};
|
|
16913
17034
|
__export(agents_exports2, {
|
|
@@ -16917,7 +17038,7 @@ __export(agents_exports2, {
|
|
|
16917
17038
|
runAgentsPause: () => runAgentsPause,
|
|
16918
17039
|
runAgentsProvision: () => runAgentsProvision
|
|
16919
17040
|
});
|
|
16920
|
-
async function
|
|
17041
|
+
async function requireSession8(opts) {
|
|
16921
17042
|
const creds = await readCredentials();
|
|
16922
17043
|
if (!creds) {
|
|
16923
17044
|
emitError(
|
|
@@ -17004,7 +17125,7 @@ function printList(data, opts) {
|
|
|
17004
17125
|
}
|
|
17005
17126
|
async function runAgentsList(options) {
|
|
17006
17127
|
const opts = options;
|
|
17007
|
-
const session = await
|
|
17128
|
+
const session = await requireSession8(opts);
|
|
17008
17129
|
let data;
|
|
17009
17130
|
try {
|
|
17010
17131
|
data = await listCliAgents(session);
|
|
@@ -17031,7 +17152,7 @@ function printDetail(agent, opts) {
|
|
|
17031
17152
|
}
|
|
17032
17153
|
async function runAgentsGet(agentRef, options) {
|
|
17033
17154
|
const opts = options;
|
|
17034
|
-
const session = await
|
|
17155
|
+
const session = await requireSession8(opts);
|
|
17035
17156
|
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17036
17157
|
let agent;
|
|
17037
17158
|
try {
|
|
@@ -17073,7 +17194,7 @@ async function resolveBrandId(session, explicit, opts) {
|
|
|
17073
17194
|
}
|
|
17074
17195
|
async function runAgentsProvision(name, options) {
|
|
17075
17196
|
const opts = options;
|
|
17076
|
-
const session = await
|
|
17197
|
+
const session = await requireSession8(opts);
|
|
17077
17198
|
const brandId = await resolveBrandId(session, options.brand, opts);
|
|
17078
17199
|
let result;
|
|
17079
17200
|
try {
|
|
@@ -17099,7 +17220,7 @@ async function runAgentsProvision(name, options) {
|
|
|
17099
17220
|
}
|
|
17100
17221
|
async function runAgentsPause(agentRef, options) {
|
|
17101
17222
|
const opts = options;
|
|
17102
|
-
const session = await
|
|
17223
|
+
const session = await requireSession8(opts);
|
|
17103
17224
|
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17104
17225
|
try {
|
|
17105
17226
|
const res = await pauseCliAgent(session, row.id);
|
|
@@ -17114,7 +17235,7 @@ async function runAgentsPause(agentRef, options) {
|
|
|
17114
17235
|
}
|
|
17115
17236
|
async function runAgentsActivate(agentRef, options) {
|
|
17116
17237
|
const opts = options;
|
|
17117
|
-
const session = await
|
|
17238
|
+
const session = await requireSession8(opts);
|
|
17118
17239
|
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17119
17240
|
let state = row.state;
|
|
17120
17241
|
let status = row.status;
|
|
@@ -17492,6 +17613,20 @@ onboarding.command("status").description("Composite onboarding gate (activation
|
|
|
17492
17613
|
const { runOnboardingStatus: runOnboardingStatus2 } = await Promise.resolve().then(() => (init_onboarding(), onboarding_exports));
|
|
17493
17614
|
await runOnboardingStatus2(options);
|
|
17494
17615
|
});
|
|
17616
|
+
var brand = program2.command("brand").description("Manage brand metadata + editors");
|
|
17617
|
+
brand.command("update <brand-id>").description("Update brand metadata (website URL)").requiredOption("--website <url>", "Brand website URL").option("--json", "Emit raw JSON").action(async (brandId, options) => {
|
|
17618
|
+
const { runBrandUpdate: runBrandUpdate2 } = await Promise.resolve().then(() => (init_brand2(), brand_exports));
|
|
17619
|
+
await runBrandUpdate2(brandId, options);
|
|
17620
|
+
});
|
|
17621
|
+
var brandEditor = brand.command("editor").description("Grant/revoke brand editor access (admin-only)");
|
|
17622
|
+
brandEditor.command("add <brand-id> <user-id>").description("Grant a user editor access on a brand").option("--json", "Emit raw JSON").action(async (brandId, userId, options) => {
|
|
17623
|
+
const { runBrandEditor: runBrandEditor2 } = await Promise.resolve().then(() => (init_brand2(), brand_exports));
|
|
17624
|
+
await runBrandEditor2("add", brandId, userId, options);
|
|
17625
|
+
});
|
|
17626
|
+
brandEditor.command("remove <brand-id> <user-id>").description("Revoke a user's editor access on a brand").option("--json", "Emit raw JSON").action(async (brandId, userId, options) => {
|
|
17627
|
+
const { runBrandEditor: runBrandEditor2 } = await Promise.resolve().then(() => (init_brand2(), brand_exports));
|
|
17628
|
+
await runBrandEditor2("remove", brandId, userId, options);
|
|
17629
|
+
});
|
|
17495
17630
|
var agents = program2.command("agents").description("Manage agents \u2014 list, get, provision, activate, pause");
|
|
17496
17631
|
agents.command("list").description("List agents with their lifecycle state").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(async (options) => {
|
|
17497
17632
|
const { runAgentsList: runAgentsList2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|