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

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.38",
3
+ "version": "7.1.40",
4
4
  "description": "Agentic-lib Agentic Coding Systems SDK powering automated GitHub workflows.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -41,7 +41,7 @@ inputs:
41
41
  model:
42
42
  description: "Copilot SDK model to use"
43
43
  required: false
44
- default: "claude-sonnet-4"
44
+ default: "gpt-5-mini"
45
45
 
46
46
  outputs:
47
47
  result:
@@ -19,6 +19,8 @@ import { parse as parseToml } from "smol-toml";
19
19
  /**
20
20
  * @typedef {Object} AgenticConfig
21
21
  * @property {string} schedule - Schedule identifier
22
+ * @property {string} supervisor - Supervisor frequency (off | weekly | daily | hourly | continuous)
23
+ * @property {string} model - Copilot SDK model for LLM requests
22
24
  * @property {Object<string, PathConfig>} paths - Mapped paths with permissions
23
25
  * @property {string} buildScript - Build command
24
26
  * @property {string} testScript - Test command
@@ -119,6 +121,7 @@ export function loadConfig(configPath) {
119
121
  return {
120
122
  schedule: toml.schedule?.tier || "schedule-1",
121
123
  supervisor: toml.schedule?.supervisor || "daily",
124
+ model: toml.schedule?.model || "gpt-5-mini",
122
125
  paths,
123
126
  buildScript: execution.build || "npm run build",
124
127
  testScript: execution.test || "npm test",
@@ -4,6 +4,7 @@
4
4
  #
5
5
  # Daily lifecycle: update agentic-lib, run init, test, PR, automerge.
6
6
  # Keeps the repository current with the latest SDK infrastructure.
7
+ # Can also set supervisor schedule and model on init.
7
8
 
8
9
  name: init
9
10
  run-name: "init [${{ github.ref_name }}]"
@@ -32,6 +33,28 @@ on:
32
33
  type: string
33
34
  required: false
34
35
  default: ""
36
+ schedule:
37
+ description: "Supervisor schedule (leave empty to keep current)"
38
+ type: choice
39
+ required: false
40
+ default: ""
41
+ options:
42
+ - ""
43
+ - "off"
44
+ - "weekly"
45
+ - "daily"
46
+ - "hourly"
47
+ - "continuous"
48
+ model:
49
+ description: "Copilot SDK model for LLM requests (leave empty to keep current)"
50
+ type: choice
51
+ required: false
52
+ default: ""
53
+ options:
54
+ - ""
55
+ - gpt-5-mini
56
+ - claude-sonnet-4
57
+ - gpt-4.1
35
58
 
36
59
  permissions: write-all
37
60
 
@@ -49,10 +72,16 @@ jobs:
49
72
  echo "dry-run=${DRY_RUN:-false}" >> $GITHUB_OUTPUT
50
73
  MISSION='${{ inputs.mission }}'
51
74
  echo "mission=${MISSION}" >> $GITHUB_OUTPUT
75
+ SCHEDULE='${{ inputs.schedule }}'
76
+ echo "schedule=${SCHEDULE}" >> $GITHUB_OUTPUT
77
+ MODEL='${{ inputs.model }}'
78
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
52
79
  outputs:
53
80
  mode: ${{ steps.normalise.outputs.mode }}
54
81
  dry-run: ${{ steps.normalise.outputs.dry-run }}
55
82
  mission: ${{ steps.normalise.outputs.mission }}
83
+ schedule: ${{ steps.normalise.outputs.schedule }}
84
+ model: ${{ steps.normalise.outputs.model }}
56
85
 
57
86
  init:
58
87
  needs: params
@@ -121,3 +150,13 @@ jobs:
121
150
  --label automerge \
122
151
  --base main \
123
152
  --head "$BRANCH"
153
+
154
+ # Configure schedule after init completes (if schedule parameter provided)
155
+ configure-schedule:
156
+ needs: [params, init]
157
+ if: needs.params.outputs.schedule != ''
158
+ uses: ./.github/workflows/agent-supervisor-schedule.yml
159
+ with:
160
+ frequency: ${{ needs.params.outputs.schedule }}
161
+ model: ${{ needs.params.outputs.model }}
162
+ secrets: inherit
@@ -8,6 +8,7 @@
8
8
  [schedule]
9
9
  tier = "schedule-1" # schedule-1 through schedule-4
10
10
  supervisor = "daily" # off | weekly | daily | hourly | continuous
11
+ model = "gpt-5-mini" # gpt-5-mini | claude-sonnet-4 | gpt-4.1
11
12
 
12
13
  [paths]
13
14
  mission = "MISSION.md"
@@ -14,7 +14,7 @@
14
14
  "author": "",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@xn-intenton-z2a/agentic-lib": "^7.1.38"
17
+ "@xn-intenton-z2a/agentic-lib": "^7.1.40"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@vitest/coverage-v8": "^4.0.0",
@@ -35,10 +35,10 @@ on:
35
35
  description: "Copilot SDK model to use"
36
36
  type: choice
37
37
  required: false
38
- default: "claude-sonnet-4"
38
+ default: "gpt-5-mini"
39
39
  options:
40
- - claude-sonnet-4
41
40
  - gpt-5-mini
41
+ - claude-sonnet-4
42
42
  - gpt-4.1
43
43
 
44
44
  permissions:
@@ -58,7 +58,7 @@ jobs:
58
58
  shell: bash
59
59
  run: |
60
60
  MODEL='${{ inputs.model }}'
61
- echo "model=${MODEL:-claude-sonnet-4}" >> $GITHUB_OUTPUT
61
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
62
62
  outputs:
63
63
  model: ${{ steps.normalise.outputs.model }}
64
64
 
@@ -25,10 +25,10 @@ on:
25
25
  description: "Copilot SDK model to use"
26
26
  type: choice
27
27
  required: false
28
- default: "claude-sonnet-4"
28
+ default: "gpt-5-mini"
29
29
  options:
30
- - claude-sonnet-4
31
30
  - gpt-5-mini
31
+ - claude-sonnet-4
32
32
  - gpt-4.1
33
33
 
34
34
  permissions:
@@ -48,7 +48,7 @@ jobs:
48
48
  shell: bash
49
49
  run: |
50
50
  MODEL='${{ inputs.model }}'
51
- echo "model=${MODEL:-claude-sonnet-4}" >> $GITHUB_OUTPUT
51
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
52
52
  outputs:
53
53
  model: ${{ steps.normalise.outputs.model }}
54
54
 
@@ -29,10 +29,10 @@ on:
29
29
  description: "Copilot SDK model to use"
30
30
  type: choice
31
31
  required: false
32
- default: "claude-sonnet-4"
32
+ default: "gpt-5-mini"
33
33
  options:
34
- - claude-sonnet-4
35
34
  - gpt-5-mini
35
+ - claude-sonnet-4
36
36
  - gpt-4.1
37
37
 
38
38
  permissions:
@@ -53,7 +53,7 @@ jobs:
53
53
  STEP='${{ inputs.step }}'
54
54
  echo "step=${STEP:-all}" >> $GITHUB_OUTPUT
55
55
  MODEL='${{ inputs.model }}'
56
- echo "model=${MODEL:-claude-sonnet-4}" >> $GITHUB_OUTPUT
56
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
57
57
  outputs:
58
58
  step: ${{ steps.normalise.outputs.step }}
59
59
  model: ${{ steps.normalise.outputs.model }}
@@ -28,10 +28,10 @@ on:
28
28
  description: "Copilot SDK model to use"
29
29
  type: choice
30
30
  required: false
31
- default: "claude-sonnet-4"
31
+ default: "gpt-5-mini"
32
32
  options:
33
- - claude-sonnet-4
34
33
  - gpt-5-mini
34
+ - claude-sonnet-4
35
35
  - gpt-4.1
36
36
 
37
37
  permissions:
@@ -52,7 +52,7 @@ jobs:
52
52
  STEP='${{ inputs.step }}'
53
53
  echo "step=${STEP:-all}" >> $GITHUB_OUTPUT
54
54
  MODEL='${{ inputs.model }}'
55
- echo "model=${MODEL:-claude-sonnet-4}" >> $GITHUB_OUTPUT
55
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
56
56
  outputs:
57
57
  step: ${{ steps.normalise.outputs.step }}
58
58
  model: ${{ steps.normalise.outputs.model }}
@@ -20,10 +20,10 @@ on:
20
20
  description: "Copilot SDK model to use"
21
21
  type: choice
22
22
  required: false
23
- default: "claude-sonnet-4"
23
+ default: "gpt-5-mini"
24
24
  options:
25
- - claude-sonnet-4
26
25
  - gpt-5-mini
26
+ - claude-sonnet-4
27
27
  - gpt-4.1
28
28
 
29
29
  permissions:
@@ -43,7 +43,7 @@ jobs:
43
43
  shell: bash
44
44
  run: |
45
45
  MODEL='${{ inputs.model }}'
46
- echo "model=${MODEL:-claude-sonnet-4}" >> $GITHUB_OUTPUT
46
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
47
47
  outputs:
48
48
  model: ${{ steps.normalise.outputs.model }}
49
49
 
@@ -3,13 +3,25 @@
3
3
  # .github/workflows/agent-supervisor-schedule.yml
4
4
  #
5
5
  # Changes the agent-supervisor's cron schedule by editing the workflow file
6
- # directly and pushing to main. This is the control plane for how often
7
- # the supervisor runs proactively.
6
+ # directly and pushing to main. Also updates the model setting in agentic-lib.toml.
7
+ # This is the control plane for how often the supervisor runs proactively
8
+ # and which LLM model is used.
8
9
 
9
10
  name: agent-supervisor-schedule
10
- run-name: "agent-supervisor-schedule → ${{ inputs.frequency }}"
11
+ run-name: "agent-supervisor-schedule → ${{ inputs.frequency }} (${{ inputs.model }})"
11
12
 
12
13
  on:
14
+ workflow_call:
15
+ inputs:
16
+ frequency:
17
+ description: "How often the supervisor should run"
18
+ required: true
19
+ type: string
20
+ model:
21
+ description: "Copilot SDK model to use"
22
+ required: false
23
+ type: string
24
+ default: "gpt-5-mini"
13
25
  workflow_dispatch:
14
26
  inputs:
15
27
  frequency:
@@ -22,6 +34,15 @@ on:
22
34
  - "daily"
23
35
  - "hourly"
24
36
  - "continuous"
37
+ model:
38
+ description: "Copilot SDK model to use"
39
+ required: false
40
+ type: choice
41
+ default: "gpt-5-mini"
42
+ options:
43
+ - gpt-5-mini
44
+ - claude-sonnet-4
45
+ - gpt-4.1
25
46
 
26
47
  permissions:
27
48
  contents: write
@@ -35,13 +56,15 @@ jobs:
35
56
  ref: main
36
57
  token: ${{ secrets.WORKFLOW_TOKEN }}
37
58
 
38
- - name: Update supervisor schedule
59
+ - name: Update supervisor schedule and model
39
60
  uses: actions/github-script@v7
40
61
  with:
41
62
  script: |
42
63
  const fs = require('fs');
43
64
  const frequency = '${{ inputs.frequency }}';
65
+ const model = '${{ inputs.model || 'gpt-5-mini' }}';
44
66
  const workflowPath = '.github/workflows/agent-supervisor.yml';
67
+ const tomlPath = 'agentic-lib.toml';
45
68
 
46
69
  const SCHEDULE_MAP = {
47
70
  off: null,
@@ -51,6 +74,7 @@ jobs:
51
74
  continuous: '*/15 * * * *',
