agentic-domain-document 0.6.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/.tbls.yml +201 -0
- package/CHANGELOG.md +68 -0
- package/README.md +313 -0
- package/agent/agent.manifest.json +8 -0
- package/agent/capabilities/document-authoring.json +21 -0
- package/agent/capabilities/document-block.json +22 -0
- package/agent/capabilities/document-toc.json +21 -0
- package/agent/capabilities/document-validation.json +21 -0
- package/agent/examples/document-quality-examples.md +153 -0
- package/agent/examples/examples.md +172 -0
- package/agent/guides/10-document-authoring-guide.md +28 -0
- package/agent/guides/20-domain-boundary-guide.md +41 -0
- package/agent/guides/30-authoring-policy-guide.md +40 -0
- package/agent/guides/40-toc-authoring-guide.md +73 -0
- package/agent/guides/50-content-block-guide.md +57 -0
- package/agent/guides/51-paragraph-authoring-guide.md +68 -0
- package/agent/guides/52-table-authoring-guide.md +73 -0
- package/agent/guides/53-diagram-figure-authoring-guide.md +75 -0
- package/agent/guides/70-korean-writing-style-guide.md +65 -0
- package/agent/instructions/00-runtime-behavior.md +17 -0
- package/agent/instructions/10-scope-and-boundary.md +27 -0
- package/agent/instructions/20-task-procedures.md +69 -0
- package/agent/instructions/30-must-and-must-not.md +34 -0
- package/agent/resource-index.json +185 -0
- package/agent/resource-selection.json +205 -0
- package/agent/routing.json +34 -0
- package/agent/sources/reference-mapping.md +53 -0
- package/agent/validation/document-validation-rules.md +73 -0
- package/dist/agent/document-agent-contribution.d.ts +15 -0
- package/dist/agent/document-agent-contribution.d.ts.map +1 -0
- package/dist/agent/document-agent-contribution.js +39 -0
- package/dist/agent/document-agent-contribution.js.map +1 -0
- package/dist/agent/index.d.ts +2 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +2 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/database.d.ts +8 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +76 -0
- package/dist/database.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown-importer.d.ts +14 -0
- package/dist/markdown-importer.d.ts.map +1 -0
- package/dist/markdown-importer.js +386 -0
- package/dist/markdown-importer.js.map +1 -0
- package/dist/reader.d.ts +17 -0
- package/dist/reader.d.ts.map +1 -0
- package/dist/reader.js +332 -0
- package/dist/reader.js.map +1 -0
- package/dist/repositories.d.ts +118 -0
- package/dist/repositories.d.ts.map +1 -0
- package/dist/repositories.js +388 -0
- package/dist/repositories.js.map +1 -0
- package/dist/service.d.ts +35 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +327 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +276 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validators.d.ts +4 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +255 -0
- package/dist/validators.js.map +1 -0
- package/docs/build.md +55 -0
- package/docs/configuration.md +34 -0
- package/docs/delivery.md +50 -0
- package/docs/operations.md +50 -0
- package/docs/publishing.md +69 -0
- package/docs/schema/generated/README.md +30 -0
- package/docs/schema/generated/document_annotations.md +119 -0
- package/docs/schema/generated/document_annotations.svg +60 -0
- package/docs/schema/generated/document_blocks.md +97 -0
- package/docs/schema/generated/document_blocks.svg +60 -0
- package/docs/schema/generated/document_change_events.md +135 -0
- package/docs/schema/generated/document_change_events.svg +88 -0
- package/docs/schema/generated/document_code_groups.md +70 -0
- package/docs/schema/generated/document_code_groups.svg +52 -0
- package/docs/schema/generated/document_codes.md +88 -0
- package/docs/schema/generated/document_codes.svg +52 -0
- package/docs/schema/generated/document_contents.md +87 -0
- package/docs/schema/generated/document_contents.svg +116 -0
- package/docs/schema/generated/document_documents.md +126 -0
- package/docs/schema/generated/document_documents.svg +222 -0
- package/docs/schema/generated/document_node_taxonomies.md +84 -0
- package/docs/schema/generated/document_node_taxonomies.svg +80 -0
- package/docs/schema/generated/document_node_taxonomy_levels.md +91 -0
- package/docs/schema/generated/document_node_taxonomy_levels.svg +52 -0
- package/docs/schema/generated/document_nodes.md +120 -0
- package/docs/schema/generated/document_nodes.svg +98 -0
- package/docs/schema/generated/document_revisions.md +107 -0
- package/docs/schema/generated/document_revisions.svg +116 -0
- package/docs/schema/generated/document_versions.md +126 -0
- package/docs/schema/generated/document_versions.svg +88 -0
- package/docs/schema/generated/schema.json +2534 -0
- package/docs/schema/generated/schema.mmd +170 -0
- package/docs/schema/generated/schema.svg +331 -0
- package/docs/schema/migrations.md +40 -0
- package/docs/usage.md +332 -0
- package/docs/validation-rules.md +69 -0
- package/package.json +30 -0
- package/src/database/migrations/0001_document_base.sql +753 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"selectionId": "agentic-domain-document.resource-selection",
|
|
3
|
+
"title": "Agentic Domain Document Resource Selection",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Document Agent 요청에 필요한 instruction, guide, example, validation, source resource를 선택하는 1차 JSON rule이다.",
|
|
6
|
+
"alwaysResourceIds": [
|
|
7
|
+
"document.instruction.runtime-behavior",
|
|
8
|
+
"document.instruction.scope-and-boundary",
|
|
9
|
+
"document.instruction.task-procedures",
|
|
10
|
+
"document.instruction.must-and-must-not"
|
|
11
|
+
],
|
|
12
|
+
"fallbackResourceIds": [
|
|
13
|
+
"document.guide.authoring",
|
|
14
|
+
"document.guide.authoring-policy",
|
|
15
|
+
"document.guide.korean-writing"
|
|
16
|
+
],
|
|
17
|
+
"rules": [
|
|
18
|
+
{
|
|
19
|
+
"ruleId": "document.resource-selection.adoc-query",
|
|
20
|
+
"title": "Adoc 조회와 Markdown Projection resource selection",
|
|
21
|
+
"bundleType": "adoc-query",
|
|
22
|
+
"priority": 50,
|
|
23
|
+
"keywords": [
|
|
24
|
+
"Adoc",
|
|
25
|
+
"Agentic Document",
|
|
26
|
+
"Agentic Doc",
|
|
27
|
+
"agentic-domain-document",
|
|
28
|
+
"Document Tree",
|
|
29
|
+
"Adoc Tree",
|
|
30
|
+
"Markdown Projection",
|
|
31
|
+
"Adoc Markdown Projection",
|
|
32
|
+
"Markdown Import",
|
|
33
|
+
"importMarkdownDocument",
|
|
34
|
+
"importMarkdownChapter",
|
|
35
|
+
"챕터 import",
|
|
36
|
+
"챕터별 import",
|
|
37
|
+
"문서 조회",
|
|
38
|
+
"문서 DB",
|
|
39
|
+
"node",
|
|
40
|
+
"block"
|
|
41
|
+
],
|
|
42
|
+
"includeResourceIds": [
|
|
43
|
+
"document.guide.domain-boundary",
|
|
44
|
+
"document.guide.content-block",
|
|
45
|
+
"document.guide.authoring-policy",
|
|
46
|
+
"document.example.quality",
|
|
47
|
+
"document.validation.rules"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"ruleId": "document.resource-selection.toc-authoring",
|
|
52
|
+
"title": "TOC 작성 resource selection",
|
|
53
|
+
"bundleType": "toc-authoring",
|
|
54
|
+
"priority": 100,
|
|
55
|
+
"keywords": [
|
|
56
|
+
"목차",
|
|
57
|
+
"TOC",
|
|
58
|
+
"chapter",
|
|
59
|
+
"section",
|
|
60
|
+
"subsection",
|
|
61
|
+
"장",
|
|
62
|
+
"절"
|
|
63
|
+
],
|
|
64
|
+
"includeResourceIds": [
|
|
65
|
+
"document.guide.authoring",
|
|
66
|
+
"document.guide.authoring-policy",
|
|
67
|
+
"document.guide.korean-writing",
|
|
68
|
+
"document.guide.toc",
|
|
69
|
+
"document.example.quality"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"ruleId": "document.resource-selection.paragraph-authoring",
|
|
74
|
+
"title": "Paragraph 작성 resource selection",
|
|
75
|
+
"bundleType": "paragraph-authoring",
|
|
76
|
+
"priority": 200,
|
|
77
|
+
"keywords": [
|
|
78
|
+
"문단",
|
|
79
|
+
"paragraph",
|
|
80
|
+
"본문",
|
|
81
|
+
"서술",
|
|
82
|
+
"설명"
|
|
83
|
+
],
|
|
84
|
+
"includeResourceIds": [
|
|
85
|
+
"document.guide.authoring",
|
|
86
|
+
"document.guide.authoring-policy",
|
|
87
|
+
"document.guide.korean-writing",
|
|
88
|
+
"document.guide.paragraph",
|
|
89
|
+
"document.example.quality"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"ruleId": "document.resource-selection.table-authoring",
|
|
94
|
+
"title": "Table 작성 resource selection",
|
|
95
|
+
"bundleType": "table-authoring",
|
|
96
|
+
"priority": 300,
|
|
97
|
+
"keywords": [
|
|
98
|
+
"표",
|
|
99
|
+
"table",
|
|
100
|
+
"컬럼",
|
|
101
|
+
"헤더",
|
|
102
|
+
"schemaRef",
|
|
103
|
+
"행",
|
|
104
|
+
"열"
|
|
105
|
+
],
|
|
106
|
+
"includeResourceIds": [
|
|
107
|
+
"document.guide.authoring",
|
|
108
|
+
"document.guide.authoring-policy",
|
|
109
|
+
"document.guide.korean-writing",
|
|
110
|
+
"document.guide.content-block",
|
|
111
|
+
"document.guide.table",
|
|
112
|
+
"document.example.quality",
|
|
113
|
+
"document.validation.rules"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"ruleId": "document.resource-selection.diagram-figure-authoring",
|
|
118
|
+
"title": "Diagram/Figure 작성 resource selection",
|
|
119
|
+
"bundleType": "diagram-figure-authoring",
|
|
120
|
+
"priority": 400,
|
|
121
|
+
"keywords": [
|
|
122
|
+
"도해",
|
|
123
|
+
"diagram",
|
|
124
|
+
"figure",
|
|
125
|
+
"drawio",
|
|
126
|
+
"draw.io",
|
|
127
|
+
"svg",
|
|
128
|
+
"mermaid",
|
|
129
|
+
"plantuml",
|
|
130
|
+
"이미지"
|
|
131
|
+
],
|
|
132
|
+
"includeResourceIds": [
|
|
133
|
+
"document.guide.authoring",
|
|
134
|
+
"document.guide.authoring-policy",
|
|
135
|
+
"document.guide.korean-writing",
|
|
136
|
+
"document.guide.content-block",
|
|
137
|
+
"document.guide.diagram-figure",
|
|
138
|
+
"document.example.quality",
|
|
139
|
+
"document.validation.rules"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"ruleId": "document.resource-selection.style-review",
|
|
144
|
+
"title": "문체 수정/검토 resource selection",
|
|
145
|
+
"bundleType": "style-review",
|
|
146
|
+
"priority": 500,
|
|
147
|
+
"keywords": [
|
|
148
|
+
"문체",
|
|
149
|
+
"표현",
|
|
150
|
+
"외래어",
|
|
151
|
+
"용어",
|
|
152
|
+
"한글",
|
|
153
|
+
"번역투",
|
|
154
|
+
"다듬어"
|
|
155
|
+
],
|
|
156
|
+
"includeResourceIds": [
|
|
157
|
+
"document.guide.authoring-policy",
|
|
158
|
+
"document.guide.korean-writing",
|
|
159
|
+
"document.guide.paragraph",
|
|
160
|
+
"document.example.quality",
|
|
161
|
+
"document.validation.rules"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"ruleId": "document.resource-selection.validation",
|
|
166
|
+
"title": "Document 검증 resource selection",
|
|
167
|
+
"bundleType": "document-validation",
|
|
168
|
+
"priority": 600,
|
|
169
|
+
"keywords": [
|
|
170
|
+
"검증",
|
|
171
|
+
"validate",
|
|
172
|
+
"validation",
|
|
173
|
+
"점검",
|
|
174
|
+
"오류",
|
|
175
|
+
"누락",
|
|
176
|
+
"적합"
|
|
177
|
+
],
|
|
178
|
+
"includeResourceIds": [
|
|
179
|
+
"document.guide.authoring-policy",
|
|
180
|
+
"document.guide.korean-writing",
|
|
181
|
+
"document.validation.rules",
|
|
182
|
+
"document.example.quality"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"ruleId": "document.resource-selection.traceability",
|
|
187
|
+
"title": "Source mapping resource selection",
|
|
188
|
+
"bundleType": "traceability",
|
|
189
|
+
"priority": 700,
|
|
190
|
+
"keywords": [
|
|
191
|
+
"출처",
|
|
192
|
+
"근거",
|
|
193
|
+
"source",
|
|
194
|
+
"mapping",
|
|
195
|
+
"참조",
|
|
196
|
+
"왜",
|
|
197
|
+
"어디서"
|
|
198
|
+
],
|
|
199
|
+
"includeResourceIds": [
|
|
200
|
+
"document.guide.domain-boundary",
|
|
201
|
+
"document.source.reference-mapping"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"keywords": [
|
|
3
|
+
"Adoc",
|
|
4
|
+
"Agentic Document",
|
|
5
|
+
"Agentic Doc",
|
|
6
|
+
"agentic-domain-document",
|
|
7
|
+
"문서",
|
|
8
|
+
"Document Tree",
|
|
9
|
+
"Adoc Tree",
|
|
10
|
+
"Markdown Projection",
|
|
11
|
+
"Adoc Markdown Projection",
|
|
12
|
+
"Markdown Import",
|
|
13
|
+
"챕터 import",
|
|
14
|
+
"챕터별 import",
|
|
15
|
+
"목차",
|
|
16
|
+
"본문",
|
|
17
|
+
"블록",
|
|
18
|
+
"표",
|
|
19
|
+
"도해",
|
|
20
|
+
"캡션",
|
|
21
|
+
"작성 규칙"
|
|
22
|
+
],
|
|
23
|
+
"examples": [
|
|
24
|
+
"Adoc 문서를 조회해줘",
|
|
25
|
+
"Agentic Document를 Markdown Projection으로 보여줘",
|
|
26
|
+
"Adoc Tree에서 특정 block을 찾아줘",
|
|
27
|
+
"Markdown 파일을 Adoc 문서로 import해줘",
|
|
28
|
+
"챕터별 Markdown을 Adoc으로 생성해줘",
|
|
29
|
+
"문서 작성 지시문을 정리해줘",
|
|
30
|
+
"목차와 본문 블록 구조를 검토해줘",
|
|
31
|
+
"외래어와 한글 작성 규칙을 반영해줘"
|
|
32
|
+
],
|
|
33
|
+
"defaultPriority": 10
|
|
34
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Document Agent Resource Source Mapping
|
|
2
|
+
|
|
3
|
+
## 목적
|
|
4
|
+
|
|
5
|
+
본 문서는 Document Agent resource가 어떤 참조 프로젝트, 규칙, 가이드, 실제 본문 사례, 프로젝트 승인 결정에서 유래했는지 추적하기 위한 mapping 문서다.
|
|
6
|
+
|
|
7
|
+
Source mapping은 참조 내용을 그대로 복사했다는 의미가 아니다. 각 source에서 일반 Document 도메인에 적용 가능한 원칙을 추출하고, `agentic-domain-document`의 책임 경계에 맞게 재정리했음을 의미한다.
|
|
8
|
+
|
|
9
|
+
## Source Mapping
|
|
10
|
+
|
|
11
|
+
| Source | Source Type | 반영 Resource | 반영 내용 | 상태 |
|
|
12
|
+
| --- | --- | --- | --- | --- |
|
|
13
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/instructions/00-runtime-behavior.md`, `agent/guides/10-document-authoring-guide.md` | Document Agent 책임, runtime/router와의 분리, source 우선순위 | reflected |
|
|
14
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/instructions/10-scope-and-boundary.md`, `agent/guides/20-domain-boundary-guide.md` | Document, TOC Node, Content, Typed Block, Annotation, Revision 경계 | reflected |
|
|
15
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/instructions/20-task-procedures.md`, `agent/guides/30-authoring-policy-guide.md` | 최종 본문과 내부 검토 메모 분리, 상태별 수정 정책 | reflected |
|
|
16
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/guides/40-toc-authoring-guide.md` | default taxonomy, additional taxonomy, TOC visibility, heading 경계 | reflected |
|
|
17
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/guides/50-content-block-guide.md` | Content는 Block Collection이며 BlockFlow는 별도 authoring 책임 | reflected |
|
|
18
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/guides/52-table-authoring-guide.md` | table schemaRef, 고정 컬럼 header, caption numbering 정책 | reflected |
|
|
19
|
+
| 프로젝트 논의 및 승인 결정 | discussion | `agent/guides/53-diagram-figure-authoring-guide.md` | draw.io, SVG, Mermaid, PlantUML, LLM prompt source와 rendered artifact 분리 | reflected |
|
|
20
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/AGENTS.md` | execution rule | `agent/instructions/20-task-procedures.md`, `agent/instructions/30-must-and-must-not.md` | output 순수성, Stage 실행과 seed/model 개선 분리, report 분리 | reflected |
|
|
21
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/control/LLM_WORKING_RULES.md` | LLM rule | `agent/instructions/00-runtime-behavior.md`, `agent/instructions/30-must-and-must-not.md`, `agent/validation/document-validation-rules.md` | 참조 우선순위, 금지사항, 오류 처리, 근거 없는 확정 금지 | reflected |
|
|
22
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/control/EXECUTION_PROJECT_POLICY.md` | execution policy | `agent/instructions/30-must-and-must-not.md`, `agent/validation/document-validation-rules.md` | 공식 output과 보고서 분리, 구조 파일 보호, 기준 결함의 report 분리 | reflected |
|
|
23
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/_structured_docs/control/AGENT_GUIDE.md` | structured docs guide | `agent/guides/30-authoring-policy-guide.md`, `agent/guides/53-diagram-figure-authoring-guide.md` | data 작성과 rendering 분리, renderer output 직접 수정 금지 | reflected |
|
|
24
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/_structured_docs/control/SPEC.md` | structured docs spec | `agent/guides/30-authoring-policy-guide.md`, `agent/guides/53-diagram-figure-authoring-guide.md` | source data, render binding, generated output 책임 분리 | reflected |
|
|
25
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/artifact-standards/**/02-artifact-format*.md` | artifact format | `agent/guides/52-table-authoring-guide.md`, `agent/validation/document-validation-rules.md` | format은 공식 output 구조 기준이며 example보다 우선한다는 원칙 | reflected |
|
|
26
|
+
| `/Users/a07468/Downloads/IMPORTANT/nova-pty-party-mgmt-sdd_codex/artifact-standards/**/03-authoring-guide.md` | authoring guide | `agent/guides/51-paragraph-authoring-guide.md`, `agent/guides/52-table-authoring-guide.md`, `agent/validation/document-validation-rules.md` | 작성 순서, 사람 검토 판단 지점, 품질 점검 기준 | reflected |
|
|
27
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/control/rules/writing-rules.md` | writing rule | `agent/guides/70-korean-writing-style-guide.md`, `agent/guides/51-paragraph-authoring-guide.md` | 공적 문체, 메시지, 문단 전개, 용어 일관성, 금지 표현 | reflected |
|
|
28
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/control/rules/content-authoring-rules.md` | content rule | `agent/guides/40-toc-authoring-guide.md`, `agent/guides/50-content-block-guide.md`, `agent/guides/51-paragraph-authoring-guide.md` | 문서 성격, 목차와 본문 책임, block type별 작성 기준 | reflected |
|
|
29
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/control/rules/table-rules.md` | table rule | `agent/guides/52-table-authoring-guide.md` | 표 목적, 유형, caption, 행/열 수준, 셀 작성, 긴 셀 처리 | reflected |
|
|
30
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/control/rules/diagram-rules.md` | diagram rule | `agent/guides/53-diagram-figure-authoring-guide.md` | 도해 역할, 형식 선택, 원천/렌더링 파일 관리, 검토 기준 | reflected |
|
|
31
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/model/guides/toc-authoring.md` | TOC guide | `agent/guides/40-toc-authoring-guide.md` | 계층별 책임, 제목 작성 기준, 제목 번호 직접 작성 금지 | reflected |
|
|
32
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/model/guides/table-authoring.md` | table guide | `agent/guides/52-table-authoring-guide.md` | 표 작성 절차, 유형별 권장 열, 과밀 표 분리 기준 | reflected |
|
|
33
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/model/guides/paragraph-flow-authoring.md` | paragraph guide | `agent/guides/51-paragraph-authoring-guide.md` | 정의, 필요성, 기준, 예시, 적용, 검증 흐름 | reflected |
|
|
34
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/presentation/dist/markdown/toc.md` | actual output | `agent/guides/40-toc-authoring-guide.md`, `agent/examples/document-quality-examples.md` | Part/Chapter/Section/Subsection 목차 실제 구조 사례 | reflected |
|
|
35
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/presentation/dist/markdown/chapters/chapter-01-document-overview-and-common-standards.md` | actual output | `agent/guides/51-paragraph-authoring-guide.md`, `agent/guides/52-table-authoring-guide.md`, `agent/examples/document-quality-examples.md` | quote, 해설 문단, 표, 후행 해석 연결 사례 | reflected |
|
|
36
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/references/existing-project/presentation-dist-markdown/chapters/chapter-05-module-and-internal-structure.md` | actual output | `agent/guides/40-toc-authoring-guide.md`, `agent/guides/52-table-authoring-guide.md`, `agent/examples/document-quality-examples.md` | 실제 목차, 표 caption, 역할/책임 구분 사례와 한계 | reflected |
|
|
37
|
+
| `/Users/a07468/Downloads/backend-application-architecture-specification-compact/references/existing-project/presentation-dist-markdown/chapters/chapter-31-change-history-and-version-management.md` | actual output | `agent/guides/30-authoring-policy-guide.md`, `agent/validation/document-validation-rules.md`, `agent/examples/document-quality-examples.md` | 변경 이력, 버전, 변경 사유, 검증 항목 적용 사례 | reflected |
|
|
38
|
+
|
|
39
|
+
## 제외 또는 변형 반영
|
|
40
|
+
|
|
41
|
+
| Source 내용 | 처리 | 사유 |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| SDD Stage별 특정 산출물 본문 | excluded | `agentic-domain-document`는 특정 SDD Stage artifact 작성 패키지가 아니다. |
|
|
44
|
+
| `_structured_docs` model package 전체 계약 | transformed | Document는 source/content/block을 관리하고 renderer/model package 전체를 소유하지 않는다. |
|
|
45
|
+
| 백엔드 아키텍처 명세서 특화 용어 | transformed | 문체, 구조, 표/도해 원칙은 일반화하고 도메인 용어는 예시로만 사용한다. |
|
|
46
|
+
| BlockFlow 모델 | transformed | 현재 Document 1차 모델은 Content를 Block Collection으로 보며, 작성 흐름 계획은 Authoring/Methodology 후보로 분리한다. |
|
|
47
|
+
|
|
48
|
+
## 관리 기준
|
|
49
|
+
|
|
50
|
+
- 지시문을 추가하거나 수정할 때 주요 규칙의 source를 이 문서에 남긴다.
|
|
51
|
+
- 참조 프로젝트의 문장을 그대로 복제하지 않고, Document 도메인 책임에 맞게 재작성한다.
|
|
52
|
+
- 특정 프로젝트의 물리명, 시스템명, 조직명, 민감 정보를 일반 예시로 사용하지 않는다.
|
|
53
|
+
- source mapping이 없는 새 강한 규칙은 사용자 승인 결정 또는 별도 source를 남긴다.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Document 검증 체크리스트
|
|
2
|
+
|
|
3
|
+
Document 검증은 문서가 구조적으로 유효한지, 본문이 독자에게 전달 가능한지, block payload가 schema와 작성 기준을 만족하는지 확인한다.
|
|
4
|
+
|
|
5
|
+
## 1. Document 수준 검증
|
|
6
|
+
|
|
7
|
+
| 검증 항목 | 통과 기준 |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| 목적 | 문서 목적, 주요 독자, 사용 맥락이 명확하다. |
|
|
10
|
+
| 범위 | 포함 범위와 제외 범위가 구분된다. |
|
|
11
|
+
| 상태 | Draft, In Review, Published, Archived 상태 전환 기준을 따른다. |
|
|
12
|
+
| 작성자 | Document, Revision, Annotation의 작성자 또는 기록 주체가 남는다. |
|
|
13
|
+
| 변경 사유 | In Review 이후 변경에는 변경 사유가 기록된다. |
|
|
14
|
+
| output 순수성 | 최종 본문에 prompt, LLM 지시문, 작업 과정 설명이 섞이지 않는다. |
|
|
15
|
+
|
|
16
|
+
## 2. TOC 검증
|
|
17
|
+
|
|
18
|
+
| 검증 항목 | 통과 기준 |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| taxonomy | 문서가 사용하는 taxonomy와 node level이 일치한다. |
|
|
21
|
+
| level limit | 기본 문서는 Chapter, Section, Subsection 3단계를 따른다. |
|
|
22
|
+
| 추가 taxonomy | Part, Chapter, Section, Subsection 4단계 문서는 별도 taxonomy를 명시한다. |
|
|
23
|
+
| visibility | 상위가 목차에서 제외되면 하위도 목차 번호 계산에서 제외된다. |
|
|
24
|
+
| 제목 | 제목은 책임 대상과 판단 축을 명사구로 표현한다. |
|
|
25
|
+
| numbering | 번호는 저장값이 아니라 renderer 계산값으로 취급한다. |
|
|
26
|
+
|
|
27
|
+
## 3. Content와 Block 검증
|
|
28
|
+
|
|
29
|
+
| 검증 항목 | 통과 기준 |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| 연결 | Content가 올바른 Document 또는 TOC Node에 연결된다. |
|
|
32
|
+
| 순서 | Block sort order가 독자의 판단 흐름에 맞는다. |
|
|
33
|
+
| 타입 | Block Type별 payload schema를 따른다. |
|
|
34
|
+
| caption | table, diagram, figure caption은 번호 없는 의미 제목이다. |
|
|
35
|
+
| schemaRef | 표준 서식이 필요한 table은 schemaRef를 가진다. |
|
|
36
|
+
| source/render 분리 | diagram, figure는 원천과 렌더링 결과를 구분한다. |
|
|
37
|
+
| Markdown import | `표 N. 제목 - 요약`과 `그림 N. 제목 - 요약` caption이 table/figure block에 결합되어 있고 중복 paragraph로 남지 않는다. |
|
|
38
|
+
|
|
39
|
+
## 4. 문체와 용어 검증
|
|
40
|
+
|
|
41
|
+
| 검증 항목 | 통과 기준 |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| 문체 | 공적이고 전문적인 한국어 문체를 유지한다. |
|
|
44
|
+
| 용어 | 같은 개념은 같은 대표 용어로 쓴다. |
|
|
45
|
+
| 영문 병기 | 필요한 경우 처음 등장할 때만 병기한다. |
|
|
46
|
+
| 외래어 | 대체 가능한 외래어는 한글 표현을 우선 검토한다. |
|
|
47
|
+
| 금지 표현 | 수동태, 사역형, 번역체, 모호한 표현, 내부 작업 표현을 줄인다. |
|
|
48
|
+
|
|
49
|
+
## 5. 표와 도해 검증
|
|
50
|
+
|
|
51
|
+
| 검증 항목 | 통과 기준 |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| 표 목적 | 표 앞에 판단 목적과 읽는 기준이 있다. |
|
|
54
|
+
| 표 유형 | 표 유형이 하나로 정해져 있다. |
|
|
55
|
+
| 행과 열 | 열은 배타적인 판단 축이고 행은 같은 추상화 수준이다. |
|
|
56
|
+
| 셀 | 한 셀에 둘 이상의 판단이 섞이지 않는다. |
|
|
57
|
+
| 도해 목적 | 도해가 구조, 관계, 경계, 흐름, 품질 게이트 중 하나를 설명한다. |
|
|
58
|
+
| 도해 source | sourceText, sourceFile, sourcePrompt 중 필요한 원천이 존재한다. |
|
|
59
|
+
| 후행 해석 | 표와 도해 뒤에 판단 결과나 적용 의미가 설명된다. |
|
|
60
|
+
|
|
61
|
+
## 6. Revision과 Annotation 검증
|
|
62
|
+
|
|
63
|
+
| 검증 항목 | 통과 기준 |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| Draft | 자유 수정 가능하되 본문과 note를 분리한다. |
|
|
66
|
+
| In Review | 수정 이벤트, 변경 사유, 작성자, 변경 일시가 남는다. |
|
|
67
|
+
| Published | 직접 수정하지 않고 새 draft version으로 복제한다. |
|
|
68
|
+
| Annotation | 내부 검토 메모와 note는 본문 block과 분리된다. |
|
|
69
|
+
| Diff | 버전별 렌더링 결과 비교는 별도 기능으로 처리할 수 있다. |
|
|
70
|
+
|
|
71
|
+
## 7. Source Mapping 검증
|
|
72
|
+
|
|
73
|
+
Agent 지시문이나 예시를 보강할 때는 주요 규칙의 출처를 `agent/sources/reference-mapping.md`에 남긴다. 참조 프로젝트의 특정 도메인 내용을 일반 Document 규칙으로 고정하지 않았는지 함께 확인한다.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AgentContextAssembly, type AgentResourceBundle, type AgentResourceIndex, type AgentResourceSelection, type AgentResourceSelectionRule, type AgentResourceItem } from "agentic-capability-agent-client";
|
|
2
|
+
export declare const documentAgentContribution: import("agentic-capability-agent-client").AgentContribution;
|
|
3
|
+
export declare const agentContribution: import("agentic-capability-agent-client").AgentContribution;
|
|
4
|
+
export declare const documentAgentManifest: import("agentic-capability-agent-client").AgentManifest;
|
|
5
|
+
export declare const documentResourceIndex: AgentResourceIndex;
|
|
6
|
+
export declare const documentResourceSelection: AgentResourceSelection;
|
|
7
|
+
export declare const documentInstructionResources: readonly AgentResourceItem[];
|
|
8
|
+
export declare const documentGuideResources: readonly AgentResourceItem[];
|
|
9
|
+
export declare const documentExampleResources: readonly AgentResourceItem[];
|
|
10
|
+
export declare const documentValidationRuleResources: readonly AgentResourceItem[];
|
|
11
|
+
export declare const documentSourceResources: readonly AgentResourceItem[];
|
|
12
|
+
export declare const documentResourceSelectionRules: readonly AgentResourceSelectionRule[];
|
|
13
|
+
export declare function selectDocumentAgentResources(requestText: string): AgentResourceBundle;
|
|
14
|
+
export declare function assembleDocumentAgentContext(requestText: string): AgentContextAssembly;
|
|
15
|
+
//# sourceMappingURL=document-agent-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-agent-contribution.d.ts","sourceRoot":"","sources":["../../src/agent/document-agent-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AAoBzC,eAAO,MAAM,yBAAyB,6DAEpC,CAAC;AACH,eAAO,MAAM,iBAAiB,6DAA4B,CAAC;AAE3D,eAAO,MAAM,qBAAqB,yDAAqC,CAAC;AACxE,eAAO,MAAM,qBAAqB,oBAAgE,CAAC;AACnG,eAAO,MAAM,yBAAyB,wBAAwE,CAAC;AAC/G,eAAO,MAAM,4BAA4B,EAAE,SAAS,iBAAiB,EAAuC,CAAC;AAC7G,eAAO,MAAM,sBAAsB,EAAE,SAAS,iBAAiB,EAAuC,CAAC;AACvG,eAAO,MAAM,wBAAwB,EAAE,SAAS,iBAAiB,EAAyC,CAAC;AAC3G,eAAO,MAAM,+BAA+B,EAAE,SAAS,iBAAiB,EAAgD,CAAC;AACzH,eAAO,MAAM,uBAAuB,EAAE,SAAS,iBAAiB,EAAwC,CAAC;AACzG,eAAO,MAAM,8BAA8B,EAAE,SAAS,0BAA0B,EAAoC,CAAC;AAErH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAIrF;AAED,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,CAItF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { assembleAgentContextFromBundle, loadAgentContributionFromDirectory, selectAgentResources } from "agentic-capability-agent-client";
|
|
3
|
+
const packageRoot = fileURLToPath(new URL("../../", import.meta.url));
|
|
4
|
+
function requireResourceIndex(resourceIndex) {
|
|
5
|
+
if (resourceIndex === undefined) {
|
|
6
|
+
throw new Error("Document agent resource index was not loaded.");
|
|
7
|
+
}
|
|
8
|
+
return resourceIndex;
|
|
9
|
+
}
|
|
10
|
+
function requireResourceSelection(resourceSelection) {
|
|
11
|
+
if (resourceSelection === undefined) {
|
|
12
|
+
throw new Error("Document agent resource selection was not loaded.");
|
|
13
|
+
}
|
|
14
|
+
return resourceSelection;
|
|
15
|
+
}
|
|
16
|
+
export const documentAgentContribution = loadAgentContributionFromDirectory(packageRoot, {
|
|
17
|
+
validate: true
|
|
18
|
+
});
|
|
19
|
+
export const agentContribution = documentAgentContribution;
|
|
20
|
+
export const documentAgentManifest = documentAgentContribution.manifest;
|
|
21
|
+
export const documentResourceIndex = requireResourceIndex(documentAgentContribution.resourceIndex);
|
|
22
|
+
export const documentResourceSelection = requireResourceSelection(documentAgentContribution.resourceSelection);
|
|
23
|
+
export const documentInstructionResources = documentResourceIndex.instructions;
|
|
24
|
+
export const documentGuideResources = documentResourceIndex.guides ?? [];
|
|
25
|
+
export const documentExampleResources = documentResourceIndex.examples ?? [];
|
|
26
|
+
export const documentValidationRuleResources = documentResourceIndex.validationRules ?? [];
|
|
27
|
+
export const documentSourceResources = documentResourceIndex.sources ?? [];
|
|
28
|
+
export const documentResourceSelectionRules = documentResourceSelection.rules;
|
|
29
|
+
export function selectDocumentAgentResources(requestText) {
|
|
30
|
+
return selectAgentResources(documentAgentContribution, {
|
|
31
|
+
requestText
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export function assembleDocumentAgentContext(requestText) {
|
|
35
|
+
return assembleAgentContextFromBundle(selectDocumentAgentResources(requestText), {
|
|
36
|
+
packageRoot
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=document-agent-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-agent-contribution.js","sourceRoot":"","sources":["../../src/agent/document-agent-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,EAClC,oBAAoB,EAOrB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtE,SAAS,oBAAoB,CAAC,aAA6C;IACzE,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,wBAAwB,CAAC,iBAAqD;IACrF,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,kCAAkC,CAAC,WAAW,EAAE;IACvF,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC,QAAQ,CAAC;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC;AACnG,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,CAAC;AAC/G,MAAM,CAAC,MAAM,4BAA4B,GAAiC,qBAAqB,CAAC,YAAY,CAAC;AAC7G,MAAM,CAAC,MAAM,sBAAsB,GAAiC,qBAAqB,CAAC,MAAM,IAAI,EAAE,CAAC;AACvG,MAAM,CAAC,MAAM,wBAAwB,GAAiC,qBAAqB,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC3G,MAAM,CAAC,MAAM,+BAA+B,GAAiC,qBAAqB,CAAC,eAAe,IAAI,EAAE,CAAC;AACzH,MAAM,CAAC,MAAM,uBAAuB,GAAiC,qBAAqB,CAAC,OAAO,IAAI,EAAE,CAAC;AACzG,MAAM,CAAC,MAAM,8BAA8B,GAA0C,yBAAyB,CAAC,KAAK,CAAC;AAErH,MAAM,UAAU,4BAA4B,CAAC,WAAmB;IAC9D,OAAO,oBAAoB,CAAC,yBAAyB,EAAE;QACrD,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,WAAmB;IAC9D,OAAO,8BAA8B,CAAC,4BAA4B,CAAC,WAAW,CAAC,EAAE;QAC/E,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { agentContribution, assembleDocumentAgentContext, documentAgentContribution, documentAgentManifest, documentExampleResources, documentGuideResources, documentInstructionResources, documentResourceIndex, documentResourceSelection, documentResourceSelectionRules, documentSourceResources, documentValidationRuleResources, selectDocumentAgentResources } from "./document-agent-contribution.js";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { agentContribution, assembleDocumentAgentContext, documentAgentContribution, documentAgentManifest, documentExampleResources, documentGuideResources, documentInstructionResources, documentResourceIndex, documentResourceSelection, documentResourceSelectionRules, documentSourceResources, documentValidationRuleResources, selectDocumentAgentResources } from "./document-agent-contribution.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import type { DocumentDatabaseInitResult, DocumentDatabaseOptions } from "./types.js";
|
|
3
|
+
export declare function resolveDocumentDatabasePath(options?: DocumentDatabaseOptions): string;
|
|
4
|
+
export declare function listDocumentTables(db: Database.Database): string[];
|
|
5
|
+
export declare function applyDocumentBaseMigration(db: Database.Database): void;
|
|
6
|
+
export declare function openDocumentDatabase(options?: DocumentDatabaseOptions): Database.Database;
|
|
7
|
+
export declare function initializeDocumentDatabase(options?: DocumentDatabaseOptions): DocumentDatabaseInitResult;
|
|
8
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAGtC,OAAO,KAAK,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAuBtF,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,uBAA4B,GAAG,MAAM,CAiBzF;AAOD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,MAAM,EAAE,CAYlE;AAED,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAEtE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,uBAA4B,GAAG,QAAQ,CAAC,QAAQ,CAkB7F;AAED,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,uBAA4B,GAAG,0BAA0B,CAc5G"}
|
package/dist/database.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import Database from "better-sqlite3";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, isAbsolute, join } from "node:path";
|
|
4
|
+
const DEFAULT_DATABASE_PATH = ".agentic/platform.sqlite";
|
|
5
|
+
function readProjectConfig(projectRoot) {
|
|
6
|
+
const configPath = join(projectRoot, "agentic.config.json");
|
|
7
|
+
if (!existsSync(configPath)) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
return JSON.parse(readFileSync(configPath, "utf8"));
|
|
11
|
+
}
|
|
12
|
+
export function resolveDocumentDatabasePath(options = {}) {
|
|
13
|
+
if (options.databasePath !== undefined) {
|
|
14
|
+
return isAbsolute(options.databasePath)
|
|
15
|
+
? options.databasePath
|
|
16
|
+
: join(options.projectRoot ?? process.cwd(), options.databasePath);
|
|
17
|
+
}
|
|
18
|
+
const projectRoot = options.projectRoot ?? process.cwd();
|
|
19
|
+
const config = readProjectConfig(projectRoot);
|
|
20
|
+
const database = config.runtime?.database;
|
|
21
|
+
if (database?.type !== undefined && database.type !== "sqlite") {
|
|
22
|
+
throw new Error(`Unsupported document database type: ${database.type}`);
|
|
23
|
+
}
|
|
24
|
+
const configuredPath = database?.path ?? DEFAULT_DATABASE_PATH;
|
|
25
|
+
return isAbsolute(configuredPath) ? configuredPath : join(projectRoot, configuredPath);
|
|
26
|
+
}
|
|
27
|
+
function readDocumentBaseMigration() {
|
|
28
|
+
const migrationUrl = new URL("../src/database/migrations/0001_document_base.sql", import.meta.url);
|
|
29
|
+
return readFileSync(migrationUrl, "utf8");
|
|
30
|
+
}
|
|
31
|
+
export function listDocumentTables(db) {
|
|
32
|
+
const rows = db
|
|
33
|
+
.prepare(`SELECT name
|
|
34
|
+
FROM sqlite_master
|
|
35
|
+
WHERE type = 'table'
|
|
36
|
+
AND name LIKE 'document_%'
|
|
37
|
+
ORDER BY name`)
|
|
38
|
+
.all();
|
|
39
|
+
return rows.map((row) => row.name);
|
|
40
|
+
}
|
|
41
|
+
export function applyDocumentBaseMigration(db) {
|
|
42
|
+
db.exec(readDocumentBaseMigration());
|
|
43
|
+
}
|
|
44
|
+
export function openDocumentDatabase(options = {}) {
|
|
45
|
+
const databasePath = resolveDocumentDatabasePath(options);
|
|
46
|
+
mkdirSync(dirname(databasePath), { recursive: true });
|
|
47
|
+
const db = new Database(databasePath);
|
|
48
|
+
try {
|
|
49
|
+
db.pragma("journal_mode = WAL");
|
|
50
|
+
db.pragma("foreign_keys = ON");
|
|
51
|
+
if (options.applyMigration !== false) {
|
|
52
|
+
applyDocumentBaseMigration(db);
|
|
53
|
+
}
|
|
54
|
+
return db;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
db.close();
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export function initializeDocumentDatabase(options = {}) {
|
|
62
|
+
const databasePath = resolveDocumentDatabasePath(options);
|
|
63
|
+
const created = !existsSync(databasePath);
|
|
64
|
+
const db = openDocumentDatabase(options);
|
|
65
|
+
try {
|
|
66
|
+
return {
|
|
67
|
+
databasePath,
|
|
68
|
+
created,
|
|
69
|
+
tables: listDocumentTables(db)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
db.close();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const agenticDomainDocumentPackage: {
|
|
2
|
+
readonly name: "agentic-domain-document";
|
|
3
|
+
readonly layer: "domain";
|
|
4
|
+
readonly logicalSchema: "document";
|
|
5
|
+
readonly sqliteTablePrefix: "document_";
|
|
6
|
+
};
|
|
7
|
+
export { applyDocumentBaseMigration, initializeDocumentDatabase, listDocumentTables, openDocumentDatabase, resolveDocumentDatabasePath } from "./database.js";
|
|
8
|
+
export { createDocumentMarkdownImporter, DocumentMarkdownImporter } from "./markdown-importer.js";
|
|
9
|
+
export { DocumentRepository } from "./repositories.js";
|
|
10
|
+
export { createDocumentReader, DocumentReader } from "./reader.js";
|
|
11
|
+
export { createDocumentService, DocumentService } from "./service.js";
|
|
12
|
+
export { validateDocument } from "./validators.js";
|
|
13
|
+
export { agentContribution, assembleDocumentAgentContext, documentAgentContribution, documentAgentManifest, documentExampleResources, documentGuideResources, documentInstructionResources, documentResourceIndex, documentResourceSelection, documentResourceSelectionRules, documentSourceResources, documentValidationRuleResources, selectDocumentAgentResources } from "./agent/index.js";
|
|
14
|
+
export type { AddBlockInput, AnnotationStatus, CreateAnnotationInput, CreateDocumentInput, CreateDraftInput, CreateNodeInput, DocumentActor, DocumentActorType, DocumentAggregate, DocumentAnnotationRecord, DocumentBlockRecord, DocumentBlockSearchQuery, DocumentBlockSearchResult, DocumentBlockType, DocumentChangeType, DocumentContentRecord, DocumentDatabaseInitResult, DocumentDatabaseOptions, DocumentImportResult, DocumentMarkdownImporterOptions, DocumentMarkdownProjectionOptions, DocumentNodeRecord, DocumentQuery, DocumentReaderOptions, DocumentRecord, DocumentRevisionRecord, DocumentServiceOptions, DocumentSnapshotType, DocumentStatus, DocumentTargetType, DocumentTreeNode, DocumentTocNode, DocumentVersionRecord, ImportMarkdownChapterInput, ImportMarkdownDocumentInput, MarkdownImportPolicy, TocVisibility, TransitionInput, UpdateBlockInput, ValidationIssue, ValidationResult } from "./types.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;;;CAK/B,CAAC;AAEX,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,+BAA+B,EAC/B,iCAAiC,EACjC,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const agenticDomainDocumentPackage = {
|
|
2
|
+
name: "agentic-domain-document",
|
|
3
|
+
layer: "domain",
|
|
4
|
+
logicalSchema: "document",
|
|
5
|
+
sqliteTablePrefix: "document_"
|
|
6
|
+
};
|
|
7
|
+
export { applyDocumentBaseMigration, initializeDocumentDatabase, listDocumentTables, openDocumentDatabase, resolveDocumentDatabasePath } from "./database.js";
|
|
8
|
+
export { createDocumentMarkdownImporter, DocumentMarkdownImporter } from "./markdown-importer.js";
|
|
9
|
+
export { DocumentRepository } from "./repositories.js";
|
|
10
|
+
export { createDocumentReader, DocumentReader } from "./reader.js";
|
|
11
|
+
export { createDocumentService, DocumentService } from "./service.js";
|
|
12
|
+
export { validateDocument } from "./validators.js";
|
|
13
|
+
export { agentContribution, assembleDocumentAgentContext, documentAgentContribution, documentAgentManifest, documentExampleResources, documentGuideResources, documentInstructionResources, documentResourceIndex, documentResourceSelection, documentResourceSelectionRules, documentSourceResources, documentValidationRuleResources, selectDocumentAgentResources } from "./agent/index.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,yBAAyB;IAC/B,KAAK,EAAE,QAAQ;IACf,aAAa,EAAE,UAAU;IACzB,iBAAiB,EAAE,WAAW;CACtB,CAAC;AAEX,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,EACvB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DocumentImportResult, DocumentMarkdownImporterOptions, ImportMarkdownChapterInput, ImportMarkdownDocumentInput } from "./types.js";
|
|
2
|
+
export declare class DocumentMarkdownImporter {
|
|
3
|
+
private readonly ownsDatabase;
|
|
4
|
+
private readonly db;
|
|
5
|
+
constructor(options?: DocumentMarkdownImporterOptions);
|
|
6
|
+
close(): void;
|
|
7
|
+
importMarkdownDocument(input: ImportMarkdownDocumentInput): DocumentImportResult;
|
|
8
|
+
importMarkdownChapter(input: ImportMarkdownChapterInput): DocumentImportResult;
|
|
9
|
+
private importItems;
|
|
10
|
+
private importHeading;
|
|
11
|
+
private importBlock;
|
|
12
|
+
}
|
|
13
|
+
export declare function createDocumentMarkdownImporter(options?: DocumentMarkdownImporterOptions): DocumentMarkdownImporter;
|
|
14
|
+
//# sourceMappingURL=markdown-importer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-importer.d.ts","sourceRoot":"","sources":["../src/markdown-importer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,oBAAoB,EACpB,+BAA+B,EAG/B,0BAA0B,EAC1B,2BAA2B,EAG5B,MAAM,YAAY,CAAC;AAiVpB,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;gBAE3B,OAAO,GAAE,+BAAoC;IAKzD,KAAK,IAAI,IAAI;IAMb,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,oBAAoB;IAsBhF,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,oBAAoB;IAsB9E,OAAO,CAAC,WAAW;IAmCnB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,WAAW;CA2BpB;AAED,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,+BAAoC,GAAG,wBAAwB,CAEtH"}
|