@qodeca/xezar 0.10.2 → 0.11.1

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.
Files changed (97) hide show
  1. package/README.md +57 -36
  2. package/dist/automations/coordinator.js +3 -2
  3. package/dist/automations/coordinator.js.map +1 -1
  4. package/dist/automations/store.js +2 -0
  5. package/dist/automations/store.js.map +1 -1
  6. package/dist/config.d.ts +2 -2
  7. package/dist/config.js +6 -5
  8. package/dist/config.js.map +1 -1
  9. package/dist/contract/index.js +1 -1
  10. package/dist/contract/skills.d.ts +2 -2
  11. package/dist/contract/workflows.d.ts +2 -2
  12. package/dist/contract/workspace.d.ts +1 -1
  13. package/dist/core/agent-model-policy.js +2 -1
  14. package/dist/core/agent-model-policy.js.map +1 -1
  15. package/dist/core/secret-redaction.d.ts +1 -1
  16. package/dist/core/secret-redaction.js +1 -1
  17. package/dist/git-worktree.d.ts +4 -4
  18. package/dist/git-worktree.js +8 -7
  19. package/dist/git-worktree.js.map +1 -1
  20. package/dist/handoff.d.ts +1 -1
  21. package/dist/handoff.js +1 -1
  22. package/dist/index.js +26 -39
  23. package/dist/index.js.map +1 -1
  24. package/dist/paths.d.ts +1 -1
  25. package/dist/paths.js +1 -1
  26. package/dist/project-data-paths.d.ts +11 -0
  27. package/dist/project-data-paths.js +42 -0
  28. package/dist/project-data-paths.js.map +1 -0
  29. package/dist/project-kit-paths.d.ts +9 -0
  30. package/dist/project-kit-paths.js +21 -0
  31. package/dist/project-kit-paths.js.map +1 -0
  32. package/dist/runs/retention.js +1 -1
  33. package/dist/runs/retention.js.map +1 -1
  34. package/dist/runs/store.d.ts +1 -1
  35. package/dist/runs/store.js +3 -1
  36. package/dist/runs/store.js.map +1 -1
  37. package/dist/runs/task-refs.d.ts +8 -1
  38. package/dist/runs/task-refs.js +45 -10
  39. package/dist/runs/task-refs.js.map +1 -1
  40. package/dist/server/git-changes.js +2 -2
  41. package/dist/server/git-changes.js.map +1 -1
  42. package/dist/server/launch-key.d.ts +1 -1
  43. package/dist/server/launch-key.js +1 -1
  44. package/dist/server/open-in-terminal.js +2 -2
  45. package/dist/server/open-in-terminal.js.map +1 -1
  46. package/dist/server/project-context.d.ts +1 -1
  47. package/dist/server/project-context.js +2 -2
  48. package/dist/server/project-context.js.map +1 -1
  49. package/dist/server/server.js +14 -11
  50. package/dist/server/server.js.map +1 -1
  51. package/dist/skills-banner.d.ts +1 -1
  52. package/dist/skills-banner.js +1 -1
  53. package/dist/skills-remote.js +5 -5
  54. package/dist/skills-remote.js.map +1 -1
  55. package/dist/skills.d.ts +2 -2
  56. package/dist/skills.js +4 -3
  57. package/dist/skills.js.map +1 -1
  58. package/dist/todos.d.ts +1 -1
  59. package/dist/todos.js +1 -1
  60. package/dist/ui-state.d.ts +1 -1
  61. package/dist/ui-state.js +3 -2
  62. package/dist/ui-state.js.map +1 -1
  63. package/dist/workflows/load.d.ts +3 -2
  64. package/dist/workflows/load.js +8 -4
  65. package/dist/workflows/load.js.map +1 -1
  66. package/dist/workflows/run.d.ts +3 -3
  67. package/dist/workflows/run.js +7 -7
  68. package/dist/workflows/run.js.map +1 -1
  69. package/dist/workspace/config.js +1 -1
  70. package/dist/workspace/migrations.js +3 -2
  71. package/dist/workspace/migrations.js.map +1 -1
  72. package/dist/workspace/projects-cli.js +1 -1
  73. package/dist/workspace/projects-cli.js.map +1 -1
  74. package/dist/workspace/projects.d.ts +3 -3
  75. package/dist/workspace/projects.js +5 -6
  76. package/dist/workspace/projects.js.map +1 -1
  77. package/dist/workspace/ui-state.d.ts +1 -1
  78. package/dist/workspace/ui-state.js +1 -1
  79. package/package.json +5 -5
  80. package/web/dist/assets/{compare-variants-SR2zZfZq.js → compare-variants-C68kZAYC.js} +1 -1
  81. package/web/dist/assets/{git-toolbar-DZlZjTGz.js → git-toolbar-CuwdZGjY.js} +1 -1
  82. package/web/dist/assets/{github-CFURo9kf.js → github-BjeW9iJb.js} +1 -1
  83. package/web/dist/assets/index-Yp8woQLH.js +7 -0
  84. package/web/dist/assets/{repo-git-CJFDMauC.js → repo-git-C_w_dYCj.js} +1 -1
  85. package/web/dist/assets/skill-empty-hint-CL0g7WBL.js +1 -0
  86. package/web/dist/assets/{skills-Cs-auniL.js → skills-DoXLGvuf.js} +1 -1
  87. package/web/dist/assets/{task-changes-DYgNXOyY.js → task-changes-DZUO7q_X.js} +1 -1
  88. package/web/dist/assets/{task-commits-BRpZSz1G.js → task-commits-CRlMB09k.js} +1 -1
  89. package/web/dist/assets/{task-files-pKOwSyLh.js → task-files-CeDPRo86.js} +1 -1
  90. package/web/dist/assets/{task-thread-Bfyqqy-t.js → task-thread-Dhkupf1-.js} +1 -1
  91. package/web/dist/assets/thread-loading-ZhJref0J.js +1 -0
  92. package/web/dist/assets/{use-desktop-C31lOFUD.js → use-desktop-C-tsTFEF.js} +1 -1
  93. package/web/dist/assets/{workflows-BmOehP-A.js → workflows-kxdOo5D_.js} +2 -2
  94. package/web/dist/index.html +2 -2
  95. package/web/dist/assets/index-DlC81_GI.js +0 -7
  96. package/web/dist/assets/skill-empty-hint-DTu0LzaJ.js +0 -1
  97. package/web/dist/assets/thread-loading-GyH2Atwo.js +0 -1
