@promptowl/contextnest-community 1.13.0 → 1.14.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 —
@@ -234,7 +290,7 @@ Postgres backend starts empty.
234
290
  ### Runtime settings persistence
235
291
 
236
292
  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)
293
+ sign-in gate, logo, base URL, upload limit, feature flags, OIDC SSO, Slack/Teams/SMTP connectors)
238
294
  plus the **installed license key** — are stored in the database (`server_settings`
239
295
  table), **not** in a `.env` file. This is deliberate: on Cloud Run the container
240
296
  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) | ✅ | ✅ |
@@ -27,6 +27,7 @@ if (envFileLoaded && !isTestRun) {
27
27
  var canonicalEnvFile = process.env.ENV_FILE_PATH || join(dataRoot(), ".env");
28
28
  var canonicalEnvLoaded = null;
29
29
  var slackUrlWarned = false;
30
+ var msteamsUrlWarned = false;
30
31
  var emailFromWarned = false;
31
32
  var emailToWarned = false;
32
33
  var oidcIssuerWarned = false;
@@ -355,6 +356,27 @@ var config = {
355
356
  }
356
357
  return raw;
357
358
  },
359
+ /**
360
+ * Optional Microsoft Teams incoming-webhook URL (Workflows app) for team
361
+ * notifications — same events as SLACK_WEBHOOK_URL, posted as Adaptive
362
+ * Cards. Empty/unset = connector off. https only — a webhook carries an
363
+ * implicit secret in its path, so it never travels plaintext. Named
364
+ * MSTEAMS_* deliberately: "teams" in this codebase means user groups.
365
+ */
366
+ get MSTEAMS_WEBHOOK_URL() {
367
+ const raw = process.env.MSTEAMS_WEBHOOK_URL?.trim();
368
+ if (!raw) return null;
369
+ if (!/^https:\/\//i.test(raw)) {
370
+ if (!msteamsUrlWarned) {
371
+ msteamsUrlWarned = true;
372
+ console.warn(
373
+ "[config] MSTEAMS_WEBHOOK_URL rejected: must be an https:// URL. Microsoft Teams notifications disabled."
374
+ );
375
+ }
376
+ return null;
377
+ }
378
+ return raw;
379
+ },
358
380
  get FEATURE_WORKFLOW_PLANE() {
359
381
  return process.env.FEATURE_WORKFLOW_PLANE === "true";
360
382
  },
@@ -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-I5KYGMIT.js";
7
7
 
8
8
  // src/governance/grants-service.ts
9
9
  import { v4 as uuid } from "uuid";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XQ46F76G.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-5QQ7WKAI.js";
7
+ } from "./chunk-I5KYGMIT.js";
8
8
 
9
9
  // src/governance/version-service.ts
10
10
  import { createHash } from "crypto";