@lazyingart/agintiflow 0.1.0 → 0.2.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 CHANGED
@@ -14,10 +14,13 @@
14
14
  - `npx aginti-cli --sandbox-status --sandbox-mode docker-readonly`: inspect Docker sandbox readiness.
15
15
  - `npx aginti-cli --sandbox-preflight --sandbox-mode docker-readonly`: run safe Docker dependency checks.
16
16
  - `npm run web`: start the local web UI on `http://127.0.0.1:3210`.
17
+ - `npx aginti-cli web --port 3210`: start the packaged web UI path.
17
18
  - `npm run check`: run syntax checks for `run.js`, `web.js`, and all files in `src/`.
19
+ - `npm run smoke:web-api`: start a temporary web server and verify config, sandbox, mock run, and persisted chat APIs without live model credentials.
20
+ - `npm run smoke:coding-tools`: verify mock workspace writes, patches, and path guardrail blocks.
18
21
  - `npm pack --dry-run`: inspect npm package contents before release.
19
22
 
20
- Use `AGENT_PROVIDER=openai` or `AGENT_PROVIDER=deepseek` when running locally.
23
+ Use `AGENT_PROVIDER=openai`, `AGENT_PROVIDER=deepseek`, or `AGENT_PROVIDER=mock` when running locally.
21
24
 
22
25
  ## Coding Style & Naming Conventions
23
26
 
@@ -25,7 +28,7 @@ Use ES modules, 2-space indentation, and semicolons, matching the existing JavaS
25
28
 
26
29
  ## Testing Guidelines
27
30
 
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`.
31
+ There is no full automated test suite yet. Treat `npm run check`, `npm run smoke:web-api`, and `npm run smoke:coding-tools` 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
32
 
30
33
  ## Commit & Pull Request Guidelines
31
34
 
@@ -38,4 +41,4 @@ Commit messages in this repo currently follow short imperative style, for exampl
38
41
 
39
42
  ## Security & Configuration Tips
40
43
 
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.
44
+ 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. Workspace file tools must stay inside `commandCwd`, block secret-like paths, and preserve before/after hash provenance for writes. 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`, `src/workspace-tools.js`, or `src/command-policy.js` without documenting why. Do not commit `.sessions/` artifacts.
package/README.md CHANGED
@@ -28,7 +28,7 @@ It is designed for workflows where an AI agent should act, but every tool, log,
28
28
  | Core loop | Plan -> use tools -> log events -> finish or resume |
29
29
  | Browser control | Playwright, lazy browser startup, domain allowlists |
30
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 |
31
+ | Local tools | Guarded workspace file tools, optional shell commands, Docker sandbox support, and advisory agent wrappers |
32
32
  | Memory | Session state, persisted web settings, chat continuation |
33
33
  | Operator UX | Multilingual web UI with provider selection, run output, and conversation history |
34
34
 
@@ -45,8 +45,14 @@ aginti --sandbox-status --sandbox-mode docker-readonly --cwd "$PWD"
45
45
  Launch the local web UI from an installed package:
46
46
 
47
47
  ```bash
48
- aginti-cli --routing smart --allow-shell "List this folder"
49
- aginti --sandbox-preflight --sandbox-mode docker-readonly --cwd "$PWD"
48
+ aginti web --port 3210
49
+ # then open http://127.0.0.1:3210
50
+ ```
51
+
52
+ Run the installed CLI without a live provider key by using the local mock route:
53
+
54
+ ```bash
55
+ aginti --provider mock --routing manual --allow-shell --cwd "$PWD" "Report the current directory"
50
56
  ```
51
57
 
52
58
  Run from a source checkout:
@@ -73,7 +79,7 @@ npx aginti-cli --routing smart --allow-shell "List this folder"
73
79
  npx aginti-cli --list-routes
74
80
  npx aginti-cli --list-wrappers
75
81
  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
