@theholocron/cli 5.0.0-alpha.199 → 5.0.0-alpha.200

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
@@ -531,6 +531,50 @@ export default acmeConfig;
531
531
 
532
532
  ```
533
533
 
534
+ ## Notifications — server as code
535
+
536
+ A `notifications` provider can declare a whole server in `holocron.config.ts`
537
+ (`layout`: categories, channels, roles, access, server settings, welcome screen,
538
+ onboarding, the bot application) and the CLI applies and checks it. The
539
+ commands and the config are provider-neutral; Discord is the first provider.
540
+
541
+ | Command | What it does |
542
+ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
543
+ | `holocron notifications setup` | Applies the layout; looks everything up by name first, so a re-run changes nothing that matches |
544
+ | `holocron notifications channel add <name>` | Creates one channel (optionally with a webhook whose URL is stored as a secret) |
545
+ | `holocron notifications link` | Links your account on the provider to your GitHub account by signing in with the provider (OAuth, nothing secret kept) |
546
+ | `holocron notifications sync-roles` | Makes who holds a role match a GitHub team, through the links file (`--keep` only adds; `--provider` picks one) |
547
+ | `holocron doctor notifications [--built-only]` | Read-only, step by step: does the server match the layout, and do the secrets exist |
548
+
549
+ Config shape added for role sync and sign-in (all under the provider's `layout`):
550
+
551
+ | Field | Meaning |
552
+ | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
553
+ | `roles[].team` | A GitHub team slug. The role follows that team: given to linked members, taken from linked people who left. Never touches holders nobody has linked. |
554
+ | `links.hostedUrl` | A hosted sign-in service (Sentinel). `link` asks `<hostedUrl>/api/link` and uses it when it answers `{ "service": "link" }`; otherwise it signs in locally. |
555
+ | `links.localPort` | The port of the local sign-in listener (default `53682`, bound to `127.0.0.1` only). |
556
+ | `links.repo` / `links.path` | Where the links file lives (default `<org>/.github-private` and `notifications/<provider>-links.json`). |
557
+ | `application.intents.members` | Switches the Server Members Intent on or off (needed to list who holds a role). |
558
+ | `application.redirectUris` | Redirect URIs that must be registered. Check-only: the API cannot set them, so `setup` and the doctor say what to add in the developer portal. |
559
+
560
+ The links file is `{ "version": 1, "links": [{ "github": "<id>", "login": "<login>", "member": "<id>" }] }`: two public ids per person.
561
+ It is read and written through the `source` capability with the `github.user-sync` token (fine-grained, **only** the
562
+ private config repo, Contents read and write), so no other token needs Contents on other repositories.
563
+
564
+ Capability surface behind it (all optional, so providers without the concept omit them):
565
+
566
+ - `Source.teamMembers(teamSlug, org?)`, `Source.readFile(path, repo?)` (returns the `version` a later write must present),
567
+ `Source.writeFile(path, content, { message, version?, repo? })` (a changed `version` is refused: a real conflict check).
568
+ - `Notifications.roleMembers(role)`, `addRoleMember(role, memberId)`, `removeRoleMember(role, memberId)`.
569
+ - `Notifications.signIn()` returning `{ authorizeUrl, complete }`: the provider-neutral shape of "prove which account you own".
570
+ - `Notifications.ensureApplication` returns `{ updated, todo? }`; each `todo` is a step only a person can do (a portal setting
571
+ the API ignores) and is reported as a failure until done.
572
+
573
+ Provider credentials for Discord: `discord.holonet` is the **bot token** (Bot → Reset Token), `discord.holonet.oauth` is the
574
+ **OAuth client secret** (OAuth2 → Reset Secret). They are different values; the API can create or read neither.
575
+
576
+ See the [command pages](https://theholocron.dev/holocron/commands/notifications-setup/) for each command's options.
577
+
534
578
  ## Upgrading
535
579
 
536
580
  - **`holocron repo upgrade node <to>`** — patches every Node.js version pin
@@ -557,6 +601,7 @@ holocron auth set github.issues ghp_xxx # issue management
557
601
  holocron auth set github.sync ghp_xxx # sync-github workflow templates
558
602
  holocron auth set github.release ghp_xxx # semantic-release
559
603
  holocron auth set github.admin ghp_xxx # setup, secrets, environments
604
+ holocron auth set github.user-sync ghp_xxx # the files that link GitHub accounts to other services' members
560
605
  ```
561
606
 
562
607
  The resolution chain per capability is:
@@ -695,7 +740,9 @@ the local override exists to exempt.
695
740
  - `src/commands/` — `repo setup`, `repo sync`, `doctor`, `deploy`,
696
741
  `monitoring check`, `secrets set`, `secrets sync`, `package publish`,
697
742
  `package bump-versions`, `sync github`, `repo upgrade node`,
698
- `repo upgrade deps`, `new plugin`, `auth`
743
+ `repo upgrade deps`, `new plugin`, `auth`, `notifications setup`,
744
+ `notifications channel add`, `notifications link`,
745
+ `notifications sync-roles`, `doctor notifications`
699
746
  - `src/interactive-menu/` — the interactive fallback: `command-registry`
700
747
  (`COMMAND_REGISTRY`, each entry's `positionals`/`options`), `launch-menu`
701
748
  (Layers 1–2, picks + spawns a fresh `holocron <command>`), `child-argv`