@elinpf/dsh-ops-access 0.1.6 → 0.2.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/lib/types.d.ts CHANGED
@@ -63,6 +63,40 @@ export interface AccessProvider {
63
63
  * in libcrypto at first use over exactly one missing newline).
64
64
  */
65
65
  normalizeTrailingNewline?: boolean;
66
+ /**
67
+ * Reference fields: maps a field name to the KIND it points at (e.g. ssh's
68
+ * `cred` → an `ssh-cred` entry), letting many entries share one credential
69
+ * instead of each carrying a copy. At resolve time core expands each
70
+ * present reference against the SAME registry and tier: the referenced
71
+ * entry is validated through its own provider and its fields are merged
72
+ * UNDER the referring entry's (the referring entry wins conflicts, e.g. a
73
+ * per-host user override). One level only — a referenced entry's own
74
+ * reference fields are NOT expanded. The referenced profile is an
75
+ * implementation detail of the referring resolve: the broker is consulted
76
+ * once, on the referring kind/name, never on the reference. A missing or
77
+ * invalid reference fails the referring resolve with a pointer to both
78
+ * entries, and canResolve reports the same.
79
+ */
80
+ references?: Record<string, string>;
81
+ /**
82
+ * Post-merge validator, run by core on the resolved fields AFTER reference
83
+ * expansion (and on the plain fields when the provider declares no
84
+ * references). Catches requirements that only hold on the merged shape —
85
+ * e.g. ssh needs a login user, which may come from the host entry OR from
86
+ * its referenced credential, so the entry schema cannot require it. Return
87
+ * an error message to fail the resolve, nothing to accept. Sync and
88
+ * structural only — same discipline as validateContent.
89
+ */
90
+ validateResolved?: (fields: Record<string, unknown>) => string | null | undefined;
91
+ /**
92
+ * Known limits of this kind's typical ro credential, in prose (e.g. "the
93
+ * view ClusterRole does not cover nodes/PVs — expect Forbidden"). Surfaced
94
+ * in the mention recall and help() so the agent learns the boundary BEFORE
95
+ * burning a call on a 403 it cannot fix — a mid-incident agent does not
96
+ * reliably infer a credential boundary from a bare Forbidden, and a
97
+ * compaction wipes the ones it learned the hard way (2026-09-10).
98
+ */
99
+ knownLimits?: string;
66
100
  /**
67
101
  * Capability probe (ticket 10): verify the credential's REAL
68
102
  * permissions against the claimed tier. Core runs it at save time,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elinpf/dsh-ops-access",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Ops access capability seam — owns the YAML credential registry and exposes ctx.opsAccess (resolve/list/register) to provider plugins.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",