bamboo-agents 0.1.5-dev.52.cc9d1f5 → 0.1.5-dev.54.477c24e
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 +111 -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.54.477c24e
|
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.54.477c24e";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -7388,7 +7388,10 @@ __export(agents_exports, {
|
|
|
7388
7388
|
CliBrandsListResponseSchema: () => CliBrandsListResponseSchema,
|
|
7389
7389
|
CliCreateAgentRequestSchema: () => CliCreateAgentRequestSchema,
|
|
7390
7390
|
CliCreateAgentResponseSchema: () => CliCreateAgentResponseSchema,
|
|
7391
|
+
CliDeleteAgentResponseSchema: () => CliDeleteAgentResponseSchema,
|
|
7391
7392
|
CliTierCapSchema: () => CliTierCapSchema,
|
|
7393
|
+
CliUpdateAgentRequestSchema: () => CliUpdateAgentRequestSchema,
|
|
7394
|
+
CliUpdateAgentResponseSchema: () => CliUpdateAgentResponseSchema,
|
|
7392
7395
|
CliUploadAgentRequestSchema: () => CliUploadAgentRequestSchema,
|
|
7393
7396
|
CliUploadAgentResponseSchema: () => CliUploadAgentResponseSchema,
|
|
7394
7397
|
CreateFromCliRequestSchema: () => CreateFromCliRequestSchema,
|
|
@@ -7397,7 +7400,7 @@ __export(agents_exports, {
|
|
|
7397
7400
|
UploadClaudeMdRequestSchema: () => UploadClaudeMdRequestSchema,
|
|
7398
7401
|
UploadClaudeMdResponseSchema: () => UploadClaudeMdResponseSchema
|
|
7399
7402
|
});
|
|
7400
|
-
var SlugSchema, NameSchema, BrandIdSchema, CliAgentRowSchema, CliTierCapSchema, CliAgentsListResponseSchema, CliCreateAgentRequestSchema, CliAgentMutationResponseBase, CliCreateAgentResponseSchema, UPLOAD_MAX_BYTES, CliUploadAgentRequestSchema, CliUploadAgentResponseSchema, CliBrandRowSchema, CliBrandsListResponseSchema, CliAgentLifecycleStateSchema, CliAgentDetailSchema, CliAgentGetResponseSchema, CliAgentPauseResponseSchema, CliAgentPublishResponseSchema, CreateFromCliRequestSchema, CreateFromCliResponseSchema, UploadClaudeMdRequestSchema, UploadClaudeMdResponseSchema;
|
|
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;
|
|
7401
7404
|
var init_agents = __esm({
|
|
7402
7405
|
"../../src/lib/api-contracts/cli/agents.ts"() {
|
|
7403
7406
|
init_zod();
|
|
@@ -7468,6 +7471,23 @@ var init_agents = __esm({
|
|
|
7468
7471
|
claude_md_content: external_exports.string().min(1)
|
|
7469
7472
|
});
|
|
7470
7473
|
CliUploadAgentResponseSchema = CliAgentMutationResponseBase;
|
|
7474
|
+
CliUpdateAgentRequestSchema = external_exports.object({
|
|
7475
|
+
name: NameSchema.optional(),
|
|
7476
|
+
description: external_exports.string().max(2e3).optional(),
|
|
7477
|
+
template_key: external_exports.string().min(1).max(128).optional(),
|
|
7478
|
+
brand_id: BrandIdSchema.optional()
|
|
7479
|
+
}).refine(
|
|
7480
|
+
(d) => d.name !== void 0 || d.description !== void 0 || d.template_key !== void 0 || d.brand_id !== void 0,
|
|
7481
|
+
{ message: "Provide at least one field to update (name, description, template_key, brand_id)" }
|
|
7482
|
+
);
|
|
7483
|
+
CliUpdateAgentResponseSchema = external_exports.object({
|
|
7484
|
+
agent_id: external_exports.string().uuid(),
|
|
7485
|
+
status: external_exports.string().nullable()
|
|
7486
|
+
});
|
|
7487
|
+
CliDeleteAgentResponseSchema = external_exports.object({
|
|
7488
|
+
agent_id: external_exports.string().uuid(),
|
|
7489
|
+
pr_number: external_exports.number().nullable()
|
|
7490
|
+
});
|
|
7471
7491
|
CliBrandRowSchema = external_exports.object({
|
|
7472
7492
|
id: external_exports.string().uuid(),
|
|
7473
7493
|
name: external_exports.string()
|
|
@@ -12647,6 +12667,29 @@ async function unpauseCliAgent(bambooSession, agentId) {
|
|
|
12647
12667
|
const json = await res.json();
|
|
12648
12668
|
return CliAgentPauseResponseSchema.parse(json.data);
|
|
12649
12669
|
}
|
|
12670
|
+
async function updateCliAgent(bambooSession, agentId, body) {
|
|
12671
|
+
const res = await cliApiFetch(
|
|
12672
|
+
`${apiBase()}/api/v1/cli/agents/${encodeURIComponent(agentId)}`,
|
|
12673
|
+
{
|
|
12674
|
+
method: "PATCH",
|
|
12675
|
+
headers: {
|
|
12676
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12677
|
+
"Content-Type": "application/json"
|
|
12678
|
+
},
|
|
12679
|
+
body: JSON.stringify(body)
|
|
12680
|
+
}
|
|
12681
|
+
);
|
|
12682
|
+
if (!res.ok) throw await parseError(res);
|
|
12683
|
+
return CliUpdateAgentResponseSchema.parse(await res.json());
|
|
12684
|
+
}
|
|
12685
|
+
async function deleteCliAgent(bambooSession, agentId) {
|
|
12686
|
+
const res = await cliApiFetch(
|
|
12687
|
+
`${apiBase()}/api/v1/cli/agents/${encodeURIComponent(agentId)}`,
|
|
12688
|
+
{ method: "DELETE", headers: { Authorization: `Bearer ${bambooSession}` } }
|
|
12689
|
+
);
|
|
12690
|
+
if (!res.ok) throw await parseError(res);
|
|
12691
|
+
return CliDeleteAgentResponseSchema.parse(await res.json());
|
|
12692
|
+
}
|
|
12650
12693
|
async function publishCliAgent(bambooSession, agentId) {
|
|
12651
12694
|
const res = await cliApiFetch(
|
|
12652
12695
|
`${apiBase()}/api/v1/agents/${encodeURIComponent(agentId)}/provision`,
|
|
@@ -17033,10 +17076,12 @@ var init_brand2 = __esm({
|
|
|
17033
17076
|
var agents_exports2 = {};
|
|
17034
17077
|
__export(agents_exports2, {
|
|
17035
17078
|
runAgentsActivate: () => runAgentsActivate,
|
|
17079
|
+
runAgentsDelete: () => runAgentsDelete,
|
|
17036
17080
|
runAgentsGet: () => runAgentsGet,
|
|
17037
17081
|
runAgentsList: () => runAgentsList,
|
|
17038
17082
|
runAgentsPause: () => runAgentsPause,
|
|
17039
|
-
runAgentsProvision: () => runAgentsProvision
|
|
17083
|
+
runAgentsProvision: () => runAgentsProvision,
|
|
17084
|
+
runAgentsUpdate: () => runAgentsUpdate
|
|
17040
17085
|
});
|
|
17041
17086
|
async function requireSession8(opts) {
|
|
17042
17087
|
const creds = await readCredentials();
|
|
@@ -17233,6 +17278,59 @@ async function runAgentsPause(agentRef, options) {
|
|
|
17233
17278
|
);
|
|
17234
17279
|
}
|
|
17235
17280
|
}
|
|
17281
|
+
async function runAgentsUpdate(agentRef, options) {
|
|
17282
|
+
const opts = options;
|
|
17283
|
+
const session = await requireSession8(opts);
|
|
17284
|
+
const body = {};
|
|
17285
|
+
if (options.name !== void 0) body.name = options.name;
|
|
17286
|
+
if (options.description !== void 0) body.description = options.description;
|
|
17287
|
+
if (options.template !== void 0) body.template_key = options.template;
|
|
17288
|
+
if (options.brand !== void 0) body.brand_id = options.brand;
|
|
17289
|
+
if (Object.keys(body).length === 0) {
|
|
17290
|
+
emitError(
|
|
17291
|
+
{
|
|
17292
|
+
code: "nothing_to_update",
|
|
17293
|
+
message: "Provide at least one of --name, --description, --template, --brand."
|
|
17294
|
+
},
|
|
17295
|
+
opts,
|
|
17296
|
+
2
|
|
17297
|
+
);
|
|
17298
|
+
return;
|
|
17299
|
+
}
|
|
17300
|
+
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17301
|
+
try {
|
|
17302
|
+
const res = await updateCliAgent(session, row.id, body);
|
|
17303
|
+
emitSuccess(res, opts, () => human(` Updated ${row.name} (${row.id}).`, opts));
|
|
17304
|
+
} catch (err) {
|
|
17305
|
+
emitError(
|
|
17306
|
+
{ code: "agent_update_failed", message: `couldn't update agent: ${err.message}` },
|
|
17307
|
+
opts,
|
|
17308
|
+
1
|
|
17309
|
+
);
|
|
17310
|
+
}
|
|
17311
|
+
}
|
|
17312
|
+
async function runAgentsDelete(agentRef, options) {
|
|
17313
|
+
const opts = options;
|
|
17314
|
+
const session = await requireSession8(opts);
|
|
17315
|
+
const row = await resolveAgentRef(session, agentRef, opts);
|
|
17316
|
+
try {
|
|
17317
|
+
const res = await deleteCliAgent(session, row.id);
|
|
17318
|
+
emitSuccess(
|
|
17319
|
+
res,
|
|
17320
|
+
opts,
|
|
17321
|
+
() => human(
|
|
17322
|
+
` Deleted ${row.name} (${row.id}).${res.pr_number ? ` Tombstone PR #${res.pr_number}.` : ""}`,
|
|
17323
|
+
opts
|
|
17324
|
+
)
|
|
17325
|
+
);
|
|
17326
|
+
} catch (err) {
|
|
17327
|
+
emitError(
|
|
17328
|
+
{ code: "agent_delete_failed", message: `couldn't delete agent: ${err.message}` },
|
|
17329
|
+
opts,
|
|
17330
|
+
1
|
|
17331
|
+
);
|
|
17332
|
+
}
|
|
17333
|
+
}
|
|
17236
17334
|
async function runAgentsActivate(agentRef, options) {
|
|
17237
17335
|
const opts = options;
|
|
17238
17336
|
const session = await requireSession8(opts);
|
|
@@ -17642,6 +17740,16 @@ agents.command("provision <name>").description("Create a new agent (immediately
|
|
|
17642
17740
|
await runAgentsProvision2(name, options);
|
|
17643
17741
|
}
|
|
17644
17742
|
);
|
|
17743
|
+
agents.command("update <agent>").description("Update an agent's name / description / template / brand (accepts id, slug, or name)").option("--name <name>", "New agent name").option("--description <text>", "New description").option("--template <key>", "Template key").option("--brand <id>", "Reassign to this brand (replaces the current assignment)").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(
|
|
17744
|
+
async (agent, options) => {
|
|
17745
|
+
const { runAgentsUpdate: runAgentsUpdate2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17746
|
+
await runAgentsUpdate2(agent, options);
|
|
17747
|
+
}
|
|
17748
|
+
);
|
|
17749
|
+
agents.command("delete <agent>").description("Delete a draft/broken agent (accepts id, slug, or name) \u2014 NOT reversible").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) => {
|
|
17750
|
+
const { runAgentsDelete: runAgentsDelete2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17751
|
+
await runAgentsDelete2(agent, options);
|
|
17752
|
+
});
|
|
17645
17753
|
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) => {
|
|
17646
17754
|
const { runAgentsActivate: runAgentsActivate2 } = await Promise.resolve().then(() => (init_agents2(), agents_exports2));
|
|
17647
17755
|
await runAgentsActivate2(agent, options);
|