@mcp-graph-workflow/agent-graph-flow 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +65 -50
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -12,9 +12,9 @@ import os, { homedir } from 'os';
12
12
  import { stat, readFile, access, constants } from 'fs/promises';
13
13
  import { execFile, execSync, spawn } from 'child_process';
14
14
  import { render, useApp, Box, Text } from 'ink';
15
- import { jsxs, jsx } from 'react/jsx-runtime';
15
+ import { jsx, jsxs } from 'react/jsx-runtime';
16
+ import { createElement, useState, useCallback, useEffect } from 'react';
16
17
  import TextInput from 'ink-text-input';
17
- import { createElement, useState } from 'react';
18
18
  import Spinner from 'ink-spinner';
19
19
  import { Command } from 'commander';
20
20
  import { setTimeout as setTimeout$1 } from 'timers/promises';
@@ -7723,6 +7723,44 @@ var init_app = __esm({
7723
7723
  };
7724
7724
  }
7725
7725
  });
7726
+ function BannerScreen({ onDone }) {
7727
+ const cols = process.stdout.columns ?? 80;
7728
+ const maxSteps = Math.max(cols - 14, 10);
7729
+ const [step, setStep] = useState(0);
7730
+ const done = useCallback(onDone, [onDone]);
7731
+ useEffect(() => {
7732
+ if (step >= maxSteps) {
7733
+ const t2 = setTimeout(done, 300);
7734
+ return () => clearTimeout(t2);
7735
+ }
7736
+ const t = setTimeout(() => setStep((s) => s + 1), FRAME_MS);
7737
+ return () => clearTimeout(t);
7738
+ }, [step, maxSteps, done]);
7739
+ const bug = BUG_FRAMES[step % BUG_FRAMES.length];
7740
+ const trailLen = Math.min(step, maxSteps - 1);
7741
+ const trail = "\xB7".repeat(trailLen);
7742
+ const pad = " ".repeat(step < maxSteps ? step : maxSteps);
7743
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingTop: 1, children: [
7744
+ /* @__PURE__ */ jsxs(Text, { color: "green", children: [
7745
+ pad,
7746
+ trail,
7747
+ bug
7748
+ ] }),
7749
+ step >= maxSteps && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
7750
+ /* @__PURE__ */ jsx(Text, { bold: true, color: "green", children: TAGLINE }),
7751
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: " type /help to see all commands" })
7752
+ ] })
7753
+ ] });
7754
+ }
7755
+ var BUG_FRAMES, TAGLINE, FRAME_MS;
7756
+ var init_banner_screen = __esm({
7757
+ "src/tui/banner-screen.tsx"() {
7758
+ init_esm_shims();
7759
+ BUG_FRAMES = [" /\\(\u2022\u203F\u2022)/\\ ", " \\(\u2022\u203F\u2022)/ ", " /\\(\u2022\u203F\u2022)/\\ "];
7760
+ TAGLINE = "mcp-graph-agent \u2014 Software Engineer as a Service";
7761
+ FRAME_MS = 28;
7762
+ }
7763
+ });
7726
7764
  function CommandBar({ value, onChange, onSubmit, suggestions }) {
7727
7765
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
7728
7766
  suggestions.length > 0 && /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, children: suggestions.map((c) => /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
@@ -7848,6 +7886,9 @@ var init_dispatch = __esm({
7848
7886
  });
7849
7887
  function InteractiveApp({ dashboard, port, asyncPort, liveRunner, skillCommands = [] }) {
7850
7888
  const { exit } = useApp();
7889
+ const [phase, setPhase] = useState(
7890
+ process.stdout.isTTY ? "banner" : "dashboard"
7891
+ );
7851
7892
  const [input, setInput] = useState("");
7852
7893
  const [log45, setLog] = useState([]);
7853
7894
  const [running, setRunning] = useState(false);
@@ -7877,12 +7918,25 @@ function InteractiveApp({ dashboard, port, asyncPort, liveRunner, skillCommands
7877
7918
  if (ASYNC_CMDS.includes(parsed.cmd) && asyncPort) {
7878
7919
  append(`\u203A ${text}`);
7879
7920
  setRunning(true);
7880
- runAsyncCommand(asyncPort, parsed).then((summary) => append(summary)).catch((err) => append(`erro: ${err instanceof Error ? err.message : String(err)}`)).finally(() => setRunning(false));
7921
+ setImmediate(() => {
7922
+ void runAsyncCommand(asyncPort, parsed).then((summary) => append(summary)).catch((err) => append(`erro: ${err instanceof Error ? err.message : String(err)}`)).finally(() => setRunning(false));
7923
+ });
7924
+ return;
7925
+ }
7926
+ const matchedSkill = skillCommands.find((sc) => sc.name === parsed.cmd);
7927
+ if (matchedSkill) {
7928
+ const skill = port.getSkill(parsed.cmd);
7929
+ append(`\u203A ${text}`);
7930
+ append(skill ? `=== ${skill.name} ===
7931
+ ${skill.body}` : `Skill n\xE3o encontrada: ${parsed.cmd}`);
7881
7932
  return;
7882
7933
  }
7883
7934
  append(`\u203A ${text}`);
7884
7935
  append(runReadCommand(port, parsed));
7885
7936
  };
7937
+ if (phase === "banner") {
7938
+ return /* @__PURE__ */ jsx(BannerScreen, { onDone: () => setPhase("dashboard") });
7939
+ }
7886
7940
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
7887
7941
  /* @__PURE__ */ jsx(App, { model: dashboard }),
7888
7942
  log45.length > 0 && /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: 1, borderStyle: "single", paddingX: 1, children: log45.map((line, i) => /* @__PURE__ */ jsx(Text, { children: line }, i)) }),
@@ -7906,6 +7960,7 @@ var init_interactive_app = __esm({
7906
7960
  "src/tui/interactive-app.tsx"() {
7907
7961
  init_esm_shims();
7908
7962
  init_app();
7963
+ init_banner_screen();
7909
7964
  init_command_bar();
7910
7965
  init_dispatch();
7911
7966
  MAX_LOG_LINES = 12;
@@ -8208,7 +8263,11 @@ function invokeSkill(dir, name) {
8208
8263
  };
8209
8264
  }
8210
8265
  function defaultSkillRoots(projectRoot = process.cwd()) {
8211
- return [join(projectRoot, "src/skills"), join(projectRoot, ".claude/skills")];
8266
+ return [
8267
+ join(projectRoot, "src/skills"),
8268
+ join(projectRoot, ".agents/skills"),
8269
+ join(projectRoot, ".claude/skills")
8270
+ ];
8212
8271
  }
8213
8272
  var init_skill_registry = __esm({
8214
8273
  "src/core/skills/skill-registry.ts"() {
@@ -9429,8 +9488,8 @@ async function launchTui(store2) {
9429
9488
  const skillCommands = defaultSkillRoots(dir).flatMap((r) => {
9430
9489
  const { skills } = listSkills(r);
9431
9490
  return skills.map((s) => ({
9432
- name: `skill:${s.name}`,
9433
- usage: `/skill ${s.name}`,
9491
+ name: s.name,
9492
+ usage: `/${s.name}`,
9434
9493
  desc: `[${s.category}] ${s.description}`
9435
9494
  }));
9436
9495
  });
@@ -10259,52 +10318,8 @@ function runCommand() {
10259
10318
 
10260
10319
  // src/cli/commands/tui-cmd.ts
10261
10320
  init_esm_shims();
10262
-
10263
- // src/cli/banner.ts
10264
- init_esm_shims();
10265
- var GREEN = "\x1B[32m";
10266
- var BOLD = "\x1B[1m";
10267
- var DIM = "\x1B[2m";
10268
- var RESET = "\x1B[0m";
10269
- var CLEAR_LINE = "\r\x1B[K";
10270
- var BUG_FRAMES = [
10271
- " /\\(\u2022\u203F\u2022)/\\ ",
10272
- " /\\(\u2022\u203F\u2022)/\\ ",
10273
- " \\(\u2022\u203F\u2022)/ ",
10274
- " \\(\u2022\u203F\u2022)/ ",
10275
- " /\\(\u2022\u203F\u2022)/\\ "
10276
- ];
10277
- var TRAIL = "\xB7";
10278
- var TAGLINE = "mcp-graph-agent \u2014 Software Engineer as a Service";
10279
- function sleep(ms) {
10280
- return new Promise((r) => setTimeout(r, ms));
10281
- }
10282
- async function showBanner() {
10283
- if (!process.stdout.isTTY) return;
10284
- const cols = process.stdout.columns ?? 80;
10285
- const bugWidth = BUG_FRAMES[0].length;
10286
- const steps = Math.max(cols - bugWidth - 2, 10);
10287
- let trail = "";
10288
- for (let i = 0; i <= steps; i++) {
10289
- const frame = BUG_FRAMES[i % BUG_FRAMES.length];
10290
- const pad = " ".repeat(i);
10291
- process.stdout.write(`${CLEAR_LINE}${GREEN}${pad}${trail}${frame}${RESET}`);
10292
- trail += TRAIL;
10293
- if (trail.length > i) trail = trail.slice(-i || 0);
10294
- await sleep(28);
10295
- }
10296
- process.stdout.write(`
10297
- ${CLEAR_LINE}${BOLD}${GREEN}${TAGLINE}${RESET}
10298
- `);
10299
- process.stdout.write(`${DIM} type /help to see all commands${RESET}
10300
-
10301
- `);
10302
- }
10303
-
10304
- // src/cli/commands/tui-cmd.ts
10305
10321
  function tuiCommand() {
10306
10322
  return new Command("tui").description("Abre a TUI interativa (dashboard do grafo + tokens)").option("-d, --dir <dir>", "Diret\xF3rio do projeto", process.cwd()).action(async (opts) => {
10307
- await showBanner();
10308
10323
  const store2 = openStoreOrFail(opts.dir);
10309
10324
  try {
10310
10325
  const { launchTui: launchTui2 } = await Promise.resolve().then(() => (init_launch(), launch_exports));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-graph-workflow/agent-graph-flow",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Agente SWE autônomo, local-first e token-frugal: PRD → grafo de execução persistente, TDD obrigatório, custo de token brutalmente baixo. AGPL v3.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",