@xn-intenton-z2a/agentic-lib 7.1.42 → 7.1.44

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.
@@ -958,6 +958,52 @@ function initPurgeGitHub() {
958
958
  } catch {
959
959
  console.log(" SKIP: Could not list discussions (feature may not be enabled)");
960
960
  }
961
+
962
+ // Create a new "Talk to the repository" discussion
963
+ try {
964
+ // Get the repository node ID and "General" category ID
965
+ const repoQuery = JSON.stringify({
966
+ query: `{ repository(owner:"${owner}", name:"${repo}") { id discussionCategories(first:20) { nodes { id name } } } }`,
967
+ });
968
+ const repoResult = execSync(`gh api graphql --input -`, {
969
+ cwd: target,
970
+ encoding: "utf8",
971
+ timeout: 30000,
972
+ input: repoQuery,
973
+ stdio: ["pipe", "pipe", "pipe"],
974
+ });
975
+ const repoParsed = JSON.parse(repoResult);
976
+ const repoId = repoParsed?.data?.repository?.id;
977
+ const categories = repoParsed?.data?.repository?.discussionCategories?.nodes || [];
978
+ const generalCat = categories.find((c) => c.name === "General");
979
+ if (!repoId || !generalCat) {
980
+ console.log(' SKIP: Could not find repository ID or "General" discussion category');
981
+ } else {
982
+ console.log(' CREATE: discussion "Talk to the repository" in General category');
983
+ if (!dryRun) {
984
+ const createMutation = JSON.stringify({
985
+ query: `mutation { createDiscussion(input: { repositoryId: "${repoId}", categoryId: "${generalCat.id}", title: "Talk to the repository", body: "This discussion is the main channel for interacting with the repository's autonomous agents.\\n\\nUse this thread to:\\n- Submit feature requests or ideas\\n- Ask questions about the project\\n- Chat with the discussions bot\\n\\n---\\n*Created by init --purge*" }) { discussion { number url } } }`,
986
+ });
987
+ const createResult = execSync(`gh api graphql --input -`, {
988
+ cwd: target,
989
+ encoding: "utf8",
990
+ timeout: 15000,
991
+ input: createMutation,
992
+ stdio: ["pipe", "pipe", "pipe"],
993
+ });
994
+ const createParsed = JSON.parse(createResult);
995
+ const newDisc = createParsed?.data?.createDiscussion?.discussion;
996
+ if (newDisc) {
997
+ console.log(` CREATED: discussion #${newDisc.number} — ${newDisc.url}`);
998
+ initChanges++;
999
+ }
1000
+ } else {
1001
+ initChanges++;
1002
+ }
1003
+ }
1004
+ } catch (err) {
1005
+ console.log(` SKIP: Could not create discussion (${err.message})`);
1006
+ }
961
1007
  }
962
1008
 
963
1009
  function runInit() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xn-intenton-z2a/agentic-lib",
3
- "version": "7.1.42",
3
+ "version": "7.1.44",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -109,6 +109,8 @@ jobs:
109
109
  run: npm update @xn-intenton-z2a/agentic-lib
110
110
 
111
111
  - name: Run init
112
+ env:
113
+ GH_TOKEN: ${{ github.token }}
112
114
  run: |
113
115
  FLAGS="init"
114
116
  if [ "$INIT_MODE" = "reseed" ]; then FLAGS="$FLAGS --reseed"; fi
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.42"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.44"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",