@qodeca/xezar 0.10.1 → 0.10.2

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/README.md CHANGED
@@ -493,7 +493,8 @@ Useful environment variables:
493
493
  | `XEZ_CODEX_BIN=/path/to/codex` | Override which `codex` binary is used. |
494
494
  | `XEZ_OPENCODE_BIN=/path/to/opencode` | Override which `opencode` binary is used. |
495
495
  | `XEZ_PI_BIN=/path/to/pi` | Override which `pi` binary is used. |
496
- | `CLAUDE_CONFIG_DIR`, `CODEX_HOME` | The agents' **own** variables, honoured where the vendor documents one. Setting one moves that agent's **default account** — the config folder xezar discovers. A *second* login of the same CLI is deliberately not an environment setting, since one process-wide value cannot differ per project: add it under **Settings → Agent accounts** and pick it per project. |
496
+ | `CLAUDE_CONFIG_DIR`, `CODEX_HOME` | The agents' **own** variables, honoured where the vendor documents one. Setting one moves that agent's **default account** — the config folder xezar discovers, credentials included. A *second* login of the same CLI is deliberately not an environment setting, since one process-wide value cannot differ per project: add it under **Settings → Agent accounts** and pick it per project. |
497
+ | `OPENCODE_CONFIG_DIR` | Where xezar looks for OpenCode's config, ahead of `$XDG_CONFIG_HOME/opencode` (default `~/.config/opencode`). Config **only** — OpenCode keeps credentials in `~/.local/share/opencode`, so this moves settings without moving the account, which is why OpenCode cannot carry Agent accounts. |
497
498
  | `XEZ_BROWSE_ROOT=~/` | Default root for **Add project → Open local folder…**. The picker cannot navigate above it; a saved workspace value overrides the environment default and must name an existing folder. |
498
499
  | `XEZ_PROJECTS_DIR=~/xezar/projects` | Default destination for **Clone from GitHub**. Saved workspace settings override it, and missing directories are created recursively. |
499
500
  | `XEZ_SKILLS_AUTO_UPDATE=0` | Disable automatic checks and updates for upstream-CLI-tracked Open Mercato skill installations. On by default; a saved global Skills setting overrides this environment default. Checks are delayed, bounded, cached, and non-blocking. |
