@dv.nghiem/flowdeck 0.2.1 → 0.2.2

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PluginModule } from "@opencode-ai/plugin";
2
- declare const plugin: PluginModule;
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ declare const plugin: Plugin;
3
3
  export default plugin;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,qBAAqB,CAAA;AA2K/D,QAAA,MAAM,MAAM,EAAE,YAGb,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA2EjD,QAAA,MAAM,MAAM,EAAE,MAsJb,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/index.js CHANGED
@@ -1,3 +1,9 @@
1
+ // src/index.ts
2
+ import { readdirSync as readdirSync3, readFileSync as readFileSync22, existsSync as existsSync23 } from "fs";
3
+ import { join as join22, basename } from "path";
4
+ import { dirname as dirname4 } from "path";
5
+ import { fileURLToPath as fileURLToPath2 } from "url";
6
+
1
7
  // src/tools/planning-state.ts
2
8
  import { join as join3 } from "path";
3
9
  import { tool as tool2 } from "@opencode-ai/plugin";
@@ -5533,7 +5539,33 @@ function loadFlowDeckConfig(directory) {
5533
5539
  return {};
5534
5540
  }
5535
5541
  // src/index.ts
5536
- var server = async (input, _options) => {
5542
+ function loadCommands() {
5543
+ const __dir = dirname4(fileURLToPath2(import.meta.url));
5544
+ const commandsDir = join22(__dir, "..", "src", "commands");
5545
+ if (!existsSync23(commandsDir))
5546
+ return {};
5547
+ const commands = {};
5548
+ try {
5549
+ for (const file of readdirSync3(commandsDir)) {
5550
+ if (!file.endsWith(".md"))
5551
+ continue;
5552
+ const name = basename(file, ".md");
5553
+ const raw = readFileSync22(join22(commandsDir, file), "utf-8");
5554
+ let description;
5555
+ let template = raw;
5556
+ const fmMatch = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);
5557
+ if (fmMatch) {
5558
+ template = fmMatch[2].trim();
5559
+ const descMatch = fmMatch[1].match(/^description:\s*(.+)$/m);
5560
+ if (descMatch)
5561
+ description = descMatch[1].trim();
5562
+ }
5563
+ commands[name] = description ? { description, template } : { template };
5564
+ }
5565
+ } catch {}
5566
+ return commands;
5567
+ }
5568
+ var plugin = async (input, _options) => {
5537
5569
  const { directory, client, worktree } = input;
5538
5570
  const runParallelTool = createRunParallelTool(client);
5539
5571
  const runPipelineTool = createRunPipelineTool(client);
@@ -5550,11 +5582,15 @@ var server = async (input, _options) => {
5550
5582
  const appLog = (msg) => client.app.log({ body: { service: "flowdeck", level: "info", message: msg } }).catch(() => {});
5551
5583
  const autoLearnHook = createAutoLearnHook(client, fileTracker, directory, appLog);
5552
5584
  const agentConfigs = getAgentConfigs({});
5585
+ const mcps = createFlowDeckMcps();
5553
5586
  return {
5554
5587
  name: "@dv.nghiem/flowdeck",
5555
5588
  agent: agentConfigs,
5556
- mcp: createFlowDeckMcps(),
5589
+ mcp: mcps,
5557
5590
  config: async (cfg) => {
5591
+ if (!cfg.default_agent) {
5592
+ cfg.default_agent = "orchestrator";
5593
+ }
5558
5594
  const flowdeckConfig = loadFlowDeckConfig(directory);
5559
5595
  const agentModels = {};
5560
5596
  for (const [name, agentCfg] of Object.entries(flowdeckConfig.agents ?? {})) {
@@ -5562,15 +5598,36 @@ var server = async (input, _options) => {
5562
5598
  agentModels[name] = agentCfg.model;
5563
5599
  }
5564
5600
  }
5565
- const agentConfigs2 = getAgentConfigs(agentModels);
5566
- if (!cfg.agent || typeof cfg.agent !== "object") {
5567
- cfg.agent = {};
5601
+ const resolvedAgentConfigs = getAgentConfigs(agentModels);
5602
+ if (!cfg.agent) {
5603
+ cfg.agent = { ...resolvedAgentConfigs };
5604
+ } else {
5605
+ for (const [name, pluginAgent] of Object.entries(resolvedAgentConfigs)) {
5606
+ const existing = cfg.agent[name];
5607
+ if (existing) {
5608
+ cfg.agent[name] = { ...pluginAgent, ...existing };
5609
+ } else {
5610
+ cfg.agent[name] = { ...pluginAgent };
5611
+ }
5612
+ }
5613
+ }
5614
+ const cfgMcp = cfg.mcp;
5615
+ if (!cfgMcp) {
5616
+ cfg.mcp = { ...mcps };
5617
+ } else {
5618
+ Object.assign(cfgMcp, mcps);
5619
+ }
5620
+ const commands = loadCommands();
5621
+ if (Object.keys(commands).length > 0) {
5622
+ if (!cfg.command || typeof cfg.command !== "object") {
5623
+ cfg.command = {};
5624
+ }
5625
+ for (const [name, cmd] of Object.entries(commands)) {
5626
+ if (!cfg.command[name]) {
5627
+ cfg.command[name] = cmd;
5628
+ }
5629
+ }
5568
5630
  }
5569
- cfg.agent = {
5570
- ...agentConfigs2,
5571
- ...cfg.agent,
5572
- ...Object.fromEntries(Object.entries(agentConfigs2).filter(([name]) => agentModels[name] !== undefined).map(([name, agentCfg]) => [name, agentCfg]))
5573
- };
5574
5631
  },
5575
5632
  tool: {
5576
5633
  "planning-state": planningStateTool,
@@ -5624,10 +5681,6 @@ var server = async (input, _options) => {
5624
5681
  }
5625
5682
  };
5626
5683
  };
5627
- var plugin = {
5628
- id: "@dv.nghiem/flowdeck",
5629
- server
5630
- };
5631
5684
  var src_default = plugin;
5632
5685
  export {
5633
5686
  src_default as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dv.nghiem/flowdeck",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "FlowDeck — structured planning and execution workflows for OpenCode",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",