82
+ npx aginti-cli --sandbox-preflight --sandbox-mode docker-workspace --cwd /home/lachlan/ProjectsLFS/Agent/AgInTiFlow
77
83
  ```
78
84
 
79
85
  Start from a URL:
@@ -95,16 +101,32 @@ The package exposes both `aginti` and `aginti-cli`; they run the same CLI entryp
95
101
  The web app includes:
96
102
 
97
103
  - Routing dropdown for smart, fast, complex, and manual model selection.
98
- - Provider dropdown for OpenAI and DeepSeek when manual routing is needed.
104
+ - Provider dropdown for DeepSeek, OpenAI, and local mock mode when manual routing is needed.
99
105
  - Language dropdown with 11 persisted UI locales.
100
106
  - Editable model field, with DeepSeek v4 flash as the fast default and DeepSeek v4 pro as the complex route.
101
107
  - 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.
108
+ - Sandbox mode, Docker image/status, package-install approval state, safe setup warnings, and recent sandbox logs.
109
+ - Wrapper capability panel with an opt-in wrapper toggle and a preferred-wrapper selector defaulting to Codex.
110
+ - Workspace Files panel showing file tools, recent file changes, blocked write attempts, hashes, and compact diffs.
111
+ - Canvas & Artifacts modal with agent-selected renders, screenshot/file explorer, text/image preview, notifications, unread badge, select-to-read, and manual mark-seen.
103
112
  - Toggleable shell tool, agent wrappers, headless browser, password typing, and destructive actions.
104
- - Live run logs above a persistent conversation panel.
113
+ - Persistent conversation panel above compact runtime logs, so follow-up messages stay close to the top.
114
+ - Conversation manager modal for auto-renaming, manual renaming, and deleting saved chat history.
105
115
 
106
116
  `Start URL` is only a suggestion. The browser opens only when the model chooses a browser tool.
107
117
 
118
+ ## Website
119
+
120
+ In the source repository, the marketing website lives in `website/`, is published at `https://flow.lazying.art`, and is separate from the app UI in `public/`.
121
+
122
+ ```bash
123
+ python3 -m http.server 4310 --directory website
124
+ node scripts/capture-website-screenshots.js
125
+ ```
126
+
127
+ The screenshot script captures the live app at `http://127.0.0.1:3210/` by default and writes carousel assets to `website/assets/screenshots/`.
128
+ GitHub Pages deploys the `website/` directory through `.github/workflows/pages.yml`; `website/CNAME` sets the custom domain to `flow.lazying.art`.
129
+
108
130
  ## Safety Model
109
131
 
110
132
  AgInTiFlow is intentionally conservative:
@@ -112,8 +134,11 @@ AgInTiFlow is intentionally conservative:
112
134
  - Password typing is blocked unless explicitly enabled.
113
135
  - Destructive browser actions are blocked unless explicitly enabled.
114
136
  - Shell commands are disabled unless the shell tool is enabled.
137
+ - Workspace file tools stay inside `commandCwd` and block `.env`, secret-like paths, `.git`, node_modules writes, absolute escapes, binary files, and huge files.
138
+ - File writes record before/after SHA-256 hashes and compact redacted diffs.
115
139
  - Guarded shell mode only allows inspection, test/build checks, and approved setup commands.
116
140
  - Docker read-only mode mounts the workspace read-only and disables container network access.
141
+ - Docker workspace-write mode is the web UI default so plot, PDF, and test outputs can be written inside the mounted workspace.
117
142
  - Docker workspace-write mode is required for approved package or environment setup.
118
143
  - Package installs default to `prompt`, so npm/pip/conda/venv setup is blocked until explicitly approved.
119
144
  - NPM publishing, npm token commands, sudo, destructive git actions, curl/wget, and shell chaining are blocked.
@@ -130,8 +155,9 @@ DEEPSEEK_API_KEY=...
130
155
  MAX_STEPS=15
131
156
  HEADLESS=true
132
157
  ALLOWED_DOMAINS=news.ycombinator.com,github.com
133
- ALLOW_SHELL_TOOL=false
134
- SANDBOX_MODE=docker-readonly
158
+ ALLOW_SHELL_TOOL=true
159
+ ALLOW_FILE_TOOLS=true
160
+ SANDBOX_MODE=docker-workspace
135
161
  PACKAGE_INSTALL_POLICY=prompt
