agentxchain 2.85.0 → 2.87.0
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
package/src/commands/init.js
CHANGED
|
@@ -117,6 +117,7 @@ const DEFAULT_GOVERNED_LOCAL_DEV_RUNTIME = Object.freeze({
|
|
|
117
117
|
|
|
118
118
|
const GOVERNED_RUNTIMES = {
|
|
119
119
|
'manual-pm': { type: 'manual' },
|
|
120
|
+
'manual-dev': { type: 'manual' },
|
|
120
121
|
'local-dev': DEFAULT_GOVERNED_LOCAL_DEV_RUNTIME,
|
|
121
122
|
'api-qa': { type: 'api_proxy', provider: 'anthropic', model: 'claude-sonnet-4-6', auth_env: 'ANTHROPIC_API_KEY' },
|
|
122
123
|
'manual-qa': { type: 'manual' },
|
|
@@ -615,15 +616,23 @@ function cloneJsonCompatible(value) {
|
|
|
615
616
|
return value == null ? value : JSON.parse(JSON.stringify(value));
|
|
616
617
|
}
|
|
617
618
|
|
|
618
|
-
function buildScaffoldConfigFromTemplate(template, localDevRuntime, workflowKitConfig) {
|
|
619
|
+
function buildScaffoldConfigFromTemplate(template, localDevRuntime, workflowKitConfig, runtimeOptions = {}) {
|
|
619
620
|
const blueprint = template.scaffold_blueprint || null;
|
|
620
621
|
const roles = cloneJsonCompatible(blueprint?.roles || GOVERNED_ROLES);
|
|
621
622
|
const runtimes = cloneJsonCompatible(blueprint?.runtimes || GOVERNED_RUNTIMES);
|
|
623
|
+
const explicitLocalDevRequested = Boolean(
|
|
624
|
+
(Array.isArray(runtimeOptions.devCommand) && runtimeOptions.devCommand.length > 0)
|
|
625
|
+
|| (typeof runtimeOptions.devPromptTransport === 'string' && runtimeOptions.devPromptTransport.trim())
|
|
626
|
+
);
|
|
622
627
|
|
|
623
|
-
if (!blueprint || Object.values(roles).some((role) => role?.runtime === 'local-dev')) {
|
|
628
|
+
if (!blueprint || Object.values(roles).some((role) => role?.runtime === 'local-dev') || explicitLocalDevRequested) {
|
|
624
629
|
runtimes['local-dev'] = localDevRuntime;
|
|
625
630
|
}
|
|
626
631
|
|
|
632
|
+
if (explicitLocalDevRequested && roles?.dev?.runtime === 'manual-dev') {
|
|
633
|
+
roles.dev.runtime = 'local-dev';
|
|
634
|
+
}
|
|
635
|
+
|
|
627
636
|
const routing = cloneJsonCompatible(blueprint?.routing || GOVERNED_ROUTING);
|
|
628
637
|
const gates = cloneJsonCompatible(blueprint?.gates || GOVERNED_GATES);
|
|
629
638
|
const effectiveWorkflowKitConfig = workflowKitConfig || cloneJsonCompatible(blueprint?.workflow_kit || null);
|
|
@@ -713,7 +722,7 @@ function buildPlanningSummaryLines(template, workflowKitConfig) {
|
|
|
713
722
|
export function scaffoldGoverned(dir, projectName, projectId, templateId = 'generic', runtimeOptions = {}, workflowKitConfig = null) {
|
|
714
723
|
const template = loadGovernedTemplate(templateId);
|
|
715
724
|
const { runtime: localDevRuntime } = resolveGovernedLocalDevRuntime(runtimeOptions);
|
|
716
|
-
const scaffoldConfig = buildScaffoldConfigFromTemplate(template, localDevRuntime, workflowKitConfig);
|
|
725
|
+
const scaffoldConfig = buildScaffoldConfigFromTemplate(template, localDevRuntime, workflowKitConfig, runtimeOptions);
|
|
717
726
|
const { roles, runtimes, routing, gates, policies, prompts, workflowKitConfig: effectiveWorkflowKitConfig } = scaffoldConfig;
|
|
718
727
|
const scaffoldWorkflowKitConfig = effectiveWorkflowKitConfig
|
|
719
728
|
? normalizeWorkflowKit(effectiveWorkflowKitConfig, Object.keys(routing))
|
|
@@ -920,6 +929,12 @@ async function initGoverned(opts) {
|
|
|
920
929
|
selectedTemplate = loadGovernedTemplate(templateId);
|
|
921
930
|
|
|
922
931
|
if (opts.yes) {
|
|
932
|
+
// Auto-detect in-place scaffolding: if cwd is a git repo without agentxchain.json,
|
|
933
|
+
// scaffold here instead of creating a subdirectory. First-time users who already
|
|
934
|
+
// ran `mkdir my-project && cd my-project && git init` should not get a nested folder.
|
|
935
|
+
if (!explicitDir && existsSync(join(process.cwd(), '.git')) && !existsSync(join(process.cwd(), CONFIG_FILE))) {
|
|
936
|
+
explicitDir = '.';
|
|
937
|
+
}
|
|
923
938
|
projectName = explicitDir
|
|
924
939
|
? inferProjectNameFromTarget(explicitDir, 'My AgentXchain Project')
|
|
925
940
|
: 'My AgentXchain Project';
|
|
@@ -1027,6 +1042,9 @@ async function initGoverned(opts) {
|
|
|
1027
1042
|
}
|
|
1028
1043
|
}
|
|
1029
1044
|
console.log('');
|
|
1045
|
+
} else if (Object.entries(config.roles).every(([, role]) => allRuntimes[role.runtime]?.type === 'manual')) {
|
|
1046
|
+
console.log(` ${chalk.green('Ready:')} manual-only scaffold (${chalk.bold('no API keys')} and ${chalk.bold('no local coding CLI')} required).`);
|
|
1047
|
+
console.log('');
|
|
1030
1048
|
}
|
|
1031
1049
|
|
|
1032
1050
|
console.log(` ${chalk.cyan('Next:')}`);
|
|
@@ -4,6 +4,40 @@
|
|
|
4
4
|
"description": "Default governed scaffold with the baseline planning artifacts and no project-type-specific guidance.",
|
|
5
5
|
"version": "1",
|
|
6
6
|
"protocol_compatibility": ["1.0", "1.1"],
|
|
7
|
+
"scaffold_blueprint": {
|
|
8
|
+
"roles": {
|
|
9
|
+
"pm": {
|
|
10
|
+
"title": "Product Manager",
|
|
11
|
+
"mandate": "Protect user value, scope clarity, and acceptance criteria.",
|
|
12
|
+
"write_authority": "review_only",
|
|
13
|
+
"runtime": "manual-pm"
|
|
14
|
+
},
|
|
15
|
+
"dev": {
|
|
16
|
+
"title": "Developer",
|
|
17
|
+
"mandate": "Implement approved work safely and verify behavior.",
|
|
18
|
+
"write_authority": "authoritative",
|
|
19
|
+
"runtime": "manual-dev"
|
|
20
|
+
},
|
|
21
|
+
"qa": {
|
|
22
|
+
"title": "QA",
|
|
23
|
+
"mandate": "Challenge correctness, acceptance coverage, and ship readiness.",
|
|
24
|
+
"write_authority": "review_only",
|
|
25
|
+
"runtime": "manual-qa"
|
|
26
|
+
},
|
|
27
|
+
"eng_director": {
|
|
28
|
+
"title": "Engineering Director",
|
|
29
|
+
"mandate": "Resolve tactical deadlocks and enforce technical coherence.",
|
|
30
|
+
"write_authority": "review_only",
|
|
31
|
+
"runtime": "manual-director"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"runtimes": {
|
|
35
|
+
"manual-pm": { "type": "manual" },
|
|
36
|
+
"manual-dev": { "type": "manual" },
|
|
37
|
+
"manual-qa": { "type": "manual" },
|
|
38
|
+
"manual-director": { "type": "manual" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
7
41
|
"planning_artifacts": [],
|
|
8
42
|
"prompt_overrides": {},
|
|
9
43
|
"acceptance_hints": []
|