@xn-intenton-z2a/agentic-lib 7.1.29 → 7.1.31

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.
@@ -814,7 +814,7 @@ function initPurge(seedsDir) {
814
814
  clearAndRecreateDir(sourcePath, sourcePath);
815
815
  clearAndRecreateDir(testsPath, testsPath);
816
816
 
817
- // Copy seed files
817
+ // Copy seed files (including config TOML)
818
818
  const SEED_MAP = {
819
819
  "zero-main.js": "src/lib/main.js",
820
820
  "zero-main.test.js": "tests/unit/main.test.js",
@@ -822,6 +822,7 @@ function initPurge(seedsDir) {
822
822
  "zero-SOURCES.md": "SOURCES.md",
823
823
  "zero-package.json": "package.json",
824
824
  "zero-README.md": "README.md",
825
+ "zero-agentic-lib.toml": "agentic-lib.toml",
825
826
  };
826
827
  for (const [seedFile, targetRel] of Object.entries(SEED_MAP)) {
827
828
  const src = resolve(seedsDir, seedFile);
@@ -831,6 +832,114 @@ function initPurge(seedsDir) {
831
832
  }
832
833
  }
833
834
 
835
+ function initPurgeGitHub() {
836
+ console.log("\n--- Purge: Close GitHub Issues + Lock Discussions ---");
837
+
838
+ // Detect the GitHub repo from git remote
839
+ let repoSlug = "";
840
+ try {
841
+ const remoteUrl = execSync("git remote get-url origin", {
842
+ cwd: target,
843
+ encoding: "utf8",
844
+ timeout: 10000,
845
+ }).trim();
846
+ // Parse owner/repo from git@github.com:owner/repo.git or https://github.com/owner/repo.git
847
+ const match = remoteUrl.match(/github\.com[:/]([^/]+\/[^/.]+)/);
848
+ if (match) repoSlug = match[1].replace(/\.git$/, "");
849
+ } catch {
850
+ console.log(" SKIP: Not a git repo or no origin remote — skipping GitHub purge");
851
+ return;
852
+ }
853
+ if (!repoSlug) {
854
+ console.log(" SKIP: Could not detect GitHub repo from remote — skipping GitHub purge");
855
+ return;
856
+ }
857
+
858
+ // Check gh CLI is available
859
+ try {
860
+ execSync("gh --version", { encoding: "utf8", timeout: 5000, stdio: "pipe" });
861
+ } catch {
862
+ console.log(" SKIP: gh CLI not found — skipping GitHub purge");
863
+ return;
864
+ }
865
+
866
+ // Close all open issues
867
+ try {
868
+ const issuesJson = execSync(
869
+ `gh issue list --repo ${repoSlug} --state open --json number,title --limit 100`,
870
+ { cwd: target, encoding: "utf8", timeout: 30000, stdio: ["pipe", "pipe", "pipe"] },
871
+ );
872
+ const issues = JSON.parse(issuesJson || "[]");
873
+ if (issues.length === 0) {
874
+ console.log(" No open issues to close");
875
+ } else {
876
+ for (const issue of issues) {
877
+ console.log(` CLOSE: issue #${issue.number} — ${issue.title}`);
878
+ if (!dryRun) {
879
+ try {
880
+ execSync(
881
+ `gh issue close ${issue.number} --repo ${repoSlug} --comment "Closed by init --purge (mission reset)"`,
882
+ { cwd: target, encoding: "utf8", timeout: 15000, stdio: "pipe" },
883
+ );
884
+ initChanges++;
885
+ } catch (err) {
886
+ console.log(` WARN: Failed to close issue #${issue.number}: ${err.message}`);
887
+ }
888
+ } else {
889
+ initChanges++;
890
+ }
891
+ }
892
+ }
893
+ } catch (err) {
894
+ console.log(` WARN: Could not list issues: ${err.message}`);
895
+ }
896
+
897
+ // Close open discussions
898
+ const [owner, repo] = repoSlug.split("/");
899
+ try {
900
+ const query = JSON.stringify({
901
+ query: `{ repository(owner:"${owner}", name:"${repo}") { discussions(first:50, states:OPEN) { nodes { id number title } } } }`,
902
+ });
903
+ const result = execSync(`gh api graphql --input -`, {
904
+ cwd: target,
905
+ encoding: "utf8",
906
+ timeout: 30000,
907
+ input: query,
908
+ stdio: ["pipe", "pipe", "pipe"],
909
+ });
910
+ const parsed = JSON.parse(result);
911
+ const discussions = parsed?.data?.repository?.discussions?.nodes || [];
912
+ if (discussions.length === 0) {
913
+ console.log(" No open discussions to close");
914
+ } else {
915
+ for (const disc of discussions) {
916
+ console.log(` CLOSE: discussion #${disc.number} — ${disc.title}`);
917
+ if (!dryRun) {
918
+ try {
919
+ const mutation = JSON.stringify({
920
+ query: `mutation { closeDiscussion(input: { discussionId: "${disc.id}" }) { discussion { number } } }`,
921
+ });
922
+ execSync(`gh api graphql --input -`, {
923
+ cwd: target,
924
+ encoding: "utf8",
925
+ timeout: 15000,
926
+ input: mutation,
927
+ stdio: ["pipe", "pipe", "pipe"],
928
+ });
929
+ initChanges++;
930
+ } catch {
931
+ console.log(` SKIP: Could not close discussion #${disc.number} (may need admin permissions)`);
932
+ }
933
+ } else {
934
+ initChanges++;
935
+ }
936
+ }
937
+ }
938
+ } catch {
939
+ console.log(" SKIP: Could not list discussions (feature may not be enabled)");
940
+ }
941
+ }
942
+
834
943
  function runInit() {
835
944
  if (!existsSync(target)) {
836
945
  console.error(`Target directory does not exist: ${target}`);
@@ -862,6 +971,7 @@ function runInit() {
862
971
  initConfig(seedsDir);
863
972
  if (reseed) initReseed();
864
973
  if (purge) initPurge(seedsDir);
974
+ if (purge) initPurgeGitHub();
865
975
 
866
976
  console.log(`\n${initChanges} change(s)${dryRun ? " (dry run)" : ""}`);
867
977
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xn-intenton-z2a/agentic-lib",
3
- "version": "7.1.29",
3
+ "version": "7.1.31",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -81,7 +81,9 @@ export async function reviewIssue(context) {
81
81
  writablePaths: [],
82
82
  });
83
83
 
84
- if (verdict.toUpperCase().startsWith("RESOLVED")) {
84
+ // Strip leading markdown formatting (e.g., **RESOLVED** or *RESOLVED*)
85
+ const normalised = verdict.replace(/^[*_`#>\s-]+/, "").toUpperCase();
86
+ if (normalised.startsWith("RESOLVED")) {
85
87
  await octokit.rest.issues.createComment({
86
88
  ...repo,
87
89
  issue_number: Number(targetIssueNumber),
@@ -8,16 +8,16 @@ paths:
8
8
  path: "MISSION.md"
9
9
  librarySourcesFilepath:
10
10
  path: "SOURCES.md"
11
- permissions: []
12
- limit: 0
11
+ permissions: ["write"]
12
+ limit: 32
13
13
  libraryDocumentsPath:
14
14
  path: "library/"
15
- permissions: []
16
- limit: 0
15
+ permissions: ["write"]
16
+ limit: 32
17
17
  featuresPath:
18
18
  path: "features/"
19
19
  permissions: ["write"]
20
- limit: 2
20
+ limit: 4
21
21
 
22
22
  # Filepaths for engineer workflows
23
23
  contributingFilepath:
@@ -0,0 +1,3 @@
1
+ # Mission
2
+
3
+ Describe your project's mission here. The agentic workflows will evolve `src/lib/main.js` to fulfil this mission.
@@ -1,3 +1,14 @@
1
1
  # Mission
2
2
 
3
- Describe your project's mission here. The agentic workflows will evolve `src/lib/main.js` to fulfil this mission.
3
+ _"Be a go-to plot library with a CLI, be the jq of formulae visualisations."_
4
+
5
+ **plot-code-lib** is a JavaScript library and CLI tool designed to:
6
+ - Transform and given range and a simple expression syntax for (pick an existing open standard) to time series data.
7
+ - Read and write the time series data in a standard format (pick an existing open standard).
8
+ - Make use of libraries for formula parsing, time series generation, plotting, and persistence in image formats.
9
+ - Generate SVG and PNG plots from the time series data and save these as files.
10
+ - Variations on this example: `node run start -- --expression "y=sin(x)" --range "x=-1:-1,y=-1:-1" --file output.svg` .
11
+ - Showcase all the features of the library via a CLI by dry running tp generate example commands and output in the README.md file.
12
+
13
+ `plot-code-lib` facilitate the creation of plots from mathematical expressions and time series data. It will take a
14
+ mathematical expression and a range of values and generate a plot in SVG or PNG format.
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.29"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.31"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",
@@ -12,7 +12,7 @@
12
12
  # 2. Proactive (supervise job): LLM-driven strategic decisions via agentic-step.
13
13
  # - Gathers full repo context (issues, PRs, workflows, features, activity)
14
14
  # - Chooses actions: dispatch workflows, create/label/close issues, respond to discussions
15
- # - Runs on workflow_dispatch or schedule (set via agent-supervisor-schedule.yml)
15
+ # - Runs on every trigger (workflow_run, workflow_dispatch, schedule)
16
16
 
17
17
  name: agent-supervisor
18
18
  run-name: "agent-supervisor [${{ github.ref_name }}]"
@@ -175,7 +175,7 @@ jobs:
175
175
  # ─── Proactive: LLM-driven strategic decisions ───────────────────────
176
176
  supervise:
177
177
  needs: params
178
- if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
178
+ if: always() && needs.params.result == 'success'
179
179
  runs-on: ubuntu-latest
180
180
  steps:
181
181
  - uses: actions/checkout@v4