@xn-intenton-z2a/agentic-lib 7.4.57 → 7.4.59

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.
@@ -376,6 +376,10 @@ jobs:
376
376
  git config user.name "${TOKEN_USER}"
377
377
  git config user.email "${TOKEN_ID}+${TOKEN_USER}@users.noreply.github.com"
378
378
  git add -A
379
+ # Unstage log/screenshot/state files — these live on the agentic-lib-logs branch
380
+ git reset HEAD -- 'intentïon.md' 'SCREENSHOT_INDEX.png' 2>/dev/null || true
381
+ git reset HEAD -- agent-log-*.md 2>/dev/null || true
382
+ git reset HEAD -- agentic-lib-state.toml 2>/dev/null || true
379
383
  git diff --cached --quiet && echo "No changes" && exit 0
380
384
  VERSION=$(npx @xn-intenton-z2a/agentic-lib version 2>/dev/null || echo "latest")
381
385
  # Problem 1 fix: Don't use [skip ci] when workflow files changed.
@@ -123,6 +123,10 @@ jobs:
123
123
  git config user.name "${TOKEN_USER}"
124
124
  git config user.email "${TOKEN_ID}+${TOKEN_USER}@users.noreply.github.com"
125
125
  git add -A
126
+ # Unstage log/screenshot/state files — these live on the agentic-lib-logs branch
127
+ git reset HEAD -- 'intentïon.md' 'SCREENSHOT_INDEX.png' 2>/dev/null || true
128
+ git reset HEAD -- agent-log-*.md 2>/dev/null || true
129
+ git reset HEAD -- agentic-lib-state.toml 2>/dev/null || true
126
130
  git diff --cached --quiet && echo "No changes" && exit 0
127
131
  VERSION=$(npx @xn-intenton-z2a/agentic-lib version 2>/dev/null || echo "latest")
128
132
  git commit -m "update agentic-lib@${VERSION} [skip ci]"
@@ -281,16 +281,20 @@ jobs:
281
281
  await github.rest.git.deleteRef({ owner, repo, ref: `heads/${pr.head.ref}` });
282
282
  } catch (e) { core.info(`Could not delete branch: ${e.message}`); }
283
283
 