package/dist/index.js CHANGED
File without changes
package/dist/paths.d.ts CHANGED
@@ -101,8 +101,19 @@ export declare function serverLockPath(instance?: string): string;
101
101
  /**
102
102
  * Where each coding agent keeps its per-user config, honouring the env vars the
103
103
  * vendors document: `$CLAUDE_CONFIG_DIR` relocates Claude Code's home;
104
- * `$CODEX_HOME` relocates Codex's; `$XDG_CONFIG_HOME` relocates OpenCode's config
105
- * dir (falling back to `~/.config`). Read per call so tests and ops can set env live.
104
+ * `$CODEX_HOME` relocates Codex's; `$OPENCODE_CONFIG_DIR`, then `$XDG_CONFIG_HOME`,
105
+ * relocate OpenCode's config dir (falling back to `~/.config`). Read per call so
106
+ * tests and ops can set env live.
107
+ *
108
+ * OpenCode's own variable is checked FIRST because it is the narrow one. Reaching
109
+ * for `XDG_CONFIG_HOME` to move one agent's config relocates every XDG-aware tool
110
+ * in the process — inside xezar's own e2e boot that silently deauthenticated `gh`
111
+ * and hid the developer's global git config. `src/core/agent-profiles.ts` rejects
112
+ * `OPENCODE_CONFIG_DIR` for AGENT PROFILES, and rightly: it moves config without
113
+ * moving the credentials in `~/.local/share/opencode`, so a profile would swap
114
+ * settings while still billing the other account. That objection is about identity
115
+ * and does not reach here — this slot IS the config dir, nothing else, so the
116
+ * config-only variable is exactly the right precision for it.
106
117
  *
107
118
  * These are the DEFAULT profile's dirs. A second login of the same CLI is an
108
119
  * agent profile (`src/core/agent-profiles.ts`) and resolves through
package/dist/paths.js CHANGED
@@ -140,8 +140,19 @@ export function serverLockPath(instance = DEFAULT_SERVER_INSTANCE) {
140
140
  /**
141
141
  * Where each coding agent keeps its per-user config, honouring the env vars the
142
142
  * vendors document: `$CLAUDE_CONFIG_DIR` relocates Claude Code's home;
143
- * `$CODEX_HOME` relocates Codex's; `$XDG_CONFIG_HOME` relocates OpenCode's config
144
- * dir (falling back to `~/.config`). Read per call so tests and ops can set env live.
143
+ * `$CODEX_HOME` relocates Codex's; `$OPENCODE_CONFIG_DIR`, then `$XDG_CONFIG_HOME`,
144
+ * relocate OpenCode's config dir (falling back to `~/.config`). Read per call so
145
+ * tests and ops can set env live.
146
+ *
147
+ * OpenCode's own variable is checked FIRST because it is the narrow one. Reaching
148
+ * for `XDG_CONFIG_HOME` to move one agent's config relocates every XDG-aware tool
149
+ * in the process — inside xezar's own e2e boot that silently deauthenticated `gh`
150
+ * and hid the developer's global git config. `src/core/agent-profiles.ts` rejects
151
+ * `OPENCODE_CONFIG_DIR` for AGENT PROFILES, and rightly: it moves config without
152
+ * moving the credentials in `~/.local/share/opencode`, so a profile would swap
153
+ * settings while still billing the other account. That objection is about identity
154
+ * and does not reach here — this slot IS the config dir, nothing else, so the
155
+ * config-only variable is exactly the right precision for it.
145
156
  *
146
157
  * These are the DEFAULT profile's dirs. A second login of the same CLI is an
147
158
  * agent profile (`src/core/agent-profiles.ts`) and resolves through
@@ -154,7 +165,7 @@ export function agentHomePaths(env = process.env) {
154
165
  return {
155
166
  claude: env.CLAUDE_CONFIG_DIR?.trim() || join(home, '.claude'),
156
167
  codex: env.CODEX_HOME?.trim() || join(home, '.codex'),
157
- opencodeConfig: join(xdgConfig, 'opencode'),
168
+ opencodeConfig: env.OPENCODE_CONFIG_DIR?.trim() || join(xdgConfig, 'opencode'),
158
169
  };
159
170
  }
160
171
  /**
package/dist/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC/D,4EAA4E;IAC5E,gEAAgE;IAChE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,+BAA+B,CAAC,IAAY,E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EAAE,UAAU,CAAC;KAC/E,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC1F,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE;WAC5D,UAAU,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,WAAW,IAAI,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9E,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;AACrG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qodeca/xezar",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -50,8 +50,8 @@
50
50
  "zod": "^4.4.3"
51
51
  },
52
52
  "devDependencies": {
53
- "@qodeca/xezar-api-client": "^0.10.1",
54
- "@qodeca/xezar-contract": "^0.10.1",
53
+ "@qodeca/xezar-api-client": "^0.10.2",
54
+ "@qodeca/xezar-contract": "^0.10.2",
55
55
  "@types/node": "^20.14.0",
56
56
  "@types/ws": "^8.18.1",
57
57
  "esbuild": "^0.28.1",
@@ -1,67 +0,0 @@
1
- /** Snapshot release decisions — the pure half of `scripts/release-snapshot.mjs`.
2
- *
3
- * Spec `.ai/specs/2026-07-18-npm-preview-publish.md` (#482): every green CI run
4
- * publishes an installable preview of the CLI. This module decides *whether* a
5
- * given CI event publishes, under *which* version and dist-tag, and how the two
6
- * manifests (the scoped package and its unscoped alias) are stamped. Kept
7
- * dependency-free and side-effect-free so the decision is unit-testable; the
8
- * script owns file writes, `npm publish`, and the exit code.
9
- *
10
- * Deliberately name-agnostic: package names come from the checked-out manifests
11
- * at call time, never from constants — so the `@pat-lewczuk/cezar` →
12
- * `@open-mercato/cezar` rename (PR #501) lands independently of this pipeline.
13
- */
14
- import { type ReleaseManifests as ReleaseManifestSet } from './manifests.ts';
15
- /** The CI facts the decision needs, straight from GitHub Actions' env/event. */
16
- export interface SnapshotContext {
17
- /** `GITHUB_EVENT_NAME` — `pull_request` and `push` publish previews; `schedule`
18
- * and `workflow_dispatch` publish only the explicitly requested nightly. */
19
- eventName: string;
20
- /** `GITHUB_REF_NAME` for push events — only `develop` publishes a snapshot;
21
- * `main` is reserved for owner-driven stable releases (see stable.ts) and for
22
- * the nightly channel below, which never moves `latest` either. */
23
- refName: string;
24
- /** `CEZ_RELEASE_CHANNEL` — a channel asked for by name rather than derived from
25
- * the event. Only `.github/workflows/nightly.yml` sets it (to `nightly`); every
26
- * other caller leaves it empty and gets the event-derived channel. Opt-in by
27
- * name is what keeps a `workflow_dispatch` of ci.yml from cutting a nightly by
28
- * accident — the event alone is not enough. */
29
- requestedChannel?: string;
30
- /** `YYYYMMDD` (UTC) of the day a nightly is cut — the nightly version is named
31
- * after its date. Required for the nightly channel, ignored by every other. */
32
- nightlyDate?: string;
33
- /** PR number for pull_request events; absent/invalid → no publish. */
34
- prNumber?: number;
35
- /** `owner/name` of the PR head repo — fork PRs (≠ `repo`) never publish. */
36
- headRepo?: string;
37
- /** `GITHUB_REPOSITORY` — this repo's `owner/name`. */
38
- repo?: string;
39
- /** The base version from the root `package.json` (e.g. `0.1.5`). */
40
- baseVersion: string;
41
- /** `GITHUB_RUN_NUMBER` — monotonic per workflow; makes versions unique. */
42
- runNumber: number;
43
- /** `GITHUB_RUN_ATTEMPT` — appended only when > 1 so re-runs never collide. */
44
- runAttempt?: number;
45
- }
46
- /** A publishable snapshot: prerelease version + the explicit dist-tag.
47
- * The dist-tag is structurally never `latest` — snapshots must not become the
48
- * default install; stable releases stay owner-driven (spec, resolved Q2). */
49
- export interface SnapshotPlan {
50
- channel: string;
51
- version: string;
52
- distTag: string;
53
- }
54
- export declare function computeSnapshot(ctx: SnapshotContext): SnapshotPlan | null;
55
- export type { ManifestLike, ReleaseManifests } from './manifests.ts';
56
- /** Stamp the release set to the snapshot version.
57
- *
58
- * Every intra-release dependency is pinned **exact** (`0.1.5-pr482.123`, no range) so
59
- * `npx <alias>@<version>` runs exactly the PR's code and the service resolves exactly the
60
- * api-client it was cut with — a `^` range would resolve to whatever newer version exists
61
- * (spec, resolved Q5). Stable releases keep their `^` range and never go through this
62
- * stamper. */
63
- export declare function stampManifests(manifests: ReleaseManifestSet, version: string): ReleaseManifestSet;
64
- /** The copy-pasteable commands for the sticky PR comment and the step summary.
65
- * Rendered from the *actual* alias package name so a future rename of the npx
66
- * command can never leave stale instructions (spec, resolved Q1). */
67
- export declare function buildInstallLines(aliasName: string, version: string): string[];
@@ -1,97 +0,0 @@
1
- /** Snapshot release decisions — the pure half of `scripts/release-snapshot.mjs`.
2
- *
3
- * Spec `.ai/specs/2026-07-18-npm-preview-publish.md` (#482): every green CI run
4
- * publishes an installable preview of the CLI. This module decides *whether* a
5
- * given CI event publishes, under *which* version and dist-tag, and how the two
6
- * manifests (the scoped package and its unscoped alias) are stamped. Kept
7
- * dependency-free and side-effect-free so the decision is unit-testable; the
8
- * script owns file writes, `npm publish`, and the exit code.
9
- *
10
- * Deliberately name-agnostic: package names come from the checked-out manifests
11
- * at call time, never from constants — so the `@pat-lewczuk/cezar` →
12
- * `@open-mercato/cezar` rename (PR #501) lands independently of this pipeline.
13
- */
14
- import { stampManifestSet } from './manifests.js';
15
- export function computeSnapshot(ctx) {
16
- const channel = resolveChannel(ctx);
17
- if (!channel)
18
- return null;
19
- if (!ctx.baseVersion || !Number.isInteger(ctx.runNumber) || ctx.runNumber <= 0)
20
- return null;
21
- const attempt = ctx.runAttempt !== undefined && Number.isInteger(ctx.runAttempt) && ctx.runAttempt > 1
22
- ? `.${ctx.runAttempt}`
23
- : '';
24
- // A nightly is named after the day it was cut — `0.1.5-nightly.20260813.126` —
25
- // so `npm view cezar-cli versions` reads as a calendar and a user can tell at a
26
- // glance how old their build is. The run number still trails the date, because a
27
- // manual re-cut on the same day must not collide with the scheduled one. Both are
28
- // plain numeric semver identifiers, so the ordering stays chronological.
29
- const nightly = channel.channel === 'nightly';
30
- if (nightly && !/^\d{8}$/.test(ctx.nightlyDate ?? ''))
31
- return null;
32
- const stamp = nightly ? `${ctx.nightlyDate}.${ctx.runNumber}` : `${ctx.runNumber}`;
33
- return {
34
- channel: channel.channel,
35
- version: `${ctx.baseVersion}-${channel.channel}.${stamp}${attempt}`,
36
- distTag: channel.distTag,
37
- };
38
- }
39
- function resolveChannel(ctx) {
40
- // A named channel wins over the event-derived ones, and is the ONLY way to reach
41
- // nightly — asked for explicitly by nightly.yml, never inferred from an event.
42
- // An unrecognised name publishes nothing rather than silently falling back: a
43
- // typo in a workflow should be a no-op, not a publish under the wrong tag.
44
- if (ctx.requestedChannel) {
45
- if (ctx.requestedChannel !== 'nightly')
46
- return null;
47
- // Nightly cuts main's tip — on the schedule, or on demand from the Actions tab
48
- // when someone needs a fresh build before the next night.
49
- if (ctx.eventName !== 'schedule' && ctx.eventName !== 'workflow_dispatch')
50
- return null;
51
- if (ctx.refName !== 'main')
52
- return null;
53
- return { channel: 'nightly', distTag: 'nightly' };
54
- }
55
- if (ctx.eventName === 'pull_request') {
56
- const n = ctx.prNumber;
57
- if (n === undefined || !Number.isInteger(n) || n <= 0)
58
- return null;
59
- // Defense in depth: the workflow's `if` already excludes forks, and fork PRs
60
- // get no secrets — but the decision must not rely on workflow wiring alone.
61
- if (!ctx.headRepo || !ctx.repo || ctx.headRepo !== ctx.repo)
62
- return null;
63
- return { channel: `pr${n}`, distTag: `pr-${n}` };
64
- }
65
- if (ctx.eventName === 'push') {
66
- // Only `develop` publishes a snapshot. `main` is deliberately excluded so a
67
- // merge to main never touches npm — stable `latest` releases are cut
68
- // manually via the Release workflow (stable.ts). Defense in depth: the
69
- // workflow's `if` already restricts the push channel to develop.
70
- if (ctx.refName === 'develop')
71
- return { channel: 'develop', distTag: 'develop' };
72
- return null;
73
- }
74
- return null;
75
- }
76
- /** Stamp the release set to the snapshot version.
77
- *
78
- * Every intra-release dependency is pinned **exact** (`0.1.5-pr482.123`, no range) so
79
- * `npx <alias>@<version>` runs exactly the PR's code and the service resolves exactly the
80
- * api-client it was cut with — a `^` range would resolve to whatever newer version exists
81
- * (spec, resolved Q5). Stable releases keep their `^` range and never go through this
82
- * stamper. */
83
- export function stampManifests(manifests, version) {
84
- return stampManifestSet(manifests, version, (v) => v);
85
- }
86
- /** The copy-pasteable commands for the sticky PR comment and the step summary.
87
- * Rendered from the *actual* alias package name so a future rename of the npx
88
- * command can never leave stale instructions (spec, resolved Q1). */
89
- export function buildInstallLines(aliasName, version) {
90
- const cmd = `npx ${aliasName}@${version}`;
91
- return [
92
- `${cmd} # cockpit at http://localhost:4321`,
93
- `${cmd} run "…" # headless run`,
94
- `${cmd} server-deploy --platform <id> # roll a server to this exact build`,
95
- ];
96
- }
97
- //# sourceMappingURL=snapshot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/release/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAA+C,MAAM,gBAAgB,CAAC;AA2C/F,MAAM,UAAU,eAAe,CAAC,GAAoB;IAClD,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,SAAS,IAAI,CAAC;QAAE,OAAO,IAAI,CAA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