@ryuenn3123/agentic-senior-core 2.0.3 → 2.0.5
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/.agent-context/blueprints/mobile-app.md +21 -21
- package/.agent-context/profiles/platform.md +13 -13
- package/.agent-context/profiles/regulated.md +13 -13
- package/.agent-context/profiles/startup.md +13 -13
- package/.agent-context/review-checklists/frontend-skill-parity.md +28 -28
- package/.agent-context/review-checklists/frontend-usability.md +33 -33
- package/.agent-context/review-checklists/release-operations.md +29 -29
- package/.agent-context/skills/README.md +62 -62
- package/.agent-context/skills/backend/README.md +67 -67
- package/.agent-context/skills/backend/architecture.md +360 -360
- package/.agent-context/skills/backend/compatibility-manifest.json +8 -8
- package/.agent-context/skills/backend/data-access.md +230 -230
- package/.agent-context/skills/backend/errors.md +137 -137
- package/.agent-context/skills/backend/validation.md +116 -116
- package/.agent-context/skills/backend.md +28 -28
- package/.agent-context/skills/cli/README.md +49 -49
- package/.agent-context/skills/cli/compatibility-manifest.json +8 -8
- package/.agent-context/skills/cli/init.md +37 -37
- package/.agent-context/skills/cli/output.md +35 -35
- package/.agent-context/skills/cli/upgrade.md +37 -37
- package/.agent-context/skills/cli.md +28 -28
- package/.agent-context/skills/distribution/README.md +18 -18
- package/.agent-context/skills/distribution/compatibility-manifest.json +8 -8
- package/.agent-context/skills/distribution/compatibility.md +31 -31
- package/.agent-context/skills/distribution/publish.md +36 -36
- package/.agent-context/skills/distribution/rollback.md +31 -31
- package/.agent-context/skills/distribution.md +28 -28
- package/.agent-context/skills/frontend/README.md +35 -35
- package/.agent-context/skills/frontend/accessibility.md +107 -107
- package/.agent-context/skills/frontend/compatibility-manifest.json +8 -8
- package/.agent-context/skills/frontend/motion.md +66 -66
- package/.agent-context/skills/frontend/performance.md +62 -62
- package/.agent-context/skills/frontend/ui-architecture.md +128 -128
- package/.agent-context/skills/frontend.md +29 -29
- package/.agent-context/skills/fullstack/README.md +18 -18
- package/.agent-context/skills/fullstack/compatibility-manifest.json +8 -8
- package/.agent-context/skills/fullstack/contracts.md +52 -52
- package/.agent-context/skills/fullstack/end-to-end.md +41 -41
- package/.agent-context/skills/fullstack/feature-slicing.md +64 -64
- package/.agent-context/skills/fullstack.md +26 -26
- package/.agent-context/skills/index.json +107 -107
- package/.agent-context/skills/review-quality/README.md +18 -18
- package/.agent-context/skills/review-quality/benchmark.md +29 -29
- package/.agent-context/skills/review-quality/compatibility-manifest.json +8 -8
- package/.agent-context/skills/review-quality/planning.md +37 -37
- package/.agent-context/skills/review-quality/security.md +33 -33
- package/.agent-context/skills/review-quality.md +27 -27
- package/.agent-context/stacks/flutter.md +16 -16
- package/.agent-context/stacks/react-native.md +16 -16
- package/.agent-context/state/architecture-map.md +25 -25
- package/.agent-context/state/benchmark-analysis.json +431 -431
- package/.agent-context/state/benchmark-thresholds.json +10 -10
- package/.agent-context/state/benchmark-watchlist.json +19 -19
- package/.agent-context/state/dependency-map.md +32 -32
- package/.agent-context/state/quality-trend-report.json +79 -0
- package/.agent-context/state/skill-platform.json +38 -38
- package/.agent-context/state/token-optimization-benchmark.json +130 -0
- package/.agent-override.md +36 -36
- package/.cursorrules +1 -1
- package/.gemini/instructions.md +21 -97
- package/.github/ISSUE_TEMPLATE/v1.7-frontend-work-item.yml +54 -54
- package/.github/copilot-instructions.md +21 -166
- package/.github/workflows/benchmark-detection.yml +38 -38
- package/.github/workflows/benchmark-intelligence.yml +50 -50
- package/.github/workflows/frontend-usability-gate.yml +36 -36
- package/.github/workflows/release-gate.yml +32 -32
- package/.github/workflows/sbom-compliance.yml +32 -32
- package/.windsurfrules +1 -1
- package/AGENTS.md +28 -181
- package/README.md +368 -346
- package/lib/cli/commands/optimize.mjs +171 -171
- package/lib/cli/compatibility.mjs +124 -124
- package/lib/cli/token-optimization.mjs +275 -275
- package/mcp.json +92 -92
- package/package.json +3 -1
- package/scripts/benchmark-gate.mjs +121 -121
- package/scripts/benchmark-intelligence.mjs +140 -140
- package/scripts/detection-benchmark.mjs +138 -138
- package/scripts/frontend-usability-audit.mjs +87 -87
- package/scripts/generate-sbom.mjs +61 -61
- package/scripts/init-project.ps1 +104 -104
- package/scripts/llm-judge.mjs +664 -664
- package/scripts/quality-trend-report.mjs +289 -0
- package/scripts/release-gate.mjs +259 -204
- package/scripts/skill-tier-policy.mjs +75 -75
- package/scripts/token-optimization-benchmark.mjs +252 -0
- package/scripts/validate.mjs +865 -811
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* frontend-usability-audit.mjs
|
|
5
|
-
*
|
|
6
|
-
* Governance-level audit for V1.7 frontend execution assets.
|
|
7
|
-
* This repository does not host a frontend runtime app, so the audit validates
|
|
8
|
-
* required execution artifacts and quality gates documentation.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
12
|
-
import { resolve, dirname } from 'node:path';
|
|
13
|
-
import { fileURLToPath } from 'node:url';
|
|
14
|
-
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
const __dirname = dirname(__filename);
|
|
17
|
-
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
18
|
-
|
|
19
|
-
const REQUIRED_FILES = [
|
|
20
|
-
'docs/roadmap.md',
|
|
21
|
-
'docs/v1.7-issue-breakdown.md',
|
|
22
|
-
'docs/v1.7-execution-playbook.md',
|
|
23
|
-
'.agent-context/review-checklists/frontend-usability.md',
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
const REQUIRED_ROADMAP_SNIPPETS = [
|
|
27
|
-
'V1.7',
|
|
28
|
-
'Frontend Product Experience',
|
|
29
|
-
'Release status: Completed',
|
|
30
|
-
'Delivered Scope',
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
const REQUIRED_CHECKLIST_SNIPPETS = [
|
|
34
|
-
'Responsiveness',
|
|
35
|
-
'Accessibility',
|
|
36
|
-
'Performance',
|
|
37
|
-
'Documentation and Release Evidence',
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
function assertFileExists(relativeFilePath, failures) {
|
|
41
|
-
const absoluteFilePath = resolve(REPOSITORY_ROOT, relativeFilePath);
|
|
42
|
-
if (!existsSync(absoluteFilePath)) {
|
|
43
|
-
failures.push(`Missing required file: ${relativeFilePath}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function assertContains(contentLabel, filePath, fileContent, snippets, failures) {
|
|
48
|
-
for (const snippetText of snippets) {
|
|
49
|
-
if (!fileContent.includes(snippetText)) {
|
|
50
|
-
failures.push(`${contentLabel} missing snippet "${snippetText}" in ${filePath}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function runAudit() {
|
|
56
|
-
const failures = [];
|
|
57
|
-
|
|
58
|
-
for (const requiredFilePath of REQUIRED_FILES) {
|
|
59
|
-
assertFileExists(requiredFilePath, failures);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const roadmapPath = 'docs/roadmap.md';
|
|
63
|
-
const checklistPath = '.agent-context/review-checklists/frontend-usability.md';
|
|
64
|
-
|
|
65
|
-
if (existsSync(resolve(REPOSITORY_ROOT, roadmapPath))) {
|
|
66
|
-
const roadmapContent = readFileSync(resolve(REPOSITORY_ROOT, roadmapPath), 'utf8');
|
|
67
|
-
assertContains('Roadmap', roadmapPath, roadmapContent, REQUIRED_ROADMAP_SNIPPETS, failures);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (existsSync(resolve(REPOSITORY_ROOT, checklistPath))) {
|
|
71
|
-
const checklistContent = readFileSync(resolve(REPOSITORY_ROOT, checklistPath), 'utf8');
|
|
72
|
-
assertContains('Checklist', checklistPath, checklistContent, REQUIRED_CHECKLIST_SNIPPETS, failures);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const reportPayload = {
|
|
76
|
-
generatedAt: new Date().toISOString(),
|
|
77
|
-
auditName: 'frontend-usability-audit',
|
|
78
|
-
passed: failures.length === 0,
|
|
79
|
-
failureCount: failures.length,
|
|
80
|
-
failures,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
console.log(JSON.stringify(reportPayload, null, 2));
|
|
84
|
-
process.exit(reportPayload.passed ? 0 : 1);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
runAudit();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* frontend-usability-audit.mjs
|
|
5
|
+
*
|
|
6
|
+
* Governance-level audit for V1.7 frontend execution assets.
|
|
7
|
+
* This repository does not host a frontend runtime app, so the audit validates
|
|
8
|
+
* required execution artifacts and quality gates documentation.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
12
|
+
import { resolve, dirname } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
18
|
+
|
|
19
|
+
const REQUIRED_FILES = [
|
|
20
|
+
'docs/roadmap.md',
|
|
21
|
+
'docs/v1.7-issue-breakdown.md',
|
|
22
|
+
'docs/v1.7-execution-playbook.md',
|
|
23
|
+
'.agent-context/review-checklists/frontend-usability.md',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const REQUIRED_ROADMAP_SNIPPETS = [
|
|
27
|
+
'V1.7',
|
|
28
|
+
'Frontend Product Experience',
|
|
29
|
+
'Release status: Completed',
|
|
30
|
+
'Delivered Scope',
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const REQUIRED_CHECKLIST_SNIPPETS = [
|
|
34
|
+
'Responsiveness',
|
|
35
|
+
'Accessibility',
|
|
36
|
+
'Performance',
|
|
37
|
+
'Documentation and Release Evidence',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
function assertFileExists(relativeFilePath, failures) {
|
|
41
|
+
const absoluteFilePath = resolve(REPOSITORY_ROOT, relativeFilePath);
|
|
42
|
+
if (!existsSync(absoluteFilePath)) {
|
|
43
|
+
failures.push(`Missing required file: ${relativeFilePath}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function assertContains(contentLabel, filePath, fileContent, snippets, failures) {
|
|
48
|
+
for (const snippetText of snippets) {
|
|
49
|
+
if (!fileContent.includes(snippetText)) {
|
|
50
|
+
failures.push(`${contentLabel} missing snippet "${snippetText}" in ${filePath}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function runAudit() {
|
|
56
|
+
const failures = [];
|
|
57
|
+
|
|
58
|
+
for (const requiredFilePath of REQUIRED_FILES) {
|
|
59
|
+
assertFileExists(requiredFilePath, failures);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const roadmapPath = 'docs/roadmap.md';
|
|
63
|
+
const checklistPath = '.agent-context/review-checklists/frontend-usability.md';
|
|
64
|
+
|
|
65
|
+
if (existsSync(resolve(REPOSITORY_ROOT, roadmapPath))) {
|
|
66
|
+
const roadmapContent = readFileSync(resolve(REPOSITORY_ROOT, roadmapPath), 'utf8');
|
|
67
|
+
assertContains('Roadmap', roadmapPath, roadmapContent, REQUIRED_ROADMAP_SNIPPETS, failures);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (existsSync(resolve(REPOSITORY_ROOT, checklistPath))) {
|
|
71
|
+
const checklistContent = readFileSync(resolve(REPOSITORY_ROOT, checklistPath), 'utf8');
|
|
72
|
+
assertContains('Checklist', checklistPath, checklistContent, REQUIRED_CHECKLIST_SNIPPETS, failures);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const reportPayload = {
|
|
76
|
+
generatedAt: new Date().toISOString(),
|
|
77
|
+
auditName: 'frontend-usability-audit',
|
|
78
|
+
passed: failures.length === 0,
|
|
79
|
+
failureCount: failures.length,
|
|
80
|
+
failures,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
console.log(JSON.stringify(reportPayload, null, 2));
|
|
84
|
+
process.exit(reportPayload.passed ? 0 : 1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
runAudit();
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* generate-sbom.mjs
|
|
5
|
-
*
|
|
6
|
-
* Minimal CycloneDX-compatible SBOM for governance CI evidence.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { readFileSync } from 'node:fs';
|
|
10
|
-
import { resolve, dirname } from 'node:path';
|
|
11
|
-
import { fileURLToPath } from 'node:url';
|
|
12
|
-
import { randomUUID } from 'node:crypto';
|
|
13
|
-
|
|
14
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
-
const __dirname = dirname(__filename);
|
|
16
|
-
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
17
|
-
const PACKAGE_JSON_PATH = resolve(REPOSITORY_ROOT, 'package.json');
|
|
18
|
-
|
|
19
|
-
function buildComponents(dependencyGroup, dependencies) {
|
|
20
|
-
return Object.entries(dependencies || {}).map(([dependencyName, dependencyVersion]) => ({
|
|
21
|
-
type: 'library',
|
|
22
|
-
name: dependencyName,
|
|
23
|
-
version: String(dependencyVersion).replace(/^[^\d]*/, ''),
|
|
24
|
-
scope: dependencyGroup,
|
|
25
|
-
purl: `pkg:npm/${dependencyName}@${String(dependencyVersion).replace(/^[^\d]*/, '')}`,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function generateSbom() {
|
|
30
|
-
const packageManifest = JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf8'));
|
|
31
|
-
const runtimeComponents = buildComponents('required', packageManifest.dependencies);
|
|
32
|
-
const developmentComponents = buildComponents('optional', packageManifest.devDependencies);
|
|
33
|
-
const allComponents = [...runtimeComponents, ...developmentComponents];
|
|
34
|
-
|
|
35
|
-
const sbomPayload = {
|
|
36
|
-
bomFormat: 'CycloneDX',
|
|
37
|
-
specVersion: '1.5',
|
|
38
|
-
serialNumber: `urn:uuid:${randomUUID()}`,
|
|
39
|
-
version: 1,
|
|
40
|
-
metadata: {
|
|
41
|
-
timestamp: new Date().toISOString(),
|
|
42
|
-
component: {
|
|
43
|
-
type: 'application',
|
|
44
|
-
name: packageManifest.name,
|
|
45
|
-
version: packageManifest.version,
|
|
46
|
-
},
|
|
47
|
-
tools: [
|
|
48
|
-
{
|
|
49
|
-
vendor: 'Agentic-Senior-Core',
|
|
50
|
-
name: 'generate-sbom.mjs',
|
|
51
|
-
version: packageManifest.version,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
components: allComponents,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
console.log(JSON.stringify(sbomPayload, null, 2));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
generateSbom();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* generate-sbom.mjs
|
|
5
|
+
*
|
|
6
|
+
* Minimal CycloneDX-compatible SBOM for governance CI evidence.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
import { resolve, dirname } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { randomUUID } from 'node:crypto';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = dirname(__filename);
|
|
16
|
+
const REPOSITORY_ROOT = resolve(__dirname, '..');
|
|
17
|
+
const PACKAGE_JSON_PATH = resolve(REPOSITORY_ROOT, 'package.json');
|
|
18
|
+
|
|
19
|
+
function buildComponents(dependencyGroup, dependencies) {
|
|
20
|
+
return Object.entries(dependencies || {}).map(([dependencyName, dependencyVersion]) => ({
|
|
21
|
+
type: 'library',
|
|
22
|
+
name: dependencyName,
|
|
23
|
+
version: String(dependencyVersion).replace(/^[^\d]*/, ''),
|
|
24
|
+
scope: dependencyGroup,
|
|
25
|
+
purl: `pkg:npm/${dependencyName}@${String(dependencyVersion).replace(/^[^\d]*/, '')}`,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function generateSbom() {
|
|
30
|
+
const packageManifest = JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf8'));
|
|
31
|
+
const runtimeComponents = buildComponents('required', packageManifest.dependencies);
|
|
32
|
+
const developmentComponents = buildComponents('optional', packageManifest.devDependencies);
|
|
33
|
+
const allComponents = [...runtimeComponents, ...developmentComponents];
|
|
34
|
+
|
|
35
|
+
const sbomPayload = {
|
|
36
|
+
bomFormat: 'CycloneDX',
|
|
37
|
+
specVersion: '1.5',
|
|
38
|
+
serialNumber: `urn:uuid:${randomUUID()}`,
|
|
39
|
+
version: 1,
|
|
40
|
+
metadata: {
|
|
41
|
+
timestamp: new Date().toISOString(),
|
|
42
|
+
component: {
|
|
43
|
+
type: 'application',
|
|
44
|
+
name: packageManifest.name,
|
|
45
|
+
version: packageManifest.version,
|
|
46
|
+
},
|
|
47
|
+
tools: [
|
|
48
|
+
{
|
|
49
|
+
vendor: 'Agentic-Senior-Core',
|
|
50
|
+
name: 'generate-sbom.mjs',
|
|
51
|
+
version: packageManifest.version,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
components: allComponents,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
console.log(JSON.stringify(sbomPayload, null, 2));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
generateSbom();
|
package/scripts/init-project.ps1
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
#!/usr/bin/env pwsh
|
|
2
|
-
|
|
3
|
-
[CmdletBinding()]
|
|
4
|
-
param(
|
|
5
|
-
[string]$TargetDirectory = ".",
|
|
6
|
-
[ValidateSet("beginner", "balanced", "strict")]
|
|
7
|
-
[string]$Profile,
|
|
8
|
-
[string]$Stack,
|
|
9
|
-
[string]$Blueprint,
|
|
10
|
-
[ValidateSet("true", "false")]
|
|
11
|
-
[string]$Ci,
|
|
12
|
-
[switch]$Newbie,
|
|
13
|
-
[string]$RepositoryUrl = "https://github.com/fatidaprilian/Agentic-Senior-Core.git",
|
|
14
|
-
[string[]]$AdditionalArguments
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
$ErrorActionPreference = "Stop"
|
|
18
|
-
|
|
19
|
-
function Resolve-AbsolutePath {
|
|
20
|
-
param([string]$PathValue)
|
|
21
|
-
|
|
22
|
-
if ([string]::IsNullOrWhiteSpace($PathValue)) {
|
|
23
|
-
throw "TargetDirectory cannot be empty."
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if ([System.IO.Path]::IsPathRooted($PathValue)) {
|
|
27
|
-
return [System.IO.Path]::GetFullPath($PathValue)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
$combinedPath = Join-Path -Path (Get-Location) -ChildPath $PathValue
|
|
31
|
-
return [System.IO.Path]::GetFullPath($combinedPath)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function New-TemporaryDirectory {
|
|
35
|
-
$temporaryDirectoryName = "agentic-senior-core-bootstrap-$(Get-Date -Format 'yyyyMMddHHmmssfff')"
|
|
36
|
-
$temporaryDirectoryPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $temporaryDirectoryName
|
|
37
|
-
New-Item -ItemType Directory -Path $temporaryDirectoryPath | Out-Null
|
|
38
|
-
return $temporaryDirectoryPath
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
$targetDirectoryPath = Resolve-AbsolutePath -PathValue $TargetDirectory
|
|
42
|
-
if (-not (Test-Path -Path $targetDirectoryPath -PathType Container)) {
|
|
43
|
-
throw "Target directory does not exist: $targetDirectoryPath"
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
$temporaryRootDirectoryPath = New-TemporaryDirectory
|
|
47
|
-
$bootstrapRepositoryPath = Join-Path -Path $temporaryRootDirectoryPath -ChildPath "Agentic-Senior-Core"
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
|
51
|
-
throw "Git is required but was not found in PATH."
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
55
|
-
throw "Node.js is required but was not found in PATH."
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
Write-Host "[Agentic-Senior-Core] Cloning bootstrap repository into temporary directory..."
|
|
59
|
-
& git clone --depth 1 $RepositoryUrl $bootstrapRepositoryPath | Out-Null
|
|
60
|
-
if ($LASTEXITCODE -ne 0) {
|
|
61
|
-
throw "Failed to clone repository from $RepositoryUrl"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
$cliScriptPath = Join-Path -Path $bootstrapRepositoryPath -ChildPath "bin\agentic-senior-core.js"
|
|
65
|
-
if (-not (Test-Path -Path $cliScriptPath -PathType Leaf)) {
|
|
66
|
-
throw "CLI entry file not found: $cliScriptPath"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
$cliArguments = @($cliScriptPath, "init", $targetDirectoryPath)
|
|
70
|
-
|
|
71
|
-
if ($Profile) {
|
|
72
|
-
$cliArguments += @("--profile", $Profile)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if ($Stack) {
|
|
76
|
-
$cliArguments += @("--stack", $Stack)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if ($Blueprint) {
|
|
80
|
-
$cliArguments += @("--blueprint", $Blueprint)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if ($Ci) {
|
|
84
|
-
$cliArguments += @("--ci", $Ci)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if ($Newbie.IsPresent) {
|
|
88
|
-
$cliArguments += "--newbie"
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if ($AdditionalArguments) {
|
|
92
|
-
$cliArguments += $AdditionalArguments
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
Write-Host "[Agentic-Senior-Core] Running CLI against target directory: $targetDirectoryPath"
|
|
96
|
-
& node @cliArguments
|
|
97
|
-
if ($LASTEXITCODE -ne 0) {
|
|
98
|
-
throw "CLI exited with a non-zero status code: $LASTEXITCODE"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
finally {
|
|
102
|
-
if (Test-Path -Path $temporaryRootDirectoryPath) {
|
|
103
|
-
Remove-Item -Path $temporaryRootDirectoryPath -Recurse -Force
|
|
104
|
-
}
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
|
|
3
|
+
[CmdletBinding()]
|
|
4
|
+
param(
|
|
5
|
+
[string]$TargetDirectory = ".",
|
|
6
|
+
[ValidateSet("beginner", "balanced", "strict")]
|
|
7
|
+
[string]$Profile,
|
|
8
|
+
[string]$Stack,
|
|
9
|
+
[string]$Blueprint,
|
|
10
|
+
[ValidateSet("true", "false")]
|
|
11
|
+
[string]$Ci,
|
|
12
|
+
[switch]$Newbie,
|
|
13
|
+
[string]$RepositoryUrl = "https://github.com/fatidaprilian/Agentic-Senior-Core.git",
|
|
14
|
+
[string[]]$AdditionalArguments
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
$ErrorActionPreference = "Stop"
|
|
18
|
+
|
|
19
|
+
function Resolve-AbsolutePath {
|
|
20
|
+
param([string]$PathValue)
|
|
21
|
+
|
|
22
|
+
if ([string]::IsNullOrWhiteSpace($PathValue)) {
|
|
23
|
+
throw "TargetDirectory cannot be empty."
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if ([System.IO.Path]::IsPathRooted($PathValue)) {
|
|
27
|
+
return [System.IO.Path]::GetFullPath($PathValue)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
$combinedPath = Join-Path -Path (Get-Location) -ChildPath $PathValue
|
|
31
|
+
return [System.IO.Path]::GetFullPath($combinedPath)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function New-TemporaryDirectory {
|
|
35
|
+
$temporaryDirectoryName = "agentic-senior-core-bootstrap-$(Get-Date -Format 'yyyyMMddHHmmssfff')"
|
|
36
|
+
$temporaryDirectoryPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $temporaryDirectoryName
|
|
37
|
+
New-Item -ItemType Directory -Path $temporaryDirectoryPath | Out-Null
|
|
38
|
+
return $temporaryDirectoryPath
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$targetDirectoryPath = Resolve-AbsolutePath -PathValue $TargetDirectory
|
|
42
|
+
if (-not (Test-Path -Path $targetDirectoryPath -PathType Container)) {
|
|
43
|
+
throw "Target directory does not exist: $targetDirectoryPath"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
$temporaryRootDirectoryPath = New-TemporaryDirectory
|
|
47
|
+
$bootstrapRepositoryPath = Join-Path -Path $temporaryRootDirectoryPath -ChildPath "Agentic-Senior-Core"
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
|
51
|
+
throw "Git is required but was not found in PATH."
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
|
55
|
+
throw "Node.js is required but was not found in PATH."
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Write-Host "[Agentic-Senior-Core] Cloning bootstrap repository into temporary directory..."
|
|
59
|
+
& git clone --depth 1 $RepositoryUrl $bootstrapRepositoryPath | Out-Null
|
|
60
|
+
if ($LASTEXITCODE -ne 0) {
|
|
61
|
+
throw "Failed to clone repository from $RepositoryUrl"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$cliScriptPath = Join-Path -Path $bootstrapRepositoryPath -ChildPath "bin\agentic-senior-core.js"
|
|
65
|
+
if (-not (Test-Path -Path $cliScriptPath -PathType Leaf)) {
|
|
66
|
+
throw "CLI entry file not found: $cliScriptPath"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
$cliArguments = @($cliScriptPath, "init", $targetDirectoryPath)
|
|
70
|
+
|
|
71
|
+
if ($Profile) {
|
|
72
|
+
$cliArguments += @("--profile", $Profile)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if ($Stack) {
|
|
76
|
+
$cliArguments += @("--stack", $Stack)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if ($Blueprint) {
|
|
80
|
+
$cliArguments += @("--blueprint", $Blueprint)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if ($Ci) {
|
|
84
|
+
$cliArguments += @("--ci", $Ci)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if ($Newbie.IsPresent) {
|
|
88
|
+
$cliArguments += "--newbie"
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if ($AdditionalArguments) {
|
|
92
|
+
$cliArguments += $AdditionalArguments
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Write-Host "[Agentic-Senior-Core] Running CLI against target directory: $targetDirectoryPath"
|
|
96
|
+
& node @cliArguments
|
|
97
|
+
if ($LASTEXITCODE -ne 0) {
|
|
98
|
+
throw "CLI exited with a non-zero status code: $LASTEXITCODE"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
if (Test-Path -Path $temporaryRootDirectoryPath) {
|
|
103
|
+
Remove-Item -Path $temporaryRootDirectoryPath -Recurse -Force
|
|
104
|
+
}
|
|
105
105
|
}
|