open-livex-wiki 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/coverage.d.ts +1 -0
- package/dist/commands/coverage.d.ts.map +1 -1
- package/dist/commands/coverage.js +5 -1
- package/dist/commands/coverage.js.map +1 -1
- package/dist/commands/discover.d.ts +2 -0
- package/dist/commands/discover.d.ts.map +1 -1
- package/dist/commands/discover.js +7 -0
- package/dist/commands/discover.js.map +1 -1
- package/dist/commands/ingest-docs/documents.d.ts +25 -0
- package/dist/commands/ingest-docs/documents.d.ts.map +1 -0
- package/dist/commands/ingest-docs/documents.js +183 -0
- package/dist/commands/ingest-docs/documents.js.map +1 -0
- package/dist/commands/ingest-docs/manifest.d.ts +41 -0
- package/dist/commands/ingest-docs/manifest.d.ts.map +1 -0
- package/dist/commands/ingest-docs/manifest.js +143 -0
- package/dist/commands/ingest-docs/manifest.js.map +1 -0
- package/dist/commands/ingest-docs.d.ts +6 -37
- package/dist/commands/ingest-docs.d.ts.map +1 -1
- package/dist/commands/ingest-docs.js +81 -312
- package/dist/commands/ingest-docs.js.map +1 -1
- package/dist/commands/init/skill-templates.d.ts +2 -0
- package/dist/commands/init/skill-templates.d.ts.map +1 -0
- package/dist/commands/init/skill-templates.js +266 -0
- package/dist/commands/init/skill-templates.js.map +1 -0
- package/dist/commands/init/templates.d.ts +7 -0
- package/dist/commands/init/templates.d.ts.map +1 -0
- package/dist/commands/init/templates.js +268 -0
- package/dist/commands/init/templates.js.map +1 -0
- package/dist/commands/init/workflow-templates.d.ts +2 -0
- package/dist/commands/init/workflow-templates.d.ts.map +1 -0
- package/dist/commands/init/workflow-templates.js +273 -0
- package/dist/commands/init/workflow-templates.js.map +1 -0
- package/dist/commands/init.d.ts +1 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -791
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/schema.js +2 -2
- package/dist/commands/schema.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/templates/starter-bundle.json +3 -3
- package/dist/templates/wiki-starter/.agents/skills/wiki-bootstrap/SKILL.md +15 -14
- package/dist/templates/wiki-starter/.agents/skills/wiki-consume/SKILL.md +2 -2
- package/dist/templates/wiki-starter/AGENTS.md +3 -3
- package/package.json +5 -5
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { serializeWikiConfigYaml } from "../../repo-utils.js";
|
|
2
|
+
import { buildSkillTemplates } from "./skill-templates.js";
|
|
3
|
+
import { buildWorkflowTemplates } from "./workflow-templates.js";
|
|
4
|
+
export function buildBuiltinStarterFiles(wikiName, options = {}) {
|
|
5
|
+
const bare = Boolean(options.bare);
|
|
6
|
+
const defaultStarterRepos = [
|
|
7
|
+
{
|
|
8
|
+
repo: "example/core-service",
|
|
9
|
+
gitUrl: "https://example.com/example/core-service.git",
|
|
10
|
+
branch: "main",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
repo: "example/shared-sdk",
|
|
14
|
+
gitUrl: "https://example.com/example/shared-sdk.git",
|
|
15
|
+
branch: "main",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
const configuredRepos = options.repositories ?? (bare ? [] : defaultStarterRepos);
|
|
19
|
+
const baseFiles = {
|
|
20
|
+
"wiki.config.yaml": serializeWikiConfigYaml({
|
|
21
|
+
version: 1,
|
|
22
|
+
name: wikiName,
|
|
23
|
+
description: "Git-native, OKF-compatible Agent Knowledge Base",
|
|
24
|
+
domainsDir: "domains",
|
|
25
|
+
infrastructureDomains: ["business-infrastructure"],
|
|
26
|
+
repositories: configuredRepos,
|
|
27
|
+
governance: {
|
|
28
|
+
autoMergeMinConfidence: 0.9,
|
|
29
|
+
requireZeroPendingForAutoMerge: true,
|
|
30
|
+
protectedSchemas: ["domain-index/v1", "infrastructure-index/v1"],
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
"AGENTS.md": [
|
|
34
|
+
`# ${wikiName} — Agent Knowledge Base Entry Contract`,
|
|
35
|
+
"",
|
|
36
|
+
"> **Consumption sessions against this wiki repository are strictly read-only.**",
|
|
37
|
+
"",
|
|
38
|
+
"## 5-Step Progressive Consumption Protocol",
|
|
39
|
+
"",
|
|
40
|
+
"1. **Discover Domains**: Start with `olw discover` (or MCP `discover_domains`) using short 1–3 keyword queries (never full sentences).",
|
|
41
|
+
"2. **Select Scene (or Stop Early on Catalog Questions)**: Expand candidate domain(s) via `discover_scenes`. If answering a high-level catalog/overview question, summarize from `discover_domains` + `discover_scenes` directly without bulk-reading every scene. Otherwise call `read_domain` and `read_scene` (or batch `read_scenes`) ONLY on the 1–3 relevant scenes.",
|
|
42
|
+
"3. **Select Core Chain**: Focus on the relevant `###` chain(s) under Section 3 (`Chain Details` / `链路详解`).",
|
|
43
|
+
"4. **Expand Direct Dependencies**: Run `olw relations <domain>/<scene> --direction deps --depth 1` (or MCP `get_relations`) while maintaining a `visited` set.",
|
|
44
|
+
"5. **Verify Against Live Sources**: Verify assertions against the reported `localPath` source repository checkouts and output `Assertion -> Live Evidence -> Verdict`.",
|
|
45
|
+
"",
|
|
46
|
+
"## Hard Stop Rules",
|
|
47
|
+
"",
|
|
48
|
+
"- Stop expanding once evidence is sufficient.",
|
|
49
|
+
"- Stop on cycle/duplicate or miss and report the knowledge gap.",
|
|
50
|
+
"- **NEVER** treat items under `4. Pending Confirmations` (`待确认项`) as verified facts.",
|
|
51
|
+
'- **NEVER** infer "no impact" when a source repository is unreachable or an anchor is broken.',
|
|
52
|
+
"",
|
|
53
|
+
"## Maintenance & Governance",
|
|
54
|
+
"",
|
|
55
|
+
"See `MAINTENANCE.md`, `olw schema`, and `.agents/skills/` (`wiki-consume`, `wiki-bootstrap`, `wiki-incremental-update`, `wiki-full-review`).",
|
|
56
|
+
"",
|
|
57
|
+
].join("\n"),
|
|
58
|
+
"MAINTENANCE.md": [
|
|
59
|
+
"# MAINTENANCE.md — Knowledge Lifecycle, Production Rubric & Git Governance",
|
|
60
|
+
"",
|
|
61
|
+
"This document defines how knowledge in this wiki is **produced**, **updated**, **reviewed**, and **released** via Git and CI.",
|
|
62
|
+
"",
|
|
63
|
+
"## 1. Authoring Quick Commands",
|
|
64
|
+
"",
|
|
65
|
+
"- Empty wiki initialization: `olw init <dir> --bare --repo <localRepoDir>`",
|
|
66
|
+
'- Create domain: `olw domain new <domainId> --title "..." [--infra]`',
|
|
67
|
+
'- Create scene / shared infra: `olw scene new <domainId>/<sceneId> --title "..." --repo <localRepoDir>`',
|
|
68
|
+
"- View canonical YAML/Markdown contracts & JSON Schemas: `olw schema [domain|scene|infrastructure|wiki-config]`",
|
|
69
|
+
"- Link a business code/QA repo to this wiki: `olw link <projectDir> --wiki <wikiDir>`",
|
|
70
|
+
"",
|
|
71
|
+
"## 2. Directory & OKF Schema Contracts",
|
|
72
|
+
"",
|
|
73
|
+
"All knowledge lives under `domains/` using POSIX forward-slash IDs (`<domainId>/<sceneId>`):",
|
|
74
|
+
"",
|
|
75
|
+
"- `domains/<domainId>/index.md` — `schema: domain-index/v1`",
|
|
76
|
+
" - Required section: `Domain Identity & Boundaries` (or `域身份与边界`).",
|
|
77
|
+
"- `domains/<domainId>/<sceneId>/index.md` — `schema: scene-index/v1`",
|
|
78
|
+
" - Required 4-part structure:",
|
|
79
|
+
" 1. `1. Business Background` (`1. 业务背景`)",
|
|
80
|
+
" 2. `2. Change History` (`2. 变更历史`)",
|
|
81
|
+
" 3. `3. Chain Details` (`3. 链路详解`) — MUST include `### <Chain Name>` subheadings for each interface chain!",
|
|
82
|
+
" 4. `4. Pending Confirmations` (`4. 待确认项` — use `None` or `无` when clean)",
|
|
83
|
+
" - Confidence rubric: when `confidenceBreakdown` (`architecture`, `chain`, `config`, `experiment`) is specified, `confidence` MUST equal `min(confidenceBreakdown)`. Scenes with `confidence < 0.9` require `maintainer_review`.",
|
|
84
|
+
" - Every `repositories[]` entry MUST pin an immutable Git SHA (`commitId`, 7–40 hex chars) and high-confidence scenes should attach `anchors[]`.",
|
|
85
|
+
"- `domains/business-infrastructure/<sceneId>/index.md` — `schema: infrastructure-index/v1`",
|
|
86
|
+
" - Every scene inside any domain listed in `wiki.config.yaml` `infrastructureDomains` MUST use `schema: infrastructure-index/v1`. **Never auto-merged.**",
|
|
87
|
+
"",
|
|
88
|
+
"## 3. Cold-Start 4-Step Production Protocol (`wiki-bootstrap`)",
|
|
89
|
+
"",
|
|
90
|
+
"1. **Pin Source Commit SHAs & Runtime Environment**: Record immutable 40-char Git SHAs (`git rev-parse HEAD`), branch, and target environment before reading code.",
|
|
91
|
+
"2. **Two-Pass Cross-Terminology Search**: Pass 1 searches business terms/PRDs/routes (`aliases`); Pass 2 pivots from confirmed APIs, classes/methods, config keys, and DB tables across related repos.",
|
|
92
|
+
"3. **Forward + Reverse Tracing**: Trace L1 Entry -> L2 Orchestration -> L3 Core Module -> L4 Downstream/Config/Experiment/DB, and reverse-check callers, strategy registries, and compensation paths.",
|
|
93
|
+
"4. **Compile L1–L4 `###` Chains & Isolate Uncertainty**: Attach `anchors[]` for deterministic symbol checks and quarantine all unverified items strictly inside `4. Pending Confirmations`.",
|
|
94
|
+
"",
|
|
95
|
+
"## 4. Incremental Self-Update & Periodic Full Self-Review",
|
|
96
|
+
"",
|
|
97
|
+
"- **Incremental Self-Update** (`wiki-incremental-update`): Run `olw diff-impact --repos-dir <path> --json` (or set `OLW_REPOS_DIR`) to detect drifted `commitId` pins, broken anchors, and 1-hop dependents. Never infer zero impact when a repository is unreachable.",
|
|
98
|
+
"- **Periodic Full Self-Review** (`wiki-full-review`): Run `olw validate --strict --check-anchors --repos-dir <path> --json` and audit inside-out & outside-in.",
|
|
99
|
+
"- **`repositories[].localPath` Resolution**: Relative paths in `wiki.config.yaml` resolve from the directory containing `wiki.config.yaml` using POSIX `/` slashes; `--repos-dir <dir>` or `OLW_REPOS_DIR` acts as the fallback.",
|
|
100
|
+
"",
|
|
101
|
+
"## 5. Quality Gate & Tiered Git Governance",
|
|
102
|
+
"",
|
|
103
|
+
"Every PR runs `olw validate --strict` and `olw gate --base <base> --head <head> --strict --json` (evaluating governance thresholds from `baseRef:wiki.config.yaml`):",
|
|
104
|
+
"",
|
|
105
|
+
"- **`blocked`**: Any schema error, folder-ID mismatch, missing required section, dangling `dependsOn`, or strict warning.",
|
|
106
|
+
"- **`maintainer_review`**: Any file deletion, sibling detail/other file edit, governance config/workflow/skill/CODEOWNERS edit, `domain-index/v1` edit, `infrastructure-index/v1` edit, scene with `confidence < 0.9`, or active item in `4. Pending Confirmations`.",
|
|
107
|
+
"- **`auto_merge`**: Only `scene-index/v1` additions/updates, all touched scenes have `confidence >= 0.9`, zero unresolved pending confirmations, and all structural/graph checks pass.",
|
|
108
|
+
"",
|
|
109
|
+
].join("\n"),
|
|
110
|
+
CODEOWNERS: [
|
|
111
|
+
"# LiveX Wiki CODEOWNERS — Tiered Governance & Ownership Mapping",
|
|
112
|
+
"/AGENTS.md @wiki-maintainers",
|
|
113
|
+
"/MAINTENANCE.md @wiki-maintainers",
|
|
114
|
+
"/wiki.config.yaml @wiki-maintainers",
|
|
115
|
+
"/CODEOWNERS @wiki-maintainers",
|
|
116
|
+
"/.github/** @wiki-maintainers",
|
|
117
|
+
"/.agents/** @wiki-maintainers",
|
|
118
|
+
"/domains/*/index.md @wiki-maintainers",
|
|
119
|
+
"/domains/*/*/index.md @wiki-maintainers",
|
|
120
|
+
"/domains/business-infrastructure/** @infra-maintainers",
|
|
121
|
+
"",
|
|
122
|
+
].join("\n"),
|
|
123
|
+
...buildSkillTemplates(),
|
|
124
|
+
...buildWorkflowTemplates(),
|
|
125
|
+
};
|
|
126
|
+
if (bare) {
|
|
127
|
+
return baseFiles;
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
...baseFiles,
|
|
131
|
+
"domains/core-business/index.md": [
|
|
132
|
+
"---",
|
|
133
|
+
"schema: domain-index/v1",
|
|
134
|
+
"domainId: core-business",
|
|
135
|
+
"title: Core Business Domain",
|
|
136
|
+
"aliases:",
|
|
137
|
+
" - core-biz",
|
|
138
|
+
" - starter-domain",
|
|
139
|
+
"summary: Primary business domain containing starter workflows and scene documentation.",
|
|
140
|
+
"maintainers:",
|
|
141
|
+
" - '@wiki-maintainers'",
|
|
142
|
+
"---",
|
|
143
|
+
"",
|
|
144
|
+
"# Core Business Domain",
|
|
145
|
+
"",
|
|
146
|
+
"## Domain Identity & Boundaries",
|
|
147
|
+
"",
|
|
148
|
+
"- **In Scope**: Core end-user business workflows, onboarding scenes, and domain orchestration.",
|
|
149
|
+
"- **Out of Scope**: Cross-domain runtime SDKs and shared configuration primitives (owned by `business-infrastructure`).",
|
|
150
|
+
"",
|
|
151
|
+
].join("\n"),
|
|
152
|
+
"domains/core-business/getting-started/index.md": [
|
|
153
|
+
"---",
|
|
154
|
+
"schema: scene-index/v1",
|
|
155
|
+
"sceneId: getting-started",
|
|
156
|
+
"title: Getting Started Feature",
|
|
157
|
+
"aliases:",
|
|
158
|
+
" - sample-scene",
|
|
159
|
+
" - onboarding-flow",
|
|
160
|
+
"summary: Minimal starter business scene illustrating the 4-part OKF structure, L1-L4 interface chain, and direct shared dependency.",
|
|
161
|
+
"maintainers:",
|
|
162
|
+
" - '@wiki-maintainers'",
|
|
163
|
+
"confidence: 0.95",
|
|
164
|
+
"confidenceBreakdown:",
|
|
165
|
+
" architecture: 0.95",
|
|
166
|
+
" chain: 0.95",
|
|
167
|
+
" config: 0.95",
|
|
168
|
+
" experiment: 1.0",
|
|
169
|
+
"dependsOn:",
|
|
170
|
+
" - business-infrastructure/shared-config",
|
|
171
|
+
"repositories:",
|
|
172
|
+
" - repo: example/core-service",
|
|
173
|
+
" gitUrl: https://example.com/example/core-service.git",
|
|
174
|
+
" branch: main",
|
|
175
|
+
" commitId: 222222222222222222222222222222222222222b",
|
|
176
|
+
" paths:",
|
|
177
|
+
" - src/onboarding/",
|
|
178
|
+
"anchors:",
|
|
179
|
+
" - repo: example/core-service",
|
|
180
|
+
" file: src/onboarding/OnboardingController.ts",
|
|
181
|
+
" symbol: getOnboardingStatus",
|
|
182
|
+
" kind: function",
|
|
183
|
+
"---",
|
|
184
|
+
"",
|
|
185
|
+
"# Getting Started Feature",
|
|
186
|
+
"",
|
|
187
|
+
"## 1. Business Background",
|
|
188
|
+
"",
|
|
189
|
+
"Provides the starter business workflow demonstrating how domain scenes link to shared infrastructure.",
|
|
190
|
+
"",
|
|
191
|
+
"## 2. Change History",
|
|
192
|
+
"",
|
|
193
|
+
"| Date | Summary | Source Baseline |",
|
|
194
|
+
"| --- | --- | --- |",
|
|
195
|
+
"| 2026-01-01 | Initial starter scene scaffolded via `olw init` | `example/core-service@22222222` |",
|
|
196
|
+
"",
|
|
197
|
+
"## 3. Chain Details",
|
|
198
|
+
"",
|
|
199
|
+
"### Chain 1: Query Onboarding Status (/api/v1/onboarding/status)",
|
|
200
|
+
"",
|
|
201
|
+
"- **L1 Entry Interface**: `GET /api/v1/onboarding/status` (`src/onboarding/OnboardingController.ts#getOnboardingStatus`)",
|
|
202
|
+
"- **L2 Service Orchestration**: `OnboardingService#loadUserProgress`",
|
|
203
|
+
"- **L3 Core Module**: `StepEvaluator#computeNextStep`",
|
|
204
|
+
"- **L4 Downstream / Config / Experiment / DB**: Loads runtime flags via `business-infrastructure/shared-config`; reads `onboarding_state`.",
|
|
205
|
+
"",
|
|
206
|
+
"## 4. Pending Confirmations",
|
|
207
|
+
"",
|
|
208
|
+
"None",
|
|
209
|
+
"",
|
|
210
|
+
].join("\n"),
|
|
211
|
+
"domains/business-infrastructure/index.md": [
|
|
212
|
+
"---",
|
|
213
|
+
"schema: domain-index/v1",
|
|
214
|
+
"domainId: business-infrastructure",
|
|
215
|
+
"title: Business Infrastructure",
|
|
216
|
+
"aliases:",
|
|
217
|
+
" - shared-infra",
|
|
218
|
+
" - platform-sdk",
|
|
219
|
+
"summary: Reusable cross-domain infrastructure, SDKs, and shared runtime capabilities.",
|
|
220
|
+
"maintainers:",
|
|
221
|
+
" - '@platform-owners'",
|
|
222
|
+
"---",
|
|
223
|
+
"",
|
|
224
|
+
"# Business Infrastructure",
|
|
225
|
+
"",
|
|
226
|
+
"## Domain Identity & Boundaries",
|
|
227
|
+
"",
|
|
228
|
+
"- **In Scope**: Cross-domain SDKs, shared configuration loaders, and platform runtime components.",
|
|
229
|
+
"- **Governance**: Changes under this domain require explicit maintainer approval and are never auto-merged.",
|
|
230
|
+
"",
|
|
231
|
+
].join("\n"),
|
|
232
|
+
"domains/business-infrastructure/shared-config/index.md": [
|
|
233
|
+
"---",
|
|
234
|
+
"schema: infrastructure-index/v1",
|
|
235
|
+
"sceneId: shared-config",
|
|
236
|
+
"title: Shared Config SDK",
|
|
237
|
+
"aliases:",
|
|
238
|
+
" - config-sdk",
|
|
239
|
+
" - runtime-config",
|
|
240
|
+
"summary: Shared runtime configuration and feature-flag resolution library consumed by business scenes.",
|
|
241
|
+
"maintainers:",
|
|
242
|
+
" - '@infra-maintainers'",
|
|
243
|
+
"confidence: 0.95",
|
|
244
|
+
"dependsOn: []",
|
|
245
|
+
"repositories:",
|
|
246
|
+
" - repo: example/shared-sdk",
|
|
247
|
+
" gitUrl: https://example.com/example/shared-sdk.git",
|
|
248
|
+
" branch: main",
|
|
249
|
+
" commitId: 111111111111111111111111111111111111111a",
|
|
250
|
+
" paths:",
|
|
251
|
+
" - src/config/",
|
|
252
|
+
"---",
|
|
253
|
+
"",
|
|
254
|
+
"# Shared Config SDK",
|
|
255
|
+
"",
|
|
256
|
+
"## Integration Guide",
|
|
257
|
+
"",
|
|
258
|
+
"Business scenes resolve typed runtime feature flags and namespace defaults via `SharedConfig.getData(key, fallback)`.",
|
|
259
|
+
"",
|
|
260
|
+
"## Shared Constraints",
|
|
261
|
+
"",
|
|
262
|
+
"- All namespace keys must declare explicit fallback defaults.",
|
|
263
|
+
"- Schema updates require backward-compatible rollout across dependent scenes.",
|
|
264
|
+
"",
|
|
265
|
+
].join("\n"),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/commands/init/templates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAOjE,MAAM,UAAU,wBAAwB,CACtC,QAAgB,EAChB,UAAsC,EAAE;IAExC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,mBAAmB,GAAqB;QAC5C;YACE,IAAI,EAAE,sBAAsB;YAC5B,MAAM,EAAE,8CAA8C;YACtD,MAAM,EAAE,MAAM;SACf;QACD;YACE,IAAI,EAAE,oBAAoB;YAC1B,MAAM,EAAE,4CAA4C;YACpD,MAAM,EAAE,MAAM;SACf;KACF,CAAC;IACF,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAElF,MAAM,SAAS,GAA2B;QACxC,kBAAkB,EAAE,uBAAuB,CAAC;YAC1C,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iDAAiD;YAC9D,UAAU,EAAE,SAAS;YACrB,qBAAqB,EAAE,CAAC,yBAAyB,CAAC;YAClD,YAAY,EAAE,eAAe;YAC7B,UAAU,EAAE;gBACV,sBAAsB,EAAE,GAAG;gBAC3B,8BAA8B,EAAE,IAAI;gBACpC,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;aACjE;SACF,CAAC;QAEF,WAAW,EAAE;YACX,KAAK,QAAQ,wCAAwC;YACrD,EAAE;YACF,iFAAiF;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AAE;YACF,6BAA6B;YAC7B,EAAE;YACF,MAAM;YACN,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC;QAEZ,0CAA0C,EAAE;YAC1C,KAAK;YACL,yBAAyB;YACzB,mCAAmC;YACnC,gCAAgC;YAChC,UAAU;YACV,kBAAkB;YAClB,kBAAkB;YAClB,uFAAuF;YACvF,cAAc;YACd,wBAAwB;YACxB,KAAK;YACL,EAAE;YACF,2BAA2B;YAC3B,EAAE;YACF,iCAAiC;YACjC,EAAE;YACF,mGAAmG;YACnG,6GAA6G;YAC7G,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC;QAEZ,wDAAwD,EAAE;YACxD,KAAK;YACL,iCAAiC;YACjC,wBAAwB;YACxB,0BAA0B;YAC1B,UAAU;YACV,gBAAgB;YAChB,oBAAoB;YACpB,wGAAwG;YACxG,cAAc;YACd,0BAA0B;YAC1B,kBAAkB;YAClB,eAAe;YACf,eAAe;YACf,8BAA8B;YAC9B,wDAAwD;YACxD,kBAAkB;YAClB,wDAAwD;YACxD,YAAY;YACZ,qBAAqB;YACrB,KAAK;YACL,EAAE;YACF,qBAAqB;YACrB,EAAE;YACF,sBAAsB;YACtB,EAAE;YACF,uHAAuH;YACvH,EAAE;YACF,uBAAuB;YACvB,EAAE;YACF,+DAA+D;YAC/D,+EAA+E;YAC/E,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-templates.d.ts","sourceRoot":"","sources":["../../../src/commands/init/workflow-templates.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiR/D"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
export function buildWorkflowTemplates() {
|
|
2
|
+
const gha = (expr) => `$\x7B\x7B ${expr} }}`;
|
|
3
|
+
return {
|
|
4
|
+
".github/workflows/wiki-ci.yml": [
|
|
5
|
+
"name: Wiki CI & Tiered Governance Gate",
|
|
6
|
+
"",
|
|
7
|
+
"on:",
|
|
8
|
+
" pull_request:",
|
|
9
|
+
" branches: [main]",
|
|
10
|
+
" push:",
|
|
11
|
+
" branches: [main]",
|
|
12
|
+
"",
|
|
13
|
+
"# Configure GitHub Branch Protection on `main` (Require PR reviews + CODEOWNERS + Allow auto-merge)",
|
|
14
|
+
"# so `maintainer_review` PRs require human sign-off while `auto_merge` PRs squash-merge automatically.",
|
|
15
|
+
"permissions:",
|
|
16
|
+
" contents: read",
|
|
17
|
+
"",
|
|
18
|
+
"jobs:",
|
|
19
|
+
" validate-and-gate:",
|
|
20
|
+
" name: Validate OKF Contracts & Evaluate Governance Gate",
|
|
21
|
+
" runs-on: ubuntu-latest",
|
|
22
|
+
" permissions:",
|
|
23
|
+
" contents: read",
|
|
24
|
+
" outputs:",
|
|
25
|
+
` decision: ${gha("steps.gate.outputs.decision")}`,
|
|
26
|
+
" steps:",
|
|
27
|
+
" - name: Checkout wiki repository at exact target commit",
|
|
28
|
+
" uses: actions/checkout@v4",
|
|
29
|
+
" with:",
|
|
30
|
+
` ref: ${gha("github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha")}`,
|
|
31
|
+
" fetch-depth: 0",
|
|
32
|
+
" - name: Setup Node.js",
|
|
33
|
+
" uses: actions/setup-node@v4",
|
|
34
|
+
" with:",
|
|
35
|
+
' node-version: "22"',
|
|
36
|
+
" - name: Install open-livex-wiki CLI",
|
|
37
|
+
" run: npm install -g open-livex-wiki",
|
|
38
|
+
" - name: Run strict structural & graph validation",
|
|
39
|
+
" run: olw validate --wiki . --strict --json",
|
|
40
|
+
" - name: Evaluate tiered Git governance gate (PR only)",
|
|
41
|
+
" if: github.event_name == 'pull_request'",
|
|
42
|
+
" id: gate",
|
|
43
|
+
" run: |",
|
|
44
|
+
` BASE_SHA="${gha("github.event.pull_request.base.sha")}"`,
|
|
45
|
+
` HEAD_SHA="${gha("github.event.pull_request.head.sha")}"`,
|
|
46
|
+
' git cat-file -e "$BASE_SHA^{commit}" 2>/dev/null || git fetch --no-tags origin "$BASE_SHA"',
|
|
47
|
+
' git cat-file -e "$HEAD_SHA^{commit}" 2>/dev/null || git fetch --no-tags origin "$HEAD_SHA"',
|
|
48
|
+
' olw gate --wiki . --base "$BASE_SHA" --head "$HEAD_SHA" --strict --json > gate-result.json',
|
|
49
|
+
" cat gate-result.json",
|
|
50
|
+
" DECISION=$(node -e \"const r = JSON.parse(require('node:fs').readFileSync('gate-result.json','utf8')); console.log(r.decision);\")",
|
|
51
|
+
' echo "decision=$DECISION" >> "$GITHUB_OUTPUT"',
|
|
52
|
+
' if [ "$DECISION" = "blocked" ]; then',
|
|
53
|
+
' echo "::error::Governance gate BLOCKED this PR. Fix validation errors before merging."',
|
|
54
|
+
" exit 1",
|
|
55
|
+
" fi",
|
|
56
|
+
"",
|
|
57
|
+
" auto-merge:",
|
|
58
|
+
" name: Enable Tiered Auto-Merge (Eligible PRs Only)",
|
|
59
|
+
" needs: validate-and-gate",
|
|
60
|
+
" if: github.event_name == 'pull_request' && needs.validate-and-gate.outputs.decision == 'auto_merge'",
|
|
61
|
+
" runs-on: ubuntu-latest",
|
|
62
|
+
" permissions:",
|
|
63
|
+
" contents: write",
|
|
64
|
+
" pull-requests: write",
|
|
65
|
+
" steps:",
|
|
66
|
+
" - name: Enable auto-merge bound to audited PR head SHA",
|
|
67
|
+
" env:",
|
|
68
|
+
` GH_TOKEN: ${gha("secrets.GITHUB_TOKEN")}`,
|
|
69
|
+
" run: |",
|
|
70
|
+
` gh pr merge --auto --squash --match-head-commit "${gha("github.event.pull_request.head.sha")}" "${gha("github.event.pull_request.html_url")}" || echo "Auto-merge not enabled in repo settings; skipping."`,
|
|
71
|
+
"",
|
|
72
|
+
].join("\n"),
|
|
73
|
+
".github/workflows/wiki-daily-sync.yml": [
|
|
74
|
+
"name: Wiki Daily Diff-Impact Sync",
|
|
75
|
+
"",
|
|
76
|
+
"on:",
|
|
77
|
+
" schedule:",
|
|
78
|
+
' - cron: "0 2 * * *"',
|
|
79
|
+
" workflow_dispatch:",
|
|
80
|
+
" inputs:",
|
|
81
|
+
" repos_dir:",
|
|
82
|
+
' description: "Directory where target source repositories are cloned"',
|
|
83
|
+
" required: false",
|
|
84
|
+
' default: ".repos"',
|
|
85
|
+
"",
|
|
86
|
+
"permissions:",
|
|
87
|
+
" contents: read",
|
|
88
|
+
" issues: write",
|
|
89
|
+
"",
|
|
90
|
+
"jobs:",
|
|
91
|
+
" diff-impact:",
|
|
92
|
+
" name: Analyze Multi-Repo Diff Impact",
|
|
93
|
+
" runs-on: ubuntu-latest",
|
|
94
|
+
" steps:",
|
|
95
|
+
" - name: Checkout wiki repository",
|
|
96
|
+
" uses: actions/checkout@v4",
|
|
97
|
+
" - name: Setup Node.js",
|
|
98
|
+
" uses: actions/setup-node@v4",
|
|
99
|
+
" with:",
|
|
100
|
+
' node-version: "22"',
|
|
101
|
+
" - name: Install open-livex-wiki CLI",
|
|
102
|
+
" run: npm install -g open-livex-wiki",
|
|
103
|
+
" - name: Sync target source repositories via olw repos sync",
|
|
104
|
+
" env:",
|
|
105
|
+
` REPOS_DIR: ${gha("inputs.repos_dir || '.repos'")}`,
|
|
106
|
+
` SOURCE_REPO_TOKEN: ${gha("secrets.SOURCE_REPO_TOKEN")}`,
|
|
107
|
+
` SOURCE_REPO_ALLOWED_HOSTS: ${gha("vars.SOURCE_REPO_ALLOWED_HOSTS")}`,
|
|
108
|
+
` GITHUB_SERVER_URL: ${gha("github.server_url")}`,
|
|
109
|
+
" run: |",
|
|
110
|
+
' olw repos sync --wiki . --repos-dir "$REPOS_DIR" --json > repos-sync.json',
|
|
111
|
+
" cat repos-sync.json",
|
|
112
|
+
" - name: Run diff-impact analysis",
|
|
113
|
+
" id: impact",
|
|
114
|
+
" env:",
|
|
115
|
+
` REPOS_DIR: ${gha("inputs.repos_dir || '.repos'")}`,
|
|
116
|
+
" run: |",
|
|
117
|
+
' olw diff-impact --wiki . --repos-dir "$REPOS_DIR" --json > diff-impact.json',
|
|
118
|
+
" cat diff-impact.json",
|
|
119
|
+
" node --input-type=module -e '",
|
|
120
|
+
' import fs from "node:fs";',
|
|
121
|
+
' const r = JSON.parse(fs.readFileSync("diff-impact.json", "utf8"));',
|
|
122
|
+
" const directCount = r.summary?.directImpactedCount ?? 0;",
|
|
123
|
+
" const dependentCount = r.summary?.dependentImpactedCount ?? 0;",
|
|
124
|
+
" const brokenAnchorCount = r.summary?.brokenAnchorCount ?? (r.brokenAnchors?.length ?? 0);",
|
|
125
|
+
" const unreachableRepoCount = r.summary?.unreachableRepoCount ?? 0;",
|
|
126
|
+
" const parseErrorCount = r.parseErrorCount ?? 0;",
|
|
127
|
+
" const hasIncompleteWiki = Boolean(r.hasIncompleteWiki) || parseErrorCount > 0;",
|
|
128
|
+
" const needsIssue = directCount > 0 || brokenAnchorCount > 0 || unreachableRepoCount > 0 || hasIncompleteWiki;",
|
|
129
|
+
" fs.appendFileSync(process.env.GITHUB_OUTPUT, [",
|
|
130
|
+
' "direct_count=" + directCount,',
|
|
131
|
+
' "dependent_count=" + dependentCount,',
|
|
132
|
+
' "broken_anchor_count=" + brokenAnchorCount,',
|
|
133
|
+
' "unreachable_repo_count=" + unreachableRepoCount,',
|
|
134
|
+
' "parse_error_count=" + parseErrorCount,',
|
|
135
|
+
' "needs_issue=" + (needsIssue ? "true" : "false"),',
|
|
136
|
+
' ].join("\\n") + "\\n");',
|
|
137
|
+
" '",
|
|
138
|
+
" - name: Upload diff-impact report artifact",
|
|
139
|
+
" uses: actions/upload-artifact@v4",
|
|
140
|
+
" with:",
|
|
141
|
+
" name: wiki-diff-impact-report",
|
|
142
|
+
" path: diff-impact.json",
|
|
143
|
+
" - name: Open or update [Wiki Sync] tracking issue",
|
|
144
|
+
" if: steps.impact.outputs.needs_issue == 'true'",
|
|
145
|
+
" env:",
|
|
146
|
+
` GH_TOKEN: ${gha("secrets.GITHUB_TOKEN")}`,
|
|
147
|
+
" run: |",
|
|
148
|
+
" node --input-type=module -e '",
|
|
149
|
+
' import fs from "node:fs";',
|
|
150
|
+
' const r = JSON.parse(fs.readFileSync("diff-impact.json", "utf8"));',
|
|
151
|
+
" const s = r.summary ?? {};",
|
|
152
|
+
" const lines = [",
|
|
153
|
+
' "### Daily Diff-Impact Sync Report",',
|
|
154
|
+
' "",',
|
|
155
|
+
' "- **Direct Impacted Scenes**: " + (s.directImpactedCount ?? 0),',
|
|
156
|
+
' "- **1-Hop Dependent Scenes**: " + (s.dependentImpactedCount ?? 0),',
|
|
157
|
+
' "- **Broken Code Anchors**: " + (s.brokenAnchorCount ?? (r.brokenAnchors?.length ?? 0)),',
|
|
158
|
+
' "- **Unreachable Repositories**: " + (s.unreachableRepoCount ?? 0),',
|
|
159
|
+
' ...(r.hasIncompleteWiki || (r.parseErrorCount ?? 0) > 0 ? ["- **Wiki Parse Errors**: " + (r.parseErrorCount ?? 0)] : []),',
|
|
160
|
+
' "",',
|
|
161
|
+
" ];",
|
|
162
|
+
" if (Array.isArray(r.impactedScenes) && r.impactedScenes.length > 0) {",
|
|
163
|
+
' lines.push("#### Impacted Scenes");',
|
|
164
|
+
" for (const item of r.impactedScenes) {",
|
|
165
|
+
' lines.push("- **`" + item.sceneId + "`** (`" + item.impactType + "`): " + (item.reasons ?? []).join("; "));',
|
|
166
|
+
" }",
|
|
167
|
+
' lines.push("");',
|
|
168
|
+
" }",
|
|
169
|
+
" if (Array.isArray(r.brokenAnchors) && r.brokenAnchors.length > 0) {",
|
|
170
|
+
' lines.push("#### Broken Code Anchors");',
|
|
171
|
+
" for (const b of r.brokenAnchors) {",
|
|
172
|
+
' const repo = b.anchor?.repo ?? b.repo ?? "unknown-repo";',
|
|
173
|
+
' const file = b.anchor?.file ?? b.file ?? "unknown-file";',
|
|
174
|
+
" const symbol = b.anchor?.symbol ?? b.symbol;",
|
|
175
|
+
' lines.push("- `" + b.sceneId + "` -> `" + repo + ":" + file + (symbol ? "#" + symbol : "") + "` (`" + b.reason + "`)");',
|
|
176
|
+
" }",
|
|
177
|
+
' lines.push("");',
|
|
178
|
+
" }",
|
|
179
|
+
" const unreachableRepos = (r.repoStatuses ?? []).filter((x) => !x.reachable);",
|
|
180
|
+
" if (unreachableRepos.length > 0) {",
|
|
181
|
+
' lines.push("#### Unreachable Repositories (Verify `SOURCE_REPO_TOKEN` or `gitUrl`)");',
|
|
182
|
+
" for (const u of unreachableRepos) {",
|
|
183
|
+
' lines.push("- `" + u.repo + "` (`" + u.gitUrl + "`): " + (u.error ?? "unreachable"));',
|
|
184
|
+
" }",
|
|
185
|
+
' lines.push("");',
|
|
186
|
+
" }",
|
|
187
|
+
' lines.push("#### Next Step");',
|
|
188
|
+
' lines.push("Run the `wiki-incremental-update` skill against fresh source checkouts to re-verify impacted chains and open a gated PR.");',
|
|
189
|
+
' fs.writeFileSync("wiki-sync-issue.md", lines.join("\\n") + "\\n", "utf8");',
|
|
190
|
+
" '",
|
|
191
|
+
` TITLE="[Wiki Sync] ${gha("steps.impact.outputs.direct_count")} direct, ${gha("steps.impact.outputs.broken_anchor_count")} broken anchors, ${gha("steps.impact.outputs.unreachable_repo_count")} unreachable repos"`,
|
|
192
|
+
" EXISTING_NUM=$(gh issue list --state open --search \"[Wiki Sync] in:title\" --json number --jq '.[0].number // empty' || true)",
|
|
193
|
+
' if [ -n "$EXISTING_NUM" ]; then',
|
|
194
|
+
' gh issue edit "$EXISTING_NUM" --title "$TITLE" --body-file wiki-sync-issue.md || echo "Issue update skipped."',
|
|
195
|
+
" else",
|
|
196
|
+
' gh issue create --title "$TITLE" --body-file wiki-sync-issue.md || echo "Issue creation skipped."',
|
|
197
|
+
" fi",
|
|
198
|
+
"",
|
|
199
|
+
].join("\n"),
|
|
200
|
+
".github/workflows/wiki-weekly-review.yml": [
|
|
201
|
+
"name: Wiki Weekly Full Review & Graph Build",
|
|
202
|
+
"",
|
|
203
|
+
"on:",
|
|
204
|
+
" schedule:",
|
|
205
|
+
' - cron: "0 3 * * 1"',
|
|
206
|
+
" workflow_dispatch:",
|
|
207
|
+
" inputs:",
|
|
208
|
+
" check_anchors:",
|
|
209
|
+
' description: "Clone declared source repos into repos_dir and verify code anchors"',
|
|
210
|
+
" required: false",
|
|
211
|
+
" type: boolean",
|
|
212
|
+
" default: false",
|
|
213
|
+
" repos_dir:",
|
|
214
|
+
' description: "Directory where target source repositories are cloned"',
|
|
215
|
+
" required: false",
|
|
216
|
+
' default: ".repos"',
|
|
217
|
+
"",
|
|
218
|
+
"permissions:",
|
|
219
|
+
" contents: read",
|
|
220
|
+
"",
|
|
221
|
+
"jobs:",
|
|
222
|
+
" weekly-review:",
|
|
223
|
+
" name: Weekly Strict Validation & Static Graph Snapshot",
|
|
224
|
+
" runs-on: ubuntu-latest",
|
|
225
|
+
" steps:",
|
|
226
|
+
" - name: Checkout wiki repository",
|
|
227
|
+
" uses: actions/checkout@v4",
|
|
228
|
+
" - name: Setup Node.js",
|
|
229
|
+
" uses: actions/setup-node@v4",
|
|
230
|
+
" with:",
|
|
231
|
+
' node-version: "22"',
|
|
232
|
+
" - name: Install open-livex-wiki CLI",
|
|
233
|
+
" run: npm install -g open-livex-wiki",
|
|
234
|
+
" - name: Checkout target source repositories when anchor check is enabled",
|
|
235
|
+
" if: inputs.check_anchors == true",
|
|
236
|
+
" id: sync_repos",
|
|
237
|
+
" env:",
|
|
238
|
+
` REPOS_DIR: ${gha("inputs.repos_dir || '.repos'")}`,
|
|
239
|
+
` SOURCE_REPO_TOKEN: ${gha("secrets.SOURCE_REPO_TOKEN")}`,
|
|
240
|
+
` SOURCE_REPO_ALLOWED_HOSTS: ${gha("vars.SOURCE_REPO_ALLOWED_HOSTS")}`,
|
|
241
|
+
` GITHUB_SERVER_URL: ${gha("github.server_url")}`,
|
|
242
|
+
" run: |",
|
|
243
|
+
' olw repos sync --wiki . --repos-dir "$REPOS_DIR" --json > repos-sync.json',
|
|
244
|
+
" cat repos-sync.json",
|
|
245
|
+
" CHECKED_OUT=$(node -e \"const r = JSON.parse(require('node:fs').readFileSync('repos-sync.json','utf8')); console.log((r.clonedCount || 0) + (r.fetchedCount || 0));\")",
|
|
246
|
+
' echo "checked_out_count=$CHECKED_OUT" >> "$GITHUB_OUTPUT"',
|
|
247
|
+
" - name: Run strict wiki validation",
|
|
248
|
+
" env:",
|
|
249
|
+
` REPOS_DIR: ${gha("inputs.repos_dir || '.repos'")}`,
|
|
250
|
+
" run: |",
|
|
251
|
+
` if [ "${gha("inputs.check_anchors")}" = "true" ] && [ "${gha("steps.sync_repos.outputs.checked_out_count || '0'")}" -gt 0 ]; then`,
|
|
252
|
+
' olw validate --wiki . --strict --check-anchors --repos-dir "$REPOS_DIR" --json > weekly-validation.json',
|
|
253
|
+
" else",
|
|
254
|
+
` if [ "${gha("inputs.check_anchors")}" = "true" ]; then`,
|
|
255
|
+
' echo "::warning::check_anchors was requested, but 0 source repositories were checked out in $REPOS_DIR; running structural validation and reporting uncloned repos."',
|
|
256
|
+
" fi",
|
|
257
|
+
" olw validate --wiki . --strict --json > weekly-validation.json",
|
|
258
|
+
" fi",
|
|
259
|
+
" cat weekly-validation.json",
|
|
260
|
+
" - name: Build static knowledge graph bundle",
|
|
261
|
+
" run: olw graph build --wiki . --out .olw-graph",
|
|
262
|
+
" - name: Upload weekly audit artifacts",
|
|
263
|
+
" uses: actions/upload-artifact@v4",
|
|
264
|
+
" with:",
|
|
265
|
+
" name: wiki-weekly-review",
|
|
266
|
+
" path: |",
|
|
267
|
+
" weekly-validation.json",
|
|
268
|
+
" .olw-graph/graph.json",
|
|
269
|
+
"",
|
|
270
|
+
].join("\n"),
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=workflow-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-templates.js","sourceRoot":"","sources":["../../../src/commands/init/workflow-templates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,sBAAsB;IACpC,MAAM,GAAG,GAA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B,EAAE;YACF,OAAO;YACP,kBAAkB;YAClB,4DAA4D;YAC5D,4BAA4B;YAC5B,YAAY;YACZ,wCAAwC;YACxC,mCAAmC;YACnC,6BAA6B;YAC7B,qCAAqC;YACrC,eAAe;YACf,8BAA8B;YAC9B,2CAA2C;YAC3C,6CAA6C;YAC7C,gFAAgF;YAChF,0CAA0C;YAC1C,wBAAwB;YACxB,cAAc;YACd,wBAAwB,GAAG,CAAC,8BAA8B,CAAC,EAAE;YAC7D,gCAAgC,GAAG,CAAC,2BAA2B,CAAC,EAAE;YAClE,wCAAwC,GAAG,CAAC,gCAAgC,CAAC,EAAE;YAC/E,gCAAgC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC1D,gBAAgB;YAChB,qFAAqF;YACrF,+BAA+B;YAC/B,kLAAkL;YAClL,qEAAqE;YACrE,0CAA0C;YAC1C,cAAc;YACd,wBAAwB,GAAG,CAAC,8BAA8B,CAAC,EAAE;YAC7D,gBAAgB;YAChB,mBAAmB,GAAG,CAAC,sBAAsB,CAAC,sBAAsB,GAAG,CAAC,mDAAmD,CAAC,iBAAiB;YAC7I,qHAAqH;YACrH,gBAAgB;YAChB,qBAAqB,GAAG,CAAC,sBAAsB,CAAC,oBAAoB;YACpE,oLAAoL;YACpL,gBAAgB;YAChB,4EAA4E;YAC5E,cAAc;YACd,sCAAsC;YACtC,mDAAmD;YACnD,wDAAwD;YACxD,6CAA6C;YAC7C,0CAA0C;YAC1C,eAAe;YACf,oCAAoC;YACpC,mBAAmB;YACnB,oCAAoC;YACpC,mCAAmC;YACnC,EAAE;SACH,CAAC,IAAI,CAAC,IAAI,CAAC;KACb,CAAC;AACJ,CAAC"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type WikiRepoConfig } from "@open-livex-wiki/core";
|
|
2
2
|
import { type CliContext } from "../io.js";
|
|
3
|
+
export { type BuildBuiltinStarterOptions, buildBuiltinStarterFiles } from "./init/templates.js";
|
|
3
4
|
export interface InitCommandOptions {
|
|
4
5
|
name?: string;
|
|
5
6
|
template?: string;
|
|
@@ -18,13 +19,8 @@ export interface InitCommandResult {
|
|
|
18
19
|
repositories: WikiRepoConfig[];
|
|
19
20
|
createdFiles: string[];
|
|
20
21
|
}
|
|
21
|
-
export interface BuildBuiltinStarterOptions {
|
|
22
|
-
bare?: boolean;
|
|
23
|
-
repositories?: WikiRepoConfig[];
|
|
24
|
-
}
|
|
25
22
|
export declare function getStarterTemplateCandidates(): string[];
|
|
26
23
|
export declare function getStarterBundleCandidates(): string[];
|
|
27
24
|
export declare function loadStarterBundleFiles(bundlePath?: string): Promise<Record<string, string> | undefined>;
|
|
28
|
-
export declare function buildBuiltinStarterFiles(wikiName: string, options?: BuildBuiltinStarterOptions): Record<string, string>;
|
|
29
25
|
export declare function runInitCommand(dirArg: string | undefined, options: InitCommandOptions, ctx: CliContext): Promise<InitCommandResult | undefined>;
|
|
30
26
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,KAAK,UAAU,EAAwC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,KAAK,UAAU,EAAwC,MAAM,UAAU,CAAC;AAUjF,OAAO,EAAE,KAAK,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEhG,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAA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