284
- // Label associated issue
284
+ // Close associated issues — extract from PR body (Closes #N) and branch name
285
+ const closesMatches = (pr.body || '').matchAll(/(?:Closes|Fixes|Resolves)\s+#(\d+)/gi);
286
+ const issueNums = new Set([...closesMatches].map(m => parseInt(m[1])));
285
287
  const branchPrefix = 'agentic-lib-issue-';
286
288
  if (pr.head.ref.startsWith(branchPrefix)) {
287
- const issueNum = parseInt(pr.head.ref.replace(branchPrefix, ''));
288
- if (issueNum) {
289
- try {
290
- await github.rest.issues.addLabels({ owner, repo, issue_number: issueNum, labels: ['merged'] });
291
- await github.rest.issues.removeLabel({ owner, repo, issue_number: issueNum, name: 'in-progress' });
292
- } catch (e) { /* label may not exist */ }
293
- }
289
+ const branchIssueNum = parseInt(pr.head.ref.replace(branchPrefix, ''));
290
+ if (branchIssueNum) issueNums.add(branchIssueNum);
291
+ }
292
+ for (const issueNum of issueNums) {
293
+ try {
294
+ await github.rest.issues.update({ owner, repo, issue_number: issueNum, state: 'closed' });
295
+ await github.rest.issues.addLabels({ owner, repo, issue_number: issueNum, labels: ['merged'] });
296
+ await github.rest.issues.removeLabel({ owner, repo, issue_number: issueNum, name: 'in-progress' });
297
+ } catch (e) { /* label may not exist */ }
294
298
  }
295
299
  mergedPRs.push(pr.number);
296
300
  } catch (e) {
@@ -1242,6 +1246,10 @@ jobs:
1242
1246
  npm install 2>/dev/null || true
1243
1247
 
1244
1248
  git add -A
1249
+ # Unstage log/screenshot/state files — these live on the agentic-lib-logs branch
1250
+ git reset HEAD -- 'intentïon.md' 'SCREENSHOT_INDEX.png' 2>/dev/null || true
1251
+ git reset HEAD -- agent-log-*.md 2>/dev/null || true
1252
+ git reset HEAD -- agentic-lib-state.toml 2>/dev/null || true
1245
1253
  if ! git diff --cached --quiet; then
1246
1254
  git commit -m "fix-stuck: sync with main (resolve conflicts)"
1247
1255
  git push --force-with-lease origin HEAD:"$BRANCH" 2>&1 && RESOLVED=true
@@ -1360,16 +1368,20 @@ jobs:
1360
1368
  try {
1361
1369
  await github.rest.git.deleteRef({ owner, repo, ref: `heads/${pr.head.ref}` });
1362
1370
  } catch (e) { /* branch may already be deleted */ }
1363
- // Label associated issue
1364
- const branchPrefix = 'agentic-lib-issue-';
1365
- if (pr.head.ref.startsWith(branchPrefix)) {
1366
- const issueNum = parseInt(pr.head.ref.replace(branchPrefix, ''));
1367
- if (issueNum) {
1368
- try {
1369
- await github.rest.issues.addLabels({ owner, repo, issue_number: issueNum, labels: ['merged'] });
1370
- await github.rest.issues.removeLabel({ owner, repo, issue_number: issueNum, name: 'in-progress' });
1371
- } catch (e) { /* label may not exist */ }
1372
- }
1371
+ // Close associated issues — extract from PR body (Closes #N) and branch name
1372
+ const closesMatches2 = (pr.body || '').matchAll(/(?:Closes|Fixes|Resolves)\s+#(\d+)/gi);
1373
+ const issueNums2 = new Set([...closesMatches2].map(m => parseInt(m[1])));
1374
+ const branchPrefix2 = 'agentic-lib-issue-';
1375
+ if (pr.head.ref.startsWith(branchPrefix2)) {
1376
+ const branchIssueNum = parseInt(pr.head.ref.replace(branchPrefix2, ''));
1377
+ if (branchIssueNum) issueNums2.add(branchIssueNum);
1378
+ }
1379
+ for (const issueNum of issueNums2) {
1380
+ try {
1381
+ await github.rest.issues.update({ owner, repo, issue_number: issueNum, state: 'closed' });
1382
+ await github.rest.issues.addLabels({ owner, repo, issue_number: issueNum, labels: ['merged'] });
1383
+ await github.rest.issues.removeLabel({ owner, repo, issue_number: issueNum, name: 'in-progress' });
1384
+ } catch (e) { /* label may not exist */ }
1373
1385
  }
1374
1386
  return;
1375
1387
  } catch (e) {
@@ -519,7 +519,7 @@ function removeStaleWorkflows(templateWorkflows) {
519
519
  const targetWorkflowsDir = resolve(target, ".github/workflows");
520
520
  if (!existsSync(targetWorkflowsDir)) return;
521
521
  for (const f of readdirSync(targetWorkflowsDir)) {
522
- if (f.endsWith(".yml") && !templateWorkflows.has(f)) {
522
+ if (f.startsWith("agentic-lib-") && f.endsWith(".yml") && !templateWorkflows.has(f)) {
523
523
  if (!dryRun) rmSync(resolve(targetWorkflowsDir, f));
524
524
  console.log(` REMOVE stale: workflows/${f}`);
525
525
  initChanges++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xn-intenton-z2a/agentic-lib",
3
- "version": "7.4.57",
3
+ "version": "7.4.59",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -20,12 +20,17 @@ const REPORT_DATA_DIR = "/tmp/report-data";
20
20
  async function findLatestInitRun(octokit, owner, repo) {
21
21
  try {
22
22
  const { data } = await octokit.rest.actions.listWorkflowRunsForRepo({
23
- owner, repo, per_page: 20,
23
+ owner, repo, per_page: 50,
24
24
  });
25
- const initRuns = data.workflow_runs
26
- .filter(r => r.name && r.name.includes("agentic-lib-init"))
25
+ // Look for standalone init runs or flow runs (init may be embedded in flow)
26
+ const relevantRuns = data.workflow_runs
27
+ .filter(r => r.name && (r.name.includes("agentic-lib-init") || r.name.includes("agentic-lib-flow")))
27
28
  .sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
28
- if (initRuns.length > 0) return initRuns[0].created_at;
29
+ // Prefer the most recent init run; fall back to the most recent flow run
30
+ const initRun = relevantRuns.find(r => r.name.includes("agentic-lib-init"));
31
+ const flowRun = relevantRuns.find(r => r.name.includes("agentic-lib-flow"));
32
+ const bestRun = initRun || flowRun;
33
+ if (bestRun) return bestRun.created_at;
29
34
  } catch (err) {
30
35
  core.warning(`Could not find init runs: ${err.message}`);
31
36
  }
@@ -17,7 +17,7 @@
17
17
  "author": "",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "@xn-intenton-z2a/agentic-lib": "^7.4.57"
20
+ "@xn-intenton-z2a/agentic-lib": "^7.4.59"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@playwright/test": "^1.58.0",