adaptiqai 0.0.0-stage → 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.
Files changed (3) hide show
  1. package/README.md +124 -2
  2. package/lib/index.js +2323 -0
  3. package/package.json +49 -3
package/README.md CHANGED
@@ -1,3 +1,125 @@
1
- # Temporary Holding Version
1
+ # adaptiqai
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ One command that connects the AI app you use to [AdaptiqAI](https://adaptiqai.com),
4
+ for a person at a terminal and for an agent running it unattended.
5
+
6
+ ```bash
7
+ npx -y adaptiqai connect cline
8
+ ```
9
+
10
+ It signs you in through your browser, sets the app up, sends one test request,
11
+ and says how to start the app. You open one link, press Connect, and add a card
12
+ or funds. Nothing else needs doing by hand, and there is no key to copy.
13
+
14
+ | Command | |
15
+ |---|---|
16
+ | `npx -y adaptiqai connect <app>` | Sign in, set the app up, test it. Safe to run again. |
17
+ | `npx -y adaptiqai status [app]` | Where each app stands. Uses no model. |
18
+ | `npx -y adaptiqai disconnect <app>` | Take AdaptiqAI out of the app, and put back what it replaced. |
19
+
20
+ `npx -y adaptiqai` on its own connects the one app it finds, or asks which.
21
+
22
+ | App | Word | What it sets up | Start it with |
23
+ |---|---|---|---|
24
+ | Cline | `cline` | A provider of its own, in every Cline app on this computer | the app, or `cline` |
25
+ | DeepSeek Harness | `deepseek` | AdaptiqAI's plugin, in its app or in the browser | the app, or `npx -y @deepseek-ai/dsh adaptiq` |
26
+ | Codex | `codex` | A profile and a model catalog of its own, as Connect to app writes them. Plain `codex` stays as it was | `codex --profile adaptiq` |
27
+ | Claude Code | `claude-code` | `adaptiq-claude`. Plain `claude` stays as it was | `adaptiq-claude` |
28
+ | OpenCode | `opencode` | OpenCode's own sign-in | `opencode` |
29
+ | Kilo Code | `kilo` | Kilo's own sign-in, which its extension reads too | `kilo`, or the extension |
30
+ | Pi | `pi` | AdaptiqAI's package for Pi | `pi --provider adaptiqai --model <id>` |
31
+ | Hermes Agent | `hermes` | AdaptiqAI's plugin, and a custom endpoint of its own | `hermes`, or the app |
32
+ | OpenClaw | `openclaw` | AdaptiqAI's plugin, and the default model | `openclaw dashboard` |
33
+
34
+ ## For agents
35
+
36
+ Without a terminal, the command is in agent mode by itself. It prints one JSON
37
+ object per line, asks nothing, waits for nobody, and never starts or stops an
38
+ app. In a terminal of your own, pass `--json --no-wait`.
39
+
40
+ ```bash
41
+ npx -y adaptiqai connect cline --json --no-wait
42
+ ```
43
+
44
+ Run it, read the last line, and do what it says. The same command goes on from
45
+ wherever the last run ended, so a time limit on your tool cannot lose a sign-in.
46
+
47
+ | Exit | Last event | What to do |
48
+ |---|---|---|
49
+ | 3 | `waiting` | Give the person `url` from the `sign_in` event (`say` has the words). Run the command again, with `--wait 90` to wait within your tool's limit. |
50
+ | 4 | `insufficient_balance` | Give the person `add_funds_url`. An empty balance is a state, not a failure: run the command again once they have added a card or funds. |
51
+ | 0 | `connected` | Tell the person how to start the app: `start`, and any `notes`. |
52
+ | 1 | `error` | `code` and `message` say why. `app_not_installed` also has `install`. |
53
+ | 2 | `error` or `choose_app` | Not understood. `choose_app` lists the apps found: say which. |
54
+
55
+ The person presses Connect and adds funds in their own browser. Nobody else can.
56
+
57
+ | Option | |
58
+ |---|---|
59
+ | `--model <id>` | The model to start on. By default the first running one, or the one the app has. |
60
+ | `--no-wait` | Do not wait for the browser or for funds. On by itself without a terminal. |
61
+ | `--wait <seconds>` | Wait this long for each. At a terminal, it waits ten minutes. |
62
+ | `--no-open` | Do not open the link in a browser. |
63
+ | `--json` | One JSON object per line. On by itself without a terminal. |
64
+
65
+ `ADAPTIQAI_API_BASE` and `ADAPTIQAI_CONSOLE_URL` point the command at another
66
+ AdaptiqAI, as they do for the plugins. Both must be https (plain http only to
67
+ localhost), and the sign-in names that address, so a person sees where they
68
+ sign in.
69
+
70
+ ## What it does to your computer
71
+
72
+ - **A key is never printed, and never goes on a command line.** It reaches an
73
+ app in that app's own file, or on its stdin or in its environment for that
74
+ one command. All output goes through one place that takes keys out, and all
75
+ commands through one place that refuses a key among their arguments.
76
+ - **The key lives in one place per app:** the app's own settings, or for Codex
77
+ and Claude Code a file of their own under `~/.config/adaptiq`. A file that
78
+ holds a key is readable by you alone. This command keeps no key itself. While
79
+ a sign-in waits it keeps the device code, readable by you alone, until the
80
+ app is set up; it is useless after ten minutes.
81
+ - **An app's settings are merged, not replaced.** Other providers stay. A file
82
+ that cannot be read stops the run before anything is written.
83
+ - **What changes is copied first,** to `~/.config/adaptiq/cli/backups`, without
84
+ any AdaptiqAI key: a copy left with one would outlive `disconnect`.
85
+ - **A second run is safe.** A file that would not change is not touched, and an
86
+ app whose key still works is not signed in again.
87
+ - **Nothing that runs is stopped without asking.** An agent gets a note to pass
88
+ on instead: it may be running inside that very app.
89
+ - **The test request is ephemeral.** It makes no conversation, and costs next
90
+ to nothing.
91
+ - **Compaction** goes off for every model in Cline, Pi, OpenClaw, OpenCode and
92
+ Kilo, which have no switch for one provider. `disconnect` puts it back. Codex
93
+ has no switch at all, so it compacts only once the 5M window is full.
94
+
95
+ `disconnect` takes the key out of the app. The connection stays listed in the
96
+ console until it is disconnected there, because a key can only be revoked from a
97
+ signed-in browser. Unused, it ends by itself after 90 days.
98
+
99
+ An app with a sign-in of its own (OpenCode, Kilo) keeps its key itself. This
100
+ command runs the sign-in, so an agent's run can end while the person is in the
101
+ browser, and hands the app the approved code.
102
+
103
+ ## Windows
104
+
105
+ The command itself, Cline, Codex, Claude Code and Pi are written for Windows,
106
+ and paths, shims and the key file have tests, but it has not been run on Windows
107
+ yet. Windows has no `chmod`: a file is as private as your user folder. OpenCode
108
+ and Kilo sign in through `sh`, which Git for Windows brings.
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ pnpm install
114
+ pnpm --filter adaptiqai run build
115
+ pnpm --filter adaptiqai run test
116
+ ```
117
+
118
+ `scripts/gateway_smoke.py` takes every app here through the whole way, as an
119
+ agent does, in a throwaway home against the real gateway of a checkout of the
120
+ knowledge app, under token billing, with a stand-in engine:
121
+
122
+ ```bash
123
+ KNOWLEDGE_APP=<checkout> uv run --directory "$KNOWLEDGE_APP" python \
124
+ packages/cli/scripts/gateway_smoke.py [apps]
125
+ ```