@xn-intenton-z2a/agentic-lib 7.1.7 → 7.1.9
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/bin/agentic-lib.js
CHANGED
|
@@ -625,15 +625,36 @@ function initCopyDirRecursive(srcPath, dstPath, label, excludes = []) {
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
+
function removeStaleWorkflows(templateWorkflows) {
|
|
629
|
+
const KEEP = new Set(["init.yml"]);
|
|
630
|
+
const targetWorkflowsDir = resolve(target, ".github/workflows");
|
|
631
|
+
if (!existsSync(targetWorkflowsDir)) return;
|
|
632
|
+
for (const f of readdirSync(targetWorkflowsDir)) {
|
|
633
|
+
if (f.endsWith(".yml") && !templateWorkflows.has(f) && !KEEP.has(f)) {
|
|
634
|
+
if (!dryRun) rmSync(resolve(targetWorkflowsDir, f));
|
|
635
|
+
console.log(` REMOVE stale: workflows/${f}`);
|
|
636
|
+
initChanges++;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
628
641
|
function initWorkflows() {
|
|
629
642
|
console.log("--- Workflows ---");
|
|
630
643
|
const workflowsDir = resolve(srcDir, "workflows");
|
|
631
644
|
if (!existsSync(workflowsDir)) return;
|
|
645
|
+
const templateWorkflows = new Set();
|
|
632
646
|
for (const f of readdirSync(workflowsDir)) {
|
|
633
647
|
if (f.endsWith(".yml")) {
|
|
648
|
+
templateWorkflows.add(f);
|
|
634
649
|
initCopyFile(resolve(workflowsDir, f), resolve(target, ".github/workflows", f), `workflows/${f}`);
|
|
635
650
|
}
|
|
636
651
|
}
|
|
652
|
+
const seedTest = resolve(srcDir, "seeds/test.yml");
|
|
653
|
+
if (existsSync(seedTest)) {
|
|
654
|
+
templateWorkflows.add("test.yml");
|
|
655
|
+
initCopyFile(seedTest, resolve(target, ".github/workflows/test.yml"), "workflows/test.yml (from seeds)");
|
|
656
|
+
}
|
|
657
|
+
removeStaleWorkflows(templateWorkflows);
|
|
637
658
|
}
|
|
638
659
|
|
|
639
660
|
function initActions(agenticDir) {
|
package/package.json
CHANGED
|
@@ -459,7 +459,7 @@ jobs:
|
|
|
459
459
|
- uses: actions/checkout@v4
|
|
460
460
|
with:
|
|
461
461
|
fetch-depth: 0
|
|
462
|
-
ref:
|
|
462
|
+
ref: main
|
|
463
463
|
|
|
464
464
|
- name: Load config
|
|
465
465
|
id: config
|
|
@@ -473,8 +473,8 @@ jobs:
|
|
|
473
473
|
git config --local user.name '${{ env.gitUserName }}'
|
|
474
474
|
git config --local pull.ff false # never fast-forward
|
|
475
475
|
git config --local pull.rebase false # never rebase on pull
|
|
476
|
-
git fetch origin
|
|
477
|
-
git merge origin
|
|
476
|
+
git fetch origin main
|
|
477
|
+
git merge origin/main --no-ff --no-edit --strategy=recursive --strategy-option=ours
|
|
478
478
|
|
|
479
479
|
- name: log-intention-activity
|
|
480
480
|
id: log-intention-activity
|
|
@@ -539,6 +539,6 @@ jobs:
|
|
|
539
539
|
git config --local pull.rebase false # never rebase on pull
|
|
540
540
|
git add ${{ steps.config.outputs.intentionFilepath }}
|
|
541
541
|
git commit -m "Activity logged by ci-automerge.yml" || echo "No changes to commit"
|
|
542
|
-
git fetch origin
|
|
543
|
-
git merge origin
|
|
544
|
-
git push -v origin
|
|
542
|
+
git fetch origin main
|
|
543
|
+
git merge origin/main --no-ff --no-edit --strategy=recursive --strategy-option=ours
|
|
544
|
+
git push -v origin main
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
# Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
-
# .github/workflows/ci-init.yml
|
|
4
|
-
#
|
|
5
|
-
# Pulls the latest agentic-lib infrastructure into this repository.
|
|
6
|
-
# Can optionally reset source files to the seed template state.
|
|
7
|
-
|
|
8
|
-
name: ci-init
|
|
9
|
-
run-name: "ci-init [${{ github.ref_name }}]"
|
|
10
|
-
|
|
11
|
-
on:
|
|
12
|
-
workflow_dispatch:
|
|
13
|
-
inputs:
|
|
14
|
-
purge:
|
|
15
|
-
description: "Reset source files to seed template state"
|
|
16
|
-
type: boolean
|
|
17
|
-
default: false
|
|
18
|
-
version:
|
|
19
|
-
description: "agentic-lib version to install (default: latest)"
|
|
20
|
-
type: string
|
|
21
|
-
default: "latest"
|
|
22
|
-
|
|
23
|
-
permissions:
|
|
24
|
-
contents: write
|
|
25
|
-
|
|
26
|
-
jobs:
|
|
27
|
-
init:
|
|
28
|
-
runs-on: ubuntu-latest
|
|
29
|
-
steps:
|
|
30
|
-
- uses: actions/checkout@v4
|
|
31
|
-
|
|
32
|
-
- uses: actions/setup-node@v4
|
|
33
|
-
with:
|
|
34
|
-
node-version: "24"
|
|
35
|
-
|
|
36
|
-
- name: Install agentic-lib
|
|
37
|
-
run: npm install @xn-intenton-z2a/agentic-lib@${{ inputs.version }}
|
|
38
|
-
|
|
39
|
-
- name: Run agentic-lib init
|
|
40
|
-
run: |
|
|
41
|
-
PURGE_FLAG=""
|
|
42
|
-
if [ "${{ inputs.purge }}" = "true" ]; then
|
|
43
|
-
PURGE_FLAG="--purge"
|
|
44
|
-
fi
|
|
45
|
-
npx agentic-lib init $PURGE_FLAG
|
|
46
|
-
|
|
47
|
-
- name: Install dependencies after init
|
|
48
|
-
if: inputs.purge == true
|
|
49
|
-
run: npm install
|
|
50
|
-
|
|
51
|
-
- name: Install agentic-step dependencies
|
|
52
|
-
run: |
|
|
53
|
-
cd .github/agentic-lib/actions/agentic-step
|
|
54
|
-
npm ci
|
|
55
|
-
|
|
56
|
-
- name: Verify tests pass
|
|
57
|
-
run: npm test
|
|
58
|
-
|
|
59
|
-
- name: Commit changes
|
|
60
|
-
uses: ./.github/agentic-lib/actions/commit-if-changed
|
|
61
|
-
with:
|
|
62
|
-
commit-message: "agentic-lib init${{ inputs.purge == true && ' --purge' || '' }} (v${{ inputs.version }})"
|
|
63
|
-
push-ref: ${{ github.ref_name }}
|