bamboo-agents 0.1.16-dev.133.a75755c → 0.1.16-dev.135.bad28cb

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 CHANGED
@@ -1 +1 @@
1
- 0.1.16-dev.133.a75755c
1
+ 0.1.16-dev.135.bad28cb
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.16-dev.133.a75755c";
3040
+ VERSION = "0.1.16-dev.135.bad28cb";
3041
3041
  }
3042
3042
  });
3043
3043
 
@@ -7212,7 +7212,7 @@ var init_knowledge_slots = __esm({
7212
7212
  "../../src/lib/api-contracts/cli/knowledge-slots.ts"() {
7213
7213
  init_zod();
7214
7214
  KnowledgeSlotKindSchema = external_exports.object({
7215
- /** Directory taxonomy: knowledge | memory | context | skills | scheduled_tasks | instructions | identity */
7215
+ /** Directory taxonomy: knowledge | memory | context | skills | scheduled_tasks | identity */
7216
7216
  kind: external_exports.string(),
7217
7217
  /** Scope this kind may be written at. */
7218
7218
  scope: external_exports.enum(["org", "brand", "agent"]),
@@ -7224,8 +7224,8 @@ var init_knowledge_slots = __esm({
7224
7224
  */
7225
7225
  example_path: external_exports.string(),
7226
7226
  /**
7227
- * True when the filename is pinned by the server (instructions/identity)
7228
- * and the caller's filename is ignored.
7227
+ * True when the filename is pinned by the server (identity) and the
7228
+ * caller's filename is ignored.
7229
7229
  */
7230
7230
  filename_pinned: external_exports.boolean()
7231
7231
  });
@@ -12493,7 +12493,9 @@ var init_auth_status = __esm({
12493
12493
  OrgRefSchema = external_exports.object({
12494
12494
  id: external_exports.string(),
12495
12495
  name: external_exports.string(),
12496
- workspace_repo: external_exports.string().nullable()
12496
+ workspace_repo: external_exports.string().nullable(),
12497
+ /** Present when Bamboo's shared installation serves this workspace. */
12498
+ workspace_managed: external_exports.boolean().optional()
12497
12499
  });
12498
12500
  MembershipSchema = external_exports.object({
12499
12501
  org: OrgRefSchema,
@@ -16869,7 +16871,7 @@ async function fetchGithubTokenForLogin(bambooSession) {
16869
16871
  return handleMissingGithubToken(bambooSession);
16870
16872
  }
16871
16873
  }
16872
- async function finishLogin(bambooSession, tokenResp) {
16874
+ async function finishLogin(bambooSession, tokenResp, options = {}) {
16873
16875
  await writeCredentials({
16874
16876
  bamboo_session: bambooSession,
16875
16877
  github_token: tokenResp?.access_token ?? "",
@@ -16877,6 +16879,13 @@ async function finishLogin(bambooSession, tokenResp) {
16877
16879
  github_username: tokenResp?.github_username ?? null,
16878
16880
  written_at: (/* @__PURE__ */ new Date()).toISOString()
16879
16881
  });
16882
+ if (options.managedWorkspace) {
16883
+ console.log("");
16884
+ console.log(" \u2713 Logged in to your Bamboo-managed workspace.");
16885
+ console.log(" Local git cloning may require separate GitHub access.");
16886
+ console.log("");
16887
+ return;
16888
+ }
16880
16889
  if (!tokenResp) {
16881
16890
  console.log("");
16882
16891
  console.log(" Your Bamboo session is saved \u2014 GitHub isn't linked yet.");
@@ -16902,7 +16911,7 @@ async function runLogin() {
16902
16911
  console.log("");
16903
16912
  console.log(" bamboo-agents will:");
16904
16913
  console.log(" \u2022 open your browser so you can sign in to Bamboo");
16905
- console.log(" \u2022 capture your session + GitHub token to ~/.bamboo/");
16914
+ console.log(" \u2022 save your Bamboo session to ~/.bamboo/");
16906
16915
  console.log("");
16907
16916
  console.log(` Verification code: ${code}`);
16908
16917
  console.log(" (the browser page should show the same code)");
@@ -16918,6 +16927,14 @@ async function runLogin() {
16918
16927
  process.exit(1);
16919
16928
  }
16920
16929
  spinner.succeed("Bamboo session captured");
16930
+ try {
16931
+ const status = await getCliAuthStatus(bambooSession);
16932
+ if (status.memberships.length > 0 && status.pending_invites.length === 0 && status.memberships.every((membership) => membership.org.workspace_managed === true)) {
16933
+ await finishLogin(bambooSession, null, { managedWorkspace: true });
16934
+ return;
16935
+ }
16936
+ } catch {
16937
+ }
16921
16938
  const tokenResp = await fetchGithubTokenForLogin(bambooSession);
16922
16939
  await finishLogin(bambooSession, tokenResp);
16923
16940
  }