@xn-intenton-z2a/agentic-lib 7.1.63 → 7.1.64

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xn-intenton-z2a/agentic-lib",
3
- "version": "7.1.63",
3
+ "version": "7.1.64",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -25,11 +25,10 @@ export async function maintainLibrary(context) {
25
25
  return { outcome: "nop", details: "Mission already complete (MISSION_COMPLETE.md signal)" };
26
26
  }
27
27
 
28
- const sources = readOptionalFile(config.paths.librarySources.path);
29
- if (!sources.trim()) {
30
- core.info("No sources found. Returning nop.");
31
- return { outcome: "nop", details: "No SOURCES.md or empty" };
32
- }
28
+ const sourcesPath = config.paths.librarySources.path;
29
+ const sources = readOptionalFile(sourcesPath);
30
+ const mission = readOptionalFile(config.paths.mission.path);
31
+ const hasUrls = /https?:\/\//.test(sources);
33
32
 
34
33
  const libraryPath = config.paths.library.path;
35
34
  const libraryLimit = config.paths.library.limit;
@@ -37,26 +36,50 @@ export async function maintainLibrary(context) {
37
36
 
38
37
  const agentInstructions = instructions || "Maintain the library by updating documents from sources.";
39
38
 
40
- const prompt = [
41
- "## Instructions",
42
- agentInstructions,
43
- "",
44
- "## Sources",
45
- sources,
46
- "",
47
- `## Current Library Documents (${libraryDocs.length}/${libraryLimit} max)`,
48
- ...libraryDocs.map((d) => `### ${d.name}\n${d.content}`),
49
- "",
50
- "## Your Task",
51
- "1. Read each URL in SOURCES.md and extract technical content.",
52
- "2. Create or update library documents based on the source content.",
53
- "3. Remove library documents that no longer have corresponding sources.",
54
- "",
55
- formatPathsSection(writablePaths, config.readOnlyPaths, config),
56
- "",
57
- "## Constraints",
58
- `- Maximum ${libraryLimit} library documents`,
59
- ].join("\n");
39
+ let prompt;
40
+ if (!hasUrls) {
41
+ // SOURCES.md has no URLs — ask the LLM to find relevant sources based on the mission
42
+ core.info("SOURCES.md has no URLs — asking LLM to discover relevant sources from the mission.");
43
+ prompt = [
44
+ "## Instructions",
45
+ agentInstructions,
46
+ "",
47
+ "## Mission",
48
+ mission || "(no mission file found)",
49
+ "",
50
+ "## Current SOURCES.md",
51
+ sources || "(empty)",
52
+ "",
53
+ "## Your Task",
54
+ `SOURCES.md has no URLs yet. Research the mission above and populate ${sourcesPath} with 3-8 relevant reference URLs.`,
55
+ "Find documentation, tutorials, API references, Wikipedia articles, or npm packages related to the mission's core topic.",
56
+ "Use web search to discover high-quality, stable URLs (prefer official docs, Wikipedia, MDN, npm).",
57
+ `Write the URLs as a markdown list in ${sourcesPath}, keeping the existing header text.`,
58
+ "",
59
+ formatPathsSection(writablePaths, config.readOnlyPaths, config),
60
+ ].join("\n");
61
+ } else {
62
+ prompt = [
63
+ "## Instructions",
64
+ agentInstructions,
65
+ "",
66
+ "## Sources",
67
+ sources,
68
+ "",
69
+ `## Current Library Documents (${libraryDocs.length}/${libraryLimit} max)`,
70
+ ...libraryDocs.map((d) => `### ${d.name}\n${d.content}`),
71
+ "",
72
+ "## Your Task",
73
+ "1. Read each URL in SOURCES.md and extract technical content.",
74
+ "2. Create or update library documents based on the source content.",
75
+ "3. Remove library documents that no longer have corresponding sources.",
76
+ "",
77
+ formatPathsSection(writablePaths, config.readOnlyPaths, config),
78
+ "",
79
+ "## Constraints",
80
+ `- Maximum ${libraryLimit} library documents`,
81
+ ].join("\n");
82
+ }
60
83
 
61
84
  const { tokensUsed, inputTokens, outputTokens, cost } = await runCopilotTask({
62
85
  model,
@@ -67,13 +90,18 @@ export async function maintainLibrary(context) {
67
90
  tuning: t,
68
91
  });
69
92
 
93
+ const outcomeLabel = hasUrls ? "library-maintained" : "sources-discovered";
94
+ const detailsMsg = hasUrls
95
+ ? `Maintained library (${libraryDocs.length} docs, limit ${libraryLimit})`
96
+ : `Discovered sources for SOURCES.md from mission`;
97
+
70
98
  return {
71
- outcome: "library-maintained",
99
+ outcome: outcomeLabel,
72
100
  tokensUsed,
73
101
  inputTokens,
74
102
  outputTokens,
75
103
  cost,
76
104
  model,
77
- details: `Maintained library (${libraryDocs.length} docs, limit ${libraryLimit})`,
105
+ details: detailsMsg,
78
106
  };
79
107
  }
@@ -4,5 +4,3 @@ 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://github.com/xn-intenton-z2a/repository0
@@ -16,7 +16,7 @@
16
16
  "author": "",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@xn-intenton-z2a/agentic-lib": "^7.1.63"
19
+ "@xn-intenton-z2a/agentic-lib": "^7.1.64"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@vitest/coverage-v8": "^4.0.18",