@xn-intenton-z2a/agentic-lib 7.1.18 → 7.1.20
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 +1 -1
- package/bin/agentic-lib.js +6 -2
- package/package.json +1 -1
- package/src/seeds/init.yml +69 -0
- package/src/seeds/zero-README.md +2 -3
- package/src/seeds/zero-package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ your-repo/
|
|
|
90
90
|
- **[USER]** -- Your files. `init` never touches these. `init --purge` resets them to seed state.
|
|
91
91
|
- **[GENERATED]** -- Created by the agentic workflows during operation.
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
The `init.yml` workflow is distributed from seeds (like `test.yml`) and runs `npx @xn-intenton-z2a/agentic-lib init --purge` on a daily schedule to keep infrastructure up to date.
|
|
94
94
|
|
|
95
95
|
### What You Need Before Running `init`
|
|
96
96
|
|
package/bin/agentic-lib.js
CHANGED
|
@@ -626,11 +626,10 @@ function initCopyDirRecursive(srcPath, dstPath, label, excludes = []) {
|
|
|
626
626
|
}
|
|
627
627
|
|
|
628
628
|
function removeStaleWorkflows(templateWorkflows) {
|
|
629
|
-
const KEEP = new Set(["init.yml"]);
|
|
630
629
|
const targetWorkflowsDir = resolve(target, ".github/workflows");
|
|
631
630
|
if (!existsSync(targetWorkflowsDir)) return;
|
|
632
631
|
for (const f of readdirSync(targetWorkflowsDir)) {
|
|
633
|
-
if (f.endsWith(".yml") && !templateWorkflows.has(f)
|
|
632
|
+
if (f.endsWith(".yml") && !templateWorkflows.has(f)) {
|
|
634
633
|
if (!dryRun) rmSync(resolve(targetWorkflowsDir, f));
|
|
635
634
|
console.log(` REMOVE stale: workflows/${f}`);
|
|
636
635
|
initChanges++;
|
|
@@ -654,6 +653,11 @@ function initWorkflows() {
|
|
|
654
653
|
templateWorkflows.add("test.yml");
|
|
655
654
|
initCopyFile(seedTest, resolve(target, ".github/workflows/test.yml"), "workflows/test.yml (from seeds)");
|
|
656
655
|
}
|
|
656
|
+
const seedInit = resolve(srcDir, "seeds/init.yml");
|
|
657
|
+
if (existsSync(seedInit)) {
|
|
658
|
+
templateWorkflows.add("init.yml");
|
|
659
|
+
initCopyFile(seedInit, resolve(target, ".github/workflows/init.yml"), "workflows/init.yml (from seeds)");
|
|
660
|
+
}
|
|
657
661
|
removeStaleWorkflows(templateWorkflows);
|
|
658
662
|
}
|
|
659
663
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
+
# .github/workflows/init.yml
|
|
4
|
+
#
|
|
5
|
+
# Daily lifecycle: update agentic-lib, run init --purge, test, PR, automerge.
|
|
6
|
+
# Keeps the repository current with the latest SDK infrastructure.
|
|
7
|
+
|
|
8
|
+
name: init
|
|
9
|
+
run-name: "init [${{ github.ref_name }}]"
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
schedule:
|
|
13
|
+
- cron: "0 5 * * *"
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
permissions: write-all
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
init:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
token: ${{ secrets.WORKFLOW_TOKEN }}
|
|
25
|
+
|
|
26
|
+
- uses: actions/setup-node@v4
|
|
27
|
+
with:
|
|
28
|
+
node-version: "24"
|
|
29
|
+
|
|
30
|
+
- name: Create init branch
|
|
31
|
+
run: |
|
|
32
|
+
BRANCH="agentic-lib-init-$(date -u +%Y%m%d)"
|
|
33
|
+
git checkout -b "$BRANCH"
|
|
34
|
+
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
|
35
|
+
|
|
36
|
+
- name: Update agentic-lib to latest
|
|
37
|
+
run: npm update @xn-intenton-z2a/agentic-lib
|
|
38
|
+
|
|
39
|
+
- name: Run init --purge
|
|
40
|
+
run: npx @xn-intenton-z2a/agentic-lib init --purge
|
|
41
|
+
|
|
42
|
+
- run: npm install
|
|
43
|
+
|
|
44
|
+
- name: Install agentic-step deps
|
|
45
|
+
run: cd .github/agentic-lib/actions/agentic-step && npm ci
|
|
46
|
+
|
|
47
|
+
- run: npm test
|
|
48
|
+
|
|
49
|
+
- name: Commit and push
|
|
50
|
+
run: |
|
|
51
|
+
git config user.email "action@github.com"
|
|
52
|
+
git config user.name "GitHub Actions[bot]"
|
|
53
|
+
git add -A
|
|
54
|
+
git diff --cached --quiet && echo "No changes" && exit 0
|
|
55
|
+
VERSION=$(npx @xn-intenton-z2a/agentic-lib version 2>/dev/null || echo "latest")
|
|
56
|
+
git commit -m "init --purge (agentic-lib@${VERSION})"
|
|
57
|
+
git push origin "$BRANCH"
|
|
58
|
+
|
|
59
|
+
- name: Create PR
|
|
60
|
+
if: success()
|
|
61
|
+
env:
|
|
62
|
+
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
|
|
63
|
+
run: |
|
|
64
|
+
gh pr create \
|
|
65
|
+
--title "init --purge ($(date -u +%Y-%m-%d))" \
|
|
66
|
+
--body "Nightly init --purge. Auto-labelled for automerge." \
|
|
67
|
+
--label automerge \
|
|
68
|
+
--base main \
|
|
69
|
+
--head "$BRANCH"
|
package/src/seeds/zero-README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# repo
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A JavaScript library that is immediately useful to something or someone and it immediately available to run e.g. `npx @xn-intenton-z2a/<this package name>`.
|
|
4
4
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
7
7
|
1. Write your mission in `MISSION.md`
|
|
8
8
|
2. Enable GitHub Actions
|
|
9
|
-
3. The
|
|
9
|
+
3. The workflows in this repository will evolve `src/lib/main.js` toward your mission
|
|
10
10
|
|
|
11
11
|
## Links
|
|
12
12
|
|
|
13
|
-
- [intentïon agentic-lib](https://github.com/xn-intenton-z2a/agentic-lib)
|
|
14
13
|
- [MISSION.md](MISSION.md)
|