@north-light/api 0.3.528 → 0.3.530

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.
@@ -6,7 +6,9 @@ export interface ReviveRequest {
6
6
  /** Clear the finalization latch before reviving (the `--reopen` gate). The
7
7
  * revive doorway accepts it only for a finalized node (`not_finalized`
8
8
  * otherwise); without it, a finalized node is rejected (`node_finalized`).
9
- * Message delivery has its own wider reopen behavior. */
9
+ * The target becomes resident, unless the caller is a node that is the
10
+ * target's manager: then it keeps its lifecycle. Message delivery has its
11
+ * own wider reopen behavior. */
10
12
  reopen?: boolean;
11
13
  /** Wake provenance: the cron whose run drove this revive (`CRTR_CRON_ID`,
12
14
  * set by the daemon in every cron run's environment and forwarded by the
@@ -19,9 +19,11 @@ export interface SendMessageRequest {
19
19
  from?: NodeIdDTO | null;
20
20
  /** Revive with no inbox entry (`--fresh` → `reviveNode({ resume: false })`). */
21
21
  fresh?: boolean;
22
- /** Before delivery, make the target resident and clear its finalization latch
23
- * when present (`--reopen`). Accepted for both durable and interactive
24
- * delivery; `--fresh` retains its separate finalized-only gate. */
22
+ /** Before delivery, clear the target's finalization latch when present and
23
+ * make it resident (`--reopen`), unless the caller is a node that is the
24
+ * target's manager: then the target keeps its lifecycle. Accepted for both
25
+ * durable and interactive delivery; `--fresh` retains its separate
26
+ * finalized-only gate. */
25
27
  reopen?: boolean;
26
28
  /** Hidden ambient context upserted onto the target's sidecar as a
27
29
  * `situational` card, never visible chat (`--situational-context`).
@@ -2,7 +2,7 @@ import { type ValidatedCommandManifest } from '../../api/command-manifest/manife
2
2
  import type { KindConfig, MemoryExtensionDeclarations, ObjectKindDeclaration, PageComponentRegistration, PluginBundle, PluginManifest, Scope } from '../../types.js';
3
3
  import { type BundleTransport } from './endpoint.js';
4
4
  /** Who may call a capability provider's tool group (contract 3). */
5
- export type ProviderGroupWho = 'own' | 'user' | 'allowlist' | 'any';
5
+ export type ProviderGroupWho = 'own' | 'user' | 'allowlist' | 'any' | `team:${string}`;
6
6
  /** One tool group a capability provider declares in `bundle.json`. */
7
7
  export interface ProviderGroupDeclaration {
8
8
  group: string;
@@ -15,6 +15,7 @@ const PROVIDER_ID = /^[A-Za-z0-9_-]{1,64}$/;
15
15
  const PROVIDER_KEYS = new Set(['id', 'major', 'groups']);
16
16
  const PROVIDER_GROUP_KEYS = new Set(['group', 'consent_line', 'rate', 'who', 'allowlist']);
17
17
  const PROVIDER_WHO = new Set(['own', 'user', 'allowlist', 'any']);
18
+ const PROVIDER_TEAM_WHO = /^team:[a-z0-9]+$/;
18
19
  // `groups` is a provider archive's tool-group declaration (consent lines, `who`); only the directory reads it, so an install accepts the key and ignores it.
19
20
  const BUNDLE_KEYS = new Set(['bundleVersion', 'kinds', 'page_components', 'memory_extensions', 'version', 'transport', 'provider', 'object_kinds', 'scopes', 'groups']);
20
21
  function issue(code, message, received, expected, next, path) {
@@ -195,8 +196,8 @@ function parseProviderBlock(raw) {
195
196
  if (rate !== undefined && rate !== null && (typeof rate !== 'number' || !Number.isFinite(rate) || rate < 0)) {
196
197
  return bad('provider group rate must be a non-negative number or null', JSON.stringify(rate), 'a finite number >= 0, null, or omitted', `${gp}.rate`);
197
198
  }
198
- if (typeof r['who'] !== 'string' || !PROVIDER_WHO.has(r['who'])) {
199
- return bad('provider group who must be own|user|allowlist|any', JSON.stringify(r['who']), 'own | user | allowlist | any', `${gp}.who`);
199
+ if (typeof r['who'] !== 'string' || !(PROVIDER_WHO.has(r['who']) || PROVIDER_TEAM_WHO.test(r['who']))) {
200
+ return bad('provider group who must be own|user|allowlist|any|team:<id>', JSON.stringify(r['who']), 'own | user | allowlist | any | team:<id> (id of lowercase letters and digits)', `${gp}.who`);
200
201
  }
201
202
  const allowlist = r['allowlist'];
202
203
  if (!Array.isArray(allowlist) || !allowlist.every((entry) => typeof entry === 'string' && entry.length > 0)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/api",
3
- "version": "0.3.528",
3
+ "version": "0.3.530",
4
4
  "description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/api/index.js",