@baselane/packs 0.1.0 → 0.1.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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest.d.ts +8 -0
- package/dist/manifest.js +10 -0
- package/dist/pack-from-fileset.js +16 -0
- package/dist/validate.d.ts +1 -1
- package/dist/validate.js +6 -3
- package/package.json +7 -4
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export { ingestHarness } from "./ingest.ts";
|
|
|
32
32
|
export type { IngestInput, IngestResult } from "./ingest.ts";
|
|
33
33
|
export { packFromFileset } from "./pack-from-fileset.ts";
|
|
34
34
|
export type { PackFromFilesetResult } from "./pack-from-fileset.ts";
|
|
35
|
-
export { validateManifest, buildManifest, MANIFEST_PATH, LEGACY_MANIFEST_PATH, KNOWN_CAPABILITIES, type HarnessManifest, type CapabilityName, type CapabilityReceipt } from "./manifest.ts";
|
|
35
|
+
export { validateManifest, buildManifest, serializeManifest, MANIFEST_PATH, LEGACY_MANIFEST_PATH, MANIFEST_SCHEMA_URL, KNOWN_CAPABILITIES, type HarnessManifest, type CapabilityName, type CapabilityReceipt } from "./manifest.ts";
|
|
36
36
|
export { materializeHarness, sha256Hex } from "./materialize-harness.ts";
|
|
37
37
|
export type { MaterializeInput, MaterializeResult } from "./materialize-harness.ts";
|
|
38
38
|
export { detectPackDrift } from "./drift-detect.ts";
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,6 @@ export { buildWikiSeed } from "./seed/wiki-seed.js";
|
|
|
16
16
|
export { buildGraphSeed } from "./seed/graph-seed.js";
|
|
17
17
|
export { ingestHarness } from "./ingest.js";
|
|
18
18
|
export { packFromFileset } from "./pack-from-fileset.js";
|
|
19
|
-
export { validateManifest, buildManifest, MANIFEST_PATH, LEGACY_MANIFEST_PATH, KNOWN_CAPABILITIES } from "./manifest.js";
|
|
19
|
+
export { validateManifest, buildManifest, serializeManifest, MANIFEST_PATH, LEGACY_MANIFEST_PATH, MANIFEST_SCHEMA_URL, KNOWN_CAPABILITIES } from "./manifest.js";
|
|
20
20
|
export { materializeHarness, sha256Hex } from "./materialize-harness.js";
|
|
21
21
|
export { detectPackDrift } from "./drift-detect.js";
|
package/dist/manifest.d.ts
CHANGED
|
@@ -49,6 +49,9 @@ export interface HarnessManifest {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
export declare const MANIFEST_PATH = "harness.json";
|
|
52
|
+
/** Served from the landing site (landing/harness.schema.json); documented in baselane-sh/harness.json.
|
|
53
|
+
* Written as the first key of every generated harness.json for editor validation/autocomplete. */
|
|
54
|
+
export declare const MANIFEST_SCHEMA_URL = "https://baselane.sh/harness.schema.json";
|
|
52
55
|
/** Pre-2026-07-16 repo manifest location. `readManifestWithFallback` (packages/materialize)
|
|
53
56
|
* reads from here when the root manifest is absent; `install` migrates it forward. */
|
|
54
57
|
export declare const LEGACY_MANIFEST_PATH = ".baselane/harness.json";
|
|
@@ -56,6 +59,11 @@ export declare const LEGACY_MANIFEST_PATH = ".baselane/harness.json";
|
|
|
56
59
|
* normalized object — absent registry → null, absent capabilities → {}, absent materialized
|
|
57
60
|
* lists → []. Throws with a reason on anything invalid. Never mutates `raw`. */
|
|
58
61
|
export declare function validateManifest(raw: unknown): HarnessManifest;
|
|
62
|
+
/** Canonical serialization of a generated harness.json: $schema first key (editor
|
|
63
|
+
* validation/autocomplete against the published schema), 2-space indent, trailing newline.
|
|
64
|
+
* Every writer of a harness.json file — CLI/agent (writeManifestFile) and portal install
|
|
65
|
+
* PRs — goes through this, so the $schema key can never drift per-writer. */
|
|
66
|
+
export declare function serializeManifest(manifest: HarnessManifest): string;
|
|
59
67
|
/** Builds the manifest an install writes. If a `receipt` is supplied (hashed vendored files,
|
|
60
68
|
* managed-region receipts, resolutions), it is used verbatim. Otherwise the receipt half is
|
|
61
69
|
* derived from the file paths the materializer produced — entry files become managedRegions,
|
package/dist/manifest.js
CHANGED
|
@@ -3,6 +3,9 @@ import { isEntryFile } from "./merge-region.js";
|
|
|
3
3
|
/** Capabilities a pack can declare as materialized (centrally computed, then distributed). */
|
|
4
4
|
export const KNOWN_CAPABILITIES = ["system-map", "wiki", "graph"];
|
|
5
5
|
export const MANIFEST_PATH = "harness.json";
|
|
6
|
+
/** Served from the landing site (landing/harness.schema.json); documented in baselane-sh/harness.json.
|
|
7
|
+
* Written as the first key of every generated harness.json for editor validation/autocomplete. */
|
|
8
|
+
export const MANIFEST_SCHEMA_URL = "https://baselane.sh/harness.schema.json";
|
|
6
9
|
/** Pre-2026-07-16 repo manifest location. `readManifestWithFallback` (packages/materialize)
|
|
7
10
|
* reads from here when the root manifest is absent; `install` migrates it forward. */
|
|
8
11
|
export const LEGACY_MANIFEST_PATH = ".baselane/harness.json";
|
|
@@ -182,6 +185,13 @@ export function validateManifest(raw) {
|
|
|
182
185
|
materialized: { vendored, managedRegions, derivedCommitted, resolutions, capabilities: materializedCapabilities },
|
|
183
186
|
};
|
|
184
187
|
}
|
|
188
|
+
/** Canonical serialization of a generated harness.json: $schema first key (editor
|
|
189
|
+
* validation/autocomplete against the published schema), 2-space indent, trailing newline.
|
|
190
|
+
* Every writer of a harness.json file — CLI/agent (writeManifestFile) and portal install
|
|
191
|
+
* PRs — goes through this, so the $schema key can never drift per-writer. */
|
|
192
|
+
export function serializeManifest(manifest) {
|
|
193
|
+
return JSON.stringify({ $schema: MANIFEST_SCHEMA_URL, ...manifest }, null, 2) + "\n";
|
|
194
|
+
}
|
|
185
195
|
/** Builds the manifest an install writes. If a `receipt` is supplied (hashed vendored files,
|
|
186
196
|
* managed-region receipts, resolutions), it is used verbatim. Otherwise the receipt half is
|
|
187
197
|
* derived from the file paths the materializer produced — entry files become managedRegions,
|
|
@@ -4,6 +4,12 @@ const VERSION_TAG_RE = /^v?(\d+\.\d+\.\d+)$/;
|
|
|
4
4
|
const ONE_LEVEL_SKILL_RE = /^skills\/([^/]+)\/SKILL\.md$/;
|
|
5
5
|
const TWO_LEVEL_SKILL_RE = /^skills\/([^/]+)\/([^/]+)\/SKILL\.md$/;
|
|
6
6
|
const AGENTS_SKILL_RE = /^\.agents\/skills\/([^/]+)\/SKILL\.md$/;
|
|
7
|
+
// gstack layout: every non-dot top-level dir holding a SKILL.md is a skill (autoplan/SKILL.md,
|
|
8
|
+
// careful/SKILL.md, ...). Dot dirs are excluded so .github/ etc. can never smuggle a skill in.
|
|
9
|
+
const TOP_LEVEL_SKILL_RE = /^([^./][^/]*)\/SKILL\.md$/;
|
|
10
|
+
// Claude plugin-marketplace layout (trailofbits/skills, anthropics/claude-code, expo/skills):
|
|
11
|
+
// plugins/<plugin>/skills/<name>/SKILL.md.
|
|
12
|
+
const PLUGIN_SKILL_RE = /^plugins\/([^/]+)\/skills\/([^/]+)\/SKILL\.md$/;
|
|
7
13
|
const ROOT_SKILL_PATH = "SKILL.md";
|
|
8
14
|
function stampVersion(ref, sha) {
|
|
9
15
|
const m = VERSION_TAG_RE.exec(ref);
|
|
@@ -29,6 +35,8 @@ function findSkillMatches(paths, repoName) {
|
|
|
29
35
|
const oneLevel = ONE_LEVEL_SKILL_RE.exec(path);
|
|
30
36
|
const twoLevel = !oneLevel ? TWO_LEVEL_SKILL_RE.exec(path) : null;
|
|
31
37
|
const agentsLevel = !oneLevel && !twoLevel ? AGENTS_SKILL_RE.exec(path) : null;
|
|
38
|
+
const pluginLevel = !oneLevel && !twoLevel && !agentsLevel ? PLUGIN_SKILL_RE.exec(path) : null;
|
|
39
|
+
const topLevel = !oneLevel && !twoLevel && !agentsLevel && !pluginLevel ? TOP_LEVEL_SKILL_RE.exec(path) : null;
|
|
32
40
|
if (oneLevel) {
|
|
33
41
|
name = oneLevel[1];
|
|
34
42
|
sourceDir = `skills/${oneLevel[1]}`;
|
|
@@ -41,6 +49,14 @@ function findSkillMatches(paths, repoName) {
|
|
|
41
49
|
name = agentsLevel[1];
|
|
42
50
|
sourceDir = `.agents/skills/${agentsLevel[1]}`;
|
|
43
51
|
}
|
|
52
|
+
else if (pluginLevel) {
|
|
53
|
+
name = pluginLevel[2];
|
|
54
|
+
sourceDir = `plugins/${pluginLevel[1]}/skills/${pluginLevel[2]}`;
|
|
55
|
+
}
|
|
56
|
+
else if (topLevel) {
|
|
57
|
+
name = topLevel[1];
|
|
58
|
+
sourceDir = topLevel[1];
|
|
59
|
+
}
|
|
44
60
|
}
|
|
45
61
|
if (name === null)
|
|
46
62
|
continue;
|
package/dist/validate.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Capability, PackAgent, PackCommand, PackHook, PackScope, SkillBloc
|
|
|
2
2
|
export declare const KNOWN_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "Notification", "UserPromptSubmit", "Stop", "SubagentStop", "PreCompact", "SessionStart", "SessionEnd"];
|
|
3
3
|
export declare const SKILL_NAME_MAX = 64;
|
|
4
4
|
export declare const SKILL_DESC_MAX = 1024;
|
|
5
|
-
export declare const SKILL_BODY_MAX_LINES =
|
|
5
|
+
export declare const SKILL_BODY_MAX_LINES = 5000;
|
|
6
6
|
export declare const SKILL_BODY_WARN_LINES = 400;
|
|
7
7
|
export interface SkillLint {
|
|
8
8
|
field: string;
|
package/dist/validate.js
CHANGED
|
@@ -258,7 +258,10 @@ function onboarding(v) {
|
|
|
258
258
|
}
|
|
259
259
|
export const SKILL_NAME_MAX = 64;
|
|
260
260
|
export const SKILL_DESC_MAX = 1024;
|
|
261
|
-
|
|
261
|
+
// Hard ceiling is a sanity bound, not an authoring target — real ecosystem skills routinely run
|
|
262
|
+
// 1-2k lines (garrytan/gstack's spec/SKILL.md is ~2.4k), and ingest must not reject them. The
|
|
263
|
+
// 400-line soft warning below is the authoring-quality nudge.
|
|
264
|
+
export const SKILL_BODY_MAX_LINES = 5000;
|
|
262
265
|
export const SKILL_BODY_WARN_LINES = 400;
|
|
263
266
|
const XML_TAG = /<\/?[a-zA-Z][^>]*>/;
|
|
264
267
|
/** name: slug, ≤64 chars. A name containing "anthropic"/"claude" is NOT rejected here — that
|
|
@@ -283,7 +286,7 @@ function skillDescription(obj, path) {
|
|
|
283
286
|
fail(`${path}.description`, "free of XML tags");
|
|
284
287
|
return v;
|
|
285
288
|
}
|
|
286
|
-
/** body: non-empty markdown, ≤
|
|
289
|
+
/** body: non-empty markdown, ≤5000 lines (hard ceiling; the 400-line soft warning is a skillLint). */
|
|
287
290
|
function skillBody(obj, path) {
|
|
288
291
|
const v = str(obj, "body", `${path}.body`);
|
|
289
292
|
if (v.split("\n").length > SKILL_BODY_MAX_LINES) {
|
|
@@ -333,7 +336,7 @@ export function validateSkill(raw) {
|
|
|
333
336
|
export function skillLints(block) {
|
|
334
337
|
const lints = [];
|
|
335
338
|
if (block.body.split("\n").length >= SKILL_BODY_WARN_LINES) {
|
|
336
|
-
lints.push({ field: "body", message: `body is
|
|
339
|
+
lints.push({ field: "body", message: `body is over ${SKILL_BODY_WARN_LINES} lines; consider splitting into references` });
|
|
337
340
|
}
|
|
338
341
|
if (block.name.includes("anthropic") || block.name.includes("claude")) {
|
|
339
342
|
lints.push({ field: "name", message: 'name contains the reserved word "anthropic" or "claude" — confirm this is legitimate first-party content, not impersonation' });
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baselane/packs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "WorkflowPack schema, validation, and render pipeline, plus the built-in packs shipped by the baselane CLI.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/
|
|
10
|
+
"url": "git+https://github.com/baselane-sh/baselane.git",
|
|
11
11
|
"directory": "packages/packs"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://baselane
|
|
13
|
+
"homepage": "https://github.com/baselane-sh/baselane",
|
|
14
14
|
"files": [
|
|
15
15
|
"dist/",
|
|
16
16
|
"packs/",
|
|
@@ -22,13 +22,16 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@baselane/analyze": "0.1.
|
|
25
|
+
"@baselane/analyze": "0.1.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^24.0.0",
|
|
29
29
|
"typescript": "^5.9.0",
|
|
30
30
|
"vitest": "^2.0.0"
|
|
31
31
|
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/baselane-sh/baselane/issues"
|
|
34
|
+
},
|
|
32
35
|
"scripts": {
|
|
33
36
|
"test": "vitest run",
|
|
34
37
|
"typecheck": "tsc --noEmit",
|