@@ -1,3 +1,5 @@
1
+ import { projectDataDir } from '../project-data-paths.js';
2
+ import { projectKitDir } from '../project-kit-paths.js';
1
3
  import { existsSync, readFileSync, statSync } from 'node:fs';
2
4
  import { randomUUID } from 'node:crypto';
3
5
  import { AutomationStore } from '../automations/store.js';
@@ -30,7 +32,7 @@ import { PROVIDER_IDS, ProviderAuthService, providerAuthChecksDisabled, } from '
30
32
  import { applyProviderEnablement } from '../core/provider-availability.js';
31
33
  import { RunnerModelCatalog } from '../core/runner-model-catalog.js';
32
34
  import { currentUsage, onUsage } from '../core/process-usage.js';
33
- import { WORKFLOWS_DIR, loadWorkflows } from '../workflows/load.js';
35
+ import { projectWorkflowsDir, loadWorkflows } from '../workflows/load.js';
34
36
  import { QUICK_TASK_WORKFLOW, normalizeWorkflowDoc, skillStackOf, skillsToSteps, stepsIssue, workflowFileSchema, workflowStepSchema, } from '../workflows/types.js';
35
37
  import { planChain, slugify } from '../planner.js';
36
38
  import { discoverSkills } from '../skills.js';
@@ -327,7 +329,7 @@ const saveWorkflowSchema = z
327
329
  const parseWorkflowSchema = z.object({
328
330
  yaml: z.string().min(1).max(100_000),
329
331
  });
330
- // Small GUI preferences persisted in `.ai/xezar/ui-state.json` (files, not a
332
+ // Small GUI preferences persisted in `.local/xezar/ui-state.json` (files, not a
331
333
  // DB): today just the last-used task source, so the form preselects what you
332
334
  // actually run. Unknown keys pass through — future prefs won't need a schema
333
335
  // dance.
