bamboo-agents 0.1.5-dev.54.477c24e → 0.1.5-dev.56.68a2b19
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 +137 -2
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.5-dev.
|
|
1
|
+
0.1.5-dev.56.68a2b19
|
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.56.68a2b19";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -7386,9 +7386,13 @@ __export(agents_exports, {
|
|
|
7386
7386
|
CliAgentsListResponseSchema: () => CliAgentsListResponseSchema,
|
|
7387
7387
|
CliBrandRowSchema: () => CliBrandRowSchema,
|
|
7388
7388
|
CliBrandsListResponseSchema: () => CliBrandsListResponseSchema,
|
|
7389
|
+
CliCloneAgentRequestSchema: () => CliCloneAgentRequestSchema,
|
|
7390
|
+
CliCloneAgentResponseSchema: () => CliCloneAgentResponseSchema,
|
|
7389
7391
|
CliCreateAgentRequestSchema: () => CliCreateAgentRequestSchema,
|
|
7390
7392
|
CliCreateAgentResponseSchema: () => CliCreateAgentResponseSchema,
|
|
7391
7393
|
CliDeleteAgentResponseSchema: () => CliDeleteAgentResponseSchema,
|
|
7394
|
+
CliEnableTemplateRequestSchema: () => CliEnableTemplateRequestSchema,
|
|
7395
|
+
CliEnableTemplateResponseSchema: () => CliEnableTemplateResponseSchema,
|
|
7392
7396
|
CliTierCapSchema: () => CliTierCapSchema,
|
|
7393
7397
|
CliUpdateAgentRequestSchema: () => CliUpdateAgentRequestSchema,
|
|
7394
7398
|
CliUpdateAgentResponseSchema: () => CliUpdateAgentResponseSchema,
|
|
@@ -7400,7 +7404,7 @@ __export(agents_exports, {
|
|
|
7400
7404
|
UploadClaudeMdRequestSchema: () => UploadClaudeMdRequestSchema,
|
|
7401
7405
|
UploadClaudeMdResponseSchema: () => UploadClaudeMdResponseSchema
|
|
7402
7406
|
});
|
|
7403
|
-
var SlugSchema, NameSchema, BrandIdSchema, CliAgentRowSchema, CliTierCapSchema, CliAgentsListResponseSchema, CliCreateAgentRequestSchema, CliAgentMutationResponseBase, CliCreateAgentResponseSchema, UPLOAD_MAX_BYTES, CliUploadAgentRequestSchema, CliUploadAgentResponseSchema, CliUpdateAgentRequestSchema, CliUpdateAgentResponseSchema, CliDeleteAgentResponseSchema, CliBrandRowSchema, CliBrandsListResponseSchema, CliAgentLifecycleStateSchema, CliAgentDetailSchema, CliAgentGetResponseSchema, CliAgentPauseResponseSchema, CliAgentPublishResponseSchema, CreateFromCliRequestSchema, CreateFromCliResponseSchema, UploadClaudeMdRequestSchema, UploadClaudeMdResponseSchema;
|
|
7407
|
+
var SlugSchema, NameSchema, BrandIdSchema, CliAgentRowSchema, CliTierCapSchema, CliAgentsListResponseSchema, CliCreateAgentRequestSchema, CliAgentMutationResponseBase, CliCreateAgentResponseSchema, UPLOAD_MAX_BYTES, CliUploadAgentRequestSchema, CliUploadAgentResponseSchema, CliUpdateAgentRequestSchema, CliUpdateAgentResponseSchema, CliDeleteAgentResponseSchema, CliCloneAgentRequestSchema, CliCloneAgentResponseSchema, CliEnableTemplateRequestSchema, CliEnableTemplateResponseSchema, CliBrandRowSchema, CliBrandsListResponseSchema, CliAgentLifecycleStateSchema, CliAgentDetailSchema, CliAgentGetResponseSchema, CliAgentPauseResponseSchema, CliAgentPublishResponseSchema, CreateFromCliRequestSchema, CreateFromCliResponseSchema, UploadClaudeMdRequestSchema, UploadClaudeMdResponseSchema;
|
|
7404
7408
|
var init_agents = __esm({
|
|
7405
7409
|
"../../src/lib/api-contracts/cli/agents.ts"() {
|
|
7406
7410
|
init_zod();
|
|
@@ -7488,6 +7492,31 @@ var init_agents = __esm({
|
|
|
7488
7492
|
agent_id: external_exports.string().uuid(),
|
|
7489
7493
|
pr_number: external_exports.number().nullable()
|
|
7490
7494
|
});
|
|
7495
|
+
CliCloneAgentRequestSchema = external_exports.object({
|
|
7496
|
+
source_agent_id: external_exports.string().uuid(),
|
|
7497
|
+
target_agent_id: external_exports.string().uuid(),
|
|
7498
|
+
include_brands: external_exports.boolean().optional()
|
|
7499
|
+
});
|
|
7500
|
+
CliCloneAgentResponseSchema = external_exports.object({
|
|
7501
|
+
source_agent_id: external_exports.string().uuid(),
|
|
7502
|
+
target_agent_id: external_exports.string().uuid(),
|
|
7503
|
+
files_copied: external_exports.number(),
|
|
7504
|
+
files_failed: external_exports.number(),
|
|
7505
|
+
files_total: external_exports.number(),
|
|
7506
|
+
brands_copied: external_exports.number()
|
|
7507
|
+
});
|
|
7508
|
+
CliEnableTemplateRequestSchema = external_exports.object({
|
|
7509
|
+
template_id: external_exports.string().min(1),
|
|
7510
|
+
brand_id: external_exports.string().uuid(),
|
|
7511
|
+
approval_emoji: external_exports.string().optional(),
|
|
7512
|
+
system_prompt: external_exports.string().optional()
|
|
7513
|
+
});
|
|
7514
|
+
CliEnableTemplateResponseSchema = external_exports.object({
|
|
7515
|
+
agent_id: external_exports.string().uuid(),
|
|
7516
|
+
template_id: external_exports.string(),
|
|
7517
|
+
anthropic_agent_id: external_exports.string().nullable(),
|
|
7518
|
+
endpoint_count: external_exports.number()
|
|
7519
|
+
});
|
|
7491
7520
|
CliBrandRowSchema = external_exports.object({
|
|
7492
7521
|
id: external_exports.string().uuid(),
|
|
7493
7522
|
name: external_exports.string()
|
|
@@ -12690,6 +12719,33 @@ async function deleteCliAgent(bambooSession, agentId) {
|
|
|
12690
12719
|
if (!res.ok) throw await parseError(res);
|
|
12691
12720
|
return CliDeleteAgentResponseSchema.parse(await res.json());
|
|
12692
12721
|
}
|
|
12722
|
+
async function cloneCliAgent(bambooSession, body) {
|
|
12723
|
+
const res = await cliApiFetch(`${apiBase()}/api/v1/cli/agents/clone`, {
|
|
12724
|
+
method: "POST",
|
|
12725
|
+
headers: {
|
|
12726
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12727
|
+
"Content-Type": "application/json"
|
|
12728
|
+
},
|
|
12729
|
+
body: JSON.stringify(body)
|
|
12730
|
+
});
|
|
12731
|
+
if (!res.ok) throw await parseError(res);
|
|
12732
|
+
return CliCloneAgentResponseSchema.parse(await res.json());
|
|
12733
|
+
}
|
|
12734
|
+
async function enableTemplateCliAgent(bambooSession, agentId, body) {
|
|
12735
|
+
const res = await cliApiFetch(
|
|
12736
|
+
`${apiBase()}/api/v1/cli/agents/${encodeURIComponent(agentId)}/enable-template`,
|
|
12737
|
+
{
|
|
12738
|
+
method: "POST",
|
|
12739
|
+
headers: {
|
|
12740
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12741
|
+
"Content-Type": "application/json"
|
|
12742
|
+
},
|
|
12743
|
+
body: JSON.stringify(body)
|
|
12744
|
+
}
|
|
12745
|
+
);
|
|
12746
|
+
if (!res.ok) throw await parseError(res);
|
|
12747
|
+
return CliEnableTemplateResponseSchema.parse(await res.json());
|
|
12748
|
+
}
|
|
12693
12749
|
async function publishCliAgent(bambooSession, agentId) {
|
|
12694
12750
|
const res = await cliApiFetch(
|
|
12695
12751
|
`${apiBase()}/api/v1/agents/${encodeURIComponent(agentId)}/provision`,
|
|
@@ -17076,7 +17132,9 @@ var init_brand2 = __esm({
|
|
|
17076
17132
|
var agents_exports2 = {};
|
|
17077
17133
|
__export(agents_exports2, {
|
|
17078
17134
|
runAgentsActivate: () => runAgentsActivate,
|
|
17135
|
+
runAgentsClone: () => runAgentsClone,
|
|
17079
17136
|
runAgentsDelete: () => runAgentsDelete,
|
|
17137
|
+
runAgentsEnableTemplate: () => runAgentsEnableTemplate,
|
|
17080
17138
|
runAgentsGet: () => runAgentsGet,
|
|
17081
17139
|
runAgentsList: () => runAgentsList,
|
|
17082
17140
|
runAgentsPause: () => runAgentsPause,
|
|
@@ -17331,6 +17389,71 @@ async function runAgentsDelete(agentRef, options) {
|
|
|
17331
17389
|
);
|
|
17332
17390
|
}
|
|
17333
17391
|
}
|
|
17392
|
+
async function runAgentsClone(sourceRef, targetRef, options) {
|
|
17393
|
+
const opts = options;
|
|
17394
|
+
const session = await requireSession8(opts);
|
|
17395
|
+
const source = await resolveAgentRef(session, sourceRef, opts);
|
|
17396
|
+
const target = await resolveAgentRef(session, targetRef, opts);
|
|
17397
|
+
try {
|
|
17398
|
+
const res = await cloneCliAgent(session, {
|
|
17399
|
+
source_agent_id: source.id,
|
|
17400
|
+
target_agent_id: target.id,
|
|
17401
|
+
// commander maps `--no-brands` to options.brands === false; default
|
|
17402
|
+
// (undefined) means include brands.
|
|
17403
|
+
...options.brands === false ? { include_brands: false } : {}
|
|
17404
|
+
});
|
|
17405
|
+
emitSuccess(
|
|
17406
|
+
res,
|
|
17407
|
+
opts,
|
|
17408
|
+
() => human(
|
|
17409
|
+
` Cloned ${source.name} \u2192 ${target.name}: ${res.files_copied}/${res.files_total} files${res.files_failed ? ` (${res.files_failed} failed)` : ""}, ${res.brands_copied} brand${res.brands_copied === 1 ? "" : "s"}.`,
|
|
17410
|
+
opts
|
|
17411
|
+
)
|
|
17412
|
+
);
|
|
17413
|
+
} catch (err) {
|
|
17414
|
+
emitError(
|
|
17415
|
+
{ code: "agent_clone_failed", message: `couldn't clone agent: ${err.message}` },
|
|
17416
|
+
opts,
|
|
17417
|
+
1
|
|
17418
|
+
);
|
|
17419
|
+
}
|
|
17420
|
+
}
|
|
17421
|
+
async function runAgentsEnableTemplate(agentRef, options) {
|
|
17422
|
+
const opts = options;
|
|
17423
|
+
const session = await requireSession8(opts);
|
|
17424
|
+
if (!options.template) {
|
|
17425
|
+
emitError({ code: "template_required", message: "Provide --template <id>." }, opts, 2);
|
|
17426
|
+
return;
|
|
17427
|
+
}
|
|
17428
|
+
if (!options.brand) {
|
|
17429
|
+
emitError({ code: "brand_required", message: "Provide --brand <id>." }, opts, 2);
|
|
17430
|
+
return;
|
|
17431
|
+
}
|
|
17432
|
+
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17433
|
+
const body = {
|
|
17434
|
+
template_id: options.template,
|
|
17435
|
+
brand_id: options.brand,
|
|
17436
|
+
...options.emoji ? { approval_emoji: options.emoji } : {},
|
|
17437
|
+
...options.systemPrompt ? { system_prompt: options.systemPrompt } : {}
|
|
17438
|
+
};
|
|
17439
|
+
try {
|
|
17440
|
+
const res = await enableTemplateCliAgent(session, row.id, body);
|
|
17441
|
+
emitSuccess(
|
|
17442
|
+
res,
|
|
17443
|
+
opts,
|
|
17444
|
+
() => human(
|
|
17445
|
+
` Applied template "${res.template_id}" to ${row.name} (${row.id}).${res.endpoint_count ? ` ${res.endpoint_count} trigger endpoint${res.endpoint_count === 1 ? "" : "s"}.` : ""} (Slack channel binding, if any, is set in the UI.)`,
|
|
17446
|
+
opts
|
|
17447
|
+
)
|
|
17448
|
+
);
|
|
17449
|
+
} catch (err) {
|
|
17450
|
+
emitError(
|
|
17451
|
+
{ code: "agent_enable_template_failed", message: `couldn't enable template: ${err.message}` },
|
|
17452
|
+
opts,
|
|
17453
|
+
1
|
|
17454
|
+
);
|
|
17455
|
+
}
|
|
17456
|
+
}
|
|
17334
17457
|
async function runAgentsActivate(agentRef, options) {
|
|
17335
17458
|
const opts = options;
|
|
17336
17459
|
const session = await requireSession8(opts);
|
|
@@ -17750,6 +17873,18 @@ agents.command("delete <agent>").description("Delete a draft/broken agent (accep
|
|
|
17750
17873
|
const { runAgentsDelete: runAgentsDelete2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17751
17874
|
await runAgentsDelete2(agent, options);
|
|
17752
17875
|
});
|
|
17876
|
+
agents.command("clone <source> <target>").description("Clone files (+ brands) from <source> agent onto <target> (accept id, slug, or name)").option("--no-brands", "Skip copying brand assignments (files only)").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(
|
|
17877
|
+
async (source, target, options) => {
|
|
17878
|
+
const { runAgentsClone: runAgentsClone2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17879
|
+
await runAgentsClone2(source, target, options);
|
|
17880
|
+
}
|
|
17881
|
+
);
|
|
17882
|
+
agents.command("enable-template <agent>").description("Apply a template to an agent (template-only; Slack channel binding is set in the UI)").requiredOption("--template <id>", "Template id (e.g. marketing_account_manager)").requiredOption("--brand <id>", "Brand id to scope the template to").option("--emoji <name>", "Slack approval emoji short-name (defaults to the template's)").option("--system-prompt <text>", "Override the template's default system prompt").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(
|
|
17883
|
+
async (agent, options) => {
|
|
17884
|
+
const { runAgentsEnableTemplate: runAgentsEnableTemplate2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17885
|
+
await runAgentsEnableTemplate2(agent, options);
|
|
17886
|
+
}
|
|
17887
|
+
);
|
|
17753
17888
|
agents.command("activate <agent>").description("Activate an agent \u2014 unpause it (or publish a draft). Admin-only.").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 (agent, options) => {
|
|
17754
17889
|
const { runAgentsActivate: runAgentsActivate2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17755
17890
|
await runAgentsActivate2(agent, options);
|