@yieldfabric/terminal 1.0.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.md ADDED
@@ -0,0 +1,118 @@
1
+ # @yieldfabric/terminal
2
+
3
+ Reusable AI-powered terminal component for YieldFabric applications.
4
+
5
+ ## Installation
6
+
7
+ Published to the **public npm registry** — no scope `.npmrc`, no token:
8
+
9
+ ```bash
10
+ npm install @yieldfabric/terminal
11
+ ```
12
+
13
+ ### Peer dependencies
14
+
15
+ `react` and `react-dom` (^18) are peer deps — install them in the host app.
16
+ All other runtime deps (`@xyflow/react`, `@mdxeditor/editor`, `framer-motion`,
17
+ `lucide-react`, `react-markdown`, `dagre`, `@dicebear/*`) install
18
+ automatically from the public npm registry.
19
+
20
+ ### Tailwind
21
+
22
+ This package emits Tailwind utility classes. Add it to your `tailwind.config.js`
23
+ `content` so the classes aren't purged:
24
+
25
+ ```js
26
+ content: [
27
+ // ...your app globs
28
+ './node_modules/@yieldfabric/terminal/dist/**/*.{js,cjs}',
29
+ ],
30
+ ```
31
+
32
+ ### Third-party CSS
33
+
34
+ The knowledge-graph and markdown-editor views import two stylesheets
35
+ (`@xyflow/react/dist/style.css`, `@mdxeditor/editor/style.css`). These ride
36
+ along as side-effect imports in the bundle — modern bundlers (Next.js, CRA,
37
+ Vite) resolve them automatically; no manual import needed.
38
+
39
+ ## Usage
40
+
41
+ ### ExpandableTerminal (Header/Dropdown Style)
42
+
43
+ ```typescript
44
+ import { ExpandableTerminal } from '@yieldfabric/terminal'
45
+ import { useRouter } from 'next/navigation' // or react-router-dom
46
+
47
+ const config = {
48
+ endpoints: [...],
49
+ welcomeMessage: "Welcome to YieldFabric!",
50
+ // ... other config
51
+ }
52
+
53
+ function MyComponent() {
54
+ const router = useRouter()
55
+
56
+ return (
57
+ <ExpandableTerminal
58
+ config={config}
59
+ onCommandExecute={handleCommand}
60
+ onPageNavigation={(page) => router.push(page.path)}
61
+ onStreamRequest={handleStreaming}
62
+ />
63
+ )
64
+ }
65
+ ```
66
+
67
+ ### EmbeddedTerminal (Embedded in Page)
68
+
69
+ ```typescript
70
+ import { EmbeddedTerminal } from '@yieldfabric/terminal'
71
+
72
+ function MyPage() {
73
+ return (
74
+ <EmbeddedTerminal
75
+ config={config}
76
+ onCommandExecute={handleCommand}
77
+ showHeader={true}
78
+ showWelcomeMessage={true}
79
+ />
80
+ )
81
+ }
82
+ ```
83
+
84
+ ## Building
85
+
86
+ Built with [tsup](https://tsup.egoist.dev/) → dual ESM + CJS bundles plus
87
+ type declarations in `dist/`. Heavy deps stay external (consumers install
88
+ them); the bundle carries only this package's own component source.
89
+
90
+ ```bash
91
+ npm run build # one-shot build → dist/
92
+ npm run dev # watch mode
93
+ npm run typecheck # tsc --noEmit
94
+ ```
95
+
96
+ ## Publishing
97
+
98
+ Public scoped package on the **public npm registry** (`publishConfig.access:
99
+ public`). Requires the `yieldfabric` scope = an npm org (or user) named
100
+ `yieldfabric`. `npm login` once, then:
101
+
102
+ ```bash
103
+ npm publish # prepublishOnly cleans + rebuilds first
104
+ ```
105
+
106
+ Bump `version` in `package.json` first (npm rejects re-publishing an existing
107
+ version). The tarball ships `dist/` + `README.md` only — no `src/`, no maps.
108
+
109
+ ## Features
110
+
111
+ - ✅ Framework-agnostic (works with Next.js, React, etc.)
112
+ - ✅ TypeScript support with strict types
113
+ - ✅ Streaming AI responses
114
+ - ✅ Command history and autocomplete
115
+ - ✅ Tailwind CSS styling
116
+ - ✅ Page navigation suggestions
117
+ - ✅ Fully customizable via config
118
+