136
162
  USE_DOCKER_SANDBOX=true
137
163
  DOCKER_SANDBOX_IMAGE=agintiflow-sandbox:latest
@@ -156,7 +182,7 @@ Provider credentials:
156
182
 
157
183
  ## Agent Wrappers
158
184
 
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.
185
+ 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. The preferred wrapper defaults to Codex and can be changed with `PREFERRED_WRAPPER=codex`, `aginti --allow-wrappers --wrapper codex`, or the web UI dropdown.
160
186
 
161
187
  Current wrappers:
162
188
 
@@ -217,13 +243,22 @@ DOCKER_TARGET_USER=lachlan ./scripts/install-docker-ubuntu.sh
217
243
 
218
244
  Open a new login shell, or run `newgrp docker`, before testing non-root Docker access.
219
245
 
246
+ Build the companion agent toolchain sandbox:
247
+
248
+ ```bash
249
+ ./scripts/setup-agent-toolchain-docker.sh
250
+ npm run smoke:toolchain-docker
251
+ ```
252
+
253
+ The setup script idempotently builds `agintiflow-sandbox:latest` from `docker/sandbox.Dockerfile` and verifies Node, npm, Python, NumPy, Matplotlib, `latexmk`, and `pdflatex` inside Docker. The smoke script runs Python plot generation, LaTeX PDF compilation, and PDF artifact preview against the same workspace-mounted sandbox path used by the agent.
254
+
220
255
  ## Sandbox Modes
221
256
 
222
257
  | Mode | Workspace mount | Network | Intended use |
223
258
  | --- | --- | --- | --- |
224
259
  | `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 |
260
+ | `docker-readonly` | read-only `/workspace` | none | safe coding inspection and tests that do not write files |
261
+ | `docker-workspace` | writable `/workspace` | none by default, enabled only for approved package installs | web UI default for environment setup, plotting, and LaTeX/PDF compilation inside the mounted project |
227
262
 
228
263
  Package policy values:
229
264
 
@@ -233,16 +268,28 @@ Package policy values:
233
268
  | `prompt` | Return a clear approval-required error; the UI can switch to approved. |
234
269
  | `allow` | Permit allowlisted setup commands only in `docker-workspace`. |
235
270
 
271
+ Toolchain commands such as `python3 plot.py`, `latexmk -pdf paper.tex`, and `pdflatex -interaction=nonstopmode -halt-on-error paper.tex` are allowlisted only when the shell tool is enabled. In Docker mode they require `docker-workspace` because they write outputs back to `/workspace`. File and canvas tools accept both normal relative paths and Docker virtual paths like `/workspace/report.pdf`, while other absolute host paths remain blocked.
272
+
236
273
  Safe preflight endpoints:
237
274
 
238
275
  ```bash
239
276
  curl http://127.0.0.1:3210/api/sandbox/status
240
277
  curl -X POST http://127.0.0.1:3210/api/sandbox/preflight \
241
278
  -H 'Content-Type: application/json' \
242
- -d '{"sandboxMode":"docker-readonly","buildImage":true}'
279
+ -d '{"sandboxMode":"docker-workspace","buildImage":true}'
280
+ curl http://127.0.0.1:3210/api/workspace/changes
281
+ curl "http://127.0.0.1:3210/api/sessions/<session-id>/artifacts"
243
282
  ```
244
283
 
245
- These endpoints report Docker/image/workspace readiness and recent sandbox logs without returning API keys or npm tokens.
284
+ These endpoints report Docker/image/workspace readiness, recent sandbox logs, file-change provenance, and renderable artifact metadata without returning API keys or npm tokens. Artifact content is loaded on demand through guarded session/workspace reads.
285
+
286
+ Credential-free API smoke test:
287
+
288
+ ```bash
289
+ npm run smoke:web-api
290
+ ```
291
+
292
+ The smoke script starts the web server on a random localhost port, checks `/api/config`, `/api/sandbox/status`, `/api/sandbox/preflight`, runs mock agent tasks, verifies persisted chat history, and exercises the canvas/artifacts selection API.
246
293
 
247
294
  ## Runtime Artifacts
248
295
 
@@ -257,6 +304,8 @@ Each run stores state under `.sessions/<session-id>/`:
257
304
  | `artifacts/step-XXX.png` | Screenshots |
258
305
  | `artifacts/step-XXX.snapshot.json` | DOM snapshots |
259
306
 
307
+ The web UI derives the Canvas & Artifacts tunnel from `canvas.item`, `canvas.selected`, snapshot, file-change, and final-answer events. Models can call `send_to_canvas` to highlight a text block, diff, image, or workspace file; otherwise the user can manually select any derived artifact in the explorer.
308
+
260
309
  ## Project Structure
261
310
 
262
311
  ```text
