agenttwin 0.2.2 → 0.3.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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # AgentTwin
2
2
 
3
- Discover a project's dependencies, then run an explicitly configured Node workflow in a fresh hosted sandbox with stateful service adapters, faults and final-state checks.
3
+ Discover a project's dependencies, then test an explicitly configured Node workflow through the CLI with stateful service adapters, faults and final-state checks.
4
4
 
5
- AgentTwin 0.2.0 executes application code in E2B. No local application containers are required. The E2B key belongs to the runtime operator; users of the hosted API receive separate revocable AgentTwin tokens.
5
+ The default runner executes reviewed bundled Node code on your computer, with fresh in-process HTTP twins. No VM or containers are needed. Select a cloud runner explicitly when a workflow needs one. The E2B key belongs to the runtime operator; users of the hosted API receive separate revocable AgentTwin tokens.
6
6
 
7
7
  ## Install and discover
8
8
 
@@ -15,20 +15,29 @@ npx agenttwin example --out ./agenttwin-example
15
15
 
16
16
  `init` writes the inventory, workflow candidates, `agenttwin.config.json`, `ENVIRONMENT.md`, `REPLICATION.md`, and an offline browser report. Discovery is evidence, not an automatically executable environment. It never uploads source. `init --json --dry-run` writes nothing.
17
17
 
18
- ## Run through an AgentTwin API
18
+ ## Test through the CLI
19
+
20
+ ```sh
21
+ npx agenttwin run --file path/to/agenttwin.world.json
22
+ npx agenttwin sync
23
+ ```
24
+
25
+ Run from your original repository so receipts stay in its `.agenttwin/runs/` directory. Local execution currently supports bundled Node workflows with HTTP collections and bounded Slack operations. It stages the listed files, passes only generated twin credentials, and records assertions, faults, events and Git metadata. It is a process on your computer, not a filesystem or network isolation boundary. PostgreSQL/Redis worlds require explicit cloud execution. Review recorded output and synthetic state before syncing.
26
+
27
+ ## Optional cloud execution through an AgentTwin API
19
28
 
20
29
  Your operator supplies the API URL and your individual token:
21
30
 
22
31
  ```sh
23
32
  export AGENTTWIN_API_URL=https://your-agenttwin-api.example.com
24
33
  export AGENTTWIN_TOKEN=your_individual_token
25
- npx agenttwin run --file agenttwin-example/agenttwin.world.json
26
- npx agenttwin run --file agenttwin-example/safe.world.json
34
+ npx agenttwin run --runtime hosted --file agenttwin-example/agenttwin.world.json
35
+ npx agenttwin run --runtime hosted --file agenttwin-example/safe.world.json
27
36
  ```
28
37
 
29
38
  The first run should fail: a write commits but its response is delayed, and an unsafe retry creates two tickets. The safe version reuses an idempotency key and passes. Both execute real application code against a custom ticket API and a bounded Slack adapter. Every run starts from fresh seeds and credentials, then deletes its sandbox. These are examples you can replace, not a refund-specific product.
30
39
 
31
- `run --json` emits a receipt with source/spec hashes, application output, ordered service events, initial/final service state, assertions, fault activation and sandbox metadata. Evidence stays in `.agenttwin/runs/`. Exit codes: 0 passed; 1 failed/error; 2 incomplete/blocked; 3 invalid input. An unsupported adapter operation or an untriggered requested fault makes the run incomplete.
40
+ `run --json` emits a receipt with source/spec hashes, application output, ordered service events, initial/final service state, assertions, fault activation, runner details and Git metadata when available. Evidence stays in `.agenttwin/runs/`. Exit codes: 0 passed; 1 failed/error; 2 incomplete/blocked; 3 invalid input. An unsupported adapter operation or an untriggered requested fault makes the run incomplete.
32
41
 
33
42
  ## Use your own E2B account
34
43
 
@@ -42,7 +51,7 @@ npx agenttwin run --runtime e2b --file agenttwin-example/safe.world.json
42
51
 
43
52
  ## Run your code
44
53
 
45
- Edit a world JSON file, listing only the built application files to upload. Bundle npm dependencies before the run; the sandbox has no outbound internet and performs no npm install. `command` is an argv array starting with `node`; the app runs as uid 1000. A world file resolves its application files relative to its own directory. Optional `workflowId` links to a workflow in the current discovery inventory.
54
+ Edit a world JSON file, listing only the built application files to upload. Bundle npm dependencies before the run. Cloud sandboxes have no outbound internet and perform no npm install; local runs use the host network. `command` is an argv array starting with `node`; cloud apps run as uid 1000. A world file resolves its application files relative to its own directory. Optional `workflowId` links to a workflow in the current discovery inventory.
46
55
 
