@letra-ai/cli 0.6.1 → 0.7.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.
Files changed (55) hide show
  1. package/dist/chunk-2GRNAFBQ.js +5305 -0
  2. package/dist/{chunk-MJ2QXNH6.js → chunk-42RST74I.js} +1 -1
  3. package/dist/chunk-HC24XMPZ.js +269 -0
  4. package/dist/chunk-LUPN3TRC.js +554 -0
  5. package/dist/{chunk-KGQLHMGZ.js → chunk-MUCIMQAU.js} +1918 -757
  6. package/dist/chunk-POGWTSEA.js +125 -0
  7. package/dist/chunk-TNF7XTFG.js +6178 -0
  8. package/dist/{chunk-BKAUN5QH.js → chunk-UMC5PDL2.js} +227 -33
  9. package/dist/{chunk-6HSUVCTR.js → chunk-YAQ2TKSK.js} +82 -30
  10. package/dist/client/assets/index-C-6kWNFi.js +232 -0
  11. package/dist/client/assets/index-QV-zN0V8.css +1 -0
  12. package/dist/client/index.html +2 -2
  13. package/dist/fallback-CXCCKHBA.js +56 -0
  14. package/dist/flow-serve-LFILD3EV.js +19 -0
  15. package/dist/{generate-N22QOXUF.js → generate-3R7POT7L.js} +4 -5
  16. package/dist/harness/default/v0.1.0/gates/all-acs-passing.yaml +1 -0
  17. package/dist/harness/default/v0.1.0/gates/has-spec-file.yaml +1 -0
  18. package/dist/harness/default/v0.1.1/gates/all-acs-passing.yaml +1 -0
  19. package/dist/harness/default/v0.1.1/gates/has-spec-file.yaml +1 -0
  20. package/dist/harness/default/v0.1.2/gates/all-acs-passing.yaml +1 -0
  21. package/dist/harness/default/v0.1.2/gates/has-spec-file.yaml +1 -0
  22. package/dist/harness/default/v0.1.3/gates/all-acs-passing.yaml +1 -0
  23. package/dist/harness/default/v0.1.3/gates/has-spec-file.yaml +1 -0
  24. package/dist/harness/default/v0.2.0/executors/registry.yaml +17 -0
  25. package/dist/harness/default/v0.2.0/flows/flow-main.yaml +84 -4
  26. package/dist/harness/default/v0.2.0/gates/code-reviewed.yaml +1 -0
  27. package/dist/harness/default/v0.2.0/gates/human-approved.yaml +4 -3
  28. package/dist/harness/default/v0.2.0/gates/security-clear.yaml +1 -0
  29. package/dist/harness/default/v0.2.0/gates/spec-approved.yaml +3 -3
  30. package/dist/{health-record-YDVXEVLR.js → health-record-JO2ZTIMR.js} +2 -2
  31. package/dist/index.js +2237 -1104
  32. package/dist/{push-5JEYSXBY.js → push-2ZCQSOHF.js} +37 -49
  33. package/dist/server-WUYVNSH7.js +677 -0
  34. package/dist/service-SVEAXQBX.js +28 -0
  35. package/dist/service-TOBY3OHO.js +22 -0
  36. package/dist/service-USTAY5E3.js +62 -0
  37. package/dist/{session-log-WTQ5JBEN.js → session-log-X2Q4XKQN.js} +6 -2
  38. package/dist/specs-CQRB7LPA.js +21 -0
  39. package/dist/sync-LIVPQXEW.js +21 -0
  40. package/package.json +1 -1
  41. package/dist/chunk-4QDEU6KP.js +0 -2765
  42. package/dist/chunk-BTPFUKHG.js +0 -275
  43. package/dist/chunk-EDD55PWL.js +0 -119
  44. package/dist/chunk-ELBTIPYN.js +0 -256
  45. package/dist/chunk-IEFSLCJL.js +0 -837
  46. package/dist/chunk-MSF44WWE.js +0 -443
  47. package/dist/chunk-QIVKP3EY.js +0 -362
  48. package/dist/client/assets/index-BuABgOyz.js +0 -232
  49. package/dist/client/assets/index-CpseCZh9.css +0 -1
  50. package/dist/fallback-UXSZ4LNR.js +0 -47
  51. package/dist/flow-serve-MTB6KZMR.js +0 -19
  52. package/dist/focus-sync-3D3XWCTI.js +0 -17
  53. package/dist/server-FUP3APZA.js +0 -415
  54. package/dist/service-OGF7BMCQ.js +0 -21
  55. package/dist/sitrep-DJXTP3JO.js +0 -16
@@ -2,27 +2,23 @@
2
2
  import {
3
3
  generateAdapters,
4
4
  loadWorkflow
5
- } from "./chunk-4QDEU6KP.js";
6
- import "./chunk-BKAUN5QH.js";
5
+ } from "./chunk-2GRNAFBQ.js";
7
6
  import "./chunk-JMIC5NKB.js";
