@dv.nghiem/flowdeck 0.4.7 β 0.4.8
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 +14 -1
- package/dist/agents/orchestrator.d.ts +2 -5
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/config/schema.d.ts +1 -15
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/dashboard/server.mjs +14 -1
- package/dist/hooks/orchestrator-guard-hook.d.ts +5 -15
- package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +617 -2045
- package/dist/{tools/dispatch-routing.d.ts β lib/task-routing.d.ts} +1 -3
- package/dist/lib/task-routing.d.ts.map +1 -0
- package/dist/services/agent-contract-registry.d.ts.map +1 -1
- package/dist/services/agent-performance.d.ts +1 -1
- package/dist/services/agent-performance.d.ts.map +1 -1
- package/dist/services/cost-estimator.d.ts +0 -88
- package/dist/services/cost-estimator.d.ts.map +1 -1
- package/dist/services/event-logger.d.ts +1 -1
- package/dist/services/event-logger.d.ts.map +1 -1
- package/dist/services/quick-router.d.ts +24 -0
- package/dist/services/quick-router.d.ts.map +1 -1
- package/dist/services/supervisor-binding.d.ts +6 -0
- package/dist/services/supervisor-binding.d.ts.map +1 -1
- package/dist/services/workflow-router.d.ts +57 -0
- package/dist/services/workflow-router.d.ts.map +1 -0
- package/dist/services/workflow-scorecard.d.ts.map +1 -1
- package/dist/tools/planning-state-lib.d.ts +23 -0
- package/dist/tools/planning-state-lib.d.ts.map +1 -1
- package/docs/concepts/workflows.md +48 -0
- package/docs/index.md +15 -2
- package/docs/reference/workflow-router.md +337 -0
- package/package.json +1 -1
- package/src/commands/fd-discuss.md +8 -1
- package/src/commands/fd-execute.md +25 -3
- package/src/commands/fd-new-feature.md +97 -4
- package/src/commands/fd-plan.md +14 -4
- package/src/commands/fd-quick.md +43 -16
- package/src/rules/common/agent-orchestration.md +52 -18
- package/src/skills/agent-harness-construction/SKILL.md +5 -5
- package/dist/services/delegation-budget.d.ts +0 -54
- package/dist/services/delegation-budget.d.ts.map +0 -1
- package/dist/services/prompt-cache.d.ts +0 -61
- package/dist/services/prompt-cache.d.ts.map +0 -1
- package/dist/services/token-metrics.d.ts +0 -97
- package/dist/services/token-metrics.d.ts.map +0 -1
- package/dist/tools/delegate.d.ts +0 -4
- package/dist/tools/delegate.d.ts.map +0 -1
- package/dist/tools/dispatch-routing.d.ts.map +0 -1
- package/dist/tools/run-pipeline.d.ts +0 -4
- package/dist/tools/run-pipeline.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ FlowDeck adds a structured, multi-agent development workflow to OpenCode. It coo
|
|
|
23
23
|
- π **Built-in MCPs** β Context7 (docs), Exa (web search), and Grep.app (code search) included and enabled by default
|
|
24
24
|
- π **Ensemble Reasoning** β `council` tool for synthesized consensus from multiple specialized agents
|
|
25
25
|
- πΊοΈ **Codegraph Integration** β Codegraph-backed code understanding maps the codebase at indexing time and serves as the shared intelligence layer for all commands and agents.
|
|
26
|
+
- π§ **Adaptive Workflow Routing** β scores tasks across 5 dimensions (complexity, risk, confidence, blast radius, codebase freshness) and selects the minimal sufficient workflow class dynamically
|
|
26
27
|
- βοΈ **Model-agnostic** β no model is hardcoded. Every agent uses your currently selected OpenCode model. Override per-agent in `flowdeck.json`.
|
|
27
28
|
- π° **Cost Optimization** β USD cost estimation (40+ models), per-workflow budget enforcement, retry-cost tracking, and concurrency limits to control total production spend.
|
|
28
29
|
- π¦ **rtk Integration** β optional [rtk](https://github.com/rtk-ai/rtk) output-compression layer compresses noisy CLI output (git, npm, test runners, linters) 60β90% before it reaches the model. Auto-detected, telemetry-disabled by default.
|
|
@@ -49,7 +50,19 @@ See [Installation](docs/installation.md) for prerequisites, verification steps,
|
|
|
49
50
|
|
|
50
51
|
## Core Workflow
|
|
51
52
|
|
|
52
|
-
FlowDeck structures every feature through
|
|
53
|
+
FlowDeck structures every feature through an **adaptive workflow cycle**. The orchestrator scores each task across 5 dimensions (simplicity, confidence, risk, codebase familiarity, complexity) and selects the minimal sufficient workflow class:
|
|
54
|
+
|
|
55
|
+
| Workflow Class | Stages | When Used |
|
|
56
|
+
|----------------|--------|-----------|
|
|
57
|
+
| `quick` | execute β verify | Simple tasks (< 5 files, low risk) |
|
|
58
|
+
| `standard` | plan β execute β verify | Normal implementations |
|
|
59
|
+
| `explore` | discuss β plan β execute β verify | Ambiguous or unfamiliar tasks |
|
|
60
|
+
| `ui-heavy` | discuss β design β plan β execute β verify | UI/UX-heavy tasks |
|
|
61
|
+
| `bugfix` | discuss β fix-bug β verify | Bug fixes |
|
|
62
|
+
| `docs-only` | write-docs β verify | Documentation changes |
|
|
63
|
+
| `verify-heavy` | plan β execute β verify | High blast radius or sensitive paths |
|
|
64
|
+
|
|
65
|
+
The default six-step cycle:
|
|
53
66
|
|
|
54
67
|
```
|
|
55
68
|
/fd-map-codebase β /fd-new-feature β /fd-discuss β /fd-design β /fd-plan β /fd-execute β /fd-verify β /fd-done
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { AgentDefinition } from './types';
|
|
2
|
-
|
|
3
|
-
* Build the orchestrator prompt with dynamic agent filtering.
|
|
4
|
-
*/
|
|
5
|
-
export declare function buildOrchestratorPrompt(disabledAgents?: Set<string>): string;
|
|
2
|
+
export declare function buildOrchestratorPrompt(disabledAgents?: Set<string>, workflowClass?: string): string;
|
|
6
3
|
export declare function createOrchestratorAgent(model?: string | Array<string | {
|
|
7
4
|
id: string;
|
|
8
5
|
variant?: string;
|
|
9
|
-
}>, customPrompt?: string, customAppendPrompt?: string, disabledAgents?: Set<string
|
|
6
|
+
}>, customPrompt?: string, customAppendPrompt?: string, disabledAgents?: Set<string>, workflowClass?: string): AgentDefinition;
|
|
10
7
|
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/agents/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/agents/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyQ/C,wBAAgB,uBAAuB,CACrC,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC5B,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CA4BR;AAED,wBAAgB,uBAAuB,CACrC,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACjE,YAAY,CAAC,EAAE,MAAM,EACrB,kBAAkB,CAAC,EAAE,MAAM,EAC3B,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC5B,aAAa,CAAC,EAAE,MAAM,GACrB,eAAe,CAuBjB"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -22,20 +22,6 @@ export interface GovernanceConfig {
|
|
|
22
22
|
/** Whether to enforce contract tool allowlists. Default: true when mode != off */
|
|
23
23
|
contractEnforcement?: "off" | "warn" | "strict";
|
|
24
24
|
};
|
|
25
|
-
delegationBudget?: {
|
|
26
|
-
/** Max total tool calls before run is stopped. Default: 200 */
|
|
27
|
-
maxToolCalls?: number;
|
|
28
|
-
/** Max total delegated agents. Default: 30 */
|
|
29
|
-
maxDelegatedAgents?: number;
|
|
30
|
-
/** Max total retries across all steps. Default: 10 */
|
|
31
|
-
maxRetries?: number;
|
|
32
|
-
/** Max delegation depth. Default: 8 */
|
|
33
|
-
maxDepth?: number;
|
|
34
|
-
/** Max retries on the same step before escalating. Default: 3 */
|
|
35
|
-
maxSameStepRetries?: number;
|
|
36
|
-
/** What to do when budget is exhausted. Default: "escalate" */
|
|
37
|
-
onExhaustion?: "stop" | "warn" | "escalate";
|
|
38
|
-
};
|
|
39
25
|
deadlockDetection?: {
|
|
40
26
|
/** Whether deadlock detection is active. Default: true */
|
|
41
27
|
enabled?: boolean;
|
|
@@ -68,7 +54,7 @@ export interface GovernanceConfig {
|
|
|
68
54
|
* What to do when the budget is exceeded.
|
|
69
55
|
* - "warn": log a warning but continue
|
|
70
56
|
* - "stop": abort the current tool call with an error message
|
|
71
|
-
* - "escalate": surface an escalation signal
|
|
57
|
+
* - "escalate": surface an escalation signal for the current run
|
|
72
58
|
* Default: "warn"
|
|
73
59
|
*/
|
|
74
60
|
onExhaustion?: "warn" | "stop" | "escalate";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,qHAAqH;IACrH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE;QACV;;;;WAIG;QACH,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;QACrC,kFAAkF;QAClF,mBAAmB,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;KACjD,CAAC;IACF,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,qHAAqH;IACrH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE;QACV;;;;WAIG;QACH,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;QACrC,kFAAkF;QAClF,mBAAmB,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;KACjD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,CAAC,EAAE,OAAO,CAAC;QAClB,WAAW,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;QACpC,mCAAmC,CAAC,EAAE,OAAO,CAAC;QAC9C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxC,uBAAuB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;KACpD,CAAC;IACF,yGAAyG;IACzG,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B"}
|
|
@@ -12456,6 +12456,14 @@ function parseState(content) {
|
|
|
12456
12456
|
result[key] = value === "true";
|
|
12457
12457
|
} else if (key === "requires_design_first" || key === "design_approved" || key === "design_override") {
|
|
12458
12458
|
result[key] = value === "true";
|
|
12459
|
+
} else if (key === "skippedStages") {
|
|
12460
|
+
result[key] = value.replace(/[\[\]]/g, "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
12461
|
+
} else if (key === "escalationHistory" || key === "routingScores") {
|
|
12462
|
+
try {
|
|
12463
|
+
result[key] = JSON.parse(value);
|
|
12464
|
+
} catch {
|
|
12465
|
+
result[key] = undefined;
|
|
12466
|
+
}
|
|
12459
12467
|
} else if (value !== "" && !isNaN(Number(value)) && key !== "plan_file" && key !== "confirmed_at") {
|
|
12460
12468
|
result[key] = Number(value);
|
|
12461
12469
|
} else {
|
|
@@ -12513,7 +12521,12 @@ function readPlanningState(dir) {
|
|
|
12513
12521
|
lastUpdatedBy: parsed.lastUpdatedBy || "",
|
|
12514
12522
|
lastUpdatedPhase: parsed.lastUpdatedPhase || 1,
|
|
12515
12523
|
summaryVersion: parsed.summaryVersion || 0,
|
|
12516
|
-
freshnessStatus: parsed.freshnessStatus || "unknown"
|
|
12524
|
+
freshnessStatus: parsed.freshnessStatus || "unknown",
|
|
12525
|
+
workflowClass: parsed.workflowClass || undefined,
|
|
12526
|
+
skippedStages: parsed.skippedStages || undefined,
|
|
12527
|
+
escalationHistory: parsed.escalationHistory || undefined,
|
|
12528
|
+
routingScores: parsed.routingScores || undefined,
|
|
12529
|
+
routingReason: parsed.routingReason || undefined
|
|
12517
12530
|
};
|
|
12518
12531
|
}
|
|
12519
12532
|
function parseTDDState(parsed) {
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Orchestrator Guard Hook
|
|
3
3
|
*
|
|
4
|
-
* Enforces the "orchestrator as coordinator
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Detection: the FIRST session.created event is treated as the orchestrator's session.
|
|
9
|
-
* Child sessions (created by `delegate`) always arrive after the primary one.
|
|
4
|
+
* Enforces the "orchestrator as coordinator" rule for the primary session.
|
|
5
|
+
* The orchestrator may inspect files and planning state directly, but it should
|
|
6
|
+
* route file writes and shell-heavy execution to specialist agents instead of
|
|
7
|
+
* using blocked tools in the primary session.
|
|
10
8
|
*
|
|
11
9
|
* To enable: set FLOWDECK_ORCHESTRATOR_GUARD=on in the environment.
|
|
12
|
-
* Default is OFF
|
|
10
|
+
* Default is OFF.
|
|
13
11
|
*/
|
|
14
12
|
export declare class OrchestratorGuard {
|
|
15
13
|
private primarySessionId;
|
|
16
|
-
/**
|
|
17
|
-
* Call this from the plugin's event handler so the guard can capture the
|
|
18
|
-
* primary session ID the first time a session is created.
|
|
19
|
-
*/
|
|
20
14
|
onEvent(event: {
|
|
21
15
|
type?: string;
|
|
22
16
|
properties?: unknown;
|
|
@@ -24,10 +18,6 @@ export declare class OrchestratorGuard {
|
|
|
24
18
|
sessionID?: string;
|
|
25
19
|
sessionId?: string;
|
|
26
20
|
}): void;
|
|
27
|
-
/**
|
|
28
|
-
* Call this from tool.execute.before.
|
|
29
|
-
* Throws if the tool is blocked for the orchestrator session.
|
|
30
|
-
*/
|
|
31
21
|
check(sessionId: string, toolName: string): void;
|
|
32
22
|
}
|
|
33
23
|
//# sourceMappingURL=orchestrator-guard-hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-guard-hook.d.ts","sourceRoot":"","sources":["../../src/hooks/orchestrator-guard-hook.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"orchestrator-guard-hook.d.ts","sourceRoot":"","sources":["../../src/hooks/orchestrator-guard-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuDH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,gBAAgB,CAAsB;IAE9C,OAAO,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAkBtH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CASjD"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA0GjD,QAAA,MAAM,MAAM,EAAE,MA0Pb,CAAA;AAED,eAAe,MAAM,CAAA"}
|