@kendoo.agentdesk/agentdesk 0.19.7 → 0.20.0

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/CHANGELOG.md CHANGED
@@ -13,6 +13,21 @@ Internal refactors, infrastructure changes, and architectural notes are not list
13
13
  ### Added
14
14
  - `[UI]` Private-session sharing flow. When someone visits a session URL they don't own, they now see a friendly "Shh… this one's private" page with a one-click "Request access" button instead of a blank error. The session owner sees pending requests in a new header inbox and can grant viewer access for just that session or the whole project. Viewer-granted sessions show up in the teammate's sidebar tagged as a viewer.
15
15
 
16
+ ## [0.20.0] — 2026-04-19
17
+
18
+ ### Changed
19
+ - `[CLI]` `agentdesk init` rewritten as a single entry point that auto-routes on what it finds. Three branches: (1) modern `.agentdesk.json` with projectKey → arrow-key menu with "Refresh tokens" as default; (2) legacy `.agentdesk.json` without projectKey → tries to match the user's account projects by github.repo / git remote / tracker team, migrates the file forward on a confident match; (3) no local config → auto-match by git remote with a confirmation prompt, otherwise a top-level "Connect to existing / New project / Cancel" menu.
20
+ - `[CLI]` New-project wizard broken into ten tiny, single-purpose steps (git detection, GitHub repo prompt, GitHub token with auto-fetched login, optional clone, tracker type, tracker location, tracker credentials, signature, verify+pick, review+checks+save). Each step does one thing so re-entry after Ctrl-C is sane.
21
+ - `[CLI]` GitHub username is no longer asked — it's derived from whatever the token authenticates as via the GitHub API. Eliminates a prompt and removes a whole class of username/token mismatch bugs.
22
+ - `[CLI]` Identity badge question replaced with "How should the AI team sign its work?" — arrow-key menu of AgentDesk / Claude Code / Custom… / Skip with AgentDesk as default.
23
+ - `[CLI]` New-project wizard clones the GitHub repo when you're not inside one (private repos work — the just-collected token is used). The existing-project flow clones too when the current directory doesn't hold the matching repo.
24
+ - `[CLI]` Final step of both flows prints a consolidated access-check checklist — agentdesk.live, GitHub (with login and push permission on the repo), tracker — before the save prompt, so broken credentials surface at the moment you'd save them instead of at the next `agentdesk team`.
25
+
26
+ ## [0.19.8] — 2026-04-19
27
+
28
+ ### Fixed
29
+ - `[CLI]` `agentdesk init` no longer silently dumps you into the new-project wizard when there's no `.agentdesk.json` and the git remote doesn't auto-match an existing project. It now asks upfront: "Connect this repo to an existing project on my account (bootstrap)" / "Set up this as a new project (full wizard)" / "Cancel". Picking "Connect" opens the project picker from your account — the same flow `agentdesk bootstrap` runs — so a second-machine user can always attach to an existing project without accidentally creating a duplicate. Auto-match still short-circuits to token refresh when it finds a confident single match.
30
+
16
31
  ## [0.19.7] — 2026-04-19
17
32
 
18
33
  ### Changed