47
56
  Use the generated `AGENTTWIN_<SERVICE>_URL` and `AGENTTWIN_<SERVICE>_TOKEN` values to configure your test clients. Production accounts, OAuth sessions, `.env` files and host credentials are not copied. Tokens and service state are fresh per run. Source files may contain hardcoded secrets; review the explicit upload list and bundle before uploading it.
48
57
 
@@ -50,19 +59,19 @@ Supported now:
50
59
 
51
60
  - Generic JSON collections: GET/list, POST/create, seed records, bearer authentication and same-key idempotency replay/conflict. This is a custom API contract, not a CRM vendor clone.
52
61
  - Slack subset: `chat.postMessage` with channel/text, `conversations.list` without parameters, `conversations.history` with channel. JSON and form POSTs are supported; reads also accept GET. Unknown methods or parameters fail visibly. OAuth, pagination, threads, files and complete SDK/provider parity are not supported.
53
- - Real PostgreSQL 15: optional seed SQL, generated `DATABASE_URL`, read-only SELECT final-state assertions.
54
- - Real Redis: generated `REDIS_URL`/`REDISCLI_AUTH`, string-key final-state assertions.
62
+ - Cloud runner: real PostgreSQL 15: optional seed SQL, generated `DATABASE_URL`, read-only SELECT final-state assertions.
63
+ - Cloud runner: real Redis: generated `REDIS_URL`/`REDISCLI_AUTH`, string-key final-state assertions.
55
64
  - One fault: a committed HTTP write followed by a delayed response. State count/filter assertions, DB rows and Redis values can verify side effects.
56
65
 
57
66
  There is no automatic cloning of arbitrary software, provider account provisioning, complete vendor catalog, browser workflow runtime, coordinated snapshots, replay of LLM responses or automatic regression-code generation. Receipts verify the configured assertions, not complete production equivalence or adversarial program correctness.
58
67
 
59
68
  ## Discovery and reports
60
69
 
61
- `discover`, `decide`, `plan`, `status`, `inspect`, `grant`, `schema`, `export`, `report`, and `feedback` remain available. `--json` sends results to stdout and logs to stderr. Discovery inspects files and bounded commands; remote reads require scoped grants. `--probe` explicitly requests provider reads. Local application observation and the legacy refund `demo/trial/check/reset` commands are retired in the public CLI; use hosted `run` instead. Development unit tests still exercise adapter code locally.
70
+ `discover`, `decide`, `plan`, `status`, `inspect`, `grant`, `schema`, `export`, `report`, and `feedback` remain available. `--json` sends results to stdout and logs to stderr. Discovery inspects files and bounded commands; remote reads require scoped grants. `--probe` explicitly requests provider reads. Local application observation and the legacy refund `demo/trial/check/reset` commands are retired in the public CLI; use `run` instead. Development unit tests still exercise adapter code locally.
62
71
 
63
72
  ## Operate the API
64
73
 
65
- The package includes `dist/gateway.js`. Deploy it on a server with Node 22+, HTTPS ingress and persistent disk. See the repository's `docs/HOSTED-RUNTIME.md` for deployment, accounts, limits and operational boundaries. The gateway is a control plane; applications execute in separate E2B sandboxes.
74
+ The package includes `dist/gateway.js`. Deploy it on a server with Node 22.12+, HTTPS ingress and persistent disk. See the repository's `docs/HOSTED-RUNTIME.md` for deployment, accounts, limits and operational boundaries. The gateway stores synced discovery and CLI results, serves chat, and can optionally dispatch cloud jobs. It starts without E2B credentials; cloud submissions then return a clear unavailable response. Applications submitted for cloud execution run in separate E2B sandboxes.
66
75
 
67
76
  MIT license.
68
77
 
@@ -70,11 +79,11 @@ MIT license.
70
79
 
71
80
  `agenttwin init --yes` detects project dependencies, tooling and available connector configuration, then writes `.agenttwin/dashboard/index.html`. Open that file to review the detected environment without selecting every connector or uploading inventory. The dashboard includes its assets and an allowlisted discovery payload; account records, credential values and evidence paths are excluded. It starts with no saved run receipts. Detection does not verify provider access or implement an adapter.
72
81
 
