@karmaniverous/stan-core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -29
- package/dist/mjs/index.js +1 -1
- package/dist/types/index.d.ts +125 -192
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
# @karmaniverous/stan-core (engine)
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@karmaniverous/stan-core)  <!-- TYPEDOC_EXCLUDE --> [](https://docs.karmanivero.us/stan-core) [](https://github.com/karmaniverous/stan-core/tree/main/CHANGELOG.md)<!-- /TYPEDOC_EXCLUDE --> [](https://github.com/karmaniverous/stan-core/tree/main/LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/@karmaniverous/stan-core)  <!-- TYPEDOC_EXCLUDE --> [](https://docs.karmanivero.us/stan-core) [](https://github.com/karmaniverous/stan-core/tree/main/CHANGELOG.md)<!-- /TYPEDOC_EXCLUDE --> [](https://github.com/karmaniverous/stan-core/tree/main/LICENSE)
|
|
6
6
|
|
|
7
7
|
This package exposes the STAN engine as a library:
|
|
8
8
|
|
|
9
9
|
- File selection (gitignore + includes/excludes + reserved workspace rules)
|
|
10
10
|
- Archiving: full archive.tar and diff archive.diff.tar (binary screening)
|
|
11
11
|
- Patch engine: worktree‑first git apply cascade with jsdiff fallback
|
|
12
|
-
- File Ops: safe mv/cp/rm/rmdir/mkdirp block as “pre‑ops”
|
|
12
|
+
- File Ops: safe mv/cp/rm/rmdir/mkdirp block as “pre‑ops”
|
|
13
13
|
- Config loading/validation (top‑level `stan-core` in stan.config.yml|json)
|
|
14
14
|
- Imports staging under <stanPath>/imports/<label>/…
|
|
15
|
-
- Imports safety: patch + File Ops refuse to modify <stanPath>/imports
|
|
15
|
+
- Imports safety: patch + File Ops refuse to modify <stanPath>/imports/\*\* when the correct stanPath is provided
|
|
16
16
|
- Response‑format validator (optional)
|
|
17
17
|
|
|
18
18
|
For the CLI and TTY runner, see @karmaniverous/stan-cli.
|
|
@@ -168,32 +168,37 @@ Core file selection applies in this order:
|
|
|
168
168
|
- `includes` are additive and can re-include paths ignored by `.gitignore`.
|
|
169
169
|
- `excludes` are hard denials and override `includes`.
|
|
170
170
|
|
|
171
|
-
## Meta archive (context-mode thread opener)
|
|
172
|
-
|
|
173
|
-
When dependency graph mode is enabled, the engine can create a small `archive.meta.tar` (via `createMetaArchive`) intended as a thread opener:
|
|
174
|
-
|
|
175
|
-
- Includes `<stanPath>/system/**` (excluding `<stanPath>/system/.docs.meta.json`)
|
|
176
|
-
- Includes `<stanPath>/context/dependency.meta.json` (required)
|
|
177
|
-
-
|
|
178
|
-
- Includes repo-root (top-level) base files selected by current selection config
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
import
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
171
|
+
## Meta archive (context-mode thread opener)
|
|
172
|
+
|
|
173
|
+
When dependency graph mode is enabled, the engine can create a small `archive.meta.tar` (via `createMetaArchive`) intended as a thread opener:
|
|
174
|
+
|
|
175
|
+
- Includes `<stanPath>/system/**` (excluding `<stanPath>/system/.docs.meta.json`)
|
|
176
|
+
- Includes `<stanPath>/context/dependency.meta.json` (required)
|
|
177
|
+
- Omits `<stanPath>/context/dependency.state.json` always (clean slate for selections)
|
|
178
|
+
- Includes repo-root (top-level) base files selected by current selection config
|
|
179
|
+
- Optionally includes `<stanPath>/output/**` when `includeOutputDir: true` (combine mode); archive files are still excluded by tar filter
|
|
180
|
+
- Excludes staged payloads under `<stanPath>/context/{npm,abs}/**` by omission
|
|
181
|
+
|
|
182
|
+
## Dependency graph mode: TypeScript injection (host contract)
|
|
183
|
+
|
|
184
|
+
When you call `buildDependencyMeta(...)`, `@karmaniverous/stan-core` delegates dependency graph generation to its peer dependency `@karmaniverous/stan-context`.
|
|
185
|
+
|
|
186
|
+
TypeScript must be provided by the host environment (typically `stan-cli`) via either `typescript` (preferred) or `typescriptPath`. `stan-core` does not attempt to resolve or import TypeScript itself; it passes these values through to `stan-context`.
|
|
187
|
+
|
|
188
|
+
If neither `typescript` nor `typescriptPath` is provided, `buildDependencyMeta` will throw (the error originates from `stan-context`).
|
|
189
|
+
|
|
190
|
+
Minimal example:
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import ts from 'typescript';
|
|
194
|
+
import { buildDependencyMeta } from '@karmaniverous/stan-core';
|
|
195
|
+
await buildDependencyMeta({
|
|
196
|
+
cwd: process.cwd(),
|
|
197
|
+
stanPath: '.stan',
|
|
198
|
+
typescript: ts,
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
197
202
|
## Environment variables
|
|
198
203
|
|
|
199
204
|
See [Env Vars](./guides/env-vars.md) for a complete list of environment variable switches observed by the engine, tests, and release scripts.
|