@xn-intenton-z2a/agentic-lib 7.1.39 → 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
|
@@ -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",
|
package/src/seeds/init.yml
CHANGED
|
@@ -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
|
|
@@ -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.
|
|
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
|
-
|
|
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
|