@@ -677,7 +679,7 @@ export function createApp(deps) {
677
679
  // handler body would silently pin it to the boot project, which the rename
678
680
  // turns into a compile error instead.
679
681
  const bootRoot = deps.repoRoot;
680
- const bootDataDir = join(bootRoot, '.ai/xezar');
682
+ const bootDataDir = deps.store.dataDir;
681
683
  const modelCatalog = deps.modelCatalog ?? new RunnerModelCatalog({
682
684
  adapters: {
683
685
  claude: { discover: () => discoverClaudeModels({ cwd: bootRoot }) },
@@ -795,7 +797,7 @@ export function createApp(deps) {
795
797
  // The boot project's context is SEEDED from the deps the caller already
796
798
  // built (src/index.ts `serveCommand` did the recover/prune/launch-key work
797
799
  // at startup — observable boot behavior unchanged); it never enters the
798
- // lazy map, so its `.ai/xezar` state is never double-opened. `id` starts as
800
+ // lazy map, so its `.local/xezar` state is never double-opened. `id` starts as
799
801
  // the reserved alias when registration was suppressed — handlers never read
800
802
  // it; API payloads name the boot project via `resolveBootProject` instead.
801
803
  const bootContext = {
@@ -2238,7 +2240,7 @@ export function createApp(deps) {
2238
2240
  // the per-row "Remove"). READ THIS BEFORE TOUCHING THE HANDLER: the ONLY
2239
2241
  // durable effect allowed here is dropping one entry from
2240
2242
  // `~/.xezar/config.json`. There is deliberately no `rm`, no `rmdir`, no
2241
- // `RunStore.open` (which would `mkdir` `<root>/.ai/xezar/runs` and therefore
2243
+ // `RunStore.open` (which would `mkdir` `<root>/.local/xezar/runs` and therefore
2242
2244
  // WRITE into a folder the user just asked us to forget) anywhere below —
2243
2245
  // `removeProject` is a registry filter and `contexts.dispose` only tears down
2244
2246
  // in-process handles. Re-registering the same root later finds every task,
@@ -2635,7 +2637,7 @@ export function createApp(deps) {
2635
2637
  const workflowsRoutes = new Hono()
2636
2638
  .get('/workflows', async (c) => c.json(await loadWorkflows(c.get('project').root)))
2637
2639
  // Save an approved plan as a reusable chain (spec 008): YAML in
2638
- // `.ai/xezar/workflows/<slug>.yaml` — from then on it's in the dropdown
2640
+ // `.xezar/workflows/<slug>.yaml` — from then on it's in the dropdown
2639
2641
  // like any other workflow.
2640
2642
  .post('/workflows', jsonZodValidator(saveWorkflowSchema), async (c) => {
2641
2643
  const { root: repoRoot } = c.get('project');
@@ -2645,7 +2647,7 @@ export function createApp(deps) {
2645
2647
  if (issue)
2646
2648
  return c.json({ error: issue }, 400);
2647
2649
  const slug = slugify(parsed.data.name) || 'chain';
2648
- const dir = join(repoRoot, WORKFLOWS_DIR);
2650
+ const dir = projectWorkflowsDir(repoRoot);
2649
2651
  const path = join(dir, `${slug}.yaml`);
2650
2652
  // Pure skill stacks are written in the portable compact form (spec 012) —
2651
2653
  // `name` + `skills:` — so the file imports cleanly in any repo.
@@ -2684,7 +2686,7 @@ export function createApp(deps) {
2684
2686
  if (wf.source !== 'file' || !wf.path) {
2685
2687
  return c.json({ error: 'built-in workflows cannot be deleted' }, 400);
2686
2688
  }
2687
- const dir = resolve(repoRoot, WORKFLOWS_DIR);
2689
+ const dir = resolve(projectWorkflowsDir(repoRoot));
2688
2690
  const target = resolve(wf.path);
2689
2691
  if (!target.startsWith(dir + sep)) {
2690
2692
  return c.json({ error: 'refusing to delete a file outside the workflows dir' }, 400);
@@ -4606,7 +4608,8 @@ export function createApp(deps) {
4606
4608
  return c.json(await configAnswer(repoRoot, await loadConfig(repoRoot)));
4607
4609
  })
4608
4610
  .put('/config', jsonZodValidator(() => setConfigSchema), async (c) => {
4609
- const { root: repoRoot, dataDir } = c.get('project');
4611
+ const { root: repoRoot } = c.get('project');
4612
+ const dataDir = projectKitDir(repoRoot);
4610
4613
  const parsed = { data: c.req.valid('json') };
4611
4614
  if (agentModelsLocked(repoRoot) && parsed.data.defaultModels !== undefined) {
4612
4615
  return c.json({ error: AGENT_MODELS_LOCKED_ERROR }, 409);
@@ -4916,7 +4919,7 @@ export function createApp(deps) {
4916
4919
  // lazy `/github/ref-status` route fills it in.
4917
4920
  const referenceStatuses = {};
4918
4921
  for (const project of projects) {
4919
- // No folder, no runs to read. `not-git` still has an `.ai/xezar` worth indexing.
4922
+ // No folder, no runs to read. `not-git` still has an `.local/xezar` worth indexing.
4920
4923
  if (project.status === 'missing')
4921
4924
  continue;
4922
4925
  const owned = project.id === bootId ? bootContext : contexts.peek(project.id);
@@ -4927,7 +4930,7 @@ export function createApp(deps) {
4927
4930
  // `GET /runs`, which has always carried them, and excluding them here would mean a task
4928
4931
  // is findable while you stand in its project and vanishes the moment you leave — the
4929
4932
  // exact asymmetry a cross-project finder exists to remove.
4930
- const recent = (owned ? owned.store.listRuns() : readRunIndexFromDisk(join(project.root, '.ai/xezar'))).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
4933
+ const recent = (owned ? owned.store.listRuns() : readRunIndexFromDisk(projectDataDir(project.root))).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
4931
4934
  if (recent.length > RUNS_INDEX_PER_PROJECT)
4932
4935
  truncated.push(project.id);
4933
4936
  const mentioned = [];