@xn-intenton-z2a/agentic-lib 7.1.54 → 7.1.56

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.
@@ -40,15 +40,23 @@ runs:
40
40
  git commit -m "${{ inputs.commit-message }}"
41
41
  REF="${{ inputs.push-ref }}"
42
42
  MAX_RETRIES=3
43
+ REMOTE_REF_EXISTS=""
44
+ if [ -n "$REF" ]; then
45
+ git ls-remote --exit-code origin "$REF" > /dev/null 2>&1 && REMOTE_REF_EXISTS="true"
46
+ else
47
+ REMOTE_REF_EXISTS="true"
48
+ fi
43
49
  for attempt in $(seq 1 $MAX_RETRIES); do
44
50
  if [ -n "$REF" ]; then
45
- git pull --rebase origin "$REF" || {
46
- echo "Rebase conflict on attempt $attempt aborting rebase and retrying"
47
- git rebase --abort 2>/dev/null || true
48
- sleep $((attempt * 2))
49
- continue
50
- }
51
- git push origin "$REF" && break
51
+ if [ "$REMOTE_REF_EXISTS" = "true" ]; then
52
+ git pull --rebase origin "$REF" || {
53
+ echo "Rebase conflict on attempt $attempt — aborting rebase and retrying"
54
+ git rebase --abort 2>/dev/null || true
55
+ sleep $((attempt * 2))
56
+ continue
57
+ }
58
+ fi
59
+ git push origin "$REF" && { REMOTE_REF_EXISTS="true"; break; }
52
60
  else
53
61
  git pull --rebase || {
54
62
  echo "Rebase conflict on attempt $attempt — aborting rebase and retrying"
@@ -0,0 +1,36 @@
1
+ // SPDX-License-Identifier: GPL-3.0-only
2
+ // Copyright (C) 2025-2026 Polycode Limited
3
+ // src/dist-transform.js — #@dist marker transform for distribution
4
+
5
+ /**
6
+ * Apply #@dist transforms to file content for distribution.
7
+ *
8
+ * Two patterns:
9
+ * 1. Line starts with "#@dist " — uncomment by removing the "#@dist " prefix
10
+ * e.g. "#@dist schedule:" → "schedule:"
11
+ * 2. Line contains " #@dist <value>" suffix — replace the preceding value
12
+ * e.g. 'default: true #@dist false' → 'default: false'
13
+ * e.g. 'mission = "test/MISSION.md" #@dist "MISSION.md"' → 'mission = "MISSION.md"'
14
+ */
15
+ export function applyDistTransform(content) {
16
+ return content
17
+ .split("\n")
18
+ .map((line) => {
19
+ // Pattern 1: line starts with #@dist — uncomment
20
+ const commentMatch = line.match(/^(\s*)#@dist (.*)$/);
21
+ if (commentMatch) {
22
+ return commentMatch[1] + commentMatch[2];
23
+ }
24
+ // Pattern 2: inline #@dist <replacement> — replace preceding value
25
+ const inlineMatch = line.match(/^(.+?)\s+#@dist\s+(.+)$/); // eslint-disable-line sonarjs/slow-regex
26
+ if (inlineMatch) {
27
+ const before = inlineMatch[1];
28
+ const replacement = inlineMatch[2];
29
+ // Replace the last value token on the line before #@dist
30
+ // Handles: 'key: value' (YAML) and 'key = "value"' (TOML)
31
+ return before.replace(/(:\s*|=\s*)(\S+)\s*$/, `$1${replacement}`); // eslint-disable-line sonarjs/slow-regex
32
+ }
33
+ return line;
34
+ })
35
+ .join("\n");
36
+ }
@@ -4,3 +4,5 @@ Reference material and documentation sources for this project.
4
4
 
5
5
  Add URLs, papers, API docs, or other reference material here.
6
6
  The maintain-library workflow will process these into `library/` documents.
7
+
8
+ - https://en.wikipedia.org/wiki/Fizz_buzz
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.54"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.56"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.18",
@@ -1,39 +0,0 @@
1
- # SPDX-License-Identifier: MIT
2
- # Copyright (C) 2025-2026 Polycode Limited
3
- # agentic-lib.toml — Configuration for agentic-lib workflows
4
- #
5
- # This file controls how agentic workflows operate on your repository.
6
- # Place it at the root of your project.
7
-
8
- [schedule]
9
- supervisor = "daily" # off | weekly | daily | hourly | continuous
10
- model = "gpt-5-mini" # gpt-5-mini | claude-sonnet-4 | gpt-4.1
11
-
12
- [paths]
13
- mission = "MISSION.md"
14
- source = "src/lib/"
15
- tests = "tests/unit/"
16
- features = "features/"
17
- library = "library/"
18
- docs = "docs/"
19
- examples = "examples/"
20
- readme = "README.md"
21
- dependencies = "package.json"
22
- contributing = "CONTRIBUTING.md"
23
- library-sources = "SOURCES.md"
24
-
25
- [execution]
26
- build = "npm run build"
27
- test = "npm test"
28
- start = "npm run start"
29
-
30
- [limits]
31
- feature-issues = 5
32
- maintenance-issues = 1
33
- attempts-per-branch = 3
34
- attempts-per-issue = 2
35
- features-limit = 4
36
- library-limit = 32
37
-
38
- [bot]
39
- log-file = "intentïon.md"