@remnic/core 9.69.53 → 9.69.55
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/dist/access-admin-ops-surface.js +2 -2
- package/dist/access-authorization-probe.js +3 -3
- package/dist/access-boundary.js +2 -2
- package/dist/access-cli.js +24 -24
- package/dist/access-extraction-force-flush.js +2 -2
- package/dist/access-http-briefing.js +3 -3
- package/dist/access-http-query.js +2 -2
- package/dist/access-http.js +14 -14
- package/dist/access-identity-continuity-surface.js +2 -2
- package/dist/access-lcm-surface.js +2 -2
- package/dist/access-mcp.js +9 -9
- package/dist/access-namespace-preflight.js +2 -2
- package/dist/access-observe-write-surface.js +2 -2
- package/dist/access-operations-batch.js +3 -3
- package/dist/access-operations.js +8 -8
- package/dist/access-recall-concurrency.js +2 -2
- package/dist/access-recall-response.js +2 -2
- package/dist/access-recall-surface.js +2 -2
- package/dist/access-service.js +2 -2
- package/dist/access-surface-catalog.js +4 -4
- package/dist/active-recall.js +2 -2
- package/dist/{chunk-ZADYEZY4.js → chunk-2SIKTXWX.js} +2 -2
- package/dist/{chunk-TS66MUUJ.js → chunk-3R23DDD3.js} +8 -8
- package/dist/{chunk-EQNZC3BH.js → chunk-3S6URXEH.js} +2 -2
- package/dist/{chunk-BCXZ4BDS.js → chunk-75YZ5VAI.js} +2 -2
- package/dist/{chunk-MXTCV3B5.js → chunk-AHVJ6GLL.js} +2 -2
- package/dist/{chunk-6UEM5EOB.js → chunk-AQ55YKEV.js} +2 -2
- package/dist/{chunk-VMKAA5SU.js → chunk-BSCNBIF4.js} +2 -2
- package/dist/{chunk-M7HFDWOS.js → chunk-FROKVQQY.js} +2 -2
- package/dist/{chunk-A4TQFNRX.js → chunk-GRDRVYXJ.js} +3 -3
- package/dist/{chunk-EYK3UHAP.js → chunk-H6WOFMOV.js} +2 -2
- package/dist/{chunk-SOOWBRMH.js → chunk-IYNCJKBM.js} +8 -8
- package/dist/{chunk-3KJTSCSX.js → chunk-J54B5DGD.js} +5 -4
- package/dist/chunk-J54B5DGD.js.map +1 -0
- package/dist/{chunk-UVZBDIJX.js → chunk-KIGC55FQ.js} +489 -49
- package/dist/chunk-KIGC55FQ.js.map +1 -0
- package/dist/{chunk-KQQEZTH6.js → chunk-KQVBR7BC.js} +2 -2
- package/dist/{chunk-MTJUIIM4.js → chunk-MTWD4KMM.js} +2 -2
- package/dist/{chunk-JE4H2QBO.js → chunk-NNEWBRUL.js} +2 -2
- package/dist/{chunk-SEQ6DWXD.js → chunk-NPX6WMFJ.js} +2 -2
- package/dist/{chunk-Z22M4JCY.js → chunk-NZLFVLLJ.js} +165 -5
- package/dist/chunk-NZLFVLLJ.js.map +1 -0
- package/dist/{chunk-QKCXRS5A.js → chunk-OGXXGHW6.js} +11 -1
- package/dist/{chunk-QKCXRS5A.js.map → chunk-OGXXGHW6.js.map} +1 -1
- package/dist/{chunk-CO7KBRPF.js → chunk-TJNDFNCU.js} +2 -2
- package/dist/{chunk-K7FXR75S.js → chunk-XZRZJHBW.js} +361 -579
- package/dist/chunk-XZRZJHBW.js.map +1 -0
- package/dist/{chunk-HUQMVI3A.js → chunk-ZBYVR5W4.js} +2 -2
- package/dist/{chunk-ZANEMAEV.js → chunk-ZP73EM2X.js} +2 -2
- package/dist/{chunk-IEOBAOA6.js → chunk-ZXQPAYCS.js} +2 -2
- package/dist/cli.js +19 -19
- package/dist/compounding/engine.js +3 -3
- package/dist/config.js +2 -2
- package/dist/external-wiki-access.js +3 -3
- package/dist/index.d.ts +139 -41
- package/dist/index.js +36 -26
- package/dist/memory-browse-operations.js +3 -3
- package/dist/operator-toolkit.js +3 -3
- package/dist/orchestration/maintenance.js +3 -2
- package/dist/orchestrator.js +24 -24
- package/dist/recall-navigation-operations.js +3 -3
- package/dist/recall-navigation.js +2 -2
- package/dist/resume-bundles.js +3 -3
- package/dist/shared-context/manager.d.ts +16 -0
- package/dist/shared-context/manager.js +2 -2
- package/dist/support-passport/index.js +5 -5
- package/package.json +2 -2
- package/src/activity/config.test.ts +19 -0
- package/src/activity/config.ts +3 -4
- package/src/activity/index.ts +2 -0
- package/src/activity/timeline/index.ts +1 -0
- package/src/activity/timeline/week-dashboard.test.ts +362 -0
- package/src/activity/timeline/week-dashboard.ts +273 -0
- package/src/activity/timeline/weekly.ts +2 -1
- package/src/lifecycle/seed-graduation.test.ts +209 -0
- package/src/lifecycle/seed-graduation.ts +94 -11
- package/src/shared-context/governance-wiring.test.ts +153 -0
- package/src/shared-context/manager.ts +104 -3
- package/src/shared-context/staleness.ts +1 -1
- package/dist/chunk-3KJTSCSX.js.map +0 -1
- package/dist/chunk-K7FXR75S.js.map +0 -1
- package/dist/chunk-UVZBDIJX.js.map +0 -1
- package/dist/chunk-Z22M4JCY.js.map +0 -1
- /package/dist/{chunk-ZADYEZY4.js.map → chunk-2SIKTXWX.js.map} +0 -0
- /package/dist/{chunk-TS66MUUJ.js.map → chunk-3R23DDD3.js.map} +0 -0
- /package/dist/{chunk-EQNZC3BH.js.map → chunk-3S6URXEH.js.map} +0 -0
- /package/dist/{chunk-BCXZ4BDS.js.map → chunk-75YZ5VAI.js.map} +0 -0
- /package/dist/{chunk-MXTCV3B5.js.map → chunk-AHVJ6GLL.js.map} +0 -0
- /package/dist/{chunk-6UEM5EOB.js.map → chunk-AQ55YKEV.js.map} +0 -0
- /package/dist/{chunk-VMKAA5SU.js.map → chunk-BSCNBIF4.js.map} +0 -0
- /package/dist/{chunk-M7HFDWOS.js.map → chunk-FROKVQQY.js.map} +0 -0
- /package/dist/{chunk-A4TQFNRX.js.map → chunk-GRDRVYXJ.js.map} +0 -0
- /package/dist/{chunk-EYK3UHAP.js.map → chunk-H6WOFMOV.js.map} +0 -0
- /package/dist/{chunk-SOOWBRMH.js.map → chunk-IYNCJKBM.js.map} +0 -0
- /package/dist/{chunk-KQQEZTH6.js.map → chunk-KQVBR7BC.js.map} +0 -0
- /package/dist/{chunk-MTJUIIM4.js.map → chunk-MTWD4KMM.js.map} +0 -0
- /package/dist/{chunk-JE4H2QBO.js.map → chunk-NNEWBRUL.js.map} +0 -0
- /package/dist/{chunk-SEQ6DWXD.js.map → chunk-NPX6WMFJ.js.map} +0 -0
- /package/dist/{chunk-CO7KBRPF.js.map → chunk-TJNDFNCU.js.map} +0 -0
- /package/dist/{chunk-HUQMVI3A.js.map → chunk-ZBYVR5W4.js.map} +0 -0
- /package/dist/{chunk-ZANEMAEV.js.map → chunk-ZP73EM2X.js.map} +0 -0
- /package/dist/{chunk-IEOBAOA6.js.map → chunk-ZXQPAYCS.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared-context/governance.ts","../src/shared-context/authority-precedence.ts","../src/shared-context/envelope-actor.ts","../src/shared-context/iso-instant.ts","../src/shared-context/envelope-at.ts","../src/shared-context/envelope-id.ts","../src/shared-context/envelope-io.ts"],"sourcesContent":["/**\n * Shared-item authority envelope (issue #1957).\n *\n * Pure parse/default/expiry helpers over the authority classes. Binding is\n * never inferred, and the authority token is validated exactly as supplied\n * or stored — a padded value never resolves to a privileged class.\n */\n\nexport const SHARED_AUTHORITIES = [\"informational\", \"advisory\", \"binding\"] as const;\nexport type SharedAuthority = (typeof SHARED_AUTHORITIES)[number];\n\nexport interface SharedEnvelope {\n sharedBy?: string;\n authority: SharedAuthority;\n expiresAt?: string;\n supersedes?: string;\n}\n\nexport interface SharedEnvelopeInput {\n sharedBy?: string;\n authority?: string;\n expiresAt?: string;\n supersedes?: string;\n}\n\nexport interface ApplyDefaultEnvelopeOptions {\n binding?: boolean;\n}\n\nfunction isSharedAuthority(value: string): value is SharedAuthority {\n return (SHARED_AUTHORITIES as readonly string[]).includes(value);\n}\n\nfunction optionalString(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\ntype AuthorityToken =\n | { kind: \"absent\" }\n | { kind: \"invalid\"; raw: string }\n | { kind: \"valid\"; authority: SharedAuthority };\n\n/**\n * Read the authority token EXACTLY as supplied or stored. A padded value\n * such as `\" binding \"` is malformed data, never a normalized match for a\n * privileged class: trimming first would let stored whitespace resolve as\n * binding/advisory (AGENTS.md rule 45). Only the empty string counts as\n * \"unspecified\"; whitespace-only is invalid.\n */\nfunction readExactAuthority(value: unknown): AuthorityToken {\n if (typeof value !== \"string\" || value.length === 0) return { kind: \"absent\" };\n if (!isSharedAuthority(value)) return { kind: \"invalid\", raw: value };\n return { kind: \"valid\", authority: value };\n}\n\nfunction withOptionalFields(\n authority: SharedAuthority,\n source: { sharedBy?: unknown; expiresAt?: unknown; supersedes?: unknown },\n): SharedEnvelope {\n const envelope: SharedEnvelope = { authority };\n const sharedBy = optionalString(source.sharedBy);\n const expiresAt = optionalString(source.expiresAt);\n const supersedes = optionalString(source.supersedes);\n if (sharedBy) envelope.sharedBy = sharedBy;\n if (expiresAt) envelope.expiresAt = expiresAt;\n if (supersedes) envelope.supersedes = supersedes;\n return envelope;\n}\n\nexport function applyDefaultEnvelope(\n input: SharedEnvelopeInput = {},\n options: ApplyDefaultEnvelopeOptions = {},\n): SharedEnvelope {\n const requested = readExactAuthority(input.authority);\n if (requested.kind === \"invalid\") {\n throw new Error(\n `applyDefaultEnvelope: authority must be informational, advisory, or binding; got ${JSON.stringify(requested.raw)}`,\n );\n }\n if (requested.kind === \"valid\" && requested.authority === \"binding\" && options.binding !== true) {\n throw new Error(\"applyDefaultEnvelope: authority \\\"binding\\\" requires an explicit binding flag\");\n }\n return withOptionalFields(requested.kind === \"valid\" ? requested.authority : \"informational\", input);\n}\n\nexport function parseSharedEnvelope(raw: unknown): SharedEnvelope {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return { authority: \"informational\" };\n }\n const record = raw as Record<string, unknown>;\n const requested = readExactAuthority(record.authority);\n const authority = requested.kind === \"valid\" ? requested.authority : \"informational\";\n return withOptionalFields(authority, record);\n}\n\nexport function isExpired(envelope: Pick<SharedEnvelope, \"expiresAt\">, nowMs: number): boolean {\n if (!Number.isFinite(nowMs)) return false;\n const expiresAt = envelope.expiresAt?.trim();\n if (!expiresAt) return false;\n const expiresAtMs = Date.parse(expiresAt);\n if (!Number.isFinite(expiresAtMs)) return false;\n return expiresAtMs <= nowMs;\n}\n","/**\n * Shared-item authority precedence (issue #1957).\n *\n * Pure helpers over the authority classes owned by `governance.ts`\n * (`SHARED_AUTHORITIES`). Resolution is least-privilege: an absent,\n * malformed, or unrecognized authority never resolves above\n * `informational`, and `binding` additionally requires the explicit\n * `allowBinding` flag. The helpers are exported for callers; wiring them\n * into the shared-context read and write paths is a later slice.\n */\n\nimport { SHARED_AUTHORITIES, type SharedAuthority } from \"./governance.js\";\n\nexport { SHARED_AUTHORITIES as SHARED_AUTHORITY_CLASSES };\nexport type { SharedAuthority as SharedAuthorityClass };\n\nexport interface ResolveSharedAuthorityInput {\n /** Raw authority value from an item's envelope, if any. */\n authority?: unknown;\n /** Explicit opt-in required before \"binding\" is honored. */\n allowBinding?: boolean;\n}\n\nconst AUTHORITY_RANK: Readonly<Record<SharedAuthority, number>> = {\n informational: 0,\n advisory: 1,\n binding: 2,\n};\n\nfunction isKnownAuthority(value: string): value is SharedAuthority {\n return (SHARED_AUTHORITIES as readonly string[]).includes(value);\n}\n\n\nexport function resolveSharedAuthority(input: ResolveSharedAuthorityInput): SharedAuthority {\n // Read the security switch ONCE. A getter (or a Proxy) can return undefined\n // during validation and true at the decision, which would let binding\n // through without a validated opt-in.\n const allowBinding = input.allowBinding;\n if (allowBinding !== undefined && typeof allowBinding !== \"boolean\") {\n // The flag is the security switch, so a truthy string or number must\n // not enable binding: reject it instead of coercing.\n throw new TypeError(\n `resolveSharedAuthority: allowBinding must be a boolean when supplied, got ${typeof allowBinding}`,\n );\n }\n const authority = input.authority;\n // Absent (missing key, undefined, null) and present-but-invalid both land\n // on informational — the least-privileged class — so an unmarked or\n // malformed legacy item can never be treated as binding. Validate the\n // exact value: no trim, no case-fold, because \" binding\" and \"BINDING\"\n // are unrecognized data, not normalized matches for a known class.\n if (typeof authority !== \"string\") return \"informational\";\n if (!isKnownAuthority(authority)) return \"informational\";\n if (authority === \"binding\" && allowBinding !== true) {\n // Downgrade rather than throw: a legacy item already carrying \"binding\"\n // is stored data, not a caller bug, so it resolves to the highest class\n // that does not require the explicit opt-in.\n return \"advisory\";\n }\n return authority;\n}\n\nexport function compareSharedAuthority(a: string, b: string): number {\n const rankA = isKnownAuthority(a) ? AUTHORITY_RANK[a] : AUTHORITY_RANK.informational;\n const rankB = isKnownAuthority(b) ? AUTHORITY_RANK[b] : AUTHORITY_RANK.informational;\n return Math.sign(rankA - rankB);\n}\n","/**\n * Shared-item envelope actor parse (issue #1957 leftover).\n *\n * Pure. Empty is missing_actor. Newline is invalid_actor.\n */\n\nexport type ParseEnvelopeActorResult =\n | { ok: true; actor: string }\n | { ok: false; error: \"missing_actor\" | \"invalid_actor\" };\n\nexport function parseEnvelopeActor(value: string): ParseEnvelopeActorResult {\n const actor = value.trim();\n if (actor.length === 0) return { ok: false, error: \"missing_actor\" };\n if (actor.includes(\"\\n\")) return { ok: false, error: \"invalid_actor\" };\n return { ok: true, actor };\n}\n","/**\n * Strict ISO-8601 instant validation for shared-context envelopes\n * (issue #1957 review round 3).\n *\n * `Date.parse` is permissive: under the supported Node runtime it reads\n * `\"2026-02-30\"` as March 2 and `\"1\"` as January 1 2001. A caller-supplied\n * expiry would therefore be silently reinterpreted into a governance deadline\n * the caller never asked for. Validate the ISO shape AND the calendar\n * components against the exact input, and reject rather than normalize.\n *\n * Extracted from `provenance.ts` so the envelope write path and the\n * provenance stamp share one validator instead of two copies.\n */\n\n// Linear ISO instant. No nested quantifiers.\nconst ISO_INSTANT =\n /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$/;\n\n/**\n * True only for a calendar-valid ISO-8601 instant carrying an explicit zone.\n * Non-strings and non-finite parses are rejected explicitly, never coerced.\n */\nexport function isStrictIsoInstant(value: unknown): boolean {\n if (typeof value !== \"string\") return false;\n const match = ISO_INSTANT.exec(value);\n if (!match) return false;\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const hour = Number(match[4]);\n const minute = Number(match[5]);\n const second = Number(match[6]);\n const utc = new Date(Date.UTC(year, month - 1, day, hour, minute, second));\n return (\n Number.isFinite(Date.parse(value)) &&\n utc.getUTCFullYear() === year &&\n utc.getUTCMonth() === month - 1 &&\n utc.getUTCDate() === day &&\n utc.getUTCHours() === hour &&\n utc.getUTCMinutes() === minute &&\n utc.getUTCSeconds() === second\n );\n}\n","/**\n * Shared-item envelope at parse (issue #1957 leftover).\n *\n * Pure. Blank is missing_at. Anything that is not a calendar-valid ISO-8601\n * instant is invalid_at — including values permissive `Date.parse` would\n * silently reinterpret (`\"2026-02-30\"` -> March 2, `\"1\"` -> January 1 2001),\n * a whitespace-padded timestamp, and any non-string or non-finite input\n * (review round 3). `trim()` only detects blankness; validation reads the\n * exact value, so normalization can never widen what passes.\n */\n\nimport { isStrictIsoInstant } from \"./iso-instant.js\";\n\nexport type ParseEnvelopeAtResult =\n | { ok: true; at: string }\n | { ok: false; error: \"missing_at\" | \"invalid_at\" };\n\nexport function parseEnvelopeAt(value: string): ParseEnvelopeAtResult {\n if (typeof value !== \"string\") return { ok: false, error: \"invalid_at\" };\n if (value.trim().length === 0) return { ok: false, error: \"missing_at\" };\n if (!isStrictIsoInstant(value)) return { ok: false, error: \"invalid_at\" };\n return { ok: true, at: new Date(Date.parse(value)).toISOString() };\n}\n","/**\n * Shared-item envelope id parse (issue #1957 leftover).\n *\n * Pure. Empty is missing_id. Newline is invalid_id.\n */\n\nexport type ParseEnvelopeIdResult =\n | { ok: true; id: string }\n | { ok: false; error: \"missing_id\" | \"invalid_id\" };\n\nexport function parseEnvelopeId(value: string): ParseEnvelopeIdResult {\n const id = value.trim();\n if (id.length === 0) return { ok: false, error: \"missing_id\" };\n if (id.includes(\"\\n\")) return { ok: false, error: \"invalid_id\" };\n return { ok: true, id };\n}\n","/**\n * Shared-item envelope wiring (issue #1957, control 1: origin + authority).\n *\n * Bridges the pure envelope helpers onto the markdown frontmatter the\n * shared-context manager reads and writes.\n *\n * Write side rejects invalid input (an unrecognized authority or a binding\n * request without the config opt-in throws — never silently reinterpreted).\n * Read side resolves least privilege: a missing, malformed, or unrecognized\n * authority never resolves above informational, and stored binding\n * downgrades to advisory unless config opted in.\n */\n\nimport { applyDefaultEnvelope, parseSharedEnvelope, type SharedEnvelope } from \"./governance.js\";\nimport { resolveSharedAuthority } from \"./authority-precedence.js\";\nimport type { SharedAuthority } from \"./governance.js\";\nimport { parseEnvelopeActor } from \"./envelope-actor.js\";\nimport { parseEnvelopeAt } from \"./envelope-at.js\";\nimport { parseEnvelopeId } from \"./envelope-id.js\";\n\nexport interface ComposeWriteEnvelopeInput {\n /** Governance origin. Becomes the envelope's `sharedBy`. */\n origin: string;\n /** Requested authority class. Unrecognized values throw. */\n authority?: string;\n /** Optional ISO-8601 expiry. Invalid timestamps throw. */\n expiresAt?: string;\n /** Optional id of the item this one supersedes. */\n supersedes?: string;\n /** Config opt-in (`sharedContextAllowBindingAuthority`). Binding throws without it. */\n allowBinding: boolean;\n /**\n * Write instant for the expiry TTL policy (issue #2920). When finite, an\n * `expiresAt` must land strictly after it and within the maximum TTL —\n * a past or effectively-immortal expiry is a client input error, never a\n * silently accepted stamp.\n */\n nowMs?: number;\n}\n\nfunction requireEnvelopeActor(agentId: string): string {\n const parsed = parseEnvelopeActor(agentId);\n if (!parsed.ok) {\n throw new Error(`composeWriteEnvelope: agentId must be a non-blank single-line string (${parsed.error})`);\n }\n return parsed.actor;\n}\n\nfunction optionalEnvelopeAt(expiresAt: string | undefined): string | undefined {\n if (expiresAt === undefined) return undefined;\n const parsed = parseEnvelopeAt(expiresAt);\n if (!parsed.ok) {\n throw new Error(`composeWriteEnvelope: expiresAt must be a valid ISO-8601 timestamp (${parsed.error})`);\n }\n return parsed.at;\n}\n\n/** Maximum write-side TTL: 10 years. A farther `expiresAt` is rejected. */\nexport const MAX_WRITE_EXPIRES_AT_TTL_MS = 3650 * 24 * 60 * 60 * 1000;\n\nfunction assertBoundedFutureExpiry(expiresAt: string, nowMs: number): void {\n const expiresAtMs = Date.parse(expiresAt);\n if (expiresAtMs <= nowMs) {\n throw new Error(\"composeWriteEnvelope: expiresAt must be an instant strictly after the write time\");\n }\n if (expiresAtMs - nowMs > MAX_WRITE_EXPIRES_AT_TTL_MS) {\n throw new Error(\n `composeWriteEnvelope: expiresAt exceeds the maximum TTL of ${MAX_WRITE_EXPIRES_AT_TTL_MS}ms`,\n );\n }\n}\n\nfunction optionalEnvelopeId(supersedes: string | undefined): string | undefined {\n if (supersedes === undefined) return undefined;\n const parsed = parseEnvelopeId(supersedes);\n if (!parsed.ok) {\n throw new Error(`composeWriteEnvelope: supersedes must be a non-blank single-line id (${parsed.error})`);\n }\n return parsed.id;\n}\n\n/**\n * Reserved governance origin for an authenticated external access write that\n * resolved no principal (`agentAccessHttp.principal` unset, no adapter\n * identity). Server-owned: the caller cannot mint or influence it, and the\n * caller-supplied `agentId` never becomes audit metadata on that path.\n */\nexport const UNATTRIBUTED_ACCESS_WRITE_ORIGIN = \"unattributed:access-surface\";\n\nexport interface ResolvedWriteIdentity {\n /**\n * Producer identity: frontmatter `agent`, on-disk segment, and the\n * cross-signals grouping key. Self-declared by the caller only on\n * surfaces that resolved no server identity; never decides authority.\n */\n agent: string;\n /** Governance origin stamped as the envelope's `sharedBy`. */\n origin: string;\n}\n\n/**\n * Resolve the producer identity and governance origin for a shared-context\n * write. They are different fields with different trust requirements:\n *\n * - The origin (`sharedBy`) is audit metadata and is always server-derived.\n * When the surface resolved an authenticated identity, that identity IS the\n * origin; when it resolved none but the write crosses an external\n * boundary, the caller-supplied `unattributedOrigin` token is stamped\n * instead — never the caller's value. Only a trusted in-process caller\n * (no identity, no token) may stamp its own id as the origin.\n * - The producer (`agent`) drives grouping and display only. When an\n * authenticated identity exists it is also the producer, and a\n * caller-supplied `agentId` naming a different agent is REJECTED, so a\n * caller can never publish an item attributed to another agent. Without a\n * server identity the caller's label stands as the producer — collapsing\n * it instead would merge every writer into one agent and erase\n * multi-agent overlaps from `synthesizeCrossSignals`.\n */\nexport function resolveWriteOrigin(input: {\n agentId: string;\n authenticatedIdentity?: string;\n unattributedOrigin?: string;\n}): ResolvedWriteIdentity {\n const identity = input.authenticatedIdentity?.trim() ?? \"\";\n if (identity.length > 0) {\n const requested = input.agentId.trim();\n if (requested.length > 0 && requested !== identity) {\n throw new Error(\n `shared-context write origin mismatch: authenticated identity ${JSON.stringify(identity)} cannot publish as ${JSON.stringify(requested)}`,\n );\n }\n return { agent: identity, origin: identity };\n }\n const unattributed = input.unattributedOrigin?.trim() ?? \"\";\n if (unattributed.length > 0) {\n const label = input.agentId.trim();\n return {\n agent: label.length > 0 ? requireProducer(label) : requireProducer(unattributed),\n origin: requireProducer(unattributed),\n };\n }\n const actor = requireProducer(input.agentId);\n return { agent: actor, origin: actor };\n}\n\nfunction requireProducer(value: string): string {\n const parsed = parseEnvelopeActor(value);\n if (!parsed.ok) {\n throw new Error(`shared-context write producer must be a non-blank single-line string (${parsed.error})`);\n }\n return parsed.actor;\n}\n\n/**\n * Validate and compose the envelope for a shared-context write.\n * `sharedBy` is stamped from the server-derived origin — provenance is\n * never injected through item content or the caller's producer label.\n */\nexport function composeWriteEnvelope(input: ComposeWriteEnvelopeInput): SharedEnvelope {\n const sharedBy = requireEnvelopeActor(input.origin);\n const expiresAt = optionalEnvelopeAt(input.expiresAt);\n if (expiresAt !== undefined && Number.isFinite(input.nowMs ?? Number.NaN)) {\n assertBoundedFutureExpiry(expiresAt, input.nowMs as number);\n }\n const supersedes = optionalEnvelopeId(input.supersedes);\n return applyDefaultEnvelope(\n { sharedBy, authority: input.authority, expiresAt, supersedes },\n { binding: input.allowBinding },\n );\n}\n\n/** Serialize an envelope into frontmatter lines (caller adds the `---` fences). */\nexport function envelopeToFrontmatterLines(envelope: SharedEnvelope): string[] {\n const line = (key: string, value: string) => `${key}: ${JSON.stringify(value)}`;\n const lines = [line(\"sharedBy\", envelope.sharedBy ?? \"\"), line(\"authority\", envelope.authority)];\n if (envelope.expiresAt !== undefined) lines.push(line(\"expiresAt\", envelope.expiresAt));\n if (envelope.supersedes !== undefined) lines.push(line(\"supersedes\", envelope.supersedes));\n return lines;\n}\n\n/**\n * Build an envelope from frontmatter scalars already read off a stored item.\n * Missing scalars (legacy items) compose to informational with no expiry.\n */\nexport function envelopeFromScalars(scalars: {\n sharedBy: string | null;\n authority: string | null;\n expiresAt: string | null;\n supersedes: string | null;\n}): SharedEnvelope {\n const record: Record<string, string> = {};\n if (scalars.sharedBy !== null) record.sharedBy = scalars.sharedBy;\n if (scalars.authority !== null) record.authority = scalars.authority;\n if (scalars.expiresAt !== null) record.expiresAt = scalars.expiresAt;\n if (scalars.supersedes !== null) record.supersedes = scalars.supersedes;\n return parseSharedEnvelope(record);\n}\n\n/**\n * Resolve a stored envelope's authority for read-side consumption.\n * Least privilege: unrecognized/missing stays informational; binding\n * requires the config opt-in or downgrades to advisory.\n */\nexport function resolveReadAuthority(\n envelope: Pick<SharedEnvelope, \"authority\">,\n allowBinding: boolean,\n): SharedAuthority {\n return resolveSharedAuthority({ authority: envelope.authority, allowBinding });\n}\n"],"mappings":";AAQO,IAAM,qBAAqB,CAAC,iBAAiB,YAAY,SAAS;AAqBzE,SAAS,kBAAkB,OAAyC;AAClE,SAAQ,mBAAyC,SAAS,KAAK;AACjE;AAEA,SAAS,eAAe,OAAoC;AAC1D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,UAAU,MAAM,KAAK;AAC3B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAcA,SAAS,mBAAmB,OAAgC;AAC1D,MAAI,OAAO,UAAU,YAAY,MAAM,WAAW,EAAG,QAAO,EAAE,MAAM,SAAS;AAC7E,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO,EA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OAAO,SAAS,MAAM,SAAS,OAAO,GAAG,GAAG;AACzE,8BAA0B,WAAW,MAAM,KAAe;AAAA,EAC5D;AACA,QAAM,aAAa,mBAAmB,MAAM,UAAU;AACtD,SAAO;AAAA,IACL,EAAE,UAAU,WAAW,MAAM,WAAW,WAAW,WAAW;AAAA,IAC9D,EAAE,SAAS,MAAM,aAAa;AAAA,EAChC;AACF;AAGO,SAAS,2BAA2B,UAAoC;AAC7E,QAAM,OAAO,CAAC,KAAa,UAAkB,GAAG,GAAG,KAAK,KAAK,UAAU,KAAK,CAAC;AAC7E,QAAM,QAAQ,CAAC,KAAK,YAAY,SAAS,YAAY,EAAE,GAAG,KAAK,aAAa,SAAS,SAAS,CAAC;AAC/F,MAAI,SAAS,cAAc,OAAW,OAAM,KAAK,KAAK,aAAa,SAAS,SAAS,CAAC;AACtF,MAAI,SAAS,eAAe,OAAW,OAAM,KAAK,KAAK,cAAc,SAAS,UAAU,CAAC;AACzF,SAAO;AACT;AAMO,SAAS,oBAAoB,SAKjB;AACjB,QAAM,SAAiC,CAAC;AACxC,MAAI,QAAQ,aAAa,KAAM,QAAO,WAAW,QAAQ;AACzD,MAAI,QAAQ,cAAc,KAAM,QAAO,YAAY,QAAQ;AAC3D,MAAI,QAAQ,cAAc,KAAM,QAAO,YAAY,QAAQ;AAC3D,MAAI,QAAQ,eAAe,KAAM,QAAO,aAAa,QAAQ;AAC7D,SAAO,oBAAoB,MAAM;AACnC;AAOO,SAAS,qBACd,UACA,cACiB;AACjB,SAAO,uBAAuB,EAAE,WAAW,SAAS,WAAW,aAAa,CAAC;AAC/E;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/shared-context/governance.ts","../src/shared-context/authority-precedence.ts","../src/shared-context/envelope-actor.ts","../src/shared-context/iso-instant.ts","../src/shared-context/envelope-at.ts","../src/shared-context/envelope-id.ts","../src/shared-context/envelope-io.ts"],"sourcesContent":["/**\n * Shared-item authority envelope (issue #1957).\n *\n * Pure parse/default/expiry helpers over the authority classes. Binding is\n * never inferred, and the authority token is validated exactly as supplied\n * or stored — a padded value never resolves to a privileged class.\n */\n\nexport const SHARED_AUTHORITIES = [\"informational\", \"advisory\", \"binding\"] as const;\nexport type SharedAuthority = (typeof SHARED_AUTHORITIES)[number];\n\nexport interface SharedEnvelope {\n sharedBy?: string;\n authority: SharedAuthority;\n expiresAt?: string;\n supersedes?: string;\n}\n\nexport interface SharedEnvelopeInput {\n sharedBy?: string;\n authority?: string;\n expiresAt?: string;\n supersedes?: string;\n}\n\nexport interface ApplyDefaultEnvelopeOptions {\n binding?: boolean;\n}\n\nfunction isSharedAuthority(value: string): value is SharedAuthority {\n return (SHARED_AUTHORITIES as readonly string[]).includes(value);\n}\n\nfunction optionalString(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\ntype AuthorityToken =\n | { kind: \"absent\" }\n | { kind: \"invalid\"; raw: string }\n | { kind: \"valid\"; authority: SharedAuthority };\n\n/**\n * Read the authority token EXACTLY as supplied or stored. A padded value\n * such as `\" binding \"` is malformed data, never a normalized match for a\n * privileged class: trimming first would let stored whitespace resolve as\n * binding/advisory (AGENTS.md rule 45). Only the empty string counts as\n * \"unspecified\"; whitespace-only is invalid.\n */\nfunction readExactAuthority(value: unknown): AuthorityToken {\n if (typeof value !== \"string\" || value.length === 0) return { kind: \"absent\" };\n if (!isSharedAuthority(value)) return { kind: \"invalid\", raw: value };\n return { kind: \"valid\", authority: value };\n}\n\nfunction withOptionalFields(\n authority: SharedAuthority,\n source: { sharedBy?: unknown; expiresAt?: unknown; supersedes?: unknown },\n): SharedEnvelope {\n const envelope: SharedEnvelope = { authority };\n const sharedBy = optionalString(source.sharedBy);\n const expiresAt = optionalString(source.expiresAt);\n const supersedes = optionalString(source.supersedes);\n if (sharedBy) envelope.sharedBy = sharedBy;\n if (expiresAt) envelope.expiresAt = expiresAt;\n if (supersedes) envelope.supersedes = supersedes;\n return envelope;\n}\n\nexport function applyDefaultEnvelope(\n input: SharedEnvelopeInput = {},\n options: ApplyDefaultEnvelopeOptions = {},\n): SharedEnvelope {\n const requested = readExactAuthority(input.authority);\n if (requested.kind === \"invalid\") {\n throw new Error(\n `applyDefaultEnvelope: authority must be informational, advisory, or binding; got ${JSON.stringify(requested.raw)}`,\n );\n }\n if (requested.kind === \"valid\" && requested.authority === \"binding\" && options.binding !== true) {\n throw new Error(\"applyDefaultEnvelope: authority \\\"binding\\\" requires an explicit binding flag\");\n }\n return withOptionalFields(requested.kind === \"valid\" ? requested.authority : \"informational\", input);\n}\n\nexport function parseSharedEnvelope(raw: unknown): SharedEnvelope {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return { authority: \"informational\" };\n }\n const record = raw as Record<string, unknown>;\n const requested = readExactAuthority(record.authority);\n const authority = requested.kind === \"valid\" ? requested.authority : \"informational\";\n return withOptionalFields(authority, record);\n}\n\nexport function isExpired(envelope: Pick<SharedEnvelope, \"expiresAt\">, nowMs: number): boolean {\n if (!Number.isFinite(nowMs)) return false;\n const expiresAt = envelope.expiresAt?.trim();\n if (!expiresAt) return false;\n const expiresAtMs = Date.parse(expiresAt);\n if (!Number.isFinite(expiresAtMs)) return false;\n return expiresAtMs <= nowMs;\n}\n","/**\n * Shared-item authority precedence (issue #1957).\n *\n * Pure helpers over the authority classes owned by `governance.ts`\n * (`SHARED_AUTHORITIES`). Resolution is least-privilege: an absent,\n * malformed, or unrecognized authority never resolves above\n * `informational`, and `binding` additionally requires the explicit\n * `allowBinding` flag. The helpers are exported for callers; wiring them\n * into the shared-context read and write paths is a later slice.\n */\n\nimport { SHARED_AUTHORITIES, type SharedAuthority } from \"./governance.js\";\n\nexport { SHARED_AUTHORITIES as SHARED_AUTHORITY_CLASSES };\nexport type { SharedAuthority as SharedAuthorityClass };\n\nexport interface ResolveSharedAuthorityInput {\n /** Raw authority value from an item's envelope, if any. */\n authority?: unknown;\n /** Explicit opt-in required before \"binding\" is honored. */\n allowBinding?: boolean;\n}\n\nconst AUTHORITY_RANK: Readonly<Record<SharedAuthority, number>> = {\n informational: 0,\n advisory: 1,\n binding: 2,\n};\n\nfunction isKnownAuthority(value: string): value is SharedAuthority {\n return (SHARED_AUTHORITIES as readonly string[]).includes(value);\n}\n\n\nexport function resolveSharedAuthority(input: ResolveSharedAuthorityInput): SharedAuthority {\n // Read the security switch ONCE. A getter (or a Proxy) can return undefined\n // during validation and true at the decision, which would let binding\n // through without a validated opt-in.\n const allowBinding = input.allowBinding;\n if (allowBinding !== undefined && typeof allowBinding !== \"boolean\") {\n // The flag is the security switch, so a truthy string or number must\n // not enable binding: reject it instead of coercing.\n throw new TypeError(\n `resolveSharedAuthority: allowBinding must be a boolean when supplied, got ${typeof allowBinding}`,\n );\n }\n const authority = input.authority;\n // Absent (missing key, undefined, null) and present-but-invalid both land\n // on informational — the least-privileged class — so an unmarked or\n // malformed legacy item can never be treated as binding. Validate the\n // exact value: no trim, no case-fold, because \" binding\" and \"BINDING\"\n // are unrecognized data, not normalized matches for a known class.\n if (typeof authority !== \"string\") return \"informational\";\n if (!isKnownAuthority(authority)) return \"informational\";\n if (authority === \"binding\" && allowBinding !== true) {\n // Downgrade rather than throw: a legacy item already carrying \"binding\"\n // is stored data, not a caller bug, so it resolves to the highest class\n // that does not require the explicit opt-in.\n return \"advisory\";\n }\n return authority;\n}\n\nexport function compareSharedAuthority(a: string, b: string): number {\n const rankA = isKnownAuthority(a) ? AUTHORITY_RANK[a] : AUTHORITY_RANK.informational;\n const rankB = isKnownAuthority(b) ? AUTHORITY_RANK[b] : AUTHORITY_RANK.informational;\n return Math.sign(rankA - rankB);\n}\n","/**\n * Shared-item envelope actor parse (issue #1957 leftover).\n *\n * Pure. Empty is missing_actor. Newline is invalid_actor.\n */\n\nexport type ParseEnvelopeActorResult =\n | { ok: true; actor: string }\n | { ok: false; error: \"missing_actor\" | \"invalid_actor\" };\n\nexport function parseEnvelopeActor(value: string): ParseEnvelopeActorResult {\n const actor = value.trim();\n if (actor.length === 0) return { ok: false, error: \"missing_actor\" };\n if (actor.includes(\"\\n\")) return { ok: false, error: \"invalid_actor\" };\n return { ok: true, actor };\n}\n","/**\n * Strict ISO-8601 instant validation for shared-context envelopes\n * (issue #1957 review round 3).\n *\n * `Date.parse` is permissive: under the supported Node runtime it reads\n * `\"2026-02-30\"` as March 2 and `\"1\"` as January 1 2001. A caller-supplied\n * expiry would therefore be silently reinterpreted into a governance deadline\n * the caller never asked for. Validate the ISO shape AND the calendar\n * components against the exact input, and reject rather than normalize.\n *\n * Extracted from `provenance.ts` so the envelope write path and the\n * provenance stamp share one validator instead of two copies.\n */\n\n// Linear ISO instant. No nested quantifiers.\nconst ISO_INSTANT =\n /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$/;\n\n/**\n * True only for a calendar-valid ISO-8601 instant carrying an explicit zone.\n * Non-strings and non-finite parses are rejected explicitly, never coerced.\n */\nexport function isStrictIsoInstant(value: unknown): boolean {\n if (typeof value !== \"string\") return false;\n const match = ISO_INSTANT.exec(value);\n if (!match) return false;\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n const hour = Number(match[4]);\n const minute = Number(match[5]);\n const second = Number(match[6]);\n const utc = new Date(Date.UTC(year, month - 1, day, hour, minute, second));\n return (\n Number.isFinite(Date.parse(value)) &&\n utc.getUTCFullYear() === year &&\n utc.getUTCMonth() === month - 1 &&\n utc.getUTCDate() === day &&\n utc.getUTCHours() === hour &&\n utc.getUTCMinutes() === minute &&\n utc.getUTCSeconds() === second\n );\n}\n","/**\n * Shared-item envelope at parse (issue #1957 leftover).\n *\n * Pure. Blank is missing_at. Anything that is not a calendar-valid ISO-8601\n * instant is invalid_at — including values permissive `Date.parse` would\n * silently reinterpret (`\"2026-02-30\"` -> March 2, `\"1\"` -> January 1 2001),\n * a whitespace-padded timestamp, and any non-string or non-finite input\n * (review round 3). `trim()` only detects blankness; validation reads the\n * exact value, so normalization can never widen what passes.\n */\n\nimport { isStrictIsoInstant } from \"./iso-instant.js\";\n\nexport type ParseEnvelopeAtResult =\n | { ok: true; at: string }\n | { ok: false; error: \"missing_at\" | \"invalid_at\" };\n\nexport function parseEnvelopeAt(value: string): ParseEnvelopeAtResult {\n if (typeof value !== \"string\") return { ok: false, error: \"invalid_at\" };\n if (value.trim().length === 0) return { ok: false, error: \"missing_at\" };\n if (!isStrictIsoInstant(value)) return { ok: false, error: \"invalid_at\" };\n return { ok: true, at: new Date(Date.parse(value)).toISOString() };\n}\n","/**\n * Shared-item envelope id parse (issue #1957 leftover).\n *\n * Pure. Empty is missing_id. Newline is invalid_id.\n */\n\nexport type ParseEnvelopeIdResult =\n | { ok: true; id: string }\n | { ok: false; error: \"missing_id\" | \"invalid_id\" };\n\nexport function parseEnvelopeId(value: string): ParseEnvelopeIdResult {\n const id = value.trim();\n if (id.length === 0) return { ok: false, error: \"missing_id\" };\n if (id.includes(\"\\n\")) return { ok: false, error: \"invalid_id\" };\n return { ok: true, id };\n}\n","/**\n * Shared-item envelope wiring (issue #1957, control 1: origin + authority).\n *\n * Bridges the pure envelope helpers onto the markdown frontmatter the\n * shared-context manager reads and writes.\n *\n * Write side rejects invalid input (an unrecognized authority or a binding\n * request without the config opt-in throws — never silently reinterpreted).\n * Read side resolves least privilege: a missing, malformed, or unrecognized\n * authority never resolves above informational, and stored binding\n * downgrades to advisory unless config opted in.\n */\n\nimport { applyDefaultEnvelope, parseSharedEnvelope, type SharedEnvelope } from \"./governance.js\";\nimport { resolveSharedAuthority } from \"./authority-precedence.js\";\nimport type { SharedAuthority } from \"./governance.js\";\nimport { parseEnvelopeActor } from \"./envelope-actor.js\";\nimport { parseEnvelopeAt } from \"./envelope-at.js\";\nimport { parseEnvelopeId } from \"./envelope-id.js\";\n\nexport interface ComposeWriteEnvelopeInput {\n /** Governance origin. Becomes the envelope's `sharedBy`. */\n origin: string;\n /** Requested authority class. Unrecognized values throw. */\n authority?: string;\n /** Optional ISO-8601 expiry. Invalid timestamps throw. */\n expiresAt?: string;\n /** Optional id of the item this one supersedes. */\n supersedes?: string;\n /** Config opt-in (`sharedContextAllowBindingAuthority`). Binding throws without it. */\n allowBinding: boolean;\n /**\n * Write instant for the expiry TTL policy (issue #2920). When finite, an\n * `expiresAt` must land strictly after it and within the maximum TTL —\n * a past or effectively-immortal expiry is a client input error, never a\n * silently accepted stamp.\n */\n nowMs?: number;\n}\n\nfunction requireEnvelopeActor(agentId: string): string {\n const parsed = parseEnvelopeActor(agentId);\n if (!parsed.ok) {\n throw new Error(`composeWriteEnvelope: agentId must be a non-blank single-line string (${parsed.error})`);\n }\n return parsed.actor;\n}\n\nfunction optionalEnvelopeAt(expiresAt: string | undefined): string | undefined {\n if (expiresAt === undefined) return undefined;\n const parsed = parseEnvelopeAt(expiresAt);\n if (!parsed.ok) {\n throw new Error(`composeWriteEnvelope: expiresAt must be a valid ISO-8601 timestamp (${parsed.error})`);\n }\n return parsed.at;\n}\n\n/** Maximum write-side TTL: 10 years. A farther `expiresAt` is rejected. */\nexport const MAX_WRITE_EXPIRES_AT_TTL_MS = 3650 * 24 * 60 * 60 * 1000;\n\nfunction assertBoundedFutureExpiry(expiresAt: string, nowMs: number): void {\n const expiresAtMs = Date.parse(expiresAt);\n if (expiresAtMs <= nowMs) {\n throw new Error(\"composeWriteEnvelope: expiresAt must be an instant strictly after the write time\");\n }\n if (expiresAtMs - nowMs > MAX_WRITE_EXPIRES_AT_TTL_MS) {\n throw new Error(\n `composeWriteEnvelope: expiresAt exceeds the maximum TTL of ${MAX_WRITE_EXPIRES_AT_TTL_MS}ms`,\n );\n }\n}\n\nfunction optionalEnvelopeId(supersedes: string | undefined): string | undefined {\n if (supersedes === undefined) return undefined;\n const parsed = parseEnvelopeId(supersedes);\n if (!parsed.ok) {\n throw new Error(`composeWriteEnvelope: supersedes must be a non-blank single-line id (${parsed.error})`);\n }\n return parsed.id;\n}\n\n/**\n * Reserved governance origin for an authenticated external access write that\n * resolved no principal (`agentAccessHttp.principal` unset, no adapter\n * identity). Server-owned: the caller cannot mint or influence it, and the\n * caller-supplied `agentId` never becomes audit metadata on that path.\n */\nexport const UNATTRIBUTED_ACCESS_WRITE_ORIGIN = \"unattributed:access-surface\";\n\nexport interface ResolvedWriteIdentity {\n /**\n * Producer identity: frontmatter `agent`, on-disk segment, and the\n * cross-signals grouping key. Self-declared by the caller only on\n * surfaces that resolved no server identity; never decides authority.\n */\n agent: string;\n /** Governance origin stamped as the envelope's `sharedBy`. */\n origin: string;\n}\n\n/**\n * Resolve the producer identity and governance origin for a shared-context\n * write. They are different fields with different trust requirements:\n *\n * - The origin (`sharedBy`) is audit metadata and is always server-derived.\n * When the surface resolved an authenticated identity, that identity IS the\n * origin; when it resolved none but the write crosses an external\n * boundary, the caller-supplied `unattributedOrigin` token is stamped\n * instead — never the caller's value. Only a trusted in-process caller\n * (no identity, no token) may stamp its own id as the origin.\n * - The producer (`agent`) drives grouping and display only. When an\n * authenticated identity exists it is also the producer, and a\n * caller-supplied `agentId` naming a different agent is REJECTED, so a\n * caller can never publish an item attributed to another agent. Without a\n * server identity the caller's label stands as the producer — collapsing\n * it instead would merge every writer into one agent and erase\n * multi-agent overlaps from `synthesizeCrossSignals`.\n */\nexport function resolveWriteOrigin(input: {\n agentId: string;\n authenticatedIdentity?: string;\n unattributedOrigin?: string;\n}): ResolvedWriteIdentity {\n const identity = input.authenticatedIdentity?.trim() ?? \"\";\n if (identity.length > 0) {\n const requested = input.agentId.trim();\n if (requested.length > 0 && requested !== identity) {\n throw new Error(\n `shared-context write origin mismatch: authenticated identity ${JSON.stringify(identity)} cannot publish as ${JSON.stringify(requested)}`,\n );\n }\n return { agent: identity, origin: identity };\n }\n const unattributed = input.unattributedOrigin?.trim() ?? \"\";\n if (unattributed.length > 0) {\n const label = input.agentId.trim();\n return {\n agent: label.length > 0 ? requireProducer(label) : requireProducer(unattributed),\n origin: requireProducer(unattributed),\n };\n }\n const actor = requireProducer(input.agentId);\n return { agent: actor, origin: actor };\n}\n\nfunction requireProducer(value: string): string {\n const parsed = parseEnvelopeActor(value);\n if (!parsed.ok) {\n throw new Error(`shared-context write producer must be a non-blank single-line string (${parsed.error})`);\n }\n return parsed.actor;\n}\n\n/**\n * Validate and compose the envelope for a shared-context write.\n * `sharedBy` is stamped from the server-derived origin — provenance is\n * never injected through item content or the caller's producer label.\n */\nexport function composeWriteEnvelope(input: ComposeWriteEnvelopeInput): SharedEnvelope {\n const sharedBy = requireEnvelopeActor(input.origin);\n const expiresAt = optionalEnvelopeAt(input.expiresAt);\n if (expiresAt !== undefined && Number.isFinite(input.nowMs ?? Number.NaN)) {\n assertBoundedFutureExpiry(expiresAt, input.nowMs as number);\n }\n const supersedes = optionalEnvelopeId(input.supersedes);\n return applyDefaultEnvelope(\n { sharedBy, authority: input.authority, expiresAt, supersedes },\n { binding: input.allowBinding },\n );\n}\n\n/** Serialize an envelope into frontmatter lines (caller adds the `---` fences). */\nexport function envelopeToFrontmatterLines(envelope: SharedEnvelope): string[] {\n const line = (key: string, value: string) => `${key}: ${JSON.stringify(value)}`;\n const lines = [line(\"sharedBy\", envelope.sharedBy ?? \"\"), line(\"authority\", envelope.authority)];\n if (envelope.expiresAt !== undefined) lines.push(line(\"expiresAt\", envelope.expiresAt));\n if (envelope.supersedes !== undefined) lines.push(line(\"supersedes\", envelope.supersedes));\n return lines;\n}\n\n/**\n * Build an envelope from frontmatter scalars already read off a stored item.\n * Missing scalars (legacy items) compose to informational with no expiry.\n */\nexport function envelopeFromScalars(scalars: {\n sharedBy: string | null;\n authority: string | null;\n expiresAt: string | null;\n supersedes: string | null;\n}): SharedEnvelope {\n const record: Record<string, string> = {};\n if (scalars.sharedBy !== null) record.sharedBy = scalars.sharedBy;\n if (scalars.authority !== null) record.authority = scalars.authority;\n if (scalars.expiresAt !== null) record.expiresAt = scalars.expiresAt;\n if (scalars.supersedes !== null) record.supersedes = scalars.supersedes;\n return parseSharedEnvelope(record);\n}\n\n/**\n * Resolve a stored envelope's authority for read-side consumption.\n * Least privilege: unrecognized/missing stays informational; binding\n * requires the config opt-in or downgrades to advisory.\n */\nexport function resolveReadAuthority(\n envelope: Pick<SharedEnvelope, \"authority\">,\n allowBinding: boolean,\n): SharedAuthority {\n return resolveSharedAuthority({ authority: envelope.authority, allowBinding });\n}\n"],"mappings":";AAQO,IAAM,qBAAqB,CAAC,iBAAiB,YAAY,SAAS;AAqBzE,SAAS,kBAAkB,OAAyC;AAClE,SAAQ,mBAAyC,SAAS,KAAK;AACjE;AAEA,SAAS,eAAe,OAAoC;AAC1D,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAM,UAAU,MAAM,KAAK;AAC3B,SAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAcA,SAAS,mBAAmB,OAAgC;AAC1D,MAAI,OAAO,UAAU,YAAY,MAAM,WAAW,EAAG,QAAO,EAAE,MAAM,SAAS;AAC7E,MAAI,CAAC,kBAAkB,KAAK,EAAG,QAAO,EAAE,MAAM,WAAW,KAAK,MAAM;AACpE,SAAO,EAAE,MAAM,SAAS,WAAW,MAAM;AAC3C;AAEA,SAAS,mBACP,WACA,QACgB;AAChB,QAAM,WAA2B,EAAE,UAAU;AAC7C,QAAM,WAAW,eAAe,OAAO,QAAQ;AAC/C,QAAM,YAAY,eAAe,OAAO,SAAS;AACjD,QAAM,aAAa,eAAe,OAAO,UAAU;AACnD,MAAI,SAAU,UAAS,WAAW;AAClC,MAAI,UAAW,UAAS,YAAY;AACpC,MAAI,WAAY,UAAS,aAAa;AACtC,SAAO;AACT;AAEO,SAAS,qBACd,QAA6B,CAAC,GAC9B,UAAuC,CAAC,GACxB;AAChB,QAAM,YAAY,mBAAmB,MAAM,SAAS;AACpD,MAAI,UAAU,SAAS,WAAW;AAChC,UAAM,IAAI;AAAA,MACR,oFAAoF,KAAK,UAAU,UAAU,GAAG,CAAC;AAAA,IACnH;AAAA,EACF;AACA,MAAI,UAAU,SAAS,W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AU,KAAK,CAAC;AAC7E,QAAM,QAAQ,CAAC,KAAK,YAAY,SAAS,YAAY,EAAE,GAAG,KAAK,aAAa,SAAS,SAAS,CAAC;AAC/F,MAAI,SAAS,cAAc,OAAW,OAAM,KAAK,KAAK,aAAa,SAAS,SAAS,CAAC;AACtF,MAAI,SAAS,eAAe,OAAW,OAAM,KAAK,KAAK,cAAc,SAAS,UAAU,CAAC;AACzF,SAAO;AACT;AAMO,SAAS,oBAAoB,SAKjB;AACjB,QAAM,SAAiC,CAAC;AACxC,MAAI,QAAQ,aAAa,KAAM,QAAO,WAAW,QAAQ;AACzD,MAAI,QAAQ,cAAc,KAAM,QAAO,YAAY,QAAQ;AAC3D,MAAI,QAAQ,cAAc,KAAM,QAAO,YAAY,QAAQ;AAC3D,MAAI,QAAQ,eAAe,KAAM,QAAO,aAAa,QAAQ;AAC7D,SAAO,oBAAoB,MAAM;AACnC;AAOO,SAAS,qBACd,UACA,cACiB;AACjB,SAAO,uBAAuB,EAAE,WAAW,SAAS,WAAW,aAAa,CAAC;AAC/E;","names":[]}
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
defineOperation,
|
|
30
30
|
parseNamespacePreflightWriteOp,
|
|
31
31
|
resolveAuthorizedNamespaceWritablePreflight
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-ZBYVR5W4.js";
|
|
33
33
|
import {
|
|
34
34
|
parseSharedWriteOutputControls
|
|
35
35
|
} from "./chunk-IFBSZGW3.js";
|
|
@@ -594,4 +594,4 @@ defineOperation({ name: "graph_events", description: "SSE graph events.", schema
|
|
|
594
594
|
defineOperation({ name: "chat_message", description: "Chat message.", schema: strictSchema({ message: S.str, chatSessionId: S.str }), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
|
|
595
595
|
defineOperation({ name: "chat_events", description: "SSE chat events.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { stream: "sse" } }) });
|
|
596
596
|
defineOperation({ name: "adapters_status", description: "Adapter registry metadata (issue #1850 round 5). Marker op: the HTTP transport builds the response from its own adapterRegistry, but the op still must be registered so it appears in listRegisteredOperations and enforceTokenOp can gate it for scoped tokens.", schema: strictSchema({}), handler: async (_i, _ctx) => ({ result: { ok: true } }) });
|
|
597
|
-
//# sourceMappingURL=chunk-
|
|
597
|
+
//# sourceMappingURL=chunk-TJNDFNCU.js.map
|