agenttwin 0.1.0 → 0.2.1
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 +94 -24
- package/dist/api.js +712 -0
- package/dist/cli.js +5375 -57
- package/dist/dashboard/assets/brand.css +2 -0
- package/dist/dashboard/assets/dashboard/dashboard.css +189 -0
- package/dist/dashboard/assets/dashboard/dashboard.js +438 -0
- package/dist/dashboard/assets/dashboard/hosted.js +50 -0
- package/dist/dashboard/assets/dashboard/inventory.json +1 -0
- package/dist/dashboard/assets/dashboard/runs.json +1 -0
- package/dist/dashboard/assets/fonts/Syne-OFL.txt +93 -0
- package/dist/dashboard/assets/fonts/inter-var.woff2 +0 -0
- package/dist/dashboard/assets/fonts/plexmono-400.woff2 +0 -0
- package/dist/dashboard/assets/fonts/plexmono-500.woff2 +0 -0
- package/dist/dashboard/assets/fonts/syne-400.ttf +0 -0
- package/dist/dashboard/assets/fonts/syne-500.ttf +0 -0
- package/dist/dashboard/assets/fonts/syne-600.ttf +0 -0
- package/dist/dashboard/assets/icons/ATTRIBUTION.md +7 -0
- package/dist/dashboard/assets/icons/attio.ico +0 -0
- package/dist/dashboard/assets/icons/aws.svg +1 -0
- package/dist/dashboard/assets/icons/bank.svg +5 -0
- package/dist/dashboard/assets/icons/box.svg +1 -0
- package/dist/dashboard/assets/icons/chat.svg +3 -0
- package/dist/dashboard/assets/icons/check.png +0 -0
- package/dist/dashboard/assets/icons/ci.svg +5 -0
- package/dist/dashboard/assets/icons/clay.png +0 -0
- package/dist/dashboard/assets/icons/cloudflare.svg +1 -0
- package/dist/dashboard/assets/icons/co-abridge.png +0 -0
- package/dist/dashboard/assets/icons/co-clay.png +0 -0
- package/dist/dashboard/assets/icons/co-cognition.png +0 -0
- package/dist/dashboard/assets/icons/co-intercom.svg +1 -0
- package/dist/dashboard/assets/icons/co-paloalto.png +0 -0
- package/dist/dashboard/assets/icons/co-pylon.png +0 -0
- package/dist/dashboard/assets/icons/co-ramp.png +0 -0
- package/dist/dashboard/assets/icons/co-sentry.svg +1 -0
- package/dist/dashboard/assets/icons/codes.svg +5 -0
- package/dist/dashboard/assets/icons/datadog.svg +1 -0
- package/dist/dashboard/assets/icons/discord.svg +1 -0
- package/dist/dashboard/assets/icons/docker.svg +1 -0
- package/dist/dashboard/assets/icons/documenso.png +0 -0
- package/dist/dashboard/assets/icons/dropbox.svg +1 -0
- package/dist/dashboard/assets/icons/edr.svg +4 -0
- package/dist/dashboard/assets/icons/ehr.svg +5 -0
- package/dist/dashboard/assets/icons/git.svg +1 -0
- package/dist/dashboard/assets/icons/github.svg +1 -0
- package/dist/dashboard/assets/icons/githubactions.svg +1 -0
- package/dist/dashboard/assets/icons/gitlab.svg +1 -0
- package/dist/dashboard/assets/icons/gmail.svg +7 -0
- package/dist/dashboard/assets/icons/google-calendar.svg +28 -0
- package/dist/dashboard/assets/icons/google.svg +1 -0
- package/dist/dashboard/assets/icons/googlecloud.svg +1 -0
- package/dist/dashboard/assets/icons/googledocs.svg +1 -0
- package/dist/dashboard/assets/icons/googledrive.svg +1 -0
- package/dist/dashboard/assets/icons/googlesheets.svg +1 -0
- package/dist/dashboard/assets/icons/hubspot.svg +1 -0
- package/dist/dashboard/assets/icons/intercom.svg +1 -0
- package/dist/dashboard/assets/icons/jira.svg +1 -0
- package/dist/dashboard/assets/icons/klaviyo.png +0 -0
- package/dist/dashboard/assets/icons/kubernetes.svg +1 -0
- package/dist/dashboard/assets/icons/linear.svg +1 -0
- package/dist/dashboard/assets/icons/linkedin.svg +1 -0
- package/dist/dashboard/assets/icons/mail.svg +4 -0
- package/dist/dashboard/assets/icons/mixpanel.svg +1 -0
- package/dist/dashboard/assets/icons/mongodb.svg +1 -0
- package/dist/dashboard/assets/icons/netsuite.png +0 -0
- package/dist/dashboard/assets/icons/nodedotjs.svg +1 -0
- package/dist/dashboard/assets/icons/notes.svg +5 -0
- package/dist/dashboard/assets/icons/notion.svg +1 -0
- package/dist/dashboard/assets/icons/npm.svg +1 -0
- package/dist/dashboard/assets/icons/okta.svg +1 -0
- package/dist/dashboard/assets/icons/openai.svg +1 -0
- package/dist/dashboard/assets/icons/outlook.ico +0 -0
- package/dist/dashboard/assets/icons/pagerduty.svg +1 -0
- package/dist/dashboard/assets/icons/policy.svg +5 -0
- package/dist/dashboard/assets/icons/postgres.svg +1 -0
- package/dist/dashboard/assets/icons/python.svg +1 -0
- package/dist/dashboard/assets/icons/quickbooks.svg +1 -0
- package/dist/dashboard/assets/icons/redis.svg +1 -0
- package/dist/dashboard/assets/icons/resend.svg +1 -0
- package/dist/dashboard/assets/icons/salesforce.svg +1 -0
- package/dist/dashboard/assets/icons/sentry.svg +1 -0
- package/dist/dashboard/assets/icons/shopify.svg +1 -0
- package/dist/dashboard/assets/icons/siem.svg +4 -0
- package/dist/dashboard/assets/icons/slack.svg +6 -0
- package/dist/dashboard/assets/icons/snowflake.svg +1 -0
- package/dist/dashboard/assets/icons/sparkle.svg +4 -0
- package/dist/dashboard/assets/icons/stripe.svg +1 -0
- package/dist/dashboard/assets/icons/supabase.svg +1 -0
- package/dist/dashboard/assets/icons/terraform.svg +1 -0
- package/dist/dashboard/assets/icons/trolley.ico +0 -0
- package/dist/dashboard/assets/icons/twilio.svg +1 -0
- package/dist/dashboard/assets/icons/ui/arrow-right.svg +1 -0
- package/dist/dashboard/assets/icons/ui/arrows-clockwise.svg +1 -0
- package/dist/dashboard/assets/icons/ui/arrows-left-right.svg +1 -0
- package/dist/dashboard/assets/icons/ui/caret-down.svg +1 -0
- package/dist/dashboard/assets/icons/ui/check.svg +1 -0
- package/dist/dashboard/assets/icons/ui/clock.svg +1 -0
- package/dist/dashboard/assets/icons/ui/cube.svg +1 -0
- package/dist/dashboard/assets/icons/ui/git-branch.svg +1 -0
- package/dist/dashboard/assets/icons/ui/github-logo.svg +1 -0
- package/dist/dashboard/assets/icons/ui/magnifying-glass.svg +1 -0
- package/dist/dashboard/assets/icons/ui/plugs-connected.svg +1 -0
- package/dist/dashboard/assets/icons/ui/seal-check.svg +1 -0
- package/dist/dashboard/assets/icons/ui/shield-check.svg +1 -0
- package/dist/dashboard/assets/icons/ui/stack-simple.svg +1 -0
- package/dist/dashboard/assets/icons/ui/terminal.svg +1 -0
- package/dist/dashboard/assets/icons/ui/warning-circle.svg +1 -0
- package/dist/dashboard/assets/icons/ui/x.svg +1 -0
- package/dist/dashboard/assets/icons/unified.png +0 -0
- package/dist/dashboard/assets/icons/unified.svg +23 -0
- package/dist/dashboard/assets/icons/unstructured.svg +3 -0
- package/dist/dashboard/assets/icons/vercel.svg +1 -0
- package/dist/dashboard/assets/icons/waterfall.jpg +0 -0
- package/dist/dashboard/assets/icons/xero.svg +1 -0
- package/dist/dashboard/assets/logo/favicon.svg +7 -0
- package/dist/dashboard/assets/logo/mark-stacked-worlds.svg +4 -0
- package/dist/dashboard/assets/logo/mark-twin-rings.svg +7 -0
- package/dist/dashboard/assets/logo/mark-worlds-overlap.svg +10 -0
- package/dist/dashboard/index.html +63 -0
- package/dist/gateway.js +719 -0
- package/dist/worker.js +341 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,48 +1,118 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgentTwin
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
can run the same workflow against a replica, inject real failure conditions, and
|
|
7
|
-
turn a discovered failure into a regression test.
|
|
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.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
> works today. The runtime commands (`up`, `run`, `fault`, `diff`, `adopt`) are
|
|
11
|
-
> coming soon.
|
|
7
|
+
## Install and discover
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
Node.js 22+ is required. Run discovery from your project; npx installs the CLI automatically:
|
|
14
10
|
|
|
15
11
|
```sh
|
|
16
12
|
npx agenttwin init
|
|
13
|
+
npx agenttwin example --out ./agenttwin-example
|
|
17
14
|
```
|
|
18
15
|
|
|
19
|
-
|
|
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
|
+
|
|
18
|
+
## Run through an AgentTwin API
|
|
19
|
+
|
|
20
|
+
Your operator supplies the API URL and your individual token:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
export AGENTTWIN_API_URL=https://your-agenttwin-api.example.com
|
|
24
|
+
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
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
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
|
+
|
|
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.
|
|
32
|
+
|
|
33
|
+
## Use your own E2B account
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
export E2B_API_KEY=your_key
|
|
37
|
+
npx agenttwin setup
|
|
38
|
+
npx agenttwin run --runtime e2b --file agenttwin-example/safe.world.json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`setup` builds a Node 22/PostgreSQL 15/Redis template on E2B and stores its nonsecret ID in `~/.agenttwin/runtime.json`. `E2B_TEMPLATE_ID` overrides that ID. It creates no local Docker containers. Sandboxes are created only for runs. The runtime boundary permits adding another hosted provider later; only E2B is implemented today.
|
|
42
|
+
|
|
43
|
+
## Run your code
|
|
44
|
+
|
|
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.
|
|
46
|
+
|
|
47
|
+
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
|
+
|
|
49
|
+
Supported now:
|
|
50
|
+
|
|
51
|
+
- 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
|
+
- 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.
|
|
55
|
+
- 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
|
+
|
|
57
|
+
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
|
+
|
|
59
|
+
## Discovery and reports
|
|
60
|
+
|
|
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.
|
|
62
|
+
|
|
63
|
+
## Operate the API
|
|
64
|
+
|
|
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.
|
|
66
|
+
|
|
67
|
+
MIT license.
|
|
68
|
+
|
|
69
|
+
## Discovery dashboard
|
|
70
|
+
|
|
71
|
+
`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
|
+
|
|
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.
|
|
74
|
+
|
|
75
|
+
## Prepare an actual discovered workflow
|
|
76
|
+
|
|
77
|
+
After `init`, select a candidate from `.agenttwin/inventory.json` or the dashboard's New world view. Write `preparation.json` beside your application files:
|
|
20
78
|
|
|
21
79
|
```json
|
|
22
80
|
{
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
81
|
+
"schema": "agenttwin/preparation-v1",
|
|
82
|
+
"workflowId": "YOUR_DISCOVERED_WORKFLOW_ID",
|
|
83
|
+
"world": {
|
|
84
|
+
"schema": "agenttwin/world-v1",
|
|
85
|
+
"name": "notification",
|
|
86
|
+
"files": ["workflow.mjs"],
|
|
87
|
+
"command": ["node", "workflow.mjs"],
|
|
88
|
+
"timeoutSeconds": 20,
|
|
89
|
+
"services": [{"name":"slack","adapter":"slack","collections":[{"path":"/messages","seed":[]},{"path":"/channels","seed":[{"id":"C_TEST","name":"test"}]}]}],
|
|
90
|
+
"assertions": [{"service":"slack","path":"/messages","count":1}]
|
|
91
|
+
},
|
|
92
|
+
"mappings": [{"toolId":"YOUR_DISCOVERED_SLACK_TOOL_ID","service":"slack","contract":"slack","operations":["chat.postMessage"],"reviewed":true}]
|
|
26
93
|
}
|
|
27
94
|
```
|
|
28
95
|
|
|
29
|
-
|
|
96
|
+
Use your actual discovered IDs and include every operation recorded for the candidate. Configure code to use the generated `AGENTTWIN_SLACK_URL` and `AGENTTWIN_SLACK_TOKEN`; an SDK needs its base URL overridden. The runtime does not install dependencies or transpile source: include a built, self-contained Node entrypoint and every required application file. Preparation never executes your code.
|
|
30
97
|
|
|
31
98
|
```sh
|
|
32
|
-
npx agenttwin --
|
|
33
|
-
npx agenttwin --
|
|
99
|
+
npx agenttwin prepare --file preparation.json --out .agenttwin/prepared/notification
|
|
100
|
+
npx agenttwin run --file .agenttwin/prepared/notification/agenttwin.world.json
|
|
34
101
|
```
|
|
35
102
|
|
|
36
|
-
|
|
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.
|
|
104
|
+
|
|
105
|
+
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
|
+
|
|
107
|
+
|
|
108
|
+
### Coding session and dashboard discovery
|
|
37
109
|
|
|
38
|
-
Node.js
|
|
110
|
+
Run `npx agenttwin init` inside your repository (Node.js 22+). Interactive init offers an OpenCode session when the CLI is installed; `npx agenttwin init --agent opencode` launches explicitly with your configured provider and its normal permission controls. Provider authentication and usage belong to your coding-agent account. Other coding agents can use `.agenttwin/AGENT-TASK.md`.
|
|
39
111
|
|
|
40
|
-
|
|
112
|
+
The session traces workflows across files, records intents and production failure hypotheses in `.agenttwin/WORKFLOWS.md`, and writes metadata to `.agenttwin/agent-discovery.json`. Static candidates retain their original evidence. Agent candidates remain unverified until the workflow is explicitly prepared and executed. Static discovery preserves distinct exported side-effect entrypoints, including repositories with 100 candidates; it does not prove that every business workflow has been found.
|
|
41
113
|
|
|
42
|
-
`agenttwin
|
|
43
|
-
providers, requests credentials, or executes code. See the project repository for
|
|
44
|
-
the product thesis and roadmap.
|
|
114
|
+
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.
|
|
45
115
|
|
|
46
|
-
|
|
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.
|
|
47
117
|
|
|
48
|
-
|
|
118
|
+
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.
|