@ethlete/agent-rules 0.1.0-next.3 → 0.1.0-next.30
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/AGENTS.md +28 -0
- package/CHANGELOG.md +463 -0
- package/CLAUDE.md +1 -0
- package/README.md +362 -29
- package/THIRD-PARTY-LICENSES.md +35 -0
- package/content/defaults.json +1 -1
- package/content/git-hooks/post-checkout.sh +10 -0
- package/content/git-hooks/pre-push.sh +5 -0
- package/content/hooks/context-warning.py +871 -110
- package/content/hooks/subagent-model-policy.py +194 -0
- package/content/mods/.claude-plugin/marketplace.json +11 -0
- package/content/mods/plugins/e2e-progress/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/e2e-progress/hooks/hooks.json +1 -0
- package/content/mods/plugins/e2e-progress/hooks/register.tsx +442 -0
- package/content/mods/plugins/e2e-progress/tsconfig.json +3 -0
- package/content/mods/plugins/e2e-progress/types/index.d.ts +23 -0
- package/content/output-styles/ste-clarity.md +131 -0
- package/content/rules/agent-sessions-wake-up.md +11 -0
- package/content/rules/app-styling.md +66 -0
- package/content/rules/comments.md +4 -1
- package/content/rules/lint-and-format.md +7 -5
- package/content/rules/nx-layout.md +50 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +9 -7
- package/content/rules/subagent-models.md +39 -0
- package/content/skills/agent-sessions/SKILL.md +81 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +492 -0
- package/content/skills/angular-patterns/SKILL.md +30 -7
- package/content/skills/api-source/SKILL.md +156 -0
- package/content/skills/app-testing/SKILL.md +141 -0
- package/content/skills/codex-subagent/SKILL.md +90 -0
- package/content/skills/codex-subagent/codex-agent.mjs +229 -0
- package/content/skills/design-exploration/SKILL.md +657 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +80 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +191 -0
- package/content/skills/figma-export/dump-figma-layers.py +83 -0
- package/content/skills/figma-export/dump-figma-svg.py +235 -0
- package/content/skills/figma-export/measure-template.mjs +87 -0
- package/content/skills/git-commit/SKILL.md +11 -7
- package/content/skills/git-flow/SKILL.md +87 -0
- package/content/skills/grill-with-docs/SKILL.md +13 -0
- package/content/skills/grilling/SKILL.md +51 -0
- package/content/skills/handoff/SKILL.md +125 -5
- package/content/skills/query/SKILL.md +165 -64
- package/content/skills/rxjs-signals/SKILL.md +33 -4
- package/content/skills/sdk-docs/SKILL.md +50 -14
- package/content/skills/sdk-local-build/SKILL.md +26 -8
- package/content/skills/sdk-local-build/sdk-local-baseline.mjs +64 -0
- package/content/skills/sdk-source/SKILL.md +37 -34
- package/content/skills/sdk-update/SKILL.md +103 -0
- package/content/skills/story-styling/SKILL.md +10 -8
- package/content/skills/styleguide/SKILL.md +12 -7
- package/content/skills/styleguide/assets.md +54 -0
- package/content/skills/styleguide/changesets.md +17 -0
- package/content/skills/styleguide/file-structure.md +73 -0
- package/content/skills/styleguide/lint-rule-lookup.md +51 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +50 -28
- package/content/skills/timetrack/SKILL.md +397 -0
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/migrations/app-styling-utilities.md +63 -0
- package/migrations/list-state-query-form.md +20 -0
- package/migrations/nx-layout.md +29 -0
- package/migrations/sdk-components-over-hand-built-ui.md +27 -0
- package/migrations/search-query-field.md +52 -0
- package/migrations.json +48 -0
- package/package.json +19 -3
- package/src/index.js +85 -30
- package/src/index.js.map +1 -1
- package/src/lib/cli-args.d.ts +9 -0
- package/src/lib/cli-args.js +48 -0
- package/src/lib/cli-args.js.map +1 -0
- package/src/lib/commitlint.d.ts +10 -0
- package/src/lib/commitlint.js +51 -0
- package/src/lib/commitlint.js.map +1 -0
- package/src/lib/config.d.ts +41 -5
- package/src/lib/config.js +117 -10
- package/src/lib/config.js.map +1 -1
- package/src/lib/filter.d.ts +2 -0
- package/src/lib/filter.js +4 -4
- package/src/lib/filter.js.map +1 -1
- package/src/lib/frontmatter.d.ts +2 -0
- package/src/lib/frontmatter.js +33 -5
- package/src/lib/frontmatter.js.map +1 -1
- package/src/lib/git-flow/build.d.ts +35 -0
- package/src/lib/git-flow/build.js +24 -0
- package/src/lib/git-flow/build.js.map +1 -0
- package/src/lib/git-flow/config.d.ts +59 -0
- package/src/lib/git-flow/config.js +50 -0
- package/src/lib/git-flow/config.js.map +1 -0
- package/src/lib/git-flow/index.d.ts +6 -0
- package/src/lib/git-flow/index.js +23 -0
- package/src/lib/git-flow/index.js.map +1 -0
- package/src/lib/git-flow/parse.d.ts +49 -0
- package/src/lib/git-flow/parse.js +300 -0
- package/src/lib/git-flow/parse.js.map +1 -0
- package/src/lib/git-flow/rename.d.ts +24 -0
- package/src/lib/git-flow/rename.js +70 -0
- package/src/lib/git-flow/rename.js.map +1 -0
- package/src/lib/git-flow/start.d.ts +49 -0
- package/src/lib/git-flow/start.js +57 -0
- package/src/lib/git-flow/start.js.map +1 -0
- package/src/lib/git-flow/validate.d.ts +34 -0
- package/src/lib/git-flow/validate.js +72 -0
- package/src/lib/git-flow/validate.js.map +1 -0
- package/src/lib/git-flow-command.d.ts +4 -0
- package/src/lib/git-flow-command.js +165 -0
- package/src/lib/git-flow-command.js.map +1 -0
- package/src/lib/git-flow-repair.d.ts +17 -0
- package/src/lib/git-flow-repair.js +165 -0
- package/src/lib/git-flow-repair.js.map +1 -0
- package/src/lib/git-flow-start.d.ts +20 -0
- package/src/lib/git-flow-start.js +140 -0
- package/src/lib/git-flow-start.js.map +1 -0
- package/src/lib/git.d.ts +64 -0
- package/src/lib/git.js +131 -0
- package/src/lib/git.js.map +1 -0
- package/src/lib/gitlab.d.ts +35 -0
- package/src/lib/gitlab.js +116 -0
- package/src/lib/gitlab.js.map +1 -0
- package/src/lib/index.d.ts +2 -0
- package/src/lib/index.js +26 -11
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.js +6 -1
- package/src/lib/migrate.js.map +1 -1
- package/src/lib/output-style-command.d.ts +3 -0
- package/src/lib/output-style-command.js +69 -0
- package/src/lib/output-style-command.js.map +1 -0
- package/src/lib/output-style.d.ts +38 -0
- package/src/lib/output-style.js +134 -0
- package/src/lib/output-style.js.map +1 -0
- package/src/lib/owned-paths.js +27 -3
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/package-runner.d.ts +4 -0
- package/src/lib/package-runner.js +86 -0
- package/src/lib/package-runner.js.map +1 -0
- package/src/lib/plain-text.d.ts +9 -0
- package/src/lib/plain-text.js +22 -0
- package/src/lib/plain-text.js.map +1 -0
- package/src/lib/plan.d.ts +6 -6
- package/src/lib/plan.js +164 -40
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prompt.d.ts +8 -0
- package/src/lib/prompt.js +35 -0
- package/src/lib/prompt.js.map +1 -0
- package/src/lib/render.d.ts +25 -2
- package/src/lib/render.js +43 -10
- package/src/lib/render.js.map +1 -1
- package/src/lib/sessions-command.d.ts +4 -0
- package/src/lib/sessions-command.js +16 -0
- package/src/lib/sessions-command.js.map +1 -0
- package/src/lib/sync.d.ts +0 -1
- package/src/lib/sync.js +30 -17
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.js +1 -1
- package/src/lib/targets/agents-skills.js.map +1 -1
- package/src/lib/targets/claude-hooks.d.ts +3 -23
- package/src/lib/targets/claude-hooks.js +22 -86
- package/src/lib/targets/claude-hooks.js.map +1 -1
- package/src/lib/targets/claude-mods.d.ts +20 -0
- package/src/lib/targets/claude-mods.js +47 -0
- package/src/lib/targets/claude-mods.js.map +1 -0
- package/src/lib/targets/claude.js +2 -3
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex-hooks.d.ts +12 -0
- package/src/lib/targets/codex-hooks.js +35 -0
- package/src/lib/targets/codex-hooks.js.map +1 -0
- package/src/lib/targets/codex.js +4 -4
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.js +4 -4
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.js +3 -3
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/git-hooks.d.ts +25 -0
- package/src/lib/targets/git-hooks.js +71 -0
- package/src/lib/targets/git-hooks.js.map +1 -0
- package/src/lib/targets/hooks-shared.d.ts +60 -0
- package/src/lib/targets/hooks-shared.js +130 -0
- package/src/lib/targets/hooks-shared.js.map +1 -0
- package/src/lib/targets/mcp.d.ts +16 -0
- package/src/lib/targets/mcp.js +68 -0
- package/src/lib/targets/mcp.js.map +1 -0
- package/src/lib/targets/shared.d.ts +1 -9
- package/src/lib/targets/shared.js +4 -8
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/timetrack-command.d.ts +11 -0
- package/src/lib/timetrack-command.js +1063 -0
- package/src/lib/timetrack-command.js.map +1 -0
- package/src/lib/timetrack-snapshot.d.ts +55 -0
- package/src/lib/timetrack-snapshot.js +120 -0
- package/src/lib/timetrack-snapshot.js.map +1 -0
- package/src/lib/timetrack.d.ts +561 -0
- package/src/lib/timetrack.js +279 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.gitFlowStart = void 0;
|
|
13
|
+
const git_1 = require("./git");
|
|
14
|
+
const git_flow_1 = require("./git-flow");
|
|
15
|
+
const prompt_1 = require("./prompt");
|
|
16
|
+
const timetrack_1 = require("./timetrack");
|
|
17
|
+
/**
|
|
18
|
+
* A Task's parent Story must already have its feature branch, because that branch is what the
|
|
19
|
+
* sub-feature nests under and is based on. A Story whose branch still uses a deprecated spelling
|
|
20
|
+
* therefore has to be repaired before anything can nest under it — the name is the parent path.
|
|
21
|
+
*/
|
|
22
|
+
const findParentBranch = (options) => {
|
|
23
|
+
const { root, storyKey, config } = options;
|
|
24
|
+
const matches = (0, git_flow_1.featureBranchesFor)({ branches: (0, git_1.allBranches)(root), storyKey, config });
|
|
25
|
+
if (matches.length === 0) {
|
|
26
|
+
throw new Error([
|
|
27
|
+
`No feature branch found for the parent story ${storyKey}.`,
|
|
28
|
+
`Create it first with \`ethlete-agents git-flow start ${storyKey}\`, or pass --of <branch>.`,
|
|
29
|
+
"If it exists under a deprecated name, `git-flow repair` it first — a sub-feature nests under its parent's full name.",
|
|
30
|
+
].join('\n'));
|
|
31
|
+
}
|
|
32
|
+
if (matches.length > 1) {
|
|
33
|
+
throw new Error(`${storyKey} has more than one feature branch: ${matches.join(', ')}. Pass --of <branch>.`);
|
|
34
|
+
}
|
|
35
|
+
return matches[0];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Timetrack resolves the subject field, because the field id is the instance's and lives there. An
|
|
39
|
+
* issue that sets nothing falls back to its summary, which is a paraphrase rather than the agreed
|
|
40
|
+
* subject — so the plan says which of the two it used.
|
|
41
|
+
*/
|
|
42
|
+
const resolveSubject = (issue) => issue.subject
|
|
43
|
+
? { subject: issue.subject, subjectSource: "the issue's subject field" }
|
|
44
|
+
: { subject: issue.summary, subjectSource: `the summary — ${issue.key} sets no subject field` };
|
|
45
|
+
const resolve = (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
var _a;
|
|
47
|
+
const { root, config, subject, type, parent, hotfix, releaseDate } = request;
|
|
48
|
+
if (releaseDate)
|
|
49
|
+
return { spec: { kind: 'release', date: releaseDate }, subjectSource: '—' };
|
|
50
|
+
if (!request.key)
|
|
51
|
+
throw new Error('Pass an issue key, e.g. `git-flow start FIP-2177`.');
|
|
52
|
+
const key = request.key.toUpperCase();
|
|
53
|
+
if (subject) {
|
|
54
|
+
if (hotfix)
|
|
55
|
+
return { spec: { kind: 'hotfix', key, subject }, subjectSource: '--subject' };
|
|
56
|
+
if (parent) {
|
|
57
|
+
return { spec: (0, git_flow_1.nestedSpecFor)({ parent, key, subject, config: config.gitFlow }), subjectSource: '--subject' };
|
|
58
|
+
}
|
|
59
|
+
return { spec: { kind: 'main-feature', type, key, subject }, subjectSource: '--subject' };
|
|
60
|
+
}
|
|
61
|
+
const issue = yield (0, timetrack_1.timetrackIssue)(key);
|
|
62
|
+
const resolvedSubject = resolveSubject(issue);
|
|
63
|
+
const resolvedType = type !== null && type !== void 0 ? type : (_a = config.jira.typeByIssueType) === null || _a === void 0 ? void 0 : _a[issue.issueType];
|
|
64
|
+
const shared = { key, subject: resolvedSubject.subject };
|
|
65
|
+
if (hotfix)
|
|
66
|
+
return { spec: Object.assign({ kind: 'hotfix' }, shared), issue, subjectSource: resolvedSubject.subjectSource };
|
|
67
|
+
const parentBranch = parent !== null && parent !== void 0 ? parent : (issue.parentKey ? findParentBranch({ root, storyKey: issue.parentKey, config: config.gitFlow }) : undefined);
|
|
68
|
+
if (parentBranch) {
|
|
69
|
+
return {
|
|
70
|
+
spec: (0, git_flow_1.nestedSpecFor)(Object.assign(Object.assign({ parent: parentBranch }, shared), { config: config.gitFlow })),
|
|
71
|
+
issue,
|
|
72
|
+
subjectSource: resolvedSubject.subjectSource,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
spec: Object.assign({ kind: 'main-feature', type: resolvedType }, shared),
|
|
77
|
+
issue,
|
|
78
|
+
subjectSource: resolvedSubject.subjectSource,
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
const describePlan = (options) => {
|
|
82
|
+
const { plan, baseRef } = options;
|
|
83
|
+
const { issue, spec, subjectSource } = options.resolved;
|
|
84
|
+
const lines = [` branch ${plan.branch}`, ` from ${baseRef}`, ` merges to ${plan.mrTargets.join(' or ')}`];
|
|
85
|
+
if (issue)
|
|
86
|
+
lines.unshift(` issue ${issue.key} ${issue.issueType}${issue.summary ? ` — ${issue.summary}` : ''}`);
|
|
87
|
+
if (spec.kind !== 'release')
|
|
88
|
+
lines.push(` subject from ${subjectSource}`);
|
|
89
|
+
return lines;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* The prospective flow: an issue key in, a correctly named branch off the correct base out. Shares
|
|
93
|
+
* `planStart` with `@ethlete/timetrack`'s ticket → branch flow, so the two cannot name a branch
|
|
94
|
+
* differently.
|
|
95
|
+
*/
|
|
96
|
+
const gitFlowStart = (request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
+
const { root, config, push, dryRun } = request;
|
|
98
|
+
const resolved = yield resolve(request);
|
|
99
|
+
const plan = (0, git_flow_1.planStart)({ spec: resolved.spec, config: config.gitFlow });
|
|
100
|
+
if (plan.problems.length > 0) {
|
|
101
|
+
console.error(`Cannot name a conforming branch for this issue:`);
|
|
102
|
+
plan.problems.forEach((problem) => console.error(` ${problem}`));
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
105
|
+
const base = plan.base;
|
|
106
|
+
const remote = (0, git_1.defaultRemote)(root);
|
|
107
|
+
const baseOnRemote = remote ? (0, git_1.remoteBranchExists)({ root, remote, branch: base }) : false;
|
|
108
|
+
const baseRef = baseOnRemote ? `${remote}/${base}` : base;
|
|
109
|
+
console.log(`Plan`);
|
|
110
|
+
describePlan({ plan, resolved, baseRef }).forEach((line) => console.log(line));
|
|
111
|
+
if ((0, git_1.localBranchExists)({ root, branch: plan.branch })) {
|
|
112
|
+
console.error(`\n${plan.branch} already exists — \`git switch ${plan.branch}\`.`);
|
|
113
|
+
return 1;
|
|
114
|
+
}
|
|
115
|
+
if (!baseOnRemote && !(0, git_1.localBranchExists)({ root, branch: base })) {
|
|
116
|
+
console.error(`\nThe base branch ${base} exists neither locally nor on ${remote !== null && remote !== void 0 ? remote : 'any remote'}.`);
|
|
117
|
+
return 1;
|
|
118
|
+
}
|
|
119
|
+
if ((0, git_1.isDirty)(root)) {
|
|
120
|
+
console.error('\nThe working tree has uncommitted changes — commit or stash them first.');
|
|
121
|
+
return 1;
|
|
122
|
+
}
|
|
123
|
+
if (dryRun) {
|
|
124
|
+
console.log('\nDry run — nothing was created.');
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
if (!(yield (0, prompt_1.confirm)({ question: `\nCreate ${plan.branch} from ${baseRef}?`, assumeYes: request.assumeYes }))) {
|
|
128
|
+
console.log('Nothing was created.');
|
|
129
|
+
return 1;
|
|
130
|
+
}
|
|
131
|
+
if (remote && baseOnRemote)
|
|
132
|
+
(0, git_1.gitLoud)({ root, args: ['fetch', remote, base] });
|
|
133
|
+
(0, git_1.gitLoud)({ root, args: ['switch', '-c', plan.branch, '--no-track', baseRef] });
|
|
134
|
+
if (push && remote)
|
|
135
|
+
(0, git_1.gitLoud)({ root, args: ['push', '-u', remote, plan.branch] });
|
|
136
|
+
console.log(`\nOn ${(0, git_1.currentBranch)(root)}. Open the merge request against ${plan.mrTargets[0]}.`);
|
|
137
|
+
return 0;
|
|
138
|
+
});
|
|
139
|
+
exports.gitFlowStart = gitFlowStart;
|
|
140
|
+
//# sourceMappingURL=git-flow-start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-flow-start.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/git-flow-start.ts"],"names":[],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QAEpC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,MAAM,IAAI,YAAY;QAAE,IAAA,aAAO,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAE7E,IAAA,aAAO,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAE9E,IAAI,IAAI,IAAI,MAAM;QAAE,IAAA,aAAO,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAEjF,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAA,mBAAa,EAAC,IAAI,CAAC,oCAAoC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAEjG,OAAO,CAAC,CAAC;AACX,CAAC,CAAA,CAAC;AA3DW,QAAA,YAAY,gBA2DvB"}
|
package/src/lib/git.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const git: (options: {
|
|
2
|
+
root: string;
|
|
3
|
+
args: string[];
|
|
4
|
+
}) => string;
|
|
5
|
+
/** Runs a command whose output belongs on the terminal — a push, a fetch, a branch creation. */
|
|
6
|
+
export declare const gitLoud: (options: {
|
|
7
|
+
root: string;
|
|
8
|
+
args: string[];
|
|
9
|
+
}) => string;
|
|
10
|
+
export declare const currentBranch: (root: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* The identity a checkout commits under, which is how somebody else's commits stay out of a repair.
|
|
13
|
+
* A work checkout and a personal one are often two addresses, so this is read per checkout.
|
|
14
|
+
*/
|
|
15
|
+
export declare const commitAuthorOf: (root: string) => string | undefined;
|
|
16
|
+
export declare const allBranches: (root: string) => string[];
|
|
17
|
+
/**
|
|
18
|
+
* The directories a checkout declares as projects, relative to it, deepest last.
|
|
19
|
+
*
|
|
20
|
+
* A repository states its own boundaries in the files its tooling reads, and those beat any depth a
|
|
21
|
+
* rule could pick: two sibling libraries stay apart, and one library's own subdirectories fold into
|
|
22
|
+
* it. The checkout root is left out on purpose - it is the whole checkout under another name.
|
|
23
|
+
*
|
|
24
|
+
* Read through `git ls-files` rather than the filesystem, so an ignored or vendored copy under
|
|
25
|
+
* `node_modules` never counts as a project.
|
|
26
|
+
*/
|
|
27
|
+
export declare const projectRootsOf: (root: string) => string[];
|
|
28
|
+
export declare const isDirty: (root: string) => boolean;
|
|
29
|
+
export declare const localBranchExists: (options: {
|
|
30
|
+
root: string;
|
|
31
|
+
branch: string;
|
|
32
|
+
}) => boolean;
|
|
33
|
+
export declare const remoteBranchExists: (options: {
|
|
34
|
+
root: string;
|
|
35
|
+
remote: string;
|
|
36
|
+
branch: string;
|
|
37
|
+
}) => boolean;
|
|
38
|
+
/** `origin` when it exists, otherwise the only remote — a repo with several and no `origin` is ambiguous. */
|
|
39
|
+
export declare const defaultRemote: (root: string) => string | undefined;
|
|
40
|
+
export declare const remoteUrl: (options: {
|
|
41
|
+
root: string;
|
|
42
|
+
remote: string;
|
|
43
|
+
}) => string;
|
|
44
|
+
/** One commit as a repair reads it: the local day it was made on, and the files it changed. */
|
|
45
|
+
export type CommitPaths = {
|
|
46
|
+
day: string;
|
|
47
|
+
paths: string[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The commits of the given local days, with the files each changed.
|
|
51
|
+
*
|
|
52
|
+
* `%cd` with `--date=format-local:%F` is the day in the machine's own zone, which is the grain
|
|
53
|
+
* Timetrack keys a day by. The span is read from the days given, so one `git log` answers them all,
|
|
54
|
+
* and a commit on a day outside the list is dropped.
|
|
55
|
+
*
|
|
56
|
+
* `--branches` and the author filter must stay in step with the collector that opened the record
|
|
57
|
+
* (`gitLogArgs` in `libs/timetrack/src/lib/git/scan.ts`). Read a narrower history than the collector
|
|
58
|
+
* did and a day the record holds looks empty, which makes a repair refuse or drop it.
|
|
59
|
+
*/
|
|
60
|
+
export declare const commitPathsOnDays: (options: {
|
|
61
|
+
root: string;
|
|
62
|
+
days: readonly string[];
|
|
63
|
+
author?: string;
|
|
64
|
+
}) => CommitPaths[];
|
package/src/lib/git.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commitPathsOnDays = exports.remoteUrl = exports.defaultRemote = exports.remoteBranchExists = exports.localBranchExists = exports.isDirty = exports.projectRootsOf = exports.allBranches = exports.commitAuthorOf = exports.currentBranch = exports.gitLoud = exports.git = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const git_flow_1 = require("./git-flow");
|
|
6
|
+
const git = (options) => (0, child_process_1.execFileSync)('git', options.args, {
|
|
7
|
+
cwd: options.root,
|
|
8
|
+
encoding: 'utf8',
|
|
9
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
10
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
11
|
+
}).trim();
|
|
12
|
+
exports.git = git;
|
|
13
|
+
/** Runs a command whose output belongs on the terminal — a push, a fetch, a branch creation. */
|
|
14
|
+
const gitLoud = (options) => (0, child_process_1.execFileSync)('git', options.args, { cwd: options.root, encoding: 'utf8', stdio: ['ignore', 'inherit', 'inherit'] });
|
|
15
|
+
exports.gitLoud = gitLoud;
|
|
16
|
+
const currentBranch = (root) => (0, exports.git)({ root, args: ['rev-parse', '--abbrev-ref', 'HEAD'] });
|
|
17
|
+
exports.currentBranch = currentBranch;
|
|
18
|
+
/**
|
|
19
|
+
* The identity a checkout commits under, which is how somebody else's commits stay out of a repair.
|
|
20
|
+
* A work checkout and a personal one are often two addresses, so this is read per checkout.
|
|
21
|
+
*/
|
|
22
|
+
const commitAuthorOf = (root) => {
|
|
23
|
+
try {
|
|
24
|
+
return (0, exports.git)({ root, args: ['config', '--get', 'user.email'] }) || undefined;
|
|
25
|
+
}
|
|
26
|
+
catch (_a) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.commitAuthorOf = commitAuthorOf;
|
|
31
|
+
const allBranches = (root) => {
|
|
32
|
+
const refs = (0, exports.git)({ root, args: ['for-each-ref', '--format=%(refname)', 'refs/heads', 'refs/remotes'] });
|
|
33
|
+
const names = refs
|
|
34
|
+
.split('\n')
|
|
35
|
+
.filter((ref) => ref && !ref.endsWith('/HEAD'))
|
|
36
|
+
.map(git_flow_1.stripRefPrefix);
|
|
37
|
+
return [...new Set(names)].sort();
|
|
38
|
+
};
|
|
39
|
+
exports.allBranches = allBranches;
|
|
40
|
+
/**
|
|
41
|
+
* The directories a checkout declares as projects, relative to it, deepest last.
|
|
42
|
+
*
|
|
43
|
+
* A repository states its own boundaries in the files its tooling reads, and those beat any depth a
|
|
44
|
+
* rule could pick: two sibling libraries stay apart, and one library's own subdirectories fold into
|
|
45
|
+
* it. The checkout root is left out on purpose - it is the whole checkout under another name.
|
|
46
|
+
*
|
|
47
|
+
* Read through `git ls-files` rather than the filesystem, so an ignored or vendored copy under
|
|
48
|
+
* `node_modules` never counts as a project.
|
|
49
|
+
*/
|
|
50
|
+
const projectRootsOf = (root) => {
|
|
51
|
+
const out = (0, exports.git)({ root, args: ['ls-files', '--', '*/project.json', '*/package.json'] });
|
|
52
|
+
const roots = out
|
|
53
|
+
.split('\n')
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.filter((path) => !path.includes('node_modules/'))
|
|
56
|
+
.map((path) => path.slice(0, path.lastIndexOf('/')));
|
|
57
|
+
return [...new Set(roots)].sort();
|
|
58
|
+
};
|
|
59
|
+
exports.projectRootsOf = projectRootsOf;
|
|
60
|
+
const isDirty = (root) => (0, exports.git)({ root, args: ['status', '--porcelain'] }).length > 0;
|
|
61
|
+
exports.isDirty = isDirty;
|
|
62
|
+
const refExists = (options) => {
|
|
63
|
+
try {
|
|
64
|
+
(0, exports.git)({ root: options.root, args: ['rev-parse', '--verify', '--quiet', options.ref] });
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
catch (_a) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const localBranchExists = (options) => refExists({ root: options.root, ref: `refs/heads/${options.branch}` });
|
|
72
|
+
exports.localBranchExists = localBranchExists;
|
|
73
|
+
const remoteBranchExists = (options) => (0, exports.git)({ root: options.root, args: ['ls-remote', '--heads', options.remote, `refs/heads/${options.branch}`] }).length >
|
|
74
|
+
0;
|
|
75
|
+
exports.remoteBranchExists = remoteBranchExists;
|
|
76
|
+
/** `origin` when it exists, otherwise the only remote — a repo with several and no `origin` is ambiguous. */
|
|
77
|
+
const defaultRemote = (root) => {
|
|
78
|
+
const remotes = (0, exports.git)({ root, args: ['remote'] })
|
|
79
|
+
.split('\n')
|
|
80
|
+
.filter(Boolean);
|
|
81
|
+
if (remotes.includes('origin'))
|
|
82
|
+
return 'origin';
|
|
83
|
+
return remotes.length === 1 ? remotes[0] : undefined;
|
|
84
|
+
};
|
|
85
|
+
exports.defaultRemote = defaultRemote;
|
|
86
|
+
const remoteUrl = (options) => (0, exports.git)({ root: options.root, args: ['remote', 'get-url', options.remote] });
|
|
87
|
+
exports.remoteUrl = remoteUrl;
|
|
88
|
+
/**
|
|
89
|
+
* The commits of the given local days, with the files each changed.
|
|
90
|
+
*
|
|
91
|
+
* `%cd` with `--date=format-local:%F` is the day in the machine's own zone, which is the grain
|
|
92
|
+
* Timetrack keys a day by. The span is read from the days given, so one `git log` answers them all,
|
|
93
|
+
* and a commit on a day outside the list is dropped.
|
|
94
|
+
*
|
|
95
|
+
* `--branches` and the author filter must stay in step with the collector that opened the record
|
|
96
|
+
* (`gitLogArgs` in `libs/timetrack/src/lib/git/scan.ts`). Read a narrower history than the collector
|
|
97
|
+
* did and a day the record holds looks empty, which makes a repair refuse or drop it.
|
|
98
|
+
*/
|
|
99
|
+
const commitPathsOnDays = (options) => {
|
|
100
|
+
const wanted = new Set(options.days);
|
|
101
|
+
const sorted = [...wanted].sort();
|
|
102
|
+
const first = sorted[0];
|
|
103
|
+
const last = sorted[sorted.length - 1];
|
|
104
|
+
if (!first || !last)
|
|
105
|
+
return [];
|
|
106
|
+
const out = (0, exports.git)({
|
|
107
|
+
root: options.root,
|
|
108
|
+
args: [
|
|
109
|
+
'log',
|
|
110
|
+
'--branches',
|
|
111
|
+
'--name-only',
|
|
112
|
+
'--no-merges',
|
|
113
|
+
'--pretty=format:%x00%cd',
|
|
114
|
+
'--date=format-local:%F',
|
|
115
|
+
`--since=${first} 00:00`,
|
|
116
|
+
`--until=${last} 23:59:59`,
|
|
117
|
+
...(options.author ? [`--author=${options.author}`] : []),
|
|
118
|
+
],
|
|
119
|
+
});
|
|
120
|
+
return out
|
|
121
|
+
.split('\0')
|
|
122
|
+
.flatMap((block) => {
|
|
123
|
+
var _a;
|
|
124
|
+
const lines = block.split('\n').filter(Boolean);
|
|
125
|
+
const day = (_a = lines.shift()) !== null && _a !== void 0 ? _a : '';
|
|
126
|
+
return wanted.has(day) && lines.length ? { day, paths: lines } : [];
|
|
127
|
+
})
|
|
128
|
+
.reverse();
|
|
129
|
+
};
|
|
130
|
+
exports.commitPathsOnDays = commitPathsOnDays;
|
|
131
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/git.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAC7C,yCAA4C;AAErC,MAAM,GAAG,GAAG,CAAC,OAAyC,EAAE,EAAE,CAC/D,IAAA,4BAAY,EAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE;IAChC,GAAG,EAAE,OAAO,CAAC,IAAI;IACjB,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,M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GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,CAAC,CAAC;SACD,OAAO,EAAE,CAAC;AACf,CAAC,CAAC;AAhCW,QAAA,iBAAiB,qBAgC5B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type GitLabProject = {
|
|
2
|
+
host: string;
|
|
3
|
+
project: string;
|
|
4
|
+
};
|
|
5
|
+
export type GitLabMergeRequest = {
|
|
6
|
+
iid: number;
|
|
7
|
+
title: string;
|
|
8
|
+
sourceBranch: string;
|
|
9
|
+
targetBranch: string;
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
/** `git@host:group/sub/project.git`, `ssh://git@host:2222/group/project.git` and the https form. */
|
|
13
|
+
export declare const parseRemoteUrl: (url: string) => GitLabProject | undefined;
|
|
14
|
+
export declare const gitLabToken: () => string | undefined;
|
|
15
|
+
/** Open merge requests whose source **or** target is the branch — both block a rename, differently. */
|
|
16
|
+
export declare const openMergeRequestsFor: (options: {
|
|
17
|
+
project: GitLabProject;
|
|
18
|
+
token: string;
|
|
19
|
+
branch: string;
|
|
20
|
+
}) => Promise<GitLabMergeRequest[]>;
|
|
21
|
+
export declare const retargetMergeRequest: (options: {
|
|
22
|
+
project: GitLabProject;
|
|
23
|
+
token: string;
|
|
24
|
+
iid: number;
|
|
25
|
+
target: string;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* The GitLab API can change a merge request's target branch but never its source branch, so an open
|
|
29
|
+
* merge request *from* the branch cannot survive a rename — it has to be closed and reopened, which
|
|
30
|
+
* loses its discussion. `repair` reports these and refuses rather than doing that to someone.
|
|
31
|
+
*/
|
|
32
|
+
export declare const blockingMergeRequests: (options: {
|
|
33
|
+
mergeRequests: GitLabMergeRequest[];
|
|
34
|
+
branch: string;
|
|
35
|
+
}) => GitLabMergeRequest[];
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.blockingMergeRequests = exports.retargetMergeRequest = exports.openMergeRequestsFor = exports.gitLabToken = exports.parseRemoteUrl = void 0;
|
|
13
|
+
const TIMEOUT_MS = 15000;
|
|
14
|
+
/** `git@host:group/sub/project.git`, `ssh://git@host:2222/group/project.git` and the https form. */
|
|
15
|
+
const parseRemoteUrl = (url) => {
|
|
16
|
+
const trimmed = url.trim();
|
|
17
|
+
const scp = /^[^@/\s]+@([^:/\s]+):(.+?)(?:\.git)?\/?$/.exec(trimmed);
|
|
18
|
+
if ((scp === null || scp === void 0 ? void 0 : scp[1]) && scp[2])
|
|
19
|
+
return { host: scp[1], project: scp[2] };
|
|
20
|
+
const withScheme = /^[a-z+]+:\/\/(?:[^@/]+@)?([^/:\s]+)(?::\d+)?\/(.+?)(?:\.git)?\/?$/.exec(trimmed);
|
|
21
|
+
if ((withScheme === null || withScheme === void 0 ? void 0 : withScheme[1]) && withScheme[2])
|
|
22
|
+
return { host: withScheme[1], project: withScheme[2] };
|
|
23
|
+
return undefined;
|
|
24
|
+
};
|
|
25
|
+
exports.parseRemoteUrl = parseRemoteUrl;
|
|
26
|
+
const gitLabHosts = () => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
return [...((_a = process.env['GITLAB_HOST']) !== null && _a !== void 0 ? _a : '').split(','), (_b = process.env['CI_SERVER_HOST']) !== null && _b !== void 0 ? _b : '']
|
|
29
|
+
.map((host) => host.trim().toLowerCase())
|
|
30
|
+
.filter(Boolean);
|
|
31
|
+
};
|
|
32
|
+
const gitLabToken = () => { var _a; return ((_a = process.env['GITLAB_TOKEN']) === null || _a === void 0 ? void 0 : _a.trim()) || undefined; };
|
|
33
|
+
exports.gitLabToken = gitLabToken;
|
|
34
|
+
const TARGET_BRANCH_FIELD = 'target_branch';
|
|
35
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
36
|
+
const toMergeRequest = (raw) => {
|
|
37
|
+
var _a, _b, _c, _d, _e;
|
|
38
|
+
return ({
|
|
39
|
+
iid: (_a = raw.iid) !== null && _a !== void 0 ? _a : 0,
|
|
40
|
+
title: (_b = raw.title) !== null && _b !== void 0 ? _b : '',
|
|
41
|
+
sourceBranch: (_c = raw.source_branch) !== null && _c !== void 0 ? _c : '',
|
|
42
|
+
targetBranch: (_d = raw.target_branch) !== null && _d !== void 0 ? _d : '',
|
|
43
|
+
url: (_e = raw.web_url) !== null && _e !== void 0 ? _e : '',
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const request = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
const { project, token, path, method, body } = options;
|
|
48
|
+
if (!gitLabHosts().includes(project.host.toLowerCase())) {
|
|
49
|
+
throw new Error(`Not sending GITLAB_TOKEN to ${project.host}: it is not a configured GitLab host. Set GITLAB_HOST=${project.host} if it is one, or pass --no-mr-check.`);
|
|
50
|
+
}
|
|
51
|
+
const base = `https://${project.host}/api/v4/projects/${encodeURIComponent(project.project)}`;
|
|
52
|
+
const response = yield fetch(`${base}${path}`, {
|
|
53
|
+
method: method !== null && method !== void 0 ? method : 'GET',
|
|
54
|
+
headers: Object.assign({ 'private-token': token, accept: 'application/json' }, (body ? { 'content-type': 'application/json' } : {})),
|
|
55
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
56
|
+
redirect: 'error',
|
|
57
|
+
signal: AbortSignal.timeout(TIMEOUT_MS),
|
|
58
|
+
});
|
|
59
|
+
if (response.status === 401 || response.status === 403) {
|
|
60
|
+
throw new Error(`GitLab rejected the token (${response.status}) for ${project.project}. GITLAB_TOKEN needs the "api" scope and Developer access.`);
|
|
61
|
+
}
|
|
62
|
+
if (!response.ok) {
|
|
63
|
+
throw new Error(`GitLab responded ${response.status} ${response.statusText} for ${method !== null && method !== void 0 ? method : 'GET'} ${path}.`);
|
|
64
|
+
}
|
|
65
|
+
return { body: (yield response.json()), nextPage: response.headers.get('x-next-page') || undefined };
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Follows `x-next-page` rather than reading the first page only: a rename that silently skipped a
|
|
69
|
+
* merge request on page two would leave exactly the half-finished state `repair` must never produce.
|
|
70
|
+
*/
|
|
71
|
+
const listMergeRequests = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
+
const { project, token, filter } = options;
|
|
73
|
+
const found = [];
|
|
74
|
+
let page = '1';
|
|
75
|
+
while (page) {
|
|
76
|
+
const result = yield request({
|
|
77
|
+
project,
|
|
78
|
+
token,
|
|
79
|
+
path: `/merge_requests?state=opened&per_page=100&${filter}&page=${page}`,
|
|
80
|
+
});
|
|
81
|
+
found.push(...result.body.map(toMergeRequest));
|
|
82
|
+
page = result.nextPage;
|
|
83
|
+
}
|
|
84
|
+
return found;
|
|
85
|
+
});
|
|
86
|
+
/** Open merge requests whose source **or** target is the branch — both block a rename, differently. */
|
|
87
|
+
const openMergeRequestsFor = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
+
const { project, token, branch } = options;
|
|
89
|
+
const encoded = encodeURIComponent(branch);
|
|
90
|
+
const [fromBranch, intoBranch] = yield Promise.all([
|
|
91
|
+
listMergeRequests({ project, token, filter: `source_branch=${encoded}` }),
|
|
92
|
+
listMergeRequests({ project, token, filter: `target_branch=${encoded}` }),
|
|
93
|
+
]);
|
|
94
|
+
const byIid = new Map([...fromBranch, ...intoBranch].map((mr) => [mr.iid, mr]));
|
|
95
|
+
return [...byIid.values()].sort((a, b) => a.iid - b.iid);
|
|
96
|
+
});
|
|
97
|
+
exports.openMergeRequestsFor = openMergeRequestsFor;
|
|
98
|
+
const retargetMergeRequest = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
+
const { project, token, iid, target } = options;
|
|
100
|
+
yield request({
|
|
101
|
+
project,
|
|
102
|
+
token,
|
|
103
|
+
path: `/merge_requests/${iid}`,
|
|
104
|
+
method: 'PUT',
|
|
105
|
+
body: { [TARGET_BRANCH_FIELD]: target },
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
exports.retargetMergeRequest = retargetMergeRequest;
|
|
109
|
+
/**
|
|
110
|
+
* The GitLab API can change a merge request's target branch but never its source branch, so an open
|
|
111
|
+
* merge request *from* the branch cannot survive a rename — it has to be closed and reopened, which
|
|
112
|
+
* loses its discussion. `repair` reports these and refuses rather than doing that to someone.
|
|
113
|
+
*/
|
|
114
|
+
const blockingMergeRequests = (options) => options.mergeRequests.filter((mr) => mr.sourceBranch === options.branch);
|
|
115
|
+
exports.blockingMergeRequests = blockingMergeRequests;
|
|
116
|
+
//# sourceMappingURL=gitlab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/gitlab.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,MAAM,UAAU,GAAG,KAAM,CAAC;AAE1B,oGAAoG;AAC7F,MAAM,cAAc,GAAG,CAAC,GAAW,EAA6B,EAAE;IACvE,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,MAAM,GAAG,GAAG,0CAA0C,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErE,IAAI,CAAA,GAAG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AfW,QAAA,oBAAoB,wBAe/B;AAEF;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAAgE,EAAE,EAAE,CACxG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAD9D,QAAA,qBAAqB,yBACyC"}
|
package/src/lib/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export * from './filter';
|
|
|
3
3
|
export * from './frontmatter';
|
|
4
4
|
export * from './load-content';
|
|
5
5
|
export * from './migrate';
|
|
6
|
+
export * from './output-style';
|
|
6
7
|
export * from './owned-paths';
|
|
8
|
+
export * from './plain-text';
|
|
7
9
|
export * from './plan';
|
|
8
10
|
export * from './render';
|
|
9
11
|
export * from './sync';
|
package/src/lib/index.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
__exportStar(require("./config"), exports);
|
|
18
|
+
__exportStar(require("./filter"), exports);
|
|
19
|
+
__exportStar(require("./frontmatter"), exports);
|
|
20
|
+
__exportStar(require("./load-content"), exports);
|
|
21
|
+
__exportStar(require("./migrate"), exports);
|
|
22
|
+
__exportStar(require("./output-style"), exports);
|
|
23
|
+
__exportStar(require("./owned-paths"), exports);
|
|
24
|
+
__exportStar(require("./plain-text"), exports);
|
|
25
|
+
__exportStar(require("./plan"), exports);
|
|
26
|
+
__exportStar(require("./render"), exports);
|
|
27
|
+
__exportStar(require("./sync"), exports);
|
|
28
|
+
__exportStar(require("./targets/shared"), exports);
|
|
14
29
|
//# sourceMappingURL=index.js.map
|
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,iDAA+B;AAC/B,4CAA0B;AAC1B,iDAA+B;AAC/B,gDAA8B;AAC9B,+CAA6B;AAC7B,yCAAuB;AACvB,2CAAyB;AACzB,yCAAuB;AACvB,mDAAiC"}
|
package/src/lib/migrate.js
CHANGED
|
@@ -31,7 +31,11 @@ const migrateClaudeMd = (options) => {
|
|
|
31
31
|
(0, fs_1.writeFileSync)(claudePath, `@${AGENTS_MD}\n`, 'utf8');
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
if ((0, fs_1.lstatSync)(claudePath).isSymbolicLink()) {
|
|
35
|
+
log(`skip ${CLAUDE_MD} — a symlink, left untouched`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const claudeContent = withoutMarkedBlock((0, fs_1.readFileSync)(claudePath, 'utf8')).trim();
|
|
35
39
|
const agentsContent = (0, fs_1.existsSync)(agentsPath) ? (0, fs_1.readFileSync)(agentsPath, 'utf8').trim() : '';
|
|
36
40
|
const merged = [claudeContent, agentsContent].filter((part) => part.length > 0).join('\n\n');
|
|
37
41
|
log(`move ${CLAUDE_MD} content into ${AGENTS_MD}`);
|
|
@@ -138,6 +142,7 @@ const migrateConfig = (options) => {
|
|
|
138
142
|
const migrate = (options) => {
|
|
139
143
|
const { root, dryRun = false } = options;
|
|
140
144
|
console.log(dryRun ? 'Migration plan (dry run):' : 'Migrating to the AGENTS.md + .agents/skills layout:');
|
|
145
|
+
(0, config_1.loadConfig)({ root });
|
|
141
146
|
migrateClaudeMd({ root, dryRun });
|
|
142
147
|
migrateSkills({ root, dryRun });
|
|
143
148
|
addLayoutNote({ root, dryRun });
|
package/src/lib/migrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/migrate.ts"],"names":[],"mappings":";;;AAAA,2BASY;AACZ,+BAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/migrate.ts"],"names":[],"mappings":";;;AAAA,2BASY;AACZ,+BAA+C;AAC/C,qCAAqE;AACrE,iCAAiD;AACjD,qCAAoD;AACpD,iCAA0C;AAE1C,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,aAAa,GAAG,gBAAgB,CAAC;AACvC,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,MAAM,GAAG,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,OAA0C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