@north-light/cli 0.3.542 → 0.3.544

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 (65) hide show
  1. package/dist/builtin-memory/crouter-plugin/commands.md +1 -1
  2. package/dist/builtin-memory/northlight-apps/build-on-your-app.md +47 -0
  3. package/dist/builtin-memory/northlight-apps/cli.md +3 -3
  4. package/dist/builtin-memory/northlight-apps/coding-agents.md +16 -7
  5. package/dist/builtin-memory/northlight-apps/concepts/apps-and-sign-in.md +0 -4
  6. package/dist/builtin-memory/northlight-apps/concepts/connections.md +0 -4
  7. package/dist/builtin-memory/northlight-apps/concepts/providers.md +0 -4
  8. package/dist/builtin-memory/northlight-apps/concepts/runs.md +0 -4
  9. package/dist/builtin-memory/northlight-apps/concepts/scopes-and-grants.md +0 -4
  10. package/dist/builtin-memory/northlight-apps/concepts/testing-mode.md +0 -4
  11. package/dist/builtin-memory/northlight-apps/get-started.md +56 -0
  12. package/dist/builtin-memory/northlight-apps/guides/go-live.md +1 -1
  13. package/dist/builtin-memory/northlight-apps/guides/manage-your-app.md +4 -4
  14. package/dist/builtin-memory/northlight-apps/how-it-fits.md +1 -1
  15. package/dist/builtin-memory/northlight-apps/know-the-person.md +29 -0
  16. package/dist/builtin-memory/northlight-apps/let-their-ai-use-your-app.md +67 -0
  17. package/dist/builtin-memory/northlight-apps/providers/README.md +1 -1
  18. package/dist/builtin-memory/northlight-apps/providers/context.md +2 -2
  19. package/dist/builtin-memory/northlight-apps/providers/device.md +3 -3
  20. package/dist/builtin-memory/northlight-apps/providers/integrations.md +1 -1
  21. package/dist/builtin-memory/northlight-apps/providers/search.md +1 -1
  22. package/dist/builtin-memory/northlight-apps/providers/sms.md +3 -3
  23. package/dist/builtin-memory/northlight-apps/quickstart.md +3 -17
  24. package/dist/builtin-memory/northlight-apps/reach-people-by-text.md +50 -0
  25. package/dist/builtin-memory/northlight-apps/use-our-ai.md +55 -0
  26. package/dist/builtin-memory/northlight-apps/use-our-apps.md +46 -0
  27. package/dist/core/command-plugins/discovery.js +1 -1
  28. package/dist/core/command-plugins/transport/http-plan.d.ts +2 -0
  29. package/dist/core/command-plugins/transport/http-plan.js +1 -1
  30. package/dist/core/providers/call.js +1 -1
  31. package/dist/daemon/api/app-listener.d.ts +1 -1
  32. package/dist/daemon/api/app-listener.js +13 -13
  33. package/dist/daemon/api/handlers/providers.d.ts +3 -1
  34. package/dist/shared/traceparent.d.ts +6 -0
  35. package/dist/shared/traceparent.js +1 -0
  36. package/docs/apps/build-on-your-app.md +44 -0
  37. package/docs/apps/cli.md +3 -3
  38. package/docs/apps/coding-agents.md +16 -7
  39. package/docs/apps/concepts/apps-and-sign-in.md +0 -4
  40. package/docs/apps/concepts/connections.md +0 -4
  41. package/docs/apps/concepts/providers.md +0 -4
  42. package/docs/apps/concepts/runs.md +0 -4
  43. package/docs/apps/concepts/scopes-and-grants.md +0 -4
  44. package/docs/apps/concepts/testing-mode.md +0 -4
  45. package/docs/apps/get-started.md +47 -0
  46. package/docs/apps/guides/go-live.md +1 -1
  47. package/docs/apps/guides/manage-your-app.md +4 -4
  48. package/docs/apps/how-it-fits.md +1 -1
  49. package/docs/apps/know-the-person.md +27 -0
  50. package/docs/apps/let-their-ai-use-your-app.md +63 -0
  51. package/docs/apps/providers/README.md +1 -1
  52. package/docs/apps/providers/context.md +2 -2
  53. package/docs/apps/providers/device.md +3 -3
  54. package/docs/apps/providers/integrations.md +1 -1
  55. package/docs/apps/providers/search.md +1 -1
  56. package/docs/apps/providers/sms.md +3 -3
  57. package/docs/apps/quickstart.md +3 -17
  58. package/docs/apps/reach-people-by-text.md +47 -0
  59. package/docs/apps/use-our-ai.md +27 -0
  60. package/docs/apps/use-our-apps.md +32 -0
  61. package/docs/cli/join-northlight.md +1 -1
  62. package/docs/plugin/commands.md +1 -1
  63. package/package.json +2 -2
  64. package/packages/crouter-identity/package.json +1 -1
  65. package/runtime.lock.json +12 -12
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: Reach people by text
3
+ description: Give your app its own iMessage number with Comms. People text it, your server answers with an agent run on their runtime, and you can text them again later.
4
+ ---
5
+
6
+ # Reach people by text
7
+
8
+ Comms gives your app its own iMessage number, under your app's name and avatar. People text that number, Comms sends each text to your server as a signed webhook, and your server answers with an agent run on the person's own runtime. Once a person has texted you, your app can text them again later, for example from a timer.
9
+
10
+ ```ts
11
+ import {continueInRuntime, formatReply, verifyWebhook} from '@north-light/comms';
12
+
13
+ const event = verifyWebhook(req.headers, rawBody, [process.env.COMMS_WEBHOOK_SECRET!]);
14
+ if (event.type === 'message.received' && event.data.content.type === 'text') {
15
+ const {contact, content} = event.data;
16
+ if (!contact.user) return; // only a sender texting from an Apple ID email has no user
17
+ const client = await oauth.client(contact.user.id); // their Northlight user id, the same as Connection.userId
18
+ const {runId, reply} = await continueInRuntime({client, message: content.text, runId: runs.get(contact.id), idempotencyKey: event.id});
19
+ runs.set(contact.id, runId); // later texts continue the same run
20
+ const {text} = await reply.collect();
21
+ for (const part of formatReply(text)) {
22
+ await comms.sendMessage({environment: event.environment, to: {contact_id: contact.id}, text: part, idempotency_key: `reply:${event.id}:${part.length}`});
23
+ }
24
+ }
25
+ ```
26
+
27
+ `oauth.client` throws `CrouterError` with code `not_connected` when the person has not signed in to your app yet. Answer that with `sendSignInLink(comms, contact, {environment: event.environment})`: Comms texts them a link that signs them in to your app, which lands on your **Sign-in start URL** (console → **Profile** → **Marketplace**).
28
+
29
+ ## The steps
30
+
31
+ The [Comms guide for coding agents](https://comms.northlight.ai/llms.txt) is the whole reference: the webhook events, the send API, its errors, STOP and HELP handling, and the `crtr comms` commands. In short:
32
+
33
+ 1. **Build in fake mode.** `npx @north-light/comms fake --webhook http://localhost:3000/hook` runs a local Comms with no account. `npx @north-light/comms fake send --from +15550001 --text "hi"` plays a person texting you.
34
+ 2. **Register your app on Northlight.** [Quick setup](/docs/quickstart) steps 1 to 4: sign up, `npx @north-light/sdk login`, `npx @north-light/sdk register`. Comms signs in with the same app key.
35
+ 3. **Connect the app to Comms.** At `https://comms.northlight.ai`, sign in and choose **Connect an app**. This is done in a browser only.
36
+ 4. **Turn Texting on.** On the app's page there, or with `crtr comms turn-on`: a display name, a square avatar, the HELP text and your test webhook URL. The page shows the test webhook signing secret.
37
+ 5. **Text it from your own phone, in test mode.** Add yourself as a tester (`crtr comms testers add --app-id <id> --phone <number> --label <name>`, or the site), then text `JOIN <code>` to the test number. Test mode is free; the [Comms guide](https://comms.northlight.ai/llms.txt) has the tester limit.
38
+ 6. **Go to production** when you want your app's own number and anyone to text it. Production is paid: add a card on the billing account, and Comms gets your app its own number.
39
+
40
+ Comms is priced per person your app texts with in production each month; fake mode and testing are free. The SDK is [`@north-light/comms`](https://www.npmjs.com/package/@north-light/comms) on npm. Its 0.3.0 release declares `@north-light/sdk` 0.3.457 as an exact optional peer, so in a project pinned to a newer SDK install it with `npm i @north-light/comms --legacy-peer-deps`.
41
+
42
+ ## Rules
43
+
44
+ - **People text first.** Your app can text a person only after they texted your number in that environment, and until they send STOP. A send to anyone else fails `403 not_texted_first`.
45
+ - **Address people by `contact_id` or `user_id`**, never by phone number.
46
+ - **Derive `idempotency_key` from the event you are answering**, so a retried webhook sends nothing twice. Deduplicate deliveries on `event.id`.
47
+ - **Verify the raw body** with `verifyWebhook` before you parse it, and answer `2xx` within 15 seconds.
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: Let your app use our AI
3
+ description: Start agent runs on each person's own Northlight runtime, with their memory, files and tools, paid by their AI subscription. Typed results, streaming, background runs and documents.
4
+ ---
5
+
6
+ # Let your app use our AI
7
+
8
+ Your app starts agents on the person's own Northlight runtime. Each run has their memory, files and tools, works under the scopes they approved, and its model calls are paid by their AI subscription, not by you.
9
+
10
+ <include lang="ts">../../examples/apps/runs-parse.ts</include>
11
+
12
+ `runs.parse` starts a run and returns a value checked against your schema. `runs.start` returns at once and lets you follow the run, reply to it or leave it running.
13
+
14
+ ## Guides
15
+
16
+ | Page | What it covers |
17
+ |---|---|
18
+ | [Runs](/docs/concepts/runs) | Start a run, its status and outcome, a run's own scopes, and how to bound one |
19
+ | [Typed results](/docs/guides/typed-results) | Get a value back with `runs.parse` and a schema; never parse the trace |
20
+ | [Stream a run](/docs/guides/stream-a-run) | Show the agent's text and tool calls as they happen |
21
+ | [Background runs](/docs/guides/background-runs) | Learn when a run you did not wait on has ended, with `RunWatcher` or run notices |
22
+ | [Files and documents](/docs/guides/files-and-documents) | Download a file from a run, and read the person's public documents |
23
+ | [Many users](/docs/guides/many-users) | Keep each person's runtime separate when people meet in your app |
24
+
25
+ To schedule work, call `runs.start` from your own timer. A run's agent may also schedule itself with `crtr cron add` when the run holds `crtr:schedule` ([Scopes and grants](/docs/concepts/scopes-and-grants)).
26
+
27
+ An app that pays for its own model calls instead can serve them from its own service with `inferenceEndpoint` from `@north-light/sdk`; see the [release notes](/docs/release-notes) and the [reference](/docs/reference).
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: Let your app use our apps
3
+ description: Call Northlight's providers from your app on the person's runtime — texting their phone, web search, their connected accounts, their Mac — with providers.tools and providers.call.
4
+ ---
5
+
6
+ # Let your app use our apps
7
+
8
+ Northlight's own apps are providers your app can call on the person's runtime: text their phone, place calls, search the web, open a cloud browser, read and act in the accounts they connected, and use their Mac. The person approves each provider's scope once, on your app's consent page.
9
+
10
+ <include lang="ts">../../examples/apps/provider-tools.ts</include>
11
+
12
+ Every provider works the same way: ask for its scope, list its tools with `providers.tools('<provider>')`, then call one with `providers.call`. Scope strings, tool names and arguments come from those lists, never from memory.
13
+
14
+ ## Providers
15
+
16
+ | Provider id | What it does | Page |
17
+ |---|---|---|
18
+ | `sms` | Texts the signed-in person's own verified phone | [Texting (sms)](/docs/providers/sms) |
19
+ | `search` | Web search, sourced answers, page contents and paid data endpoints | [Search](/docs/providers/search) |
20
+ | `integrations` | The person's own accounts at other services | [Integrations](/docs/providers/integrations) |
21
+ | `context` | Ask about the person from their memory, and look up public profiles | [Context](/docs/providers/context) |
22
+ | `device` | The person's Mac: browser, files, Messages and shell | [Device](/docs/providers/device) |
23
+
24
+ These five have pages here. Northlight also runs `phone` (calls from Northlight's number, with an AI voice), `browser` (cloud browser sessions) and `meetings` (the person's meeting notes and transcripts), which have no page yet. For any of them, `providers.tools()` with no argument lists every provider installed on the person's runtime, `providers.tools('<provider>')` lists its tools and arguments, and the console's **Add permissions** list shows every scope your app can ask for.
25
+
26
+ ## Guides
27
+
28
+ | Page | What it covers |
29
+ |---|---|
30
+ | [Providers](/docs/concepts/providers) | Scopes, finding and calling tools, and providers your app requires |
31
+ | [Providers index](/docs/providers) | Every first-party provider, its scopes and where names come from |
32
+ | [Grant changes](/docs/guides/grant-changes) | When a person adds or removes a scope, and waiting on a provider's setup |
@@ -5,7 +5,7 @@ description: Join a laptop to your Northlight account with crtr sys join so crtr
5
5
 
6
6
  # Join a machine to your Northlight account
7
7
 
8
- Joining makes this machine one of your Northlight account's machines, so `crtr cloud …` commands run as you. Building an app does not need it: the [SDK docs site](https://sdk.docs.northlight.ai/docs/quickstart) takes you through the web console. Join when you want to run `crtr cloud apps` yourself.
8
+ Joining makes this machine one of your Northlight account's machines, so `crtr cloud …` commands run as you. Join when you want to run `crtr cloud apps` yourself, or to let your own crtr agents build and manage your Northlight apps. Building an app works without it too: the [SDK docs site](https://sdk.docs.northlight.ai/docs/get-started) uses `npx @north-light/sdk` and the web console.
9
9
 
10
10
  Create your account at `https://account.northlight.ai/signup` first. Then 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.
11
11
 
@@ -30,7 +30,7 @@ definePlugin({
30
30
  });
31
31
  ```
32
32
 
33
- Each group has `consentLine`, the line the directory's consent page shows, and optionally `who` (`own`, `user`, `allowlist`, `any` or `team:<id>`; the directory treats an omitted `who` as `user`) and `allowlist` (app principals `app:<id>`, required with `who: 'allowlist'` and refused otherwise). `buildBundle` writes the block into `bundle.json` as `groups`, and the directory applies it when it refreshes the provider's manifest. The directory refuses a provider archive whose `bundle.json` has no `groups` (`bundle.json groups: is required`), and a provider's groups come only from this declaration: the directory's console and CLI do not edit groups. `definePlugin` itself accepts a provider without `groups`, but once declared every leaf's `group` must name a declared group and every declared group must be used by at least one leaf; `definePlugin` throws `PluginDefinitionError` otherwise. A plugin that is not `provider: true` must not declare `groups`.
33
+ Each group has `consentLine`, the line the directory's consent page shows, and optionally `who` (`own`, `user`, `allowlist`, `any` or `team:<id>`; the directory treats an omitted `who` as `user`) and `allowlist` (app principals `app:<id>`, required with `who: 'allowlist'` and refused otherwise). `buildBundle` writes the block into `bundle.json` as `groups`, and the directory applies it when it refreshes the provider's manifest. The directory refuses a provider archive whose `bundle.json` has no `groups` (`bundle.json groups: is required`), and a provider's groups come only from this declaration: the directory's console and CLI do not edit groups. `definePlugin` itself accepts a provider without `groups`, but once declared every leaf's `group` must name a declared group, or `definePlugin` throws `PluginDefinitionError`. A declared group no leaf uses is allowed: a provider that ships documents only (`commands: {}` and a `memory` array) declares one so a grant naming it installs the bundle, and it adds no `crtr` command. A plugin that is not `provider: true` must not declare `groups`.
34
34
 
35
35
  A branch or leaf may set `tier` to `common` or `important` to be promoted into its parent's `-h`. A command with more than 40 children lists only its promoted children in its own `-h`, followed by the count of the rest; the others still run and answer `-h` by name. Use this when a plugin mounts one command per entry of a large catalog. On such a command only promoted leaves reach the top-level `crtr -h`; a promoted branch shows in the command's own `-h`.
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.542",
3
+ "version": "0.3.544",
4
4
  "description": "crtr — agent runtime with memory, plugins, and marketplaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -140,7 +140,7 @@
140
140
  },
141
141
  "license": "UNLICENSED",
142
142
  "dependencies": {
143
- "@north-light/identity": "0.3.542",
143
+ "@north-light/identity": "0.3.544",
144
144
  "@earendil-works/pi-agent-core": "1.1.0",
145
145
  "@earendil-works/pi-ai": "1.1.0",
146
146
  "@earendil-works/pi-coding-agent": "1.1.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/identity",
3
- "version": "0.3.542",
3
+ "version": "0.3.544",
4
4
  "description": "Northlight access-token verification and scope rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.542",
3
+ "version": "0.3.544",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.542",
9
+ "version": "0.3.544",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "workspaces": [
@@ -24,7 +24,7 @@
24
24
  "@milkdown/preset-gfm": "^7.22.3",
25
25
  "@milkdown/prose": "^7.22.3",
26
26
  "@milkdown/utils": "^7.22.3",
27
- "@north-light/identity": "0.3.542",
27
+ "@north-light/identity": "0.3.544",
28
28
  "cron-parser": "^5.6.0",
29
29
  "esbuild": "^0.27.7",
30
30
  "jose": "^6.2.12",
@@ -12455,17 +12455,17 @@
12455
12455
  },
12456
12456
  "packages/crouter-api": {
12457
12457
  "name": "@north-light/api",
12458
- "version": "0.3.542",
12458
+ "version": "0.3.544",
12459
12459
  "license": "UNLICENSED"
12460
12460
  },
12461
12461
  "packages/crouter-env-docker": {
12462
12462
  "name": "@north-light/env-docker",
12463
- "version": "0.3.542",
12463
+ "version": "0.3.544",
12464
12464
  "license": "UNLICENSED"
12465
12465
  },
12466
12466
  "packages/crouter-identity": {
12467
12467
  "name": "@north-light/identity",
12468
- "version": "0.3.542",
12468
+ "version": "0.3.544",
12469
12469
  "license": "UNLICENSED",
12470
12470
  "dependencies": {
12471
12471
  "jose": "^6.2.1"
@@ -12473,20 +12473,20 @@
12473
12473
  },
12474
12474
  "packages/crouter-plugin": {
12475
12475
  "name": "@north-light/plugin",
12476
- "version": "0.3.542",
12476
+ "version": "0.3.544",
12477
12477
  "license": "UNLICENSED",
12478
12478
  "dependencies": {
12479
- "@north-light/api": "0.3.542",
12480
- "@north-light/identity": "0.3.542"
12479
+ "@north-light/api": "0.3.544",
12480
+ "@north-light/identity": "0.3.544"
12481
12481
  }
12482
12482
  },
12483
12483
  "packages/crouter-sdk": {
12484
12484
  "name": "@north-light/sdk",
12485
- "version": "0.3.542",
12485
+ "version": "0.3.544",
12486
12486
  "license": "UNLICENSED",
12487
12487
  "dependencies": {
12488
- "@north-light/api": "0.3.542",
12489
- "@north-light/identity": "0.3.542",
12488
+ "@north-light/api": "0.3.544",
12489
+ "@north-light/identity": "0.3.544",
12490
12490
  "jose": "^6.2.1"
12491
12491
  },
12492
12492
  "bin": {