@lazyingart/agintiflow 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/AGENTS.md +41 -0
- package/LICENSE +201 -0
- package/README.md +294 -0
- package/bin/aginti-cli.js +7 -0
- package/docker/sandbox.Dockerfile +22 -0
- package/docs/npm-publishing.md +45 -0
- package/i18n/README.ar.md +51 -0
- package/i18n/README.de.md +51 -0
- package/i18n/README.es.md +51 -0
- package/i18n/README.fr.md +51 -0
- package/i18n/README.ja.md +51 -0
- package/i18n/README.ko.md +51 -0
- package/i18n/README.ru.md +51 -0
- package/i18n/README.vi.md +51 -0
- package/i18n/README.zh-Hans.md +51 -0
- package/i18n/README.zh-Hant.md +171 -0
- package/logos/banner-opaque.png +0 -0
- package/logos/logo.png +0 -0
- package/package.json +62 -0
- package/public/app.js +1060 -0
- package/public/index.html +198 -0
- package/public/styles.css +305 -0
- package/run.js +6 -0
- package/scripts/install-docker-ubuntu.sh +140 -0
- package/src/agent-runner.js +686 -0
- package/src/cli.js +181 -0
- package/src/command-policy.js +185 -0
- package/src/config.js +89 -0
- package/src/docker-sandbox.js +309 -0
- package/src/guardrails.js +122 -0
- package/src/model-client.js +212 -0
- package/src/model-routing.js +135 -0
- package/src/redaction.js +29 -0
- package/src/session-store.js +73 -0
- package/src/snapshot.js +55 -0
- package/src/tool-wrappers.js +193 -0
- package/src/web-db.js +158 -0
- package/web.js +530 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure & Module Organization
|
|
4
|
+
|
|
5
|
+
`run.js` is the legacy CLI entrypoint, `bin/aginti-cli.js` is the packaged CLI, and `web.js` serves the local UI. Core runtime logic lives in `src/`: `agent-runner.js` orchestrates the loop, `model-client.js` defines model/tool interactions, `model-routing.js` owns routing presets, `tool-wrappers.js` owns external agent wrapper contracts, `guardrails.js` enforces safety checks, `snapshot.js` captures browser state, and `session-store.js` persists runs under `.sessions/`. Frontend assets for the local UI live in `public/` (`index.html`, `app.js`, `styles.css`).
|
|
6
|
+
|
|
7
|
+
## Build, Test, and Development Commands
|
|
8
|
+
|
|
9
|
+
- `npm install`: install dependencies.
|
|
10
|
+
- `npx playwright install chromium`: install the browser runtime used by Playwright.
|
|
11
|
+
- `npm start -- "your task"`: run the CLI agent.
|
|
12
|
+
- `npx aginti-cli --list-routes`: inspect routing presets.
|
|
13
|
+
- `npx aginti-cli --list-wrappers`: inspect installed wrapper availability.
|
|
14
|
+
- `npx aginti-cli --sandbox-status --sandbox-mode docker-readonly`: inspect Docker sandbox readiness.
|
|
15
|
+
- `npx aginti-cli --sandbox-preflight --sandbox-mode docker-readonly`: run safe Docker dependency checks.
|
|
16
|
+
- `npm run web`: start the local web UI on `http://127.0.0.1:3210`.
|
|
17
|
+
- `npm run check`: run syntax checks for `run.js`, `web.js`, and all files in `src/`.
|
|
18
|
+
- `npm pack --dry-run`: inspect npm package contents before release.
|
|
19
|
+
|
|
20
|
+
Use `AGENT_PROVIDER=openai` or `AGENT_PROVIDER=deepseek` when running locally.
|
|
21
|
+
|
|
22
|
+
## Coding Style & Naming Conventions
|
|
23
|
+
|
|
24
|
+
Use ES modules, 2-space indentation, and semicolons, matching the existing JavaScript files. Prefer small single-purpose modules in `src/`. Use kebab-free lowercase filenames such as `session-store.js` and descriptive function names such as `resolveRuntimeConfig` or `captureSnapshot`. Keep browser and shell guardrails explicit rather than clever.
|
|
25
|
+
|
|
26
|
+
## Testing Guidelines
|
|
27
|
+
|
|
28
|
+
There is no full automated test suite yet. Treat `npm run check` as the minimum required gate before committing. For behavior changes, do one manual smoke test through either the CLI or the web UI. If you add tests later, place them in a dedicated `test/` directory and name them after the module under test, for example `guardrails.test.js`.
|
|
29
|
+
|
|
30
|
+
## Commit & Pull Request Guidelines
|
|
31
|
+
|
|
32
|
+
Commit messages in this repo currently follow short imperative style, for example `Make browser startup lazy and shell-first`. Keep commits focused and explain user-visible behavior changes in the body when needed. Pull requests should include:
|
|
33
|
+
|
|
34
|
+
- a short summary of what changed
|
|
35
|
+
- any environment or model assumptions
|
|
36
|
+
- screenshots for `public/` or `web.js` UI changes
|
|
37
|
+
- a brief manual test note, such as `npm run check` and one sample prompt
|
|
38
|
+
|
|
39
|
+
## Security & Configuration Tips
|
|
40
|
+
|
|
41
|
+
Never hard-code API keys. Use environment variables like `OPENAI_API_KEY` and `DEEPSEEK_API_KEY`. Do not expose provider defaults that include API keys through web APIs. Keep wrapper tools advisory and opt-in; do not remove read-only/planning defaults without documenting the risk. Keep npm publish and token commands blocked inside agent runs. Prefer Trusted Publishing through `.github/workflows/npm-publish.yml`; local npm tokens may only live in ignored `.env` or `.npmrc` files and must never be printed or committed. Package installs or venv/conda/npm setup must require the package policy and Docker workspace-write mode. Do not weaken guardrails in `src/guardrails.js` or `src/command-policy.js` without documenting why. Do not commit `.sessions/` artifacts.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
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,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising 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
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 AgInTi and AgInTiFlow contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
[English](README.md) · [العربية](i18n/README.ar.md) · [Español](i18n/README.es.md) · [Français](i18n/README.fr.md) · [日本語](i18n/README.ja.md) · [한국어](i18n/README.ko.md) · [Tiếng Việt](i18n/README.vi.md) · [中文 (简体)](i18n/README.zh-Hans.md) · [中文(繁體)](i18n/README.zh-Hant.md) · [Deutsch](i18n/README.de.md) · [Русский](i18n/README.ru.md)
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/lachlanchen/lachlanchen/main/figs/banner.png" alt="Lachlan Chen banner" width="960" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="./logos/banner-opaque.png" alt="AgInTiFlow banner" width="960" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
# AgInTiFlow
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
AgInTiFlow is AgInTi's web-first agent platform for controlled website automation, persistent conversations, resumable runs, guarded local commands, and optional coding-agent wrappers.
|
|
21
|
+
|
|
22
|
+
It is designed for workflows where an AI agent should act, but every tool, log, and session state should remain inspectable.
|
|
23
|
+
|
|
24
|
+
## Product Snapshot
|
|
25
|
+
|
|
26
|
+
| Area | Direction |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| Core loop | Plan -> use tools -> log events -> finish or resume |
|
|
29
|
+
| Browser control | Playwright, lazy browser startup, domain allowlists |
|
|
30
|
+
| Model layer | Smart routing over DeepSeek fast/pro presets with manual OpenAI-compatible fallback |
|
|
31
|
+
| Local tools | Optional guarded shell commands, Docker sandbox support, and advisory agent wrappers |
|
|
32
|
+
| Memory | Session state, persisted web settings, chat continuation |
|
|
33
|
+
| Operator UX | Multilingual web UI with provider selection, run output, and conversation history |
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
Install the published CLI:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install -g @lazyingart/agintiflow
|
|
41
|
+
aginti --list-routes
|
|
42
|
+
aginti --sandbox-status --sandbox-mode docker-readonly --cwd "$PWD"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Launch the local web UI from an installed package:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
aginti-cli --routing smart --allow-shell "List this folder"
|
|
49
|
+
aginti --sandbox-preflight --sandbox-mode docker-readonly --cwd "$PWD"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Run from a source checkout:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cd /home/lachlan/ProjectsLFS/Agent/AgInTiFlow
|
|
56
|
+
npm install
|
|
57
|
+
npx playwright install chromium
|
|
58
|
+
npm run web
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Open `http://127.0.0.1:3210`.
|
|
62
|
+
|
|
63
|
+
Run a CLI task:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
AGENT_PROVIDER=deepseek npm start -- "List this folder and summarize what each project is for"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Use the dedicated CLI entrypoint:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx aginti-cli --routing smart --allow-shell "List this folder"
|
|
73
|
+
npx aginti-cli --list-routes
|
|
74
|
+
npx aginti-cli --list-wrappers
|
|
75
|
+
npx aginti-cli --sandbox-status --sandbox-mode docker-readonly --cwd /home/lachlan/ProjectsLFS/Agent/AgInTiFlow
|
|
76
|
+
npx aginti-cli --sandbox-preflight --sandbox-mode docker-readonly --cwd /home/lachlan/ProjectsLFS/Agent/AgInTiFlow
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Start from a URL:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm start -- --start-url https://news.ycombinator.com "Summarize this page"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Resume a run:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm start -- --resume your-session-id
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The package exposes both `aginti` and `aginti-cli`; they run the same CLI entrypoint.
|
|
92
|
+
|
|
93
|
+
## Web UI
|
|
94
|
+
|
|
95
|
+
The web app includes:
|
|
96
|
+
|
|
97
|
+
- Routing dropdown for smart, fast, complex, and manual model selection.
|
|
98
|
+
- Provider dropdown for OpenAI and DeepSeek when manual routing is needed.
|
|
99
|
+
- Language dropdown with 11 persisted UI locales.
|
|
100
|
+
- Editable model field, with DeepSeek v4 flash as the fast default and DeepSeek v4 pro as the complex route.
|
|
101
|
+
- Goal, start URL, allowed domains, working directory, and max-step controls.
|
|
102
|
+
- Sandbox mode, Docker image/status, package-install approval state, and recent sandbox logs.
|
|
103
|
+
- Toggleable shell tool, agent wrappers, headless browser, password typing, and destructive actions.
|
|
104
|
+
- Live run logs above a persistent conversation panel.
|
|
105
|
+
|
|
106
|
+
`Start URL` is only a suggestion. The browser opens only when the model chooses a browser tool.
|
|
107
|
+
|
|
108
|
+
## Safety Model
|
|
109
|
+
|
|
110
|
+
AgInTiFlow is intentionally conservative:
|
|
111
|
+
|
|
112
|
+
- Password typing is blocked unless explicitly enabled.
|
|
113
|
+
- Destructive browser actions are blocked unless explicitly enabled.
|
|
114
|
+
- Shell commands are disabled unless the shell tool is enabled.
|
|
115
|
+
- Guarded shell mode only allows inspection, test/build checks, and approved setup commands.
|
|
116
|
+
- Docker read-only mode mounts the workspace read-only and disables container network access.
|
|
117
|
+
- Docker workspace-write mode is required for approved package or environment setup.
|
|
118
|
+
- Package installs default to `prompt`, so npm/pip/conda/venv setup is blocked until explicitly approved.
|
|
119
|
+
- NPM publishing, npm token commands, sudo, destructive git actions, curl/wget, and shell chaining are blocked.
|
|
120
|
+
- NPM tokens and API keys are redacted from tool logs and API responses.
|
|
121
|
+
- Every tool request and result is written to structured logs.
|
|
122
|
+
|
|
123
|
+
## Configuration
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
AGENT_PROVIDER=deepseek
|
|
127
|
+
LLM_MODEL=deepseek-chat
|
|
128
|
+
OPENAI_API_KEY=...
|
|
129
|
+
DEEPSEEK_API_KEY=...
|
|
130
|
+
MAX_STEPS=15
|
|
131
|
+
HEADLESS=true
|
|
132
|
+
ALLOWED_DOMAINS=news.ycombinator.com,github.com
|
|
133
|
+
ALLOW_SHELL_TOOL=false
|
|
134
|
+
SANDBOX_MODE=docker-readonly
|
|
135
|
+
PACKAGE_INSTALL_POLICY=prompt
|
|
136
|
+
USE_DOCKER_SANDBOX=true
|
|
137
|
+
DOCKER_SANDBOX_IMAGE=agintiflow-sandbox:latest
|
|
138
|
+
COMMAND_CWD=/home/lachlan/ProjectsLFS/Agent
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Defaults:
|
|
142
|
+
|
|
143
|
+
| Route | Provider | Default model | Override |
|
|
144
|
+
| --- | --- | --- | --- |
|
|
145
|
+
| `smart` | DeepSeek | Fast for normal tasks, pro for complex tasks | `AGENT_ROUTING_MODE=smart` |
|
|
146
|
+
| `fast` | DeepSeek | `deepseek-v4-flash` | `DEEPSEEK_FAST_MODEL` |
|
|
147
|
+
| `complex` | DeepSeek | `deepseek-v4-pro` | `DEEPSEEK_PRO_MODEL` |
|
|
148
|
+
| `manual` | DeepSeek/OpenAI | user supplied | `AGENT_PROVIDER`, `LLM_MODEL` |
|
|
149
|
+
|
|
150
|
+
Provider credentials:
|
|
151
|
+
|
|
152
|
+
| Provider | API key | Base URL |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| OpenAI | `OPENAI_API_KEY` | `https://api.openai.com/v1` |
|
|
155
|
+
| DeepSeek | `DEEPSEEK_API_KEY` | `https://api.deepseek.com/v1` |
|
|
156
|
+
|
|
157
|
+
## Agent Wrappers
|
|
158
|
+
|
|
159
|
+
AgInTiFlow can expose external coding agents as advisory tools when `ALLOW_WRAPPER_TOOLS=true` or the web UI toggle is enabled. Wrappers are not a replacement for the core runner; they are used for second opinions, codebase analysis, or planning when they are installed and authenticated.
|
|
160
|
+
|
|
161
|
+
Current wrappers:
|
|
162
|
+
|
|
163
|
+
| Wrapper | Command | Safety mode |
|
|
164
|
+
| --- | --- | --- |
|
|
165
|
+
| Codex | `codex exec` | read-only sandbox, primary `gpt-5.5` medium, spare `gpt-5.4-mini` high |
|
|
166
|
+
| Claude Code | `claude --print` | plan permission mode |
|
|
167
|
+
| Gemini CLI | `gemini` | advisory prompt |
|
|
168
|
+
| GitHub Copilot CLI | `gh copilot` | advisory prompt |
|
|
169
|
+
| Qwen Code | `qwen` | plan approval mode |
|
|
170
|
+
|
|
171
|
+
Wrapper prompts are capped and filtered for destructive intent unless destructive actions are explicitly enabled.
|
|
172
|
+
|
|
173
|
+
## npm Release Safety
|
|
174
|
+
|
|
175
|
+
AgInTiFlow is published as `@lazyingart/agintiflow`.
|
|
176
|
+
|
|
177
|
+
Preferred release path:
|
|
178
|
+
|
|
179
|
+
1. Bump `package.json` version.
|
|
180
|
+
2. Run `npm test` and `npm pack --dry-run`.
|
|
181
|
+
3. Create a GitHub Release or run `.github/workflows/npm-publish.yml` manually.
|
|
182
|
+
4. Let npm Trusted Publishing use GitHub Actions OIDC and `npm publish --access public --provenance`.
|
|
183
|
+
|
|
184
|
+
Trusted Publishing setup on npm:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm install -g npm@^11.5.1
|
|
188
|
+
npm trust github @lazyingart/agintiflow --repo lazyingart/AgInTiFlow --file npm-publish.yml
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The npm trust command may require the package to exist first and may require an OTP in the browser/account flow. Do not commit `.npmrc`, `.env`, npm tokens, OTPs, or npm debug logs.
|
|
192
|
+
|
|
193
|
+
Local token fallback is only for bootstrapping when Trusted Publishing cannot be used:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
cp .env.example .env
|
|
197
|
+
# Put NPM_TOKEN or NODE_AUTH_TOKEN in .env locally only.
|
|
198
|
+
set -a && source .env && set +a
|
|
199
|
+
npm publish --access public
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Never publish with `npm publish` from inside an agent run. The runtime command policy blocks npm publish and npm token commands by design.
|
|
203
|
+
|
|
204
|
+
## Docker Bootstrap
|
|
205
|
+
|
|
206
|
+
Ubuntu helper:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
./scripts/install-docker-ubuntu.sh
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
If running as `root` and configuring Docker for a regular user:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
DOCKER_TARGET_USER=lachlan ./scripts/install-docker-ubuntu.sh
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Open a new login shell, or run `newgrp docker`, before testing non-root Docker access.
|
|
219
|
+
|
|
220
|
+
## Sandbox Modes
|
|
221
|
+
|
|
222
|
+
| Mode | Workspace mount | Network | Intended use |
|
|
223
|
+
| --- | --- | --- | --- |
|
|
224
|
+
| `host` | local process | host network | legacy read-only inspection only |
|
|
225
|
+
| `docker-readonly` | read-only `/workspace` | none | default safe coding inspection and tests |
|
|
226
|
+
| `docker-workspace` | writable `/workspace` | none by default, enabled only for approved package installs | environment setup inside the mounted project |
|
|
227
|
+
|
|
228
|
+
Package policy values:
|
|
229
|
+
|
|
230
|
+
| Policy | Behavior |
|
|
231
|
+
| --- | --- |
|
|
232
|
+
| `block` | Always block npm/pip/conda/venv setup. |
|
|
233
|
+
| `prompt` | Return a clear approval-required error; the UI can switch to approved. |
|
|
234
|
+
| `allow` | Permit allowlisted setup commands only in `docker-workspace`. |
|
|
235
|
+
|
|
236
|
+
Safe preflight endpoints:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
curl http://127.0.0.1:3210/api/sandbox/status
|
|
240
|
+
curl -X POST http://127.0.0.1:3210/api/sandbox/preflight \
|
|
241
|
+
-H 'Content-Type: application/json' \
|
|
242
|
+
-d '{"sandboxMode":"docker-readonly","buildImage":true}'
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
These endpoints report Docker/image/workspace readiness and recent sandbox logs without returning API keys or npm tokens.
|
|
246
|
+
|
|
247
|
+
## Runtime Artifacts
|
|
248
|
+
|
|
249
|
+
Each run stores state under `.sessions/<session-id>/`:
|
|
250
|
+
|
|
251
|
+
| File | Purpose |
|
|
252
|
+
| --- | --- |
|
|
253
|
+
| `state.json` | Resumable model and tool state |
|
|
254
|
+
| `plan.md` | Execution plan |
|
|
255
|
+
| `events.jsonl` | Structured event log |
|
|
256
|
+
| `storage-state.json` | Browser session persistence |
|
|
257
|
+
| `artifacts/step-XXX.png` | Screenshots |
|
|
258
|
+
| `artifacts/step-XXX.snapshot.json` | DOM snapshots |
|
|
259
|
+
|
|
260
|
+
## Project Structure
|
|
261
|
+
|
|
262
|
+
```text
|
|
263
|
+
AgInTiFlow/
|
|
264
|
+
├── public/ # Web UI
|
|
265
|
+
├── src/ # Agent runtime, tools, guardrails, storage
|
|
266
|
+
├── docker/ # Shell sandbox image
|
|
267
|
+
├── scripts/ # Docker bootstrap helper
|
|
268
|
+
├── bin/ # aginti/aginti-cli entrypoint
|
|
269
|
+
├── logos/ # Brand assets and crop notes
|
|
270
|
+
├── references/ # Design philosophy and research notes
|
|
271
|
+
├── tools/ # Reusable project documentation helpers
|
|
272
|
+
├── run.js # CLI entrypoint
|
|
273
|
+
└── web.js # Express web server
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Development
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
npm run check
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The check validates JavaScript syntax for the CLI, web server, and runtime modules.
|
|
283
|
+
|
|
284
|
+
## Prompt Tools
|
|
285
|
+
|
|
286
|
+
This repo includes small prompt helpers for repeatable documentation and i18n work:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
node tools/readme_prompt_tool.js agintiflow
|
|
290
|
+
node tools/readme_prompt_tool.js aginti-landing
|
|
291
|
+
node tools/webapp_i18n_prompt_tool.js
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
The README helper captures the documentation style used here: concise overview, full language links, product signals, quick start, safety notes, and localized README targets. The webapp i18n helper captures the full UI translation key contract for future language backfills.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
FROM ubuntu:24.04
|
|
2
|
+
|
|
3
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
4
|
+
|
|
5
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
6
|
+
bash \
|
|
7
|
+
ca-certificates \
|
|
8
|
+
curl \
|
|
9
|
+
findutils \
|
|
10
|
+
gawk \
|
|
11
|
+
git \
|
|
12
|
+
grep \
|
|
13
|
+
npm \
|
|
14
|
+
nodejs \
|
|
15
|
+
python3-pip \
|
|
16
|
+
python3-venv \
|
|
17
|
+
python3 \
|
|
18
|
+
ripgrep \
|
|
19
|
+
sed \
|
|
20
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
21
|
+
|
|
22
|
+
WORKDIR /workspace
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# npm Publishing
|
|
2
|
+
|
|
3
|
+
AgInTiFlow is published on npm as `@lazyingart/agintiflow`.
|
|
4
|
+
|
|
5
|
+
## Trusted Publishing
|
|
6
|
+
|
|
7
|
+
Use GitHub Actions Trusted Publishing for normal releases. The workflow is `.github/workflows/npm-publish.yml` and publishes with provenance using OIDC.
|
|
8
|
+
|
|
9
|
+
Trusted Publisher settings on npm:
|
|
10
|
+
|
|
11
|
+
- Package: `@lazyingart/agintiflow`
|
|
12
|
+
- Publisher: GitHub Actions
|
|
13
|
+
- Repository: `lazyingart/AgInTiFlow`
|
|
14
|
+
- Workflow filename: `npm-publish.yml`
|
|
15
|
+
- Environment: blank, unless a GitHub deployment environment is added later
|
|
16
|
+
|
|
17
|
+
Equivalent setup command:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g npm@^11.5.1
|
|
21
|
+
npm trust github @lazyingart/agintiflow --repo lazyingart/AgInTiFlow --file npm-publish.yml
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The npm trust setup may require the package to exist before trust can be attached. If npm asks for an OTP or browser confirmation, stop and complete that step outside the agent.
|
|
25
|
+
|
|
26
|
+
## Release Flow
|
|
27
|
+
|
|
28
|
+
1. Update `package.json` version.
|
|
29
|
+
2. Run `npm test`.
|
|
30
|
+
3. Run `npm pack --dry-run` and inspect the tarball contents.
|
|
31
|
+
4. Push the release commit and create a GitHub Release, or run the publish workflow manually.
|
|
32
|
+
5. Confirm the npm package page shows provenance.
|
|
33
|
+
|
|
34
|
+
## Local Token Fallback
|
|
35
|
+
|
|
36
|
+
Trusted Publishing is preferred. A local automation token can be used only for bootstrap or emergency fallback:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cp .env.example .env
|
|
40
|
+
# Add NPM_TOKEN or NODE_AUTH_TOKEN locally only.
|
|
41
|
+
set -a && source .env && set +a
|
|
42
|
+
npm publish --access public
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Never commit `.env`, `.npmrc`, npm tokens, OTPs, npm debug logs, or generated credential material. The runtime command policy intentionally blocks npm publish and npm token commands during agent runs.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[English](../README.md) · [العربية](README.ar.md) · [Español](README.es.md) · [Français](README.fr.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Tiếng Việt](README.vi.md) · [中文 (简体)](README.zh-Hans.md) · [中文(繁體)](README.zh-Hant.md) · [Deutsch](README.de.md) · [Русский](README.ru.md)
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/lachlanchen/lachlanchen/main/figs/banner.png" alt="Lachlan Chen banner" width="960" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="../logos/banner-opaque.png" alt="AgInTiFlow banner" width="960" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
# AgInTiFlow
|
|
12
|
+
|
|
13
|
+
AgInTiFlow هو وكيل من AgInTi للتحكم المنضبط في المتصفح والأدوات المحلية: أتمتة الويب، محادثات مستمرة، تشغيل قابل للاستئناف، وأوامر محلية محمية.
|
|
14
|
+
|
|
15
|
+
## لمحة
|
|
16
|
+
|
|
17
|
+
| المجال | الاتجاه |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| الحلقة الأساسية | تخطيط -> استخدام أدوات -> تسجيل أحداث -> إنهاء أو استئناف |
|
|
20
|
+
| المتصفح | Playwright، تشغيل عند الحاجة، قائمة سماح للنطاقات |
|
|
21
|
+
| النماذج | Tool calling متوافق مع OpenAI مع إعدادات OpenAI و DeepSeek |
|
|
22
|
+
| الأدوات المحلية | Shell اختياري مع guardrails و Docker sandbox |
|
|
23
|
+
| الذاكرة | حالة الجلسة، إعدادات محفوظة، ومتابعة المحادثة |
|
|
24
|
+
|
|
25
|
+
## تشغيل سريع
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd /home/lachlan/ProjectsLFS/Agent/AgInTiFlow
|
|
29
|
+
npm install
|
|
30
|
+
npx playwright install chromium
|
|
31
|
+
npm run web
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
افتح `http://127.0.0.1:3210`.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
AGENT_PROVIDER=deepseek npm start -- "List this folder"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## الأمان
|
|
41
|
+
|
|
42
|
+
- كلمات المرور والإجراءات التخريبية محجوبة ما لم يتم تفعيلها صراحة.
|
|
43
|
+
- shell اختياري ويمكن تشغيله داخل Docker بلا شبكة.
|
|
44
|
+
- كل طلب أداة ونتيجته يتم تسجيلهما في `.sessions/`.
|
|
45
|
+
|
|
46
|
+
## التطوير
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm run check
|
|
50
|
+
node tools/readme_prompt_tool.js agintiflow
|
|
51
|
+
```
|