prjct-cli 2.38.1 → 2.40.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
@@ -2,6 +2,34 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ### Added
6
+ - **Multi-agent: per-worktree active tasks.** prjct's single-`currentTask` runtime now supports several AI agents working concurrently, each in its own git worktree, without clobbering a shared task. A deterministic `workspaceId` (derived from the git worktree root) keys each task into the existing `activeTasks[]` layer; the main worktree keeps the singular `currentTask` path, so single-agent use is unchanged. The single-task gate is now evaluated **per workspace** (a task in worktree A no longer blocks worktree B; a second task in the *same* worktree still gates), atomic inside the SQLite compare-and-set updater. Wiring lives at one choke point — `task-service` (`startTask`/`setTaskStatus`/`resolveActiveTask`/`completeActiveTask`) — inherited by the CLI, the MCP `prjct_task_*` tools, and `prjct ship`. Every read path (`prjct task`/`status` no-arg, `prjct remember` attribution, the session hooks, `prjct_task_status`, `prjct_workflow_status`) now resolves the **current worktree's** task and renders a workspace label (`shortId · branch`) plus a multi-workspace list, so it's always clear which worktree a task belongs to. Pause/resume **per worktree** is a planned follow-up (a child-worktree `prjct status paused` returns an explicit "unsupported" rather than a silent no-op); `done`/`ship` isolate correctly today.
7
+
8
+ The long-lived daemon no longer serves stale code, and embeddings reach any provider.
9
+
10
+ ### Fixed
11
+ - **Daemon could serve output from an outdated build (the recurring "stale daemon" trap).** Two compounding defects: staleness was detected *after* the daemon decided to serve, so the request that first observed a new build/install was still answered by the old code; and on refusal the client printed `Daemon restarting — retry the command` and exited 1, so the command never ran (1st call stale → 2nd fails → 3rd fresh). Now staleness is detected *before* serving, the daemon refuses cleanly with a `retry` signal (the request never executes → zero side effects), and **both `bin/prjct.ts` and the daemon shim** (`scripts/build.js` → `dist/bin/prjct.mjs`, what users actually run) transparently fall through to direct in-process execution on the fresh code — no error, no manual re-run. Hooks degrade to the fail-soft `{}` no-op. The global-install version-drift check is now time-throttled (1s) instead of every-10-commands (which could leak up to 9 stale responses). Closes the "stale daemon caches old hook code" gotcha.
12
+ - **`prjct embeddings test` no longer truncates its failure** to 65 chars (`embeddings endpoi…`). It now prints the full endpoint response plus an actionable hint (401 → base-url/key mismatch, 404 → wrong route, network → unreachable) — the one command meant to diagnose connectivity stopped hiding the diagnosis.
13
+ - **Embeddings test isolation:** `global-config` resolves its directory lazily from `PRJCT_CLI_HOME`, so config/embeddings tests no longer read the developer's real `~/.prjct-cli`.
14
+
15
+ ### Added
16
+ - **Zero-config embeddings setup — paste just the key.** `prjct embeddings set --key <k>` now infers the base URL from the key's prefix (`sk-or-…` → OpenRouter, `sk-…` → OpenAI, `pa-…` → Voyage; `sk-ant-`/Groq/unknown → keep default), so `--base-url` is optional for known providers. An explicit `--base-url` still wins, and detection re-fires when you switch keys. `set` is now partial-update friendly too: `set --key …` keeps your existing model/base URL instead of resetting them.
17
+ - **Embeddings support ANY OpenAI-compatible provider, including non-Bearer ones.** Already worked with OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio, … via `--base-url` + `--model` + `--key`; now providers that deviate from `Authorization: Bearer` are covered too — e.g. **Azure OpenAI** (`api-key` header + `api-version` query) and custom gateways. New `prjct embeddings set` flags: `--auth-header <h>`, `--auth-scheme <s|none>` (`none` = raw key), `--headers "k=v,…"`, `--query <qs>`. Default stays `Bearer`/`authorization`, so existing providers are unchanged. Vector dimensionality is detected from the response (no hardcoded size).
18
+
19
+ ## [2.40.0] - 2026-06-02
20
+
21
+ ### Features
22
+
23
+ - per-worktree active tasks — multi-agent runtime (#413)
24
+
25
+
26
+ ## [2.39.0] - 2026-06-02
27
+
28
+ ### Features
29
+
30
+ - zero-config embeddings (any provider) + fix daemon never serves stale code (#412)
31
+
32
+
5
33
  ## [2.38.1] - 2026-06-02
6
34
 
7
35
  ### Performance
package/README.md CHANGED
@@ -201,7 +201,7 @@ Cursor / Windsurf use the same commands with a `/` prefix: `/capture`, `/task`,
201
201
  | `prjct status <value>` | Inline status change on the active task (`done`, `paused`, `active`, …). |
202
202
  | `prjct tag <k:v>` | Tag the active task (`type:bug`, `domain:auth`, …). |
203
203
  | `prjct remember <type> "<content>"` | Persist a memory entry (decision, learning, gotcha, …). |
204
- | `prjct embeddings <set\|status\|test\|clear>` | Configure the global BYOT embeddings provider (one secure key, all projects). |
204
+ | `prjct embeddings <set\|status\|test\|clear>` | Configure the global BYOT embeddings provider — any OpenAI-compatible API (OpenAI, OpenRouter, Ollama, Azure, …), one secure key, all projects. |
205
205
  | `prjct ship [name]` | Run the project's ship workflow (commit, push, PR, persist). |
206
206
  | `prjct sync` | Re-index files, git co-change, imports; refresh project analysis. |
207
207
  | `prjct regen` | Full rebuild of the Obsidian vault snapshot from SQLite. |
@@ -282,7 +282,7 @@ prjct hooks <install|uninstall|status> Git hooks for auto-sync
282
282
  prjct context <memory|learnings|wiki> Recall memory / sync the vault
283
283
  prjct review-risk Advisory change-size + delivery-geometry hint (read-only)
284
284
  prjct workflow ["config"] Configure hooks via natural language
285
- prjct stop / restart Background daemon control
285
+ prjct stop / restart Background daemon control (self-reloads on stale code; manual restart rarely needed)
286
286
  prjct login / logout / auth Cloud sync authentication
287
287
  prjct update Update CLI system-wide (alias: prjct upgrade)
288
288
  prjct --version / --help
@@ -310,15 +310,44 @@ Memory is FTS5-backed (SQLite) and persona-filtered. Recall blends three signals
310
310
 
311
311
  On by default for **every** project — no setup, no key, no native dependency. A built-in pure-JS embedder (feature-hashed character n-grams) vectorizes memory into SQLite so recall catches morphological / cross-vocabulary matches BM25 misses (`auth`≈`authentication`).
312
312
 
313
- Want higher quality? Bring your own key once, globally:
313
+ Want higher quality? Bring your own key once, globally — **just paste the key, the provider is auto-detected from its prefix:**
314
314
 
315
315
  ```bash
316
- prjct embeddings set --key sk-... # stored in the macOS Keychain (else a 0600 file), never in config
317
- prjct embeddings test # validate connectivity
318
- prjct embeddings status # show provider + key location
316
+ prjct embeddings set --key sk-or-v1-... # OpenRouter (auto-detected)
317
+ prjct embeddings set --key sk-... # OpenAI (auto-detected)
318
+ prjct embeddings test # validate connectivity (full error + hint on failure)
319
+ prjct embeddings status # show provider, model, base URL + key location
320
+ prjct embeddings clear # forget the key AND settings (falls back to local)
319
321
  ```
320
322
 
321
- One key applies to every project (OpenAI-compatible OpenAI, Ollama at `http://localhost:11434/v1`, LM Studio, …). Without it, the local embedder is used. Each project re-vectorizes on its next session.
323
+ One key applies to every project. **Any OpenAI-compatible `/embeddings` provider works.** For providers without a recognizable key prefix (or a custom/self-hosted endpoint), point `--base-url` at its root:
324
+
325
+ ```bash
326
+ # Ollama (local, no key) / LM Studio / Together / Mistral / Voyage / Jina / DeepInfra …
327
+ prjct embeddings set --model nomic-embed-text --base-url http://localhost:11434/v1
328
+ ```
329
+
330
+ `set` is partial-update friendly — `set --key …` keeps your existing model and base URL; `set --model …` keeps your key. An explicit `--base-url` always overrides auto-detection.
331
+
332
+ Providers that don't use `Authorization: Bearer` are supported too via auth flags — e.g. **Azure OpenAI** (`api-key` header + `api-version` query):
333
+
334
+ ```bash
335
+ prjct embeddings set --key "$AZURE_KEY" \
336
+ --base-url https://RESOURCE.openai.azure.com/openai/deployments/DEPLOYMENT \
337
+ --auth-header api-key --auth-scheme none --query "api-version=2023-05-15"
338
+ ```
339
+
340
+ | Flag | Purpose |
341
+ | --- | --- |
342
+ | `--key <k>` | API key — stored in the Keychain (else a 0600 file), never in config |
343
+ | `--base-url <u>` | Provider's OpenAI-compatible root (default `https://api.openai.com/v1`) |
344
+ | `--model <m>` | Model id (default `text-embedding-3-small`) |
345
+ | `--auth-header <h>` | Header carrying the key (default `authorization`; `api-key` for Azure) |
346
+ | `--auth-scheme <s\|none>` | Prefix before the key (default `Bearer`; `none` = raw key) |
347
+ | `--headers "k=v,k2=v2"` | Extra static headers (gateways, attribution) |
348
+ | `--query <qs>` | Raw query string appended to the URL (e.g. `api-version=2023-05-15`) |
349
+
350
+ Without a key the built-in local embedder is used. Vector dimensionality is detected from the provider's response (no hardcoded size). Each project re-vectorizes on its next session.
322
351
 
323
352
  ### Drop files into the vault (bidirectional)
324
353