@vibe-agent-toolkit/agent-skills 0.2.0-rc.6 → 0.2.0-rc.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/README.md +5 -5
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +7 -17
- package/dist/builder.js.map +1 -1
- package/dist/content-type-routing.d.ts +32 -0
- package/dist/content-type-routing.d.ts.map +1 -1
- package/dist/content-type-routing.js +23 -0
- package/dist/content-type-routing.js.map +1 -1
- package/dist/files-config.d.ts +2 -2
- package/dist/files-config.d.ts.map +1 -1
- package/dist/files-config.js +1 -7
- package/dist/files-config.js.map +1 -1
- package/dist/import.d.ts.map +1 -1
- package/dist/import.js +0 -4
- package/dist/import.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/inventory/types.d.ts +8 -0
- package/dist/inventory/types.d.ts.map +1 -1
- package/dist/inventory/types.js.map +1 -1
- package/dist/parsers/frontmatter-parser.d.ts.map +1 -1
- package/dist/parsers/frontmatter-parser.js +30 -6
- package/dist/parsers/frontmatter-parser.js.map +1 -1
- package/dist/plugin-distribution-layout.d.ts.map +1 -1
- package/dist/plugin-distribution-layout.js +13 -2
- package/dist/plugin-distribution-layout.js.map +1 -1
- package/dist/post-build-checks.d.ts +9 -1
- package/dist/post-build-checks.d.ts.map +1 -1
- package/dist/post-build-checks.js +21 -13
- package/dist/post-build-checks.js.map +1 -1
- package/dist/schemas/allowed-tools.d.ts +31 -0
- package/dist/schemas/allowed-tools.d.ts.map +1 -0
- package/dist/schemas/allowed-tools.js +88 -0
- package/dist/schemas/allowed-tools.js.map +1 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/installed-plugins-registry.d.ts.map +1 -1
- package/dist/schemas/installed-plugins-registry.js +7 -1
- package/dist/schemas/installed-plugins-registry.js.map +1 -1
- package/dist/schemas/marketplace-manifest.d.ts.map +1 -1
- package/dist/schemas/marketplace-manifest.js +17 -6
- package/dist/schemas/marketplace-manifest.js.map +1 -1
- package/dist/skill-identity.d.ts +8 -3
- package/dist/skill-identity.d.ts.map +1 -1
- package/dist/skill-identity.js +13 -6
- package/dist/skill-identity.js.map +1 -1
- package/dist/skill-packager.d.ts +87 -14
- package/dist/skill-packager.d.ts.map +1 -1
- package/dist/skill-packager.js +200 -72
- package/dist/skill-packager.js.map +1 -1
- package/dist/skill-source/content-hash.d.ts.map +1 -1
- package/dist/skill-source/content-hash.js +21 -10
- package/dist/skill-source/content-hash.js.map +1 -1
- package/dist/skill-source/fetch-cache.d.ts.map +1 -1
- package/dist/skill-source/fetch-cache.js +0 -5
- package/dist/skill-source/fetch-cache.js.map +1 -1
- package/dist/skill-source/git-clone.d.ts.map +1 -1
- package/dist/skill-source/git-clone.js +0 -2
- package/dist/skill-source/git-clone.js.map +1 -1
- package/dist/skill-source/sources/url-source.d.ts.map +1 -1
- package/dist/skill-source/sources/url-source.js +0 -1
- package/dist/skill-source/sources/url-source.js.map +1 -1
- package/dist/skill-source/stage.d.ts.map +1 -1
- package/dist/skill-source/stage.js +0 -6
- package/dist/skill-source/stage.js.map +1 -1
- package/dist/skill-test/baseline-integrity.d.ts.map +1 -1
- package/dist/skill-test/baseline-integrity.js +8 -2
- package/dist/skill-test/baseline-integrity.js.map +1 -1
- package/dist/skill-test/build-hook.d.ts +3 -2
- package/dist/skill-test/build-hook.d.ts.map +1 -1
- package/dist/skill-test/build-hook.js +4 -4
- package/dist/skill-test/build-hook.js.map +1 -1
- package/dist/skill-test/declared-env.d.ts +5 -4
- package/dist/skill-test/declared-env.d.ts.map +1 -1
- package/dist/skill-test/declared-env.js +7 -9
- package/dist/skill-test/declared-env.js.map +1 -1
- package/dist/skill-test/eval-executor.d.ts +1 -1
- package/dist/skill-test/eval-executor.js +2 -2
- package/dist/skill-test/eval-executor.js.map +1 -1
- package/dist/skill-test/eval-fragment.d.ts +12 -8
- package/dist/skill-test/eval-fragment.d.ts.map +1 -1
- package/dist/skill-test/eval-fragment.js +18 -10
- package/dist/skill-test/eval-fragment.js.map +1 -1
- package/dist/skill-test/eval-grader.d.ts +64 -6
- package/dist/skill-test/eval-grader.d.ts.map +1 -1
- package/dist/skill-test/eval-grader.js +139 -77
- package/dist/skill-test/eval-grader.js.map +1 -1
- package/dist/skill-test/eval-inputs.d.ts +8 -7
- package/dist/skill-test/eval-inputs.d.ts.map +1 -1
- package/dist/skill-test/eval-inputs.js +9 -11
- package/dist/skill-test/eval-inputs.js.map +1 -1
- package/dist/skill-test/eval-lint.d.ts +4 -4
- package/dist/skill-test/eval-lint.js +5 -5
- package/dist/skill-test/eval-lint.js.map +1 -1
- package/dist/skill-test/eval-suite-isolation.d.ts.map +1 -1
- package/dist/skill-test/eval-suite-isolation.js +8 -5
- package/dist/skill-test/eval-suite-isolation.js.map +1 -1
- package/dist/skill-test/evals-template.d.ts +1 -1
- package/dist/skill-test/evals-template.d.ts.map +1 -1
- package/dist/skill-test/evals-template.js +1 -3
- package/dist/skill-test/evals-template.js.map +1 -1
- package/dist/skill-test/executor-prompt.d.ts +2 -2
- package/dist/skill-test/executor-prompt.js +2 -2
- package/dist/skill-test/failure-reason.d.ts +113 -0
- package/dist/skill-test/failure-reason.d.ts.map +1 -0
- package/dist/skill-test/failure-reason.js +124 -0
- package/dist/skill-test/failure-reason.js.map +1 -0
- package/dist/skill-test/fragment-merge.d.ts +2 -2
- package/dist/skill-test/fragment-merge.js +4 -4
- package/dist/skill-test/grader-prompt.d.ts +2 -2
- package/dist/skill-test/grader-prompt.d.ts.map +1 -1
- package/dist/skill-test/grader-prompt.js +12 -8
- package/dist/skill-test/grader-prompt.js.map +1 -1
- package/dist/skill-test/grading-adapter.d.ts +7 -3
- package/dist/skill-test/grading-adapter.d.ts.map +1 -1
- package/dist/skill-test/grading-adapter.js +10 -9
- package/dist/skill-test/grading-adapter.js.map +1 -1
- package/dist/skill-test/harness-location.d.ts +3 -2
- package/dist/skill-test/harness-location.d.ts.map +1 -1
- package/dist/skill-test/harness-location.js +5 -16
- package/dist/skill-test/harness-location.js.map +1 -1
- package/dist/skill-test/index.d.ts +1 -1
- package/dist/skill-test/index.d.ts.map +1 -1
- package/dist/skill-test/index.js +1 -1
- package/dist/skill-test/index.js.map +1 -1
- package/dist/skill-test/lock.d.ts +11 -10
- package/dist/skill-test/lock.d.ts.map +1 -1
- package/dist/skill-test/lock.js +13 -14
- package/dist/skill-test/lock.js.map +1 -1
- package/dist/skill-test/pipeline.d.ts +3 -1
- package/dist/skill-test/pipeline.d.ts.map +1 -1
- package/dist/skill-test/pipeline.js +5 -1
- package/dist/skill-test/pipeline.js.map +1 -1
- package/dist/skill-test/preflight.d.ts.map +1 -1
- package/dist/skill-test/preflight.js +0 -1
- package/dist/skill-test/preflight.js.map +1 -1
- package/dist/skill-test/prompt-invariants.d.ts +4 -2
- package/dist/skill-test/prompt-invariants.d.ts.map +1 -1
- package/dist/skill-test/prompt-invariants.js +5 -4
- package/dist/skill-test/prompt-invariants.js.map +1 -1
- package/dist/skill-test/run-harness.d.ts +160 -123
- package/dist/skill-test/run-harness.d.ts.map +1 -1
- package/dist/skill-test/run-harness.js +309 -173
- package/dist/skill-test/run-harness.js.map +1 -1
- package/dist/skill-test/staging.d.ts +12 -6
- package/dist/skill-test/staging.d.ts.map +1 -1
- package/dist/skill-test/staging.js +15 -12
- package/dist/skill-test/staging.js.map +1 -1
- package/dist/skill-test/tier-plan.d.ts +1 -1
- package/dist/skill-test/tier-plan.js +1 -1
- package/dist/skill-test/tool-eval-schema.js +2 -2
- package/dist/skill-test/vendor-manifest.d.ts +2 -1
- package/dist/skill-test/vendor-manifest.d.ts.map +1 -1
- package/dist/skill-test/vendor-manifest.js +10 -10
- package/dist/skill-test/vendor-manifest.js.map +1 -1
- package/dist/test-input.d.ts +2 -2
- package/dist/test-input.d.ts.map +1 -1
- package/dist/test-input.js +4 -5
- package/dist/test-input.js.map +1 -1
- package/dist/validators/agent-instruction-presence.d.ts.map +1 -1
- package/dist/validators/agent-instruction-presence.js +44 -2
- package/dist/validators/agent-instruction-presence.js.map +1 -1
- package/dist/validators/bundled-resource-link-detection.d.ts +5 -3
- package/dist/validators/bundled-resource-link-detection.d.ts.map +1 -1
- package/dist/validators/bundled-resource-link-detection.js +38 -38
- package/dist/validators/bundled-resource-link-detection.js.map +1 -1
- package/dist/validators/compat-detectors.d.ts +17 -0
- package/dist/validators/compat-detectors.d.ts.map +1 -1
- package/dist/validators/compat-detectors.js +46 -19
- package/dist/validators/compat-detectors.js.map +1 -1
- package/dist/validators/format-detection.d.ts +3 -0
- package/dist/validators/format-detection.d.ts.map +1 -1
- package/dist/validators/format-detection.js +41 -26
- package/dist/validators/format-detection.js.map +1 -1
- package/dist/validators/frontmatter-validation.js +1 -1
- package/dist/validators/frontmatter-validation.js.map +1 -1
- package/dist/validators/marketplace-validator.d.ts.map +1 -1
- package/dist/validators/marketplace-validator.js +6 -1
- package/dist/validators/marketplace-validator.js.map +1 -1
- package/dist/validators/mcp-tool-qualification.d.ts +1 -1
- package/dist/validators/mcp-tool-qualification.js +1 -1
- package/dist/validators/packaged-size-limit.d.ts.map +1 -1
- package/dist/validators/packaged-size-limit.js +0 -2
- package/dist/validators/packaged-size-limit.js.map +1 -1
- package/dist/validators/packaging-validator.d.ts +33 -4
- package/dist/validators/packaging-validator.d.ts.map +1 -1
- package/dist/validators/packaging-validator.js +95 -22
- package/dist/validators/packaging-validator.js.map +1 -1
- package/dist/validators/plugin-hosted-shape.d.ts +3 -1
- package/dist/validators/plugin-hosted-shape.d.ts.map +1 -1
- package/dist/validators/plugin-hosted-shape.js +5 -6
- package/dist/validators/plugin-hosted-shape.js.map +1 -1
- package/dist/validators/referenced-path-missing.d.ts +15 -6
- package/dist/validators/referenced-path-missing.d.ts.map +1 -1
- package/dist/validators/referenced-path-missing.js +42 -22
- package/dist/validators/referenced-path-missing.js.map +1 -1
- package/dist/validators/registry-validator.d.ts.map +1 -1
- package/dist/validators/registry-validator.js +0 -1
- package/dist/validators/registry-validator.js.map +1 -1
- package/dist/validators/rule-engine/index.d.ts +1 -1
- package/dist/validators/rule-engine/rule-context.d.ts +3 -3
- package/dist/validators/rule-engine/rule-context.js +1 -1
- package/dist/validators/rule-engine/rule-engine.d.ts +1 -1
- package/dist/validators/rule-engine/rule-engine.js +5 -5
- package/dist/validators/rule-engine/rule-engine.js.map +1 -1
- package/dist/validators/skill-validator.d.ts.map +1 -1
- package/dist/validators/skill-validator.js +41 -51
- package/dist/validators/skill-validator.js.map +1 -1
- package/dist/validators/source-only-codes.js +1 -1
- package/dist/validators/source-only-codes.js.map +1 -1
- package/dist/validators/types.d.ts +21 -1
- package/dist/validators/types.d.ts.map +1 -1
- package/dist/validators/unified-validator.d.ts.map +1 -1
- package/dist/validators/unified-validator.js +3 -4
- package/dist/validators/unified-validator.js.map +1 -1
- package/dist/validators/validation-rules.d.ts +3 -3
- package/dist/validators/validation-rules.d.ts.map +1 -1
- package/dist/validators/validation-rules.js +9 -38
- package/dist/validators/validation-rules.js.map +1 -1
- package/dist/validators/walker-to-issues.d.ts +2 -0
- package/dist/validators/walker-to-issues.d.ts.map +1 -1
- package/dist/validators/walker-to-issues.js +17 -12
- package/dist/validators/walker-to-issues.js.map +1 -1
- package/dist/walk-link-graph.d.ts +2 -0
- package/dist/walk-link-graph.d.ts.map +1 -1
- package/dist/walk-link-graph.js +46 -15
- package/dist/walk-link-graph.js.map +1 -1
- package/package.json +12 -20
- package/dist/skill-test/exit-codes.d.ts +0 -134
- package/dist/skill-test/exit-codes.d.ts.map +0 -1
- package/dist/skill-test/exit-codes.js +0 -224
- package/dist/skill-test/exit-codes.js.map +0 -1
package/dist/skill-identity.js
CHANGED
|
@@ -11,22 +11,29 @@
|
|
|
11
11
|
* a path, so every lane answers the question the same way.
|
|
12
12
|
*/
|
|
13
13
|
import { readFileSync } from 'node:fs';
|
|
14
|
+
import { isPathAbsentError } from '@vibe-agent-toolkit/utils';
|
|
14
15
|
import { parseFrontmatter } from './parsers/frontmatter-parser.js';
|
|
15
16
|
/**
|
|
16
17
|
* Read the name a SKILL.md declares for itself.
|
|
17
18
|
*
|
|
18
|
-
* Returns `undefined` when
|
|
19
|
-
* declares no usable `name` — callers decide whether that is fatal or
|
|
20
|
-
* some fallback (typically the directory leaf) applies.
|
|
19
|
+
* Returns `undefined` when there is no file at the path, it has no frontmatter,
|
|
20
|
+
* or it declares no usable `name` — callers decide whether that is fatal or
|
|
21
|
+
* whether some fallback (typically the directory leaf) applies.
|
|
22
|
+
*
|
|
23
|
+
* A file that IS there but could not be read (a permission refusal, a path
|
|
24
|
+
* component that is a directory) throws: `undefined` means "declares no name",
|
|
25
|
+
* and a refusal has not established that — a caller falling back to the
|
|
26
|
+
* directory leaf would otherwise rename the skill on the operator's behalf.
|
|
21
27
|
*/
|
|
22
28
|
export function readDeclaredSkillName(skillMdPath) {
|
|
23
29
|
let content;
|
|
24
30
|
try {
|
|
25
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- caller-supplied skill path
|
|
26
31
|
content = readFileSync(skillMdPath, 'utf-8');
|
|
27
32
|
}
|
|
28
|
-
catch {
|
|
29
|
-
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (isPathAbsentError(error))
|
|
35
|
+
return undefined;
|
|
36
|
+
throw error;
|
|
30
37
|
}
|
|
31
38
|
return declaredSkillNameIn(content);
|
|
32
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-identity.js","sourceRoot":"","sources":["../src/skill-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"skill-identity.js","sourceRoot":"","sources":["../src/skill-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAAmB;IACvD,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,iBAAiB,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/C,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAEtC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAEnD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChC,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AAC9C,CAAC"}
|
package/dist/skill-packager.d.ts
CHANGED
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* Uses ResourceRegistry + transformContent() from @vibe-agent-toolkit/resources
|
|
15
15
|
* for link resolution and rewriting (replacing the previous inline regex approach).
|
|
16
16
|
*/
|
|
17
|
-
import { ResourceRegistry, type ResourcePopulationSource } from '@vibe-agent-toolkit/resources';
|
|
17
|
+
import { ResourceRegistry, type ResourceLink, type ResourcePopulationSource } from '@vibe-agent-toolkit/resources';
|
|
18
18
|
import { type AllowUsageLedger, type ValidationConfig, type ValidationIssue } from '@vibe-agent-toolkit/schema';
|
|
19
|
+
import { VatError } from '@vibe-agent-toolkit/utils';
|
|
19
20
|
import { type GitTracker } from '@vibe-agent-toolkit/utils/git';
|
|
21
|
+
import { type PackagingTarget } from './content-type-routing.js';
|
|
20
22
|
import { type SkillFileEntry } from './files-config.js';
|
|
21
23
|
import { type ConventionalSuiteProbe, type DeclaredEvalSuite } from './test-input.js';
|
|
22
24
|
import { type PackagingValidationResult, type SkillPackagingConfig } from './validators/packaging-validator.js';
|
|
@@ -24,12 +26,6 @@ import { type PackagingValidationResult, type SkillPackagingConfig } from './val
|
|
|
24
26
|
* Resource naming strategy type
|
|
25
27
|
*/
|
|
26
28
|
export type ResourceNamingStrategy = 'basename' | 'resource-id' | 'preserve-path';
|
|
27
|
-
/**
|
|
28
|
-
* Packaging target: determines ZIP directory structure
|
|
29
|
-
* - 'claude-code': Standard VAT format with resources/ subdirectory (default)
|
|
30
|
-
* - 'claude-web': Claude.ai web upload format with references/, scripts/, assets/ subdirectories
|
|
31
|
-
*/
|
|
32
|
-
export type PackagingTarget = 'claude-code' | 'claude-web';
|
|
33
29
|
export interface PackageSkillOptions {
|
|
34
30
|
/**
|
|
35
31
|
* Output directory for packaged skill
|
|
@@ -111,8 +107,10 @@ export interface PackageSkillOptions {
|
|
|
111
107
|
/**
|
|
112
108
|
* Packaging target — controls the ZIP directory structure produced.
|
|
113
109
|
*
|
|
114
|
-
* - 'claude-code' (default): Standard VAT layout
|
|
115
|
-
*
|
|
110
|
+
* - 'claude-code' (default): Standard VAT layout, routed by extension into
|
|
111
|
+
* resources/, scripts/, templates/, assets/
|
|
112
|
+
* - 'claude-web': Claude.ai web upload layout — every resource flattened into
|
|
113
|
+
* references/, extensions ignored (see `PackagingTarget`)
|
|
116
114
|
*
|
|
117
115
|
* Default: 'claude-code'
|
|
118
116
|
*/
|
|
@@ -390,12 +388,87 @@ export declare function createProjectRegistry(projectRoot: string, options?: Pro
|
|
|
390
388
|
*/
|
|
391
389
|
export declare function synthesizeAssetId(assetPath: string): string;
|
|
392
390
|
/**
|
|
393
|
-
*
|
|
391
|
+
* Copy a single file, optionally rewriting markdown links using transformContent().
|
|
392
|
+
*
|
|
393
|
+
* For markdown files with rewriteLinks enabled:
|
|
394
|
+
* 1. Reads the source file
|
|
395
|
+
* 2. Finds the corresponding resource in the "from" registry
|
|
396
|
+
* 3. Calls transformContent() with the resource's links, unified rules, and "to" registry
|
|
397
|
+
* 4. Writes the result
|
|
398
|
+
*
|
|
399
|
+
* All link rewriting (bundled, excluded, inline, reference-style definitions)
|
|
400
|
+
* is handled by a single transformContent() call with ordered rules.
|
|
401
|
+
*
|
|
402
|
+
* For non-markdown files, performs a plain binary copy.
|
|
403
|
+
*/
|
|
404
|
+
/**
|
|
405
|
+
* Re-base a resource's link spans onto the frontmatter-stripped body.
|
|
406
|
+
*
|
|
407
|
+
* ## 🚨 Why this exists: the span rewrite was INERT here, and could mis-splice
|
|
408
|
+
*
|
|
409
|
+
* `transformContent` identifies each link by its parsed `[startOffset,
|
|
410
|
+
* endOffset)` span rather than by replaying a regex and correlating on href —
|
|
411
|
+
* which is the whole point, because the two grammars disagree about what the
|
|
412
|
+
* href IS. Its docstring states the precondition outright: *links must come from
|
|
413
|
+
* the same bytes as content*.
|
|
414
|
+
*
|
|
415
|
+
* This call site violated it. `resource.links` are parsed from the WHOLE FILE,
|
|
416
|
+
* and `editor.body` has the frontmatter block removed — so every offset was off
|
|
417
|
+
* by the frontmatter's length. Measured on a four-line skill: span `[45, 77)`
|
|
418
|
+
* against a body shifted by 40, where `body.slice(45, 81)` is `"ails.\n"`. Every
|
|
419
|
+
* splice declined and every link fell back to the pre-fix regex path, so the
|
|
420
|
+
* headline defect (`[](url)` silently not rewritten) was still
|
|
421
|
+
* shipping. Worse, a stale span can land on a *different*, structurally valid
|
|
422
|
+
* link and rewrite ITS href to the first link's target.
|
|
423
|
+
*
|
|
424
|
+
* ## The re-base is VERIFIED, not assumed
|
|
425
|
+
*
|
|
426
|
+
* Subtracting `content.length - body.length` is correct if and only if `body` is
|
|
427
|
+
* a literal SUFFIX of `content` — that is exactly the statement "every body index
|
|
428
|
+
* `i` is content index `i + offset`". `String.endsWith` decides it outright, so
|
|
429
|
+
* the arithmetic is checked rather than argued, and a body that is not a suffix
|
|
430
|
+
* comes back with its spans REMOVED instead of with coordinates nothing verified.
|
|
431
|
+
* `openFrontmatter` does yield a suffix today, across CRLF, a commented block, an
|
|
432
|
+
* absent block and empty input; the check is what keeps that a fact rather than a
|
|
433
|
+
* comment that outlives the code it describes.
|
|
434
|
+
*
|
|
435
|
+
* ⛔ **This used to claim `splicableFrom` as its backstop, and that claim was
|
|
436
|
+
* false.** The words were: "`splicableFrom` refuses any span whose destination is
|
|
437
|
+
* not exactly the parser's href, so a misalignment that survives this degrades to
|
|
438
|
+
* *no rewrite* rather than to a wrong one." It does not. That comparison is keyed
|
|
439
|
+
* on the HREF, which two links in one document routinely share, so a stale span
|
|
440
|
+
* landing on a same-href neighbour passes it and the neighbour is rewritten
|
|
441
|
+
* through the first link's metadata. Constructed and pinned in
|
|
442
|
+
* `packages/resources/test/content-transform.test.ts` › *two links sharing an
|
|
443
|
+
* href defeat the destination comparison*, where a tuned frontmatter length makes
|
|
444
|
+
* two labels swap places. A mitigation keyed on a value the two candidates have
|
|
445
|
+
* in common cannot be a guarantee, and a guard resting on one is resting on
|
|
446
|
+
* nothing.
|
|
447
|
+
*
|
|
448
|
+
* 🔑 What holds instead, in full, because the precondition has two halves:
|
|
449
|
+
*
|
|
450
|
+
* 1. *The spans address `content`* — discharged by the reader, not by this
|
|
451
|
+
* function. `resource.links` and `content` must come from the same decode of
|
|
452
|
+
* the same file, which is why the caller's read is pinned to
|
|
453
|
+
* `readTextContent` with a 🚨 of its own. A second reader is the one way this
|
|
454
|
+
* half fails, and it fails invisibly.
|
|
455
|
+
* 2. *The subtraction maps `content` onto `body`* — discharged here, by
|
|
456
|
+
* `endsWith`.
|
|
457
|
+
*
|
|
458
|
+
* `splicableFrom`'s destination check remains a useful mitigation for the
|
|
459
|
+
* residue. It is not counted on, and nothing here degrades gracefully because of
|
|
460
|
+
* it.
|
|
394
461
|
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
462
|
+
* @param content - The file as read, which the links were parsed from
|
|
463
|
+
* @param body - The frontmatter-stripped body the rewrite will run over
|
|
464
|
+
* @param links - The resource's links, carrying whole-file offsets
|
|
465
|
+
* @param onUnverifiable - Called when `body` is not a suffix of `content`, so the
|
|
466
|
+
* caller can say which file lost its span-driven rewrite. Never called on the
|
|
467
|
+
* normal path.
|
|
468
|
+
* @returns The same links with offsets stated against `body`, or with no offsets
|
|
469
|
+
* at all when the re-base could not be verified
|
|
397
470
|
*/
|
|
398
|
-
export declare function
|
|
471
|
+
export declare function bodyRelativeLinks(content: string, body: string, links: readonly ResourceLink[], onUnverifiable: () => void): ResourceLink[];
|
|
399
472
|
/**
|
|
400
473
|
* Extract H1 title from markdown content
|
|
401
474
|
*
|
|
@@ -424,7 +497,7 @@ export declare function generateTargetPath(filePath: string, basePath: string, s
|
|
|
424
497
|
* Thrown when a claude-web ZIP exceeds the 8MB Claude.ai upload limit.
|
|
425
498
|
* The CLI catches this and exits with code 1.
|
|
426
499
|
*/
|
|
427
|
-
export declare class ZipSizeLimitError extends
|
|
500
|
+
export declare class ZipSizeLimitError extends VatError {
|
|
428
501
|
readonly sizeBytes: number;
|
|
429
502
|
readonly limitBytes: number;
|
|
430
503
|
constructor(sizeBytes: number, limitBytes: number);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-packager.d.ts","sourceRoot":"","sources":["../src/skill-packager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAGL,gBAAgB,
|
|
1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