bamboo-agents 0.1.5-dev.55.449e3e1 → 0.1.5-dev.57.9905e44
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 +71 -3
- 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.57.9905e44
|
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.57.9905e44";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -7391,6 +7391,8 @@ __export(agents_exports, {
|
|
|
7391
7391
|
CliCreateAgentRequestSchema: () => CliCreateAgentRequestSchema,
|
|
7392
7392
|
CliCreateAgentResponseSchema: () => CliCreateAgentResponseSchema,
|
|
7393
7393
|
CliDeleteAgentResponseSchema: () => CliDeleteAgentResponseSchema,
|
|
7394
|
+
CliEnableTemplateRequestSchema: () => CliEnableTemplateRequestSchema,
|
|
7395
|
+
CliEnableTemplateResponseSchema: () => CliEnableTemplateResponseSchema,
|
|
7394
7396
|
CliTierCapSchema: () => CliTierCapSchema,
|
|
7395
7397
|
CliUpdateAgentRequestSchema: () => CliUpdateAgentRequestSchema,
|
|
7396
7398
|
CliUpdateAgentResponseSchema: () => CliUpdateAgentResponseSchema,
|
|
@@ -7402,7 +7404,7 @@ __export(agents_exports, {
|
|
|
7402
7404
|
UploadClaudeMdRequestSchema: () => UploadClaudeMdRequestSchema,
|
|
7403
7405
|
UploadClaudeMdResponseSchema: () => UploadClaudeMdResponseSchema
|
|
7404
7406
|
});
|
|
7405
|
-
var SlugSchema, NameSchema, BrandIdSchema, CliAgentRowSchema, CliTierCapSchema, CliAgentsListResponseSchema, CliCreateAgentRequestSchema, CliAgentMutationResponseBase, CliCreateAgentResponseSchema, UPLOAD_MAX_BYTES, CliUploadAgentRequestSchema, CliUploadAgentResponseSchema, CliUpdateAgentRequestSchema, CliUpdateAgentResponseSchema, CliDeleteAgentResponseSchema, CliCloneAgentRequestSchema, CliCloneAgentResponseSchema, 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;
|
|
7406
7408
|
var init_agents = __esm({
|
|
7407
7409
|
"../../src/lib/api-contracts/cli/agents.ts"() {
|
|
7408
7410
|
init_zod();
|
|
@@ -7503,6 +7505,16 @@ var init_agents = __esm({
|
|
|
7503
7505
|
files_total: external_exports.number(),
|
|
7504
7506
|
brands_copied: external_exports.number()
|
|
7505
7507
|
});
|
|
7508
|
+
CliEnableTemplateRequestSchema = external_exports.object({
|
|
7509
|
+
template_id: external_exports.string().min(1),
|
|
7510
|
+
brand_id: external_exports.string().uuid()
|
|
7511
|
+
});
|
|
7512
|
+
CliEnableTemplateResponseSchema = external_exports.object({
|
|
7513
|
+
agent_id: external_exports.string().uuid(),
|
|
7514
|
+
template_id: external_exports.string(),
|
|
7515
|
+
anthropic_agent_id: external_exports.string().nullable(),
|
|
7516
|
+
endpoint_count: external_exports.number()
|
|
7517
|
+
});
|
|
7506
7518
|
CliBrandRowSchema = external_exports.object({
|
|
7507
7519
|
id: external_exports.string().uuid(),
|
|
7508
7520
|
name: external_exports.string()
|
|
@@ -12325,7 +12337,7 @@ var init_brand = __esm({
|
|
|
12325
12337
|
"../../src/lib/api-contracts/cli/brand.ts"() {
|
|
12326
12338
|
init_zod();
|
|
12327
12339
|
BrandUpdateRequestSchema = external_exports.object({
|
|
12328
|
-
website_url: external_exports.string().url().max(2048)
|
|
12340
|
+
website_url: external_exports.union([external_exports.literal(""), external_exports.string().url().max(2048)])
|
|
12329
12341
|
});
|
|
12330
12342
|
BrandUpdateResponseSchema = external_exports.object({
|
|
12331
12343
|
brand_id: external_exports.string(),
|
|
@@ -12717,6 +12729,21 @@ async function cloneCliAgent(bambooSession, body) {
|
|
|
12717
12729
|
if (!res.ok) throw await parseError(res);
|
|
12718
12730
|
return CliCloneAgentResponseSchema.parse(await res.json());
|
|
12719
12731
|
}
|
|
12732
|
+
async function enableTemplateCliAgent(bambooSession, agentId, body) {
|
|
12733
|
+
const res = await cliApiFetch(
|
|
12734
|
+
`${apiBase()}/api/v1/cli/agents/${encodeURIComponent(agentId)}/enable-template`,
|
|
12735
|
+
{
|
|
12736
|
+
method: "POST",
|
|
12737
|
+
headers: {
|
|
12738
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12739
|
+
"Content-Type": "application/json"
|
|
12740
|
+
},
|
|
12741
|
+
body: JSON.stringify(body)
|
|
12742
|
+
}
|
|
12743
|
+
);
|
|
12744
|
+
if (!res.ok) throw await parseError(res);
|
|
12745
|
+
return CliEnableTemplateResponseSchema.parse(await res.json());
|
|
12746
|
+
}
|
|
12720
12747
|
async function publishCliAgent(bambooSession, agentId) {
|
|
12721
12748
|
const res = await cliApiFetch(
|
|
12722
12749
|
`${apiBase()}/api/v1/agents/${encodeURIComponent(agentId)}/provision`,
|
|
@@ -17105,6 +17132,7 @@ __export(agents_exports2, {
|
|
|
17105
17132
|
runAgentsActivate: () => runAgentsActivate,
|
|
17106
17133
|
runAgentsClone: () => runAgentsClone,
|
|
17107
17134
|
runAgentsDelete: () => runAgentsDelete,
|
|
17135
|
+
runAgentsEnableTemplate: () => runAgentsEnableTemplate,
|
|
17108
17136
|
runAgentsGet: () => runAgentsGet,
|
|
17109
17137
|
runAgentsList: () => runAgentsList,
|
|
17110
17138
|
runAgentsPause: () => runAgentsPause,
|
|
@@ -17388,6 +17416,40 @@ async function runAgentsClone(sourceRef, targetRef, options) {
|
|
|
17388
17416
|
);
|
|
17389
17417
|
}
|
|
17390
17418
|
}
|
|
17419
|
+
async function runAgentsEnableTemplate(agentRef, options) {
|
|
17420
|
+
const opts = options;
|
|
17421
|
+
const session = await requireSession8(opts);
|
|
17422
|
+
if (!options.template) {
|
|
17423
|
+
emitError({ code: "template_required", message: "Provide --template <id>." }, opts, 2);
|
|
17424
|
+
return;
|
|
17425
|
+
}
|
|
17426
|
+
if (!options.brand) {
|
|
17427
|
+
emitError({ code: "brand_required", message: "Provide --brand <id>." }, opts, 2);
|
|
17428
|
+
return;
|
|
17429
|
+
}
|
|
17430
|
+
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17431
|
+
const body = {
|
|
17432
|
+
template_id: options.template,
|
|
17433
|
+
brand_id: options.brand
|
|
17434
|
+
};
|
|
17435
|
+
try {
|
|
17436
|
+
const res = await enableTemplateCliAgent(session, row.id, body);
|
|
17437
|
+
emitSuccess(
|
|
17438
|
+
res,
|
|
17439
|
+
opts,
|
|
17440
|
+
() => human(
|
|
17441
|
+
` 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.)`,
|
|
17442
|
+
opts
|
|
17443
|
+
)
|
|
17444
|
+
);
|
|
17445
|
+
} catch (err) {
|
|
17446
|
+
emitError(
|
|
17447
|
+
{ code: "agent_enable_template_failed", message: `couldn't enable template: ${err.message}` },
|
|
17448
|
+
opts,
|
|
17449
|
+
1
|
|
17450
|
+
);
|
|
17451
|
+
}
|
|
17452
|
+
}
|
|
17391
17453
|
async function runAgentsActivate(agentRef, options) {
|
|
17392
17454
|
const opts = options;
|
|
17393
17455
|
const session = await requireSession8(opts);
|
|
@@ -17813,6 +17875,12 @@ agents.command("clone <source> <target>").description("Clone files (+ brands) fr
|
|
|
17813
17875
|
await runAgentsClone2(source, target, options);
|
|
17814
17876
|
}
|
|
17815
17877
|
);
|
|
17878
|
+
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("--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(
|
|
17879
|
+
async (agent, options) => {
|
|
17880
|
+
const { runAgentsEnableTemplate: runAgentsEnableTemplate2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17881
|
+
await runAgentsEnableTemplate2(agent, options);
|
|
17882
|
+
}
|
|
17883
|
+
);
|
|
17816
17884
|
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) => {
|
|
17817
17885
|
const { runAgentsActivate: runAgentsActivate2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17818
17886
|
await runAgentsActivate2(agent, options);
|