farai 0.1.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/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source,
28
+ and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation
31
+ or translation of a Source form, including but not limited to compiled
32
+ object code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that
36
+ is included in or attached to the work.
37
+
38
+ "Derivative Works" shall mean any work, whether in Source or Object form,
39
+ that is based on (or derived from) the Work and for which the editorial
40
+ revisions, annotations, elaborations, or other modifications represent, as
41
+ a whole, an original work of authorship. For the purposes of this License,
42
+ Derivative Works shall not include works that remain separable from, or
43
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
44
+ Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original
47
+ version of the Work and any modifications or additions to that Work or
48
+ Derivative Works thereof, that is intentionally submitted to Licensor for
49
+ inclusion in the Work by the copyright owner or by an individual or Legal
50
+ Entity authorized to submit on behalf of the copyright owner. For the
51
+ purposes of this definition, "submitted" means any form of electronic,
52
+ verbal, or written communication sent to the Licensor or its representatives,
53
+ including but not limited to communication on electronic mailing lists,
54
+ source code control systems, and issue tracking systems that are managed by,
55
+ or on behalf of, the Licensor for the purpose of discussing and improving
56
+ the Work, but excluding communication that is conspicuously marked or
57
+ otherwise designated in writing by the copyright owner as "Not a Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
60
+ behalf of whom a Contribution has been received by Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
64
+ License, each Contributor hereby grants to You a perpetual, worldwide,
65
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
66
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
67
+ sublicense, and distribute the Work and such Derivative Works in Source or
68
+ Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of this
71
+ License, each Contributor hereby grants to You a perpetual, worldwide,
72
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
73
+ this section) patent license to make, have made, use, offer to sell, sell,
74
+ import, and otherwise transfer the Work, where such license applies only
75
+ to those patent claims licensable by such Contributor that are necessarily
76
+ infringed by their Contribution(s) alone or by combination of their
77
+ Contribution(s) with the Work to which such Contribution(s) was submitted.
78
+ If You institute patent litigation against any entity (including a
79
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
80
+ Contribution incorporated within the Work constitutes direct or contributory
81
+ patent infringement, then any patent licenses granted to You under this
82
+ License for that Work shall terminate as of the date such litigation is
83
+ filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
86
+ Derivative Works thereof in any medium, with or without modifications, and
87
+ in Source or Object form, provided that You meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or Derivative Works
90
+ a copy of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices stating
93
+ that You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works that You
96
+ distribute, all copyright, patent, trademark, and attribution notices
97
+ from the Source form of the Work, excluding those notices that do not
98
+ pertain to any part of the Derivative Works; and
99
+
100
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
101
+ then any Derivative Works that You distribute must include a readable
102
+ copy of the attribution notices contained within such NOTICE file,
103
+ excluding those notices that do not pertain to any part of the
104
+ Derivative Works, in at least one of the following places: within a
105
+ NOTICE text file distributed as part of the Derivative Works; within
106
+ the Source form or documentation, if provided along with the
107
+ Derivative Works; or, within a display generated by the Derivative
108
+ Works, if and wherever such third-party notices normally appear. The
109
+ contents of the NOTICE file are for informational purposes only and
110
+ do not modify the License. You may add Your own attribution notices
111
+ within Derivative Works that You distribute, alongside or as an
112
+ addendum to the NOTICE text from the Work, provided that such
113
+ additional attribution notices cannot be construed as modifying the
114
+ License.
115
+
116
+ You may add Your own copyright statement to Your modifications and may
117
+ provide additional or different license terms and conditions for use,
118
+ reproduction, or distribution of Your modifications, or for any such
119
+ Derivative Works as a whole, provided Your use, reproduction, and
120
+ distribution of the Work otherwise complies with the conditions stated in
121
+ this License.
122
+
123
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
124
+ any Contribution intentionally submitted for inclusion in the Work by You
125
+ to the Licensor shall be under the terms and conditions of this License,
126
+ without any additional terms or conditions. Notwithstanding the above,
127
+ nothing herein shall supersede or modify the terms of any separate license
128
+ agreement you may have executed with Licensor regarding such Contributions.
129
+
130
+ 6. Trademarks. This License does not grant permission to use the trade
131
+ names, trademarks, service marks, or product names of the Licensor, except
132
+ as required for reasonable and customary use in describing the origin of
133
+ the Work and reproducing the content of the NOTICE file.
134
+
135
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to
136
+ in writing, Licensor provides the Work (and each Contributor provides its
137
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
138
+ KIND, either express or implied, including, without limitation, any warranties
139
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
140
+ PARTICULAR PURPOSE. You are solely responsible for determining the
141
+ appropriateness of using or redistributing the Work and assume any risks
142
+ associated with Your exercise of permissions under this License.
143
+
144
+ 8. Limitation of Liability. In no event and under no legal theory, whether
145
+ in tort (including negligence), contract, or otherwise, unless required by
146
+ applicable law (such as deliberate and grossly negligent acts) or agreed to
147
+ in writing, shall any Contributor be liable to You for damages, including
148
+ any direct, indirect, special, incidental, or consequential damages of any
149
+ character arising as a result of this License or out of the use or inability
150
+ to use the Work (including but not limited to damages for loss of goodwill,
151
+ work stoppage, computer failure or malfunction, or any and all other
152
+ commercial damages or losses), even if such Contributor has been advised of
153
+ the possibility of such damages.
154
+
155
+ 9. Accepting Warranty or Additional Liability. While redistributing the
156
+ Work or Derivative Works thereof, You may choose to offer, and charge a fee
157
+ for, acceptance of support, warranty, indemnity, or other liability
158
+ obligations and/or rights consistent with this License. However, in accepting
159
+ such obligations, You may act only on Your own behalf and on Your sole
160
+ responsibility, not on behalf of any other Contributor, and only if You agree
161
+ to indemnify, defend, and hold each Contributor harmless for any liability
162
+ incurred by, or claims asserted against, such Contributor by reason of your
163
+ accepting any such warranty or additional liability.
164
+
165
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,147 @@
1
+ <div align="center">
2
+
3
+ # Farai
4
+
5
+ Cyber-first local AI agent for terminal-driven security work.
6
+
7
+ <p>
8
+ <a href="https://www.npmjs.com/package/farai"><img src="https://img.shields.io/npm/v/farai?style=flat&logo=npm" alt="npm"></a>
9
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License: Apache-2.0"></a>
10
+ <a href="https://github.com/pajarori/farai/stargazers"><img src="https://img.shields.io/github/stars/pajarori/farai?style=flat&logo=github" alt="GitHub stars"></a>
11
+ <a href="https://github.com/pajarori/farai/network/members"><img src="https://img.shields.io/github/forks/pajarori/farai?style=flat&logo=github" alt="GitHub forks"></a>
12
+ </p>
13
+
14
+ </div>
15
+
16
+ <p align="center">
17
+ <img src="https://raw.githubusercontent.com/pajarori/farai/main/docs/assets/farai.gif" alt="Farai terminal demo" width="900">
18
+ </p>
19
+
20
+ Farai is a local AI agent built for CTFs, lab automation, security research, and long-running technical workflows. It runs from the terminal, keeps sessions resumable, executes tools locally or inside a Kali Docker runtime, and preserves tool output, artifacts, usage, and evidence so work can be reviewed instead of only trusted from a final answer.
21
+
22
+ For CSI/CyBench materials and exploratory benchmark artifacts, see [farai-csi-bench](https://github.com/pajarori/farai-csi-bench).
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ npm install -g farai
28
+ farai setup
29
+ farai
30
+ ```
31
+
32
+ Or with Bun:
33
+
34
+ ```bash
35
+ bun install -g farai
36
+ farai setup
37
+ farai
38
+ ```
39
+
40
+ Requirements:
41
+
42
+ - Bun 1.1+
43
+ - Node.js 20+
44
+ - Docker
45
+ - A model provider/API key, unless using an already configured default provider
46
+
47
+ ## Setup
48
+
49
+ Configure Farai and prepare the local runtime:
50
+
51
+ ```bash
52
+ farai setup
53
+ ```
54
+
55
+ Configure a model provider during setup:
56
+
57
+ ```bash
58
+ farai setup \
59
+ --model openai:gpt-5 \
60
+ --base-url https://api.openai.com/v1 \
61
+ --api-key-env OPENAI_API_KEY
62
+ ```
63
+
64
+ Skip heavier setup steps when needed:
65
+
66
+ ```bash
67
+ farai setup --no-docker
68
+ farai setup --no-kb
69
+ ```
70
+
71
+ Check the environment:
72
+
73
+ ```bash
74
+ farai doctor
75
+ ```
76
+
77
+ ## Usage
78
+
79
+ Open the interactive TUI:
80
+
81
+ ```bash
82
+ farai
83
+ ```
84
+
85
+ Run a one-shot prompt:
86
+
87
+ ```bash
88
+ farai run "scan the target and summarize exposed services"
89
+ ```
90
+
91
+ Create a named session:
92
+
93
+ ```bash
94
+ farai init --name htb-box --target 10.10.10.10
95
+ ```
96
+
97
+ Resume a session:
98
+
99
+ ```bash
100
+ farai resume htb-box
101
+ ```
102
+
103
+ Change or add a model provider:
104
+
105
+ ```bash
106
+ farai model
107
+ farai model add openai/gpt-5 --base-url https://api.openai.com/v1 --api-key-env OPENAI_API_KEY --set-default
108
+ ```
109
+
110
+ Run benchmark manifests:
111
+
112
+ ```bash
113
+ farai bench run manifest.json --artifacts /tmp/farai-results
114
+ farai bench suite suite.json --artifacts /tmp/farai-results
115
+ ```
116
+
117
+ ## Commands
118
+
119
+ | Command | Description |
120
+ |---|---|
121
+ | `farai` | Open the interactive terminal UI |
122
+ | `farai setup` | Prepare config, Docker runtime, local data, and optional model provider |
123
+ | `farai run` | Execute a one-shot prompt |
124
+ | `farai resume` | Continue a saved session |
125
+ | `farai init` | Create a named session |
126
+ | `farai model` | List or add model providers |
127
+ | `farai bench` | Run benchmark manifests and suites |
128
+ | `farai doctor` | Verify the local environment |
129
+ | `farai config` | Print config and auth paths |
130
+
131
+ Config and auth files live under:
132
+
133
+ ```text
134
+ ~/.local/pajarori/farai/
135
+ ```
136
+
137
+ ## Status
138
+
139
+ Farai is under active development.
140
+
141
+ The current defensible claim is that Farai has substantial implementation validation and an evidence-oriented agent architecture. Stronger claims require clean benchmark campaigns, stronger isolation, canonical scoring, and larger empirical evaluations.
142
+
143
+ Early benchmark artifacts should be treated as exploratory unless the run artifact, oracle, isolation policy, model selection, and challenge materials are frozen and auditable.
144
+
145
+ ## License
146
+
147
+ Apache License 2.0