@north-light/cli 0.3.435 → 0.3.437
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/dist/builtin-memory/crouter-sdk/guides/apps-on-northlight.md +24 -9
- package/dist/clients/attach/viewer.js +545 -545
- package/dist/commands/sys/daemon.js +1 -1
- package/dist/commands/sys/join.js +1 -1
- package/dist/core/directory/join-lock.d.ts +13 -0
- package/dist/core/directory/join-lock.js +1 -0
- package/dist/core/directory/join.d.ts +23 -1
- package/dist/core/directory/join.js +1 -1
- package/dist/core/grants/sync.js +1 -1
- package/dist/core/io.d.ts +8 -1
- package/dist/core/io.js +7 -7
- package/dist/core/render.js +11 -11
- package/dist/daemon/crtrd.js +1 -1
- package/dist/daemon/manage.d.ts +14 -1
- package/dist/daemon/manage.js +2 -2
- package/docs/sdk/guides/apps-on-northlight.md +24 -9
- package/package.json +2 -2
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +12 -12
|
@@ -25,19 +25,18 @@ The example app texts you, so it asks for the `sms` provider's `sms:send` scope.
|
|
|
25
25
|
|
|
26
26
|
Open `https://account.northlight.ai/signup` and create your account. Signup texts a confirmation code to your phone, and that text is sent over iMessage, so use a phone number that has iMessage. A number that cannot receive iMessage gets "We couldn't send the text", and retrying does not help. One phone number belongs to one account.
|
|
27
27
|
|
|
28
|
-
Install the CLI (`npm i -g @north-light/cli`). Joining needs `crtr` 0.3.
|
|
28
|
+
Install the CLI (`npm i -g @north-light/cli`). Joining needs `crtr` 0.3.436 or later (older versions need `crtr sys daemon stop` first and fail if a viewer is open); `crtr --version` shows yours.
|
|
29
29
|
|
|
30
30
|
Then join your laptop to the account:
|
|
31
31
|
|
|
32
32
|
1. Open `https://account.northlight.ai/account/machines` and choose **Create join token**. A token needs a sign-in within the last 10 minutes, so the page asks you to sign in again if yours is older.
|
|
33
|
-
2. The page shows
|
|
33
|
+
2. The page shows the join command with the token filled in. On your laptop, run it from a plain terminal: `crtr sys join --directory https://account.northlight.ai --token <token>`. Leave your crtr windows open: join stops the daemon itself, holds it down while it writes your identity (so an open viewer cannot restart it early), and starts it again on the joined settings. Run it outside any crtr node, because a node's engine stops with the daemon; from inside one, join refuses with `join_inside_node`. Add `--name <label>` to name the machine on the page. The token works once and expires at the time the page shows; the page shows it only once.
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
crtr sys daemon stop
|
|
37
36
|
crtr sys join --directory https://account.northlight.ai --token <token> --name my-laptop
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
It answers with `registered: true`, the machine id (`runtime:<id>`)
|
|
39
|
+
It answers with `registered: true`, the machine id (`runtime:<id>`), your user id and `daemon: restarted` (`daemon: not_running` when crtr was not running; the next crtr command starts it). Your open viewers and nodes reconnect on their own.
|
|
41
40
|
3. Check it: `crtr cloud apps mine` lists the apps you manage. Before you have joined, it answers `not_joined` and prints these same steps.
|
|
42
41
|
|
|
43
42
|
Things to know before you join:
|
|
@@ -99,10 +98,10 @@ An app can only ask for scopes it has been given. It starts with `crtr:llm` and
|
|
|
99
98
|
|
|
100
99
|
```bash
|
|
101
100
|
crtr cloud apps asks --app-id <client id> --source sms
|
|
102
|
-
crtr cloud apps set-scopes --app-id <client id> --
|
|
101
|
+
crtr cloud apps set-scopes --app-id <client id> --add sms:send
|
|
103
102
|
```
|
|
104
103
|
|
|
105
|
-
`asks` lists, per source, what the app may ask for and whether it asks now; `sms:send` is under providers, with the consent sentence "Send you text messages from Northlight's number". `set-scopes`
|
|
104
|
+
`asks` lists, per source, what the app may ask for and whether it asks now; `sms:send` is under providers, with the consent sentence "Send you text messages from Northlight's number". `set-scopes --add` adds to the list the app has now and leaves the rest alone; `--remove` drops a scope that is in it (`crtr:act` needs `crtr:llm`, so drop both together). `crtr cloud apps asks --app-id <client id> --requested` shows exactly what the app asks for now. To replace the whole list instead, repeat `--scope` for every scope you want, or pass `--clear`. The console's **What it asks for** tab does the same with an **Add permissions** search. Without `sms:send` the consent page does not offer it and `providers.call` for `sms` is refused. Take scope strings from `asks` and do not invent them.
|
|
106
105
|
|
|
107
106
|
If your app does not work without a provider being set up first (Doppel needs Context), name it:
|
|
108
107
|
|
|
@@ -252,9 +251,9 @@ Your Northlight chat agent at `https://chat.northlight.ai` can run the same comm
|
|
|
252
251
|
| `crtr cloud apps get --app-id <id>` | Shows the registration. |
|
|
253
252
|
| `crtr cloud apps update --app-id <id> --name … / --origin … / --logo … / --justification …` | Changes the profile fields you pass. |
|
|
254
253
|
| `crtr cloud apps set-redirect-uris --app-id <id> --redirect-uri …` | Replaces the whole redirect URI list; repeat the flag for each. |
|
|
255
|
-
| `crtr cloud apps asks --app-id <id>` | Lists what an app may ask for, with whether it asks now. Large sources such as `integrations` print as a count. Narrow it with `--query sms:send`, `--source sms`, `--group providers\|apps\|agents\|space`, or `--query <text>`; for example `crtr cloud apps asks --app-id <id> --source sms`. |
|
|
256
|
-
| `crtr cloud apps set-scopes --app-id <id> --
|
|
257
|
-
| `crtr cloud apps set-requires --app-id <id> --
|
|
254
|
+
| `crtr cloud apps asks --app-id <id>` | Lists what an app may ask for, with whether it asks now. Large sources such as `integrations` print as a count. Narrow it with `--query sms:send`, `--source sms`, `--group providers\|apps\|agents\|space`, or `--query <text>`; `--requested` lists only what the app asks for now. For example `crtr cloud apps asks --app-id <id> --source sms`. |
|
|
255
|
+
| `crtr cloud apps set-scopes --app-id <id> --add … --remove …` | Edits the scope list the app has now; repeat `--add`/`--remove` per scope. Removing a scope that is not in the list is refused. Or replace the whole list with repeated `--scope`; `--clear` empties it. `crtr:act` needs `crtr:llm`. |
|
|
256
|
+
| `crtr cloud apps set-requires --app-id <id> --add … --remove …` | Edits the providers your app does not work without (for example `context`). Or replace the list with repeated `--provider`; `--clear` empties it. |
|
|
258
257
|
| `crtr cloud apps keys add --app-id <id> --jwk '<public JWK>'` | Adds a signing key beside any existing one. Answers `created: false` if that key is already on the app. `keygen --app` calls it for you. |
|
|
259
258
|
| `crtr cloud apps keys list --app-id <id>` | Lists the keys with their `kid` and `active` or `retired` status. |
|
|
260
259
|
| `crtr cloud apps keys retire --app-id <id> --kid <kid>` | Retires a key so it no longer signs in. |
|
|
@@ -287,6 +286,22 @@ crtr cloud apps set-listing --app-id <client id> --listed true --price free \
|
|
|
287
286
|
|
|
288
287
|
`--text-welcome` is one or two plain sentences, at most 120 characters, with no links. Agents can install an app for people by text only while it is listed (`--listed true`). `crtr cloud apps install --app-id <client id>` sends the signed-in person a text with the install link. Run it only for yourself or for a person who asked: it sends a real text.
|
|
289
288
|
|
|
289
|
+
### Developing alongside your live app
|
|
290
|
+
|
|
291
|
+
Once your app is live, you can keep developing on your laptop against production while the live app keeps running. There are two ways to do it.
|
|
292
|
+
|
|
293
|
+
**Add your localhost callback to the live app.** This is the simplest, and it is fine for most apps. An app can hold several redirect URIs, and each sign-in returns to the one its request names, so your deployed server and your laptop can both sign people in at once:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
crtr cloud apps set-redirect-uris --app-id <client id> \
|
|
297
|
+
--redirect-uri https://app.example.com/auth/callback \
|
|
298
|
+
--redirect-uri http://localhost:3000/auth/callback
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
`set-redirect-uris` replaces the whole list, so name the live URI too. Give your laptop its own signing key beside the deployed one (`keygen --app` adds it; an app holds at most 2 active keys), so you never copy the production private key to your laptop. Both servers share everything else: the same people, their grants, the app's space and the scopes the app asks for. A scope you add while developing changes what the live app asks of everyone. The origin, `login_start_url` and run notice URL each hold one value, so they keep pointing at the deployed app.
|
|
302
|
+
|
|
303
|
+
**Register a separate development app.** Do this when you are changing what the app asks for, or need data and grants of its own that live people never touch. Run `crtr cloud apps register` again with a name such as "Texty (dev)", a `localhost` origin and redirect URI, and its own key. It starts in testing and stays there, so only you and the testers you add can sign in, and it never appears in the marketplace. Point your laptop's environment file at its client id. This is how Google recommends separating tiers too: a separate project for development and for production.
|
|
304
|
+
|
|
290
305
|
### Rotate keys
|
|
291
306
|
|
|
292
307
|
Add a new key beside the old one, switch, verify with a real sign-in, then retire the old key:
|