trellis 3.1.31 → 3.1.33
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 +10 -0
- package/README.md +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +320 -24
- package/dist/cli/lane.d.ts +6 -0
- package/dist/cli/lane.d.ts.map +1 -0
- package/dist/cms/client.d.ts +1 -1
- package/dist/cms/client.d.ts.map +1 -1
- package/dist/cms/index.js +0 -16
- package/dist/cms/types.d.ts +1 -1
- package/dist/cms/types.d.ts.map +1 -1
- package/dist/context/manager.d.ts +1 -1
- package/dist/context/manager.d.ts.map +1 -1
- package/dist/context/types.d.ts +1 -1
- package/dist/context/types.d.ts.map +1 -1
- package/dist/decisions/index.js +2 -2
- package/dist/engine.d.ts +86 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/{index-65z0xfjw.js → index-4cdr7x2x.js} +2 -2
- package/dist/{index-r5064492.js → index-nq520y6k.js} +7 -3
- package/dist/{index-v9b4hqa7.js → index-nzb3am4f.js} +4 -1
- package/dist/{index-8f2z3b0h.js → index-rv1p47gp.js} +996 -172
- package/dist/{index-1tv9sbwp.js → index-w5wccer3.js} +1 -1
- package/dist/{index-p3nnc7ac.js → index-xhcp6xrn.js} +462 -31
- package/dist/index.js +39 -7
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/plugins/agent-memory/graph-context-manager.d.ts +5 -0
- package/dist/plugins/agent-memory/graph-context-manager.d.ts.map +1 -1
- package/dist/{remote-manager-8qbz3mrn.js → remote-manager-xvbg4230.js} +4 -4
- package/dist/vcs/branch.d.ts +6 -0
- package/dist/vcs/branch.d.ts.map +1 -1
- package/dist/vcs/decompose.d.ts.map +1 -1
- package/dist/vcs/engine-context.d.ts +9 -2
- package/dist/vcs/engine-context.d.ts.map +1 -1
- package/dist/vcs/index.d.ts +2 -0
- package/dist/vcs/index.d.ts.map +1 -1
- package/dist/vcs/index.js +36 -4
- package/dist/vcs/issue.d.ts +2 -0
- package/dist/vcs/issue.d.ts.map +1 -1
- package/dist/vcs/lane-materialize.d.ts +45 -0
- package/dist/vcs/lane-materialize.d.ts.map +1 -0
- package/dist/vcs/lane-promote.d.ts +56 -0
- package/dist/vcs/lane-promote.d.ts.map +1 -0
- package/dist/vcs/lane.d.ts +55 -0
- package/dist/vcs/lane.d.ts.map +1 -0
- package/dist/vcs/op-log.d.ts +29 -0
- package/dist/vcs/op-log.d.ts.map +1 -0
- package/dist/vcs/types.d.ts +15 -1
- package/dist/vcs/types.d.ts.map +1 -1
- package/dist/watcher/ingestion.d.ts +1 -0
- package/dist/watcher/ingestion.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.1.32
|
|
4
|
+
|
|
5
|
+
- **Agent Lanes (W1–W4):** `trellis lane` — isolated per-agent op journals under `.trellis/lanes/`, `create` / `enter` / `leave` / `status` / `diff` / `promote` / `drop`.
|
|
6
|
+
- **`trellis lane promote`:** replay lane ops onto integration with `--dry-run`, `--explain`, and hard/soft/file conflict detection.
|
|
7
|
+
- **`trellis issue start`:** auto-creates and enters a lane (opt out with `--no-lane`).
|
|
8
|
+
- **`TRELLIS_LANE_ID`:** subprocess agents auto-enter the lane via `syncEnvLaneFromEnv()`.
|
|
9
|
+
- **Lazy replay (W4):** integration materialization cache; `leaveLane` restores integration view without full journal replay.
|
|
10
|
+
- **`getBranchHeadOpHash`:** latest `headOpHash` fact wins (fixes stale head during promote).
|
|
11
|
+
- **Op log lock:** configurable timeout via `TRELLIS_OPLOG_LOCK_MS`.
|
|
12
|
+
|
|
3
13
|
## 3.1.14
|
|
4
14
|
|
|
5
15
|
- CLI `trellis --version` now reports the real package version from `package.json` (was hardcoded `0.1.0`).
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ const off = cms.collection('blogpost').subscribe(
|
|
|
104
104
|
off();
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
- **Collections**: `cms.collections()` returns
|
|
107
|
+
- **Collections**: `cms.collections()` returns `TypeSchema` collections marked with `cms=true`.
|
|
108
108
|
- **Schema**: `cms.collection('blogpost').schema()` returns field definitions including types, labels, requirements, formulas, and targets.
|
|
109
109
|
- **Normalized keys**: `cms.collection('blogpost')` matches stored entity types like `BlogPost`.
|
|
110
110
|
- **References**: `expand` resolves reference ids from facts and graph links into nested entries.
|
package/dist/cli/index.d.ts
CHANGED
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;GAWG;AA0CH,MAAM,MAAM,OAAO,GACf,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,MAAM,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,KAAK,GACL,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,MAAM,GACN,KAAK,GACL,MAAM,GACN,KAAK,GACL,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -2,25 +2,27 @@
|
|
|
2
2
|
// @bun
|
|
3
3
|
import {
|
|
4
4
|
seedContext
|
|
5
|
-
} from "../index-
|
|
5
|
+
} from "../index-w5wccer3.js";
|
|
6
6
|
import {
|
|
7
7
|
TrellisVcsEngine,
|
|
8
|
+
formatPromoteExplain,
|
|
8
9
|
hasProfile,
|
|
9
10
|
inferProjectContext,
|
|
10
11
|
init_engine,
|
|
12
|
+
init_lane_promote,
|
|
11
13
|
loadProfile,
|
|
12
14
|
promptForProfile,
|
|
13
15
|
saveProfile,
|
|
14
16
|
updateProfile,
|
|
15
17
|
writeAgentScaffold,
|
|
16
18
|
writeIdeScaffold
|
|
17
|
-
} from "../index-
|
|
19
|
+
} from "../index-rv1p47gp.js";
|
|
18
20
|
import {
|
|
19
21
|
OntologyRegistry,
|
|
20
22
|
builtinOntologies,
|
|
21
23
|
validateStore
|
|
22
24
|
} from "../index-w7ng765c.js";
|
|
23
|
-
import"../index-
|
|
25
|
+
import"../index-xhcp6xrn.js";
|
|
24
26
|
import {
|
|
25
27
|
VectorStore,
|
|
26
28
|
buildRAGContext,
|
|
@@ -37,11 +39,11 @@ import {
|
|
|
37
39
|
exports_links,
|
|
38
40
|
init_links
|
|
39
41
|
} from "../index-vkpkfwhq.js";
|
|
40
|
-
import"../index-
|
|
42
|
+
import"../index-4cdr7x2x.js";
|
|
41
43
|
import {
|
|
42
44
|
createVcsOp,
|
|
43
45
|
init_ops
|
|
44
|
-
} from "../index-
|
|
46
|
+
} from "../index-nzb3am4f.js";
|
|
45
47
|
import {
|
|
46
48
|
parseQuery,
|
|
47
49
|
parseSimple
|
|
@@ -5760,6 +5762,276 @@ function failNotRepo(start, pathOpt) {
|
|
|
5760
5762
|
process.exit(1);
|
|
5761
5763
|
}
|
|
5762
5764
|
|
|
5765
|
+
// src/cli/lane.ts
|
|
5766
|
+
init_engine();
|
|
5767
|
+
init_lane_promote();
|
|
5768
|
+
function formatRelativeTime(iso) {
|
|
5769
|
+
const diff = Date.now() - new Date(iso).getTime();
|
|
5770
|
+
if (diff < 60000)
|
|
5771
|
+
return "just now";
|
|
5772
|
+
if (diff < 3600000)
|
|
5773
|
+
return `${Math.floor(diff / 60000)}m ago`;
|
|
5774
|
+
if (diff < 86400000)
|
|
5775
|
+
return `${Math.floor(diff / 3600000)}h ago`;
|
|
5776
|
+
return `${Math.floor(diff / 86400000)}d ago`;
|
|
5777
|
+
}
|
|
5778
|
+
function formatLaneStatus(status) {
|
|
5779
|
+
switch (status) {
|
|
5780
|
+
case "active":
|
|
5781
|
+
return source_default.green("active");
|
|
5782
|
+
case "promoting":
|
|
5783
|
+
return source_default.yellow("promoting");
|
|
5784
|
+
case "promoted":
|
|
5785
|
+
return source_default.blue("promoted");
|
|
5786
|
+
case "dropped":
|
|
5787
|
+
return source_default.dim("dropped");
|
|
5788
|
+
default:
|
|
5789
|
+
return status;
|
|
5790
|
+
}
|
|
5791
|
+
}
|
|
5792
|
+
async function openEngine(rootPath) {
|
|
5793
|
+
const engine = new TrellisVcsEngine({ rootPath });
|
|
5794
|
+
engine.open();
|
|
5795
|
+
await engine.syncEnvLaneFromEnv();
|
|
5796
|
+
return engine;
|
|
5797
|
+
}
|
|
5798
|
+
function isStaleLane(lane) {
|
|
5799
|
+
if (lane.status !== "active")
|
|
5800
|
+
return false;
|
|
5801
|
+
if (lane.leaseExpiresAt) {
|
|
5802
|
+
return Date.now() > new Date(lane.leaseExpiresAt).getTime();
|
|
5803
|
+
}
|
|
5804
|
+
const ageMs = Date.now() - new Date(lane.createdAt).getTime();
|
|
5805
|
+
return ageMs > 24 * 60 * 60 * 1000;
|
|
5806
|
+
}
|
|
5807
|
+
function registerLaneCommands(program2) {
|
|
5808
|
+
const laneCmd = program2.command("lane").description("Agent lanes \u2014 isolated op journals for multi-agent work");
|
|
5809
|
+
laneCmd.command("fork <parentId>").description("Fork a sibling lane from an existing lane (ADR 0006)").option("--session <id>", "New session id for the fork").option("--issue <id>", "Issue id override (default: inherit from parent)").option("--child", "Child fork from parent lane head (ADR 0007)").option("--worktree <path>", "Optional git worktree path (W5)").option("-p, --path <path>", "Repository path", ".").action(async (parentId, opts) => {
|
|
5810
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5811
|
+
const engine = await openEngine(rootPath);
|
|
5812
|
+
try {
|
|
5813
|
+
const meta = await engine.forkLane(parentId, {
|
|
5814
|
+
sessionId: opts.session,
|
|
5815
|
+
issueId: opts.issue,
|
|
5816
|
+
worktreePath: opts.worktree,
|
|
5817
|
+
forkKind: opts.child ? "child" : "sibling"
|
|
5818
|
+
});
|
|
5819
|
+
console.log(source_default.green(`\u2713 Lane forked: ${source_default.bold(meta.id)}`));
|
|
5820
|
+
console.log(` ${source_default.dim("Parent:")} ${parentId}`);
|
|
5821
|
+
console.log(` ${source_default.dim("Base:")} ${meta.baseBranch} @ ${meta.baseOpHash.slice(0, 20)}\u2026`);
|
|
5822
|
+
if (meta.issueId) {
|
|
5823
|
+
console.log(` ${source_default.dim("Issue:")} ${meta.issueId}`);
|
|
5824
|
+
}
|
|
5825
|
+
if (meta.sessionId) {
|
|
5826
|
+
console.log(` ${source_default.dim("Session:")} ${meta.sessionId}`);
|
|
5827
|
+
}
|
|
5828
|
+
if (meta.forkKind) {
|
|
5829
|
+
console.log(` ${source_default.dim("Fork kind:")} ${meta.forkKind}`);
|
|
5830
|
+
}
|
|
5831
|
+
if (meta.virtualBaseOpHash) {
|
|
5832
|
+
console.log(` ${source_default.dim("Virtual base:")} ${meta.virtualBaseOpHash.slice(0, 20)}\u2026`);
|
|
5833
|
+
}
|
|
5834
|
+
console.log(source_default.dim(` Enter: trellis lane enter ${meta.id} | export TRELLIS_LANE_ID=${meta.id}`));
|
|
5835
|
+
} catch (err) {
|
|
5836
|
+
console.error(source_default.red(err.message));
|
|
5837
|
+
process.exit(1);
|
|
5838
|
+
}
|
|
5839
|
+
});
|
|
5840
|
+
laneCmd.command("create").description("Create a lane forked from the integration branch head").option("--from <branch>", "Base branch (default: current)").option("--to <branch>", "Promotion target branch").option("--issue <id>", "Link to issue id").option("--agent <agentId>", "Agent attribution override").option("--worktree <path>", "Optional git worktree path (W5)").option("-p, --path <path>", "Repository path", ".").action(async (opts) => {
|
|
5841
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5842
|
+
const engine = await openEngine(rootPath);
|
|
5843
|
+
try {
|
|
5844
|
+
const meta = await engine.createLane({
|
|
5845
|
+
fromBranch: opts.from,
|
|
5846
|
+
targetBranch: opts.to,
|
|
5847
|
+
issueId: opts.issue,
|
|
5848
|
+
worktreePath: opts.worktree
|
|
5849
|
+
});
|
|
5850
|
+
console.log(source_default.green(`\u2713 Lane created: ${source_default.bold(meta.id)}`));
|
|
5851
|
+
console.log(` ${source_default.dim("Base:")} ${meta.baseBranch} @ ${meta.baseOpHash.slice(0, 20)}\u2026`);
|
|
5852
|
+
console.log(` ${source_default.dim("Target:")} ${meta.targetBranch}`);
|
|
5853
|
+
if (meta.issueId) {
|
|
5854
|
+
console.log(` ${source_default.dim("Issue:")} ${meta.issueId}`);
|
|
5855
|
+
}
|
|
5856
|
+
console.log(source_default.dim(` Enter: trellis lane enter ${meta.id} | export TRELLIS_LANE_ID=${meta.id}`));
|
|
5857
|
+
} catch (err) {
|
|
5858
|
+
console.error(source_default.red(err.message));
|
|
5859
|
+
process.exit(1);
|
|
5860
|
+
}
|
|
5861
|
+
});
|
|
5862
|
+
laneCmd.command("list").description("List agent lanes").option("--active", "Show only active lanes").option("--stale", "Show only stale active lanes (lease expired or >24h)").option("-p, --path <path>", "Repository path", ".").action(async (opts) => {
|
|
5863
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5864
|
+
const engine = await openEngine(rootPath);
|
|
5865
|
+
let lanes = engine.listLanes();
|
|
5866
|
+
if (opts.active) {
|
|
5867
|
+
lanes = lanes.filter((l) => l.status === "active");
|
|
5868
|
+
}
|
|
5869
|
+
if (opts.stale) {
|
|
5870
|
+
lanes = lanes.filter((l) => isStaleLane(l));
|
|
5871
|
+
}
|
|
5872
|
+
if (lanes.length === 0) {
|
|
5873
|
+
console.log(source_default.dim("No lanes"));
|
|
5874
|
+
return;
|
|
5875
|
+
}
|
|
5876
|
+
console.log(source_default.bold(`Agent Lanes
|
|
5877
|
+
`));
|
|
5878
|
+
for (const lane of lanes) {
|
|
5879
|
+
const marker = engine.getActiveLaneId() === lane.id ? source_default.green("* ") : " ";
|
|
5880
|
+
const opCount = engine.getLaneOpCount(lane.id);
|
|
5881
|
+
const issue = lane.issueId ? source_default.dim(` \xB7 ${lane.issueId}`) : "";
|
|
5882
|
+
console.log(`${marker}${source_default.cyan(lane.id)} ${formatLaneStatus(lane.status)} ${source_default.dim(`${opCount} ops`)}${issue}`);
|
|
5883
|
+
console.log(` ${source_default.dim("fork")} ${lane.baseBranch} \xB7 ${formatRelativeTime(lane.createdAt)}`);
|
|
5884
|
+
if (lane.parentLaneId) {
|
|
5885
|
+
console.log(` ${source_default.dim("from")} ${lane.parentLaneId}${lane.forkKind ? ` (${lane.forkKind})` : ""}`);
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5888
|
+
});
|
|
5889
|
+
laneCmd.command("enter <id>").description("Enter a lane (route writes to lane journal)").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
5890
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5891
|
+
const engine = await openEngine(rootPath);
|
|
5892
|
+
try {
|
|
5893
|
+
await engine.enterLane(id);
|
|
5894
|
+
console.log(source_default.green(`\u2713 Entered lane ${source_default.bold(id)}`));
|
|
5895
|
+
console.log(source_default.dim(` export TRELLIS_LANE_ID=${id} for subprocess agents`));
|
|
5896
|
+
} catch (err) {
|
|
5897
|
+
console.error(source_default.red(err.message));
|
|
5898
|
+
process.exit(1);
|
|
5899
|
+
}
|
|
5900
|
+
});
|
|
5901
|
+
laneCmd.command("leave").description("Leave the active lane").option("-p, --path <path>", "Repository path", ".").action(async (opts) => {
|
|
5902
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5903
|
+
const engine = await openEngine(rootPath);
|
|
5904
|
+
const active = engine.getActiveLaneId();
|
|
5905
|
+
if (!active) {
|
|
5906
|
+
console.log(source_default.dim("No active lane"));
|
|
5907
|
+
return;
|
|
5908
|
+
}
|
|
5909
|
+
await engine.leaveLane();
|
|
5910
|
+
console.log(source_default.green(`\u2713 Left lane ${source_default.bold(active)}`));
|
|
5911
|
+
});
|
|
5912
|
+
laneCmd.command("status").description("Show active lane or a specific lane").argument("[id]", "Lane id (default: active session)").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
5913
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5914
|
+
const engine = await openEngine(rootPath);
|
|
5915
|
+
const laneId = id ?? engine.getActiveLaneId();
|
|
5916
|
+
if (!laneId) {
|
|
5917
|
+
console.log(source_default.dim("No active lane"));
|
|
5918
|
+
return;
|
|
5919
|
+
}
|
|
5920
|
+
const summary = engine.summarizeLane(laneId);
|
|
5921
|
+
const { meta, ops, filePaths, integrationHead } = summary;
|
|
5922
|
+
const active = engine.getActiveLaneId() === laneId;
|
|
5923
|
+
console.log(source_default.bold(`Lane ${meta.id}${active ? source_default.green(" (active)") : ""}
|
|
5924
|
+
`));
|
|
5925
|
+
console.log(` ${source_default.dim("Status:")} ${formatLaneStatus(meta.status)}`);
|
|
5926
|
+
console.log(` ${source_default.dim("Base:")} ${meta.baseBranch} @ ${meta.baseOpHash}`);
|
|
5927
|
+
console.log(` ${source_default.dim("Target:")} ${meta.targetBranch}`);
|
|
5928
|
+
console.log(` ${source_default.dim("Head:")} ${meta.headOpHash ?? "\u2014"}`);
|
|
5929
|
+
console.log(` ${source_default.dim("Ops:")} ${ops.length} in lane journal`);
|
|
5930
|
+
console.log(` ${source_default.dim("Integration:")} ${integrationHead ?? "\u2014"} (${meta.targetBranch} head)`);
|
|
5931
|
+
if (meta.issueId) {
|
|
5932
|
+
console.log(` ${source_default.dim("Issue:")} ${meta.issueId}`);
|
|
5933
|
+
}
|
|
5934
|
+
if (meta.parentLaneId) {
|
|
5935
|
+
console.log(` ${source_default.dim("Parent:")} ${meta.parentLaneId}`);
|
|
5936
|
+
}
|
|
5937
|
+
if (meta.forkKind) {
|
|
5938
|
+
console.log(` ${source_default.dim("Fork kind:")} ${meta.forkKind}`);
|
|
5939
|
+
}
|
|
5940
|
+
if (meta.virtualBaseOpHash) {
|
|
5941
|
+
console.log(` ${source_default.dim("Virtual base:")} ${meta.virtualBaseOpHash.slice(0, 20)}\u2026`);
|
|
5942
|
+
}
|
|
5943
|
+
if (meta.sessionId) {
|
|
5944
|
+
console.log(` ${source_default.dim("Session:")} ${meta.sessionId}`);
|
|
5945
|
+
}
|
|
5946
|
+
if (meta.agentId) {
|
|
5947
|
+
console.log(` ${source_default.dim("Agent:")} ${meta.agentId}`);
|
|
5948
|
+
}
|
|
5949
|
+
if (filePaths.length > 0) {
|
|
5950
|
+
console.log(` ${source_default.dim("Files:")} ${filePaths.length} touched`);
|
|
5951
|
+
}
|
|
5952
|
+
if (active) {
|
|
5953
|
+
const mat = engine.getMaterializationStats();
|
|
5954
|
+
const cacheLabel = mat.integrationCacheHit ? source_default.green("hit") : source_default.yellow("miss");
|
|
5955
|
+
console.log(` ${source_default.dim("Materialize:")} integration replay ${mat.integrationOpsReplayed} ops (${cacheLabel}), lane overlay ${mat.laneOpsReplayed} ops`);
|
|
5956
|
+
}
|
|
5957
|
+
});
|
|
5958
|
+
laneCmd.command("diff <id>").description("Summarize lane journal vs integration head").option("--to <branch>", "Integration branch (default: lane target)").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
5959
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5960
|
+
const engine = await openEngine(rootPath);
|
|
5961
|
+
try {
|
|
5962
|
+
const { meta, ops, filePaths, integrationHead } = engine.summarizeLane(id);
|
|
5963
|
+
const target = opts.to ?? meta.targetBranch;
|
|
5964
|
+
console.log(source_default.bold(`Lane diff: ${id}
|
|
5965
|
+
`));
|
|
5966
|
+
console.log(` ${source_default.dim("Fork base:")} ${meta.baseOpHash}`);
|
|
5967
|
+
console.log(` ${source_default.dim("Integration head:")} ${integrationHead ?? "\u2014"} (${target})`);
|
|
5968
|
+
console.log(` ${source_default.dim("Lane ops:")} ${ops.length}`);
|
|
5969
|
+
console.log(` ${source_default.dim("Kinds:")} ${summarizeOpKinds(ops)}`);
|
|
5970
|
+
if (filePaths.length > 0) {
|
|
5971
|
+
console.log(`
|
|
5972
|
+
${source_default.bold("Touched files")}`);
|
|
5973
|
+
for (const path of filePaths.slice(0, 20)) {
|
|
5974
|
+
console.log(` ${path}`);
|
|
5975
|
+
}
|
|
5976
|
+
if (filePaths.length > 20) {
|
|
5977
|
+
console.log(source_default.dim(` \u2026 and ${filePaths.length - 20} more`));
|
|
5978
|
+
}
|
|
5979
|
+
}
|
|
5980
|
+
console.log(source_default.dim(`
|
|
5981
|
+
Promote: trellis lane promote ${id}`));
|
|
5982
|
+
} catch (err) {
|
|
5983
|
+
console.error(source_default.red(err.message));
|
|
5984
|
+
process.exit(1);
|
|
5985
|
+
}
|
|
5986
|
+
});
|
|
5987
|
+
laneCmd.command("promote <id>").description("Promote lane ops onto the integration branch").option("--to <branch>", "Target branch (default: lane target)").option("--dry-run", "Run conflict detection only; no writes").option("--explain", "Human-readable conflict report").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
5988
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
5989
|
+
const engine = await openEngine(rootPath);
|
|
5990
|
+
try {
|
|
5991
|
+
const result = await engine.promoteLane(id, {
|
|
5992
|
+
dryRun: opts.dryRun,
|
|
5993
|
+
explain: opts.explain,
|
|
5994
|
+
toBranch: opts.to
|
|
5995
|
+
});
|
|
5996
|
+
if (opts.explain || opts.dryRun || !result.canPromote) {
|
|
5997
|
+
console.log(formatPromoteExplain(result));
|
|
5998
|
+
}
|
|
5999
|
+
if (result.promoted) {
|
|
6000
|
+
console.log(source_default.green(`\u2713 Promoted ${source_default.bold(id)} \u2014 ${result.integrationOpsAppended ?? 0} integration ops`));
|
|
6001
|
+
} else if (!opts.dryRun && !result.canPromote) {
|
|
6002
|
+
process.exit(1);
|
|
6003
|
+
} else if (opts.dryRun && !result.canPromote) {
|
|
6004
|
+
console.log(source_default.dim(`
|
|
6005
|
+
Nothing to promote \u2014 add lane ops first`));
|
|
6006
|
+
} else if (opts.dryRun && result.canPromote) {
|
|
6007
|
+
console.log(source_default.dim(`
|
|
6008
|
+
Run without --dry-run to apply`));
|
|
6009
|
+
}
|
|
6010
|
+
} catch (err) {
|
|
6011
|
+
console.error(source_default.red(err.message));
|
|
6012
|
+
process.exit(1);
|
|
6013
|
+
}
|
|
6014
|
+
});
|
|
6015
|
+
laneCmd.command("drop <id>").description("Drop a lane (archive journal on disk)").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
6016
|
+
const rootPath = resolveRepoRoot(opts.path);
|
|
6017
|
+
const engine = await openEngine(rootPath);
|
|
6018
|
+
try {
|
|
6019
|
+
await engine.dropLane(id);
|
|
6020
|
+
console.log(source_default.green(`\u2713 Dropped lane ${source_default.bold(id)}`));
|
|
6021
|
+
} catch (err) {
|
|
6022
|
+
console.error(source_default.red(err.message));
|
|
6023
|
+
process.exit(1);
|
|
6024
|
+
}
|
|
6025
|
+
});
|
|
6026
|
+
}
|
|
6027
|
+
function summarizeOpKinds(ops) {
|
|
6028
|
+
const counts = new Map;
|
|
6029
|
+
for (const op of ops) {
|
|
6030
|
+
counts.set(op.kind, (counts.get(op.kind) ?? 0) + 1);
|
|
6031
|
+
}
|
|
6032
|
+
return [...counts.entries()].map(([kind, n]) => `${kind.replace("vcs:", "")}:${n}`).join(", ");
|
|
6033
|
+
}
|
|
6034
|
+
|
|
5763
6035
|
// src/cli/index.ts
|
|
5764
6036
|
var program2 = new Command;
|
|
5765
6037
|
program2.name("trellis").description("TrellisVCS \u2014 graph-native, code-first version control").version(cliVersion());
|
|
@@ -6081,7 +6353,7 @@ program2.command("status").description("Show current repository status").option(
|
|
|
6081
6353
|
for (const op of display) {
|
|
6082
6354
|
const kind = formatOpKind(op.kind);
|
|
6083
6355
|
const file = op.vcs?.filePath ?? "";
|
|
6084
|
-
const time =
|
|
6356
|
+
const time = formatRelativeTime2(op.timestamp);
|
|
6085
6357
|
console.log(` ${kind} ${source_default.white(file)} ${source_default.dim(time)}`);
|
|
6086
6358
|
}
|
|
6087
6359
|
}
|
|
@@ -6095,7 +6367,7 @@ program2.command("log").description("Show operation history").option("-p, --path
|
|
|
6095
6367
|
filePath: opts.file
|
|
6096
6368
|
});
|
|
6097
6369
|
if (opts.remote || opts.all) {
|
|
6098
|
-
const { RemoteManager } = await import("../remote-manager-
|
|
6370
|
+
const { RemoteManager } = await import("../remote-manager-xvbg4230.js");
|
|
6099
6371
|
const remoteManager = new RemoteManager(join6(rootPath, ".trellis"));
|
|
6100
6372
|
if (opts.all) {
|
|
6101
6373
|
const remotes = remoteManager.listRemotes();
|
|
@@ -6130,7 +6402,7 @@ program2.command("log").description("Show operation history").option("-p, --path
|
|
|
6130
6402
|
for (const op of remoteOps.reverse()) {
|
|
6131
6403
|
const kind = formatOpKind(op.kind);
|
|
6132
6404
|
const hash = source_default.dim(op.hash.slice(0, 28) + "\u2026");
|
|
6133
|
-
const time =
|
|
6405
|
+
const time = formatRelativeTime2(op.timestamp);
|
|
6134
6406
|
const file = op.vcs?.filePath ? source_default.white(op.vcs.filePath) : "";
|
|
6135
6407
|
const rename = op.vcs?.oldFilePath ? source_default.dim(` (from ${op.vcs.oldFilePath})`) : "";
|
|
6136
6408
|
console.log(` ${hash} ${kind} ${file}${rename} ${source_default.dim(time)}`);
|
|
@@ -6160,7 +6432,12 @@ program2.command("watch").description("Start file watcher (foreground, Ctrl+C to
|
|
|
6160
6432
|
const rootPath = resolveRepoRoot(opts.path);
|
|
6161
6433
|
const engine = new TrellisVcsEngine({ rootPath });
|
|
6162
6434
|
engine.open();
|
|
6435
|
+
await engine.syncEnvLaneFromEnv();
|
|
6436
|
+
const laneId = engine.getActiveLaneId();
|
|
6163
6437
|
console.log(source_default.green("\u2713 Watching for changes\u2026") + source_default.dim(" (Ctrl+C to stop)"));
|
|
6438
|
+
if (laneId) {
|
|
6439
|
+
console.log(source_default.dim(` Lane: ${laneId} (writes \u2192 lane journal)`));
|
|
6440
|
+
}
|
|
6164
6441
|
console.log();
|
|
6165
6442
|
const originalWatch = engine.watch.bind(engine);
|
|
6166
6443
|
engine.watch();
|
|
@@ -6288,7 +6565,7 @@ program2.command("branch").description("Manage branches").argument("[name]", "Br
|
|
|
6288
6565
|
for (const b of branches) {
|
|
6289
6566
|
const marker = b.isCurrent ? source_default.green("* ") : " ";
|
|
6290
6567
|
const name2 = b.isCurrent ? source_default.green(b.name) : b.name;
|
|
6291
|
-
const age = b.createdAt ? source_default.dim(
|
|
6568
|
+
const age = b.createdAt ? source_default.dim(formatRelativeTime2(b.createdAt)) : "";
|
|
6292
6569
|
console.log(`${marker}${name2} ${age}`);
|
|
6293
6570
|
}
|
|
6294
6571
|
});
|
|
@@ -6324,7 +6601,7 @@ program2.command("milestone").description("Create or list milestones").argument(
|
|
|
6324
6601
|
console.log(source_default.bold(`Milestones (${milestones.length})
|
|
6325
6602
|
`));
|
|
6326
6603
|
for (const m of milestones) {
|
|
6327
|
-
const age = m.createdAt ?
|
|
6604
|
+
const age = m.createdAt ? formatRelativeTime2(m.createdAt) : "";
|
|
6328
6605
|
console.log(` ${source_default.cyan("\u2605")} ${source_default.bold(m.message ?? "(no message)")}`);
|
|
6329
6606
|
console.log(` ${source_default.dim("ID:")} ${m.id} ${source_default.dim(age)}`);
|
|
6330
6607
|
if (m.affectedFiles.length > 0) {
|
|
@@ -6357,7 +6634,7 @@ program2.command("checkpoint").description("Create or list checkpoints").argumen
|
|
|
6357
6634
|
console.log(source_default.bold(`Checkpoints (${checkpoints.length})
|
|
6358
6635
|
`));
|
|
6359
6636
|
for (const cp of checkpoints) {
|
|
6360
|
-
const age = cp.createdAt ?
|
|
6637
|
+
const age = cp.createdAt ? formatRelativeTime2(cp.createdAt) : "";
|
|
6361
6638
|
console.log(` ${source_default.dim("\u25CF")} ${cp.id.slice(0, 32)} ${source_default.dim(cp.trigger ?? "")} ${source_default.dim(age)}`);
|
|
6362
6639
|
}
|
|
6363
6640
|
});
|
|
@@ -6688,7 +6965,7 @@ function formatClusterStatus(status) {
|
|
|
6688
6965
|
function printClusterSummary(c) {
|
|
6689
6966
|
console.log(` ${source_default.cyan("\u2740")} ${source_default.bold(c.id)} ${formatClusterStatus(c.status)} ${source_default.dim(c.detectedBy)}`);
|
|
6690
6967
|
console.log(` ${source_default.dim("Ops:")} ${c.ops.length} ${source_default.dim("Files:")} ${c.affectedFiles.slice(0, 3).join(", ")}${c.affectedFiles.length > 3 ? ` +${c.affectedFiles.length - 3}` : ""}`);
|
|
6691
|
-
console.log(` ${source_default.dim("Created:")} ${
|
|
6968
|
+
console.log(` ${source_default.dim("Created:")} ${formatRelativeTime2(c.createdAt)} ${source_default.dim("Abandoned:")} ${formatRelativeTime2(c.abandonedAt)}`);
|
|
6692
6969
|
console.log();
|
|
6693
6970
|
}
|
|
6694
6971
|
function formatIssueStatus(status) {
|
|
@@ -6779,7 +7056,7 @@ issueCmd.command("list").description("List issues").option("--status <status>",
|
|
|
6779
7056
|
parentId: opts.parent
|
|
6780
7057
|
});
|
|
6781
7058
|
if (opts.remote || opts.all) {
|
|
6782
|
-
const { RemoteManager } = await import("../remote-manager-
|
|
7059
|
+
const { RemoteManager } = await import("../remote-manager-xvbg4230.js");
|
|
6783
7060
|
const remoteManager = new RemoteManager(join6(rootPath, ".trellis"));
|
|
6784
7061
|
if (opts.all) {
|
|
6785
7062
|
const remotes = remoteManager.listRemotes();
|
|
@@ -6859,13 +7136,13 @@ issueCmd.command("show").description("Show issue details").argument("<id>", "Iss
|
|
|
6859
7136
|
console.log(` ${source_default.dim("Blocking:")} ${issue.blocking.map((b) => source_default.cyan(b)).join(", ")}`);
|
|
6860
7137
|
}
|
|
6861
7138
|
if (issue.createdAt) {
|
|
6862
|
-
console.log(` ${source_default.dim("Created:")} ${
|
|
7139
|
+
console.log(` ${source_default.dim("Created:")} ${formatRelativeTime2(issue.createdAt)}`);
|
|
6863
7140
|
}
|
|
6864
7141
|
if (issue.startedAt) {
|
|
6865
|
-
console.log(` ${source_default.dim("Started:")} ${
|
|
7142
|
+
console.log(` ${source_default.dim("Started:")} ${formatRelativeTime2(issue.startedAt)}`);
|
|
6866
7143
|
}
|
|
6867
7144
|
if (issue.closedAt) {
|
|
6868
|
-
console.log(` ${source_default.dim("Closed:")} ${
|
|
7145
|
+
console.log(` ${source_default.dim("Closed:")} ${formatRelativeTime2(issue.closedAt)}`);
|
|
6869
7146
|
}
|
|
6870
7147
|
if (issue.criteria.length > 0) {
|
|
6871
7148
|
console.log(`
|
|
@@ -6877,11 +7154,11 @@ issueCmd.command("show").description("Show issue details").argument("<id>", "Iss
|
|
|
6877
7154
|
}
|
|
6878
7155
|
}
|
|
6879
7156
|
});
|
|
6880
|
-
issueCmd.command("start").description("Start working on an issue (creates branch, auto-assigns)").argument("<id>", "Issue ID").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
7157
|
+
issueCmd.command("start").description("Start working on an issue (creates branch, lane, auto-assigns)").argument("<id>", "Issue ID").option("--no-lane", "Skip auto-create/enter agent lane").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
6881
7158
|
const rootPath = resolveRepoRoot(opts.path);
|
|
6882
7159
|
const engine = new TrellisVcsEngine({ rootPath });
|
|
6883
7160
|
engine.open();
|
|
6884
|
-
|
|
7161
|
+
await engine.startIssue(id, { lane: !opts.noLane });
|
|
6885
7162
|
const issue = engine.getIssue(id);
|
|
6886
7163
|
console.log(source_default.green(`\u2713 Started issue ${source_default.bold(id)}`));
|
|
6887
7164
|
if (issue?.branchName) {
|
|
@@ -6890,6 +7167,11 @@ issueCmd.command("start").description("Start working on an issue (creates branch
|
|
|
6890
7167
|
if (issue?.assignee) {
|
|
6891
7168
|
console.log(` ${source_default.dim("Assignee:")} ${issue.assignee}`);
|
|
6892
7169
|
}
|
|
7170
|
+
const laneId = engine.getActiveLaneId();
|
|
7171
|
+
if (laneId) {
|
|
7172
|
+
console.log(` ${source_default.dim("Lane:")} ${laneId}`);
|
|
7173
|
+
console.log(source_default.dim(` export TRELLIS_LANE_ID=${laneId}`));
|
|
7174
|
+
}
|
|
6893
7175
|
});
|
|
6894
7176
|
issueCmd.command("pause").description("Pause an in-progress issue (switches to default branch)").argument("<id>", "Issue ID").requiredOption("-n, --note <note>", "Why paused and what must happen before resuming").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
6895
7177
|
const rootPath = resolveRepoRoot(opts.path);
|
|
@@ -6900,16 +7182,20 @@ issueCmd.command("pause").description("Pause an in-progress issue (switches to d
|
|
|
6900
7182
|
console.log(` ${source_default.dim("Note:")} ${opts.note}`);
|
|
6901
7183
|
console.log(` ${source_default.dim("Switched to:")} ${engine.getCurrentBranch()}`);
|
|
6902
7184
|
});
|
|
6903
|
-
issueCmd.command("resume").description("Resume a paused issue (switches to issue branch)").argument("<id>", "Issue ID").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
7185
|
+
issueCmd.command("resume").description("Resume a paused issue (switches to issue branch and lane)").argument("<id>", "Issue ID").option("--no-lane", "Do not re-enter linked agent lane").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
6904
7186
|
const rootPath = resolveRepoRoot(opts.path);
|
|
6905
7187
|
const engine = new TrellisVcsEngine({ rootPath });
|
|
6906
7188
|
engine.open();
|
|
6907
|
-
await engine.resumeIssue(id);
|
|
7189
|
+
await engine.resumeIssue(id, { lane: !opts.noLane });
|
|
6908
7190
|
const issue = engine.getIssue(id);
|
|
6909
7191
|
console.log(source_default.green(`\u25B6 Resumed issue ${source_default.bold(id)}`));
|
|
6910
7192
|
if (issue?.branchName) {
|
|
6911
7193
|
console.log(` ${source_default.dim("Branch:")} ${issue.branchName}`);
|
|
6912
7194
|
}
|
|
7195
|
+
const laneId = engine.getActiveLaneId();
|
|
7196
|
+
if (laneId) {
|
|
7197
|
+
console.log(` ${source_default.dim("Lane:")} ${laneId}`);
|
|
7198
|
+
}
|
|
6913
7199
|
});
|
|
6914
7200
|
issueCmd.command("triage").description("Move a backlog issue to queue (ready to start)").argument("<id>", "Issue ID").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
6915
7201
|
const rootPath = resolveRepoRoot(opts.path);
|
|
@@ -6918,7 +7204,7 @@ issueCmd.command("triage").description("Move a backlog issue to queue (ready to
|
|
|
6918
7204
|
await engine.triageIssue(id);
|
|
6919
7205
|
console.log(source_default.green(`\u2713 Triaged ${source_default.bold(id)} \u2192 queue`));
|
|
6920
7206
|
});
|
|
6921
|
-
issueCmd.command("update").description("Update issue metadata").argument("<id>", "Issue ID").option("--title <title>", "New title").option("-d, --desc <description>", "Short description").option("--description <description>", "Alias for --desc").option("--status <status>", "New status: backlog, queue, in_progress, paused, closed").option("-P, --priority <priority>", "Priority: critical, high, medium, low").option("-l, --labels <labels>", "Comma-separated labels").option("--assignee <agentId>", "Agent to assign").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
7207
|
+
issueCmd.command("update").description("Update issue metadata").argument("<id>", "Issue ID").option("--title <title>", "New title").option("-d, --desc <description>", "Short description").option("--description <description>", "Alias for --desc").option("--status <status>", "New status: backlog, queue, in_progress, paused, closed").option("-P, --priority <priority>", "Priority: critical, high, medium, low").option("-l, --labels <labels>", "Comma-separated labels").option("--assignee <agentId>", "Agent to assign").option("--parent <id>", "Parent issue ID (re-parent sub-task)").option("--clear-parent", "Remove parent link").option("-p, --path <path>", "Repository path", ".").action(async (id, opts) => {
|
|
6922
7208
|
const rootPath = resolveRepoRoot(opts.path);
|
|
6923
7209
|
const engine = new TrellisVcsEngine({ rootPath });
|
|
6924
7210
|
engine.open();
|
|
@@ -6937,6 +7223,11 @@ issueCmd.command("update").description("Update issue metadata").argument("<id>",
|
|
|
6937
7223
|
}
|
|
6938
7224
|
if (opts.assignee !== undefined)
|
|
6939
7225
|
updates.assignee = opts.assignee;
|
|
7226
|
+
if (opts.clearParent) {
|
|
7227
|
+
updates.parentId = null;
|
|
7228
|
+
} else if (opts.parent !== undefined) {
|
|
7229
|
+
updates.parentId = opts.parent;
|
|
7230
|
+
}
|
|
6940
7231
|
await engine.updateIssue(id, updates);
|
|
6941
7232
|
console.log(source_default.green(`\u2713 Updated ${source_default.bold(id)}`));
|
|
6942
7233
|
});
|
|
@@ -7015,6 +7306,10 @@ issueCmd.command("close").description("Close an issue (requires all criteria pas
|
|
|
7015
7306
|
const rootPath = resolveRepoRoot(opts.path);
|
|
7016
7307
|
const engine = new TrellisVcsEngine({ rootPath });
|
|
7017
7308
|
engine.open();
|
|
7309
|
+
const lane = engine.findLaneForIssue(id);
|
|
7310
|
+
if (lane && lane.status === "active" && engine.getLaneOpCount(lane.id) > 0) {
|
|
7311
|
+
console.log(source_default.yellow(`\u26A0 Lane ${lane.id} has unpromoted ops \u2014 promote before close when W3 lands (trellis lane promote)`));
|
|
7312
|
+
}
|
|
7018
7313
|
try {
|
|
7019
7314
|
const result = await engine.closeIssue(id, { confirm: opts.confirm });
|
|
7020
7315
|
if (!result.op) {
|
|
@@ -8028,7 +8323,7 @@ function formatOpKind(kind) {
|
|
|
8028
8323
|
};
|
|
8029
8324
|
return kindMap[kind] ?? source_default.dim(kind);
|
|
8030
8325
|
}
|
|
8031
|
-
function
|
|
8326
|
+
function formatRelativeTime2(iso) {
|
|
8032
8327
|
const now = Date.now();
|
|
8033
8328
|
const then = new Date(iso).getTime();
|
|
8034
8329
|
const diff = now - then;
|
|
@@ -8936,7 +9231,7 @@ cmsCmd.command("register-library <pkg>").description("Register a Svelte 5 compon
|
|
|
8936
9231
|
});
|
|
8937
9232
|
program2.command("remote").description("Manage remote workspace subscriptions").argument("[action]", '"add", "remove", or "list" (default: list)').argument("[name]", "Remote name (for add/remove)").argument("[path]", "Remote path (for add)").option("-p, --path <path>", "Repository path", ".").action(async (action, name, path, opts) => {
|
|
8938
9233
|
const rootPath = resolveRepoRoot(opts.path);
|
|
8939
|
-
const { RemoteManager } = await import("../remote-manager-
|
|
9234
|
+
const { RemoteManager } = await import("../remote-manager-xvbg4230.js");
|
|
8940
9235
|
const remoteManager = new RemoteManager(join6(rootPath, ".trellis"));
|
|
8941
9236
|
try {
|
|
8942
9237
|
if (!action || action === "list") {
|
|
@@ -8984,7 +9279,7 @@ program2.command("remote").description("Manage remote workspace subscriptions").
|
|
|
8984
9279
|
});
|
|
8985
9280
|
program2.command("pull").description("Pull operations from remote workspaces").option("-p, --path <path>", "Repository path", ".").option("--remote <remote>", "Pull from specific remote only").action(async (opts) => {
|
|
8986
9281
|
const rootPath = resolveRepoRoot(opts.path);
|
|
8987
|
-
const { RemoteManager } = await import("../remote-manager-
|
|
9282
|
+
const { RemoteManager } = await import("../remote-manager-xvbg4230.js");
|
|
8988
9283
|
const remoteManager = new RemoteManager(join6(rootPath, ".trellis"));
|
|
8989
9284
|
const engine = new TrellisVcsEngine({ rootPath });
|
|
8990
9285
|
engine.open();
|
|
@@ -9043,4 +9338,5 @@ program2.command("skills").description("Install Trellis agent skills using the s
|
|
|
9043
9338
|
process.exit(result.status ?? 1);
|
|
9044
9339
|
}
|
|
9045
9340
|
});
|
|
9341
|
+
registerLaneCommands(program2);
|
|
9046
9342
|
program2.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lane.d.ts","sourceRoot":"","sources":["../../src/cli/lane.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8CzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuU3D"}
|
package/dist/cms/client.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare class CmsClient {
|
|
|
36
36
|
constructor(opts: CmsClientOptions);
|
|
37
37
|
collection<T extends Record<string, unknown> = Record<string, unknown>>(key: string): CollectionRef<T>;
|
|
38
38
|
entry<T extends Record<string, unknown> = Record<string, unknown>>(id: string): EntryRef<T>;
|
|
39
|
-
/** List
|
|
39
|
+
/** List CMS collections (TypeSchema entities marked cms=true). */
|
|
40
40
|
collections(): Promise<Collection[]>;
|
|
41
41
|
close(): void;
|
|
42
42
|
/**
|
package/dist/cms/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/cms/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,KAAK,EACL,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/cms/client.ts"],"names":[],"mappings":"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"}
|
package/dist/cms/index.js
CHANGED
|
@@ -23,9 +23,6 @@ var SYSTEM_TYPES = new Set([
|
|
|
23
23
|
"typeschema",
|
|
24
24
|
"field"
|
|
25
25
|
]);
|
|
26
|
-
function isSystemType(type) {
|
|
27
|
-
return SYSTEM_TYPES.has(type.trim().toLowerCase());
|
|
28
|
-
}
|
|
29
26
|
function typeKey(type) {
|
|
30
27
|
return type.trim().toLowerCase();
|
|
31
28
|
}
|
|
@@ -292,12 +289,9 @@ class CmsClient {
|
|
|
292
289
|
]);
|
|
293
290
|
const factsByEntity = groupFactsByEntity(facts ?? []);
|
|
294
291
|
const counts = new Map;
|
|
295
|
-
const canonical = new Map;
|
|
296
292
|
for (const e of entities ?? []) {
|
|
297
293
|
const k = typeKey(e.type);
|
|
298
294
|
counts.set(k, (counts.get(k) ?? 0) + 1);
|
|
299
|
-
if (!canonical.has(k))
|
|
300
|
-
canonical.set(k, e.type);
|
|
301
295
|
}
|
|
302
296
|
const out = new Map;
|
|
303
297
|
for (const e of entities ?? []) {
|
|
@@ -318,16 +312,6 @@ class CmsClient {
|
|
|
318
312
|
count: counts.get(k) ?? 0
|
|
319
313
|
});
|
|
320
314
|
}
|
|
321
|
-
for (const [k, count] of counts) {
|
|
322
|
-
if (isSystemType(k) || out.has(k))
|
|
323
|
-
continue;
|
|
324
|
-
out.set(k, {
|
|
325
|
-
key: k,
|
|
326
|
-
label: canonical.get(k) ?? k,
|
|
327
|
-
inferred: true,
|
|
328
|
-
count
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
315
|
return [...out.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
332
316
|
}
|
|
333
317
|
close() {
|