@thjodann/wk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/cli/commands/article.d.ts +2 -0
- package/dist/cli/commands/article.js +47 -0
- package/dist/cli/commands/article.js.map +1 -0
- package/dist/cli/commands/closeout.d.ts +2 -0
- package/dist/cli/commands/closeout.js +37 -0
- package/dist/cli/commands/closeout.js.map +1 -0
- package/dist/cli/commands/compile.d.ts +2 -0
- package/dist/cli/commands/compile.js +50 -0
- package/dist/cli/commands/compile.js.map +1 -0
- package/dist/cli/commands/concept.d.ts +2 -0
- package/dist/cli/commands/concept.js +36 -0
- package/dist/cli/commands/concept.js.map +1 -0
- package/dist/cli/commands/decision.d.ts +2 -0
- package/dist/cli/commands/decision.js +38 -0
- package/dist/cli/commands/decision.js.map +1 -0
- package/dist/cli/commands/event.d.ts +2 -0
- package/dist/cli/commands/event.js +32 -0
- package/dist/cli/commands/event.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +52 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/installAgent.d.ts +2 -0
- package/dist/cli/commands/installAgent.js +130 -0
- package/dist/cli/commands/installAgent.js.map +1 -0
- package/dist/cli/commands/link.d.ts +2 -0
- package/dist/cli/commands/link.js +36 -0
- package/dist/cli/commands/link.js.map +1 -0
- package/dist/cli/commands/note.d.ts +2 -0
- package/dist/cli/commands/note.js +34 -0
- package/dist/cli/commands/note.js.map +1 -0
- package/dist/cli/commands/pages.d.ts +2 -0
- package/dist/cli/commands/pages.js +46 -0
- package/dist/cli/commands/pages.js.map +1 -0
- package/dist/cli/commands/record.d.ts +2 -0
- package/dist/cli/commands/record.js +101 -0
- package/dist/cli/commands/record.js.map +1 -0
- package/dist/cli/commands/render.d.ts +2 -0
- package/dist/cli/commands/render.js +33 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/search.d.ts +2 -0
- package/dist/cli/commands/search.js +125 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +2 -0
- package/dist/cli/commands/setup.js +53 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/cli/commands/site.d.ts +2 -0
- package/dist/cli/commands/site.js +47 -0
- package/dist/cli/commands/site.js.map +1 -0
- package/dist/cli/commands/spin.d.ts +2 -0
- package/dist/cli/commands/spin.js +43 -0
- package/dist/cli/commands/spin.js.map +1 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/status.js +63 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/symbol.d.ts +2 -0
- package/dist/cli/commands/symbol.js +37 -0
- package/dist/cli/commands/symbol.js.map +1 -0
- package/dist/cli/commands/theme.d.ts +2 -0
- package/dist/cli/commands/theme.js +52 -0
- package/dist/cli/commands/theme.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +2 -0
- package/dist/cli/commands/validate.js +44 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/helpers.d.ts +30 -0
- package/dist/cli/helpers.js +131 -0
- package/dist/cli/helpers.js.map +1 -0
- package/dist/core/articles.d.ts +5 -0
- package/dist/core/articles.js +25 -0
- package/dist/core/articles.js.map +1 -0
- package/dist/core/automation.d.ts +96 -0
- package/dist/core/automation.js +384 -0
- package/dist/core/automation.js.map +1 -0
- package/dist/core/beads.d.ts +43 -0
- package/dist/core/beads.js +358 -0
- package/dist/core/beads.js.map +1 -0
- package/dist/core/compiler.d.ts +45 -0
- package/dist/core/compiler.js +399 -0
- package/dist/core/compiler.js.map +1 -0
- package/dist/core/config.d.ts +59 -0
- package/dist/core/config.js +187 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/git.d.ts +21 -0
- package/dist/core/git.js +109 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/ids.d.ts +2 -0
- package/dist/core/ids.js +8 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/core/pages.d.ts +34 -0
- package/dist/core/pages.js +233 -0
- package/dist/core/pages.js.map +1 -0
- package/dist/core/paths.d.ts +15 -0
- package/dist/core/paths.js +67 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/profiles.d.ts +30 -0
- package/dist/core/profiles.js +243 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/renderer.d.ts +8 -0
- package/dist/core/renderer.js +106 -0
- package/dist/core/renderer.js.map +1 -0
- package/dist/core/schemas.d.ts +1039 -0
- package/dist/core/schemas.js +108 -0
- package/dist/core/schemas.js.map +1 -0
- package/dist/core/site.d.ts +20 -0
- package/dist/core/site.js +2684 -0
- package/dist/core/site.js.map +1 -0
- package/dist/core/spin.d.ts +42 -0
- package/dist/core/spin.js +265 -0
- package/dist/core/spin.js.map +1 -0
- package/dist/core/store.d.ts +29 -0
- package/dist/core/store.js +146 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/theme.d.ts +35 -0
- package/dist/core/theme.js +1086 -0
- package/dist/core/theme.js.map +1 -0
- package/dist/core/validator.d.ts +8 -0
- package/dist/core/validator.js +154 -0
- package/dist/core/validator.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/templates/articlesPage.d.ts +3 -0
- package/dist/templates/articlesPage.js +46 -0
- package/dist/templates/articlesPage.js.map +1 -0
- package/dist/templates/conceptsPage.d.ts +2 -0
- package/dist/templates/conceptsPage.js +24 -0
- package/dist/templates/conceptsPage.js.map +1 -0
- package/dist/templates/decisionsPage.d.ts +2 -0
- package/dist/templates/decisionsPage.js +27 -0
- package/dist/templates/decisionsPage.js.map +1 -0
- package/dist/templates/devlogPage.d.ts +2 -0
- package/dist/templates/devlogPage.js +22 -0
- package/dist/templates/devlogPage.js.map +1 -0
- package/dist/templates/indexPage.d.ts +6 -0
- package/dist/templates/indexPage.js +33 -0
- package/dist/templates/indexPage.js.map +1 -0
- package/dist/templates/linksPage.d.ts +2 -0
- package/dist/templates/linksPage.js +26 -0
- package/dist/templates/linksPage.js.map +1 -0
- package/dist/templates/notesPage.d.ts +2 -0
- package/dist/templates/notesPage.js +26 -0
- package/dist/templates/notesPage.js.map +1 -0
- package/dist/templates/symbolsPage.d.ts +2 -0
- package/dist/templates/symbolsPage.js +25 -0
- package/dist/templates/symbolsPage.js.map +1 -0
- package/docs/concepts.md +249 -0
- package/docs/reference.md +356 -0
- package/docs/setup.md +331 -0
- package/docs/workflows.md +154 -0
- package/package.json +61 -0
- package/skills/wk/SKILL.md +251 -0
- package/skills/wk/agents/openai.yaml +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Thjodann
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Thjodann/Wikiwiki/main/assets/wikiwiki-banner.png" alt="Wikiwiki banner: Spin the docs. Ship the code." width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Wikiwiki
|
|
6
|
+
|
|
7
|
+
> Spin the docs. Ship the code.
|
|
8
|
+
|
|
9
|
+
Wikiwiki is quiet infrastructure for a project's own wiki. It is a scriptable
|
|
10
|
+
CLI for teams that want local, deterministic project knowledge, and it becomes
|
|
11
|
+
more capable when an agentic IDE uses the same commands while code changes.
|
|
12
|
+
|
|
13
|
+
The core idea is simple: keep structured repo knowledge in plain JSONL records,
|
|
14
|
+
make `article` records the public wiki pages, and use concepts, decisions,
|
|
15
|
+
notes, symbols, events, and links as the evidence ledger behind them. No hosted
|
|
16
|
+
service, database, vector store, or hidden memory layer is required.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
Install Wikiwiki as `@thjodann/wk` in the repo that should keep a wiki:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
test "$(npm prefix)" = "$PWD" || npm init -y
|
|
24
|
+
npm install --prefix "$PWD" --save-dev @thjodann/wk
|
|
25
|
+
./node_modules/.bin/wk --help
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The `npm prefix` check prevents npm from climbing into an ancestor project
|
|
29
|
+
when the target repo has no local `package.json`. Use your repo's normal
|
|
30
|
+
lockfile policy after the package is installed.
|
|
31
|
+
|
|
32
|
+
For local development on Wikiwiki itself, install and run from source:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm install
|
|
36
|
+
npm run build
|
|
37
|
+
npm link
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Initialize Wikiwiki in a repo:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
wk setup --profile mixed --audience all
|
|
44
|
+
wk theme preview --json
|
|
45
|
+
wk theme init
|
|
46
|
+
wk pages init --audience all
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Check status and inspect the current working tree:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
wk status --json
|
|
53
|
+
wk spin --profile mixed --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Add a public article as knowledge becomes durable:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
wk article add \
|
|
60
|
+
--title "Getting started" \
|
|
61
|
+
--summary "The first successful path for a new user." \
|
|
62
|
+
--body "Install the project, run the first command, and verify the expected output." \
|
|
63
|
+
--categories guides,onboarding \
|
|
64
|
+
--tags audience:user,getting-started
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Add supporting records when they capture evidence, decisions, or maintainer
|
|
68
|
+
context:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
wk concept add \
|
|
72
|
+
--name "Structured records" \
|
|
73
|
+
--summary "JSONL records are the source of truth for repo knowledge." \
|
|
74
|
+
--files .wikiwiki/records/concepts.jsonl \
|
|
75
|
+
--tags audience:developer,architecture,docs
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Render the wiki and site:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
wk validate
|
|
82
|
+
wk render
|
|
83
|
+
wk site --audience all
|
|
84
|
+
open wiki-site/index.html
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Each `wk site` run replaces `wiki-site/`, so render only the audience you want
|
|
88
|
+
to inspect or publish last.
|
|
89
|
+
|
|
90
|
+
Close out meaningful work with a review packet:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
wk closeout --profile mixed --audience all --json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If a repo already uses Beads, Wikiwiki detects `.beads/` automatically. Detailed
|
|
97
|
+
`bd` reads are opt-in through `.wikiwiki/config.json` because some Beads
|
|
98
|
+
versions can touch internal storage during read commands. Publishing the
|
|
99
|
+
Beads-powered `work.html` site page is also explicit opt-in; user-audience
|
|
100
|
+
sites omit Beads data entirely. If Beads is absent, the normal flow is
|
|
101
|
+
unchanged.
|
|
102
|
+
|
|
103
|
+
## Docs
|
|
104
|
+
|
|
105
|
+
- [Concepts](docs/concepts.md): what Wikiwiki stores, renders, and optimizes for.
|
|
106
|
+
- [Setup](docs/setup.md): source install, awesome initial install, agentic IDE setup, and the "Update wk" agent pipeline.
|
|
107
|
+
- [Workflows](docs/workflows.md): dogfooding, JSON-first agent work, revisions, and closeout.
|
|
108
|
+
- [Reference](docs/reference.md): commands, profiles, theming, GitHub Pages, status, and roadmap.
|
|
109
|
+
|
|
110
|
+
## Current Status
|
|
111
|
+
|
|
112
|
+
Wikiwiki is an article-first CLI foundation. It currently includes:
|
|
113
|
+
|
|
114
|
+
- TypeScript CLI
|
|
115
|
+
- JSONL record storage with append-only revisions and deletion tombstones
|
|
116
|
+
- first-class `article` records with `wk article add`
|
|
117
|
+
- Zod validation
|
|
118
|
+
- Git-aware `spin` with deterministic `user`, `developer`, and `mixed` profile recipes
|
|
119
|
+
- audience tagging and audience-focused site rendering
|
|
120
|
+
- article-led Markdown rendering into `wiki/`
|
|
121
|
+
- article-led static HTML site generation into `wiki-site/`
|
|
122
|
+
- project theme overrides with light, dark, and system-auto support
|
|
123
|
+
- product-identity theme generation through `wk theme`, including paired light/dark palettes
|
|
124
|
+
- agent-mediated UX/DX human wiki compilation
|
|
125
|
+
- local search across articles, active records, and rendered docs
|
|
126
|
+
- scriptable non-AI setup through `wk setup`
|
|
127
|
+
- GitHub Pages workflow scaffolding through `wk pages init`
|
|
128
|
+
- deterministic closeout draft packets through `wk closeout`
|
|
129
|
+
- installable Codex-compatible `wk` agent skill
|
|
130
|
+
- optional read-only Beads integration for developer work context
|
|
131
|
+
- published npm package metadata for `@thjodann/wk`
|
|
132
|
+
- CI and tests
|
|
133
|
+
|
|
134
|
+
Some planned pieces are not built yet: richer symbol extraction, draft review
|
|
135
|
+
flows, and watch mode.
|
|
136
|
+
|
|
137
|
+
Generated `wiki/` and `wiki-site/` are intentionally not shipped in the npm
|
|
138
|
+
package. Installed users generate their own copies from their own records.
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
Build:
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
npm run build
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Run checks:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
npm run check
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Run tests:
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
npm test
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Verify package contents:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
npm run pack:dry-run
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Run the CLI in development:
|
|
167
|
+
|
|
168
|
+
```sh
|
|
169
|
+
npm run dev -- spin --json
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Roadmap
|
|
173
|
+
|
|
174
|
+
Completion estimates are rough planning signals based on the current repo state,
|
|
175
|
+
not release commitments.
|
|
176
|
+
|
|
177
|
+
| Planned feature | Completion | Notes |
|
|
178
|
+
| --- | ---: | --- |
|
|
179
|
+
| Richer symbol extraction | 20% | Symbol records and pages exist, but important symbols are still captured manually. |
|
|
180
|
+
| Draft review flows | 45% | Closeout and compile draft packets exist; structured approve, reject, and apply flows are still early. |
|
|
181
|
+
| Watch mode | 10% | Batch commands exist for `status`, `spin`, and `closeout`; no file watcher is built yet. |
|
|
182
|
+
| `scratch` review command | 10% | Validation and search exist; contradiction, drift, and stale-knowledge review is not a dedicated command yet. |
|
|
183
|
+
| `press` render alias | 30% | `render`, `site`, and `closeout` cover the workflow; the friendlier alias is not implemented. |
|
|
184
|
+
| `crate` rebuild/index command | 35% | Markdown, static site, and search indexes can be rebuilt; no unified rebuild/retrieval command exists yet. |
|
|
185
|
+
| `ask` repo knowledge query | 25% | `wk search` provides local lookup; answer synthesis over repo knowledge is not built yet. |
|
|
186
|
+
| GitHub Pages scaffolding | 85% | `wk pages init` writes a GitHub Actions workflow, persists site audience/source URL defaults, and reports the manual Pages settings step; authenticated settings and custom-domain automation remain future work. |
|
|
187
|
+
| Product-identity theme generation | 90% | `wk theme preview` and `wk theme init` create mood-based light/dark project themes with Auto/Light/Dark site controls; richer logo and layout customization remains future work. |
|
|
188
|
+
|
|
189
|
+
Shared completion snapshot:
|
|
190
|
+
|
|
191
|
+
- V1 package readiness: about 80%
|
|
192
|
+
- Named future roadmap: about 45%
|
|
193
|
+
- Blended overall product vision: about 72%
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
MIT
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerArticleCommand = registerArticleCommand;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const articles_1 = require("../../core/articles");
|
|
6
|
+
const ids_1 = require("../../core/ids");
|
|
7
|
+
const paths_1 = require("../../core/paths");
|
|
8
|
+
const store_1 = require("../../core/store");
|
|
9
|
+
function registerArticleCommand(program) {
|
|
10
|
+
const article = program.command("article").description("Manage public wiki articles.");
|
|
11
|
+
(0, helpers_1.addCommonRecordOptions)(article
|
|
12
|
+
.command("add")
|
|
13
|
+
.description("Add a public wiki article.")
|
|
14
|
+
.option("--title <title>", "article title")
|
|
15
|
+
.option("--slug <slug>", "stable article slug")
|
|
16
|
+
.option("--summary <summary>", "short article summary")
|
|
17
|
+
.option("--body <body>", "article body")
|
|
18
|
+
.option("--categories <categories>", "comma-separated categories; repeatable", helpers_1.collectList, [])
|
|
19
|
+
.option("--aliases <aliases>", "comma-separated aliases; repeatable", helpers_1.collectList, [])
|
|
20
|
+
.option("--source-records <ids>", "comma-separated source record ids; repeatable", helpers_1.collectList, [])
|
|
21
|
+
.option("--json [payload]", "read input as JSON and print machine-readable output")).action((options) => {
|
|
22
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
23
|
+
const payload = (0, helpers_1.parseJsonInput)(options.json);
|
|
24
|
+
const timestamps = (0, helpers_1.timestampPair)(payload);
|
|
25
|
+
const title = options.title ?? (0, helpers_1.stringValue)(payload, "title");
|
|
26
|
+
const slug = options.slug ?? (0, helpers_1.stringValue)(payload, "slug", (0, articles_1.slugFromTitle)(title));
|
|
27
|
+
const record = {
|
|
28
|
+
type: "article",
|
|
29
|
+
id: (0, helpers_1.stringValue)(payload, "id", (0, ids_1.createId)("article")),
|
|
30
|
+
title,
|
|
31
|
+
slug,
|
|
32
|
+
summary: options.summary ?? (0, helpers_1.stringValue)(payload, "summary"),
|
|
33
|
+
body: options.body ?? (0, helpers_1.stringValue)(payload, "body"),
|
|
34
|
+
categories: (0, helpers_1.parseList)(options.categories).length ? (0, helpers_1.parseList)(options.categories) : (0, helpers_1.arrayValue)(payload, "categories"),
|
|
35
|
+
aliases: (0, helpers_1.parseList)(options.aliases).length ? (0, helpers_1.parseList)(options.aliases) : (0, helpers_1.arrayValue)(payload, "aliases"),
|
|
36
|
+
source_record_ids: (0, helpers_1.parseList)(options.sourceRecords).length ? (0, helpers_1.parseList)(options.sourceRecords) : (0, helpers_1.arrayValue)(payload, "source_record_ids"),
|
|
37
|
+
files: (0, helpers_1.parseList)(options.files).length ? (0, helpers_1.parseList)(options.files) : (0, helpers_1.arrayValue)(payload, "files"),
|
|
38
|
+
tags: (0, helpers_1.parseList)(options.tags).length ? (0, helpers_1.parseList)(options.tags) : (0, helpers_1.arrayValue)(payload, "tags"),
|
|
39
|
+
...(0, helpers_1.commonRecordFields)(options, payload),
|
|
40
|
+
created_at: timestamps.created_at,
|
|
41
|
+
updated_at: timestamps.updated_at
|
|
42
|
+
};
|
|
43
|
+
const added = (0, store_1.appendRecord)(root, "article", record);
|
|
44
|
+
(0, helpers_1.printAdded)("article", added.id, (0, helpers_1.wantsJsonOutput)(options.json), added);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=article.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article.js","sourceRoot":"","sources":["../../../src/cli/commands/article.ts"],"names":[],"mappings":";;AAmBA,wDAyCC;AA3DD,wCAWoB;AACpB,kDAAoD;AACpD,wCAA0C;AAC1C,4CAAgD;AAChD,4CAAgD;AAGhD,SAAgB,sBAAsB,CAAC,OAAgB;IACrD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;IAEvF,IAAA,gCAAsB,EACpB,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,4BAA4B,CAAC;SACzC,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC;SAC1C,MAAM,CAAC,eAAe,EAAE,qBAAqB,CAAC;SAC9C,MAAM,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;SACtD,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC;SACvC,MAAM,CAAC,2BAA2B,EAAE,wCAAwC,EAAE,qBAAW,EAAE,EAAE,CAAC;SAC9F,MAAM,CAAC,qBAAqB,EAAE,qCAAqC,EAAE,qBAAW,EAAE,EAAE,CAAC;SACrF,MAAM,CAAC,wBAAwB,EAAE,+CAA+C,EAAE,qBAAW,EAAE,EAAE,CAAC;SAClG,MAAM,CAAC,kBAAkB,EAAE,sDAAsD,CAAC,CACtF,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QACnB,MAAM,IAAI,GAAG,IAAA,oBAAY,GAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAA,wBAAc,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,OAAO,CAA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K,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,mBAAS,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,OAAO,EAAE,OAAO,CAAC;YAChG,IAAI,EAAE,IAAA,mBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,mBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,OAAO,EAAE,MAAM,CAAC;YAC5F,GAAG,IAAA,4BAAkB,EAAC,OAAO,EAAE,OAAO,CAAC;YACvC,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;QAEF,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QACpD,IAAA,oBAAU,EAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,IAAA,yBAAe,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCloseoutCommand = registerCloseoutCommand;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const automation_1 = require("../../core/automation");
|
|
6
|
+
const paths_1 = require("../../core/paths");
|
|
7
|
+
function registerCloseoutCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command("closeout")
|
|
10
|
+
.description("Create deterministic closeout drafts, then validate and render the wiki.")
|
|
11
|
+
.option("--profile <profile>", "wiki profile: mixed, user, developer")
|
|
12
|
+
.option("--audience <audience>", "site audience: all, user, developer")
|
|
13
|
+
.option("--source-base-url <url>", "base URL for source file links")
|
|
14
|
+
.option("--json", "print machine-readable output")
|
|
15
|
+
.action((options) => {
|
|
16
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
17
|
+
const result = (0, automation_1.runCloseout)(root, options);
|
|
18
|
+
if (options.json) {
|
|
19
|
+
(0, helpers_1.printJson)(result);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(`Closeout draft: ${result.draft_path}`);
|
|
23
|
+
console.log(`Profile: ${result.profile}`);
|
|
24
|
+
console.log(`Audience: ${result.audience}`);
|
|
25
|
+
console.log(`Record drafts: ${result.drafts.length}`);
|
|
26
|
+
console.log(`Rendered Markdown files: ${result.rendered_files.length}`);
|
|
27
|
+
console.log(`Rendered site files: ${result.site_files.length}`);
|
|
28
|
+
if (result.integrations?.beads?.detected) {
|
|
29
|
+
const state = result.integrations.beads.available
|
|
30
|
+
? `${result.integrations.beads.issue_ids.length} related issue ids`
|
|
31
|
+
: result.integrations.beads.error === "beads_auto_read_skipped" ? "detected; detailed reads skipped"
|
|
32
|
+
: result.integrations.beads.enabled ? "detected but unavailable" : "disabled";
|
|
33
|
+
console.log(`Beads: ${state}`);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=closeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closeout.js","sourceRoot":"","sources":["../../../src/cli/commands/closeout.ts"],"names":[],"mappings":";;AAKA,0DAoCC;AAxCD,wCAAuC;AACvC,sDAAoD;AACpD,4CAAgD;AAEhD,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,0EAA0E,CAAC;SACvF,MAAM,CAAC,qBAAqB,EAAE,sCAAsC,CAAC;SACrE,MAAM,CAAC,uBAAuB,EAAE,qCAAqC,CAAC;SACtE,MAAM,CAAC,yBAAyB,EAAE,gCAAgC,CAAC;SACnE,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;SACjD,MAAM,CAAC,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C,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCompileCommand = registerCompileCommand;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const paths_1 = require("../../core/paths");
|
|
6
|
+
const compiler_1 = require("../../core/compiler");
|
|
7
|
+
function registerCompileCommand(program) {
|
|
8
|
+
const compile = program
|
|
9
|
+
.command("compile")
|
|
10
|
+
.description("Compile structured records into role-oriented human wiki drafts.");
|
|
11
|
+
compile
|
|
12
|
+
.command("draft")
|
|
13
|
+
.description("Create UX/DX human wiki drafts for an IDE agent to compose.")
|
|
14
|
+
.option("--role <role>", "compile role: all, ux, dx", "all")
|
|
15
|
+
.option("--json", "print machine-readable output")
|
|
16
|
+
.action((options) => {
|
|
17
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
18
|
+
const result = (0, compiler_1.createCompileDraft)(root, options.role);
|
|
19
|
+
if (options.json) {
|
|
20
|
+
(0, helpers_1.printJson)({
|
|
21
|
+
...result,
|
|
22
|
+
draft_path: (0, paths_1.reportPath)(result.draft_path),
|
|
23
|
+
manifest_path: (0, paths_1.reportPath)(result.manifest_path)
|
|
24
|
+
});
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
console.log(`Created compile draft: ${result.draft_id}`);
|
|
28
|
+
console.log(`Draft path: ${result.draft_path}`);
|
|
29
|
+
for (const page of result.pages) {
|
|
30
|
+
console.log(`- ${page.draft_path} -> ${page.output_path}`);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
compile
|
|
34
|
+
.command("apply <draft-id>")
|
|
35
|
+
.description("Validate and publish a human wiki compile draft.")
|
|
36
|
+
.option("--json", "print machine-readable output")
|
|
37
|
+
.action((draftId, options) => {
|
|
38
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
39
|
+
const result = (0, compiler_1.applyCompileDraft)(root, draftId);
|
|
40
|
+
if (options.json) {
|
|
41
|
+
(0, helpers_1.printJson)(result);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
console.log(`Applied compile draft: ${result.draft_id}`);
|
|
45
|
+
for (const file of result.rendered_files) {
|
|
46
|
+
console.log(`- ${file}`);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../src/cli/commands/compile.ts"],"names":[],"mappings":";;AASA,wDAgDC;AAxDD,wCAAuC;AACvC,4CAA4D;AAC5D,kDAI6B;AAE7B,SAAgB,sBAAsB,CAAC,OAAgB;IACrD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,kEAAkE,CAAC,CAAC;IAEnF,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,6DAA6D,CAAC;SAC1E,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,KAAK,CAAC;SAC3D,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;SACjD,MAAM,CAAC,CAAC,OAAyC,EAAE,EAAE;QACpD,MAAM,IAAI,GAAG,IAAA,oBAAY,GAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAA,6BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAyB,CAAC,CAAC;QAE3E,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,IAAA,mBAAS,EAAC;gBACR,GAAG,MAAM;gBACT,UAAU,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,UAAU,CAAC;gBACzC,aAAa,EAAE,IAAA,kBAAU,EAAC,MAAM,CAAC,aAAa,CAAC;aAChD,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,0BAA0B,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAChD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO;SACJ,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;SACjD,MAAM,CAAC,CAAC,OAAe,EAAE,OAA2B,EAAE,EAAE;QACvD,MAAM,IAAI,GAAG,IAAA,oBAAY,GAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAA,4BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEhD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;YAClB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,0BAA0B,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YACzC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerConceptCommand = registerConceptCommand;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const ids_1 = require("../../core/ids");
|
|
6
|
+
const paths_1 = require("../../core/paths");
|
|
7
|
+
const store_1 = require("../../core/store");
|
|
8
|
+
function registerConceptCommand(program) {
|
|
9
|
+
const concept = program.command("concept").description("Manage concepts.");
|
|
10
|
+
(0, helpers_1.addCommonRecordOptions)(concept
|
|
11
|
+
.command("add")
|
|
12
|
+
.description("Add a concept.")
|
|
13
|
+
.option("--name <name>", "concept name")
|
|
14
|
+
.option("--summary <summary>", "short concept summary")
|
|
15
|
+
.option("--details <details>", "longer concept details")
|
|
16
|
+
.option("--json [payload]", "read input as JSON and print machine-readable output")).action((options) => {
|
|
17
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
18
|
+
const payload = (0, helpers_1.parseJsonInput)(options.json);
|
|
19
|
+
const timestamps = (0, helpers_1.timestampPair)(payload);
|
|
20
|
+
const record = {
|
|
21
|
+
type: "concept",
|
|
22
|
+
id: (0, helpers_1.stringValue)(payload, "id", (0, ids_1.createId)("concept")),
|
|
23
|
+
name: options.name ?? (0, helpers_1.stringValue)(payload, "name"),
|
|
24
|
+
summary: options.summary ?? (0, helpers_1.stringValue)(payload, "summary"),
|
|
25
|
+
details: options.details ?? (0, helpers_1.stringValue)(payload, "details"),
|
|
26
|
+
files: (0, helpers_1.parseList)(options.files).length ? (0, helpers_1.parseList)(options.files) : (0, helpers_1.arrayValue)(payload, "files"),
|
|
27
|
+
tags: (0, helpers_1.parseList)(options.tags).length ? (0, helpers_1.parseList)(options.tags) : (0, helpers_1.arrayValue)(payload, "tags"),
|
|
28
|
+
...(0, helpers_1.commonRecordFields)(options, payload),
|
|
29
|
+
created_at: timestamps.created_at,
|
|
30
|
+
updated_at: timestamps.updated_at
|
|
31
|
+
};
|
|
32
|
+
const added = (0, store_1.appendRecord)(root, "concept", record);
|
|
33
|
+
(0, helpers_1.printAdded)("concept", added.id, (0, helpers_1.wantsJsonOutput)(options.json), added);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=concept.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concept.js","sourceRoot":"","sources":["../../../src/cli/commands/conc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,CAAC,CAAC,IAAA,mBAAS,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,OAAO,EAAE,OAAO,CAAC;YAChG,IAAI,EAAE,IAAA,mBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,mBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,OAAO,EAAE,MAAM,CAAC;YAC5F,GAAG,IAAA,4BAAkB,EAAC,OAAO,EAAE,OAAO,CAAC;YACvC,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;QAEF,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QACpD,IAAA,oBAAU,EAAC,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,IAAA,yBAAe,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDecisionCommand = registerDecisionCommand;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const ids_1 = require("../../core/ids");
|
|
6
|
+
const paths_1 = require("../../core/paths");
|
|
7
|
+
const store_1 = require("../../core/store");
|
|
8
|
+
function registerDecisionCommand(program) {
|
|
9
|
+
const decision = program.command("decision").description("Manage decisions.");
|
|
10
|
+
(0, helpers_1.addCommonRecordOptions)(decision
|
|
11
|
+
.command("add")
|
|
12
|
+
.description("Add a decision.")
|
|
13
|
+
.option("--title <title>", "decision title")
|
|
14
|
+
.option("--context <context>", "decision context")
|
|
15
|
+
.option("--decision <decision>", "the decision")
|
|
16
|
+
.option("--consequences <consequences>", "known consequences")
|
|
17
|
+
.option("--json [payload]", "read input as JSON and print machine-readable output")).action((options) => {
|
|
18
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
19
|
+
const payload = (0, helpers_1.parseJsonInput)(options.json);
|
|
20
|
+
const timestamps = (0, helpers_1.timestampPair)(payload);
|
|
21
|
+
const record = {
|
|
22
|
+
type: "decision",
|
|
23
|
+
id: (0, helpers_1.stringValue)(payload, "id", (0, ids_1.createId)("decision")),
|
|
24
|
+
title: options.title ?? (0, helpers_1.stringValue)(payload, "title"),
|
|
25
|
+
context: options.context ?? (0, helpers_1.stringValue)(payload, "context"),
|
|
26
|
+
decision: options.decision ?? (0, helpers_1.stringValue)(payload, "decision"),
|
|
27
|
+
consequences: options.consequences ?? (0, helpers_1.stringValue)(payload, "consequences"),
|
|
28
|
+
files: (0, helpers_1.parseList)(options.files).length ? (0, helpers_1.parseList)(options.files) : (0, helpers_1.arrayValue)(payload, "files"),
|
|
29
|
+
tags: (0, helpers_1.parseList)(options.tags).length ? (0, helpers_1.parseList)(options.tags) : (0, helpers_1.arrayValue)(payload, "tags"),
|
|
30
|
+
...(0, helpers_1.commonRecordFields)(options, payload),
|
|
31
|
+
created_at: timestamps.created_at,
|
|
32
|
+
updated_at: timestamps.updated_at
|
|
33
|
+
};
|
|
34
|
+
const added = (0, store_1.appendRecord)(root, "decision", record);
|
|
35
|
+
(0, helpers_1.printAdded)("decision", added.id, (0, helpers_1.wantsJsonOutput)(options.json), added);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=decision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../../src/cli/commands/decision.ts"],"names":[],"mappings":";;AAiBA,0DAiCC;AAjDD,wCAUoB;AACpB,wCAA0C;AAC1C,4CAAgD;AAChD,4CAAgD;AAGhD,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,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EAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,OAAO,EAAE,OAAO,CAAC;YAChG,IAAI,EAAE,IAAA,mBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAA,mBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAU,EAAC,OAAO,EAAE,MAAM,CAAC;YAC5F,GAAG,IAAA,4BAAkB,EAAC,OAAO,EAAE,OAAO,CAAC;YACvC,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;QAEF,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QACrD,IAAA,oBAAU,EAAC,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,IAAA,yBAAe,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerEventCommand = registerEventCommand;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
const ids_1 = require("../../core/ids");
|
|
6
|
+
const paths_1 = require("../../core/paths");
|
|
7
|
+
const store_1 = require("../../core/store");
|
|
8
|
+
function registerEventCommand(program) {
|
|
9
|
+
const event = program.command("event").description("Manage development events.");
|
|
10
|
+
(0, helpers_1.addCommonRecordOptions)(event
|
|
11
|
+
.command("add")
|
|
12
|
+
.description("Add an event.")
|
|
13
|
+
.option("--summary <summary>", "event summary")
|
|
14
|
+
.option("--details <details>", "event details")
|
|
15
|
+
.option("--json [payload]", "read input as JSON and print machine-readable output")).action((options) => {
|
|
16
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
17
|
+
const payload = (0, helpers_1.parseJsonInput)(options.json);
|
|
18
|
+
const record = {
|
|
19
|
+
type: "event",
|
|
20
|
+
id: (0, helpers_1.stringValue)(payload, "id", (0, ids_1.createId)("event")),
|
|
21
|
+
summary: options.summary ?? (0, helpers_1.stringValue)(payload, "summary"),
|
|
22
|
+
details: options.details ?? (0, helpers_1.stringValue)(payload, "details"),
|
|
23
|
+
files: (0, helpers_1.parseList)(options.files).length ? (0, helpers_1.parseList)(options.files) : (0, helpers_1.arrayValue)(payload, "files"),
|
|
24
|
+
tags: (0, helpers_1.parseList)(options.tags).length ? (0, helpers_1.parseList)(options.tags) : (0, helpers_1.arrayValue)(payload, "tags"),
|
|
25
|
+
...(0, helpers_1.commonRecordFields)(options, payload),
|
|
26
|
+
created_at: (0, helpers_1.stringValue)(payload, "created_at", new Date().toISOString())
|
|
27
|
+
};
|
|
28
|
+
const added = (0, store_1.appendRecord)(root, "event", record);
|
|
29
|
+
(0, helpers_1.printAdded)("event", added.id, (0, helpers_1.wantsJsonOutput)(options.json), added);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/cli/commands/event.ts"],"names":[],"mappings":";;AAgBA,oDA2BC;AA1CD,wCASoB;AACpB,wCAA0C;AAC1C,4CAAgD;AAChD,4CAAgD;AAGhD,SAAgB,oBAAoB,CAAC,OAAgB;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAEjF,IAAA,gCAAsB,EACpB,KAAK;SACF,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,eAAe,CAAC;SAC5B,MAAM,CAAC,qBAAqB,EAAE,eAAe,CAAC;SAC9C,MAAM,CAAC,qBAAqB,EAAE,eAAe,CAAC;SAC9C,MAAM,CAAC,kBAA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AAA,yBAAe,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerInitCommand = registerInitCommand;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const helpers_1 = require("../helpers");
|
|
9
|
+
const config_1 = require("../../core/config");
|
|
10
|
+
const profiles_1 = require("../../core/profiles");
|
|
11
|
+
const store_1 = require("../../core/store");
|
|
12
|
+
const paths_1 = require("../../core/paths");
|
|
13
|
+
const schemas_1 = require("../../core/schemas");
|
|
14
|
+
const renderer_1 = require("../../core/renderer");
|
|
15
|
+
function registerInitCommand(program) {
|
|
16
|
+
program
|
|
17
|
+
.command("init")
|
|
18
|
+
.description("Initialize Wikiwiki storage for this repo.")
|
|
19
|
+
.option("--profile <profile>", "first-pass wiki profile: mixed, user, developer")
|
|
20
|
+
.option("--json", "print machine-readable output")
|
|
21
|
+
.action((options) => {
|
|
22
|
+
const root = (0, paths_1.findRepoRoot)();
|
|
23
|
+
const alreadyInitialized = (0, store_1.isInitialized)(root);
|
|
24
|
+
const existingConfig = (0, config_1.readWikiwikiConfig)(root);
|
|
25
|
+
const profile = (0, profiles_1.parseWikiProfile)(options.profile ?? existingConfig.wiki_profile, "mixed");
|
|
26
|
+
(0, store_1.ensureStore)(root);
|
|
27
|
+
(0, config_1.writeWikiwikiConfig)(root, {
|
|
28
|
+
...existingConfig,
|
|
29
|
+
wiki_profile: profile
|
|
30
|
+
});
|
|
31
|
+
const renderedFiles = (0, renderer_1.renderWiki)(root);
|
|
32
|
+
const result = {
|
|
33
|
+
ok: true,
|
|
34
|
+
already_initialized: alreadyInitialized,
|
|
35
|
+
profile,
|
|
36
|
+
repo_root: (0, paths_1.reportPath)(root),
|
|
37
|
+
store_path: (0, paths_1.reportPath)((0, paths_1.wikiwikiPath)(root)),
|
|
38
|
+
wiki_path: (0, paths_1.reportPath)((0, paths_1.wikiPath)(root)),
|
|
39
|
+
record_files: schemas_1.recordTypes.map((type) => (0, paths_1.relativeReportPath)(root, (0, paths_1.recordPath)(root, type))),
|
|
40
|
+
rendered_files: renderedFiles.map((file) => (0, paths_1.relativeReportPath)(root, file))
|
|
41
|
+
};
|
|
42
|
+
if (options.json) {
|
|
43
|
+
(0, helpers_1.printJson)(result);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const state = alreadyInitialized ? "already initialized" : "initialized";
|
|
47
|
+
console.log(`Wikiwiki ${state} at ${fs_1.default.realpathSync(root)}`);
|
|
48
|
+
console.log(`Store: ${result.store_path}`);
|
|
49
|
+
console.log(`Wiki: ${result.wiki_path}`);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;AAUA,kDAuCC;AAjDD,4CAAoB;AAEpB,wCAAuC;AACvC,8CAA4E;AAC5E,kDAAuD;AACvD,4CAA8D;AAC9D,4CAAoH;AACpH,gDAAiD;AACjD,kDAAiD;AAEjD,SAAgB,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,4CAA4C,CAAC;SACzD,MAAM,CAAC,qBAAqB,EAAE,iDAAiD,CAAC;SAChF,MAAM,CAAC,QAAQ,EAAE,+BAA+B,CAAC;SACjD,MAAM,CAAC,CAAC,OAA6C,EAAE,EAAE;QACxD,MAAM,IAAI,GAAG,IAAA,oBAAY,GAAE,CAAC;QAC5B,MAAM,kBAAkB,GAAG,IAAA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