@namzu/sdk 57.0.0 → 58.0.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/CHANGELOG.md +62 -0
- package/dist/agents/QueryAgent.d.ts.map +1 -1
- package/dist/agents/QueryAgent.js +3 -0
- package/dist/agents/QueryAgent.js.map +1 -1
- package/dist/agents/file-definitions.d.ts +35 -4
- package/dist/agents/file-definitions.d.ts.map +1 -1
- package/dist/agents/file-definitions.js +98 -8
- package/dist/agents/file-definitions.js.map +1 -1
- package/dist/authorization/protected-paths.d.ts +9 -0
- package/dist/authorization/protected-paths.d.ts.map +1 -1
- package/dist/authorization/protected-paths.js +29 -3
- package/dist/authorization/protected-paths.js.map +1 -1
- package/dist/compaction/index.d.ts +1 -0
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/manual.d.ts +7 -0
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +31 -12
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/model-summary.d.ts +101 -0
- package/dist/compaction/model-summary.d.ts.map +1 -0
- package/dist/compaction/model-summary.js +333 -0
- package/dist/compaction/model-summary.js.map +1 -0
- package/dist/compaction/verifier.d.ts +6 -1
- package/dist/compaction/verifier.d.ts.map +1 -1
- package/dist/compaction/verifier.js +3 -3
- package/dist/compaction/verifier.js.map +1 -1
- package/dist/config/runtime.d.ts +62 -0
- package/dist/config/runtime.d.ts.map +1 -1
- package/dist/config/runtime.js +16 -0
- package/dist/config/runtime.js.map +1 -1
- package/dist/connector/mcp/client.d.ts +8 -0
- package/dist/connector/mcp/client.d.ts.map +1 -1
- package/dist/connector/mcp/client.js +75 -2
- package/dist/connector/mcp/client.js.map +1 -1
- package/dist/constants/mcp/index.d.ts +2 -0
- package/dist/constants/mcp/index.d.ts.map +1 -1
- package/dist/constants/mcp/index.js +2 -0
- package/dist/constants/mcp/index.js.map +1 -1
- package/dist/constants/plugin/index.d.ts +2 -0
- package/dist/constants/plugin/index.d.ts.map +1 -1
- package/dist/constants/plugin/index.js +2 -0
- package/dist/constants/plugin/index.js.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts +1 -1
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +25 -4
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +2 -1
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/persona/assembler.d.ts.map +1 -1
- package/dist/persona/assembler.js +2 -2
- package/dist/persona/assembler.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/lifecycle.d.ts +8 -1
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/lifecycle.js +9 -2
- package/dist/plugin/lifecycle.js.map +1 -1
- package/dist/plugin/shell-hook-http.d.ts +39 -0
- package/dist/plugin/shell-hook-http.d.ts.map +1 -0
- package/dist/plugin/shell-hook-http.js +163 -0
- package/dist/plugin/shell-hook-http.js.map +1 -0
- package/dist/plugin/shell-hook.d.ts +93 -11
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +223 -39
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +2 -1
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/public-runtime.d.ts +3 -2
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +2 -2
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +1 -0
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +2 -0
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +1 -1
- package/dist/public-types.d.ts.map +1 -1
- package/dist/runtime/query/executor.d.ts +4 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +47 -9
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +8 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +29 -1
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +6 -2
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction-breaker.d.ts +18 -8
- package/dist/runtime/query/iteration/phases/compaction-breaker.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction-breaker.js +33 -9
- package/dist/runtime/query/iteration/phases/compaction-breaker.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +52 -5
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +5 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +70 -3
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/path-escalation.d.ts +2 -0
- package/dist/runtime/query/path-escalation.d.ts.map +1 -1
- package/dist/runtime/query/path-escalation.js +7 -4
- package/dist/runtime/query/path-escalation.js.map +1 -1
- package/dist/runtime/query/plugin-hooks.js +2 -2
- package/dist/runtime/query/plugin-hooks.js.map +1 -1
- package/dist/runtime/query/prepare-turn.d.ts +2 -0
- package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
- package/dist/runtime/query/prepare-turn.js +25 -0
- package/dist/runtime/query/prepare-turn.js.map +1 -1
- package/dist/runtime/query/review-policy.d.ts +3 -2
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +32 -13
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/scheduler/local.js +1 -1
- package/dist/scheduler/local.js.map +1 -1
- package/dist/session/retention/archive.js +1 -1
- package/dist/session/retention/archive.js.map +1 -1
- package/dist/session/workspace/driver.d.ts +6 -0
- package/dist/session/workspace/driver.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js +28 -0
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/loader.d.ts +7 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +53 -0
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/registry.d.ts +1 -1
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +2 -1
- package/dist/skills/registry.js.map +1 -1
- package/dist/tools/builtins/bash-cwd.d.ts +52 -0
- package/dist/tools/builtins/bash-cwd.d.ts.map +1 -0
- package/dist/tools/builtins/bash-cwd.js +127 -0
- package/dist/tools/builtins/bash-cwd.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +41 -6
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/bounded-file-read.d.ts +10 -0
- package/dist/tools/builtins/bounded-file-read.d.ts.map +1 -0
- package/dist/tools/builtins/bounded-file-read.js +67 -0
- package/dist/tools/builtins/bounded-file-read.js.map +1 -0
- package/dist/tools/builtins/grep.d.ts +6 -1
- package/dist/tools/builtins/grep.d.ts.map +1 -1
- package/dist/tools/builtins/grep.js +187 -24
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/read-file.d.ts +1 -0
- package/dist/tools/builtins/read-file.d.ts.map +1 -1
- package/dist/tools/builtins/read-file.js +113 -28
- package/dist/tools/builtins/read-file.js.map +1 -1
- package/dist/tools/builtins/read-media.d.ts +68 -0
- package/dist/tools/builtins/read-media.d.ts.map +1 -0
- package/dist/tools/builtins/read-media.js +397 -0
- package/dist/tools/builtins/read-media.js.map +1 -0
- package/dist/tools/builtins/search-tools.js +1 -1
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts +4 -2
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +61 -2
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/tools/builtins/sleep-guard.d.ts +15 -0
- package/dist/tools/builtins/sleep-guard.d.ts.map +1 -0
- package/dist/tools/builtins/sleep-guard.js +33 -0
- package/dist/tools/builtins/sleep-guard.js.map +1 -0
- package/dist/tools/builtins/view-image.d.ts +23 -1
- package/dist/tools/builtins/view-image.d.ts.map +1 -1
- package/dist/tools/builtins/view-image.js +66 -58
- package/dist/tools/builtins/view-image.js.map +1 -1
- package/dist/tools/file-read-tracker.d.ts.map +1 -1
- package/dist/tools/file-read-tracker.js +31 -0
- package/dist/tools/file-read-tracker.js.map +1 -1
- package/dist/toolsets/manager.js +3 -3
- package/dist/toolsets/manager.js.map +1 -1
- package/dist/types/agent/base.d.ts +8 -0
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/query.d.ts +2 -0
- package/dist/types/agent/query.d.ts.map +1 -1
- package/dist/types/agent/scheduler.d.ts +8 -0
- package/dist/types/agent/scheduler.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +6 -2
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/agent/task.js.map +1 -1
- package/dist/types/connector/mcp.d.ts +46 -0
- package/dist/types/connector/mcp.d.ts.map +1 -1
- package/dist/types/hitl/index.d.ts +1 -1
- package/dist/types/plugin/index.d.ts +74 -7
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +12 -1
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/session/sub-session.d.ts +6 -2
- package/dist/types/session/sub-session.d.ts.map +1 -1
- package/dist/types/skills/index.d.ts +36 -0
- package/dist/types/skills/index.d.ts.map +1 -1
- package/dist/types/skills/index.js +9 -0
- package/dist/types/skills/index.js.map +1 -1
- package/dist/types/tool/index.d.ts +37 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/workspace/ref.d.ts +2 -0
- package/dist/types/workspace/ref.d.ts.map +1 -1
- package/dist/utils/frontmatter.d.ts +12 -0
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +6 -0
- package/dist/utils/frontmatter.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/QueryAgent.ts +3 -0
- package/src/agents/file-definitions.ts +126 -6
- package/src/authorization/protected-paths.ts +30 -2
- package/src/compaction/index.ts +1 -0
- package/src/compaction/manual.ts +68 -30
- package/src/compaction/model-summary.ts +412 -0
- package/src/compaction/verifier.ts +3 -3
- package/src/config/runtime.ts +16 -0
- package/src/connector/mcp/client.ts +87 -1
- package/src/constants/mcp/index.ts +3 -0
- package/src/constants/plugin/index.ts +2 -0
- package/src/manager/agent/lifecycle.ts +24 -5
- package/src/manager/session/turn-recorder.ts +2 -1
- package/src/persona/assembler.ts +2 -2
- package/src/plugin/index.ts +5 -0
- package/src/plugin/lifecycle.ts +16 -2
- package/src/plugin/shell-hook-http.ts +181 -0
- package/src/plugin/shell-hook.ts +386 -89
- package/src/prompt/coding-agent-doctrine.ts +2 -1
- package/src/public-runtime.ts +6 -0
- package/src/public-tools.ts +2 -0
- package/src/public-types.ts +5 -0
- package/src/runtime/query/executor.ts +54 -10
- package/src/runtime/query/index.ts +44 -0
- package/src/runtime/query/iteration/index.ts +11 -3
- package/src/runtime/query/iteration/phases/compaction-breaker.ts +38 -9
- package/src/runtime/query/iteration/phases/compaction.ts +67 -5
- package/src/runtime/query/iteration/phases/context.ts +6 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +74 -3
- package/src/runtime/query/path-escalation.ts +11 -5
- package/src/runtime/query/plugin-hooks.ts +2 -2
- package/src/runtime/query/prepare-turn.ts +33 -0
- package/src/runtime/query/review-policy.ts +45 -16
- package/src/scheduler/local.ts +1 -1
- package/src/session/retention/archive.ts +1 -1
- package/src/session/workspace/driver.ts +6 -0
- package/src/session/workspace/git-worktree.ts +31 -0
- package/src/skills/index.ts +6 -1
- package/src/skills/loader.ts +54 -0
- package/src/skills/registry.ts +7 -6
- package/src/tools/builtins/bash-cwd.ts +156 -0
- package/src/tools/builtins/bash.ts +79 -34
- package/src/tools/builtins/bounded-file-read.ts +80 -0
- package/src/tools/builtins/grep.ts +198 -28
- package/src/tools/builtins/read-file.ts +151 -30
- package/src/tools/builtins/read-media.ts +483 -0
- package/src/tools/builtins/search-tools.ts +1 -1
- package/src/tools/builtins/skill.ts +91 -2
- package/src/tools/builtins/sleep-guard.ts +31 -0
- package/src/tools/builtins/view-image.ts +74 -62
- package/src/tools/file-read-tracker.ts +30 -0
- package/src/toolsets/manager.ts +3 -3
- package/src/types/agent/base.ts +9 -0
- package/src/types/agent/query.ts +2 -0
- package/src/types/agent/scheduler.ts +9 -0
- package/src/types/agent/task.ts +6 -2
- package/src/types/connector/mcp.ts +48 -0
- package/src/types/hitl/index.ts +1 -1
- package/src/types/plugin/index.ts +102 -16
- package/src/types/session/sub-session.ts +6 -2
- package/src/types/skills/index.ts +48 -0
- package/src/types/tool/index.ts +38 -0
- package/src/types/workspace/ref.ts +2 -0
- package/src/utils/frontmatter.ts +21 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ReasoningEffort } from '../provider/chat.js'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Who may reach for a skill.
|
|
3
5
|
*
|
|
@@ -37,6 +39,52 @@ export interface SkillMetadata {
|
|
|
37
39
|
invocation?: SkillInvocation
|
|
38
40
|
|
|
39
41
|
metadata?: Record<string, string>
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* When the model should reach for the skill, in the author's words.
|
|
45
|
+
* Shown to the model next to the description (`when_to_use`); see
|
|
46
|
+
* {@link skillModelDescription}.
|
|
47
|
+
*/
|
|
48
|
+
whenToUse?: string
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Where the skill runs. `fork` hands its instructions to a delegated agent
|
|
52
|
+
* and returns that agent's report; absent or `inline` loads them into the
|
|
53
|
+
* current conversation.
|
|
54
|
+
*/
|
|
55
|
+
context?: 'inline' | 'fork'
|
|
56
|
+
|
|
57
|
+
/** The delegated agent type a `fork` skill runs as (`agent`). */
|
|
58
|
+
agent?: string
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The model a `fork` skill's delegated agent runs on (`model`). An inline
|
|
62
|
+
* skill runs on the turn's own model; this does not switch it.
|
|
63
|
+
*/
|
|
64
|
+
model?: string
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The reasoning effort requested for a `fork` skill's delegated agent
|
|
68
|
+
* (`effort`), even without `model`. The host validates the combination;
|
|
69
|
+
* this does not switch the current turn's effort for an inline skill.
|
|
70
|
+
*/
|
|
71
|
+
effort?: ReasoningEffort
|
|
72
|
+
|
|
73
|
+
/** Whether a `fork` skill's agent runs in the background (`background`). */
|
|
74
|
+
background?: boolean
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* What the model reads as a skill's description: the description, then the
|
|
79
|
+
* author's `when_to_use` guidance when there is one.
|
|
80
|
+
*/
|
|
81
|
+
export function skillModelDescription(metadata: {
|
|
82
|
+
description: string
|
|
83
|
+
whenToUse?: string
|
|
84
|
+
}): string {
|
|
85
|
+
const description = metadata.description.trim()
|
|
86
|
+
const when = metadata.whenToUse?.trim()
|
|
87
|
+
return when ? `${description} - ${when}` : description
|
|
40
88
|
}
|
|
41
89
|
|
|
42
90
|
/** What a skill that says nothing means. */
|
package/src/types/tool/index.ts
CHANGED
|
@@ -93,6 +93,12 @@ export interface SkillRegistryRef {
|
|
|
93
93
|
* silent `both` — the fail-open answer.
|
|
94
94
|
*/
|
|
95
95
|
invocation?: 'model' | 'operator' | 'both'
|
|
96
|
+
/** `fork` hands the skill to a delegated agent; see `SkillMetadata.context`. */
|
|
97
|
+
context?: 'inline' | 'fork'
|
|
98
|
+
agent?: string
|
|
99
|
+
model?: string
|
|
100
|
+
effort?: import('../provider/chat.js').ReasoningEffort
|
|
101
|
+
background?: boolean
|
|
96
102
|
}
|
|
97
103
|
body?: string
|
|
98
104
|
/** The skill's directory, which `${CLAUDE_SKILL_DIR}` in `allowed-tools` names. */
|
|
@@ -324,6 +330,22 @@ export interface FileReadTracker {
|
|
|
324
330
|
* only as a rendering, and nothing may be replayed on top of it.
|
|
325
331
|
*/
|
|
326
332
|
recordFullRead?(key: string, content: string, callId: string, renderedFingerprint: string): void
|
|
333
|
+
/**
|
|
334
|
+
* Optional body of a file whose latest observation was the whole file (a
|
|
335
|
+
* full read, a full write, or an edit's result), for a host that wants to
|
|
336
|
+
* show what changed under it. Absent after a windowed read, for a file too
|
|
337
|
+
* large to keep, and once the ledger has dropped the oldest bodies.
|
|
338
|
+
*/
|
|
339
|
+
fullBody?(key: string): string | undefined
|
|
340
|
+
/** Optional: the keys {@link fullBody} holds a body for, oldest first. */
|
|
341
|
+
fullBodyPaths?(): readonly string[]
|
|
342
|
+
/**
|
|
343
|
+
* Optional: record that the whole file now reads `content`, as an
|
|
344
|
+
* observation with no witness (the host has told the model about it, or
|
|
345
|
+
* read it itself). Advances the fingerprint and the kept body, so the next
|
|
346
|
+
* mutation compares against this body and not the one before it.
|
|
347
|
+
*/
|
|
348
|
+
recordFullBody?(key: string, content: string): void
|
|
327
349
|
/**
|
|
328
350
|
* Optional witness of the full read above: the call whose receipt holds the
|
|
329
351
|
* body, and the fingerprint of what that call emitted.
|
|
@@ -574,6 +596,22 @@ export interface ToolContext {
|
|
|
574
596
|
*/
|
|
575
597
|
receiptVisible?: (callId: string, renderedFingerprint: string) => boolean
|
|
576
598
|
|
|
599
|
+
/**
|
|
600
|
+
* The conversation this call belongs to, read live: the messages the model
|
|
601
|
+
* is shown right now, including the assistant message that issued this
|
|
602
|
+
* call, and the system prompt assembled for the current iteration.
|
|
603
|
+
*
|
|
604
|
+
* Absent when the host cannot say. A tool that needs it (one that starts a
|
|
605
|
+
* delegate which continues this conversation) must then refuse rather than
|
|
606
|
+
* start the delegate without the context it was asked to inherit. Read
|
|
607
|
+
* only: the arrays are the turn's own and a tool must copy before it
|
|
608
|
+
* changes anything.
|
|
609
|
+
*/
|
|
610
|
+
conversation?: {
|
|
611
|
+
messages(): readonly import('../message/index.js').Message[]
|
|
612
|
+
systemPrompt(): string | undefined
|
|
613
|
+
}
|
|
614
|
+
|
|
577
615
|
/**
|
|
578
616
|
* Where work that outlives this call is held.
|
|
579
617
|
*
|
|
@@ -29,6 +29,8 @@ export interface GitWorktreeBackendMeta {
|
|
|
29
29
|
branch: string
|
|
30
30
|
/** Absolute path to the worktree directory. */
|
|
31
31
|
worktreePath: string
|
|
32
|
+
/** The commit the checkout started on; absent on refs made before it was recorded. */
|
|
33
|
+
baseCommit?: string
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
package/src/utils/frontmatter.ts
CHANGED
|
@@ -145,6 +145,18 @@ export interface FrontmatterOptions {
|
|
|
145
145
|
* key is parsed and refused exactly as before.
|
|
146
146
|
*/
|
|
147
147
|
readonly readsKey?: (key: string) => boolean
|
|
148
|
+
/**
|
|
149
|
+
* Read keys that are read when they are plain and skipped, rather than
|
|
150
|
+
* refused, when they are not: a value in a block scalar, a flow sequence
|
|
151
|
+
* or flow mapping, or one written as indented lines under the key.
|
|
152
|
+
*
|
|
153
|
+
* For a key added to a loader after skills written for other tools already
|
|
154
|
+
* used it in a spelling this reader cannot take. Refusing the file over
|
|
155
|
+
* such a key would turn a skill that loaded into one that does not, for the
|
|
156
|
+
* sake of a field that only adds behaviour. The key then reads as absent,
|
|
157
|
+
* which is what it meant to everything before it was read.
|
|
158
|
+
*/
|
|
159
|
+
readonly tolerates?: (key: string) => boolean
|
|
148
160
|
}
|
|
149
161
|
|
|
150
162
|
export interface ParsedFrontmatter {
|
|
@@ -282,6 +294,15 @@ export function parseFrontmatter(
|
|
|
282
294
|
skipping = false
|
|
283
295
|
const value = normalizeScalar(line.slice(colonIdx + 1))
|
|
284
296
|
|
|
297
|
+
if (
|
|
298
|
+
options.tolerates?.(key) &&
|
|
299
|
+
(value === '' || UNSUPPORTED_YAML.some(({ pattern }) => pattern.test(value)))
|
|
300
|
+
) {
|
|
301
|
+
currentKey = key
|
|
302
|
+
skipping = true
|
|
303
|
+
continue
|
|
304
|
+
}
|
|
305
|
+
|
|
285
306
|
if (listKeys.has(key) && /^\[.*\]$/.test(value)) {
|
|
286
307
|
currentKey = key
|
|
287
308
|
const items = value
|