@hongmaple0820/scale-engine 0.33.0 → 0.39.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/README.en.md +86 -376
- package/README.md +95 -540
- package/dist/api/cli.js +293 -18
- package/dist/api/cli.js.map +1 -1
- package/dist/api/doctor.d.ts +38 -3
- package/dist/api/doctor.js +269 -44
- package/dist/api/doctor.js.map +1 -1
- package/dist/api/mcp.js +2 -2
- package/dist/api/mcp.js.map +1 -1
- package/dist/api/quickstart.d.ts +34 -4
- package/dist/api/quickstart.js +90 -73
- package/dist/api/quickstart.js.map +1 -1
- package/dist/bootstrap/DependencyBootstrap.d.ts +110 -0
- package/dist/bootstrap/DependencyBootstrap.js +829 -0
- package/dist/bootstrap/DependencyBootstrap.js.map +1 -0
- package/dist/bootstrap/DependencyBootstrapRenderer.d.ts +3 -0
- package/dist/bootstrap/DependencyBootstrapRenderer.js +140 -0
- package/dist/bootstrap/DependencyBootstrapRenderer.js.map +1 -0
- package/dist/capabilities/InstalledSkillsIntegration.js +14 -6
- package/dist/capabilities/InstalledSkillsIntegration.js.map +1 -1
- package/dist/cli/gateStatusCommands.d.ts +1 -0
- package/dist/cli/gateStatusCommands.js +52 -0
- package/dist/cli/gateStatusCommands.js.map +1 -0
- package/dist/cli/phaseCommands.js +15 -3
- package/dist/cli/phaseCommands.js.map +1 -1
- package/dist/cli/promptCommands.d.ts +1 -0
- package/dist/cli/promptCommands.js +57 -0
- package/dist/cli/promptCommands.js.map +1 -0
- package/dist/cli/scoreCommands.d.ts +1 -0
- package/dist/cli/scoreCommands.js +112 -0
- package/dist/cli/scoreCommands.js.map +1 -0
- package/dist/codegraph/CodeIntelligence.d.ts +12 -0
- package/dist/codegraph/CodeIntelligence.js +251 -30
- package/dist/codegraph/CodeIntelligence.js.map +1 -1
- package/dist/config/profiles.d.ts +12 -0
- package/dist/config/profiles.js +39 -4
- package/dist/config/profiles.js.map +1 -1
- package/dist/context/SessionStartSequence.js +13 -4
- package/dist/context/SessionStartSequence.js.map +1 -1
- package/dist/core/ExternalCommand.d.ts +9 -0
- package/dist/core/ExternalCommand.js +70 -0
- package/dist/core/ExternalCommand.js.map +1 -0
- package/dist/env/EnvironmentDoctor.d.ts +66 -0
- package/dist/env/EnvironmentDoctor.js +365 -0
- package/dist/env/EnvironmentDoctor.js.map +1 -0
- package/dist/i18n/Language.d.ts +9 -0
- package/dist/i18n/Language.js +38 -0
- package/dist/i18n/Language.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge/CerebrumManager.d.ts +2 -2
- package/dist/knowledge/CerebrumManager.js.map +1 -1
- package/dist/knowledge/GraphifyKnowledgeBase.d.ts +38 -0
- package/dist/knowledge/GraphifyKnowledgeBase.js +409 -0
- package/dist/knowledge/GraphifyKnowledgeBase.js.map +1 -0
- package/dist/memory/MemoryFabric.js +1 -0
- package/dist/memory/MemoryFabric.js.map +1 -1
- package/dist/memory/MemoryIntelligence.d.ts +42 -0
- package/dist/memory/MemoryIntelligence.js +215 -0
- package/dist/memory/MemoryIntelligence.js.map +1 -0
- package/dist/memory/MemoryProviders.d.ts +22 -0
- package/dist/memory/MemoryProviders.js +171 -5
- package/dist/memory/MemoryProviders.js.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.js +1 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/prompts/PromptOptimizer.d.ts +42 -0
- package/dist/prompts/PromptOptimizer.js +309 -0
- package/dist/prompts/PromptOptimizer.js.map +1 -0
- package/dist/runtime/AiOsRuntime.d.ts +2 -0
- package/dist/runtime/AiOsRuntime.js +2 -0
- package/dist/runtime/AiOsRuntime.js.map +1 -1
- package/dist/runtime/ExecutionLedger.d.ts +46 -0
- package/dist/runtime/ExecutionLedger.js +71 -0
- package/dist/runtime/ExecutionLedger.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/setup/SetupWizard.d.ts +42 -0
- package/dist/setup/SetupWizard.js +156 -0
- package/dist/setup/SetupWizard.js.map +1 -0
- package/dist/skills/SkillRepository.js +7 -7
- package/dist/skills/SkillRepository.js.map +1 -1
- package/dist/skills/routing/SkillPolicy.js +2 -2
- package/dist/skills/routing/SkillPolicy.js.map +1 -1
- package/dist/testing/DiffTestSelector.js +1 -1
- package/dist/testing/DiffTestSelector.js.map +1 -1
- package/dist/tools/RtkRuntime.d.ts +9 -0
- package/dist/tools/RtkRuntime.js +43 -0
- package/dist/tools/RtkRuntime.js.map +1 -0
- package/dist/tools/ToolCapabilityRegistry.d.ts +5 -0
- package/dist/tools/ToolCapabilityRegistry.js +75 -13
- package/dist/tools/ToolCapabilityRegistry.js.map +1 -1
- package/dist/tools/ToolOrchestrator.js +6 -4
- package/dist/tools/ToolOrchestrator.js.map +1 -1
- package/dist/tools/ToolPolicy.js +16 -1
- package/dist/tools/ToolPolicy.js.map +1 -1
- package/dist/workflow/AdaptiveWorkflowRouter.d.ts +1 -0
- package/dist/workflow/AdaptiveWorkflowRouter.js +3 -0
- package/dist/workflow/AdaptiveWorkflowRouter.js.map +1 -1
- package/dist/workflow/CommitDiscipline.d.ts +68 -0
- package/dist/workflow/CommitDiscipline.js +328 -0
- package/dist/workflow/CommitDiscipline.js.map +1 -0
- package/dist/workflow/CrossRepoOrchestrator.d.ts +92 -0
- package/dist/workflow/CrossRepoOrchestrator.js +408 -0
- package/dist/workflow/CrossRepoOrchestrator.js.map +1 -0
- package/dist/workflow/GateCatalog.d.ts +61 -0
- package/dist/workflow/GateCatalog.js +212 -0
- package/dist/workflow/GateCatalog.js.map +1 -0
- package/dist/workflow/GovernanceRoi.d.ts +52 -0
- package/dist/workflow/GovernanceRoi.js +204 -0
- package/dist/workflow/GovernanceRoi.js.map +1 -0
- package/dist/workflow/GovernanceTemplatePacks.js +19 -4
- package/dist/workflow/GovernanceTemplatePacks.js.map +1 -1
- package/dist/workflow/GovernanceTemplates.js +2 -2
- package/dist/workflow/McpGovernance.d.ts +63 -0
- package/dist/workflow/McpGovernance.js +198 -0
- package/dist/workflow/McpGovernance.js.map +1 -0
- package/dist/workflow/SessionCoordinator.d.ts +103 -0
- package/dist/workflow/SessionCoordinator.js +401 -0
- package/dist/workflow/SessionCoordinator.js.map +1 -0
- package/dist/workflow/SessionPreamble.js +7 -2
- package/dist/workflow/SessionPreamble.js.map +1 -1
- package/dist/workflow/TaskDependencyGraph.d.ts +73 -0
- package/dist/workflow/TaskDependencyGraph.js +245 -0
- package/dist/workflow/TaskDependencyGraph.js.map +1 -0
- package/dist/workflow/TaskScoreEngine.d.ts +42 -0
- package/dist/workflow/TaskScoreEngine.js +181 -0
- package/dist/workflow/TaskScoreEngine.js.map +1 -0
- package/dist/workflow/WorkflowTemplates.d.ts +38 -0
- package/dist/workflow/WorkflowTemplates.js +371 -0
- package/dist/workflow/WorkflowTemplates.js.map +1 -0
- package/dist/workflow/WorkspacePolicy.d.ts +46 -0
- package/dist/workflow/WorkspacePolicy.js +141 -0
- package/dist/workflow/WorkspacePolicy.js.map +1 -0
- package/dist/workflow/WorkspaceTopology.d.ts +3 -0
- package/dist/workflow/WorkspaceTopology.js +40 -3
- package/dist/workflow/WorkspaceTopology.js.map +1 -1
- package/dist/workflow/gates/GateSystem.js +14 -11
- package/dist/workflow/gates/GateSystem.js.map +1 -1
- package/dist/workflow/index.d.ts +9 -0
- package/dist/workflow/index.js +9 -0
- package/dist/workflow/index.js.map +1 -1
- package/docs/CODE_INTELLIGENCE.md +48 -6
- package/docs/EXTERNAL_REFERENCES.md +5 -2
- package/docs/MEMORY_FABRIC.md +28 -3
- package/docs/SKILL-REPOSITORY.md +3 -3
- package/docs/THIRD_PARTY_SKILLS.md +50 -1
- package/docs/guides/GETTING_STARTED.md +24 -0
- package/docs/start/quickstart.md +107 -69
- package/docs/workflow/GATES_AND_SCORE.md +56 -0
- package/docs/workflow/PROMPT_OPTIMIZATION.md +44 -0
- package/docs/workflow/README.md +7 -0
- package/docs/workflow/node-library.md +3 -3
- package/docs/workflow/templates/skill-plan.md +1 -1
- package/package.json +13 -5
- package/scripts/workflow/provider-rehearsal.mjs +425 -0
- package/scripts/workflow/setup-smoke.mjs +299 -0
package/dist/api/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Gateway } from '../guardrails/Gateway.js';
|
|
|
10
10
|
import { BruteRetryDetector, PrematureDoneDetector, BlameShiftDetector } from '../guardrails/detectors.js';
|
|
11
11
|
import { DangerousCommandDetector, SecretLeakDetector, RoleGateDetector, ScopeCreepDetector, BUILT_IN_ROLES } from '../guardrails/advancedDetectors.js';
|
|
12
12
|
import { auditDependencies } from '../guardrails/DependencyAuditor.js';
|
|
13
|
-
import {
|
|
13
|
+
import { GraphifyKnowledgeBase } from '../knowledge/GraphifyKnowledgeBase.js';
|
|
14
14
|
import { ContextBuilder } from '../context/ContextBuilder.js';
|
|
15
15
|
import { ProjectAnatomy } from '../context/ProjectAnatomy.js';
|
|
16
16
|
import { buildContextPack, doctorContextBudget, scanContextBudget, writeContextBudgetReport, } from '../context/ContextBudget.js';
|
|
@@ -27,7 +27,12 @@ import { createSkillPlan, evaluateSkillGate, loadSkillRoutingPolicy, skillPlanMa
|
|
|
27
27
|
import { createAdapter, SUPPORTED_AGENTS } from '../adapters/index.js';
|
|
28
28
|
import { LessonExtractor, RuleProposer, HookGenerator, EvolutionEngine } from '../evolution/EvolutionEngine.js';
|
|
29
29
|
import { Doctor } from './doctor.js';
|
|
30
|
+
import { inspectEnvironment, renderEnvironmentDoctor } from '../env/EnvironmentDoctor.js';
|
|
30
31
|
import { quickStart, detectPlatform, governanceNextSteps } from './quickstart.js';
|
|
32
|
+
import { bootstrapDependencies } from '../bootstrap/DependencyBootstrap.js';
|
|
33
|
+
import { renderDependencyBootstrapReport } from '../bootstrap/DependencyBootstrapRenderer.js';
|
|
34
|
+
import { runSetupWizard } from '../setup/SetupWizard.js';
|
|
35
|
+
import { normalizeLanguage, resolveCliLanguage } from '../i18n/Language.js';
|
|
31
36
|
import { SkillDiscovery } from '../skills/SkillDiscovery.js';
|
|
32
37
|
import { inspectRequiredWorkflowSkills, inspectWorkflowSkills } from '../skills/SkillDoctor.js';
|
|
33
38
|
import { evaluateSkillInstallSafety, listSkillRepositoryEntries, recommendSkillWorkflow, renderSkillRepositoryMarkdown, } from '../skills/SkillRepository.js';
|
|
@@ -39,8 +44,12 @@ import { OutOfScopeStore } from '../workflow/OutOfScopeStore.js';
|
|
|
39
44
|
import { ReviewStore } from '../workflow/ReviewStore.js';
|
|
40
45
|
import { WorkflowEngine } from '../workflow/WorkflowEngine.js';
|
|
41
46
|
import { resolveVerificationTargets, } from '../workflow/VerificationProfile.js';
|
|
47
|
+
import { preflightGateStages } from '../workflow/GateCatalog.js';
|
|
48
|
+
import { gatesCommand } from '../cli/gateStatusCommands.js';
|
|
49
|
+
import { scoreCommand } from '../cli/scoreCommands.js';
|
|
50
|
+
import { promptCommand } from '../cli/promptCommands.js';
|
|
42
51
|
import { writeGovernanceTemplates } from '../workflow/GovernanceTemplates.js';
|
|
43
|
-
import { getProfile as getConfigProfile, generateConfigForProfile, listProfiles as listConfigProfiles } from '../config/profiles.js';
|
|
52
|
+
import { getBootstrapPlanForProfile, getProfile as getConfigProfile, generateConfigForProfile, listProfiles as listConfigProfiles, } from '../config/profiles.js';
|
|
44
53
|
import { computeGovernanceDrift } from '../workflow/GovernanceLock.js';
|
|
45
54
|
import { applyUpgradePlan, createThirdPartyUpdateReport, createUpgradeCheckReport, createUpgradePlanReport, rollbackLatestUpgrade, writeUpgradePlanHtml, } from '../workflow/UpgradeManager.js';
|
|
46
55
|
import { createGovernanceRoiReport } from '../governance/GovernanceRoi.js';
|
|
@@ -66,7 +75,7 @@ import { renderGovernanceDashboard } from '../output/GovernanceDashboard.js';
|
|
|
66
75
|
import { cleanupWorkspaceLifecycle, inspectWorkspaceLifecycle, } from '../workflow/WorkspaceLifecycle.js';
|
|
67
76
|
import { inspectWorkspaceSafety } from '../workflow/WorkspaceSafety.js';
|
|
68
77
|
import { RuntimeEvidenceLedger, SessionLedger, createAiOsAdoption, createAiOsBenchmark, createAiOsDashboard, createAiOsDoctor, createAiOsMigration, createAiOsPlan, createAiOsRun, createAiOsStatus, doctorRuntimeEvidence, evaluateFinalReportReadiness, } from '../runtime/index.js';
|
|
69
|
-
import { MemoryFabric, MemoryBrain, doctorMemoryFabric, renderContextPackMarkdown, renderMemoryLearningCandidateMarkdown, inspectMemoryProviders, recallMemoryProviders, settleMemoryLearning, writeMemoryProvidersConfig, } from '../memory/index.js';
|
|
78
|
+
import { MemoryFabric, MemoryBrain, doctorMemoryFabric, renderContextPackMarkdown, renderMemoryLearningCandidateMarkdown, inspectMemoryProviders, recallMemoryProviders, settleMemoryLearning, useMemoryProvider, writeMemoryProvidersConfig, } from '../memory/index.js';
|
|
70
79
|
import { resolveWorkspaceTopology, workspaceTopologyPath, workspaceTopologyTemplate, } from '../workflow/WorkspaceTopology.js';
|
|
71
80
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
72
81
|
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
@@ -125,9 +134,7 @@ function normalizePreflightProfile(value) {
|
|
|
125
134
|
return 'quick';
|
|
126
135
|
}
|
|
127
136
|
function gatesForPreflightProfile(profile) {
|
|
128
|
-
|
|
129
|
-
return ['G3', 'G0', 'G4', 'G5'];
|
|
130
|
-
return ['G3', 'G0', 'G4', 'G5', 'G6', 'G7'];
|
|
137
|
+
return preflightGateStages(profile);
|
|
131
138
|
}
|
|
132
139
|
function shouldSkipPreflightCommandTargets(resolved, args) {
|
|
133
140
|
if (!resolved.matrix)
|
|
@@ -166,11 +173,13 @@ function evaluateEngineeringStandardsGate(options) {
|
|
|
166
173
|
scaleDir: options.scaleDir ?? SCALE_DIR,
|
|
167
174
|
taskId: options.taskId,
|
|
168
175
|
artifactsDir: options.artifactsDir,
|
|
176
|
+
changedFiles: options.changedFiles,
|
|
169
177
|
})
|
|
170
178
|
: undefined;
|
|
171
179
|
const doctor = settlement?.doctor ?? doctorEngineeringStandards({
|
|
172
180
|
projectDir: options.projectDir ?? PROJECT_DIR,
|
|
173
181
|
scaleDir: options.scaleDir ?? SCALE_DIR,
|
|
182
|
+
changedFiles: options.changedFiles,
|
|
174
183
|
});
|
|
175
184
|
return {
|
|
176
185
|
mode,
|
|
@@ -180,6 +189,7 @@ function evaluateEngineeringStandardsGate(options) {
|
|
|
180
189
|
findings: doctor.findings,
|
|
181
190
|
summary: doctor.scan.summary,
|
|
182
191
|
standardsImpactPath: settlement?.standardsImpactPath,
|
|
192
|
+
changedFiles: options.changedFiles,
|
|
183
193
|
};
|
|
184
194
|
}
|
|
185
195
|
function skippedEngineeringStandardsGate(reason, policy) {
|
|
@@ -220,7 +230,7 @@ function createEngine() {
|
|
|
220
230
|
gateway.registerDetector(new ScopeCreepDetector(), 'preTool');
|
|
221
231
|
gateway.registerDetector(new PrematureDoneDetector(), 'beforeStop');
|
|
222
232
|
gateway.registerDetector(new BlameShiftDetector(), 'postTool');
|
|
223
|
-
const kb = new
|
|
233
|
+
const kb = new GraphifyKnowledgeBase(eventBus, { projectDir: PROJECT_DIR, scaleDir: SCALE_DIR });
|
|
224
234
|
const ctx = new ContextBuilder(store, kb, eventBus);
|
|
225
235
|
const fsmAgentBridge = new FSMAgentBridge(fsm, store);
|
|
226
236
|
const capabilityRegistry = new CapabilityRegistry(eventBus);
|
|
@@ -1197,8 +1207,18 @@ const codegraphStatus = defineCommand({
|
|
|
1197
1207
|
}
|
|
1198
1208
|
console.log('SCALE Code Intelligence Status');
|
|
1199
1209
|
console.log(` Config: ${report.configPath} (${report.configExists ? 'found' : 'default'})`);
|
|
1210
|
+
console.log(` Project index: ${report.projectIndexExists ? report.projectIndexPath : `${report.projectIndexPath} (not initialized)`}`);
|
|
1200
1211
|
for (const provider of report.providers) {
|
|
1201
1212
|
console.log(` [${provider.available ? 'AVAILABLE' : 'UNAVAILABLE'}] ${provider.id} (${provider.type}): ${provider.reason}`);
|
|
1213
|
+
if (provider.source)
|
|
1214
|
+
console.log(` source: ${provider.source}`);
|
|
1215
|
+
if (!provider.available && provider.installHint)
|
|
1216
|
+
console.log(` install: ${provider.installHint}`);
|
|
1217
|
+
if (provider.available && provider.projectInitHint && provider.id === 'codegraph' && !report.projectIndexExists) {
|
|
1218
|
+
console.log(` init: ${provider.projectInitHint}`);
|
|
1219
|
+
}
|
|
1220
|
+
if (provider.serveCommand)
|
|
1221
|
+
console.log(` mcp: ${provider.serveCommand}`);
|
|
1202
1222
|
}
|
|
1203
1223
|
console.log(` Fallback: ${report.fallback.available ? 'available' : 'disabled'} (${report.fallback.tools.join(', ')})`);
|
|
1204
1224
|
for (const recommendation of report.recommendations)
|
|
@@ -2304,12 +2324,14 @@ const preflight = defineCommand({
|
|
|
2304
2324
|
resolved.warnings.push('No verification services or profile commands configured; command gates skipped for this governance-only project.');
|
|
2305
2325
|
}
|
|
2306
2326
|
const workspaceSafety = inspectWorkspaceSafety(projectDir);
|
|
2327
|
+
const engineeringStandardsChangedFiles = readGitChangedFilesForStandards(projectDir);
|
|
2307
2328
|
const engineeringStandards = workspaceSafety.blocked
|
|
2308
2329
|
? skippedEngineeringStandardsGate('Workspace has unresolved git conflicts; resolve them before standards scanning.', resolved.policy)
|
|
2309
2330
|
: evaluateEngineeringStandardsGate({
|
|
2310
2331
|
policy: resolved.policy,
|
|
2311
2332
|
projectDir,
|
|
2312
2333
|
scaleDir,
|
|
2334
|
+
changedFiles: engineeringStandardsChangedFiles,
|
|
2313
2335
|
});
|
|
2314
2336
|
const targetResults = [];
|
|
2315
2337
|
if (!args.json) {
|
|
@@ -2325,6 +2347,9 @@ const preflight = defineCommand({
|
|
|
2325
2347
|
if (engineeringStandards.checked) {
|
|
2326
2348
|
const status = engineeringStandards.blocked ? 'BLOCKED' : engineeringStandards.ok ? 'OK' : 'WARN';
|
|
2327
2349
|
console.log(` Engineering standards: ${status} (${engineeringStandards.mode})`);
|
|
2350
|
+
if (engineeringStandards.changedFiles) {
|
|
2351
|
+
console.log(` Engineering standards scope: changed files (${engineeringStandards.changedFiles.length})`);
|
|
2352
|
+
}
|
|
2328
2353
|
}
|
|
2329
2354
|
else {
|
|
2330
2355
|
console.log(' Engineering standards: skipped');
|
|
@@ -2528,7 +2553,7 @@ const status = defineCommand({
|
|
|
2528
2553
|
// init command
|
|
2529
2554
|
// ============================================================================
|
|
2530
2555
|
const init = defineCommand({
|
|
2531
|
-
meta: { name: 'init', description: 'Initialize SCALE Engine in current project (one-click install)' },
|
|
2556
|
+
meta: { name: 'init', description: 'Initialize SCALE Engine governance in current project (one-click bootstrap, not third-party auto-install)' },
|
|
2532
2557
|
args: {
|
|
2533
2558
|
agent: { type: 'string', default: '', description: `Agent type (${SUPPORTED_AGENTS.join('/')}) - auto-detected if not specified` },
|
|
2534
2559
|
dir: { type: 'string', default: '.', description: 'Project directory' },
|
|
@@ -2626,16 +2651,22 @@ const init = defineCommand({
|
|
|
2626
2651
|
console.log(` Scenario: ${scenarioMode}`);
|
|
2627
2652
|
console.log(` Profile: ${profileId}`);
|
|
2628
2653
|
console.log(`\n📋 Next steps:`);
|
|
2629
|
-
for (const step of governanceNextSteps(
|
|
2654
|
+
for (const step of governanceNextSteps({
|
|
2655
|
+
profileId,
|
|
2656
|
+
governancePack: String(args['governance-pack']),
|
|
2657
|
+
}))
|
|
2630
2658
|
console.log(` → ${step}`);
|
|
2631
2659
|
return;
|
|
2632
2660
|
}
|
|
2633
2661
|
// One-click quick start mode
|
|
2634
2662
|
if (!args.agent) {
|
|
2635
|
-
const
|
|
2663
|
+
const profileId = args.profile || profileFromScenario(args.scenario);
|
|
2664
|
+
const qsResult = await quickStart(args.dir, {
|
|
2665
|
+
governancePack: args['governance-pack'],
|
|
2666
|
+
profileId,
|
|
2667
|
+
});
|
|
2636
2668
|
// Generate config.yaml from profile
|
|
2637
2669
|
if (qsResult.success) {
|
|
2638
|
-
const profileId = args.profile || profileFromScenario(args.scenario);
|
|
2639
2670
|
const projectName = args.dir.split(/[/\\]/).pop() || 'Project';
|
|
2640
2671
|
const detectedAgent = qsResult.platform ? [qsResult.platform] : [];
|
|
2641
2672
|
const configPath = writeConfigYaml(args.dir, profileId, projectName, detectedAgent);
|
|
@@ -2650,8 +2681,10 @@ const init = defineCommand({
|
|
|
2650
2681
|
created: qsResult.created,
|
|
2651
2682
|
skipped: qsResult.skipped,
|
|
2652
2683
|
constraintsApplied: qsResult.constraintsApplied,
|
|
2684
|
+
workflowCapabilities: qsResult.workflowCapabilities,
|
|
2653
2685
|
capabilitiesEnabled: qsResult.capabilitiesEnabled,
|
|
2654
2686
|
knowledgeGraph: qsResult.knowledgeGraph,
|
|
2687
|
+
dependencyBootstrapCommand: qsResult.dependencyBootstrapCommand,
|
|
2655
2688
|
nextSteps: qsResult.nextSteps,
|
|
2656
2689
|
suggestions: detection?.suggestions ?? [],
|
|
2657
2690
|
}, null, 2));
|
|
@@ -2671,7 +2704,8 @@ const init = defineCommand({
|
|
|
2671
2704
|
console.log(` - ${f}`);
|
|
2672
2705
|
}
|
|
2673
2706
|
console.log(`\n🔒 Physical constraints applied: ${qsResult.constraintsApplied}`);
|
|
2674
|
-
console.log(`\n
|
|
2707
|
+
console.log(`\n🧭 Workflow capability plan: ${qsResult.workflowCapabilities.join(', ')}`);
|
|
2708
|
+
console.log(`\n🧰 Dependency bootstrap: ${qsResult.dependencyBootstrapCommand}`);
|
|
2675
2709
|
console.log(`\n📋 Next steps:`);
|
|
2676
2710
|
for (const step of qsResult.nextSteps)
|
|
2677
2711
|
console.log(` → ${step}`);
|
|
@@ -2713,7 +2747,10 @@ const init = defineCommand({
|
|
|
2713
2747
|
scaleDir: result.scaleDir,
|
|
2714
2748
|
created: result.created,
|
|
2715
2749
|
skipped: result.skipped,
|
|
2716
|
-
nextSteps: governanceNextSteps(
|
|
2750
|
+
nextSteps: governanceNextSteps({
|
|
2751
|
+
profileId,
|
|
2752
|
+
governancePack: String(args['governance-pack']),
|
|
2753
|
+
}),
|
|
2717
2754
|
}, null, 2));
|
|
2718
2755
|
return;
|
|
2719
2756
|
}
|
|
@@ -2731,17 +2768,130 @@ const init = defineCommand({
|
|
|
2731
2768
|
console.log(`\n📄 Config: ${configPath}`);
|
|
2732
2769
|
console.log(`\n📂 Data dir: ${result.scaleDir}`);
|
|
2733
2770
|
console.log(`\n📋 Next steps:`);
|
|
2734
|
-
for (const step of governanceNextSteps(
|
|
2771
|
+
for (const step of governanceNextSteps({
|
|
2772
|
+
profileId,
|
|
2773
|
+
governancePack: String(args['governance-pack']),
|
|
2774
|
+
}))
|
|
2735
2775
|
console.log(` → ${step}`);
|
|
2736
2776
|
},
|
|
2737
2777
|
});
|
|
2778
|
+
const bootstrapDepsCommand = defineCommand({
|
|
2779
|
+
meta: { name: 'deps', description: 'Plan or install third-party skills, CLI dependencies, and project post-configuration' },
|
|
2780
|
+
args: {
|
|
2781
|
+
dir: { type: 'string', default: PROJECT_DIR, description: 'Project directory' },
|
|
2782
|
+
pack: { type: 'string', default: '', description: 'Comma-separated packs: ui,memory,knowledge,external-cli,full. Defaults to full unless --profile is supplied.' },
|
|
2783
|
+
profile: { type: 'string', description: 'Resolve recommended packs from profile: minimal, standard, advanced' },
|
|
2784
|
+
'governance-pack': { type: 'string', description: 'Optional governance pack hint, for example frontend-app -> ui' },
|
|
2785
|
+
include: { type: 'string', description: 'Additional dependency ids to include explicitly' },
|
|
2786
|
+
apply: { type: 'boolean', default: false, description: 'Run install commands for ready dependencies' },
|
|
2787
|
+
lang: { type: 'string', description: 'Output language zh/en. Defaults to zh, then SCALE_LANG, then .scale/config.yaml locale.' },
|
|
2788
|
+
json: { type: 'boolean', default: false, description: 'Output bootstrap plan as JSON' },
|
|
2789
|
+
},
|
|
2790
|
+
async run({ args }) {
|
|
2791
|
+
const projectDir = resolve(String(args.dir ?? PROJECT_DIR));
|
|
2792
|
+
const lang = resolveCliLanguage({ lang: args.lang, projectDir, scaleDir: SCALE_DIR });
|
|
2793
|
+
const explicitPacks = parseCommaList(args.pack);
|
|
2794
|
+
const recommendedPacks = args.profile
|
|
2795
|
+
? getBootstrapPlanForProfile(String(args.profile), args['governance-pack'] ? String(args['governance-pack']) : undefined).packs
|
|
2796
|
+
: [];
|
|
2797
|
+
const report = await bootstrapDependencies({
|
|
2798
|
+
projectDir,
|
|
2799
|
+
scaleDir: SCALE_DIR,
|
|
2800
|
+
packIds: explicitPacks.length > 0 ? uniqueStrings([...recommendedPacks, ...explicitPacks]) : recommendedPacks,
|
|
2801
|
+
includeIds: parseCommaList(args.include),
|
|
2802
|
+
apply: isTruthyFlag(args.apply),
|
|
2803
|
+
});
|
|
2804
|
+
if (args.json) {
|
|
2805
|
+
console.log(JSON.stringify(report, null, 2));
|
|
2806
|
+
if (isTruthyFlag(args.apply) && !report.ok)
|
|
2807
|
+
process.exitCode = 1;
|
|
2808
|
+
return;
|
|
2809
|
+
}
|
|
2810
|
+
console.log(renderDependencyBootstrapReport(report, lang));
|
|
2811
|
+
if (report.apply && !report.ok)
|
|
2812
|
+
process.exitCode = 1;
|
|
2813
|
+
},
|
|
2814
|
+
});
|
|
2815
|
+
const bootstrap = defineCommand({
|
|
2816
|
+
meta: { name: 'bootstrap', description: 'Bootstrap third-party workflow dependencies with explicit install intent' },
|
|
2817
|
+
subCommands: { deps: bootstrapDepsCommand },
|
|
2818
|
+
});
|
|
2738
2819
|
// ============================================================================
|
|
2820
|
+
const setup = defineCommand({
|
|
2821
|
+
meta: { name: 'setup', description: 'Interactive SCALE setup for third-party skills, CLIs, memory, and knowledge providers' },
|
|
2822
|
+
args: {
|
|
2823
|
+
dir: { type: 'string', default: PROJECT_DIR, description: 'Project directory' },
|
|
2824
|
+
pack: { type: 'string', default: '', description: 'Comma-separated packs: ui,memory,knowledge,external-cli,full. Defaults to full unless --profile is supplied.' },
|
|
2825
|
+
profile: { type: 'string', description: 'Resolve recommended packs from profile: minimal, standard, advanced' },
|
|
2826
|
+
'governance-pack': { type: 'string', description: 'Optional governance pack hint, for example frontend-app -> ui' },
|
|
2827
|
+
include: { type: 'string', description: 'Additional dependency ids to include explicitly' },
|
|
2828
|
+
apply: { type: 'boolean', default: false, description: 'Run install commands for ready dependencies' },
|
|
2829
|
+
yes: { type: 'boolean', default: false, description: 'Confirm installation without prompting' },
|
|
2830
|
+
interactive: { type: 'boolean', default: true, description: 'Prompt before installation when dependencies are ready' },
|
|
2831
|
+
lang: { type: 'string', description: 'Output language zh/en. Defaults to zh, then SCALE_LANG, then .scale/config.yaml locale.' },
|
|
2832
|
+
'memory-provider': { type: 'string', description: 'Switch memory provider during setup: gbrain, agentmemory, or scale-local' },
|
|
2833
|
+
'memory-mode': { type: 'string', description: 'Memory routing mode: auto, local-only, external-first' },
|
|
2834
|
+
'memory-endpoint': { type: 'string', description: 'Optional endpoint to persist for the selected memory provider' },
|
|
2835
|
+
'memory-write-mode': { type: 'string', description: 'Memory write mode: disabled, candidate-only, enabled' },
|
|
2836
|
+
'allow-external-write': { type: 'boolean', default: false, description: 'Explicitly allow external memory writes in provider routing' },
|
|
2837
|
+
json: { type: 'boolean', default: false, description: 'Output setup report as JSON' },
|
|
2838
|
+
},
|
|
2839
|
+
async run({ args }) {
|
|
2840
|
+
const projectDir = resolve(String(args.dir ?? PROJECT_DIR));
|
|
2841
|
+
const lang = resolveCliLanguage({ lang: args.lang, projectDir, scaleDir: SCALE_DIR });
|
|
2842
|
+
const explicitPacks = parseCommaList(args.pack);
|
|
2843
|
+
const recommendedPacks = args.profile
|
|
2844
|
+
? getBootstrapPlanForProfile(String(args.profile), args['governance-pack'] ? String(args['governance-pack']) : undefined).packs
|
|
2845
|
+
: [];
|
|
2846
|
+
const report = await runSetupWizard({
|
|
2847
|
+
projectDir,
|
|
2848
|
+
scaleDir: SCALE_DIR,
|
|
2849
|
+
packIds: explicitPacks.length > 0 ? uniqueStrings([...recommendedPacks, ...explicitPacks]) : recommendedPacks,
|
|
2850
|
+
includeIds: parseCommaList(args.include),
|
|
2851
|
+
apply: isTruthyFlag(args.apply),
|
|
2852
|
+
yes: isTruthyFlag(args.yes),
|
|
2853
|
+
interactive: isTruthyFlag(args.interactive) && !isTruthyFlag(args.json),
|
|
2854
|
+
lang,
|
|
2855
|
+
memoryProvider: args['memory-provider'] ? String(args['memory-provider']) : undefined,
|
|
2856
|
+
memoryMode: normalizeMemoryModeArg(args['memory-mode']),
|
|
2857
|
+
memoryEndpoint: args['memory-endpoint'] ? String(args['memory-endpoint']) : undefined,
|
|
2858
|
+
memoryWriteMode: normalizeMemoryWriteModeArg(args['memory-write-mode']),
|
|
2859
|
+
allowExternalWrite: isTruthyFlag(args['allow-external-write']) ? true : undefined,
|
|
2860
|
+
promptLanguage: isTruthyFlag(args.interactive) && !args.lang,
|
|
2861
|
+
});
|
|
2862
|
+
if (args.json) {
|
|
2863
|
+
console.log(JSON.stringify(report, null, 2));
|
|
2864
|
+
if (!report.ok)
|
|
2865
|
+
process.exitCode = 1;
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
console.log(lang === 'zh' ? '\nSCALE 交互式安装' : '\nSCALE Interactive Setup');
|
|
2869
|
+
console.log(lang === 'zh'
|
|
2870
|
+
? ` 已执行安装: ${report.applied ? '是' : '否'}`
|
|
2871
|
+
: ` Applied: ${report.applied}`);
|
|
2872
|
+
if (report.memoryProviderSwitch) {
|
|
2873
|
+
const switched = report.memoryProviderSwitch;
|
|
2874
|
+
console.log(lang === 'zh' ? ' 记忆供应商:' : ' Memory provider:');
|
|
2875
|
+
console.log(` provider=${switched.provider}; mode=${switched.mode}; config=${switched.path}`);
|
|
2876
|
+
console.log(` order=${switched.previousOrder.join(' -> ')} => ${switched.nextOrder.join(' -> ')}`);
|
|
2877
|
+
if (switched.providerStatus) {
|
|
2878
|
+
console.log(` status=${switched.providerStatus.available ? 'available' : 'not-ready'}; reason=${switched.providerStatus.reason}`);
|
|
2879
|
+
}
|
|
2880
|
+
for (const warning of switched.warnings)
|
|
2881
|
+
console.log(lang === 'zh' ? ` [警告] ${warning}` : ` [WARN] ${warning}`);
|
|
2882
|
+
}
|
|
2883
|
+
console.log(renderDependencyBootstrapReport(report.final, lang));
|
|
2884
|
+
if (!report.ok)
|
|
2885
|
+
process.exitCode = 1;
|
|
2886
|
+
},
|
|
2887
|
+
});
|
|
2739
2888
|
// config command — Configuration profile management
|
|
2740
2889
|
// ============================================================================
|
|
2741
2890
|
const configProfile = defineCommand({
|
|
2742
2891
|
meta: { name: 'profile', description: 'View or switch configuration profile' },
|
|
2743
2892
|
args: {
|
|
2744
2893
|
set: { type: 'string', default: '', description: 'Switch to profile (minimal/standard/advanced)' },
|
|
2894
|
+
'governance-pack': { type: 'string', description: 'Optional governance pack hint for bootstrap suggestions, for example frontend-app' },
|
|
2745
2895
|
list: { type: 'boolean', default: false, description: 'List all available profiles' },
|
|
2746
2896
|
json: { type: 'boolean', default: false, description: 'Output as JSON' },
|
|
2747
2897
|
},
|
|
@@ -2765,12 +2915,27 @@ const configProfile = defineCommand({
|
|
|
2765
2915
|
console.log(`\n⚠️ Profile "${args.set}" not found. Available: minimal, standard, advanced`);
|
|
2766
2916
|
return;
|
|
2767
2917
|
}
|
|
2918
|
+
const bootstrapPlan = getBootstrapPlanForProfile(profile.id, args['governance-pack'] ? String(args['governance-pack']) : undefined);
|
|
2768
2919
|
// Update config.yaml
|
|
2769
2920
|
const configPath = join('.scale', 'config.yaml');
|
|
2770
2921
|
const projectName = process.cwd().split(/[/\\]/).pop() || 'Project';
|
|
2771
2922
|
const content = generateConfigForProfile(args.set, { name: projectName });
|
|
2772
2923
|
ensureDir('.scale');
|
|
2773
2924
|
writeFileSync(configPath, content, 'utf-8');
|
|
2925
|
+
if (args.json) {
|
|
2926
|
+
console.log(JSON.stringify({
|
|
2927
|
+
ok: true,
|
|
2928
|
+
profile: profile.id,
|
|
2929
|
+
name: profile.name,
|
|
2930
|
+
description: profile.description,
|
|
2931
|
+
sections: profile.sections,
|
|
2932
|
+
bootstrapPacks: bootstrapPlan.packs,
|
|
2933
|
+
dependencyBootstrapCommand: bootstrapPlan.inspectCommand,
|
|
2934
|
+
dependencyBootstrapApplyCommand: bootstrapPlan.applyCommand,
|
|
2935
|
+
configPath,
|
|
2936
|
+
}, null, 2));
|
|
2937
|
+
return;
|
|
2938
|
+
}
|
|
2774
2939
|
console.log(`\n✅ Profile switched to: ${profile.name}`);
|
|
2775
2940
|
console.log(` ${profile.description}`);
|
|
2776
2941
|
console.log(`\n📄 Config updated: ${configPath}`);
|
|
@@ -2786,13 +2951,24 @@ const configProfile = defineCommand({
|
|
|
2786
2951
|
const match = content.match(/^profile:\s*(.+)$/m);
|
|
2787
2952
|
const currentProfile = match?.[1]?.trim() || 'standard';
|
|
2788
2953
|
const profile = getConfigProfile(currentProfile);
|
|
2954
|
+
const bootstrapPlan = getBootstrapPlanForProfile(profile.id, args['governance-pack'] ? String(args['governance-pack']) : undefined);
|
|
2789
2955
|
if (args.json) {
|
|
2790
|
-
console.log(JSON.stringify({
|
|
2956
|
+
console.log(JSON.stringify({
|
|
2957
|
+
profile: profile.id,
|
|
2958
|
+
name: profile.name,
|
|
2959
|
+
description: profile.description,
|
|
2960
|
+
sections: profile.sections,
|
|
2961
|
+
bootstrapPacks: bootstrapPlan.packs,
|
|
2962
|
+
dependencyBootstrapCommand: bootstrapPlan.inspectCommand,
|
|
2963
|
+
dependencyBootstrapApplyCommand: bootstrapPlan.applyCommand,
|
|
2964
|
+
}, null, 2));
|
|
2791
2965
|
return;
|
|
2792
2966
|
}
|
|
2793
2967
|
console.log(`\nCurrent profile: ${profile.name} (${profile.id})`);
|
|
2794
2968
|
console.log(` ${profile.description}`);
|
|
2795
2969
|
console.log(`\nSections: ${profile.sections.join(', ')}`);
|
|
2970
|
+
console.log(`Bootstrap packs: ${bootstrapPlan.packs.join(', ')}`);
|
|
2971
|
+
console.log(`Dependency bootstrap: ${bootstrapPlan.inspectCommand}`);
|
|
2796
2972
|
console.log(`\nUse: scale config profile --set <id> to switch`);
|
|
2797
2973
|
},
|
|
2798
2974
|
});
|
|
@@ -3654,9 +3830,24 @@ function readGitChangedFiles(projectDir) {
|
|
|
3654
3830
|
const untracked = readGitPathList(projectDir, ['ls-files', '--others', '--exclude-standard']);
|
|
3655
3831
|
return Array.from(new Set([...tracked, ...untracked]));
|
|
3656
3832
|
}
|
|
3833
|
+
function readGitChangedFilesForStandards(projectDir) {
|
|
3834
|
+
try {
|
|
3835
|
+
execFileSync('git', ['-C', projectDir, 'rev-parse', '--is-inside-work-tree'], {
|
|
3836
|
+
encoding: 'utf-8',
|
|
3837
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
3838
|
+
});
|
|
3839
|
+
}
|
|
3840
|
+
catch {
|
|
3841
|
+
return undefined;
|
|
3842
|
+
}
|
|
3843
|
+
return readGitChangedFiles(projectDir);
|
|
3844
|
+
}
|
|
3657
3845
|
function readGitPathList(projectDir, args) {
|
|
3658
3846
|
try {
|
|
3659
|
-
return execFileSync('git', ['-C', projectDir, ...args], {
|
|
3847
|
+
return execFileSync('git', ['-C', projectDir, ...args], {
|
|
3848
|
+
encoding: 'utf-8',
|
|
3849
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
3850
|
+
})
|
|
3660
3851
|
.split(/\r?\n/)
|
|
3661
3852
|
.map(item => item.trim())
|
|
3662
3853
|
.filter(Boolean);
|
|
@@ -3987,8 +4178,19 @@ function normalizeThemeArg(value) {
|
|
|
3987
4178
|
return 'auto';
|
|
3988
4179
|
}
|
|
3989
4180
|
function normalizeLangArg(value) {
|
|
3990
|
-
|
|
3991
|
-
|
|
4181
|
+
return normalizeLanguage(value ?? process.env.SCALE_LANG);
|
|
4182
|
+
}
|
|
4183
|
+
function normalizeMemoryModeArg(value) {
|
|
4184
|
+
const normalized = String(value ?? '').trim().toLowerCase();
|
|
4185
|
+
if (normalized === 'auto' || normalized === 'local-only' || normalized === 'external-first')
|
|
4186
|
+
return normalized;
|
|
4187
|
+
return undefined;
|
|
4188
|
+
}
|
|
4189
|
+
function normalizeMemoryWriteModeArg(value) {
|
|
4190
|
+
const normalized = String(value ?? '').trim().toLowerCase();
|
|
4191
|
+
if (normalized === 'disabled' || normalized === 'candidate-only' || normalized === 'enabled')
|
|
4192
|
+
return normalized;
|
|
4193
|
+
return undefined;
|
|
3992
4194
|
}
|
|
3993
4195
|
function launchLocalFile(path) {
|
|
3994
4196
|
try {
|
|
@@ -4025,13 +4227,34 @@ const evolve = defineCommand({
|
|
|
4025
4227
|
// ============================================================================
|
|
4026
4228
|
// doctor command
|
|
4027
4229
|
// ============================================================================
|
|
4230
|
+
function runEnvironmentDoctor(json) {
|
|
4231
|
+
const report = inspectEnvironment();
|
|
4232
|
+
if (json) {
|
|
4233
|
+
console.log(JSON.stringify(report, null, 2));
|
|
4234
|
+
}
|
|
4235
|
+
else {
|
|
4236
|
+
console.log(renderEnvironmentDoctor(report));
|
|
4237
|
+
}
|
|
4238
|
+
process.exitCode = report.ok ? 0 : 1;
|
|
4239
|
+
}
|
|
4028
4240
|
const doctor = defineCommand({
|
|
4029
4241
|
meta: { name: 'doctor', description: 'Diagnose SCALE Engine health' },
|
|
4030
4242
|
args: {
|
|
4243
|
+
scope: { type: 'positional', required: false, description: 'Optional diagnostic scope: env' },
|
|
4031
4244
|
dir: { type: 'string', default: '.', description: 'Project directory' },
|
|
4032
4245
|
json: { type: 'boolean', default: false, description: 'Output as JSON' },
|
|
4033
4246
|
},
|
|
4034
4247
|
async run({ args }) {
|
|
4248
|
+
const scope = String(args.scope ?? '').trim().toLowerCase();
|
|
4249
|
+
if (scope === 'env' || scope === 'environment') {
|
|
4250
|
+
runEnvironmentDoctor(args.json);
|
|
4251
|
+
return;
|
|
4252
|
+
}
|
|
4253
|
+
if (scope) {
|
|
4254
|
+
console.error(`Unknown doctor scope: ${scope}. Supported scope: env.`);
|
|
4255
|
+
process.exitCode = 1;
|
|
4256
|
+
return;
|
|
4257
|
+
}
|
|
4035
4258
|
const doc = new Doctor(args.dir);
|
|
4036
4259
|
const report = await doc.diagnose();
|
|
4037
4260
|
if (args.json) {
|
|
@@ -4924,12 +5147,57 @@ const memoryProviderRecall = defineCommand({
|
|
|
4924
5147
|
console.log(` [WARN] ${warning}`);
|
|
4925
5148
|
},
|
|
4926
5149
|
});
|
|
5150
|
+
const memoryProviderUse = defineCommand({
|
|
5151
|
+
meta: { name: 'use', description: 'Promote one memory provider to the front of routing and persist the selection' },
|
|
5152
|
+
args: {
|
|
5153
|
+
provider: { type: 'positional', required: true, description: 'Provider id: gbrain, agentmemory, or scale-local' },
|
|
5154
|
+
mode: { type: 'string', description: 'Optional routing mode override: auto, local-only, external-first' },
|
|
5155
|
+
endpoint: { type: 'string', description: 'Optional provider endpoint to persist while switching' },
|
|
5156
|
+
'write-mode': { type: 'string', description: 'Optional provider write mode: disabled, candidate-only, enabled' },
|
|
5157
|
+
'allow-external-write': { type: 'boolean', default: false, description: 'Persist external write allowance when explicitly switching' },
|
|
5158
|
+
json: { type: 'boolean', default: false },
|
|
5159
|
+
},
|
|
5160
|
+
run({ args }) {
|
|
5161
|
+
const mode = args.mode ? String(args.mode) : undefined;
|
|
5162
|
+
const writeMode = args['write-mode']
|
|
5163
|
+
? String(args['write-mode'])
|
|
5164
|
+
: undefined;
|
|
5165
|
+
const report = useMemoryProvider({
|
|
5166
|
+
projectDir: PROJECT_DIR,
|
|
5167
|
+
scaleDir: SCALE_DIR,
|
|
5168
|
+
provider: String(args.provider),
|
|
5169
|
+
mode: mode,
|
|
5170
|
+
endpoint: args.endpoint ? String(args.endpoint) : undefined,
|
|
5171
|
+
writeMode,
|
|
5172
|
+
allowExternalWrite: isTruthyFlag(args['allow-external-write']) ? true : undefined,
|
|
5173
|
+
});
|
|
5174
|
+
if (args.json) {
|
|
5175
|
+
console.log(JSON.stringify(report, null, 2));
|
|
5176
|
+
if (!report.ok)
|
|
5177
|
+
process.exitCode = 1;
|
|
5178
|
+
return;
|
|
5179
|
+
}
|
|
5180
|
+
console.log('\nSCALE Memory Provider Switch');
|
|
5181
|
+
console.log(` Provider: ${report.provider}`);
|
|
5182
|
+
console.log(` Mode: ${report.mode}`);
|
|
5183
|
+
console.log(` Config: ${report.path}`);
|
|
5184
|
+
console.log(` Order: ${report.previousOrder.join(' -> ')} -> ${report.nextOrder.join(' -> ')}`);
|
|
5185
|
+
if (report.providerStatus) {
|
|
5186
|
+
console.log(` Status: ${report.providerStatus.available ? 'available' : 'not-ready'} (${report.providerStatus.reason})`);
|
|
5187
|
+
}
|
|
5188
|
+
for (const warning of report.warnings)
|
|
5189
|
+
console.log(` [WARN] ${warning}`);
|
|
5190
|
+
if (!report.ok)
|
|
5191
|
+
process.exitCode = 1;
|
|
5192
|
+
},
|
|
5193
|
+
});
|
|
4927
5194
|
const memoryProvider = defineCommand({
|
|
4928
5195
|
meta: { name: 'provider', description: 'Manage autonomous memory provider routing for agentmemory, gbrain, and scale-local' },
|
|
4929
5196
|
subCommands: {
|
|
4930
5197
|
init: memoryProviderInit,
|
|
4931
5198
|
status: memoryProviderStatus,
|
|
4932
5199
|
recall: memoryProviderRecall,
|
|
5200
|
+
use: memoryProviderUse,
|
|
4933
5201
|
},
|
|
4934
5202
|
});
|
|
4935
5203
|
const memory = defineCommand({
|
|
@@ -5524,6 +5792,8 @@ const toolDoctorCommand = defineCommand({
|
|
|
5524
5792
|
console.log(` version: ${entry.version}`);
|
|
5525
5793
|
if (entry.missingReason)
|
|
5526
5794
|
console.log(` reason: ${entry.missingReason}`);
|
|
5795
|
+
if (!entry.installed && entry.installHint)
|
|
5796
|
+
console.log(` install: ${entry.installHint}`);
|
|
5527
5797
|
}
|
|
5528
5798
|
}
|
|
5529
5799
|
if (!report.ok)
|
|
@@ -5848,9 +6118,12 @@ const main = defineCommand({
|
|
|
5848
6118
|
run: runCommand,
|
|
5849
6119
|
// Original commands (preserved)
|
|
5850
6120
|
init,
|
|
6121
|
+
setup,
|
|
6122
|
+
bootstrap,
|
|
5851
6123
|
doctor,
|
|
5852
6124
|
session,
|
|
5853
6125
|
gate,
|
|
6126
|
+
gates: gatesCommand,
|
|
5854
6127
|
'meta-governance': metaGovernance,
|
|
5855
6128
|
create,
|
|
5856
6129
|
list,
|
|
@@ -5865,6 +6138,8 @@ const main = defineCommand({
|
|
|
5865
6138
|
preflight,
|
|
5866
6139
|
upgrade,
|
|
5867
6140
|
governance,
|
|
6141
|
+
prompt: promptCommand,
|
|
6142
|
+
score: scoreCommand,
|
|
5868
6143
|
'ai-os': aiOs,
|
|
5869
6144
|
codegraph,
|
|
5870
6145
|
eval: evalCommand,
|