@ethlete/agent-rules 0.1.0-next.1 → 0.1.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +20 -10
- package/content/skills/sdk-docs/SKILL.md +1 -0
- package/content/skills/sdk-local-build/SKILL.md +113 -0
- package/content/skills/sdk-source/SKILL.md +108 -0
- package/content/skills/styleguide/STYLEGUIDE.md +1 -1
- package/package.json +1 -1
- package/src/lib/config.d.ts +9 -5
- package/src/lib/config.js +1 -1
- package/src/lib/config.js.map +1 -1
- package/src/lib/plan.js +23 -3
- package/src/lib/plan.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @ethlete/agent-rules
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#3043](https://github.com/ethlete-io/ethdk/pull/3043) [`a311f80`](https://github.com/ethlete-io/ethdk/commit/a311f80455bc9cc9a925fe8f72ac945a1b057315) Thanks [@github-actions](https://github.com/apps/github-actions)! - New `sdk-source` and `sdk-local-build` skills let an agent read the SDK's own sources and test an unreleased build via `file:`, from the checkout named by the local config's new `sdkSourcePath`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#3043](https://github.com/ethlete-io/ethdk/pull/3043) [`9627646`](https://github.com/ethlete-io/ethdk/commit/96276462e1c2ecde5394b8b1eafcebbb9f56a973) Thanks [@github-actions](https://github.com/apps/github-actions)! - Styleguide: changeset notes are now capped at one to two sentences, with mechanism and API inventories
|
|
12
|
+
explicitly sent to the docs instead.
|
|
13
|
+
|
|
3
14
|
## 0.1.0-next.1
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -136,23 +136,33 @@ Available hooks:
|
|
|
136
136
|
past 200k input tokens bills the whole context at a premium rate, so the warnings
|
|
137
137
|
fire at ~140k/~170k instead of deep into the expensive range.
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
Hooks can be turned off per machine - see the local config below.
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
## Per-machine local config
|
|
142
|
+
|
|
143
|
+
A gitignored `ethlete-agents.config.local.json` at the repo root holds the values that
|
|
144
|
+
differ per developer, without touching any committed file:
|
|
143
145
|
|
|
144
146
|
```json
|
|
145
147
|
{
|
|
146
|
-
"disableHooks": true
|
|
148
|
+
"disableHooks": true,
|
|
149
|
+
"sdkSourcePath": "/absolute/path/to/ethlete-sdk"
|
|
147
150
|
}
|
|
148
151
|
```
|
|
149
152
|
|
|
150
|
-
`true` disables every generated hook; an array
|
|
151
|
-
ones. The hook scripts read
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
- **`disableHooks`** - `true` disables every generated hook; an array
|
|
154
|
+
(`["context-warning"]`) just the named ones. The hook scripts read the file at
|
|
155
|
+
runtime, so toggling takes effect on the next prompt - no `sync` needed.
|
|
156
|
+
- **`sdkSourcePath`** - a local `ethlete-sdk` checkout. The `sdk-source` and
|
|
157
|
+
`sdk-local-build` skills read it when the agent needs the SDK's own sources, or has to
|
|
158
|
+
build the SDK and install it here through a `file:` dependency. A relative path is
|
|
159
|
+
resolved from the repo root.
|
|
160
|
+
|
|
161
|
+
Everything in this file is read at runtime, never by `sync`: the generated files stay
|
|
162
|
+
identical on every machine and in CI, which is what lets `check` diff them. That is also
|
|
163
|
+
why the file takes nothing beyond these keys - `sync`/`check` warn about unknown keys,
|
|
164
|
+
and about an `sdkSourcePath` that is missing or is not an SDK checkout. Add the filename
|
|
165
|
+
to your repo's `.gitignore`.
|
|
156
166
|
|
|
157
167
|
## Authoring content
|
|
158
168
|
|
|
@@ -68,3 +68,4 @@ So the table guide is `{%docsBaseUrl%}/components/table`, the menu guide
|
|
|
68
68
|
|
|
69
69
|
- Data fetching has its own guide: {%skill:query%}
|
|
70
70
|
- Theming tokens and how to register themes: {%skill:theming%}
|
|
71
|
+
- When the docs cannot answer it, read the SDK source: {%skill:sdk-source%}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdk-local-build
|
|
3
|
+
description: Build the @ethlete SDK from a local ethlete-sdk checkout and install it into this repo through a `file:` dependency, so an unreleased SDK change can be tested against this app before it is published - and reverted cleanly afterwards. Read whenever an SDK-side fix needs verifying here, or when package.json already points at a local build.
|
|
4
|
+
kind: skill
|
|
5
|
+
scope: consumer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Testing an unreleased SDK build in this repo
|
|
9
|
+
|
|
10
|
+
Swapping an `@ethlete/*` dependency for a locally built one lets you verify an SDK
|
|
11
|
+
change against this app before it ships. It is a **temporary, local-only** state: the
|
|
12
|
+
`file:` specifier and the lockfile entry it produces must never be committed.
|
|
13
|
+
|
|
14
|
+
Prefer a published prerelease when one exists - installing `@ethlete/components@next`
|
|
15
|
+
is faster and reproducible for the whole team. Use a local build when the change is not
|
|
16
|
+
published yet, or when you are iterating on it.
|
|
17
|
+
|
|
18
|
+
## 1. Prerequisites
|
|
19
|
+
|
|
20
|
+
- The checkout path comes from `sdkSourcePath` in `ethlete-agents.config.local.json`;
|
|
21
|
+
{%skill:sdk-source%} covers resolving it and what to check before trusting it.
|
|
22
|
+
- The checkout has its dependencies installed (`yarn install` in the checkout root - the
|
|
23
|
+
SDK repo is a Yarn 4 workspace).
|
|
24
|
+
- Note which branch it is on. Building `main` when your app runs `-next` prereleases
|
|
25
|
+
swaps in a completely different API surface.
|
|
26
|
+
|
|
27
|
+
## 2. Build the libraries you changed
|
|
28
|
+
|
|
29
|
+
From the **checkout root**, one build per `@ethlete/*` package whose source you touched:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx nx build components # writes dist/libs/components
|
|
33
|
+
npx nx build query # writes dist/libs/query
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each build also builds the libs it depends on (`types` → `core` → `query` →
|
|
37
|
+
`components`), so a single command is enough to produce a consistent set. Only the
|
|
38
|
+
packages you actually changed need to be installed here; leave the rest on their
|
|
39
|
+
published versions.
|
|
40
|
+
|
|
41
|
+
If a build stalls trying to reach Nx Cloud, re-run it with `NX_NO_CLOUD=true`.
|
|
42
|
+
|
|
43
|
+
## 3. Point this repo at the build
|
|
44
|
+
|
|
45
|
+
Edit the version specifiers in `package.json` (the one declaring the dependency - in a
|
|
46
|
+
workspace that is the workspace package, not necessarily the root):
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ethlete/components": "file:../ethlete-sdk/dist/libs/components"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The path is resolved relative to that `package.json`; an absolute path works too. Then
|
|
57
|
+
install:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
yarn install
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Expect peer-dependency warnings - the built package pins peers to the SDK's own Angular
|
|
64
|
+
version. They are warnings, not failures; a real version conflict shows up as a build
|
|
65
|
+
error, and means the checkout is on the wrong branch.
|
|
66
|
+
|
|
67
|
+
## 4. Confirm the local build is really what got installed
|
|
68
|
+
|
|
69
|
+
`yarn install` is the only thing that copies the build into `node_modules`, so verifying
|
|
70
|
+
is not optional - a stale package looks exactly like a change that did not work:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
grep -m1 '"version"' node_modules/@ethlete/components/package.json
|
|
74
|
+
rg -n "<a symbol from your change>" node_modules/@ethlete/components/fesm2022/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Then **restart the dev server**. Bundlers pre-bundle dependencies and will keep serving
|
|
78
|
+
the old copy; if the change still does not show up, delete `.angular/cache` (and
|
|
79
|
+
`node_modules/.vite` if present) and start it again.
|
|
80
|
+
|
|
81
|
+
## 5. Iterating
|
|
82
|
+
|
|
83
|
+
Every SDK edit needs the full loop - there is no watch mode across the boundary:
|
|
84
|
+
|
|
85
|
+
1. rebuild in the checkout (`npx nx build <lib>`)
|
|
86
|
+
2. `yarn install` here
|
|
87
|
+
3. restart the dev server
|
|
88
|
+
|
|
89
|
+
Yarn 4 re-copies a `file:` dependency whenever its contents change, so step 2 does pick
|
|
90
|
+
up the rebuild. It also rewrites that package's `resolution` hash in `yarn.lock` on
|
|
91
|
+
every rebuild - which is one more reason the lockfile must not be committed in this
|
|
92
|
+
state. (With npm, `file:` symlinks instead of copying, so a rebuild is picked up without
|
|
93
|
+
reinstalling; the restart in step 3 is still required.)
|
|
94
|
+
|
|
95
|
+
## 6. Clean up when you are done
|
|
96
|
+
|
|
97
|
+
Leaving a `file:` dependency behind breaks every other checkout and CI, because the path
|
|
98
|
+
does not exist there. Restore it as part of the same task, not later:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
git checkout package.json # or hand-restore the original version specifier
|
|
102
|
+
yarn install
|
|
103
|
+
git status --short # package.json and yarn.lock must both be clean
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Never commit a `file:` specifier or the lockfile it produced. If the verified fix is
|
|
107
|
+
still unreleased, say what has to be published (which lib, which version) instead of
|
|
108
|
+
shipping a local path.
|
|
109
|
+
|
|
110
|
+
## Related
|
|
111
|
+
|
|
112
|
+
- Finding and reading the checkout: {%skill:sdk-source%}
|
|
113
|
+
- What the published packages document: {%skill:sdk-docs%}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdk-source
|
|
3
|
+
description: How to read the @ethlete SDK's own source from a local ethlete-sdk checkout when the docs and the installed types are not enough. Read when you need an implementation detail, the exact behaviour behind a bug, or an API the docs do not cover - and never edit that checkout as part of work in this repo.
|
|
4
|
+
kind: skill
|
|
5
|
+
scope: consumer
|
|
6
|
+
vars: [docsBaseUrl]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Reading the @ethlete SDK source
|
|
10
|
+
|
|
11
|
+
The SDK is developed in a separate repository (`ethlete-sdk`). Most questions are
|
|
12
|
+
answered faster and more reliably by the documentation - read {%skill:sdk-docs%}
|
|
13
|
+
first. Reach for the source when the docs genuinely cannot answer the question:
|
|
14
|
+
|
|
15
|
+
- a behaviour looks like an SDK bug and you need to see what the code actually does
|
|
16
|
+
- you need an implementation detail the guides omit (event order, internal defaults,
|
|
17
|
+
which host directive writes which attribute)
|
|
18
|
+
- the installed version is ahead of - or behind - the published docs and you have to
|
|
19
|
+
confirm what the code in _this_ version does
|
|
20
|
+
- you are about to report or fix something in the SDK itself
|
|
21
|
+
|
|
22
|
+
## 1. Resolve the checkout
|
|
23
|
+
|
|
24
|
+
The path is per machine, so it lives in the gitignored `ethlete-agents.config.local.json`
|
|
25
|
+
at the repo root:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"sdkSourcePath": "/absolute/path/to/ethlete-sdk"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Read that file before searching anywhere. A relative path is resolved from the repo root.
|
|
34
|
+
|
|
35
|
+
If the file or the key is missing, **do not guess a path** and do not clone the
|
|
36
|
+
repository. Fall back to the installed package - `node_modules/@ethlete/<lib>/types/`
|
|
37
|
+
holds the full `.d.ts` surface of exactly the version this repo runs - and to
|
|
38
|
+
{%docsBaseUrl%}. Then tell the user a local checkout would help, and offer the snippet
|
|
39
|
+
above (the file is gitignored, so adding it changes nothing for anyone else).
|
|
40
|
+
|
|
41
|
+
## 2. Check the checkout matches what is installed
|
|
42
|
+
|
|
43
|
+
A checkout sits on whatever branch the developer left it on, so it can be months of
|
|
44
|
+
work ahead of the installed package - or behind it. Compare before you trust it:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
grep '"@ethlete/' package.json # what this repo runs
|
|
48
|
+
grep -m1 '"version"' <sdkSourcePath>/libs/<lib>/package.json # what the checkout is at
|
|
49
|
+
git -C <sdkSourcePath> status -sb # branch, and whether it is dirty
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Rules when they differ:
|
|
53
|
+
|
|
54
|
+
- **The installed package wins** for anything about how this repo behaves today. The
|
|
55
|
+
`.d.ts` in `node_modules` is the truth about the API you are calling.
|
|
56
|
+
- Source that is ahead describes an **unreleased** API. Never write consumer code
|
|
57
|
+
against it, and never assume it is available - say what release it needs.
|
|
58
|
+
- A dirty checkout may contain someone's work in progress. Say so rather than quoting
|
|
59
|
+
it as SDK behaviour.
|
|
60
|
+
|
|
61
|
+
## 3. Where things live
|
|
62
|
+
|
|
63
|
+
Paths are relative to the checkout root:
|
|
64
|
+
|
|
65
|
+
| Path | What is in it |
|
|
66
|
+
| ----------------------------------- | --------------------------------------------------------------------------- |
|
|
67
|
+
| `libs/components/src/lib/<domain>/` | The active UI library, one folder per domain (`button`, `menu`, `table`, …) |
|
|
68
|
+
| `libs/core/src/lib/` | Framework primitives: directives, signal utils, overlay runtime, theming |
|
|
69
|
+
| `libs/query/src/lib/` | Data fetching: `http`, `gql`, `ws`, auth, query-form |
|
|
70
|
+
| `libs/types/src/lib/` | Shared types |
|
|
71
|
+
| `libs/cdk/` | The predecessor UI toolkit, maintenance mode - only for code still on it |
|
|
72
|
+
| `libs/eslint-plugin/src/` | The lint rules, including the message text explaining each one |
|
|
73
|
+
| `apps/docs/` | The markdown behind {%docsBaseUrl%} |
|
|
74
|
+
| `apps/playground/` | The Storybook app - stories also live next to each component |
|
|
75
|
+
|
|
76
|
+
Inside a component domain: `<name>.component.ts` with its `.css` next to it,
|
|
77
|
+
`<name>.imports.ts` (the imports array to spread into a consumer component),
|
|
78
|
+
`headless/` for the unstyled directives, `stories/` for the Storybook stories, and
|
|
79
|
+
`index.ts` as the barrel. The lib's public surface is `libs/<lib>/src/index.ts` -
|
|
80
|
+
anything not re-exported from there is internal, whatever it looks like.
|
|
81
|
+
|
|
82
|
+
## 4. Search it, don't read it whole
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
rg -n "etButton" <sdkSourcePath>/libs/components/src --glob '!*.spec.ts' # a selector
|
|
86
|
+
rg -n "export const OVERLAY" <sdkSourcePath>/libs/core/src # an export
|
|
87
|
+
rg -n "menu" <sdkSourcePath>/apps/docs/components # the guide source
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Specs are the cheapest description of intended behaviour - `<name>.component.spec.ts`
|
|
91
|
+
next to a component usually answers "is this supposed to happen?" faster than the
|
|
92
|
+
implementation does.
|
|
93
|
+
|
|
94
|
+
## 5. The checkout is read-only from here
|
|
95
|
+
|
|
96
|
+
It is a different repository with its own branch, lint, docs and changeset workflow.
|
|
97
|
+
Never edit it while working on a task in this repo, and never copy its internals into
|
|
98
|
+
consumer code - a private helper is not a supported API and disappears without a major
|
|
99
|
+
version (the same goes for anything under a `subtle` namespace).
|
|
100
|
+
|
|
101
|
+
When the fix belongs in the SDK, say so and describe it precisely: file, symbol, and
|
|
102
|
+
the behaviour it should have. If the user wants that fix verified against this app
|
|
103
|
+
before it ships, that is {%skill:sdk-local-build%}.
|
|
104
|
+
|
|
105
|
+
## Related
|
|
106
|
+
|
|
107
|
+
- Docs and Storybook, which come first: {%skill:sdk-docs%}
|
|
108
|
+
- Testing an unreleased SDK build here: {%skill:sdk-local-build%}
|
|
@@ -463,7 +463,7 @@ settings-form/
|
|
|
463
463
|
- **Do not** create a changeset for irrelevant changes (e.g., formatting, comments, internal refactoring).
|
|
464
464
|
- **Do not** create a changeset for fixes to features that have not yet been released.
|
|
465
465
|
- **Do not** include multiple changes in a single changeset. Each changeset should contain only one change.
|
|
466
|
-
- **
|
|
466
|
+
- **A changeset note is a TL;DR: one sentence, two at most, under 40 words.** Never a second paragraph, no matter how much work the change took. It is the line a consumer skims to decide whether the release affects them - not a summary of your work. Mechanism, API inventories, caveats and rationale belong in the docs or the commit body, never here.
|
|
467
467
|
- Create changesets for dependency updates if they are relevant to the project (e.g., major version updates).
|
|
468
468
|
- Write changesets in the imperative mood. For example:
|
|
469
469
|
- Add button component
|
package/package.json
CHANGED
package/src/lib/config.d.ts
CHANGED
|
@@ -20,14 +20,18 @@ export type SyncConfig = {
|
|
|
20
20
|
hooks: string[];
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* The gitignored local config
|
|
24
|
-
*
|
|
25
|
-
* generated files are committed and `check` diffs them),
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* The gitignored local config holds per-machine values, read at runtime — by the generated hook
|
|
24
|
+
* scripts, and by the agent while following a skill — never by `sync`. Sync output must be
|
|
25
|
+
* identical on every machine and in CI (the generated files are committed and `check` diffs them),
|
|
26
|
+
* so nothing here may change what gets emitted:
|
|
27
|
+
*
|
|
28
|
+
* - `disableHooks: true` silences every generated hook, `["context-warning"]` just the named ones.
|
|
29
|
+
* - `sdkSourcePath` points at a local `ethlete-sdk` checkout, which the SDK source and local-build
|
|
30
|
+
* skills read when they need the SDK's own sources instead of the published package.
|
|
28
31
|
*/
|
|
29
32
|
export type LocalConfig = {
|
|
30
33
|
disableHooks?: boolean | string[];
|
|
34
|
+
sdkSourcePath?: string;
|
|
31
35
|
};
|
|
32
36
|
export type LocalConfigState = {
|
|
33
37
|
exists: false;
|
package/src/lib/config.js
CHANGED
|
@@ -13,7 +13,7 @@ const readRawConfig = (root) => {
|
|
|
13
13
|
return {};
|
|
14
14
|
return JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
|
|
15
15
|
};
|
|
16
|
-
const LOCAL_CONFIG_KEYS = ['disableHooks'];
|
|
16
|
+
const LOCAL_CONFIG_KEYS = ['disableHooks', 'sdkSourcePath'];
|
|
17
17
|
const readLocalConfig = (root) => {
|
|
18
18
|
const path = (0, path_1.join)(root, exports.LOCAL_CONFIG_FILE_NAME);
|
|
19
19
|
if (!(0, fs_1.existsSync)(path))
|
package/src/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../libs/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AAC;IAE5B,OAAO;QACL,IAAI;QACJ,OAAO;QACP,MAAM,EAAE,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;QAC/D,IAAI,kCAAO,IAAA,8BAAe,GAAE,GAAK,CAAC,MAAA,GAAG,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAE;QACnD,OAAO,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,EAAE;QAC1B,uBAAuB,EAAE,MAAA,GAAG,CAAC,uBAAuB,mCAAI,KAAK;QAC7D,KAAK,EAAE,MAAA,GAAG,CAAC,KAAK,mCAAI,EAAE;KACvB,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,UAAU,cAiBrB"}
|
package/src/lib/plan.js
CHANGED
|
@@ -31,10 +31,29 @@ const claudeMdImportsAgentsMd = (root) => {
|
|
|
31
31
|
return /^@AGENTS\.md\s*$/m.test((0, fs_1.readFileSync)(path, 'utf8'));
|
|
32
32
|
};
|
|
33
33
|
exports.claudeMdImportsAgentsMd = claudeMdImportsAgentsMd;
|
|
34
|
+
/** Marks a directory as an `ethlete-sdk` checkout rather than some other folder. */
|
|
35
|
+
const SDK_CHECKOUT_MARKERS = ['libs/components', 'libs/core', 'libs/agent-rules'];
|
|
36
|
+
const describeSdkSourcePath = (options) => {
|
|
37
|
+
const { root, value } = options;
|
|
38
|
+
if (value === undefined)
|
|
39
|
+
return [];
|
|
40
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
41
|
+
return [`${config_1.LOCAL_CONFIG_FILE_NAME} has an invalid "sdkSourcePath" — use a path to an ethlete-sdk checkout.`];
|
|
42
|
+
}
|
|
43
|
+
const absolute = (0, path_1.resolve)(root, value);
|
|
44
|
+
if (!(0, fs_1.existsSync)(absolute)) {
|
|
45
|
+
return [`${config_1.LOCAL_CONFIG_FILE_NAME} points "sdkSourcePath" at ${absolute}, which does not exist.`];
|
|
46
|
+
}
|
|
47
|
+
if (SDK_CHECKOUT_MARKERS.some((marker) => !(0, fs_1.existsSync)((0, path_1.join)(absolute, marker)))) {
|
|
48
|
+
return [`${config_1.LOCAL_CONFIG_FILE_NAME} points "sdkSourcePath" at ${absolute}, which is not an ethlete-sdk checkout.`];
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
51
|
+
};
|
|
34
52
|
/**
|
|
35
|
-
* The local file only affects
|
|
53
|
+
* The local file only affects runtime behavior, never sync output — so the warnings here are about
|
|
36
54
|
* the mistakes that would otherwise fail silently: a file the hooks can't parse, a key that
|
|
37
|
-
* suggests someone expected sync-time overrides,
|
|
55
|
+
* suggests someone expected sync-time overrides, a hook name nothing matches, or an SDK path that
|
|
56
|
+
* no longer exists (the skills reading it would just report the checkout as missing).
|
|
38
57
|
*/
|
|
39
58
|
const collectLocalConfigWarnings = (root) => {
|
|
40
59
|
const local = (0, config_1.readLocalConfig)(root);
|
|
@@ -45,8 +64,9 @@ const collectLocalConfigWarnings = (root) => {
|
|
|
45
64
|
}
|
|
46
65
|
const warnings = [];
|
|
47
66
|
if (local.unknownKeys.length > 0) {
|
|
48
|
-
warnings.push(`${config_1.LOCAL_CONFIG_FILE_NAME} contains unsupported key(s): ${local.unknownKeys.join(', ')} — the local file
|
|
67
|
+
warnings.push(`${config_1.LOCAL_CONFIG_FILE_NAME} contains unsupported key(s): ${local.unknownKeys.join(', ')} — the local file supports "disableHooks" and "sdkSourcePath"; it never changes what sync writes.`);
|
|
49
68
|
}
|
|
69
|
+
warnings.push(...describeSdkSourcePath({ root, value: local.config.sdkSourcePath }));
|
|
50
70
|
const disable = local.config.disableHooks;
|
|
51
71
|
if (disable !== undefined && typeof disable !== 'boolean' && !Array.isArray(disable)) {
|
|
52
72
|
warnings.push(`${config_1.LOCAL_CONFIG_FILE_NAME} has an invalid "disableHooks" value — use true or an array of hook names; hooks stay enabled.`);
|
package/src/lib/plan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/plan.ts"],"names":[],"mappings":";;;AAAA,2BAAuE;AACvE,+
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/plan.ts"],"names":[],"mappings":";;;AAAA,2BAAuE;AACvE,+BAAqC;AACrC,qCAA+E;AAC/E,qCAAsD;AACtD,iDAA0D;AAC1D,2DAA2D;AAC3D,yDAA+G;AAC/G,6CAA8C;AAC9C,2CAAwD;AACxD,+CAA8D;AAC9D,6CAA8C;AAY9C,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AAElE,MAAM,iBAAiB,GAAG,CAAC,KAAoB,EAAE,aAA0B,EAAE,EAAE,CAC7E,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CACrB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;KACxC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC;KAClC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KAC1C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAC9D,CAAC;AAEJ,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,YAAoB,EAAE,EAAE;IAC1D,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAEtC,OAAO,IAAA,eAAU,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC,CAAC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