73
- For this repository’s website preview (`python3 serve.py 4173`), the dashboard automatically loads the latest handoff from init every five seconds while visible. Other projects use their generated dashboard or the manual discovery import. No inventory is uploaded to a hosted website automatically. Removed detected resources stay excluded until a fresh init scan.
82
+ The website starts empty and does not import this repository’s inventory automatically. Connect your individual API account in Settings and run `npx agenttwin sync` with `AGENTTWIN_TOKEN` configured, or import discovery JSON manually. Removed detected resources stay excluded until a fresh discovery revision. The generated project dashboard loads its own embedded discovery.
74
83
 
75
84
  ## Prepare an actual discovered workflow
76
85
 
77
- After `init`, select a candidate from `.agenttwin/inventory.json` or the dashboard's New world view. Write `preparation.json` beside your application files:
86
+ After `init`, select a candidate from `.agenttwin/inventory.json` or the dashboard's Workflows view. Write `preparation.json` beside your application files:
78
87
 
79
88
  ```json
80
89
  {
@@ -100,7 +109,7 @@ npx agenttwin prepare --file preparation.json --out .agenttwin/prepared/notifica
100
109
  npx agenttwin run --file .agenttwin/prepared/notification/agenttwin.world.json
101
110
  ```
102
111
 
103
- The output contains your unchanged source, a world spec, a SHA-256 manifest, and `agenttwin.bundle.json`. In Hosted runs, connect with an individual API token, choose that bundle, review the upload and execute. Jobs can be refreshed, cancelled and inspected. Tokens stay in page memory. Discovery imports remain in the browser; executing uploads the explicit bundle to the API.
112
+ The output contains your unchanged source, a world spec, a SHA-256 manifest, and `agenttwin.bundle.json`. In Workflows, connect with an individual API token through Settings, choose that bundle, review the upload and execute. Runs lists jobs for refresh, cancellation and inspection. Tokens stay in page memory. Discovery imports remain in the browser; executing uploads the explicit bundle to the API.
104
113
 
105
114
  Supported mapping contracts: bounded Slack operations, PostgreSQL, Redis and custom JSON collections (`GET /path` / `POST /path`). Preparation rejects missing/unreviewed mappings and unsupported vendor SDK operations. Discovery and mappings remain user-reviewed declarations, not proof that every operation or dependency in arbitrary source was discovered. Hosted execution checks the declared assertions.
106
115
 
@@ -113,6 +122,13 @@ The session traces workflows across files, records intents and production failur
113
122
 
114
123
  After reviewing discovery, configure `AGENTTWIN_TOKEN` using your individual account token (never paste it into an agent prompt) and run `npx agenttwin sync`. Optional `AGENTTWIN_API_URL` selects your API. The website loads account discovery after you connect in Settings, then refreshes while visible. Sync sends names, operations and relative entrypoint metadata; application source uploads happen separately through reviewed bundles. Avoid sensitive names or identifiers in discovery metadata.
115
124
 
116
- To execute a workflow, supply an executable Node entrypoint, reviewed supported dependency mappings, synthetic fixtures and expected observable outcomes. Run `npx agenttwin prepare --file preparation.json`, review the bundle, and run it through your AgentTwin API or E2B account. Browser/desktop automation and arbitrary vendor SDKs require additional runtimes/adapters. Every application execution is hosted; no local Docker is used.
125
+ To execute a workflow, supply an executable Node entrypoint, reviewed supported dependency mappings, synthetic fixtures and expected observable outcomes. Run `npx agenttwin prepare --file preparation.json`, review the bundle, and run it through your AgentTwin API or E2B account. Browser/desktop automation and arbitrary vendor SDKs require additional runtimes/adapters. The CLI is the default runner; select a hosted runner only when the workflow requires it. No local Docker is used.
117
126
 
118
127
  A run receipt's **Fix & retest** tab exports an evidence-based task for your coding agent. Edit the code in the original project, prepare a new bundle, execute in a fresh sandbox, and compare receipts. This is an interactive coding loop, not an unattended universal repair service.
128
+
129
+
130
+ ### Dashboard settings and account controls
131
+
132
+ The website’s Settings page saves workspace name, default execution limit (1–300 seconds for new templates), automatic refresh, compact lists and reduced motion in this browser. Existing reviewed bundles retain their limits. The account section supports token visibility, connection status, manual workspace refresh and disconnect; tokens are never persisted with preferences.
133
+
134
+ Top-right initials open account actions. The sidebar closes into a full-width layout. See `docs-site/src/dashboard.mdx` for the complete guide. The website/API UI has received additional fixes after npm 0.2.2; the published package remains 0.2.2.