package/README.md CHANGED
@@ -43,13 +43,30 @@ Opens your browser to [agentdesk.live](https://agentdesk.live) where you sign up
43
43
  agentdesk init
44
44
  ```
45
45
 
46
- A guided wizard walks you through it: picks up your project type, asks which task tracker you use (Linear, Jira, GitHub Issues, or none), shows the tradeoff between a **dedicated AgentDesk user** and your personal account with step-by-step setup for either, verifies the credentials, echoes "Posting as: …" so you can confirm which identity will appear on tickets, then writes `.agentdesk.json`.
46
+ `agentdesk init` is a single entry point that auto-routes based on what it finds:
47
47
 
48
- Re-running `agentdesk init` in a project that already has config offers a four-way menu with **"Refresh tokens"** as the default so rotating a token or setting up a second machine is a single enter-press, no wizard walk. The other options are "Tracker only", "Full setup", and "Cancel". Use `agentdesk init --quick` to skip the narrative copy for scripted setups, or `--force-full` to bypass the fast paths and walk the full wizard.
48
+ - **Modern `.agentdesk.json` (projectKey present)** arrow-key menu: *Refresh tokens* (default) / Full setup / Cancel.
49
+ - **Legacy `.agentdesk.json` (no projectKey)** → tries to match your account's projects by `github.repo` / git remote / tracker team; migrates the file forward on a confident match.
50
+ - **No local config** → auto-matches the git remote against your account's projects. On a single match, prints `✓ Recognized: <name>` and confirms; otherwise a top-level *Connect to existing / New project / Cancel* menu.
49
51
 
50
- **On a second machine** (repo cloned from a teammate's setup): just run `agentdesk init`. If no `.agentdesk.json` is committed, `init` fetches your account's project list, auto-matches this clone against the git remote, and switches to token-refresh mode — you only paste the per-machine tokens (Linear API key, Jira email + token, GitHub token) into `.env`. The explicit `agentdesk bootstrap` command still exists as an alias that always runs that flow. The other machine's `.env` and the server config are left untouched.
52
+ The **new-project wizard** is ten tiny steps, each doing one thing:
51
53
 
52
- All menus use arrow-key navigation with color highlighting.
54
+ 1. Detect git repo in cwd.
55
+ 2. Ask for GitHub repo (`owner/repo` or URL; GitHub only for now) — skipped when a repo is detected.
56
+ 3. Ask for `GITHUB_TOKEN`, fetch `@login` from the GitHub API, echo "Token authenticates as @…".
57
+ 4. `git clone` the repo into `./<repo>` — skipped when already in one.
58
+ 5. Tracker type — Linear / Jira / GitHub Issues / None.
59
+ 6. Tracker location — Linear workspace slug *or* Jira tenant URL.
60
+ 7. Tracker credentials — `LINEAR_API_KEY` *or* `JIRA_EMAIL`+`JIRA_API_TOKEN`.
61
+ 8. **How should the AI team sign its work?** AgentDesk / Claude Code / Custom… / Skip.
62
+ 9. Verify tracker + pick team/project from the fetched list.
63
+ 10. Review, access-check checklist (`agentdesk.live ✓`, `GitHub ✓`, tracker ✓), confirm save.
64
+
65
+ The **existing-project flow** (E1–E7) reuses Steps 3, 4 (clone if missing) and Step 10's access checks, plus a server-config fetch and a gap-scan for whichever `.env` credentials are missing. Nothing project-wide is re-asked.
66
+
67
+ Use `agentdesk init --force-full` to bypass every auto-route and always walk the new-project wizard. `agentdesk bootstrap` is an alias that always runs the existing-project flow.
68
+
69
+ All menus use arrow-key navigation with color highlighting; Ctrl-C exits cleanly.
53
70
 
54
71
  `.agentdesk.json` is kept in sync with the server: every CLI run fetches the authoritative config and rewrites the local file as a credential-free snapshot. Credentials live only on the server, encrypted. If a local edit disagreed with the server's value, a one-line warning lists the overridden fields.
55
72
 
@@ -75,8 +92,8 @@ Watch the session live at [agentdesk.live](https://agentdesk.live). Each session
75
92
  ```
76
93
  agentdesk login Sign in to AgentDesk
77
94
  agentdesk logout Sign out and remove credentials
78
- agentdesk init Set up project and configure tracker
79
- agentdesk bootstrap Fill in per-machine tokens on a cloned repo
95
+ agentdesk init [--force-full] Guided setup auto-detects new vs existing, clones if needed
96
+ agentdesk bootstrap Alias for the connect-to-existing-project flow
80
97
  agentdesk team <TASK-ID> Run a team session on an existing task
81
98
  agentdesk team -d "..." Describe what you want — task created automatically
82
99
  agentdesk <agent> -d "..." Run a single agent (jane, dennis, sam, bart, vera, luna, mark, nora)
package/bin/agentdesk.mjs CHANGED
@@ -55,20 +55,20 @@ if (!command || command === "help" || command === "--help") {
55
55
 
56
56
  Getting started:
57
57
  1. agentdesk login Sign in to your account
58
- 2. agentdesk init Set up your project (choose tracker, save config)
58
+ 2. agentdesk init Guided setup auto-detects new vs existing projects
59
59
  3. agentdesk team TASK-123 Run a team session
60
60
 
61
- On a freshly cloned repo (already set up on another machine):
62
- 1. agentdesk login Sign in
63
- 2. agentdesk init Auto-detects the project and asks only for tokens
64
- (or run 'agentdesk bootstrap' same flow)
65
- 3. agentdesk team TASK-123 Run a team session
61
+ 'agentdesk init' branches on what it finds:
62
+ • Local .agentdesk.json with projectKey → Refresh tokens (default) / Full setup / Cancel
63
+ No local config, git remote matches → confirms the match, then only asks for tokens
64
+ No match → Connect to existing / New project (wizard) / Cancel
65
+ Use 'agentdesk init --force-full' to bypass the fast paths.
66
66
 
67
67
  Commands:
68
68
  agentdesk login Sign in to AgentDesk
69
69
  agentdesk logout Sign out and remove credentials
70
- agentdesk init [--quick | --force-full] Set up project (auto-detects cloned repos & offers token refresh)
71
- agentdesk bootstrap Fill in per-machine tokens on a cloned repo
70
+ agentdesk init [--force-full] Guided setup (auto-detects new vs existing projects, clones GitHub repo if needed)
71
+ agentdesk bootstrap Alias for the 'connect to existing project' path of init
72
72
  agentdesk team <TASK-ID> Run a team session on an existing task
73
73
  agentdesk team -d "..." Create a task and run a session
74
74
  agentdesk <agent> -d "..." Run a single agent (jane, dennis, sam, bart, vera, luna, mark, nora)
@@ -150,9 +150,8 @@ else if (command === "logout") {
150
150
  else if (command === "init") {
151
151
  const { runInit } = await import("../cli/init.mjs");
152
152
  const rest = args.slice(1);
153
- const quick = rest.includes("--quick");
154
153
  const forceFull = rest.includes("--force-full") || rest.includes("--full");
155
- await runInit(process.cwd(), { quick, forceFull });
154
+ await runInit(process.cwd(), { forceFull });
156
155
  }
157
156
 
158
157
  else if (command === "bootstrap") {
package/cli/bootstrap.mjs CHANGED
@@ -347,15 +347,6 @@ export async function gapScan({ cwd, apiKey, projectKey }) {
347
347
  }
348
348
 
349
349
  console.log("");
350
- if (trackerOk && githubOk) {
351
- console.log(" Ready. Try:");
352
- const prefix = config.linear?.teamKey || config.jira?.project || projectKey.toUpperCase();
353
- console.log(` agentdesk team ${prefix}-123`);
354
- console.log("");
355
- } else {
356
- console.log(" Finished with missing pieces — edit .env directly or re-run.");
357
- console.log("");
358
- }
359
350
  return { trackerOk, githubOk, config };
360
351
  }
361
352
 
@@ -387,5 +378,15 @@ export async function runBootstrap(cwd = process.cwd()) {
387
378
  console.log("");
388
379
  }
389
380
 
390
- await gapScan({ cwd, apiKey, projectKey });
381
+ const { config } = await gapScan({ cwd, apiKey, projectKey });
382
+
383
+ // Final access-checks summary — same checklist the new-project wizard
384
+ // prints at the end of its own flow, so both entry points finish
385
+ // consistently.
386
+ const { loadDotEnv } = await import("./setup-helpers.mjs");
387
+ const { runAccessChecks, printAccessChecks } = await import("./setup-helpers.mjs");
388
+ const creds = loadDotEnv(cwd);
389
+ const results = await runAccessChecks({ apiKey, serverUrl: SERVER, cwd, config, creds });
390
+ printAccessChecks(results, { tracker: config?.tracker });
391
+ console.log("");
391
392
  }