@@ -269,6 +318,7 @@ AgInTiFlow/
269
318
  ├── logos/ # Brand assets and crop notes
270
319
  ├── references/ # Design philosophy and research notes
271
320
  ├── tools/ # Reusable project documentation helpers
321
+ ├── website/ # Static marketing site and screenshot carousel
272
322
  ├── run.js # CLI entrypoint
273
323
  └── web.js # Express web server
274
324
  ```
@@ -277,9 +327,12 @@ AgInTiFlow/
277
327
 
278
328
  ```bash
279
329
  npm run check
330
+ npm run smoke:web-api
331
+ npm run smoke:coding-tools
332
+ npm test
280
333
  ```
281
334
 
282
- The check validates JavaScript syntax for the CLI, web server, and runtime modules.
335
+ `npm run check` validates JavaScript syntax for the CLI, web server, and runtime modules. The smoke scripts use the local mock provider, so they do not require DeepSeek or OpenAI credentials.
283
336
 
284
337
  ## Prompt Tools
285
338
 
@@ -12,11 +12,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
12
12
  grep \
13
13
  npm \
14
14
  nodejs \
15
+ latexmk \
16
+ poppler-utils \
17
+ python3-matplotlib \
18
+ python3-numpy \
15
19
  python3-pip \
16
20
  python3-venv \
17
21
  python3 \
18
22
  ripgrep \
19
23
  sed \
24
+ texlive-fonts-recommended \
25
+ texlive-latex-base \
26
+ texlive-latex-extra \
27
+ texlive-latex-recommended \
20
28
  && rm -rf /var/lib/apt/lists/*
21
29
 
22
30
  WORKDIR /workspace
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a resumable Playwright website-control agent with OpenAI-compatible tool calling.",
6
6
  "license": "Apache-2.0",
7
- "homepage": "https://github.com/lazyingart/AgInTiFlow#readme",
7
+ "homepage": "https://flow.lazying.art",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/lazyingart/AgInTiFlow.git"
@@ -39,6 +39,10 @@
39
39
  "logos/logo.png",
40
40
  "public/",
41
41
  "scripts/install-docker-ubuntu.sh",
42
+ "scripts/setup-agent-toolchain-docker.sh",
43
+ "scripts/smoke-coding-tools.js",
44
+ "scripts/smoke-toolchain-docker.js",
45
+ "scripts/smoke-web-api.js",
42
46
  "src/",
43
47
  "run.js",
44
48
  "web.js"
@@ -51,7 +55,11 @@
51
55
  "start": "node run.js",
52
56
  "web": "node web.js",
53
57
  "check": "node --check run.js && node --check web.js && node --check bin/aginti-cli.js && node --check src/*.js",
54
- "test": "npm run check",
58
+ "setup:toolchain-docker": "scripts/setup-agent-toolchain-docker.sh",
59
+ "smoke:coding-tools": "node scripts/smoke-coding-tools.js",
60
+ "smoke:toolchain-docker": "node scripts/smoke-toolchain-docker.js",
61
+ "smoke:web-api": "node scripts/smoke-web-api.js",
62
+ "test": "npm run check && npm run smoke:web-api && npm run smoke:coding-tools",
55
63
  "pack:dry-run": "npm pack --dry-run"
56
64
  },
57
65
  "dependencies": {