@promptowl/contextnest-community 1.13.0 → 1.15.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/CONFIGURATION.md CHANGED
@@ -87,6 +87,7 @@ The server prints a loud warning at startup when `AUTH_MODE=open` is active.
87
87
  | `RUN_MAX_CONCURRENT_ROOTS` | `50` | Max concurrently-running root (depth-0) runs per nest (clamped 1..1000). The subagent caps bound a single tree; this bounds how many trees can run at once, so triggers can't flood a nest. |
88
88
  | `ANTHROPIC_API_KEY` | _(unset)_ | Server-wide default runner key for workflow-plane agent runs. Never returned by the API — the health endpoint reports presence only, and Settings shows a masked tail. |
89
89
  | `SLACK_WEBHOOK_URL` | _(unset — connector off)_ | Slack incoming-webhook URL for governance-event notifications (review submitted/approved/rejected, collaborator added). `https://` only — the URL embeds a secret. Also editable from Settings in the UI. |
90
+ | `MSTEAMS_WEBHOOK_URL` | _(unset — connector off)_ | Microsoft Teams incoming-webhook URL for the same governance events, posted as Adaptive Cards. `https://` only — the URL embeds a secret. Also editable from Settings in the UI. See [Microsoft Teams notifications](#microsoft-teams-notifications). |
90
91
  | `SMTP_URL` | _(unset — connector off)_ | SMTP connection URL for email notifications (`smtp://` or `smtps://`, credentials inline). Requires `NOTIFY_EMAIL_FROM` and `NOTIFY_EMAIL_TO`. Also editable from Settings. |
91
92
  | `NOTIFY_EMAIL_FROM` | _(unset)_ | From address for notification emails. |
92
93
  | `NOTIFY_EMAIL_TO` | _(unset)_ | Comma-separated recipients for notification emails. |
@@ -94,6 +95,61 @@ The server prints a loud warning at startup when `AUTH_MODE=open` is active.
94
95
 
95
96
  ---
96
97
 
98
+ ## Microsoft Teams notifications
99
+
100
+ Set `MSTEAMS_WEBHOOK_URL` (or paste the URL into **Settings → Notifications →
101
+ Microsoft Teams notifications**) and the server posts the same governance
102
+ events the Slack connector covers — review requested / approved / rejected,
103
+ collaborator added, plus per-nest burst digests — to one Teams channel as
104
+ [Adaptive Cards](https://adaptivecards.io/). Leave it empty to turn the
105
+ connector off. Delivery is fire-and-forget with a short timeout: a Teams
106
+ outage or a bad URL never slows down or fails the action that triggered the
107
+ message.
108
+
109
+ > Naming note: the setting is `msteams_webhook_url` / `MSTEAMS_WEBHOOK_URL`
110
+ > because "teams" in this product means user groups (the `/teams` API), not
111
+ > Microsoft Teams.
112
+
113
+ ### Create the incoming webhook in a Teams channel
114
+
115
+ Microsoft retired the classic Office 365 "Incoming Webhook" connectors;
116
+ webhooks are now created with the **Workflows** (Power Automate) app:
117
+
118
+ 1. In Microsoft Teams, open the channel that should receive notifications,
119
+ click **⋯ (More options) → Workflows**.
120
+ 2. Pick the template **"Post to a channel when a webhook request is
121
+ received"** (searching for "webhook" finds it), sign in if prompted, and
122
+ confirm the team + channel.
123
+ 3. Create the flow and **copy the HTTP POST URL** it shows (a
124
+ `https://….logic.azure.com/…` or `https://….powerplatform.com/…` address).
125
+ 4. Paste that URL into **Settings → Notifications → Microsoft Teams
126
+ notifications** (or set `MSTEAMS_WEBHOOK_URL`).
127
+ 5. Save, then click **Send test** on the card to post a test message and
128
+ confirm the channel receives it. (The button tests the *saved* URL — save
129
+ first, then test. The Slack card has the same button.)
130
+
131
+ If your tenant still has a legacy Office 365 connector webhook, it is expected
132
+ to accept the same payload envelope (legacy connectors documented support for
133
+ Adaptive Card attachments, though we have not verified one end-to-end — the
134
+ card's plain-text `fallbackText` is the safety net) — but create new hooks via
135
+ Workflows.
136
+
137
+ The URL embeds a secret — anyone holding it can post to the channel, so treat
138
+ it like a password (it is why the setting requires `https://`). The server
139
+ sends the standard envelope Workflows expects:
140
+ `{"type": "message", "attachments": [{"contentType":
141
+ "application/vnd.microsoft.card.adaptive", "content": {…card…}}]}` with a
142
+ plain-text `fallbackText` for clients that cannot render cards.
143
+
144
+ Per-nest connector rows post the same Adaptive Card format to a nest-specific
145
+ webhook, with per-event filtering: `POST /nests/:id/connectors` with a JSON
146
+ body like `{"channel": "teams", "url": "https://…", "events":
147
+ ["review_requested", "review_rejected"]}` (`events` may also be `["*"]`; the
148
+ `url` may be an `env:KEY` reference into the nest's env store). Manage rows
149
+ with `GET`/`PATCH`/`DELETE` on the same path.
150
+
151
+ ---
152
+
97
153
  ## Single sign-on (OIDC)
98
154
 
99
155
  Generic OpenID Connect sign-in against any spec-compliant identity provider —
@@ -223,6 +279,20 @@ On first connect the server creates its schema automatically (idempotent) — no
223
279
  manual migration step. There is no built-in SQLite→Postgres data migration; a new
224
280
  Postgres backend starts empty.
225
281
 
282
+ ### First-boot upgrade passes
283
+
284
+ Some upgrades carry a one-shot data pass that runs at startup, before the server
285
+ accepts requests, and records itself in `schema_migrations` so it never repeats.
286
+ Two exist today: the `node_versions` backfill from `history.yaml`, and the
287
+ version-chain repair added in 1.13 (re-anchors documents whose version chain was
288
+ grafted by an older import, and moves inline patches into `v{N}.diff` files).
289
+
290
+ Both walk every document in every nest, so on a large vault the **first** boot
291
+ after upgrading can take noticeably longer than usual — reads of the on-disk
292
+ vault, not database work, so an install on network/FUSE storage feels it most.
293
+ Every subsequent boot skips the pass entirely. Progress and a per-pass summary
294
+ are printed to the server log.
295
+
226
296
  > ⚠️ **Cloud Run durability — read this.** Cloud SQL persists only the *metadata
227
297
  > database*. The actual **document content and version history** live on the
228
298
  > filesystem under `$DATA_ROOT/nests/`, which on Cloud Run is **ephemeral** and is
@@ -234,7 +304,7 @@ Postgres backend starts empty.
234
304
  ### Runtime settings persistence
235
305
 
236
306
  Settings you change at runtime — everything on the **Settings page** (`/admin/settings`:
237
- sign-in gate, logo, base URL, upload limit, feature flags, OIDC SSO, Slack/SMTP connectors)
307
+ sign-in gate, logo, base URL, upload limit, feature flags, OIDC SSO, Slack/Teams/SMTP connectors)
238
308
  plus the **installed license key** — are stored in the database (`server_settings`
239
309
  table), **not** in a `.env` file. This is deliberate: on Cloud Run the container
240
310
  filesystem is ephemeral, so a file-based value was wiped by every rebuild, and each
package/README.md CHANGED
@@ -12,6 +12,7 @@ ContextNest Community Edition is a self-hosted server that lets you:
12
12
 
13
13
  - Store, version, and govern markdown-based context documents ("nests")
14
14
  - Import an existing folder or vault of markdown files in one step
15
+ - Export a nest as a portable bundle and re-import it on another self-hosted host
15
16
  - Apply stewardship workflows — draft, pending review, approved
16
17
  - Share nests with collaborators or publish them read-only to the public
17
18
  - Serve approved context to AI agents via MCP, HTTP, or CLI
@@ -93,6 +94,7 @@ For redistribution, hosted-service, OEM, or regulated-industry licensing, contac
93
94
  | Configurable nest storage (external / GCS volume mount) | ✅ | ✅ |
94
95
  | Markdown + YAML frontmatter vaults | ✅ | ✅ |
95
96
  | Import existing folder / vault | ✅ | ✅ |
97
+ | Export nest as portable bundle (.zip) | ✅ | ✅ |
96
98
  | Markdown rendering + wiki cross-linking | ✅ | ✅ |
97
99
  | External-edit detection + version diff | ✅ | ✅ |
98
100
  | Stewardship workflow (draft/review/approve) | ✅ | ✅ |
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GUNJTORH.js";
4
4
  import {
5
5
  getDb
6
- } from "./chunk-5QQ7WKAI.js";
6
+ } from "./chunk-BCFKLY4H.js";
7
7
 
8
8
  // src/governance/grants-service.ts
9
9
  import { v4 as uuid } from "uuid";