@ethlete/agent-rules 0.1.0-next.5 → 0.1.0-next.51
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 +759 -0
- package/CLAUDE.md +1 -0
- package/README.md +434 -25
- 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/away-mode.py +327 -0
- package/content/hooks/background-design-commands.py +228 -0
- package/content/hooks/builder-idle-check.py +397 -0
- package/content/hooks/context-warning.py +694 -134
- package/content/hooks/design-live-check.py +136 -0
- package/content/hooks/git-safety.py +213 -0
- package/content/hooks/human-wait-check.py +167 -0
- package/content/hooks/subagent-model-policy.py +261 -0
- package/content/mods/.claude-plugin/marketplace.json +26 -0
- package/content/mods/plugins/codex-runs/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/codex-runs/hooks/hooks.json +1 -0
- package/content/mods/plugins/codex-runs/hooks/progress.ts +130 -0
- package/content/mods/plugins/codex-runs/hooks/register.tsx +103 -0
- package/content/mods/plugins/codex-runs/tsconfig.json +4 -0
- package/content/mods/plugins/codex-runs/types/index.d.ts +19 -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/progress.ts +160 -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 +26 -0
- package/content/mods/plugins/status-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/status-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/status-line/hooks/line.ts +74 -0
- package/content/mods/plugins/status-line/hooks/register.tsx +141 -0
- package/content/mods/plugins/status-line/types/index.d.ts +5 -0
- package/content/mods/plugins/usage-line/.claude-plugin/plugin.json +6 -0
- package/content/mods/plugins/usage-line/hooks/codex.ts +52 -0
- package/content/mods/plugins/usage-line/hooks/format.ts +24 -0
- package/content/mods/plugins/usage-line/hooks/hooks.json +1 -0
- package/content/mods/plugins/usage-line/hooks/register.tsx +67 -0
- package/content/mods/plugins/usage-line/tsconfig.json +4 -0
- package/content/mods/plugins/usage-line/types/index.d.ts +5 -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 +53 -0
- package/content/rules/reactive-state.md +1 -1
- package/content/rules/styling.md +19 -10
- package/content/rules/subagent-models.md +42 -0
- package/content/rules/waiting-on-the-human.md +17 -0
- package/content/skills/agent-sessions/SKILL.md +100 -0
- package/content/skills/agent-sessions/agent-sessions.mjs +1420 -0
- package/content/skills/angular-patterns/SKILL.md +31 -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 +96 -0
- package/content/skills/codex-subagent/codex-agent.mjs +229 -0
- package/content/skills/codex-subagent/codex-limit.mjs +106 -0
- package/content/skills/design-exploration/SKILL.md +203 -0
- package/content/skills/design-exploration/check-story.mjs +139 -0
- package/content/skills/design-exploration/reference-check-and-notes.md +101 -0
- package/content/skills/design-exploration/reference-flows.md +38 -0
- package/content/skills/design-exploration/reference-inbox-and-mcp.md +54 -0
- package/content/skills/design-exploration/reference-order-and-design-system.md +120 -0
- package/content/skills/design-exploration/reference-products-and-sketches.md +250 -0
- package/content/skills/design-exploration/reference-shots.md +25 -0
- package/content/skills/design-exploration/shoot-template.mjs +61 -0
- package/content/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/content/skills/domain-modeling/SKILL.md +71 -0
- package/content/skills/e2e-triage/SKILL.md +80 -0
- package/content/skills/figma-export/SKILL.md +16 -18
- package/content/skills/git-commit/SKILL.md +21 -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 +52 -0
- package/content/skills/handoff/SKILL.md +29 -69
- package/content/skills/handoff/save.md +187 -0
- package/content/skills/query/SKILL.md +165 -70
- package/content/skills/report/SKILL.md +26 -0
- 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 +12 -10
- package/content/skills/styleguide/SKILL.md +13 -8
- 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 +52 -0
- package/content/skills/styleguide/storybook-structure.md +25 -0
- package/content/skills/theming/SKILL.md +76 -49
- package/content/skills/timetrack/SKILL.md +324 -0
- package/content/skills/verify-in-app/SKILL.md +107 -0
- package/content/skills/verify-in-storybook/SKILL.md +1 -1
- 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 +39 -0
- package/package.json +19 -3
- package/src/index.js +99 -32
- 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 +68 -6
- package/src/lib/config.js +141 -11
- 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-test-env.fixtures.d.ts +11 -0
- package/src/lib/git-test-env.fixtures.js +31 -0
- package/src/lib/git-test-env.fixtures.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 +8 -2
- 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 +8 -2
- 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/peer-path.d.ts +12 -0
- package/src/lib/peer-path.js +39 -0
- package/src/lib/peer-path.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 +167 -39
- package/src/lib/plan.js.map +1 -1
- package/src/lib/prettier.d.ts +21 -0
- package/src/lib/prettier.js +51 -0
- package/src/lib/prettier.js.map +1 -0
- 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 +26 -2
- package/src/lib/render.js +45 -10
- package/src/lib/render.js.map +1 -1
- package/src/lib/report-command.d.ts +34 -0
- package/src/lib/report-command.js +316 -0
- package/src/lib/report-command.js.map +1 -0
- 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 +1 -2
- package/src/lib/sync.js +37 -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 +5 -0
- package/src/lib/targets/claude-hooks.js +27 -4
- 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.js +4 -2
- package/src/lib/targets/codex-hooks.js.map +1 -1
- 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 +29 -5
- package/src/lib/targets/hooks-shared.js +130 -36
- package/src/lib/targets/hooks-shared.js.map +1 -1
- package/src/lib/targets/mcp.d.ts +16 -0
- package/src/lib/targets/mcp.js +72 -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 +1262 -0
- package/src/lib/timetrack-command.js.map +1 -0
- package/src/lib/timetrack-snapshot.d.ts +66 -0
- package/src/lib/timetrack-snapshot.js +146 -0
- package/src/lib/timetrack-snapshot.js.map +1 -0
- package/src/lib/timetrack.d.ts +607 -0
- package/src/lib/timetrack.js +285 -0
- package/src/lib/timetrack.js.map +1 -0
- package/content/skills/styleguide/STYLEGUIDE.md +0 -520
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ExecFileSyncOptions, SpawnSyncOptions, SpawnSyncReturns } from 'child_process';
|
|
2
|
+
/** `process.env` plus `extra` without the `GIT_*` variables inherited from a hook, so git in a temp repo never reaches the hook's repo. */
|
|
3
|
+
export declare const gitEnv: (extra?: Record<string, string | undefined>) => NodeJS.ProcessEnv;
|
|
4
|
+
/** `execFileSync('git', args, options)` with every inherited `GIT_*` variable stripped. */
|
|
5
|
+
export declare const gitExec: (args: string[], options?: ExecFileSyncOptions) => string & Buffer;
|
|
6
|
+
/** `spawnSync('git', args, options)` with every inherited `GIT_*` variable stripped. */
|
|
7
|
+
export declare const gitSpawn: (args: string[], options?: SpawnSyncOptions) => SpawnSyncReturns<string & Buffer>;
|
|
8
|
+
/** Runs git in `dir` with `GIT_*` stripped and returns trimmed stdout. */
|
|
9
|
+
export declare const git: (dir: string, ...args: string[]) => string;
|
|
10
|
+
/** Makes a temp directory, runs `git init` in it and returns its path. */
|
|
11
|
+
export declare const tempGitRepo: (prefix?: string) => string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tempGitRepo = exports.git = exports.gitSpawn = exports.gitExec = exports.gitEnv = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const os_1 = require("os");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
/** `process.env` plus `extra` without the `GIT_*` variables inherited from a hook, so git in a temp repo never reaches the hook's repo. */
|
|
9
|
+
const gitEnv = (extra = {}) => {
|
|
10
|
+
const merged = Object.assign(Object.assign({}, process.env), extra);
|
|
11
|
+
return Object.fromEntries(Object.entries(merged).filter(([key, value]) => !(key.startsWith('GIT_') && process.env[key] === value)));
|
|
12
|
+
};
|
|
13
|
+
exports.gitEnv = gitEnv;
|
|
14
|
+
const withGitEnv = (options) => (Object.assign(Object.assign({}, options), { env: (0, exports.gitEnv)(options === null || options === void 0 ? void 0 : options.env) }));
|
|
15
|
+
/** `execFileSync('git', args, options)` with every inherited `GIT_*` variable stripped. */
|
|
16
|
+
const gitExec = (args, options) => (0, child_process_1.execFileSync)('git', args, withGitEnv(options));
|
|
17
|
+
exports.gitExec = gitExec;
|
|
18
|
+
/** `spawnSync('git', args, options)` with every inherited `GIT_*` variable stripped. */
|
|
19
|
+
const gitSpawn = (args, options) => (0, child_process_1.spawnSync)('git', args, withGitEnv(options));
|
|
20
|
+
exports.gitSpawn = gitSpawn;
|
|
21
|
+
/** Runs git in `dir` with `GIT_*` stripped and returns trimmed stdout. */
|
|
22
|
+
const git = (dir, ...args) => (0, exports.gitExec)(args, { cwd: dir, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
23
|
+
exports.git = git;
|
|
24
|
+
/** Makes a temp directory, runs `git init` in it and returns its path. */
|
|
25
|
+
const tempGitRepo = (prefix = 'git-spec-') => {
|
|
26
|
+
const dir = (0, fs_1.mkdtempSync)((0, path_1.join)((0, os_1.tmpdir)(), prefix));
|
|
27
|
+
(0, exports.git)(dir, 'init', '-q');
|
|
28
|
+
return dir;
|
|
29
|
+
};
|
|
30
|
+
exports.tempGitRepo = tempGitRepo;
|
|
31
|
+
//# sourceMappingURL=git-test-env.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-test-env.fixtures.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/git-test-env.fixtures.ts"],"names":[],"mappings":";;;AAAA,iDAAiH;AACjH,2BAAiC;AACjC,2BAA4B;AAC5B,+BAA4B;AAE5B,2IAA2I;AACpI,MAAM,MAAM,GAAG,CAAC,QAA4C,EAAE,EAAE,EAAE;IACvE,MAAM,MAAM,mCAAQ,OAAO,CAAC,GAAG,GAAK,KAAK,CAAE,CAAC;IAC5C,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC,CACpF,CAAC;AACzB,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
+
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,MAAM,CAAC;IACjC,SAAS,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;CAC7B,CAAC,CAAC,IAAI,EAAE,CAAC;AANC,QAAA,GAAG,OAMJ;AAEZ,gGAAgG;AACzF,MAAM,OAAO,GAAG,CAAC,OAAyC,EAAE,EAAE,CACnE,IAAA,4BAAY,EAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;AADzG,QAAA,OAAO,WACkG;AAE/G,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAA,WAAG,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAA7F,QAAA,aAAa,iBAAgF;AAE1G;;;GAGG;AACI,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE;IAC7C,IAAI,CAAC;QACH,OAAO,IAAA,WAAG,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,CAA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AC1B,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1D;KACF,CAAC,CAAC;IAEH,OAAO,GAAG;SACP,KAAK,CAAC,IAAI,CAAC;SACX,OAAO,CAAC,CAAC,KAAK,EAAoB,EAAE;;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,GAAG,GAAG,MAAA,KAAK,CAAC,KAAK,EAAE,mCAAI,EAAE,CAAC;QAEhC,OAAO,MAAM,CAAC,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,aAAH,GAAG,uBAAH,GAAG,CAAG,CAAC,CAAC,KAAI,GAAG,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjE,MAAM,UAAU,GAAG,mEAAmE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErG,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,CAAC,CAAC,KAAI,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAE7F,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAXW,QAAA,cAAc,kBAWzB;AAEF,MAAM,WAAW,GAAG,GAAG,EAAE;;IACvB,OAAA,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,mCAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,mCAAI,EAAE,CAAC;SACpF,GAAG,CAAC,CAAC,IAAI,EAAE,EAA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G,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC,CAAA,CAAC;AAdW,QAAA,oBAAoB,wBAc/B;AAEK,MAAM,oBAAoB,GAAG,CAAO,OAK1C,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEhD,MAAM,OAAO,CAAC;QACZ,OAAO;QACP,KAAK;QACL,IAAI,EAAE,mBAAmB,GAAG,EAAE;QAC9B,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE;KACxC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAfW,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
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.migrate = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
|
+
const prettier_1 = require("./prettier");
|
|
6
7
|
const config_1 = require("./config");
|
|
7
8
|
const plan_1 = require("./plan");
|
|
8
9
|
const render_1 = require("./render");
|
|
@@ -31,7 +32,11 @@ const migrateClaudeMd = (options) => {
|
|
|
31
32
|
(0, fs_1.writeFileSync)(claudePath, `@${AGENTS_MD}\n`, 'utf8');
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
if ((0, fs_1.lstatSync)(claudePath).isSymbolicLink()) {
|
|
36
|
+
log(`skip ${CLAUDE_MD} — a symlink, left untouched`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const claudeContent = withoutMarkedBlock((0, fs_1.readFileSync)(claudePath, 'utf8')).trim();
|
|
35
40
|
const agentsContent = (0, fs_1.existsSync)(agentsPath) ? (0, fs_1.readFileSync)(agentsPath, 'utf8').trim() : '';
|
|
36
41
|
const merged = [claudeContent, agentsContent].filter((part) => part.length > 0).join('\n\n');
|
|
37
42
|
log(`move ${CLAUDE_MD} content into ${AGENTS_MD}`);
|
|
@@ -129,7 +134,7 @@ const migrateConfig = (options) => {
|
|
|
129
134
|
raw['claudeMdImportsAgentsMd'] = true;
|
|
130
135
|
log(`write ${config_1.CONFIG_FILE_NAME} — codex target + claudeMdImportsAgentsMd`);
|
|
131
136
|
if (!dryRun)
|
|
132
|
-
(0,
|
|
137
|
+
(0, prettier_1.writeJsonFile)({ file: path, value: raw });
|
|
133
138
|
};
|
|
134
139
|
/**
|
|
135
140
|
* Converts a repo to the `AGENTS.md`-canonical layout and re-syncs. Safe to re-run: every step
|
|
@@ -138,6 +143,7 @@ const migrateConfig = (options) => {
|
|
|
138
143
|
const migrate = (options) => {
|
|
139
144
|
const { root, dryRun = false } = options;
|
|
140
145
|
console.log(dryRun ? 'Migration plan (dry run):' : 'Migrating to the AGENTS.md + .agents/skills layout:');
|
|
146
|
+
(0, config_1.loadConfig)({ root });
|
|
141
147
|
migrateClaudeMd({ root, dryRun });
|
|
142
148
|
migrateSkills({ root, dryRun });
|
|
143
149
|
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,yCAA2C;AAC3C,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,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACjC,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,SAA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C;IAChC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAEhC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;QAEpF,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE/B,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,CAAC;IAE7B,OAAO,CAAC,GAAG,CACT,0HAA0H,CAC3H,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA3BW,QAAA,OAAO,WA2BlB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.outputStyleCommand = void 0;
|
|
4
|
+
const output_style_1 = require("./output-style");
|
|
5
|
+
const FLAGS_WITH_VALUE = ['--config-dir'];
|
|
6
|
+
const positionalArgs = (args) => args.filter((entry, index) => { var _a; return !entry.startsWith('--') && !FLAGS_WITH_VALUE.includes((_a = args[index - 1]) !== null && _a !== void 0 ? _a : ''); });
|
|
7
|
+
const flagValue = (args, flag) => {
|
|
8
|
+
const index = args.indexOf(flag);
|
|
9
|
+
return index === -1 ? undefined : args[index + 1];
|
|
10
|
+
};
|
|
11
|
+
const usage = () => `ethlete-agents output-style — install an Ethlete output style into Claude Code
|
|
12
|
+
|
|
13
|
+
An output style replaces Claude Code's own answer style for every session, so it is written
|
|
14
|
+
into the machine's Claude config rather than into a repository.
|
|
15
|
+
|
|
16
|
+
output-style [name] Install the style and switch Claude Code to it
|
|
17
|
+
(default: ${output_style_1.DEFAULT_OUTPUT_STYLE})
|
|
18
|
+
|
|
19
|
+
Options
|
|
20
|
+
--no-activate Write the file, but leave "outputStyle" in settings.json alone
|
|
21
|
+
--remove Delete the style file and stop using it
|
|
22
|
+
--force Overwrite (or delete) a style file this command did not write
|
|
23
|
+
--dry-run Print what would change without writing
|
|
24
|
+
--config-dir <path> Claude's config directory (default: $CLAUDE_CONFIG_DIR, else ~/.claude)
|
|
25
|
+
|
|
26
|
+
Ships: ${(0, output_style_1.availableOutputStyles)().join(', ') || 'nothing'}
|
|
27
|
+
|
|
28
|
+
Claude Code only. Codex has no output-style mechanism - everything it is told comes from
|
|
29
|
+
AGENTS.md, which \`ethlete-agents sync\` already writes.
|
|
30
|
+
`;
|
|
31
|
+
const describe = (file) => ` ${file.action.padEnd(6)} ${file.path}`;
|
|
32
|
+
const outputStyleCommand = (options) => {
|
|
33
|
+
const { argv } = options;
|
|
34
|
+
if (argv.includes('--help') || argv.includes('-h')) {
|
|
35
|
+
console.log(usage());
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
const plan = (0, output_style_1.planOutputStyle)({
|
|
39
|
+
name: positionalArgs(argv)[0],
|
|
40
|
+
configDir: flagValue(argv, '--config-dir'),
|
|
41
|
+
activate: !argv.includes('--no-activate'),
|
|
42
|
+
remove: argv.includes('--remove'),
|
|
43
|
+
force: argv.includes('--force'),
|
|
44
|
+
});
|
|
45
|
+
console.log(`Style ${plan.name}`);
|
|
46
|
+
console.log(`Config ${plan.configDir}`);
|
|
47
|
+
if (plan.conflict) {
|
|
48
|
+
console.error(plan.conflict);
|
|
49
|
+
return 1;
|
|
50
|
+
}
|
|
51
|
+
if (plan.files.length === 0) {
|
|
52
|
+
console.log(argv.includes('--remove') ? 'It is not installed here.' : 'Already installed and in use.');
|
|
53
|
+
return 0;
|
|
54
|
+
}
|
|
55
|
+
plan.files.forEach((file) => console.log(describe(file)));
|
|
56
|
+
if (argv.includes('--dry-run')) {
|
|
57
|
+
console.log(`\n${plan.files.length} file(s) would change. Re-run without --dry-run to apply.`);
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
(0, output_style_1.applyOutputStylePlan)(plan);
|
|
61
|
+
if (argv.includes('--remove')) {
|
|
62
|
+
console.log('\nRemoved. A session that is already open keeps the style until it restarts.');
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
console.log(`\nInstalled. Start a new session, or run \`/output-style ${plan.name}\`, to use it.`);
|
|
66
|
+
return 0;
|
|
67
|
+
};
|
|
68
|
+
exports.outputStyleCommand = outputStyleCommand;
|
|
69
|
+
//# sourceMappingURL=output-style-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-style-command.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/output-style-command.ts"],"names":[],"mappings":";;;AAAA,iDAMwB;AAExB,MAAM,gBAAgB,GAAG,CAAC,cAAc,CAAC,CAAC;AAE1C,MAAM,cAAc,GAAG,CAAC,IAAc,EAAE,EAAE,CACxC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,WAAC,OAAA,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAA,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAC,CAAC;AAE9G,MAAM,SAAS,GAAG,CAAC,IAAc,EAAE,IAAY,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC;;;;;;sCAMkB,mCAAoB;;;;;;;;;SASjD,IAAA,oCAAqB,GAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,SAAS;;;;CAIvD,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAsC,EAAE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