@orkestrel/scaffold 0.0.99 → 0.0.101
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/dist/bin/main.js +74 -19
- package/dist/bin/main.js.map +1 -1
- package/dist/host/claude/rules/workspace.md +6 -0
- package/dist/host/configs/helpers.ts +8 -0
- package/dist/host/dotfiles/gitignore +1 -0
- package/dist/host/dotfiles/oxlintrc.json +10 -0
- package/dist/host/guides/scaffold.md +26 -4
- package/dist/host/manifest.json +8 -8
- package/dist/host/tests/config.test.ts +99 -0
- package/dist/host/tests/setupPolicy.ts +31 -0
- package/dist/src/core/index.cjs +103 -4
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +40 -1
- package/dist/src/core/index.d.ts +40 -1
- package/dist/src/core/index.js +101 -5
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +9 -3
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +7 -1
- package/dist/src/server/index.d.ts +7 -1
- package/dist/src/server/index.js +11 -5
- package/dist/src/server/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1263,6 +1263,9 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1263
1263
|
* the manifest only through `additions`, which inserts it into the section its
|
|
1264
1264
|
* list names in key order, creating that section when the manifest lacks it,
|
|
1265
1265
|
* before the ranges are rewritten.
|
|
1266
|
+
* Scoped npm overrides insert absent ancestors and leaves and replace owned
|
|
1267
|
+
* string leaves. Malformed ancestors, duplicate selected keys, and non-string
|
|
1268
|
+
* owned leaves refuse the entire manifest write.
|
|
1266
1269
|
*
|
|
1267
1270
|
* The regions refuse differently because their targets differ. A range
|
|
1268
1271
|
* the manifest does not declare is the caller's mistake and throws. A script
|
|
@@ -1428,7 +1431,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1428
1431
|
/**
|
|
1429
1432
|
* Rewrites the manifest regions the caller names in the target's manifest.
|
|
1430
1433
|
*
|
|
1431
|
-
* @param regions - The dependency ranges, script values, and
|
|
1434
|
+
* @param regions - The dependency ranges, script values, additions, and npm overrides to declare.
|
|
1432
1435
|
* @param target - The directory to write into.
|
|
1433
1436
|
* @returns The manifest path, written when a named region moved and skipped otherwise.
|
|
1434
1437
|
*
|
|
@@ -1439,6 +1442,9 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1439
1442
|
* without a byte moving, and the range region is written regardless. An
|
|
1440
1443
|
* addition is inserted into the section its list names, which is created when
|
|
1441
1444
|
* the manifest lacks it, and one the manifest already declares is refused.
|
|
1445
|
+
* Selected npm override leaves are inserted or replaced in place. Invalid JSON,
|
|
1446
|
+
* duplicate selected keys, malformed ancestors, and non-string owned leaves
|
|
1447
|
+
* refuse the entire manifest write before any region changes.
|
|
1442
1448
|
*/
|
|
1443
1449
|
declare(regions: ManifestRegionSet, target: string): MaterializeResult;
|
|
1444
1450
|
/**
|
|
@@ -1263,6 +1263,9 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1263
1263
|
* the manifest only through `additions`, which inserts it into the section its
|
|
1264
1264
|
* list names in key order, creating that section when the manifest lacks it,
|
|
1265
1265
|
* before the ranges are rewritten.
|
|
1266
|
+
* Scoped npm overrides insert absent ancestors and leaves and replace owned
|
|
1267
|
+
* string leaves. Malformed ancestors, duplicate selected keys, and non-string
|
|
1268
|
+
* owned leaves refuse the entire manifest write.
|
|
1266
1269
|
*
|
|
1267
1270
|
* The regions refuse differently because their targets differ. A range
|
|
1268
1271
|
* the manifest does not declare is the caller's mistake and throws. A script
|
|
@@ -1428,7 +1431,7 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1428
1431
|
/**
|
|
1429
1432
|
* Rewrites the manifest regions the caller names in the target's manifest.
|
|
1430
1433
|
*
|
|
1431
|
-
* @param regions - The dependency ranges, script values, and
|
|
1434
|
+
* @param regions - The dependency ranges, script values, additions, and npm overrides to declare.
|
|
1432
1435
|
* @param target - The directory to write into.
|
|
1433
1436
|
* @returns The manifest path, written when a named region moved and skipped otherwise.
|
|
1434
1437
|
*
|
|
@@ -1439,6 +1442,9 @@ export declare class Materializer implements MaterializerInterface {
|
|
|
1439
1442
|
* without a byte moving, and the range region is written regardless. An
|
|
1440
1443
|
* addition is inserted into the section its list names, which is created when
|
|
1441
1444
|
* the manifest lacks it, and one the manifest already declares is refused.
|
|
1445
|
+
* Selected npm override leaves are inserted or replaced in place. Invalid JSON,
|
|
1446
|
+
* duplicate selected keys, malformed ancestors, and non-string owned leaves
|
|
1447
|
+
* refuse the entire manifest write before any region changes.
|
|
1442
1448
|
*/
|
|
1443
1449
|
declare(regions: ManifestRegionSet, target: string): MaterializeResult;
|
|
1444
1450
|
/**
|
package/dist/src/server/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { andOf, arrayOf, attempt, boundsOf, compareValues, holds, isArray, isBoolean, isError, isFunction, isInteger, isNumber, isRecord, isString, parseJSON, parseJSONAs, parseStringField, recordOf, stringOf, unionOf, whereOf } from "@orkestrel/contract";
|
|
3
|
-
import { CANON_PATHS, CATALOG_AGENT_PATH, CATALOG_CLOSING_MARKER, CATALOG_OPENING_MARKER, CONTROL_CHARACTER_PATTERN, DEPENDENCY_NAME_PATTERN, EXECUTABLE_PATHS, HOST_INVENTORY_PATH, HOST_PATHS, MAX_ARTIFACT_BYTES, MAX_COLLECTION_ITEMS, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_REGISTRY_BYTES, MAX_TOTAL_ARTIFACT_BYTES, MAX_TOTAL_REGISTRY_BYTES, REFERENCE_PATHS, ScaffoldError, bytesToHex, catalogToLayers, cloneValue, compareVersions, computeBytes, contentToHex, extractRangeMajor, extractVersion, inferGroup, insertManifestDependencies, isAudit, isCatalogEntry, isCollection, isDependency, isDependencyName, isFloorPath, isHex, isManifestScript, isMirror, isPath, isPlan, isRetainedPath, isSnapshot, matchesDriftReachability, matchesRange, nameToGuide, planToFindings, renderSkillPointer, replaceManifestRanges, replaceManifestScripts } from "../core/index.js";
|
|
2
|
+
import { andOf, arrayOf, attempt, boundsOf, compareValues, compileGuard, holds, isArray, isBoolean, isError, isFunction, isInteger, isNumber, isRecord, isString, parseJSON, parseJSONAs, parseStringField, recordOf, recordShape, stringOf, stringShape, unionOf, whereOf } from "@orkestrel/contract";
|
|
3
|
+
import { CANON_PATHS, CATALOG_AGENT_PATH, CATALOG_CLOSING_MARKER, CATALOG_OPENING_MARKER, CONTROL_CHARACTER_PATTERN, DEPENDENCY_NAME_PATTERN, EXECUTABLE_PATHS, HOST_INVENTORY_PATH, HOST_PATHS, MAX_ARTIFACT_BYTES, MAX_COLLECTION_ITEMS, MAX_DEPENDENCY_NAME_LENGTH, MAX_MANIFEST_BYTES, MAX_PATH_LENGTH, MAX_RANGE_LENGTH, MAX_REGISTRY_BYTES, MAX_TOTAL_ARTIFACT_BYTES, MAX_TOTAL_REGISTRY_BYTES, REFERENCE_PATHS, ScaffoldError, bytesToHex, catalogToLayers, cloneValue, compareVersions, computeBytes, contentToHex, extractRangeMajor, extractVersion, inferGroup, insertManifestDependencies, isAudit, isCatalogEntry, isCollection, isDependency, isDependencyName, isFloorPath, isHex, isManifestScript, isMirror, isPath, isPlan, isRetainedPath, isSnapshot, matchesDriftReachability, matchesRange, nameToGuide, planToFindings, renderSkillPointer, replaceManifestOverrides, replaceManifestRanges, replaceManifestScripts } from "../core/index.js";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { chmodSync, closeSync, constants, copyFileSync, fstatSync, linkSync, lstatSync, mkdirSync, mkdtempSync, openSync, opendirSync, readSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, rmdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
@@ -2169,8 +2169,9 @@ var isManifestRegionSet = recordOf({
|
|
|
2169
2169
|
additions: recordOf({
|
|
2170
2170
|
runtime: isDependencies,
|
|
2171
2171
|
development: isDependencies
|
|
2172
|
-
})
|
|
2173
|
-
|
|
2172
|
+
}),
|
|
2173
|
+
overrides: compileGuard(recordShape(recordShape(stringShape())))
|
|
2174
|
+
}, ["additions", "overrides"]);
|
|
2174
2175
|
/** Narrows a value to a bounded list of fetched guide mirrors. */
|
|
2175
2176
|
var isMirrors = andOf(isCollection, arrayOf(isMirror));
|
|
2176
2177
|
/** Narrows a value to a bounded list of fleet catalog rows. */
|
|
@@ -3180,6 +3181,9 @@ var Materializer = class {
|
|
|
3180
3181
|
* the manifest only through `additions`, which inserts it into the section its
|
|
3181
3182
|
* list names in key order, creating that section when the manifest lacks it,
|
|
3182
3183
|
* before the ranges are rewritten.
|
|
3184
|
+
* Scoped npm overrides insert absent ancestors and leaves and replace owned
|
|
3185
|
+
* string leaves. Malformed ancestors, duplicate selected keys, and non-string
|
|
3186
|
+
* owned leaves refuse the entire manifest write.
|
|
3183
3187
|
*
|
|
3184
3188
|
* The regions refuse differently because their targets differ. A range
|
|
3185
3189
|
* the manifest does not declare is the caller's mistake and throws. A script
|
|
@@ -3783,11 +3787,13 @@ var Materializer = class {
|
|
|
3783
3787
|
}
|
|
3784
3788
|
#redeclare(regions) {
|
|
3785
3789
|
return (text) => {
|
|
3790
|
+
const overridden = replaceManifestOverrides(text, regions.overrides ?? {});
|
|
3791
|
+
if (overridden === void 0) throw this.#error("INVALID", "The manifest cannot safely rewrite the selected npm overrides.");
|
|
3786
3792
|
const additions = regions.additions ?? {
|
|
3787
3793
|
runtime: [],
|
|
3788
3794
|
development: []
|
|
3789
3795
|
};
|
|
3790
|
-
const declared = insertManifestDependencies(
|
|
3796
|
+
const declared = insertManifestDependencies(overridden, additions);
|
|
3791
3797
|
if (declared === void 0) {
|
|
3792
3798
|
const names = [...additions.runtime, ...additions.development].map(({ name }) => name);
|
|
3793
3799
|
throw this.#error("INVALID", `The manifest cannot declare ${names.join(", ")}: it already declares one of them, or the section that receives them is not an object of version strings.`, { names: names.length });
|