bamboo-agents 0.1.5-dev.40.51dbc4d → 0.1.5-dev.41.aa82457
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 +481 -1
- 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.41.aa82457
|
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.41.aa82457";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -11980,6 +11980,135 @@ var init_agents = __esm({
|
|
|
11980
11980
|
}
|
|
11981
11981
|
});
|
|
11982
11982
|
|
|
11983
|
+
// ../../src/lib/api-contracts/cli/knowledge-slots.ts
|
|
11984
|
+
var KnowledgeSlotKindSchema, KnowledgeDimensionSchema, KnowledgeSlotsResponseSchema;
|
|
11985
|
+
var init_knowledge_slots = __esm({
|
|
11986
|
+
"../../src/lib/api-contracts/cli/knowledge-slots.ts"() {
|
|
11987
|
+
init_zod();
|
|
11988
|
+
KnowledgeSlotKindSchema = external_exports.object({
|
|
11989
|
+
/** Directory taxonomy: knowledge | memory | context | skills | scheduled_tasks | instructions | identity */
|
|
11990
|
+
kind: external_exports.string(),
|
|
11991
|
+
/** Scope this kind may be written at. */
|
|
11992
|
+
scope: external_exports.enum(["org", "brand", "agent"]),
|
|
11993
|
+
/**
|
|
11994
|
+
* Example workspace-relative path, derived from the server's
|
|
11995
|
+
* `resolveRepoPathByKind`. Uses `{brand}` / `{agent}` placeholders the
|
|
11996
|
+
* skill substitutes from its workspace config. `example.md` stands in
|
|
11997
|
+
* for the caller-chosen filename.
|
|
11998
|
+
*/
|
|
11999
|
+
example_path: external_exports.string(),
|
|
12000
|
+
/**
|
|
12001
|
+
* True when the filename is pinned by the server (instructions/identity)
|
|
12002
|
+
* and the caller's filename is ignored.
|
|
12003
|
+
*/
|
|
12004
|
+
filename_pinned: external_exports.boolean()
|
|
12005
|
+
});
|
|
12006
|
+
KnowledgeDimensionSchema = external_exports.object({
|
|
12007
|
+
key: external_exports.string(),
|
|
12008
|
+
label: external_exports.string(),
|
|
12009
|
+
tags: external_exports.array(external_exports.string())
|
|
12010
|
+
});
|
|
12011
|
+
KnowledgeSlotsResponseSchema = external_exports.object({
|
|
12012
|
+
/** Spec §3 filename regex (source string) the skill validates against before writing. */
|
|
12013
|
+
filename_regex: external_exports.string(),
|
|
12014
|
+
/** Every (kind × allowed-scope) with its canonical path pattern. */
|
|
12015
|
+
kinds: external_exports.array(KnowledgeSlotKindSchema),
|
|
12016
|
+
/** The knowledge dimensions, for metadata tagging. */
|
|
12017
|
+
dimensions: external_exports.array(KnowledgeDimensionSchema)
|
|
12018
|
+
});
|
|
12019
|
+
}
|
|
12020
|
+
});
|
|
12021
|
+
|
|
12022
|
+
// ../../src/lib/api-contracts/cli/knowledge-save.ts
|
|
12023
|
+
var KnowledgeSaveRequestSchema, KnowledgeSaveResponseSchema;
|
|
12024
|
+
var init_knowledge_save = __esm({
|
|
12025
|
+
"../../src/lib/api-contracts/cli/knowledge-save.ts"() {
|
|
12026
|
+
init_zod();
|
|
12027
|
+
KnowledgeSaveRequestSchema = external_exports.object({
|
|
12028
|
+
/** Canonical repo path, e.g. `brands/acme/knowledge/competitors.md`. Derived by the caller from `knowledge slots`. */
|
|
12029
|
+
path: external_exports.string().min(1).max(512),
|
|
12030
|
+
/** UTF-8 file content. Ignored when `delete` is true. */
|
|
12031
|
+
content: external_exports.string(),
|
|
12032
|
+
/** Emit as a git-level deletion instead of a content write. */
|
|
12033
|
+
delete: external_exports.boolean().optional(),
|
|
12034
|
+
/** Human-readable summary surfaced in the PR body / commit trailer. */
|
|
12035
|
+
intent: external_exports.string().max(500).optional()
|
|
12036
|
+
});
|
|
12037
|
+
KnowledgeSaveResponseSchema = external_exports.object({
|
|
12038
|
+
/** Routing outcome from `executeKnowledgeWrite`. */
|
|
12039
|
+
routed: external_exports.enum(["auto", "queued", "submitted", "rejected", "noop"]),
|
|
12040
|
+
classification: external_exports.enum(["self_only", "cross_scope", "forbidden"]),
|
|
12041
|
+
/** Present when a PR was opened (queued/submitted, or auto via queue-PR). */
|
|
12042
|
+
pr_url: external_exports.string().optional(),
|
|
12043
|
+
pr_number: external_exports.number().optional(),
|
|
12044
|
+
/** Present on `rejected` / `noop` — short machine-friendly reason. */
|
|
12045
|
+
reason: external_exports.string().optional()
|
|
12046
|
+
});
|
|
12047
|
+
}
|
|
12048
|
+
});
|
|
12049
|
+
|
|
12050
|
+
// ../../src/lib/api-contracts/cli/history.ts
|
|
12051
|
+
var HistoryEntrySchema, HistoryResponseSchema;
|
|
12052
|
+
var init_history = __esm({
|
|
12053
|
+
"../../src/lib/api-contracts/cli/history.ts"() {
|
|
12054
|
+
init_zod();
|
|
12055
|
+
HistoryEntrySchema = external_exports.object({
|
|
12056
|
+
tool_name: external_exports.string().nullable(),
|
|
12057
|
+
status: external_exports.string(),
|
|
12058
|
+
timestamp: external_exports.string(),
|
|
12059
|
+
duration_ms: external_exports.number().nullable()
|
|
12060
|
+
});
|
|
12061
|
+
HistoryResponseSchema = external_exports.object({
|
|
12062
|
+
entries: external_exports.array(HistoryEntrySchema),
|
|
12063
|
+
count: external_exports.number()
|
|
12064
|
+
});
|
|
12065
|
+
}
|
|
12066
|
+
});
|
|
12067
|
+
|
|
12068
|
+
// ../../src/lib/api-contracts/cli/changes.ts
|
|
12069
|
+
var ChangeEntrySchema, ChangesResponseSchema;
|
|
12070
|
+
var init_changes = __esm({
|
|
12071
|
+
"../../src/lib/api-contracts/cli/changes.ts"() {
|
|
12072
|
+
init_zod();
|
|
12073
|
+
ChangeEntrySchema = external_exports.object({
|
|
12074
|
+
id: external_exports.string(),
|
|
12075
|
+
tool_name: external_exports.string().nullable(),
|
|
12076
|
+
action: external_exports.string().nullable(),
|
|
12077
|
+
entity_type: external_exports.string().nullable(),
|
|
12078
|
+
entity_id: external_exports.string().nullable(),
|
|
12079
|
+
entity_name: external_exports.string().nullable(),
|
|
12080
|
+
agent: external_exports.string().nullable(),
|
|
12081
|
+
brand_id: external_exports.string().nullable(),
|
|
12082
|
+
timestamp: external_exports.string()
|
|
12083
|
+
});
|
|
12084
|
+
ChangesResponseSchema = external_exports.object({
|
|
12085
|
+
entries: external_exports.array(ChangeEntrySchema),
|
|
12086
|
+
count: external_exports.number()
|
|
12087
|
+
});
|
|
12088
|
+
}
|
|
12089
|
+
});
|
|
12090
|
+
|
|
12091
|
+
// ../../src/lib/api-contracts/cli/onboarding-status.ts
|
|
12092
|
+
var OnboardingStatusResponseSchema;
|
|
12093
|
+
var init_onboarding_status = __esm({
|
|
12094
|
+
"../../src/lib/api-contracts/cli/onboarding-status.ts"() {
|
|
12095
|
+
init_zod();
|
|
12096
|
+
OnboardingStatusResponseSchema = external_exports.object({
|
|
12097
|
+
composite_gate: external_exports.object({
|
|
12098
|
+
passed: external_exports.boolean(),
|
|
12099
|
+
knowledge_ok: external_exports.boolean(),
|
|
12100
|
+
activation_ok: external_exports.boolean()
|
|
12101
|
+
}),
|
|
12102
|
+
health: external_exports.object({
|
|
12103
|
+
grade: external_exports.enum(["A", "B", "C", "D", "F"]).nullable(),
|
|
12104
|
+
score: external_exports.number().nullable()
|
|
12105
|
+
}),
|
|
12106
|
+
/** Raw `compute_onboarding_status` payload (shape owned by the RPC). */
|
|
12107
|
+
milestones: external_exports.unknown().nullable()
|
|
12108
|
+
});
|
|
12109
|
+
}
|
|
12110
|
+
});
|
|
12111
|
+
|
|
11983
12112
|
// src/lib/api.ts
|
|
11984
12113
|
import { platform as platform2 } from "node:os";
|
|
11985
12114
|
function defaultApiBase(version) {
|
|
@@ -12036,6 +12165,57 @@ async function getCliBillingStatus(bambooSession) {
|
|
|
12036
12165
|
const json = await res.json();
|
|
12037
12166
|
return BillingStatusResponseSchema.parse(json);
|
|
12038
12167
|
}
|
|
12168
|
+
async function getKnowledgeSlots(bambooSession) {
|
|
12169
|
+
const res = await cliApiFetch(`${apiBase()}/api/v1/cli/knowledge/slots`, {
|
|
12170
|
+
headers: { Authorization: `Bearer ${bambooSession}` }
|
|
12171
|
+
});
|
|
12172
|
+
if (!res.ok) throw await parseError(res);
|
|
12173
|
+
const json = await res.json();
|
|
12174
|
+
return KnowledgeSlotsResponseSchema.parse(json);
|
|
12175
|
+
}
|
|
12176
|
+
async function saveKnowledge(bambooSession, body) {
|
|
12177
|
+
const res = await cliApiFetch(`${apiBase()}/api/v1/cli/knowledge/save`, {
|
|
12178
|
+
method: "POST",
|
|
12179
|
+
headers: {
|
|
12180
|
+
Authorization: `Bearer ${bambooSession}`,
|
|
12181
|
+
"Content-Type": "application/json"
|
|
12182
|
+
},
|
|
12183
|
+
body: JSON.stringify(body)
|
|
12184
|
+
});
|
|
12185
|
+
if (!res.ok) throw await parseError(res);
|
|
12186
|
+
const json = await res.json();
|
|
12187
|
+
return KnowledgeSaveResponseSchema.parse(json);
|
|
12188
|
+
}
|
|
12189
|
+
async function getHistory(bambooSession, opts = {}) {
|
|
12190
|
+
const url = new URL(`${apiBase()}/api/v1/cli/history`);
|
|
12191
|
+
if (opts.limit) url.searchParams.set("limit", String(opts.limit));
|
|
12192
|
+
const res = await cliApiFetch(url.toString(), {
|
|
12193
|
+
headers: { Authorization: `Bearer ${bambooSession}` }
|
|
12194
|
+
});
|
|
12195
|
+
if (!res.ok) throw await parseError(res);
|
|
12196
|
+
return HistoryResponseSchema.parse(await res.json());
|
|
12197
|
+
}
|
|
12198
|
+
async function getChanges(bambooSession, opts = {}) {
|
|
12199
|
+
const url = new URL(`${apiBase()}/api/v1/cli/changes`);
|
|
12200
|
+
if (opts.limit) url.searchParams.set("limit", String(opts.limit));
|
|
12201
|
+
if (opts.brandId) url.searchParams.set("brand_id", opts.brandId);
|
|
12202
|
+
if (opts.since) url.searchParams.set("since", opts.since);
|
|
12203
|
+
if (opts.entityType) url.searchParams.set("entity_type", opts.entityType);
|
|
12204
|
+
const res = await cliApiFetch(url.toString(), {
|
|
12205
|
+
headers: { Authorization: `Bearer ${bambooSession}` }
|
|
12206
|
+
});
|
|
12207
|
+
if (!res.ok) throw await parseError(res);
|
|
12208
|
+
return ChangesResponseSchema.parse(await res.json());
|
|
12209
|
+
}
|
|
12210
|
+
async function getOnboardingStatus(bambooSession, opts = {}) {
|
|
12211
|
+
const url = new URL(`${apiBase()}/api/v1/cli/onboarding/status`);
|
|
12212
|
+
if (opts.brandId) url.searchParams.set("brand_id", opts.brandId);
|
|
12213
|
+
const res = await cliApiFetch(url.toString(), {
|
|
12214
|
+
headers: { Authorization: `Bearer ${bambooSession}` }
|
|
12215
|
+
});
|
|
12216
|
+
if (!res.ok) throw await parseError(res);
|
|
12217
|
+
return OnboardingStatusResponseSchema.parse(await res.json());
|
|
12218
|
+
}
|
|
12039
12219
|
async function startGithubOAuthRelink(bambooSession) {
|
|
12040
12220
|
const res = await cliApiFetch(
|
|
12041
12221
|
`${apiBase()}/api/auth/github/oauth-relink/start`,
|
|
@@ -12225,6 +12405,11 @@ var init_api = __esm({
|
|
|
12225
12405
|
init_agent_health();
|
|
12226
12406
|
init_onboarding_next_prompt();
|
|
12227
12407
|
init_agents();
|
|
12408
|
+
init_knowledge_slots();
|
|
12409
|
+
init_knowledge_save();
|
|
12410
|
+
init_history();
|
|
12411
|
+
init_changes();
|
|
12412
|
+
init_onboarding_status();
|
|
12228
12413
|
init_version();
|
|
12229
12414
|
PROD_DEFAULT_BASE = "https://withbamboo.com";
|
|
12230
12415
|
DEV_DEFAULT_BASE = "https://dev.withbamboo.com";
|
|
@@ -15483,6 +15668,277 @@ var init_skills = __esm({
|
|
|
15483
15668
|
}
|
|
15484
15669
|
});
|
|
15485
15670
|
|
|
15671
|
+
// src/commands/knowledge.ts
|
|
15672
|
+
var knowledge_exports = {};
|
|
15673
|
+
__export(knowledge_exports, {
|
|
15674
|
+
runKnowledgeSave: () => runKnowledgeSave,
|
|
15675
|
+
runKnowledgeSlots: () => runKnowledgeSlots
|
|
15676
|
+
});
|
|
15677
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
15678
|
+
async function requireSession2() {
|
|
15679
|
+
const creds = await readCredentials();
|
|
15680
|
+
if (!creds) {
|
|
15681
|
+
console.error("bamboo-agents: not signed in. Run `bamboo-agents login` first.");
|
|
15682
|
+
process.exit(1);
|
|
15683
|
+
}
|
|
15684
|
+
return creds.bamboo_session;
|
|
15685
|
+
}
|
|
15686
|
+
function padRight2(s, n) {
|
|
15687
|
+
return s.length >= n ? s : s + " ".repeat(n - s.length);
|
|
15688
|
+
}
|
|
15689
|
+
function printHuman(data) {
|
|
15690
|
+
console.log("");
|
|
15691
|
+
console.log(" Knowledge slots \u2014 where a file belongs in the workspace repo:");
|
|
15692
|
+
console.log("");
|
|
15693
|
+
const kindW = Math.max(4, ...data.kinds.map((k) => k.kind.length));
|
|
15694
|
+
const scopeW = Math.max(5, ...data.kinds.map((k) => k.scope.length));
|
|
15695
|
+
console.log(
|
|
15696
|
+
` ${padRight2("KIND", kindW)} ${padRight2("SCOPE", scopeW)} PATH`
|
|
15697
|
+
);
|
|
15698
|
+
for (const k of data.kinds) {
|
|
15699
|
+
const pinned = k.filename_pinned ? " (filename pinned)" : "";
|
|
15700
|
+
console.log(
|
|
15701
|
+
` ${padRight2(k.kind, kindW)} ${padRight2(k.scope, scopeW)} ${k.example_path}${pinned}`
|
|
15702
|
+
);
|
|
15703
|
+
}
|
|
15704
|
+
console.log("");
|
|
15705
|
+
console.log(` Filename rule: ${data.filename_regex}`);
|
|
15706
|
+
console.log("");
|
|
15707
|
+
console.log(" Dimensions (tag freshly-written files with these):");
|
|
15708
|
+
const keyW = Math.max(3, ...data.dimensions.map((d) => d.key.length));
|
|
15709
|
+
for (const d of data.dimensions) {
|
|
15710
|
+
console.log(` ${padRight2(d.key, keyW)} ${d.label} [${d.tags.join(", ")}]`);
|
|
15711
|
+
}
|
|
15712
|
+
console.log("");
|
|
15713
|
+
console.log(" Substitute {brand} / {agent} with your workspace slugs, then write");
|
|
15714
|
+
console.log(" the file natively and push a branch \u2014 routeWrite merges or queues it.");
|
|
15715
|
+
console.log("");
|
|
15716
|
+
}
|
|
15717
|
+
async function runKnowledgeSlots(options) {
|
|
15718
|
+
const session = await requireSession2();
|
|
15719
|
+
let data;
|
|
15720
|
+
try {
|
|
15721
|
+
data = await getKnowledgeSlots(session);
|
|
15722
|
+
} catch (err) {
|
|
15723
|
+
console.error(`bamboo-agents: couldn't load knowledge slots: ${err.message}`);
|
|
15724
|
+
process.exit(1);
|
|
15725
|
+
}
|
|
15726
|
+
if (options.json) {
|
|
15727
|
+
console.log(JSON.stringify(data, null, 2));
|
|
15728
|
+
return;
|
|
15729
|
+
}
|
|
15730
|
+
printHuman(data);
|
|
15731
|
+
}
|
|
15732
|
+
async function resolveContent(options) {
|
|
15733
|
+
if (options.contentFile) {
|
|
15734
|
+
return readFile5(options.contentFile, "utf8");
|
|
15735
|
+
}
|
|
15736
|
+
if (typeof options.content === "string") {
|
|
15737
|
+
return options.content;
|
|
15738
|
+
}
|
|
15739
|
+
if (!process.stdin.isTTY) {
|
|
15740
|
+
const chunks = [];
|
|
15741
|
+
for await (const chunk of process.stdin) {
|
|
15742
|
+
chunks.push(chunk);
|
|
15743
|
+
}
|
|
15744
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
15745
|
+
}
|
|
15746
|
+
return "";
|
|
15747
|
+
}
|
|
15748
|
+
async function runKnowledgeSave(options) {
|
|
15749
|
+
const session = await requireSession2();
|
|
15750
|
+
if (!options.path) {
|
|
15751
|
+
console.error("bamboo-agents: knowledge save requires --path.");
|
|
15752
|
+
console.error("Tip: run `bamboo-agents knowledge slots` to find the right path.");
|
|
15753
|
+
process.exit(1);
|
|
15754
|
+
}
|
|
15755
|
+
const isDelete = options.delete === true;
|
|
15756
|
+
const content = isDelete ? "" : await resolveContent(options);
|
|
15757
|
+
if (!isDelete && content.length === 0) {
|
|
15758
|
+
console.error(
|
|
15759
|
+
"bamboo-agents: no content. Pass --content, --content-file <path>, or pipe via stdin."
|
|
15760
|
+
);
|
|
15761
|
+
process.exit(1);
|
|
15762
|
+
}
|
|
15763
|
+
let result;
|
|
15764
|
+
try {
|
|
15765
|
+
result = await saveKnowledge(session, {
|
|
15766
|
+
path: options.path,
|
|
15767
|
+
content,
|
|
15768
|
+
delete: isDelete || void 0,
|
|
15769
|
+
intent: options.intent
|
|
15770
|
+
});
|
|
15771
|
+
} catch (err) {
|
|
15772
|
+
console.error(`bamboo-agents: save failed: ${err.message}`);
|
|
15773
|
+
process.exit(1);
|
|
15774
|
+
}
|
|
15775
|
+
if (options.json) {
|
|
15776
|
+
console.log(JSON.stringify(result, null, 2));
|
|
15777
|
+
return;
|
|
15778
|
+
}
|
|
15779
|
+
switch (result.routed) {
|
|
15780
|
+
case "auto":
|
|
15781
|
+
console.log(` \u2713 Saved \u2014 auto-merged to main (${options.path})`);
|
|
15782
|
+
break;
|
|
15783
|
+
case "queued":
|
|
15784
|
+
case "submitted":
|
|
15785
|
+
console.log(
|
|
15786
|
+
` \u2713 Queued for review (${options.path})` + (result.pr_url ? `
|
|
15787
|
+
${result.pr_url}` : "")
|
|
15788
|
+
);
|
|
15789
|
+
break;
|
|
15790
|
+
case "noop":
|
|
15791
|
+
console.log(` \u2022 Nothing to do${result.reason ? ` (${result.reason})` : ""}.`);
|
|
15792
|
+
break;
|
|
15793
|
+
case "rejected":
|
|
15794
|
+
console.error(` \u2717 Rejected${result.reason ? `: ${result.reason}` : ""}.`);
|
|
15795
|
+
process.exit(1);
|
|
15796
|
+
}
|
|
15797
|
+
}
|
|
15798
|
+
var init_knowledge = __esm({
|
|
15799
|
+
"src/commands/knowledge.ts"() {
|
|
15800
|
+
"use strict";
|
|
15801
|
+
init_credentials();
|
|
15802
|
+
init_api();
|
|
15803
|
+
}
|
|
15804
|
+
});
|
|
15805
|
+
|
|
15806
|
+
// src/commands/history.ts
|
|
15807
|
+
var history_exports = {};
|
|
15808
|
+
__export(history_exports, {
|
|
15809
|
+
runChanges: () => runChanges,
|
|
15810
|
+
runHistory: () => runHistory
|
|
15811
|
+
});
|
|
15812
|
+
async function requireSession3() {
|
|
15813
|
+
const creds = await readCredentials();
|
|
15814
|
+
if (!creds) {
|
|
15815
|
+
console.error("bamboo-agents: not signed in. Run `bamboo-agents login` first.");
|
|
15816
|
+
process.exit(1);
|
|
15817
|
+
}
|
|
15818
|
+
return creds.bamboo_session;
|
|
15819
|
+
}
|
|
15820
|
+
function parseLimit(raw) {
|
|
15821
|
+
if (raw === void 0) return void 0;
|
|
15822
|
+
const n = Number(raw);
|
|
15823
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : void 0;
|
|
15824
|
+
}
|
|
15825
|
+
function padRight3(s, n) {
|
|
15826
|
+
return s.length >= n ? s : s + " ".repeat(n - s.length);
|
|
15827
|
+
}
|
|
15828
|
+
function printHistory(data) {
|
|
15829
|
+
if (data.entries.length === 0) {
|
|
15830
|
+
console.log(" No recent actions.");
|
|
15831
|
+
return;
|
|
15832
|
+
}
|
|
15833
|
+
const nameW = Math.max(4, ...data.entries.map((e) => (e.tool_name ?? "\u2014").length));
|
|
15834
|
+
for (const e of data.entries) {
|
|
15835
|
+
const dur = e.duration_ms != null ? `${e.duration_ms}ms` : "";
|
|
15836
|
+
console.log(
|
|
15837
|
+
` ${padRight3(e.tool_name ?? "\u2014", nameW)} ${padRight3(e.status, 10)} ${e.timestamp} ${dur}`
|
|
15838
|
+
);
|
|
15839
|
+
}
|
|
15840
|
+
console.log(` ${data.count} action${data.count === 1 ? "" : "s"}.`);
|
|
15841
|
+
}
|
|
15842
|
+
async function runHistory(options) {
|
|
15843
|
+
const session = await requireSession3();
|
|
15844
|
+
let data;
|
|
15845
|
+
try {
|
|
15846
|
+
data = await getHistory(session, { limit: parseLimit(options.limit) });
|
|
15847
|
+
} catch (err) {
|
|
15848
|
+
console.error(`bamboo-agents: couldn't load history: ${err.message}`);
|
|
15849
|
+
process.exit(1);
|
|
15850
|
+
}
|
|
15851
|
+
if (options.json) {
|
|
15852
|
+
console.log(JSON.stringify(data, null, 2));
|
|
15853
|
+
return;
|
|
15854
|
+
}
|
|
15855
|
+
printHistory(data);
|
|
15856
|
+
}
|
|
15857
|
+
function printChanges(data) {
|
|
15858
|
+
if (data.entries.length === 0) {
|
|
15859
|
+
console.log(" No changes.");
|
|
15860
|
+
return;
|
|
15861
|
+
}
|
|
15862
|
+
for (const e of data.entries) {
|
|
15863
|
+
const what = [e.action, e.entity_type, e.entity_name].filter(Boolean).join(" ");
|
|
15864
|
+
console.log(` ${e.timestamp} ${what || e.tool_name || "\u2014"}`);
|
|
15865
|
+
}
|
|
15866
|
+
console.log(` ${data.count} change${data.count === 1 ? "" : "s"}.`);
|
|
15867
|
+
}
|
|
15868
|
+
async function runChanges(options) {
|
|
15869
|
+
const session = await requireSession3();
|
|
15870
|
+
let data;
|
|
15871
|
+
try {
|
|
15872
|
+
data = await getChanges(session, {
|
|
15873
|
+
limit: parseLimit(options.limit),
|
|
15874
|
+
brandId: options.brand,
|
|
15875
|
+
since: options.since,
|
|
15876
|
+
entityType: options.entityType
|
|
15877
|
+
});
|
|
15878
|
+
} catch (err) {
|
|
15879
|
+
console.error(`bamboo-agents: couldn't load changes: ${err.message}`);
|
|
15880
|
+
process.exit(1);
|
|
15881
|
+
}
|
|
15882
|
+
if (options.json) {
|
|
15883
|
+
console.log(JSON.stringify(data, null, 2));
|
|
15884
|
+
return;
|
|
15885
|
+
}
|
|
15886
|
+
printChanges(data);
|
|
15887
|
+
}
|
|
15888
|
+
var init_history2 = __esm({
|
|
15889
|
+
"src/commands/history.ts"() {
|
|
15890
|
+
"use strict";
|
|
15891
|
+
init_credentials();
|
|
15892
|
+
init_api();
|
|
15893
|
+
}
|
|
15894
|
+
});
|
|
15895
|
+
|
|
15896
|
+
// src/commands/onboarding.ts
|
|
15897
|
+
var onboarding_exports = {};
|
|
15898
|
+
__export(onboarding_exports, {
|
|
15899
|
+
runOnboardingStatus: () => runOnboardingStatus
|
|
15900
|
+
});
|
|
15901
|
+
async function requireSession4() {
|
|
15902
|
+
const creds = await readCredentials();
|
|
15903
|
+
if (!creds) {
|
|
15904
|
+
console.error("bamboo-agents: not signed in. Run `bamboo-agents login` first.");
|
|
15905
|
+
process.exit(1);
|
|
15906
|
+
}
|
|
15907
|
+
return creds.bamboo_session;
|
|
15908
|
+
}
|
|
15909
|
+
function printStatus(data) {
|
|
15910
|
+
const g = data.composite_gate;
|
|
15911
|
+
console.log("");
|
|
15912
|
+
console.log(` Onboarding: ${g.passed ? "\u2713 complete" : "\u2022 in progress"}`);
|
|
15913
|
+
console.log(
|
|
15914
|
+
` knowledge: ${g.knowledge_ok ? "ok" : "needs work"} (grade ${data.health.grade ?? "\u2014"}, score ${data.health.score ?? "\u2014"})`
|
|
15915
|
+
);
|
|
15916
|
+
console.log(` activation: ${g.activation_ok ? "ok" : "incomplete"}`);
|
|
15917
|
+
console.log("");
|
|
15918
|
+
}
|
|
15919
|
+
async function runOnboardingStatus(options) {
|
|
15920
|
+
const session = await requireSession4();
|
|
15921
|
+
let data;
|
|
15922
|
+
try {
|
|
15923
|
+
data = await getOnboardingStatus(session, { brandId: options.brand });
|
|
15924
|
+
} catch (err) {
|
|
15925
|
+
console.error(`bamboo-agents: couldn't load onboarding status: ${err.message}`);
|
|
15926
|
+
process.exit(1);
|
|
15927
|
+
}
|
|
15928
|
+
if (options.json) {
|
|
15929
|
+
console.log(JSON.stringify(data, null, 2));
|
|
15930
|
+
return;
|
|
15931
|
+
}
|
|
15932
|
+
printStatus(data);
|
|
15933
|
+
}
|
|
15934
|
+
var init_onboarding = __esm({
|
|
15935
|
+
"src/commands/onboarding.ts"() {
|
|
15936
|
+
"use strict";
|
|
15937
|
+
init_credentials();
|
|
15938
|
+
init_api();
|
|
15939
|
+
}
|
|
15940
|
+
});
|
|
15941
|
+
|
|
15486
15942
|
// node_modules/commander/esm.mjs
|
|
15487
15943
|
var import_index = __toESM(require_commander(), 1);
|
|
15488
15944
|
var {
|
|
@@ -15569,6 +16025,30 @@ skills.command("update <agent> <skill-name>").description("Update an installed s
|
|
|
15569
16025
|
const { runSkillsUpdate: runSkillsUpdate2 } = await Promise.resolve().then(() => (init_skills(), skills_exports));
|
|
15570
16026
|
await runSkillsUpdate2(agent, skillName);
|
|
15571
16027
|
});
|
|
16028
|
+
var knowledge = program2.command("knowledge").description("Knowledge surface for CLI-first skills");
|
|
16029
|
+
knowledge.command("slots").description("Print the knowledge slot schema (kind \xD7 scope \u2192 path) + dimensions").option("--json", "Emit raw JSON for agent consumption").option("--no-sync", "Skip the auto-sync git pull on this command").action(async (options) => {
|
|
16030
|
+
const { runKnowledgeSlots: runKnowledgeSlots2 } = await Promise.resolve().then(() => (init_knowledge(), knowledge_exports));
|
|
16031
|
+
await runKnowledgeSlots2(options);
|
|
16032
|
+
});
|
|
16033
|
+
knowledge.command("save").description("Save a knowledge file (routed write \u2014 auto-merges or queues)").requiredOption("--path <path>", "Repo path (from `knowledge slots`), e.g. brands/acme/knowledge/competitors.md").option("--content <text>", "Inline file content").option("--content-file <file>", "Read file content from a local path").option("--delete", "Delete the file instead of writing content").option("--intent <text>", "Human-readable summary for the PR body").option("--json", "Emit raw JSON for agent consumption").option("--no-sync", "Skip the auto-sync git pull on this command").action(async (options) => {
|
|
16034
|
+
const { runKnowledgeSave: runKnowledgeSave2 } = await Promise.resolve().then(() => (init_knowledge(), knowledge_exports));
|
|
16035
|
+
await runKnowledgeSave2(options);
|
|
16036
|
+
});
|
|
16037
|
+
program2.command("history").description("Recent workspace actions (reverse-chronological)").option("--limit <n>", "Max entries (default 20, max 100)").option("--json", "Emit raw JSON for agent consumption").option("--no-sync", "Skip the auto-sync git pull on this command").action(async (options) => {
|
|
16038
|
+
const { runHistory: runHistory2 } = await Promise.resolve().then(() => (init_history2(), history_exports));
|
|
16039
|
+
await runHistory2(options);
|
|
16040
|
+
});
|
|
16041
|
+
program2.command("changes").description("Structured change log \u2014 what was created/updated/deleted").option("--limit <n>", "Max entries (default 20, max 100)").option("--brand <id>", "Filter to one brand_id").option("--since <iso>", "Only changes at/after this ISO timestamp").option("--entity-type <type>", "Filter by entity type").option("--json", "Emit raw JSON for agent consumption").option("--no-sync", "Skip the auto-sync git pull on this command").action(
|
|
16042
|
+
async (options) => {
|
|
16043
|
+
const { runChanges: runChanges2 } = await Promise.resolve().then(() => (init_history2(), history_exports));
|
|
16044
|
+
await runChanges2(options);
|
|
16045
|
+
}
|
|
16046
|
+
);
|
|
16047
|
+
var onboarding = program2.command("onboarding").description("Onboarding status for CLI-first skills");
|
|
16048
|
+
onboarding.command("status").description("Composite onboarding gate (activation milestones + knowledge health)").option("--brand <id>", "Scope to a brand_id (default: org)").option("--json", "Emit raw JSON for agent consumption").option("--no-sync", "Skip the auto-sync git pull on this command").action(async (options) => {
|
|
16049
|
+
const { runOnboardingStatus: runOnboardingStatus2 } = await Promise.resolve().then(() => (init_onboarding(), onboarding_exports));
|
|
16050
|
+
await runOnboardingStatus2(options);
|
|
16051
|
+
});
|
|
15572
16052
|
program2.parseAsync(process.argv).catch((err) => {
|
|
15573
16053
|
const message = err instanceof Error ? err.message : String(err);
|
|
15574
16054
|
console.error(`bamboo-agents: ${message}`);
|