@xn-intenton-z2a/agentic-lib 7.1.37 → 7.1.38

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.37",
3
+ "version": "7.1.38",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -132,6 +132,10 @@ function buildPrompt(ctx, agentInstructions) {
132
132
  "",
133
133
  "### Communication",
134
134
  "- `respond:discussions | message: <text> | discussion-url: <url>` — Reply via discussions bot",
135
+ "",
136
+ "### Schedule Control",
137
+ "- `set-schedule:<frequency>` — Change supervisor schedule (off, weekly, daily, hourly, continuous). Use `set-schedule:weekly` when mission is substantially complete, `set-schedule:continuous` to ramp up.",
138
+ "",
135
139
  "- `nop` — No action needed this cycle",
136
140
  "",
137
141
  "## Output Format",
@@ -235,8 +239,24 @@ const ACTION_HANDLERS = {
235
239
  "respond:discussions": executeRespondDiscussions,
236
240
  };
237
241
 
242
+ async function executeSetSchedule(octokit, repo, frequency) {
243
+ const valid = ["off", "weekly", "daily", "hourly", "continuous"];
244
+ if (!valid.includes(frequency)) {
245
+ return `skipped:invalid-frequency:${frequency}`;
246
+ }
247
+ core.info(`Setting supervisor schedule to: ${frequency}`);
248
+ await octokit.rest.actions.createWorkflowDispatch({
249
+ ...repo,
250
+ workflow_id: "agent-supervisor-schedule.yml",
251
+ ref: "main",
252
+ inputs: { frequency },
253
+ });
254
+ return `set-schedule:${frequency}`;
255
+ }
256
+
238
257
  async function executeAction(octokit, repo, action, params) {
239
258
  if (action.startsWith("dispatch:")) return executeDispatch(octokit, repo, action, params);
259
+ if (action.startsWith("set-schedule:")) return executeSetSchedule(octokit, repo, action.replace("set-schedule:", ""));
240
260
  if (action === "nop") return "nop";
241
261
  const handler = ACTION_HANDLERS[action];
242
262
  if (handler) return handler(octokit, repo, params);
@@ -26,10 +26,27 @@ You are the supervisor of an autonomous coding repository. Your job is to advanc
26
26
  - **github:label-issue** — When an issue needs better categorisation for prioritisation.
27
27
  - **github:close-issue** — When an issue is clearly resolved or no longer relevant.
28
28
  - **respond:discussions** — When replying to a user request that came through the discussions bot. Include the discussion URL and a clear message.
29
+ - **set-schedule:\<frequency\>** — Change the supervisor schedule. Use `weekly` when mission is substantially achieved, `continuous` to ramp up for active development.
29
30
  - **nop** — When everything is running optimally: transform is active, issues are flowing, no failures.
30
31
 
31
32
  ## Guidelines
32
33
 
34
+ ## Mission Lifecycle
35
+
36
+ ### Mission Initialised (init completed)
37
+ When recent workflow runs show an init completion, the repository has a fresh or updated mission.
38
+ Dispatch the discussions bot to announce the new mission to the community.
39
+
40
+ ### Mission Complete
41
+ When the recent activity log shows the transform agent declaring the mission substantially complete
42
+ (all features implemented, tests passing, examples generated), take these steps together:
43
+ 1. `dispatch:agent-discussions-bot` — announce completion in the discussions thread
44
+ 2. `set-schedule:weekly` — reduce to weekly maintenance check-ins
45
+
46
+ Do NOT use `set-schedule:off` — the repository still needs periodic review for regressions and user requests.
47
+
48
+ ## Guidelines
49
+
33
50
  - Pick multiple actions when appropriate — concurrent work is encouraged.
34
51
  - Always explain your reasoning — this helps future cycles understand the trajectory.
35
52
  - When a user has made a request via discussions, prioritise responding to it.
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.37"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.38"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",
@@ -26,6 +26,7 @@ on:
26
26
  - agent-flow-maintain
27
27
  - agent-flow-review
28
28
  - ci-automerge
29
+ - init
29
30
  types:
30
31
  - completed
31
32
  workflow_dispatch:
@@ -189,6 +190,21 @@ jobs:
189
190
  core.warning(`Post-transform review dispatch failed: ${err.message}`);
190
191
  }
191
192
 
193
+ // ─── 4. Successful init → dispatch discussions bot to announce new mission ───
194
+ try {
195
+ if (workflowRun && workflowName === 'init' && conclusion === 'success') {
196
+ core.info('Init completed successfully — dispatching discussions bot to announce.');
197
+ await github.rest.actions.createWorkflowDispatch({
198
+ owner, repo,
199
+ workflow_id: 'agent-discussions-bot.yml',
200
+ ref: 'main',
201
+ inputs: {},
202
+ });
203
+ }
204
+ } catch (err) {
205
+ core.warning(`Post-init discussions dispatch failed: ${err.message}`);
206
+ }
207
+
192
208
  # ─── Proactive: LLM-driven strategic decisions ───────────────────────
193
209
  supervise:
194
210
  needs: params