substrate-ai 0.1.33 → 0.2.1
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.md +33 -63
- package/dist/cli/index.js +4586 -18398
- package/dist/cli/templates/claude-md-substrate-section.md +3 -3
- package/dist/decisions-BBLMsN_c.js +336 -0
- package/dist/decisions-WIsicZiG.js +3 -0
- package/dist/errors-BPqtzQ4U.js +111 -0
- package/dist/event-bus-J-bw-pkp.js +1549 -0
- package/dist/experimenter-BSu2ie3J.js +484 -0
- package/dist/git-utils-BtI5eNoN.js +365 -0
- package/dist/index.d.ts +89 -137
- package/dist/index.js +5 -305
- package/dist/logger-C6n1g8uP.js +119 -0
- package/dist/metrics-BSg8VIHd.js +184 -0
- package/dist/run-CRmhkcwN.js +7 -0
- package/dist/run-DlOWhkIF.js +10725 -0
- package/dist/{upgrade-CS2i2Qy5.js → upgrade-BjYVeC6G.js} +2 -3
- package/dist/{upgrade-CIAel_WS.js → upgrade-rV26kdh3.js} +2 -2
- package/dist/version-manager-impl-9N_519Ey.js +3 -0
- package/dist/{version-manager-impl-CcCP8PzG.js → version-manager-impl-BpVx2DkY.js} +101 -3
- package/package.json +1 -1
- package/packs/bmad/prompts/ux-step-3-journeys.md +3 -3
- package/dist/app-CY3MaJtP.js +0 -6342
- package/dist/cli/templates/parallel.yaml +0 -72
- package/dist/cli/templates/research-then-implement.yaml +0 -103
- package/dist/cli/templates/review-cycle.yaml +0 -91
- package/dist/cli/templates/sequential.yaml +0 -68
- package/dist/config-schema-C9tTMcm1.js +0 -102
- package/dist/version-manager-impl-LhLAyrCL.js +0 -4
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CIAel_WS.js";
|
|
1
|
+
import "./version-manager-impl-BpVx2DkY.js";
|
|
2
|
+
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-rV26kdh3.js";
|
|
4
3
|
|
|
5
4
|
export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVersionManager } from "./version-manager-impl-
|
|
1
|
+
import { createVersionManager } from "./version-manager-impl-BpVx2DkY.js";
|
|
2
2
|
import { execSync, spawn } from "child_process";
|
|
3
3
|
import * as readline from "readline";
|
|
4
4
|
|
|
@@ -123,4 +123,4 @@ function registerUpgradeCommand(program) {
|
|
|
123
123
|
|
|
124
124
|
//#endregion
|
|
125
125
|
export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
|
|
126
|
-
//# sourceMappingURL=upgrade-
|
|
126
|
+
//# sourceMappingURL=upgrade-rV26kdh3.js.map
|
|
@@ -1,13 +1,111 @@
|
|
|
1
|
-
import { SUPPORTED_CONFIG_FORMAT_VERSIONS, SUPPORTED_TASK_GRAPH_VERSIONS } from "./config-schema-C9tTMcm1.js";
|
|
2
1
|
import { createRequire } from "module";
|
|
3
2
|
import { fileURLToPath } from "url";
|
|
4
3
|
import path, { dirname, resolve } from "path";
|
|
5
4
|
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
5
|
+
import { z } from "zod";
|
|
6
6
|
import os from "os";
|
|
7
7
|
import * as semver$1 from "semver";
|
|
8
8
|
import * as semver from "semver";
|
|
9
9
|
import https from "https";
|
|
10
10
|
|
|
11
|
+
//#region src/modules/config/config-schema.ts
|
|
12
|
+
/** Subscription routing modes */
|
|
13
|
+
const SubscriptionRoutingSchema = z.enum([
|
|
14
|
+
"auto",
|
|
15
|
+
"subscription",
|
|
16
|
+
"api",
|
|
17
|
+
"disabled"
|
|
18
|
+
]);
|
|
19
|
+
/** Rate limit configuration for a provider */
|
|
20
|
+
const RateLimitSchema = z.object({
|
|
21
|
+
tokens: z.number().int().positive(),
|
|
22
|
+
window_seconds: z.number().int().positive()
|
|
23
|
+
}).strict();
|
|
24
|
+
/** Per-provider configuration */
|
|
25
|
+
const ProviderConfigSchema = z.object({
|
|
26
|
+
enabled: z.boolean(),
|
|
27
|
+
cli_path: z.string().optional(),
|
|
28
|
+
subscription_routing: SubscriptionRoutingSchema,
|
|
29
|
+
max_concurrent: z.number().int().min(1).max(32),
|
|
30
|
+
rate_limit: RateLimitSchema.optional(),
|
|
31
|
+
api_key_env: z.string().optional(),
|
|
32
|
+
api_billing: z.boolean()
|
|
33
|
+
}).strict();
|
|
34
|
+
/** Map of all known providers */
|
|
35
|
+
const ProvidersSchema = z.object({
|
|
36
|
+
claude: ProviderConfigSchema.optional(),
|
|
37
|
+
codex: ProviderConfigSchema.optional(),
|
|
38
|
+
gemini: ProviderConfigSchema.optional()
|
|
39
|
+
}).strict();
|
|
40
|
+
const LogLevelSchema = z.enum([
|
|
41
|
+
"trace",
|
|
42
|
+
"debug",
|
|
43
|
+
"info",
|
|
44
|
+
"warn",
|
|
45
|
+
"error",
|
|
46
|
+
"fatal"
|
|
47
|
+
]);
|
|
48
|
+
const GlobalSettingsSchema = z.object({
|
|
49
|
+
log_level: LogLevelSchema,
|
|
50
|
+
max_concurrent_tasks: z.number().int().min(1).max(64),
|
|
51
|
+
budget_cap_tokens: z.number().int().min(0),
|
|
52
|
+
budget_cap_usd: z.number().min(0),
|
|
53
|
+
workspace_dir: z.string().optional(),
|
|
54
|
+
update_check: z.boolean().optional()
|
|
55
|
+
}).strict();
|
|
56
|
+
const CostTrackerConfigSchema = z.object({
|
|
57
|
+
enabled: z.boolean(),
|
|
58
|
+
token_rates_provider: z.enum(["builtin", "custom"]),
|
|
59
|
+
track_planning_costs: z.boolean(),
|
|
60
|
+
savings_reporting: z.boolean()
|
|
61
|
+
}).strict();
|
|
62
|
+
const BudgetConfigSchema = z.object({
|
|
63
|
+
default_task_budget_usd: z.number().min(0),
|
|
64
|
+
default_session_budget_usd: z.number().min(0),
|
|
65
|
+
planning_costs_count_against_budget: z.boolean(),
|
|
66
|
+
warning_threshold_percent: z.number().min(0).max(100)
|
|
67
|
+
}).strict();
|
|
68
|
+
const RoutingRuleSchema = z.object({
|
|
69
|
+
task_type: z.string(),
|
|
70
|
+
preferred_provider: z.string(),
|
|
71
|
+
fallback_providers: z.array(z.string())
|
|
72
|
+
}).strict();
|
|
73
|
+
const RoutingPolicySchema = z.object({
|
|
74
|
+
default_provider: z.string(),
|
|
75
|
+
rules: z.array(RoutingRuleSchema)
|
|
76
|
+
}).strict();
|
|
77
|
+
/** Current supported config format version */
|
|
78
|
+
const CURRENT_CONFIG_FORMAT_VERSION = "1";
|
|
79
|
+
/** Current supported task graph version */
|
|
80
|
+
const CURRENT_TASK_GRAPH_VERSION = "1";
|
|
81
|
+
/** All config format versions this toolkit can read and validate */
|
|
82
|
+
const SUPPORTED_CONFIG_FORMAT_VERSIONS = ["1"];
|
|
83
|
+
/** All task graph format versions this toolkit can read and validate */
|
|
84
|
+
const SUPPORTED_TASK_GRAPH_VERSIONS = ["1"];
|
|
85
|
+
const SubstrateConfigSchema = z.object({
|
|
86
|
+
config_format_version: z.enum(["1"]),
|
|
87
|
+
task_graph_version: z.enum(["1"]).optional(),
|
|
88
|
+
global: GlobalSettingsSchema,
|
|
89
|
+
providers: ProvidersSchema,
|
|
90
|
+
cost_tracker: CostTrackerConfigSchema.optional(),
|
|
91
|
+
budget: BudgetConfigSchema.optional()
|
|
92
|
+
}).strict();
|
|
93
|
+
const PartialProviderConfigSchema = ProviderConfigSchema.partial();
|
|
94
|
+
const PartialGlobalSettingsSchema = GlobalSettingsSchema.partial();
|
|
95
|
+
const PartialSubstrateConfigSchema = z.object({
|
|
96
|
+
config_format_version: z.enum(["1"]).optional(),
|
|
97
|
+
task_graph_version: z.enum(["1"]).optional(),
|
|
98
|
+
global: PartialGlobalSettingsSchema.optional(),
|
|
99
|
+
providers: z.object({
|
|
100
|
+
claude: PartialProviderConfigSchema.optional(),
|
|
101
|
+
codex: PartialProviderConfigSchema.optional(),
|
|
102
|
+
gemini: PartialProviderConfigSchema.optional()
|
|
103
|
+
}).partial().optional(),
|
|
104
|
+
cost_tracker: CostTrackerConfigSchema.partial().optional(),
|
|
105
|
+
budget: BudgetConfigSchema.partial().optional()
|
|
106
|
+
}).strict();
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
11
109
|
//#region src/modules/config/config-migrator.ts
|
|
12
110
|
/**
|
|
13
111
|
* ConfigMigrator manages a registry of migration functions and applies them
|
|
@@ -495,5 +593,5 @@ function createVersionManager(deps = {}) {
|
|
|
495
593
|
}
|
|
496
594
|
|
|
497
595
|
//#endregion
|
|
498
|
-
export { VersionManagerImpl, createVersionManager, defaultConfigMigrator };
|
|
499
|
-
//# sourceMappingURL=version-manager-impl-
|
|
596
|
+
export { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SubstrateConfigSchema, VersionManagerImpl, createVersionManager, defaultConfigMigrator };
|
|
597
|
+
//# sourceMappingURL=version-manager-impl-BpVx2DkY.js.map
|
package/package.json
CHANGED
|
@@ -55,9 +55,9 @@ Emit ONLY this YAML block as your final output — no other text.
|
|
|
55
55
|
```yaml
|
|
56
56
|
result: success
|
|
57
57
|
user_journeys:
|
|
58
|
-
- "First run: User installs CLI → runs 'substrate
|
|
59
|
-
- "Resume after failure: User sees failed story → inspects error → runs 'substrate
|
|
60
|
-
- "Amend existing run: User wants to change direction → runs 'substrate
|
|
58
|
+
- "First run: User installs CLI → runs 'substrate init' → provides project concept → pipeline starts automatically → watches real-time progress → reviews results"
|
|
59
|
+
- "Resume after failure: User sees failed story → inspects error → runs 'substrate resume' → pipeline retries from last checkpoint → completes successfully"
|
|
60
|
+
- "Amend existing run: User wants to change direction → runs 'substrate amend --concept ...' → sees diff of changes → approves → pipeline re-runs affected phases"
|
|
61
61
|
component_strategy: "Priority components: (1) Pipeline status view — hierarchical phase/story progress with real-time updates; (2) Story detail panel — structured view of AC, tasks, and test results; (3) Error inspector — contextual error display with suggested fixes"
|
|
62
62
|
ux_patterns:
|
|
63
63
|
- "Streaming output: display pipeline logs in real-time with ANSI color preservation"
|