indusagi-coding-agent 0.1.22 → 0.1.24
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 +72 -11
- package/README.md +2 -36
- package/dist/cli/args.d.ts +117 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +231 -64
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts +58 -2
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +130 -12
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +70 -2
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +240 -15
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/list-models.d.ts +63 -3
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +202 -27
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/login-handler.d.ts +82 -8
- package/dist/cli/login-handler.d.ts.map +1 -1
- package/dist/cli/login-handler.js +410 -77
- package/dist/cli/login-handler.js.map +1 -1
- package/dist/cli/session-picker.d.ts +74 -2
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +236 -12
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session.d.ts +214 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +214 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +302 -12
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +302 -12
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/diagnostics.d.ts +191 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js +142 -0
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/event-bus.d.ts +146 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js +93 -0
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +4 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +4 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts +128 -0
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +128 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +4 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +4 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/keybindings.d.ts +142 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +142 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +98 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +98 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +99 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +99 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +0 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +127 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +125 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/subagents.js.map +1 -1
- package/dist/core/tools/bash.d.ts +391 -11
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +269 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +284 -6
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +238 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +169 -5
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +136 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +285 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +247 -0
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +0 -18
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -23
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +6 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +6 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +308 -7
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +231 -0
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/webfetch.d.ts +118 -3
- package/dist/core/tools/webfetch.d.ts.map +1 -1
- package/dist/core/tools/webfetch.js +118 -3
- package/dist/core/tools/webfetch.js.map +1 -1
- package/dist/core/tools/websearch.d.ts +130 -3
- package/dist/core/tools/websearch.d.ts.map +1 -1
- package/dist/core/tools/websearch.js +130 -3
- package/dist/core/tools/websearch.js.map +1 -1
- package/dist/core/tools/write.d.ts +251 -5
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +210 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +164 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +164 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +297 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +297 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +251 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +186 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +186 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1567 -13
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1567 -13
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +422 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +422 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +538 -5
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +538 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +921 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +921 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +802 -9
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +802 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +356 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +356 -3
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/shared.d.ts +386 -0
- package/dist/modes/shared.d.ts.map +1 -0
- package/dist/modes/shared.js +543 -0
- package/dist/modes/shared.js.map +1 -0
- package/dist/utils/array.d.ts +389 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +585 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/color-formatter.d.ts +318 -0
- package/dist/utils/color-formatter.d.ts.map +1 -0
- package/dist/utils/color-formatter.js +442 -0
- package/dist/utils/color-formatter.js.map +1 -0
- package/dist/utils/data-transformer.d.ts +326 -0
- package/dist/utils/data-transformer.d.ts.map +1 -0
- package/dist/utils/data-transformer.js +512 -0
- package/dist/utils/data-transformer.js.map +1 -0
- package/dist/utils/date-formatter.d.ts +281 -0
- package/dist/utils/date-formatter.d.ts.map +1 -0
- package/dist/utils/date-formatter.js +503 -0
- package/dist/utils/date-formatter.js.map +1 -0
- package/dist/utils/error-handler.d.ts +541 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +726 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/file-operations.d.ts +297 -0
- package/dist/utils/file-operations.d.ts.map +1 -0
- package/dist/utils/file-operations.js +505 -0
- package/dist/utils/file-operations.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +268 -6
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +500 -21
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/json-formatter.d.ts +259 -0
- package/dist/utils/json-formatter.d.ts.map +1 -0
- package/dist/utils/json-formatter.js +517 -0
- package/dist/utils/json-formatter.js.map +1 -0
- package/dist/utils/logger.d.ts +176 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +346 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-formatter.d.ts +211 -0
- package/dist/utils/markdown-formatter.d.ts.map +1 -0
- package/dist/utils/markdown-formatter.js +482 -0
- package/dist/utils/markdown-formatter.js.map +1 -0
- package/dist/utils/path-validator.d.ts +603 -0
- package/dist/utils/path-validator.d.ts.map +1 -0
- package/dist/utils/path-validator.js +870 -0
- package/dist/utils/path-validator.js.map +1 -0
- package/dist/utils/string-formatter.d.ts +609 -0
- package/dist/utils/string-formatter.d.ts.map +1 -0
- package/dist/utils/string-formatter.js +806 -0
- package/dist/utils/string-formatter.js.map +1 -0
- package/dist/utils/type-guards.d.ts +629 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +662 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/docs/COMPLETE-GUIDE.md +300 -0
- package/docs/MODES-ARCHITECTURE.md +565 -0
- package/docs/PRINT-MODE-GUIDE.md +456 -0
- package/docs/README.md +1 -2
- package/docs/RPC-GUIDE.md +705 -0
- package/docs/UTILS-IMPLEMENTATION-SUMMARY.md +647 -0
- package/docs/UTILS-MODULE-OVERVIEW.md +1480 -0
- package/docs/UTILS-QA-CHECKLIST.md +1061 -0
- package/docs/UTILS-USAGE-GUIDE.md +1419 -0
- package/package.json +3 -3
|
@@ -1,26 +1,505 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview YAML frontmatter parsing and generation for markdown documents
|
|
3
|
+
*
|
|
4
|
+
* This module provides:
|
|
5
|
+
* - Parse frontmatter from markdown/text files
|
|
6
|
+
* - Generate frontmatter from metadata objects
|
|
7
|
+
* - Validate frontmatter structure
|
|
8
|
+
* - Extract and transform metadata
|
|
9
|
+
* - Support for YAML format in code blocks
|
|
10
|
+
* - Safe parsing with error handling
|
|
11
|
+
* - Common metadata patterns (tags, dates, authors)
|
|
12
|
+
*
|
|
13
|
+
* Frontmatter format:
|
|
14
|
+
* ```
|
|
15
|
+
* ---
|
|
16
|
+
* title: Document Title
|
|
17
|
+
* author: John Doe
|
|
18
|
+
* date: 2024-01-15
|
|
19
|
+
* tags:
|
|
20
|
+
* - markdown
|
|
21
|
+
* - documentation
|
|
22
|
+
* ---
|
|
23
|
+
* Document content here
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* import { parseFrontmatter, stringifyFrontmatter, extractMetadata } from './frontmatter';
|
|
28
|
+
*
|
|
29
|
+
* const content = '---\ntitle: Hello\nauthor: John\n---\nContent';
|
|
30
|
+
* const { data, content: body } = parseFrontmatter(content);
|
|
31
|
+
* console.log(data.title); // 'Hello'
|
|
32
|
+
*
|
|
33
|
+
* @author indusagi
|
|
34
|
+
* @version 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Parse frontmatter from document content
|
|
38
|
+
* @param content - Document content with potential frontmatter
|
|
39
|
+
* @returns Parsed data and remaining content
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const doc = `---
|
|
43
|
+
* title: My Document
|
|
44
|
+
* author: John Doe
|
|
45
|
+
* tags: [markdown, docs]
|
|
46
|
+
* ---
|
|
47
|
+
*
|
|
48
|
+
* # Content here`;
|
|
49
|
+
*
|
|
50
|
+
* const { data, content: body } = parseFrontmatter(doc);
|
|
51
|
+
* console.log(data.title); // 'My Document'
|
|
52
|
+
* console.log(body); // '# Content here'
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // No frontmatter
|
|
56
|
+
* const { data, content } = parseFrontmatter('# Just content');
|
|
57
|
+
* // data = {}, content = '# Just content'
|
|
58
|
+
*/
|
|
59
|
+
export function parseFrontmatter(content) {
|
|
60
|
+
if (!content.startsWith('---')) {
|
|
61
|
+
return { data: {}, content, frontmatter: {}, body: content };
|
|
7
62
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
63
|
+
// Remove leading ---
|
|
64
|
+
const rest = content.slice(3);
|
|
65
|
+
// Find closing ---
|
|
66
|
+
const match = rest.match(/^([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
67
|
+
if (!match) {
|
|
68
|
+
return { data: {}, content, frontmatter: {}, body: content };
|
|
11
69
|
}
|
|
70
|
+
const [, frontmatterStr, body] = match;
|
|
71
|
+
try {
|
|
72
|
+
const data = parseYaml(frontmatterStr);
|
|
73
|
+
const trimmedBody = body.trim();
|
|
74
|
+
return { data, content: trimmedBody, frontmatter: data, body: trimmedBody };
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
// If YAML parsing fails, treat everything as content
|
|
78
|
+
return { data: {}, content, frontmatter: {}, body: content };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generate frontmatter string from data object
|
|
83
|
+
* @param data - Metadata object
|
|
84
|
+
* @returns Frontmatter string
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* const frontmatter = stringifyFrontmatter({
|
|
88
|
+
* title: 'My Document',
|
|
89
|
+
* author: 'John Doe',
|
|
90
|
+
* date: '2024-01-15',
|
|
91
|
+
* tags: ['markdown', 'docs']
|
|
92
|
+
* });
|
|
93
|
+
* // '---\n' +
|
|
94
|
+
* // 'title: My Document\n' +
|
|
95
|
+
* // 'author: John Doe\n' +
|
|
96
|
+
* // 'date: 2024-01-15\n' +
|
|
97
|
+
* // 'tags:\n' +
|
|
98
|
+
* // ' - markdown\n' +
|
|
99
|
+
* // ' - docs\n' +
|
|
100
|
+
* // '---'
|
|
101
|
+
*/
|
|
102
|
+
export function stringifyFrontmatter(data) {
|
|
103
|
+
const lines = ['---'];
|
|
104
|
+
for (const [key, value] of Object.entries(data)) {
|
|
105
|
+
lines.push(formatYamlLine(key, value));
|
|
106
|
+
}
|
|
107
|
+
lines.push('---');
|
|
108
|
+
return lines.join('\n');
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Parse simple YAML format (subset)
|
|
112
|
+
* @param yaml - YAML string
|
|
113
|
+
* @returns Parsed object
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* const obj = parseYaml('title: Hello\ncount: 42');
|
|
117
|
+
* // { title: 'Hello', count: 42 }
|
|
118
|
+
*/
|
|
119
|
+
function parseYaml(yaml) {
|
|
120
|
+
const result = {};
|
|
121
|
+
const lines = yaml.split('\n').filter((line) => line.trim());
|
|
122
|
+
let currentKey = null;
|
|
123
|
+
let currentArray = [];
|
|
124
|
+
let inArray = false;
|
|
125
|
+
for (const line of lines) {
|
|
126
|
+
const indent = line.match(/^\s*/)?.[0].length || 0;
|
|
127
|
+
// Array item
|
|
128
|
+
if (line.trim().startsWith('-')) {
|
|
129
|
+
if (!inArray && currentKey) {
|
|
130
|
+
inArray = true;
|
|
131
|
+
currentArray = [];
|
|
132
|
+
result[currentKey] = currentArray;
|
|
133
|
+
}
|
|
134
|
+
const arrayItem = line.trim().slice(1).trim();
|
|
135
|
+
const value = parseYamlValue(arrayItem);
|
|
136
|
+
if (inArray && currentKey) {
|
|
137
|
+
currentArray.push(value);
|
|
138
|
+
}
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
// Reset array flag if not indented
|
|
142
|
+
if (inArray && indent === 0) {
|
|
143
|
+
inArray = false;
|
|
144
|
+
}
|
|
145
|
+
// Key-value pair
|
|
146
|
+
const colonIndex = line.indexOf(':');
|
|
147
|
+
if (colonIndex > -1) {
|
|
148
|
+
const key = line.substring(0, colonIndex).trim();
|
|
149
|
+
const valueStr = line.substring(colonIndex + 1).trim();
|
|
150
|
+
currentKey = key;
|
|
151
|
+
const value = parseYamlValue(valueStr);
|
|
152
|
+
result[key] = value;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Parse YAML value
|
|
159
|
+
* @param value - YAML value string
|
|
160
|
+
* @returns Parsed value
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* parseYamlValue('true'); // true
|
|
164
|
+
* parseYamlValue('42'); // 42
|
|
165
|
+
* parseYamlValue('"hello"'); // 'hello'
|
|
166
|
+
* parseYamlValue('hello'); // 'hello'
|
|
167
|
+
*/
|
|
168
|
+
function parseYamlValue(value) {
|
|
169
|
+
if (!value)
|
|
170
|
+
return '';
|
|
171
|
+
// Boolean
|
|
172
|
+
if (value === 'true')
|
|
173
|
+
return true;
|
|
174
|
+
if (value === 'false')
|
|
175
|
+
return false;
|
|
176
|
+
// Null
|
|
177
|
+
if (value === 'null' || value === '~')
|
|
178
|
+
return null;
|
|
179
|
+
// Number
|
|
180
|
+
if (/^-?\d+$/.test(value))
|
|
181
|
+
return parseInt(value, 10);
|
|
182
|
+
if (/^-?\d+\.\d+$/.test(value))
|
|
183
|
+
return parseFloat(value);
|
|
184
|
+
// String with quotes
|
|
185
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
186
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
187
|
+
return value.slice(1, -1);
|
|
188
|
+
}
|
|
189
|
+
// Array shorthand [a, b, c]
|
|
190
|
+
if (value.startsWith('[') && value.endsWith(']')) {
|
|
191
|
+
const items = value.slice(1, -1).split(',').map((item) => parseYamlValue(item.trim()));
|
|
192
|
+
return items;
|
|
193
|
+
}
|
|
194
|
+
// Plain string
|
|
195
|
+
return value;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Format YAML key-value line
|
|
199
|
+
* @param key - Key name
|
|
200
|
+
* @param value - Value to format
|
|
201
|
+
* @returns Formatted YAML line(s)
|
|
202
|
+
*/
|
|
203
|
+
function formatYamlLine(key, value) {
|
|
204
|
+
if (value === null || value === undefined) {
|
|
205
|
+
return `${key}:`;
|
|
206
|
+
}
|
|
207
|
+
if (typeof value === 'boolean') {
|
|
208
|
+
return `${key}: ${value}`;
|
|
209
|
+
}
|
|
210
|
+
if (typeof value === 'number') {
|
|
211
|
+
return `${key}: ${value}`;
|
|
212
|
+
}
|
|
213
|
+
if (typeof value === 'string') {
|
|
214
|
+
// Escape if needed
|
|
215
|
+
const needsQuotes = value.includes(':') || value.includes('#') || value.includes('"');
|
|
216
|
+
if (needsQuotes) {
|
|
217
|
+
return `${key}: "${value.replace(/"/g, '\\"')}"`;
|
|
218
|
+
}
|
|
219
|
+
return `${key}: ${value}`;
|
|
220
|
+
}
|
|
221
|
+
if (Array.isArray(value)) {
|
|
222
|
+
const lines = [`${key}:`];
|
|
223
|
+
for (const item of value) {
|
|
224
|
+
const formatted = typeof item === 'string' ? item : JSON.stringify(item);
|
|
225
|
+
lines.push(` - ${formatted}`);
|
|
226
|
+
}
|
|
227
|
+
return lines.join('\n');
|
|
228
|
+
}
|
|
229
|
+
if (typeof value === 'object') {
|
|
230
|
+
// Nested object
|
|
231
|
+
const lines = [`${key}:`];
|
|
232
|
+
for (const [k, v] of Object.entries(value)) {
|
|
233
|
+
lines.push(' ' + formatYamlLine(k, v));
|
|
234
|
+
}
|
|
235
|
+
return lines.join('\n');
|
|
236
|
+
}
|
|
237
|
+
return `${key}: ${value}`;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Validate frontmatter structure and content
|
|
241
|
+
* @param data - Frontmatter data to validate
|
|
242
|
+
* @param schema - Validation schema (optional)
|
|
243
|
+
* @returns Validation result
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* const result = validateFrontmatter({
|
|
247
|
+
* title: 'Document',
|
|
248
|
+
* author: 'John'
|
|
249
|
+
* });
|
|
250
|
+
* // { valid: true, errors: [], warnings: [] }
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* const result = validateFrontmatter(
|
|
254
|
+
* { title: '', author: 'John' },
|
|
255
|
+
* { required: ['title', 'author'] }
|
|
256
|
+
* );
|
|
257
|
+
* // { valid: false, errors: ['title is required'], warnings: [] }
|
|
258
|
+
*/
|
|
259
|
+
export function validateFrontmatter(data, schema) {
|
|
260
|
+
const errors = [];
|
|
261
|
+
const warnings = [];
|
|
262
|
+
if (!schema) {
|
|
263
|
+
return { valid: true, errors, warnings };
|
|
264
|
+
}
|
|
265
|
+
// Check required fields
|
|
266
|
+
if (schema.required) {
|
|
267
|
+
for (const field of schema.required) {
|
|
268
|
+
if (!(field in data) || !data[field]) {
|
|
269
|
+
errors.push(`"${field}" is required`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Check patterns
|
|
274
|
+
if (schema.patterns) {
|
|
275
|
+
for (const [field, pattern] of Object.entries(schema.patterns)) {
|
|
276
|
+
if (field in data && typeof data[field] === 'string') {
|
|
277
|
+
if (!pattern.test(data[field])) {
|
|
278
|
+
errors.push(`"${field}" does not match required pattern`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
valid: errors.length === 0,
|
|
285
|
+
errors,
|
|
286
|
+
warnings,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Extract common metadata fields from frontmatter
|
|
291
|
+
* @param data - Frontmatter data
|
|
292
|
+
* @returns Common metadata object
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* const metadata = extractMetadata({
|
|
296
|
+
* title: 'Hello',
|
|
297
|
+
* author: 'John',
|
|
298
|
+
* date: '2024-01-15',
|
|
299
|
+
* tags: ['markdown']
|
|
300
|
+
* });
|
|
301
|
+
* // {
|
|
302
|
+
* // title: 'Hello',
|
|
303
|
+
* // author: 'John',
|
|
304
|
+
* // date: '2024-01-15',
|
|
305
|
+
* // tags: ['markdown']
|
|
306
|
+
* // }
|
|
307
|
+
*/
|
|
308
|
+
export function extractMetadata(data) {
|
|
12
309
|
return {
|
|
13
|
-
|
|
14
|
-
|
|
310
|
+
title: data.title,
|
|
311
|
+
description: data.description,
|
|
312
|
+
author: data.author,
|
|
313
|
+
date: data.date,
|
|
314
|
+
modified: data.modified || data.updated,
|
|
315
|
+
tags: Array.isArray(data.tags) ? data.tags : [],
|
|
316
|
+
category: data.category,
|
|
317
|
+
draft: data.draft || false,
|
|
318
|
+
published: data.published !== false,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Create frontmatter with common metadata
|
|
323
|
+
* @param metadata - Common metadata
|
|
324
|
+
* @param additional - Additional custom fields
|
|
325
|
+
* @returns Frontmatter string
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* const frontmatter = createFrontmatter({
|
|
329
|
+
* title: 'My Post',
|
|
330
|
+
* author: 'John',
|
|
331
|
+
* date: '2024-01-15',
|
|
332
|
+
* tags: ['markdown', 'docs']
|
|
333
|
+
* });
|
|
334
|
+
*/
|
|
335
|
+
export function createFrontmatter(metadata, additional) {
|
|
336
|
+
const data = { ...metadata, ...additional };
|
|
337
|
+
// Remove undefined values
|
|
338
|
+
for (const key in data) {
|
|
339
|
+
if (data[key] === undefined) {
|
|
340
|
+
delete data[key];
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return stringifyFrontmatter(data);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Update frontmatter while preserving content
|
|
347
|
+
* @param content - Full document content
|
|
348
|
+
* @param updates - Metadata updates
|
|
349
|
+
* @returns Updated document
|
|
350
|
+
*
|
|
351
|
+
* @example
|
|
352
|
+
* const updated = updateFrontmatter(
|
|
353
|
+
* '---\\ntitle: Old\\n---\\nContent',
|
|
354
|
+
* { title: 'New', author: 'Jane' }
|
|
355
|
+
* );
|
|
356
|
+
* // '---\ntitle: New\nauthor: Jane\n---\nContent'
|
|
357
|
+
*/
|
|
358
|
+
export function updateFrontmatter(content, updates) {
|
|
359
|
+
const { data, content: body } = parseFrontmatter(content);
|
|
360
|
+
const merged = { ...data, ...updates };
|
|
361
|
+
const frontmatter = stringifyFrontmatter(merged);
|
|
362
|
+
return body ? `${frontmatter}\n\n${body}` : frontmatter;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Remove frontmatter from content
|
|
366
|
+
* @param content - Document content
|
|
367
|
+
* @returns Content without frontmatter
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* const clean = removeFrontmatter('---\ntitle: Test\n---\nContent');
|
|
371
|
+
* // 'Content'
|
|
372
|
+
*/
|
|
373
|
+
export function removeFrontmatter(content) {
|
|
374
|
+
const { content: body } = parseFrontmatter(content);
|
|
375
|
+
return body;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Alias for removeFrontmatter
|
|
379
|
+
* @param content - Document content
|
|
380
|
+
* @returns Content without frontmatter
|
|
381
|
+
*/
|
|
382
|
+
export const stripFrontmatter = removeFrontmatter;
|
|
383
|
+
/**
|
|
384
|
+
* Check if content has frontmatter
|
|
385
|
+
* @param content - Document content
|
|
386
|
+
* @returns True if has frontmatter
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* hasFrontmatter('---\ntitle: Test\n---\nContent'); // true
|
|
390
|
+
* hasFrontmatter('Just content'); // false
|
|
391
|
+
*/
|
|
392
|
+
export function hasFrontmatter(content) {
|
|
393
|
+
return /^---\n[\s\S]*?\n---\n/.test(content);
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Get all tags from frontmatter data
|
|
397
|
+
* @param data - Frontmatter data
|
|
398
|
+
* @returns Flattened array of tags
|
|
399
|
+
*
|
|
400
|
+
* @example
|
|
401
|
+
* const tags = getTags({
|
|
402
|
+
* tags: ['markdown', 'docs'],
|
|
403
|
+
* categories: ['tutorial']
|
|
404
|
+
* });
|
|
405
|
+
* // ['markdown', 'docs']
|
|
406
|
+
*/
|
|
407
|
+
export function getTags(data) {
|
|
408
|
+
const tags = [];
|
|
409
|
+
if (Array.isArray(data.tags)) {
|
|
410
|
+
tags.push(...data.tags);
|
|
411
|
+
}
|
|
412
|
+
if (typeof data.tag === 'string') {
|
|
413
|
+
tags.push(data.tag);
|
|
414
|
+
}
|
|
415
|
+
return [...new Set(tags)];
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Get authors from frontmatter data
|
|
419
|
+
* @param data - Frontmatter data
|
|
420
|
+
* @returns Array of author names
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
* const authors = getAuthors({ author: 'John', authors: ['Jane', 'Bob'] });
|
|
424
|
+
* // ['John', 'Jane', 'Bob']
|
|
425
|
+
*/
|
|
426
|
+
export function getAuthors(data) {
|
|
427
|
+
const authors = [];
|
|
428
|
+
if (typeof data.author === 'string') {
|
|
429
|
+
authors.push(data.author);
|
|
430
|
+
}
|
|
431
|
+
else if (Array.isArray(data.author)) {
|
|
432
|
+
authors.push(...data.author);
|
|
433
|
+
}
|
|
434
|
+
if (Array.isArray(data.authors)) {
|
|
435
|
+
authors.push(...data.authors);
|
|
436
|
+
}
|
|
437
|
+
return [...new Set(authors)];
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Format date field in frontmatter
|
|
441
|
+
* @param dateStr - Date string
|
|
442
|
+
* @returns ISO formatted date
|
|
443
|
+
*
|
|
444
|
+
* @example
|
|
445
|
+
* formatFrontmatterDate('January 15, 2024');
|
|
446
|
+
* // '2024-01-15'
|
|
447
|
+
*/
|
|
448
|
+
export function formatFrontmatterDate(dateStr) {
|
|
449
|
+
const date = new Date(dateStr);
|
|
450
|
+
if (isNaN(date.getTime())) {
|
|
451
|
+
return dateStr;
|
|
452
|
+
}
|
|
453
|
+
return date.toISOString().split('T')[0];
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Merge frontmatter data objects
|
|
457
|
+
* @param base - Base metadata
|
|
458
|
+
* @param overrides - Override metadata
|
|
459
|
+
* @returns Merged metadata
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* const merged = mergeFrontmatter(
|
|
463
|
+
* { title: 'Original', author: 'John' },
|
|
464
|
+
* { title: 'Updated' }
|
|
465
|
+
* );
|
|
466
|
+
* // { title: 'Updated', author: 'John' }
|
|
467
|
+
*/
|
|
468
|
+
export function mergeFrontmatter(base, overrides) {
|
|
469
|
+
return { ...base, ...overrides };
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Generate a template frontmatter for new documents
|
|
473
|
+
* @param type - Document type (post, page, etc)
|
|
474
|
+
* @returns Frontmatter template string
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* const template = createTemplate('post');
|
|
478
|
+
* // Returns template with common fields for blog posts
|
|
479
|
+
*/
|
|
480
|
+
export function createTemplate(type = 'post') {
|
|
481
|
+
const now = new Date().toISOString().split('T')[0];
|
|
482
|
+
const templates = {
|
|
483
|
+
post: {
|
|
484
|
+
title: 'New Post',
|
|
485
|
+
description: 'Post description',
|
|
486
|
+
author: 'Author Name',
|
|
487
|
+
date: now,
|
|
488
|
+
tags: ['tag1', 'tag2'],
|
|
489
|
+
draft: false,
|
|
490
|
+
},
|
|
491
|
+
page: {
|
|
492
|
+
title: 'New Page',
|
|
493
|
+
description: 'Page description',
|
|
494
|
+
draft: false,
|
|
495
|
+
},
|
|
496
|
+
draft: {
|
|
497
|
+
title: 'Draft Title',
|
|
498
|
+
date: now,
|
|
499
|
+
draft: true,
|
|
500
|
+
},
|
|
15
501
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!yamlString) {
|
|
20
|
-
return { frontmatter: {}, body };
|
|
21
|
-
}
|
|
22
|
-
const parsed = parse(yamlString);
|
|
23
|
-
return { frontmatter: (parsed ?? {}), body };
|
|
24
|
-
};
|
|
25
|
-
export const stripFrontmatter = (content) => parseFrontmatter(content).body;
|
|
502
|
+
const data = templates[type] || templates.post;
|
|
503
|
+
return stringifyFrontmatter(data);
|
|
504
|
+
}
|
|
26
505
|
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/utils/frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/utils/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAsCH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,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