@chronova/wiki-agent 1.4.0 → 1.5.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/dist/agent.js +6 -12
- package/dist/flatten-wiki.d.ts +1 -0
- package/dist/flatten-wiki.js +1 -0
- package/package.json +3 -2
package/dist/agent.js
CHANGED
|
@@ -209,20 +209,14 @@ async function createWorkflowFile(projectRoot, wikiPublish) {
|
|
|
209
209
|
" with:",
|
|
210
210
|
" token: ${{ steps.token.outputs.token || secrets.GITHUB_TOKEN }}",
|
|
211
211
|
"",
|
|
212
|
-
" - name: Set up
|
|
213
|
-
" uses:
|
|
214
|
-
" with:",
|
|
215
|
-
' node-version: "25"',
|
|
212
|
+
" - name: Set up Bun",
|
|
213
|
+
" uses: oven-sh/setup-bun@v2",
|
|
216
214
|
"",
|
|
217
|
-
" - name:
|
|
218
|
-
" run:
|
|
219
|
-
" git clone --branch main --depth 1 https://github.com/nx-solutions-ug/wiki-agent.git /tmp/wiki-agent",
|
|
220
|
-
" cd /tmp/wiki-agent",
|
|
221
|
-
" npm install",
|
|
222
|
-
" npx tsc -p tsconfig.json",
|
|
215
|
+
" - name: Install Wiki Agent",
|
|
216
|
+
" run: bun add -g @chronova/wiki-agent",
|
|
223
217
|
"",
|
|
224
218
|
" - name: Run Wiki Agent",
|
|
225
|
-
` run:
|
|
219
|
+
` run: wiki ${runFlags}`,
|
|
226
220
|
" env:",
|
|
227
221
|
" WIKI_OLLAMA_MODE: cloud",
|
|
228
222
|
' WIKI_OLLAMA_API_KEY: ${{ secrets.WIKI_OLLAMA_API_KEY }}',
|
|
@@ -250,7 +244,7 @@ async function createWorkflowFile(projectRoot, wikiPublish) {
|
|
|
250
244
|
"",
|
|
251
245
|
];
|
|
252
246
|
if (wikiPublish) {
|
|
253
|
-
workflow.push(" - name: Repository coordinates", " id: coords", " run: echo \"owner_repo=${GITHUB_REPOSITORY}\" >> $GITHUB_OUTPUT", "", " - name: Detect wiki initialization", " id: wiki-init", " env:", " TOKEN: ${{ secrets.WIKI_PUSH_TOKEN || steps.token.outputs.token || secrets.GITHUB_TOKEN }}", " run: |", " REMOTE=\"https://x-access-token:${TOKEN}@github.com/${{ steps.coords.outputs.owner_repo }}.wiki.git\"", " if git ls-remote --exit-code \"$REMOTE\" HEAD >/dev/null 2>&1; then", " echo \"initialized=true\" >> $GITHUB_OUTPUT", " else", " echo \"initialized=false\" >> $GITHUB_OUTPUT", " echo \"::warning::Wiki is not initialized. Create the first page in the GitHub UI (Wiki tab -> New Page), then rerun. Staging PR will still be opened.\" >> $GITHUB_OUTPUT", " fi", "", " - name: Publish to wiki repo", " id: publish", " if: steps.report.outputs.has_changes == 'true' && steps.wiki-init.outputs.initialized == 'true'", " env:", " TOKEN: ${{ secrets.WIKI_PUSH_TOKEN || steps.token.outputs.token || secrets.GITHUB_TOKEN }}", " run: |", " WIKI_URL=\"https://x-access-token:${TOKEN}@github.com/${{ steps.coords.outputs.owner_repo }}.wiki.git\"", " rm -rf /tmp/wiki /tmp/wiki-flat", "
|
|
247
|
+
workflow.push(" - name: Repository coordinates", " id: coords", " run: echo \"owner_repo=${GITHUB_REPOSITORY}\" >> $GITHUB_OUTPUT", "", " - name: Detect wiki initialization", " id: wiki-init", " env:", " TOKEN: ${{ secrets.WIKI_PUSH_TOKEN || steps.token.outputs.token || secrets.GITHUB_TOKEN }}", " run: |", " REMOTE=\"https://x-access-token:${TOKEN}@github.com/${{ steps.coords.outputs.owner_repo }}.wiki.git\"", " if git ls-remote --exit-code \"$REMOTE\" HEAD >/dev/null 2>&1; then", " echo \"initialized=true\" >> $GITHUB_OUTPUT", " else", " echo \"initialized=false\" >> $GITHUB_OUTPUT", " echo \"::warning::Wiki is not initialized. Create the first page in the GitHub UI (Wiki tab -> New Page), then rerun. Staging PR will still be opened.\" >> $GITHUB_OUTPUT", " fi", "", " - name: Publish to wiki repo", " id: publish", " if: steps.report.outputs.has_changes == 'true' && steps.wiki-init.outputs.initialized == 'true'", " env:", " TOKEN: ${{ secrets.WIKI_PUSH_TOKEN || steps.token.outputs.token || secrets.GITHUB_TOKEN }}", " run: |", " WIKI_URL=\"https://x-access-token:${TOKEN}@github.com/${{ steps.coords.outputs.owner_repo }}.wiki.git\"", " rm -rf /tmp/wiki /tmp/wiki-flat", " wiki-flatten \"$GITHUB_WORKSPACE/.wiki\" /tmp/wiki-flat", " git clone \"$WIKI_URL\" /tmp/wiki", " cd /tmp/wiki", " # rsync the flattened wiki output (flat names, Home.md, _Sidebar.md).", " # --exclude='.git' protects the wiki clone's .git directory from --delete.", " rsync -a --delete \\", " --exclude='.git' \\", " /tmp/wiki-flat/ ./", " git add -A", " if ! git diff --cached --quiet; then", " git -c user.name='wiki-agent[bot]' -c user.email='bot@wiki-agent' \\", " commit -m \"docs: update wiki\"", " if ! git push origin master 2>&1 | tee /tmp/wiki-push.log; then", " echo \"::error::Failed to push to the wiki repo. Ensure the GitHub App has contents:write on the repository (which covers the wiki), or set a WIKI_PUSH_TOKEN secret with repo scope.\"", " exit 1", " fi", " echo \"published=true\" >> $GITHUB_OUTPUT", " else", " echo \"::warning::No net wiki content changes after sync; skipping wiki push.\"", " echo \"published=false\" >> $GITHUB_OUTPUT", " fi");
|
|
254
248
|
}
|
|
255
249
|
workflow.push(" - name: Create wiki staging snapshot pull request", " uses: peter-evans/create-pull-request@v8", " if: steps.report.outputs.has_changes == 'true'", " with:", " token: ${{ secrets.WIKI_PUSH_TOKEN || steps.token.outputs.token || secrets.GITHUB_TOKEN }}", " branch: wiki/staging-${{ steps.timestamp.outputs.timestamp }}", " add-paths: .wiki", ' title: "docs: wiki staging snapshot"', ' body: ${{ steps.report.outputs.body }}');
|
|
256
250
|
await writeFile(workflowPath, workflow.join("\n") + "\n", "utf8");
|
package/dist/flatten-wiki.d.ts
CHANGED
package/dist/flatten-wiki.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chronova/wiki-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Standalone Ollama-only documentation agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"wiki": "dist/cli.js"
|
|
7
|
+
"wiki": "dist/cli.js",
|
|
8
|
+
"wiki-flatten": "dist/flatten-wiki.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
10
11
|
"dist",
|