@chronova/wiki-agent 1.3.0 → 1.3.1

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/README.md CHANGED
@@ -109,21 +109,20 @@ Environment variables take priority over config files.
109
109
 
110
110
  ## GitHub Actions
111
111
 
112
- Running `wiki --init` automatically creates `.github/workflows/update-wiki.yml` in your repo. The workflow publishes generated pages to your repository's **GitHub Wiki tab**, not to the main repo's file tree:
112
+ Running `wiki --init --wiki` automatically creates `.github/workflows/update-wiki.yml` in your repo. With `--wiki`, the workflow publishes generated pages to your repository's **GitHub Wiki tab**; without `--wiki` it only stages `.wiki/` and opens a staging PR.
113
113
 
114
114
  1. Generates a GitHub App token if `APP_CLIENT_ID` and `APP_PRIVATE_KEY` secrets are set (falls back to `GITHUB_TOKEN`)
115
115
  2. Checks out your repo, clones and builds wiki-agent from `nx-solutions-ug/wiki-agent`
116
- 3. Runs `wiki --update --print` with your Ollama Cloud credentials, staging pages under `.wiki/`
116
+ 3. Runs `wiki --update --print --verbose` (with `--wiki` if the flag was passed at `--init` time), staging pages under `.wiki/`
117
117
  4. Probes the wiki remote (`<repo>.wiki.git`) with `git ls-remote` to detect whether the wiki has been initialized
118
- 5. If there are content changes and the wiki is initialized: clones `<repo>.wiki.git`, syncs the `.wiki/` content (excluding `config.json`, `.last-update-report.md`, `.last-updated.json`) via `rsync`, commits on a `wiki/update-<timestamp>` branch, and pushes
119
- 6. Opens a pull request against the wiki repo (`--repo <owner>/<repo>.wiki`, base `master`) with `.wiki/.last-update-report.md` as the body a human merges to make updates live
120
- 7. Always opens a `docs: wiki staging snapshot` pull request against the main repo with the `.wiki/` changes, so the staged content stays auditable
118
+ 5. If there are content changes and the wiki is initialized: clones `<repo>.wiki.git`, syncs the staged `.wiki/` content (excluding `config.json` and the run metadata) via `rsync`, commits, and **pushes directly to `master`** — the wiki goes live immediately (no PR, no review gate)
119
+ 6. Always opens a `docs: wiki staging snapshot` pull request against the main repo with the `.wiki/` changes, so the staged content stays auditable
121
120
 
122
121
  ### Bootstrap the wiki first
123
122
 
124
123
  GitHub wikis must be initialized once through the UI before they can be pushed to programmatically. Open the **Wiki** tab in your repository, create the first page (any content), then run the workflow. Until then the publish step is skipped with a warning; the staging PR still opens so you can inspect the generated content.
125
124
 
126
- The full workflow is written to `.github/workflows/update-wiki.yml` by `wiki --init`. See that file (or the template in [`src/agent.ts`](src/agent.ts) `createWorkflowFile`) for the authoritative, current definition. The steps in brief: generate token → checkout → build wiki-agent → run `--update --print` → probe wiki remote → if there are content changes and the wiki is initialized, clone `<repo>.wiki.git`, `rsync` the staged `.wiki/` content (excluding `config.json` and the run metadata), commit on `wiki/update-<timestamp>`, push → open a PR against the wiki repo (base `master`) → open a `docs: wiki staging snapshot` PR against the main repo.
125
+ The full workflow is written to `.github/workflows/update-wiki.yml` by `wiki --init`. See that file (or the template in [`src/agent.ts`](src/agent.ts) `createWorkflowFile`) for the authoritative, current definition.
127
126
 
128
127
  ### Required secrets
129
128
 
package/dist/agent.js CHANGED
@@ -250,7 +250,7 @@ async function createWorkflowFile(projectRoot, wikiPublish) {
250
250
  "",
251
251
  ];
252
252
  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: |", " BRANCH=\"wiki/update-${{ steps.timestamp.outputs.timestamp }}\"", " WIKI_URL=\"https://x-access-token:${TOKEN}@github.com/${{ steps.coords.outputs.owner_repo }}.wiki.git\"", " rm -rf /tmp/wiki", " git clone \"$WIKI_URL\" /tmp/wiki", " cd /tmp/wiki", " git checkout -b \"$BRANCH\"", " # --exclude='.git' protects the wiki clone's .git directory from --delete.", " rsync -a --delete \\", " --exclude='.git' \\", " --exclude='.last-update-report.md' \\", " --exclude='.last-updated.json' \\", " --exclude='config.json' \\", " \"$GITHUB_WORKSPACE/.wiki/\" ./", " 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 \"$BRANCH\" 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 \"branch=$BRANCH\" >> $GITHUB_OUTPUT", " else", " echo \"::warning::No net wiki content changes after sync; skipping wiki push.\"", " echo \"branch=\" >> $GITHUB_OUTPUT", " fi", "", " - name: Open wiki update pull request", " if: steps.report.outputs.has_changes == 'true' && steps.wiki-init.outputs.initialized == 'true' && steps.publish.outputs.branch != ''", " env:", " GH_TOKEN: ${{ secrets.WIKI_PUSH_TOKEN || steps.token.outputs.token || secrets.GITHUB_TOKEN }}", " run: |", " gh pr create --repo \"${{ steps.coords.outputs.owner_repo }}.wiki\" \\", " --head \"wiki/update-${{ steps.timestamp.outputs.timestamp }}\" \\", " --base master \\", " --title \"docs: update wiki\" \\", " --body-file .wiki/.last-update-report.md", "");
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", " git clone \"$WIKI_URL\" /tmp/wiki", " cd /tmp/wiki", " # --exclude='.git' protects the wiki clone's .git directory from --delete.", " rsync -a --delete \\", " --exclude='.git' \\", " --exclude='.last-update-report.md' \\", " --exclude='.last-updated.json' \\", " --exclude='config.json' \\", " \"$GITHUB_WORKSPACE/.wiki/\" ./", " 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
254
  }
255
255
  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
256
  await writeFile(workflowPath, workflow.join("\n") + "\n", "utf8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chronova/wiki-agent",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Standalone Ollama-only documentation agent",
5
5
  "type": "module",
6
6
  "bin": {