@baselane/materialize 0.1.7 → 0.1.8
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/install.js +7 -1
- package/dist/resolve-packs.d.ts +2 -0
- package/dist/resolve-packs.js +13 -1
- package/package.json +3 -3
package/dist/install.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile, unlink, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { buildManifest, materializeHarness, ENTRY_FILES, LEGACY_MANIFEST_PATH, MANIFEST_PATH, } from "@baselane/packs";
|
|
4
|
-
import { parseInstallRef, resolveDefaultBranch } from "@baselane/distribute";
|
|
4
|
+
import { parseInstallRef, resolveDefaultBranch, resolveWellKnownSource } from "@baselane/distribute";
|
|
5
5
|
import { applyPlan, readCurrent } from "./fs-ops.js";
|
|
6
6
|
import { planReconcile } from "./plan.js";
|
|
7
7
|
import { mergeBaselaneHooks, SettingsParseError } from "./settings-merge.js";
|
|
@@ -80,6 +80,12 @@ export async function runInstall(opts) {
|
|
|
80
80
|
if (parsed.kind === "git") {
|
|
81
81
|
manifest = { ...base, packs: { ...base.packs, [parsed.name]: parsed.ref } };
|
|
82
82
|
}
|
|
83
|
+
else if (parsed.kind === "docs") {
|
|
84
|
+
// Resolve once to fix the pin = sha256 of the host's well-known index.json; installFromManifest
|
|
85
|
+
// then re-resolves and re-verifies against it (index sha + per-artifact digests).
|
|
86
|
+
const { indexSha } = await resolveWellKnownSource({ url: parsed.url, fetchImpl: opts.fetchImpl, onNotice: log });
|
|
87
|
+
manifest = { ...base, packs: { ...base.packs, [`docs:${parsed.url}`]: indexSha } };
|
|
88
|
+
}
|
|
83
89
|
else if (parsed.kind === "registry") {
|
|
84
90
|
const registryBase = base.registry ?? opts.registryBase ?? DEFAULT_REGISTRY;
|
|
85
91
|
let version = parsed.version;
|
package/dist/resolve-packs.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HarnessManifest, type Resolution, type WorkflowPack } from "@baselane/packs";
|
|
2
|
+
import { type DnsLookup } from "@baselane/distribute";
|
|
2
3
|
export interface ResolvedManifestPacks {
|
|
3
4
|
packs: Record<string, WorkflowPack>;
|
|
4
5
|
resolutions: Record<string, Resolution>;
|
|
@@ -41,4 +42,5 @@ export declare function resolveManifestPacks(manifest: HarnessManifest, opts?: {
|
|
|
41
42
|
onNotice?: (m: string) => void;
|
|
42
43
|
inlinePacks?: Record<string, WorkflowPack>;
|
|
43
44
|
registryBase?: string;
|
|
45
|
+
lookupImpl?: DnsLookup;
|
|
44
46
|
}): Promise<ResolvedManifestPacks>;
|
package/dist/resolve-packs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { packFromFileset, validatePack } from "@baselane/packs";
|
|
2
|
-
import { isGitSourceName, parseGitSourceName, resolveGitSource } from "@baselane/distribute";
|
|
2
|
+
import { isGitSourceName, parseGitSourceName, resolveGitSource, resolveWellKnownSource } from "@baselane/distribute";
|
|
3
3
|
/** CLI default registry, overridden by `manifest.registry`, then a caller-supplied `registryBase`
|
|
4
4
|
* (the CLI reads `BASELANE_REGISTRY` and passes it through — env access stays out of this
|
|
5
5
|
* package, same as how `GITHUB_TOKEN` flows in as `opts.token`). Spec: RETURN DECISION 4. */
|
|
@@ -107,6 +107,18 @@ export async function resolveManifestPacks(manifest, opts = {}) {
|
|
|
107
107
|
packs[name] = validatePack(inline);
|
|
108
108
|
continue;
|
|
109
109
|
}
|
|
110
|
+
if (name.startsWith("docs:")) {
|
|
111
|
+
// Well-known agent-skills source. `pin` is the sha256 of the host's index.json; the resolver
|
|
112
|
+
// re-fetches and re-verifies (index sha against the pin, each artifact against its digest) or
|
|
113
|
+
// hard-fails on drift/tamper. Reuses packFromFileset for validation.
|
|
114
|
+
const url = name.slice("docs:".length);
|
|
115
|
+
const { indexSha, files } = await resolveWellKnownSource({ url, pin, fetchImpl: opts.fetchImpl, onNotice: opts.onNotice, lookupImpl: opts.lookupImpl });
|
|
116
|
+
const host = new URL(url).hostname;
|
|
117
|
+
const result = await packFromFileset(files, { repoName: host, ref: "well-known", sha: indexSha });
|
|
118
|
+
packs[name] = result.pack;
|
|
119
|
+
resolutions[name] = { ref: pin, sha: indexSha, packId: result.pack.id };
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
110
122
|
if (isGitSourceName(name)) {
|
|
111
123
|
const { repo } = parseGitSourceName(name);
|
|
112
124
|
const { ref, onlySkill } = decodeSkillPin(pin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baselane/materialize",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Disk-reconcile and install engine (plan/apply/receipt/settings-merge/manifest-io/resolve/install) shared by the baselane CLI and desktop agent.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@baselane/packs": "0.1.
|
|
23
|
-
"@baselane/distribute": "0.1.
|
|
22
|
+
"@baselane/packs": "0.1.8",
|
|
23
|
+
"@baselane/distribute": "0.1.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^24.0.0",
|