@ai-ecoverse/slicc-jerk 0.4.1 → 0.5.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
@@ -4,7 +4,7 @@ Get, list, create and drop OAuth tokens across operating systems and inside SLIC
4
4
 
5
5
  `jerk` (as in an ice-cream jerk) asks `gh`, `npm`, `wrangler`, `aio` and friends for their tokens, so that adding a provider is configuration, not code. It feeds [fnox](https://fnox.jdx.dev) as a `command` lease backend on a real machine. Inside seven, tokens go to the vault's sealed store, and programs only ever see placeholders.
6
6
 
7
- **Status:** being built. `jerk list`, `jerk config`, and `get`, `list`, `create` and `drop` for providers backed by a CLI (gh, npm, wrangler, aio) work, and so do `lease`, `drop --lease`, `sync` and `config fnox`. OAuth providers and `intercept` print `not implemented yet` and exit 5 until they land.
7
+ **Status:** being built. `jerk list`, `jerk config`, and `get`, `list`, `create` and `drop` for providers backed by a CLI (gh, npm, wrangler, aio) work, and so do `lease`, `drop --lease`, `sync` and `config fnox`. OAuth providers (loopback, auto, device modes) work for `get`, `create` and `drop`. `intercept` prints `not implemented yet` and exits 5 until it lands.
8
8
 
9
9
  `jerk <provider> get` prints the token only to a terminal, or with `--reveal`. To a pipe it prints a masked form such as `gho_…1234`. A token already in the provider's first `env` variable (`GH_TOKEN`, …) wins over the CLI, as gh does. `--scope` checks the granted scopes, with GitHub's implied scopes understood, and exits 3 when they don't cover it. jerk never signs in by itself: `get` exits 3, and `get --login` on a terminal runs `create` first. The provider's CLI runs without the provider's own token variables in its environment.
10
10
 
@@ -58,6 +58,34 @@ drop = { run = ["gh", "auth", "logout", "--hostname", "{host}", "--user", "{id}"
58
58
 
59
59
  Commands are argument lists, never shell strings. `{name}` placeholders come from `params` or from `scope`, `id`, `name`, `expires` and `user`. `jerk config check` validates every layer, `jerk config show <provider>` prints the provider that wins, and `jerk config path` shows where each layer lives.
60
60
 
61
+ <<<<<<< HEAD
62
+ ## OAuth providers
63
+
64
+ A provider can use an `[oauth]` block instead of CLI commands. jerk handles the OAuth flow itself: PKCE loopback, device code, or auto (loopback when the port binds, otherwise exit 4).
65
+
66
+ ```toml
67
+ [providers.xai]
68
+ name = "xAI Grok"
69
+ env = ["XAI_API_KEY"]
70
+ domains = ["api.x.ai"]
71
+ [providers.xai.oauth]
72
+ mode = "auto"
73
+ flow = "pkce"
74
+ authorize_url = "https://auth.x.ai/oauth2/auth?response_type=code&client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}&code_challenge={code_challenge}&code_challenge_method=S256&state={state}"
75
+ token_url = "https://auth.x.ai/oauth2/token"
76
+ client_id = "b1a00492-073a-47ea-816f-4c329264a828"
77
+ redirect_uri = "http://127.0.0.1:56121/callback"
78
+ scope = "openid profile email offline_access grok-cli:access api:access"
79
+ [providers.xai.oauth.capture]
80
+ at = "request"
81
+ from = "query"
82
+ param = "code"
83
+ ```
84
+
85
+ `jerk xai create` opens the sign-in in the system browser. The refresh token goes to the OS keyring (service `slicc-jerk`, account `xai/default`), or to a file store (mode 0600) with `store = "file"`. `jerk xai get` refreshes the token at `token_url` and prints the access token by the same rules as CLI providers. `jerk xai drop --yes` removes the grant.
86
+
87
+ The `device` mode sends the first request to `authorize_url` as the device authorization endpoint, prints the verification URI and user code on stderr, then polls `token_url`. `intercept` and `popup` modes exit 5 until they land.
88
+
61
89
  ## fnox
62
90
 
63
91
  jerk feeds [fnox](https://fnox.jdx.dev) as a `command` lease backend. `jerk config fnox [--proxy] [<provider>...]` prints the stanzas to paste into `~/.config/fnox/config.toml`:
package/bin/jerk.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-jerk",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Get, list, create and drop OAuth tokens across operating systems and inside SLICC, by dispatching to each provider's own CLI",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -27,11 +27,11 @@
27
27
  }
28
28
  },
29
29
  "optionalDependencies": {
30
- "@ai-ecoverse/slicc-jerk-darwin-arm64": "0.4.1",
31
- "@ai-ecoverse/slicc-jerk-darwin-x64": "0.4.1",
32
- "@ai-ecoverse/slicc-jerk-linux-arm64": "0.4.1",
33
- "@ai-ecoverse/slicc-jerk-linux-x64": "0.4.1",
34
- "@ai-ecoverse/slicc-jerk-win32-arm64": "0.4.1",
35
- "@ai-ecoverse/slicc-jerk-win32-x64": "0.4.1"
30
+ "@ai-ecoverse/slicc-jerk-darwin-arm64": "0.5.0",
31
+ "@ai-ecoverse/slicc-jerk-darwin-x64": "0.5.0",
32
+ "@ai-ecoverse/slicc-jerk-linux-arm64": "0.5.0",
33
+ "@ai-ecoverse/slicc-jerk-linux-x64": "0.5.0",
34
+ "@ai-ecoverse/slicc-jerk-win32-arm64": "0.5.0",
35
+ "@ai-ecoverse/slicc-jerk-win32-x64": "0.5.0"
36
36
  }
37
37
  }