8
- import "./chunk-EDD55PWL.js";
9
- import "./chunk-MJ2QXNH6.js";
7
+ import "./chunk-42RST74I.js";
8
+ import "./chunk-UMC5PDL2.js";
10
9
  import {
11
- getLetraDir2 as getLetraDir,
12
- getSpecsDir,
10
+ LINK_FILE,
13
11
  isWorkspaceMode,
14
12
  resolveWorkspaceRoot
15
- } from "./chunk-6HSUVCTR.js";
16
- import {
17
- __require
18
- } from "./chunk-PDX44BCA.js";
13
+ } from "./chunk-YAQ2TKSK.js";
14
+ import "./chunk-PDX44BCA.js";
19
15
 
20
16
  // src/commands/push.ts
21
- import { existsSync, mkdirSync, cpSync } from "fs";
22
- import { join, relative } from "path";
17
+ import { existsSync, readFileSync, writeFileSync } from "fs";
18
+ import { join, relative, resolve } from "path";
23
19
  import chalk from "chalk";
24
20
  async function push(targetPath, options) {
25
- const cwd = targetPath ? join(process.cwd(), targetPath) : process.cwd();
21
+ const cwd = targetPath ? resolve(process.cwd(), targetPath) : process.cwd();
26
22
  const resolution = resolveWorkspaceRoot(cwd);
27
23
  if (!isWorkspaceMode(resolution)) {
28
24
  console.log(
@@ -48,16 +44,18 @@ async function push(targetPath, options) {
48
44
  `));
49
45
  }
50
46
  const files = [];
51
- const specsDir = getSpecsDir(resolution.workspaceDir);
52
- if (existsSync(specsDir)) {
53
- const targetSpecs = join(getLetraDir(targetDir), "specs");
54
- if (!existsSync(targetSpecs)) mkdirSync(targetSpecs, { recursive: true });
55
- if (!dryRun) {
56
- cpSync(specsDir, targetSpecs, { recursive: true, force: true });
57
- }
58
- const specFiles = readdirSyncSimple(specsDir);
59
- for (const f of specFiles) {
60
- files.push(`.letra/specs/${relative(specsDir, f)}`);
47
+ if (resolve(targetDir) !== resolve(workspaceDir)) {
48
+ const linkPath = join(targetDir, LINK_FILE);
49
+ if (existsSync(linkPath)) {
50
+ const linkedTarget = readFileSync(linkPath, "utf8").trim().split("\n")[0] ?? "";
51
+ if (!linkedTarget || resolve(targetDir, linkedTarget) !== resolve(workspaceDir)) {
52
+ console.log(chalk.red(` Conflito: ${LINK_FILE} j\xE1 aponta para outro workspace; nada foi alterado.`));
53
+ return;
54
+ }
55
+ } else {
56
+ files.push(LINK_FILE);
57
+ if (!dryRun) writeFileSync(linkPath, `${workspaceDir}
58
+ `, "utf8");
61
59
  }
62
60
  }
63
61
  const normalizedTarget = targetDir.replace(/\\/g, "/");
@@ -67,26 +65,23 @@ async function push(targetPath, options) {
67
65
  return locationPath === normalizedTarget || locationPath === relativeTarget || locationPath === targetPath;
68
66
  });
69
67
  const effectiveTools = targetConfig?.adapters && targetConfig.adapters.length > 0 ? targetConfig.adapters : workflow.tools;
70
- if (effectiveTools && effectiveTools.length > 0 && !dryRun) {
68
+ if (effectiveTools && effectiveTools.length > 0) {
71
69
  const activeStage = workflow.primaryItemId ? workflow.items.find((i) => i.id === workflow.primaryItemId)?.stage : workflow.items[0]?.stage;
72
- generateAdapters(targetDir, effectiveTools, {
73
- source: "flow-move",
74
- workflow: {
75
- name: workflow.name,
76
- stages: workflow.stages,
77
- items: workflow.items
78
- },
79
- activeStageId: activeStage || workflow.stages[0]?.id || "backlog",
80
- primaryItemId: workflow.primaryItemId || workflow.items[0]?.id,
81
- workspaceDir
82
- });
83
- files.push(
84
- "AGENTS.md",
85
- ".cursorrules",
86
- "CLAUDE.md",
87
- ".windsurfrules",
88
- ".github/copilot-instructions.md"
89
- );
70
+ for (const tool of effectiveTools) {
71
+ files.push(`adapters/${tool}/`);
72
+ if (!dryRun) generateAdapters(join(workspaceDir, "adapters", tool), [tool], {
73
+ source: "flow-move",
74
+ workflow: {
75
+ name: workflow.name,
76
+ stages: workflow.stages,
77
+ items: workflow.items
78
+ },
79
+ activeStageId: activeStage || workflow.stages[0]?.id || "backlog",
80
+ primaryItemId: workflow.primaryItemId || workflow.items[0]?.id,
81
+ workspaceDir,
82
+ contentRoot: workspaceDir
83
+ });
84
+ }
90
85
  }
91
86
  if (!quiet) {
92
87
  if (files.length === 0) {
@@ -104,13 +99,6 @@ async function push(targetPath, options) {
104
99
  }
105
100
  }
106
101
  }
107
- function readdirSyncSimple(dir) {
108
- try {
109
- return __require("fs").readdirSync(dir, { recursive: true });
110
- } catch {
111
- return [];
112
- }
113
- }
114
102
  export {
115
103
  push
116
104
  };