52
75
  };
53
76
 
77
+ // Update agent-supervisor.yml schedule
54
78
  let content = fs.readFileSync(workflowPath, 'utf8');
55
79
  const cron = SCHEDULE_MAP[frequency];
56
80
 
@@ -73,12 +97,47 @@ jobs:
73
97
  fs.writeFileSync(workflowPath, content);
74
98
  core.info(`Updated supervisor schedule to: ${frequency} (cron: ${cron || 'none'})`);
75
99
 
100
+ // Update agentic-lib.toml with model and supervisor settings
101
+ if (fs.existsSync(tomlPath)) {
102
+ let toml = fs.readFileSync(tomlPath, 'utf8');
103
+
104
+ // Update model setting within [schedule] section
105
+ // Match model line that appears after [schedule] but before any other section
106
+ // Allow optional leading whitespace for robustness
107
+ const scheduleModelRegex = /(\[schedule\][^\[]*?)(^\s*model\s*=\s*"[^"]*")/m;
108
+ if (scheduleModelRegex.test(toml)) {
109
+ // Model exists in schedule section - update it
110
+ toml = toml.replace(scheduleModelRegex, `$1model = "${model}"`);
111
+ } else if (toml.match(/^\[schedule\]/m)) {
112
+ // No model in schedule section - add it after supervisor line (or after section header)
113
+ const supervisorLineRegex = /^(\s*supervisor\s*=\s*"[^"]*")(\s*#.*)?$/m;
114
+ if (supervisorLineRegex.test(toml)) {
115
+ toml = toml.replace(supervisorLineRegex, `$1$2\nmodel = "${model}"`);
116
+ } else {
117
+ // Add after [schedule] header (handle optional trailing content)
118
+ toml = toml.replace(/^(\[schedule\].*)$/m, `$1\nmodel = "${model}"`);
119
+ }
120
+ }
121
+
122
+ // Update supervisor setting within [schedule] section
123
+ const scheduleSupervisorRegex = /(\[schedule\][^\[]*?)(^\s*supervisor\s*=\s*"[^"]*")/m;
124
+ if (scheduleSupervisorRegex.test(toml)) {
125
+ toml = toml.replace(scheduleSupervisorRegex, `$1supervisor = "${frequency}"`);
126
+ }
127
+
128
+ fs.writeFileSync(tomlPath, toml);
129
+ core.info(`Updated agentic-lib.toml: model=${model}, supervisor=${frequency}`);
130
+ } else {
131
+ core.warning('agentic-lib.toml not found — skipping config update');
132
+ }
133
+
76
134
  - name: Commit and push
77
135
  run: |
78
136
  git config user.name "github-actions[bot]"
79
137
  git config user.email "github-actions[bot]@users.noreply.github.com"
80
138
  FREQUENCY="${{ inputs.frequency }}"
81
- git add .github/workflows/agent-supervisor.yml
139
+ MODEL="${{ inputs.model }}"
140
+ git add .github/workflows/agent-supervisor.yml agentic-lib.toml
82
141
  git diff --cached --quiet && echo "No changes to commit" && exit 0
83
- git commit -m "supervisor: set schedule to ${FREQUENCY}"
142
+ git commit -m "supervisor: set schedule to ${FREQUENCY}, model to ${MODEL:-gpt-5-mini}"
84
143
  git push origin main
@@ -35,10 +35,10 @@ on:
35
35
  description: "Copilot SDK model to use"
36
36
  type: choice
37
37
  required: false
38
- default: "claude-sonnet-4"
38
+ default: "gpt-5-mini"
39
39
  options:
40
- - claude-sonnet-4
41
40
  - gpt-5-mini
41
+ - claude-sonnet-4
42
42
  - gpt-4.1
43
43
 
44
44
  permissions:
@@ -63,7 +63,7 @@ jobs:
63
63
  shell: bash
64
64
  run: |
65
65
  MODEL='${{ inputs.model }}'
66
- echo "model=${MODEL:-claude-sonnet-4}" >> $GITHUB_OUTPUT
66
+ echo "model=${MODEL:-gpt-5-mini}" >> $GITHUB_OUTPUT
67
67
  outputs:
68
68
  model: ${{ steps.normalise.outputs.model }}
69
69