@xn-intenton-z2a/agentic-lib 7.2.20 → 7.2.22
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/.github/workflows/agentic-lib-bot.yml +6 -0
- package/.github/workflows/agentic-lib-init.yml +8 -1
- package/.github/workflows/agentic-lib-schedule.yml +7 -1
- package/.github/workflows/agentic-lib-test.yml +12 -0
- package/.github/workflows/agentic-lib-update.yml +7 -1
- package/.github/workflows/agentic-lib-workflow.yml +32 -6
- package/bin/agentic-lib.js +54 -50
- package/package.json +1 -1
- package/src/actions/agentic-step/config-loader.js +4 -3
- package/src/actions/agentic-step/copilot.js +45 -527
- package/src/actions/agentic-step/tools.js +19 -134
- package/src/copilot/sdk.js +5 -3
- package/src/seeds/zero-package.json +1 -1
- package/src/copilot/tasks/fix-code.js +0 -73
- package/src/copilot/tasks/maintain-features.js +0 -61
- package/src/copilot/tasks/maintain-library.js +0 -66
- package/src/copilot/tasks/transform.js +0 -120
|
@@ -28,6 +28,10 @@ on:
|
|
|
28
28
|
#@dist - edited
|
|
29
29
|
workflow_call:
|
|
30
30
|
inputs:
|
|
31
|
+
ref:
|
|
32
|
+
type: string
|
|
33
|
+
required: false
|
|
34
|
+
default: ""
|
|
31
35
|
discussion-url:
|
|
32
36
|
type: string
|
|
33
37
|
required: false
|
|
@@ -83,6 +87,7 @@ jobs:
|
|
|
83
87
|
steps:
|
|
84
88
|
- uses: actions/checkout@v6
|
|
85
89
|
with:
|
|
90
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
86
91
|
sparse-checkout: ${{ env.configPath }}
|
|
87
92
|
sparse-checkout-cone-mode: false
|
|
88
93
|
- name: Normalise params
|
|
@@ -111,6 +116,7 @@ jobs:
|
|
|
111
116
|
- uses: actions/checkout@v6
|
|
112
117
|
with:
|
|
113
118
|
fetch-depth: 0
|
|
119
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
114
120
|
|
|
115
121
|
- uses: actions/setup-node@v6
|
|
116
122
|
with:
|
|
@@ -12,6 +12,10 @@ run-name: "agentic-lib-init ${{ inputs.mode || 'update' }} [${{ github.ref_name
|
|
|
12
12
|
on:
|
|
13
13
|
workflow_call:
|
|
14
14
|
inputs:
|
|
15
|
+
ref:
|
|
16
|
+
type: string
|
|
17
|
+
required: false
|
|
18
|
+
default: ""
|
|
15
19
|
mode:
|
|
16
20
|
type: string
|
|
17
21
|
required: false
|
|
@@ -121,6 +125,7 @@ jobs:
|
|
|
121
125
|
update:
|
|
122
126
|
uses: ./.github/workflows/agentic-lib-update.yml
|
|
123
127
|
with:
|
|
128
|
+
ref: ${{ inputs.ref }}
|
|
124
129
|
dry-run: ${{ inputs.dry-run || 'false' }}
|
|
125
130
|
secrets: inherit
|
|
126
131
|
|
|
@@ -136,10 +141,12 @@ jobs:
|
|
|
136
141
|
steps:
|
|
137
142
|
- uses: actions/checkout@v6
|
|
138
143
|
if: inputs.dry-run == 'true' || inputs.dry-run == true
|
|
144
|
+
with:
|
|
145
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
139
146
|
- uses: actions/checkout@v6
|
|
140
147
|
if: inputs.dry-run != 'true' && inputs.dry-run != true
|
|
141
148
|
with:
|
|
142
|
-
ref: main
|
|
149
|
+
ref: ${{ inputs.ref || 'main' }}
|
|
143
150
|
token: ${{ secrets.WORKFLOW_TOKEN }}
|
|
144
151
|
|
|
145
152
|
- uses: actions/setup-node@v6
|
|
@@ -13,6 +13,10 @@ run-name: "agentic-lib-schedule -> ${{ inputs.frequency }} (${{ inputs.model }}$
|
|
|
13
13
|
on:
|
|
14
14
|
workflow_call:
|
|
15
15
|
inputs:
|
|
16
|
+
ref:
|
|
17
|
+
type: string
|
|
18
|
+
required: false
|
|
19
|
+
default: ""
|
|
16
20
|
frequency:
|
|
17
21
|
description: "How often the workflow should run"
|
|
18
22
|
required: true
|
|
@@ -80,10 +84,12 @@ jobs:
|
|
|
80
84
|
steps:
|
|
81
85
|
- uses: actions/checkout@v6
|
|
82
86
|
if: inputs.dry-run == 'true' || inputs.dry-run == true
|
|
87
|
+
with:
|
|
88
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
83
89
|
- uses: actions/checkout@v6
|
|
84
90
|
if: inputs.dry-run != 'true' && inputs.dry-run != true
|
|
85
91
|
with:
|
|
86
|
-
ref: main
|
|
92
|
+
ref: ${{ inputs.ref || 'main' }}
|
|
87
93
|
token: ${{ secrets.WORKFLOW_TOKEN }}
|
|
88
94
|
|
|
89
95
|
- name: Update workflow schedule and model
|
|
@@ -40,6 +40,10 @@ on:
|
|
|
40
40
|
type: string
|
|
41
41
|
required: false
|
|
42
42
|
default: "false"
|
|
43
|
+
ref:
|
|
44
|
+
type: string
|
|
45
|
+
required: false
|
|
46
|
+
default: ""
|
|
43
47
|
workflow_dispatch:
|
|
44
48
|
inputs:
|
|
45
49
|
push-screenshot:
|
|
@@ -58,6 +62,8 @@ jobs:
|
|
|
58
62
|
runs-on: ubuntu-latest
|
|
59
63
|
steps:
|
|
60
64
|
- uses: actions/checkout@v6
|
|
65
|
+
with:
|
|
66
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
61
67
|
|
|
62
68
|
- uses: actions/setup-node@v6
|
|
63
69
|
with:
|
|
@@ -89,6 +95,8 @@ jobs:
|
|
|
89
95
|
tests-failed: ${{ steps.result.outputs.tests-failed }}
|
|
90
96
|
steps:
|
|
91
97
|
- uses: actions/checkout@v6
|
|
98
|
+
with:
|
|
99
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
92
100
|
|
|
93
101
|
- name: Install dependencies
|
|
94
102
|
run: npm ci
|
|
@@ -182,6 +190,8 @@ jobs:
|
|
|
182
190
|
runs-on: ubuntu-latest
|
|
183
191
|
steps:
|
|
184
192
|
- uses: actions/checkout@v6
|
|
193
|
+
with:
|
|
194
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
185
195
|
|
|
186
196
|
- name: Install dependencies (non-blocking)
|
|
187
197
|
id: install-deps
|
|
@@ -291,6 +301,8 @@ jobs:
|
|
|
291
301
|
container: mcr.microsoft.com/playwright:v1.58.2-noble
|
|
292
302
|
steps:
|
|
293
303
|
- uses: actions/checkout@v6
|
|
304
|
+
with:
|
|
305
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
294
306
|
|
|
295
307
|
- name: Install dependencies (non-blocking)
|
|
296
308
|
id: install-deps
|
|
@@ -14,6 +14,10 @@ run-name: "agentic-lib-update [${{ github.ref_name }}]"
|
|
|
14
14
|
on:
|
|
15
15
|
workflow_call:
|
|
16
16
|
inputs:
|
|
17
|
+
ref:
|
|
18
|
+
type: string
|
|
19
|
+
required: false
|
|
20
|
+
default: ""
|
|
17
21
|
dry-run:
|
|
18
22
|
type: string
|
|
19
23
|
required: false
|
|
@@ -36,10 +40,12 @@ jobs:
|
|
|
36
40
|
steps:
|
|
37
41
|
- uses: actions/checkout@v6
|
|
38
42
|
if: inputs.dry-run == 'true' || inputs.dry-run == true
|
|
43
|
+
with:
|
|
44
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
39
45
|
- uses: actions/checkout@v6
|
|
40
46
|
if: inputs.dry-run != 'true' && inputs.dry-run != true
|
|
41
47
|
with:
|
|
42
|
-
ref: main
|
|
48
|
+
ref: ${{ inputs.ref || 'main' }}
|
|
43
49
|
token: ${{ secrets.WORKFLOW_TOKEN }}
|
|
44
50
|
|
|
45
51
|
- uses: actions/setup-node@v6
|
|
@@ -20,6 +20,10 @@ on:
|
|
|
20
20
|
#@dist - cron: "0 6 * * 1"
|
|
21
21
|
workflow_call:
|
|
22
22
|
inputs:
|
|
23
|
+
ref:
|
|
24
|
+
type: string
|
|
25
|
+
required: false
|
|
26
|
+
default: ""
|
|
23
27
|
model:
|
|
24
28
|
type: string
|
|
25
29
|
required: false
|
|
@@ -135,6 +139,7 @@ jobs:
|
|
|
135
139
|
steps:
|
|
136
140
|
- uses: actions/checkout@v6
|
|
137
141
|
with:
|
|
142
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
138
143
|
sparse-checkout: ${{ env.configPath }}
|
|
139
144
|
sparse-checkout-cone-mode: false
|
|
140
145
|
- name: Normalise params
|
|
@@ -265,6 +270,8 @@ jobs:
|
|
|
265
270
|
container: mcr.microsoft.com/playwright:v1.58.2-noble
|
|
266
271
|
steps:
|
|
267
272
|
- uses: actions/checkout@v6
|
|
273
|
+
with:
|
|
274
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
268
275
|
|
|
269
276
|
- uses: actions/setup-node@v6
|
|
270
277
|
with:
|
|
@@ -305,6 +312,8 @@ jobs:
|
|
|
305
312
|
runs-on: ubuntu-latest
|
|
306
313
|
steps:
|
|
307
314
|
- uses: actions/checkout@v6
|
|
315
|
+
with:
|
|
316
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
308
317
|
|
|
309
318
|
- uses: actions/setup-node@v6
|
|
310
319
|
with:
|
|
@@ -553,10 +562,13 @@ jobs:
|
|
|
553
562
|
needs.params.result == 'success' &&
|
|
554
563
|
inputs.skipMaintain != 'true' && inputs.skipMaintain != true
|
|
555
564
|
runs-on: ubuntu-latest
|
|
565
|
+
outputs:
|
|
566
|
+
commit-sha: ${{ steps.get-sha.outputs.sha }}
|
|
556
567
|
steps:
|
|
557
568
|
- uses: actions/checkout@v6
|
|
558
569
|
with:
|
|
559
570
|
fetch-depth: 0
|
|
571
|
+
ref: ${{ inputs.ref || github.sha }}
|
|
560
572
|
|
|
561
573
|
- name: Fetch log from agentic-lib-logs branch
|
|
562
574
|
run: |
|
|
@@ -660,6 +672,10 @@ jobs:
|
|
|
660
672
|
commit-message: "agentic-step: maintain features and library"
|
|
661
673
|
push-ref: ${{ github.ref_name }}
|
|
662
674
|
|
|
675
|
+
- name: Capture commit SHA
|
|
676
|
+
id: get-sha
|
|
677
|
+
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
|
678
|
+
|
|
663
679
|
- name: Push log to agentic-lib-logs branch
|
|
664
680
|
if: github.repository != 'xn-intenton-z2a/agentic-lib' && needs.params.outputs.dry-run != 'true'
|
|
665
681
|
run: bash .github/agentic-lib/scripts/push-to-logs.sh "intentïon.md" "intention.md"
|
|
@@ -679,6 +695,7 @@ jobs:
|
|
|
679
695
|
- uses: actions/checkout@v6
|
|
680
696
|
with:
|
|
681
697
|
fetch-depth: 0
|
|
698
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
682
699
|
|
|
683
700
|
- name: Fetch log from agentic-lib-logs branch
|
|
684
701
|
run: |
|
|
@@ -729,6 +746,7 @@ jobs:
|
|
|
729
746
|
- uses: actions/checkout@v6
|
|
730
747
|
with:
|
|
731
748
|
fetch-depth: 0
|
|
749
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
732
750
|
|
|
733
751
|
- name: Fetch log from agentic-lib-logs branch
|
|
734
752
|
run: |
|
|
@@ -767,7 +785,7 @@ jobs:
|
|
|
767
785
|
|
|
768
786
|
# ─── Fix stuck PRs with failing checks ─────────────────────────────
|
|
769
787
|
fix-stuck:
|
|
770
|
-
needs: [params, supervisor]
|
|
788
|
+
needs: [params, maintain, supervisor]
|
|
771
789
|
if: |
|
|
772
790
|
!cancelled() &&
|
|
773
791
|
needs.params.outputs.mode == 'full' &&
|
|
@@ -777,6 +795,7 @@ jobs:
|
|
|
777
795
|
- uses: actions/checkout@v6
|
|
778
796
|
with:
|
|
779
797
|
fetch-depth: 0
|
|
798
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
780
799
|
|
|
781
800
|
- uses: actions/setup-node@v6
|
|
782
801
|
with:
|
|
@@ -1088,7 +1107,7 @@ jobs:
|
|
|
1088
1107
|
|
|
1089
1108
|
# ─── Review: close resolved issues, enhance with criteria ──────────
|
|
1090
1109
|
review-features:
|
|
1091
|
-
needs: [params, supervisor]
|
|
1110
|
+
needs: [params, maintain, supervisor]
|
|
1092
1111
|
if: |
|
|
1093
1112
|
!cancelled() &&
|
|
1094
1113
|
(needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'review-only') &&
|
|
@@ -1096,6 +1115,8 @@ jobs:
|
|
|
1096
1115
|
runs-on: ubuntu-latest
|
|
1097
1116
|
steps:
|
|
1098
1117
|
- uses: actions/checkout@v6
|
|
1118
|
+
with:
|
|
1119
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
1099
1120
|
|
|
1100
1121
|
- uses: actions/setup-node@v6
|
|
1101
1122
|
with:
|
|
@@ -1133,7 +1154,7 @@ jobs:
|
|
|
1133
1154
|
|
|
1134
1155
|
# ─── Dev: sequential issue resolution ──────────────────────────────
|
|
1135
1156
|
dev:
|
|
1136
|
-
needs: [params, review-features]
|
|
1157
|
+
needs: [params, maintain, review-features]
|
|
1137
1158
|
if: |
|
|
1138
1159
|
!cancelled() &&
|
|
1139
1160
|
(needs.params.outputs.mode == 'full' || needs.params.outputs.mode == 'dev-only') &&
|
|
@@ -1144,6 +1165,7 @@ jobs:
|
|
|
1144
1165
|
with:
|
|
1145
1166
|
fetch-depth: 0
|
|
1146
1167
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
1168
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
1147
1169
|
|
|
1148
1170
|
- name: Fetch log from agentic-lib-logs branch
|
|
1149
1171
|
run: |
|
|
@@ -1405,13 +1427,14 @@ jobs:
|
|
|
1405
1427
|
|
|
1406
1428
|
# ─── Post-merge: stats, schedule, mission check ────────────────────
|
|
1407
1429
|
post-merge:
|
|
1408
|
-
needs: [params, dev, pr-cleanup]
|
|
1430
|
+
needs: [params, maintain, dev, pr-cleanup]
|
|
1409
1431
|
if: ${{ !cancelled() && needs.params.result == 'success' }}
|
|
1410
1432
|
runs-on: ubuntu-latest
|
|
1411
1433
|
steps:
|
|
1412
1434
|
- uses: actions/checkout@v6
|
|
1413
1435
|
with:
|
|
1414
1436
|
fetch-depth: 0
|
|
1437
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
1415
1438
|
|
|
1416
1439
|
- name: Summary
|
|
1417
1440
|
run: |
|
|
@@ -1428,20 +1451,23 @@ jobs:
|
|
|
1428
1451
|
|
|
1429
1452
|
# ─── Post-commit validation: call test workflow to verify branch health ───
|
|
1430
1453
|
post-commit-test:
|
|
1431
|
-
needs: [params, dev, fix-stuck, post-merge]
|
|
1454
|
+
needs: [params, maintain, dev, fix-stuck, post-merge]
|
|
1432
1455
|
if: >-
|
|
1433
1456
|
!cancelled()
|
|
1434
1457
|
&& needs.params.outputs.dry-run != 'true'
|
|
1435
1458
|
&& needs.params.result == 'success'
|
|
1436
1459
|
uses: ./.github/workflows/agentic-lib-test.yml
|
|
1460
|
+
with:
|
|
1461
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
1437
1462
|
secrets: inherit
|
|
1438
1463
|
|
|
1439
1464
|
# ─── Schedule change (if requested) ────────────────────────────────
|
|
1440
1465
|
update-schedule:
|
|
1441
|
-
needs: [params, dev]
|
|
1466
|
+
needs: [params, maintain, dev]
|
|
1442
1467
|
if: ${{ !cancelled() && needs.params.outputs.dry-run != 'true' && needs.params.outputs.schedule != '' && needs.params.result == 'success' }}
|
|
1443
1468
|
uses: ./.github/workflows/agentic-lib-schedule.yml
|
|
1444
1469
|
with:
|
|
1470
|
+
ref: ${{ needs.maintain.outputs.commit-sha || github.sha }}
|
|
1445
1471
|
frequency: ${{ needs.params.outputs.schedule }}
|
|
1446
1472
|
model: ${{ needs.params.outputs.model }}
|
|
1447
1473
|
profile: ${{ needs.params.outputs.profile }}
|
package/bin/agentic-lib.js
CHANGED
|
@@ -30,6 +30,12 @@ const flags = args.slice(1);
|
|
|
30
30
|
|
|
31
31
|
let initChanges = 0;
|
|
32
32
|
const TASK_COMMANDS = ["transform", "maintain-features", "maintain-library", "fix-code"];
|
|
33
|
+
const TASK_AGENT_MAP = {
|
|
34
|
+
"transform": "agent-issue-resolution",
|
|
35
|
+
"fix-code": "agent-apply-fix",
|
|
36
|
+
"maintain-features": "agent-maintain-features",
|
|
37
|
+
"maintain-library": "agent-maintain-library",
|
|
38
|
+
};
|
|
33
39
|
const INIT_COMMANDS = ["init", "update", "reset"];
|
|
34
40
|
const ALL_COMMANDS = [...INIT_COMMANDS, ...TASK_COMMANDS, "version", "mcp", "iterate"];
|
|
35
41
|
|
|
@@ -366,21 +372,30 @@ async function runIterate() {
|
|
|
366
372
|
// ─── Task Runner ─────────────────────────────────────────────────────
|
|
367
373
|
|
|
368
374
|
async function runTask(taskName) {
|
|
375
|
+
// Task commands are now aliases for iterate --agent <agent-name>
|
|
376
|
+
const agentName = TASK_AGENT_MAP[taskName];
|
|
377
|
+
if (!agentName) {
|
|
378
|
+
console.error(`Unknown task: ${taskName}`);
|
|
379
|
+
return 1;
|
|
380
|
+
}
|
|
381
|
+
|
|
369
382
|
console.log("");
|
|
370
|
-
console.log(`=== agentic-lib ${taskName} ===`);
|
|
383
|
+
console.log(`=== agentic-lib ${taskName} (→ iterate --agent ${agentName}) ===`);
|
|
371
384
|
console.log(`Target: ${target}`);
|
|
372
385
|
console.log(`Model: ${model}`);
|
|
373
386
|
console.log(`Dry-run: ${dryRun}`);
|
|
374
387
|
console.log("");
|
|
375
388
|
|
|
376
|
-
// Load config from shared module
|
|
377
389
|
const { loadConfig } = await import("../src/copilot/config.js");
|
|
378
|
-
|
|
379
|
-
|
|
390
|
+
let config;
|
|
391
|
+
try {
|
|
392
|
+
config = loadConfig(resolve(target, "agentic-lib.toml"));
|
|
393
|
+
} catch {
|
|
394
|
+
config = { tuning: {}, model: "gpt-5-mini", paths: {}, writablePaths: [], readOnlyPaths: [] };
|
|
395
|
+
}
|
|
396
|
+
const effectiveModel = model || config.model || "gpt-5-mini";
|
|
380
397
|
|
|
381
|
-
console.log(`[config]
|
|
382
|
-
console.log(`[config] writable=${config.writablePaths.join(", ")}`);
|
|
383
|
-
console.log(`[config] test=${config.testScript}`);
|
|
398
|
+
console.log(`[config] writable=${(config.writablePaths || []).join(", ")}`);
|
|
384
399
|
console.log("");
|
|
385
400
|
|
|
386
401
|
if (dryRun) {
|
|
@@ -388,62 +403,50 @@ async function runTask(taskName) {
|
|
|
388
403
|
return 0;
|
|
389
404
|
}
|
|
390
405
|
|
|
391
|
-
// Change to target directory so relative paths in config work
|
|
392
|
-
const originalCwd = process.cwd();
|
|
393
|
-
process.chdir(target);
|
|
394
|
-
|
|
395
406
|
try {
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
case "maintain-features": {
|
|
412
|
-
const { maintainFeatures } = await import("../src/copilot/tasks/maintain-features.js");
|
|
413
|
-
result = await maintainFeatures(context);
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
case "maintain-library": {
|
|
417
|
-
const { maintainLibrary } = await import("../src/copilot/tasks/maintain-library.js");
|
|
418
|
-
result = await maintainLibrary(context);
|
|
419
|
-
break;
|
|
420
|
-
}
|
|
421
|
-
case "fix-code": {
|
|
422
|
-
const { fixCode } = await import("../src/copilot/tasks/fix-code.js");
|
|
423
|
-
result = await fixCode(context);
|
|
424
|
-
break;
|
|
425
|
-
}
|
|
426
|
-
default:
|
|
427
|
-
console.error(`Unknown task: ${taskName}`);
|
|
428
|
-
return 1;
|
|
407
|
+
const { loadAgentPrompt } = await import("../src/copilot/agents.js");
|
|
408
|
+
const { runHybridSession } = await import("../src/copilot/hybrid-session.js");
|
|
409
|
+
const { gatherLocalContext, gatherGitHubContext, buildUserPrompt } = await import("../src/copilot/context.js");
|
|
410
|
+
|
|
411
|
+
const agentPrompt = loadAgentPrompt(agentName);
|
|
412
|
+
const localContext = gatherLocalContext(target, config);
|
|
413
|
+
|
|
414
|
+
let githubContext;
|
|
415
|
+
if (issueNumber || prNumber) {
|
|
416
|
+
githubContext = gatherGitHubContext({
|
|
417
|
+
issueNumber: issueNumber || undefined,
|
|
418
|
+
prNumber: prNumber || undefined,
|
|
419
|
+
workspacePath: target,
|
|
420
|
+
});
|
|
429
421
|
}
|
|
430
422
|
|
|
423
|
+
const userPrompt = buildUserPrompt(agentName, localContext, githubContext, { tuning: config.tuning });
|
|
424
|
+
|
|
425
|
+
const result = await runHybridSession({
|
|
426
|
+
workspacePath: target,
|
|
427
|
+
model: effectiveModel,
|
|
428
|
+
tuning: config.tuning || {},
|
|
429
|
+
timeoutMs,
|
|
430
|
+
agentPrompt,
|
|
431
|
+
userPrompt,
|
|
432
|
+
writablePaths: config.writablePaths?.length > 0 ? config.writablePaths : undefined,
|
|
433
|
+
});
|
|
434
|
+
|
|
431
435
|
console.log("");
|
|
432
436
|
console.log(`=== ${taskName} completed ===`);
|
|
433
|
-
console.log(`
|
|
434
|
-
|
|
435
|
-
|
|
437
|
+
console.log(`Success: ${result.success}`);
|
|
438
|
+
console.log(`Session time: ${result.sessionTime}s`);
|
|
439
|
+
console.log(`Tool calls: ${result.toolCalls}`);
|
|
440
|
+
console.log(`Tokens: ${result.tokensIn + result.tokensOut} (in=${result.tokensIn} out=${result.tokensOut})`);
|
|
436
441
|
if (result.narrative) console.log(`Narrative: ${result.narrative}`);
|
|
437
442
|
console.log("");
|
|
438
|
-
return 0;
|
|
443
|
+
return result.success ? 0 : 1;
|
|
439
444
|
} catch (err) {
|
|
440
445
|
console.error("");
|
|
441
446
|
console.error(`=== ${taskName} FAILED ===`);
|
|
442
447
|
console.error(err.message);
|
|
443
448
|
if (err.stack) console.error(err.stack);
|
|
444
449
|
return 1;
|
|
445
|
-
} finally {
|
|
446
|
-
process.chdir(originalCwd);
|
|
447
450
|
}
|
|
448
451
|
}
|
|
449
452
|
|
|
@@ -1229,6 +1232,7 @@ function runInit() {
|
|
|
1229
1232
|
|
|
1230
1233
|
initWorkflows();
|
|
1231
1234
|
initActions(agenticDir);
|
|
1235
|
+
initDirContents("copilot", resolve(agenticDir, "copilot"), "Copilot (shared modules)");
|
|
1232
1236
|
initDirContents("agents", resolve(agenticDir, "agents"), "Agents");
|
|
1233
1237
|
initDirContents("seeds", resolve(agenticDir, "seeds"), "Seeds");
|
|
1234
1238
|
initScripts(agenticDir);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
2
|
// Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
-
// config-loader.js —
|
|
3
|
+
// config-loader.js — Thin re-export from shared src/copilot/config.js
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// Phase 4: Configuration logic now lives in src/copilot/config.js.
|
|
6
|
+
// This file re-exports for backwards compatibility with existing imports.
|
|
7
7
|
|
|
8
8
|
import { readFileSync, existsSync } from "fs";
|
|
9
9
|
import { dirname, join } from "path";
|
|
@@ -306,3 +306,4 @@ export function getWritablePaths(config, override) {
|
|
|
306
306
|
}
|
|
307
307
|
return config.writablePaths;
|
|
308
308
|
}
|
|
309
|
+
export { loadConfig, getWritablePaths } from "../../copilot/config.js";
|