@oscharko-dev/keiko-contracts 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/dist/.tsbuildinfo +1 -0
- package/dist/bff-wire.d.ts +661 -0
- package/dist/bff-wire.d.ts.map +1 -0
- package/dist/bff-wire.js +102 -0
- package/dist/bug-investigation-events.d.ts +92 -0
- package/dist/bug-investigation-events.d.ts.map +1 -0
- package/dist/bug-investigation-events.js +18 -0
- package/dist/coding-context.d.ts +76 -0
- package/dist/coding-context.d.ts.map +1 -0
- package/dist/coding-context.js +158 -0
- package/dist/connected-context.d.ts +174 -0
- package/dist/connected-context.d.ts.map +1 -0
- package/dist/connected-context.js +636 -0
- package/dist/conversation-budget.d.ts +37 -0
- package/dist/conversation-budget.d.ts.map +1 -0
- package/dist/conversation-budget.js +97 -0
- package/dist/editor-agent.d.ts +131 -0
- package/dist/editor-agent.d.ts.map +1 -0
- package/dist/editor-agent.js +197 -0
- package/dist/editor-completion.d.ts +62 -0
- package/dist/editor-completion.d.ts.map +1 -0
- package/dist/editor-completion.js +147 -0
- package/dist/editor-dirty-close.d.ts +17 -0
- package/dist/editor-dirty-close.d.ts.map +1 -0
- package/dist/editor-dirty-close.js +8 -0
- package/dist/editor-hot-exit.d.ts +18 -0
- package/dist/editor-hot-exit.d.ts.map +1 -0
- package/dist/editor-hot-exit.js +42 -0
- package/dist/editor-inline-completion.d.ts +70 -0
- package/dist/editor-inline-completion.d.ts.map +1 -0
- package/dist/editor-inline-completion.js +215 -0
- package/dist/editor-layout.d.ts +105 -0
- package/dist/editor-layout.d.ts.map +1 -0
- package/dist/editor-layout.js +479 -0
- package/dist/editor-patch-apply.d.ts +77 -0
- package/dist/editor-patch-apply.d.ts.map +1 -0
- package/dist/editor-patch-apply.js +122 -0
- package/dist/editor-session.d.ts +31 -0
- package/dist/editor-session.d.ts.map +1 -0
- package/dist/editor-session.js +75 -0
- package/dist/editor-test-generation.d.ts +104 -0
- package/dist/editor-test-generation.d.ts.map +1 -0
- package/dist/editor-test-generation.js +211 -0
- package/dist/evaluations.d.ts +75 -0
- package/dist/evaluations.d.ts.map +1 -0
- package/dist/evaluations.js +16 -0
- package/dist/evidence.d.ts +297 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +9 -0
- package/dist/gateway.d.ts +129 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +66 -0
- package/dist/harness.d.ts +274 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +38 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/language-service.d.ts +145 -0
- package/dist/language-service.d.ts.map +1 -0
- package/dist/language-service.js +161 -0
- package/dist/local-knowledge-large-document-validation.d.ts +7 -0
- package/dist/local-knowledge-large-document-validation.d.ts.map +1 -0
- package/dist/local-knowledge-large-document-validation.js +161 -0
- package/dist/local-knowledge-large-document.d.ts +113 -0
- package/dist/local-knowledge-large-document.d.ts.map +1 -0
- package/dist/local-knowledge-large-document.js +142 -0
- package/dist/local-knowledge-paths.d.ts +3 -0
- package/dist/local-knowledge-paths.d.ts.map +1 -0
- package/dist/local-knowledge-paths.js +65 -0
- package/dist/local-knowledge-records.d.ts +190 -0
- package/dist/local-knowledge-records.d.ts.map +1 -0
- package/dist/local-knowledge-records.js +36 -0
- package/dist/local-knowledge-schema-validation.d.ts +19 -0
- package/dist/local-knowledge-schema-validation.d.ts.map +1 -0
- package/dist/local-knowledge-schema-validation.js +115 -0
- package/dist/local-knowledge-schema.d.ts +14 -0
- package/dist/local-knowledge-schema.d.ts.map +1 -0
- package/dist/local-knowledge-schema.js +715 -0
- package/dist/local-knowledge-validation.d.ts +20 -0
- package/dist/local-knowledge-validation.d.ts.map +1 -0
- package/dist/local-knowledge-validation.js +487 -0
- package/dist/local-knowledge.d.ts +158 -0
- package/dist/local-knowledge.d.ts.map +1 -0
- package/dist/local-knowledge.js +63 -0
- package/dist/memory-audit-events.d.ts +73 -0
- package/dist/memory-audit-events.d.ts.map +1 -0
- package/dist/memory-audit-events.js +44 -0
- package/dist/memory-audit-validation.d.ts +4 -0
- package/dist/memory-audit-validation.d.ts.map +1 -0
- package/dist/memory-audit-validation.js +151 -0
- package/dist/memory-barrel.d.ts +15 -0
- package/dist/memory-barrel.d.ts.map +1 -0
- package/dist/memory-barrel.js +20 -0
- package/dist/memory-internal.d.ts +26 -0
- package/dist/memory-internal.d.ts.map +1 -0
- package/dist/memory-internal.js +104 -0
- package/dist/memory-operations-validation.d.ts +12 -0
- package/dist/memory-operations-validation.d.ts.map +1 -0
- package/dist/memory-operations-validation.js +267 -0
- package/dist/memory-operations.d.ts +156 -0
- package/dist/memory-operations.d.ts.map +1 -0
- package/dist/memory-operations.js +29 -0
- package/dist/memory-record-validation.d.ts +10 -0
- package/dist/memory-record-validation.d.ts.map +1 -0
- package/dist/memory-record-validation.js +101 -0
- package/dist/memory-records.d.ts +66 -0
- package/dist/memory-records.d.ts.map +1 -0
- package/dist/memory-records.js +22 -0
- package/dist/memory-retrieval-validation.d.ts +6 -0
- package/dist/memory-retrieval-validation.d.ts.map +1 -0
- package/dist/memory-retrieval-validation.js +108 -0
- package/dist/memory-validation.d.ts +31 -0
- package/dist/memory-validation.d.ts.map +1 -0
- package/dist/memory-validation.js +318 -0
- package/dist/memory-workflow-port.d.ts +26 -0
- package/dist/memory-workflow-port.d.ts.map +1 -0
- package/dist/memory-workflow-port.js +13 -0
- package/dist/memory.d.ts +81 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +104 -0
- package/dist/prompt-enhancer-analyzer.d.ts +7 -0
- package/dist/prompt-enhancer-analyzer.d.ts.map +1 -0
- package/dist/prompt-enhancer-analyzer.js +745 -0
- package/dist/prompt-enhancer-bff.d.ts +67 -0
- package/dist/prompt-enhancer-bff.d.ts.map +1 -0
- package/dist/prompt-enhancer-bff.js +156 -0
- package/dist/prompt-enhancer-critic.d.ts +46 -0
- package/dist/prompt-enhancer-critic.d.ts.map +1 -0
- package/dist/prompt-enhancer-critic.js +35 -0
- package/dist/prompt-enhancer-grounding.d.ts +19 -0
- package/dist/prompt-enhancer-grounding.d.ts.map +1 -0
- package/dist/prompt-enhancer-grounding.js +235 -0
- package/dist/prompt-enhancer-safety.d.ts +66 -0
- package/dist/prompt-enhancer-safety.d.ts.map +1 -0
- package/dist/prompt-enhancer-safety.js +446 -0
- package/dist/prompt-enhancer-validation.d.ts +28 -0
- package/dist/prompt-enhancer-validation.d.ts.map +1 -0
- package/dist/prompt-enhancer-validation.js +931 -0
- package/dist/prompt-enhancer.d.ts +184 -0
- package/dist/prompt-enhancer.d.ts.map +1 -0
- package/dist/prompt-enhancer.js +350 -0
- package/dist/qualityIntelligence/assertNever.d.ts +2 -0
- package/dist/qualityIntelligence/assertNever.d.ts.map +1 -0
- package/dist/qualityIntelligence/assertNever.js +7 -0
- package/dist/qualityIntelligence/auditSummary.d.ts +25 -0
- package/dist/qualityIntelligence/auditSummary.d.ts.map +1 -0
- package/dist/qualityIntelligence/auditSummary.js +7 -0
- package/dist/qualityIntelligence/bffWire.d.ts +356 -0
- package/dist/qualityIntelligence/bffWire.d.ts.map +1 -0
- package/dist/qualityIntelligence/bffWire.js +22 -0
- package/dist/qualityIntelligence/coverageMap.d.ts +21 -0
- package/dist/qualityIntelligence/coverageMap.d.ts.map +1 -0
- package/dist/qualityIntelligence/coverageMap.js +29 -0
- package/dist/qualityIntelligence/editableRevision.d.ts +21 -0
- package/dist/qualityIntelligence/editableRevision.d.ts.map +1 -0
- package/dist/qualityIntelligence/editableRevision.js +8 -0
- package/dist/qualityIntelligence/evidenceAtom.d.ts +35 -0
- package/dist/qualityIntelligence/evidenceAtom.d.ts.map +1 -0
- package/dist/qualityIntelligence/evidenceAtom.js +29 -0
- package/dist/qualityIntelligence/exportBundle.d.ts +28 -0
- package/dist/qualityIntelligence/exportBundle.d.ts.map +1 -0
- package/dist/qualityIntelligence/exportBundle.js +46 -0
- package/dist/qualityIntelligence/handoffEnvelope.d.ts +23 -0
- package/dist/qualityIntelligence/handoffEnvelope.d.ts.map +1 -0
- package/dist/qualityIntelligence/handoffEnvelope.js +8 -0
- package/dist/qualityIntelligence/ids.d.ts +58 -0
- package/dist/qualityIntelligence/ids.d.ts.map +1 -0
- package/dist/qualityIntelligence/ids.js +93 -0
- package/dist/qualityIntelligence/index.d.ts +29 -0
- package/dist/qualityIntelligence/index.d.ts.map +1 -0
- package/dist/qualityIntelligence/index.js +20 -0
- package/dist/qualityIntelligence/reviewRecord.d.ts +19 -0
- package/dist/qualityIntelligence/reviewRecord.d.ts.map +1 -0
- package/dist/qualityIntelligence/reviewRecord.js +20 -0
- package/dist/qualityIntelligence/runPlanAndEvents.d.ts +84 -0
- package/dist/qualityIntelligence/runPlanAndEvents.d.ts.map +1 -0
- package/dist/qualityIntelligence/runPlanAndEvents.js +51 -0
- package/dist/qualityIntelligence/sourceEnvelope.d.ts +77 -0
- package/dist/qualityIntelligence/sourceEnvelope.d.ts.map +1 -0
- package/dist/qualityIntelligence/sourceEnvelope.js +118 -0
- package/dist/qualityIntelligence/testCaseCandidate.d.ts +21 -0
- package/dist/qualityIntelligence/testCaseCandidate.d.ts.map +1 -0
- package/dist/qualityIntelligence/testCaseCandidate.js +21 -0
- package/dist/qualityIntelligence/testQualityRubric.d.ts +17 -0
- package/dist/qualityIntelligence/testQualityRubric.d.ts.map +1 -0
- package/dist/qualityIntelligence/testQualityRubric.js +32 -0
- package/dist/qualityIntelligence/validationFinding.d.ts +48 -0
- package/dist/qualityIntelligence/validationFinding.d.ts.map +1 -0
- package/dist/qualityIntelligence/validationFinding.js +36 -0
- package/dist/relationships-validation.d.ts +13 -0
- package/dist/relationships-validation.d.ts.map +1 -0
- package/dist/relationships-validation.js +422 -0
- package/dist/relationships.d.ts +79 -0
- package/dist/relationships.d.ts.map +1 -0
- package/dist/relationships.js +307 -0
- package/dist/text-safety.d.ts +7 -0
- package/dist/text-safety.d.ts.map +1 -0
- package/dist/text-safety.js +58 -0
- package/dist/tools.d.ts +153 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +118 -0
- package/dist/unit-test-events.d.ts +87 -0
- package/dist/unit-test-events.d.ts.map +1 -0
- package/dist/unit-test-events.js +14 -0
- package/dist/verification-summary.d.ts +38 -0
- package/dist/verification-summary.d.ts.map +1 -0
- package/dist/verification-summary.js +5 -0
- package/dist/verification.d.ts +64 -0
- package/dist/verification.d.ts.map +1 -0
- package/dist/verification.js +13 -0
- package/dist/workflow-descriptor.d.ts +21 -0
- package/dist/workflow-descriptor.d.ts.map +1 -0
- package/dist/workflow-descriptor.js +8 -0
- package/dist/workflow-handoff.d.ts +69 -0
- package/dist/workflow-handoff.d.ts.map +1 -0
- package/dist/workflow-handoff.js +381 -0
- package/dist/workspace-descriptors.d.ts +21 -0
- package/dist/workspace-descriptors.d.ts.map +1 -0
- package/dist/workspace-descriptors.js +180 -0
- package/dist/workspace-ui.d.ts +119 -0
- package/dist/workspace-ui.d.ts.map +1 -0
- package/dist/workspace-ui.js +105 -0
- package/dist/workspace.d.ts +104 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +27 -0
- package/package.json +71 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
// Pure deterministic validator for the relationship-engine contracts (Epic #532,
|
|
2
|
+
// Issue #538).
|
|
3
|
+
//
|
|
4
|
+
// This module is pure: no IO, no clock reads, no crypto, no randomness, no module-level
|
|
5
|
+
// side effects. The validator returns a discriminated `{ ok: true; value } | { ok: false;
|
|
6
|
+
// errors }` so downstream code can branch without throwing. Error messages are short,
|
|
7
|
+
// machine-readable, deterministic — one per failed invariant — and deliberately omit
|
|
8
|
+
// cross-workspace identifiers so the validator itself never leaks the foreign id
|
|
9
|
+
// (denial-reasons.md §"Cross-cutting invariants" body-free rule; audit-events.md §8.3
|
|
10
|
+
// FORBIDDEN field "cross-workspace identifiers on denied/cross-workspace").
|
|
11
|
+
//
|
|
12
|
+
// Scope: this validator covers the codes the contract layer can decide given the
|
|
13
|
+
// proposal record plus an optional pure context. The following codes are deliberately
|
|
14
|
+
// NOT enforced here because they require resources the contract package does not own:
|
|
15
|
+
//
|
|
16
|
+
// - `denied/path-not-contained` — enforced by @oscharko-dev/keiko-workspace at
|
|
17
|
+
// the API edge (assertContainedRealPath).
|
|
18
|
+
// - `denied/denied-by-deny-list` — enforced by the project deny-list resolver.
|
|
19
|
+
// - `denied/authority-insufficient` — enforced by the BFF authority gate.
|
|
20
|
+
// - `denied/endpoint-tombstoned|retired|unavailable` — emitted by the endpoint resolver
|
|
21
|
+
// and folded into our validation result via
|
|
22
|
+
// ctx.endpointResolver. (We surface these
|
|
23
|
+
// from the resolver; we do not detect them.)
|
|
24
|
+
// - `denied/kind-incompatible` — fires for `agent → evidence-run` after agent
|
|
25
|
+
// lands; while agent is forward-looking the
|
|
26
|
+
// validator returns `object-kind-not-yet-
|
|
27
|
+
// supported` per compatibility-matrix.md §3.
|
|
28
|
+
//
|
|
29
|
+
// The pure helper `assertRelationshipTypeAllowsKinds` is exported for the API layer to
|
|
30
|
+
// re-run the kind compatibility step in isolation (e.g. when scanning bulk proposals).
|
|
31
|
+
import { RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS, RELATIONSHIP_LIFECYCLE_STATES, RELATIONSHIP_OBJECT_KINDS, RELATIONSHIP_SCHEMA_VERSION, RELATIONSHIP_SUPPORTED_OBJECT_KINDS, RELATIONSHIP_TYPE_DEFINITIONS, RELATIONSHIP_TYPES, } from "./relationships.js";
|
|
32
|
+
// ─── Lifecycle transition table ───────────────────────────────────────────────
|
|
33
|
+
// Encoded directly from lifecycle.md §2 ("Transition table"). Read as: from-state →
|
|
34
|
+
// set of legal next-states. `(no-op)` self-transitions are admitted (lifecycle.md §2).
|
|
35
|
+
const LIFECYCLE_TRANSITIONS = {
|
|
36
|
+
draft: ["draft", "active", "archived", "superseded", "revoked", "blocked", "stale"],
|
|
37
|
+
active: ["active", "archived", "superseded", "revoked", "stale"],
|
|
38
|
+
archived: ["archived", "superseded", "revoked", "stale"],
|
|
39
|
+
superseded: ["superseded", "stale"],
|
|
40
|
+
revoked: ["revoked"],
|
|
41
|
+
blocked: ["blocked", "draft", "active", "archived", "revoked", "stale"],
|
|
42
|
+
stale: ["stale", "active", "archived", "superseded", "revoked"],
|
|
43
|
+
};
|
|
44
|
+
// ─── Shared primitive guards ──────────────────────────────────────────────────
|
|
45
|
+
function isRecord(value) {
|
|
46
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47
|
+
}
|
|
48
|
+
function isNonEmptyString(value) {
|
|
49
|
+
return typeof value === "string" && value.length > 0;
|
|
50
|
+
}
|
|
51
|
+
function isFiniteInteger(value) {
|
|
52
|
+
return typeof value === "number" && Number.isInteger(value) && Number.isFinite(value);
|
|
53
|
+
}
|
|
54
|
+
function makeError(code, message, field) {
|
|
55
|
+
return field === undefined ? { code, message } : { code, field, message };
|
|
56
|
+
}
|
|
57
|
+
// ─── Endpoint structural validation ───────────────────────────────────────────
|
|
58
|
+
function validateEndpointShape(endpoint, field, errors) {
|
|
59
|
+
if (!isRecord(endpoint)) {
|
|
60
|
+
errors.push(makeError("denied/schema-version-unsupported", `${field} must be an object`, field));
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
if (!isNonEmptyString(endpoint.kind)) {
|
|
64
|
+
errors.push(makeError("denied/schema-version-unsupported", `${field}.kind must be a non-empty string`, `${field}.kind`));
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (!isNonEmptyString(endpoint.id)) {
|
|
68
|
+
errors.push(makeError("denied/schema-version-unsupported", `${field}.id must be a non-empty string`, `${field}.id`));
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
if (!isNonEmptyString(endpoint.workspaceId)) {
|
|
72
|
+
errors.push(makeError("denied/schema-version-unsupported", `${field}.workspaceId must be a non-empty string`, `${field}.workspaceId`));
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
// Per-field check for the top-level required fields (storage.md §3.1). Pushed into
|
|
78
|
+
// `errors` as a side effect; caller checks `errors.length` to decide whether to proceed.
|
|
79
|
+
function checkRequiredStringField(input, field, errors) {
|
|
80
|
+
if (!isNonEmptyString(input[field])) {
|
|
81
|
+
errors.push(makeError("denied/schema-version-unsupported", `${field} must be a non-empty string`, field));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function checkRequiredTopLevelFields(input, errors) {
|
|
85
|
+
checkRequiredStringField(input, "id", errors);
|
|
86
|
+
checkRequiredStringField(input, "workspaceId", errors);
|
|
87
|
+
checkRequiredStringField(input, "createdAt", errors);
|
|
88
|
+
checkRequiredStringField(input, "updatedAt", errors);
|
|
89
|
+
if (!isFiniteInteger(input.etag) || input.etag < 0) {
|
|
90
|
+
errors.push(makeError("denied/schema-version-unsupported", "etag must be a non-negative finite integer", "etag"));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function structuralPrelude(input) {
|
|
94
|
+
if (!isRecord(input)) {
|
|
95
|
+
return {
|
|
96
|
+
errors: [makeError("denied/schema-version-unsupported", "relationship must be an object")],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const errors = [];
|
|
100
|
+
checkRequiredTopLevelFields(input, errors);
|
|
101
|
+
const sourceOk = validateEndpointShape(input.source, "source", errors);
|
|
102
|
+
const targetOk = validateEndpointShape(input.target, "target", errors);
|
|
103
|
+
if (errors.length > 0 || !sourceOk || !targetOk) {
|
|
104
|
+
return { errors };
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
errors: [],
|
|
108
|
+
value: {
|
|
109
|
+
record: input,
|
|
110
|
+
source: input.source,
|
|
111
|
+
target: input.target,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// ─── Schema-version check ─────────────────────────────────────────────────────
|
|
116
|
+
function checkSchemaVersion(record) {
|
|
117
|
+
if (record.schemaVersion !== RELATIONSHIP_SCHEMA_VERSION) {
|
|
118
|
+
return makeError("denied/schema-version-unsupported", `schemaVersion must be the literal "${RELATIONSHIP_SCHEMA_VERSION}"`, "schemaVersion");
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
// ─── Unknown enum checks ──────────────────────────────────────────────────────
|
|
123
|
+
function checkKindIsKnown(endpoint, field) {
|
|
124
|
+
const kind = endpoint.kind;
|
|
125
|
+
if (!RELATIONSHIP_OBJECT_KINDS.includes(kind)) {
|
|
126
|
+
return makeError("denied/schema-version-unsupported", `${field}.kind is not a known object kind`, `${field}.kind`);
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
function checkTypeIsKnown(record) {
|
|
131
|
+
const type = record.type;
|
|
132
|
+
if (!isNonEmptyString(type)) {
|
|
133
|
+
return makeError("denied/schema-version-unsupported", "type must be a non-empty string", "type");
|
|
134
|
+
}
|
|
135
|
+
if (!RELATIONSHIP_TYPES.includes(type)) {
|
|
136
|
+
return makeError("denied/schema-version-unsupported", "type is not a known relationship type", "type");
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
function checkLifecycleIsKnown(record) {
|
|
141
|
+
const state = record.lifecycleState;
|
|
142
|
+
if (!isNonEmptyString(state)) {
|
|
143
|
+
return makeError("denied/schema-version-unsupported", "lifecycleState must be a non-empty string", "lifecycleState");
|
|
144
|
+
}
|
|
145
|
+
if (!RELATIONSHIP_LIFECYCLE_STATES.includes(state)) {
|
|
146
|
+
return makeError("denied/schema-version-unsupported", "lifecycleState is not a known lifecycle state", "lifecycleState");
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
// ─── Endpoint-liveness folding (resolver-supplied) ────────────────────────────
|
|
151
|
+
function appendResolverError(side, status, errors) {
|
|
152
|
+
if (status === "missing") {
|
|
153
|
+
errors.push(makeError(side === "source" ? "denied/non-existent-source" : "denied/non-existent-target", `${side} endpoint does not exist`, side));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (status === "tombstoned") {
|
|
157
|
+
errors.push(makeError("denied/endpoint-tombstoned", `${side} endpoint has been tombstoned`, side));
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (status === "retired") {
|
|
161
|
+
errors.push(makeError("denied/endpoint-retired", `${side} endpoint has been retired`, side));
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (status === "unavailable") {
|
|
165
|
+
errors.push(makeError("denied/endpoint-unavailable", `${side} endpoint is unavailable`, side));
|
|
166
|
+
}
|
|
167
|
+
// "live" → nothing to append.
|
|
168
|
+
}
|
|
169
|
+
// ─── Forward-looking kind check ───────────────────────────────────────────────
|
|
170
|
+
function checkObjectKindSupported(endpoint, field) {
|
|
171
|
+
const kind = endpoint.kind;
|
|
172
|
+
if (!RELATIONSHIP_SUPPORTED_OBJECT_KINDS.includes(kind)) {
|
|
173
|
+
return makeError("denied/object-kind-not-yet-supported", `${field}.kind "${kind}" is reserved for a future release`, `${field}.kind`);
|
|
174
|
+
}
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
// ─── Kind compatibility (validSourceKinds / validTargetKinds) ─────────────────
|
|
178
|
+
// Pure helper exported so the API layer can re-run the kind compatibility step in
|
|
179
|
+
// isolation when scanning bulk proposals. Returns the FIRST applicable denial code
|
|
180
|
+
// (per the resolution order: source check before target check) or `null` when both
|
|
181
|
+
// kinds are admissible for the relationship type.
|
|
182
|
+
export function assertRelationshipTypeAllowsKinds(type, sourceKind, targetKind) {
|
|
183
|
+
// `type: RelationshipType` is a closed key set of RELATIONSHIP_TYPE_DEFINITIONS, so
|
|
184
|
+
// the indexed access is always defined — no need to widen / null-check.
|
|
185
|
+
const def = RELATIONSHIP_TYPE_DEFINITIONS[type];
|
|
186
|
+
if (!def.validSourceKinds.includes(sourceKind)) {
|
|
187
|
+
return "denied/source-kind-not-allowed";
|
|
188
|
+
}
|
|
189
|
+
if (!def.validTargetKinds.includes(targetKind)) {
|
|
190
|
+
return "denied/target-kind-not-allowed";
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
// ─── Cardinality (context-gated) ──────────────────────────────────────────────
|
|
195
|
+
function checkCardinality(type, ctx) {
|
|
196
|
+
const counts = ctx?.cardinalityCounts;
|
|
197
|
+
if (!counts) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
if (type === "produces-evidence") {
|
|
201
|
+
// 1:1 on the source side: at most one produces-evidence per source workflow-run.
|
|
202
|
+
if (typeof counts.producesEvidenceForSource === "number" &&
|
|
203
|
+
counts.producesEvidenceForSource >= 1) {
|
|
204
|
+
return makeError("denied/cardinality-exceeded", "produces-evidence already exists for this source workflow-run");
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (type === "starts-workflow") {
|
|
208
|
+
// 1:1 on the target side: each run has exactly one origin.
|
|
209
|
+
if (typeof counts.startsWorkflowForTarget === "number" && counts.startsWorkflowForTarget >= 1) {
|
|
210
|
+
return makeError("denied/cardinality-exceeded", "starts-workflow already exists for this target workflow-run");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
// ─── Cycle / self-edge ────────────────────────────────────────────────────────
|
|
216
|
+
// The validator detects the O(1) cases (self-loop). Transitive-closure cycle detection
|
|
217
|
+
// is deferred to issue #542's impact-analysis traversal (denial-reasons.md
|
|
218
|
+
// `denied/cycle-forbidden`).
|
|
219
|
+
function checkSelfEdge(source, target) {
|
|
220
|
+
if (source.kind === target.kind && source.id === target.id) {
|
|
221
|
+
return makeError("denied/cycle-forbidden", "source and target refer to the same endpoint");
|
|
222
|
+
}
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
function checkDirectDependsOnReverseEdge(type, ctx) {
|
|
226
|
+
if (type === "depends-on" && ctx?.dependsOnReverseEdgeExists === true) {
|
|
227
|
+
return makeError("denied/cycle-forbidden", "depends-on reverse edge already exists for this endpoint pair");
|
|
228
|
+
}
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
// ─── Cross-workspace ──────────────────────────────────────────────────────────
|
|
232
|
+
// The error message NEVER echoes the foreign workspace id: audit-events.md §8.3 lists
|
|
233
|
+
// `proposedSourceId` / `proposedTargetId` / cross-workspace identifiers as FORBIDDEN.
|
|
234
|
+
function checkCrossWorkspace(workspaceId, source, target) {
|
|
235
|
+
if (source.workspaceId !== workspaceId || target.workspaceId !== workspaceId) {
|
|
236
|
+
return makeError("denied/cross-workspace", "source and target must be in the relationship's workspace");
|
|
237
|
+
}
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
// ─── Lifecycle transition (context-gated) ─────────────────────────────────────
|
|
241
|
+
function checkLifecycleTransition(lifecycleState, ctx) {
|
|
242
|
+
const previous = ctx?.previousLifecycleState;
|
|
243
|
+
if (previous === undefined) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
const allowed = LIFECYCLE_TRANSITIONS[previous];
|
|
247
|
+
if (!allowed.includes(lifecycleState)) {
|
|
248
|
+
return makeError("denied/lifecycle-illegal-transition", `transition from ${previous} to ${lifecycleState} is not permitted`, "lifecycleState");
|
|
249
|
+
}
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
// ─── Forbidden metadata keys ──────────────────────────────────────────────────
|
|
253
|
+
function checkForbiddenMetadata(record) {
|
|
254
|
+
const errors = [];
|
|
255
|
+
if (record.metadata === undefined || record.metadata === null) {
|
|
256
|
+
return errors;
|
|
257
|
+
}
|
|
258
|
+
if (!isRecord(record.metadata)) {
|
|
259
|
+
errors.push(makeError("denied/payload-content-not-permitted", "metadata must be an object when set", "metadata"));
|
|
260
|
+
return errors;
|
|
261
|
+
}
|
|
262
|
+
for (const key of Object.keys(record.metadata)) {
|
|
263
|
+
// Lowercase + strip non-alphanumerics so "API_KEY", "api-key", "apiKey", and
|
|
264
|
+
// "api.key" all collapse to "apikey" — catching the common variants of forbidden
|
|
265
|
+
// payload-key names with one substring check per banned token.
|
|
266
|
+
const normalized = key.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
267
|
+
for (const banned of RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS) {
|
|
268
|
+
if (normalized.includes(banned)) {
|
|
269
|
+
errors.push(makeError("denied/payload-content-not-permitted", "metadata may not carry endpoint content", `metadata.${key}`));
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return errors;
|
|
275
|
+
}
|
|
276
|
+
// ─── Driver ───────────────────────────────────────────────────────────────────
|
|
277
|
+
// Pure: same input → same output. Each check is implemented as a small helper above so
|
|
278
|
+
// the resolution order is visible at the call site below; reordering the calls REORDERS
|
|
279
|
+
// the resolution order, which is the explicit normative contract.
|
|
280
|
+
// Short-circuit checks that must pass before the accumulating phase runs. Returns either
|
|
281
|
+
// the first blocking error array (caller returns it) or `null` when the record is
|
|
282
|
+
// structurally usable for the kind compatibility / cardinality / lifecycle / metadata
|
|
283
|
+
// checks. The order pins resolution-order steps 1–4 (schema, type, kind-known,
|
|
284
|
+
// lifecycle-known) so subsequent helpers can safely index by `type` / `kind` /
|
|
285
|
+
// `lifecycleState`.
|
|
286
|
+
function runShortCircuitChecks(record, source, target) {
|
|
287
|
+
const versionError = checkSchemaVersion(record);
|
|
288
|
+
if (versionError)
|
|
289
|
+
return [versionError];
|
|
290
|
+
const typeError = checkTypeIsKnown(record);
|
|
291
|
+
if (typeError)
|
|
292
|
+
return [typeError];
|
|
293
|
+
const sourceKnown = checkKindIsKnown(source, "source");
|
|
294
|
+
const targetKnown = checkKindIsKnown(target, "target");
|
|
295
|
+
if (sourceKnown !== null || targetKnown !== null) {
|
|
296
|
+
const errs = [];
|
|
297
|
+
if (sourceKnown !== null)
|
|
298
|
+
errs.push(sourceKnown);
|
|
299
|
+
if (targetKnown !== null)
|
|
300
|
+
errs.push(targetKnown);
|
|
301
|
+
return errs;
|
|
302
|
+
}
|
|
303
|
+
const lifecycleKnown = checkLifecycleIsKnown(record);
|
|
304
|
+
if (lifecycleKnown)
|
|
305
|
+
return [lifecycleKnown];
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
// Accumulates kind-compatibility errors for the resolution-order 4 + 5 slots, AFTER
|
|
309
|
+
// the forward-looking kind check (resolution-order 3). If a forward-looking error was
|
|
310
|
+
// already reported on either side, the kind-compatibility step is skipped — the
|
|
311
|
+
// validity sets index by RELATIONSHIP_TYPE_DEFINITIONS which only covers supported
|
|
312
|
+
// kinds; reporting both noise and signal would be misleading.
|
|
313
|
+
function appendKindCompatibilityErrors(type, sourceRef, targetRef, errors) {
|
|
314
|
+
const kindCode = assertRelationshipTypeAllowsKinds(type, sourceRef.kind, targetRef.kind);
|
|
315
|
+
if (kindCode === "denied/source-kind-not-allowed") {
|
|
316
|
+
errors.push(makeError("denied/source-kind-not-allowed", `source.kind "${sourceRef.kind}" is not permitted for type "${type}"`, "source.kind"));
|
|
317
|
+
}
|
|
318
|
+
else if (kindCode === "denied/target-kind-not-allowed") {
|
|
319
|
+
errors.push(makeError("denied/target-kind-not-allowed", `target.kind "${targetRef.kind}" is not permitted for type "${type}"`, "target.kind"));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
function appendCycleErrors(type, sourceRef, targetRef, ctx, errors) {
|
|
323
|
+
const selfEdge = checkSelfEdge(sourceRef, targetRef);
|
|
324
|
+
if (selfEdge)
|
|
325
|
+
errors.push(selfEdge);
|
|
326
|
+
const reverseEdge = checkDirectDependsOnReverseEdge(type, ctx);
|
|
327
|
+
if (reverseEdge)
|
|
328
|
+
errors.push(reverseEdge);
|
|
329
|
+
}
|
|
330
|
+
// Runs every accumulating check in the resolution-order documented by
|
|
331
|
+
// denial-reasons.md. The helper is the seam between the short-circuit phase (above) and
|
|
332
|
+
// the per-step pure helpers (cardinality / cycle / cross-workspace / lifecycle /
|
|
333
|
+
// metadata).
|
|
334
|
+
function runAccumulatingChecks(record, source, target, ctx) {
|
|
335
|
+
const errors = [];
|
|
336
|
+
const type = record.type;
|
|
337
|
+
const lifecycleState = record.lifecycleState;
|
|
338
|
+
const sourceRef = source;
|
|
339
|
+
const targetRef = target;
|
|
340
|
+
// Resolution-order 3 — forward-looking kinds. Accumulates both sides.
|
|
341
|
+
const sourceSupported = checkObjectKindSupported(source, "source");
|
|
342
|
+
if (sourceSupported)
|
|
343
|
+
errors.push(sourceSupported);
|
|
344
|
+
const targetSupported = checkObjectKindSupported(target, "target");
|
|
345
|
+
if (targetSupported)
|
|
346
|
+
errors.push(targetSupported);
|
|
347
|
+
// Resolution-order 4 + 5 — kind compatibility, skipped if a forward-looking error
|
|
348
|
+
// fired on either side (see helper docstring).
|
|
349
|
+
if (sourceSupported === null && targetSupported === null) {
|
|
350
|
+
appendKindCompatibilityErrors(type, sourceRef, targetRef, errors);
|
|
351
|
+
}
|
|
352
|
+
// Resolution-order 7 — cardinality (context-gated).
|
|
353
|
+
const cardinality = checkCardinality(type, ctx);
|
|
354
|
+
if (cardinality)
|
|
355
|
+
errors.push(cardinality);
|
|
356
|
+
// Resolution-order 8 — O(1) self-loop.
|
|
357
|
+
appendCycleErrors(type, sourceRef, targetRef, ctx, errors);
|
|
358
|
+
// Resolution-order 9 — body-free cross-workspace.
|
|
359
|
+
const cross = checkCrossWorkspace(record.workspaceId, sourceRef, targetRef);
|
|
360
|
+
if (cross)
|
|
361
|
+
errors.push(cross);
|
|
362
|
+
// Resolution-order 12 — lifecycle transition (context-gated).
|
|
363
|
+
const transition = checkLifecycleTransition(lifecycleState, ctx);
|
|
364
|
+
if (transition)
|
|
365
|
+
errors.push(transition);
|
|
366
|
+
// Resolution-order 13-15 — deferred endpoint liveness from the resolver port. Missing
|
|
367
|
+
// endpoints short-circuit earlier in `runResolverMissingCheck`.
|
|
368
|
+
appendDeferredResolverErrors(ctx, errors);
|
|
369
|
+
// Resolution-order 16 — forbidden metadata keys.
|
|
370
|
+
for (const error of checkForbiddenMetadata(record)) {
|
|
371
|
+
errors.push(error);
|
|
372
|
+
}
|
|
373
|
+
return errors;
|
|
374
|
+
}
|
|
375
|
+
// Resolver-supplied identity codes (resolution-order 1 + 2). Returns the errors when
|
|
376
|
+
// the resolver reports any missing endpoint (caller short-circuits); empty array when
|
|
377
|
+
// ctx supplied an endpointResolver but both endpoints still exist; null when ctx omitted
|
|
378
|
+
// endpoint resolution entirely.
|
|
379
|
+
function runResolverMissingCheck(ctx) {
|
|
380
|
+
if (!ctx?.endpointResolver)
|
|
381
|
+
return null;
|
|
382
|
+
const errors = [];
|
|
383
|
+
if (ctx.endpointResolver.source === "missing") {
|
|
384
|
+
appendResolverError("source", ctx.endpointResolver.source, errors);
|
|
385
|
+
}
|
|
386
|
+
if (ctx.endpointResolver.target === "missing") {
|
|
387
|
+
appendResolverError("target", ctx.endpointResolver.target, errors);
|
|
388
|
+
}
|
|
389
|
+
return errors;
|
|
390
|
+
}
|
|
391
|
+
function appendDeferredResolverErrors(ctx, errors) {
|
|
392
|
+
if (!ctx?.endpointResolver)
|
|
393
|
+
return;
|
|
394
|
+
if (ctx.endpointResolver.source !== "missing") {
|
|
395
|
+
appendResolverError("source", ctx.endpointResolver.source, errors);
|
|
396
|
+
}
|
|
397
|
+
if (ctx.endpointResolver.target !== "missing") {
|
|
398
|
+
appendResolverError("target", ctx.endpointResolver.target, errors);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
export function validateRelationship(input, ctx) {
|
|
402
|
+
const prelude = structuralPrelude(input);
|
|
403
|
+
if (!prelude.value) {
|
|
404
|
+
return { ok: false, errors: prelude.errors };
|
|
405
|
+
}
|
|
406
|
+
const { record, source, target } = prelude.value;
|
|
407
|
+
const shortCircuit = runShortCircuitChecks(record, source, target);
|
|
408
|
+
if (shortCircuit) {
|
|
409
|
+
return { ok: false, errors: shortCircuit };
|
|
410
|
+
}
|
|
411
|
+
// Resolver identity is the most-structural failure (denial-reasons.md "Resolution
|
|
412
|
+
// order" 1 + 2). When the resolver reports any failure, short-circuit.
|
|
413
|
+
const resolverErrors = runResolverMissingCheck(ctx);
|
|
414
|
+
if (resolverErrors !== null && resolverErrors.length > 0) {
|
|
415
|
+
return { ok: false, errors: resolverErrors };
|
|
416
|
+
}
|
|
417
|
+
const errors = runAccumulatingChecks(record, source, target, ctx);
|
|
418
|
+
if (errors.length > 0) {
|
|
419
|
+
return { ok: false, errors };
|
|
420
|
+
}
|
|
421
|
+
return { ok: true, value: record };
|
|
422
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const RELATIONSHIP_SCHEMA_VERSION: "1";
|
|
2
|
+
export declare const RELATIONSHIP_OBJECT_KINDS: readonly ["agent", "capsule", "capsule-set", "chat", "connector", "data-source", "evidence-run", "mcp-tool", "memory", "patch-proposal", "skill", "tool", "workflow-run", "workspace-path"];
|
|
3
|
+
export type RelationshipObjectKind = (typeof RELATIONSHIP_OBJECT_KINDS)[number];
|
|
4
|
+
export declare const RELATIONSHIP_SUPPORTED_OBJECT_KINDS: readonly ["capsule", "capsule-set", "chat", "evidence-run", "memory", "patch-proposal", "tool", "workflow-run", "workspace-path"];
|
|
5
|
+
export type RelationshipSupportedObjectKind = (typeof RELATIONSHIP_SUPPORTED_OBJECT_KINDS)[number];
|
|
6
|
+
export declare const RELATIONSHIP_TYPES: readonly ["reads-context", "proposes-patch", "uses-tool", "starts-workflow", "produces-evidence", "references-document", "depends-on"];
|
|
7
|
+
export type RelationshipType = (typeof RELATIONSHIP_TYPES)[number];
|
|
8
|
+
export declare const RELATIONSHIP_LIFECYCLE_STATES: readonly ["draft", "active", "archived", "superseded", "revoked", "blocked", "stale"];
|
|
9
|
+
export type RelationshipLifecycleState = (typeof RELATIONSHIP_LIFECYCLE_STATES)[number];
|
|
10
|
+
export declare const RELATIONSHIP_ACTIVITY_STATES: readonly ["inactive", "queued", "active", "processing", "completed", "failed", "blocked", "degraded", "high-throughput"];
|
|
11
|
+
export type RelationshipActivityState = (typeof RELATIONSHIP_ACTIVITY_STATES)[number];
|
|
12
|
+
export declare const RELATIONSHIP_DENIAL_CODES: readonly ["denied/non-existent-source", "denied/non-existent-target", "denied/object-kind-not-yet-supported", "denied/source-kind-not-allowed", "denied/target-kind-not-allowed", "denied/kind-incompatible", "denied/cardinality-exceeded", "denied/cycle-forbidden", "denied/cross-workspace", "denied/path-not-contained", "denied/denied-by-deny-list", "denied/lifecycle-illegal-transition", "denied/endpoint-tombstoned", "denied/endpoint-retired", "denied/endpoint-unavailable", "denied/payload-content-not-permitted", "denied/authority-insufficient", "denied/schema-version-unsupported"];
|
|
13
|
+
export type RelationshipDenialCode = (typeof RELATIONSHIP_DENIAL_CODES)[number];
|
|
14
|
+
export type RelationshipCardinality = "1:1" | "1:N" | "N:1" | "N:N";
|
|
15
|
+
export type RelationshipDirection = "directed" | "undirected";
|
|
16
|
+
export type RelationshipEvidenceRelevance = "none" | "reference" | "produces";
|
|
17
|
+
export interface RelationshipTypeLifecycleFlags {
|
|
18
|
+
readonly creatable: boolean;
|
|
19
|
+
readonly immutable: boolean;
|
|
20
|
+
readonly reconnectable: boolean;
|
|
21
|
+
readonly deletable: boolean;
|
|
22
|
+
readonly archivable: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface RelationshipTypeDefinition {
|
|
25
|
+
readonly id: RelationshipType;
|
|
26
|
+
readonly displayName: string;
|
|
27
|
+
readonly semantics: string;
|
|
28
|
+
readonly validSourceKinds: readonly RelationshipObjectKind[];
|
|
29
|
+
readonly validTargetKinds: readonly RelationshipObjectKind[];
|
|
30
|
+
readonly cardinality: RelationshipCardinality;
|
|
31
|
+
readonly direction: RelationshipDirection;
|
|
32
|
+
readonly lifecycle: RelationshipTypeLifecycleFlags;
|
|
33
|
+
readonly auditEventOnMutation: boolean;
|
|
34
|
+
readonly evidenceRelevance: RelationshipEvidenceRelevance;
|
|
35
|
+
readonly ownerPackage: string;
|
|
36
|
+
readonly trustBoundary: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const RELATIONSHIP_TYPE_DEFINITIONS: Readonly<Record<RelationshipType, RelationshipTypeDefinition>>;
|
|
39
|
+
export interface ObjectReference {
|
|
40
|
+
readonly kind: RelationshipObjectKind;
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly workspaceId: string;
|
|
43
|
+
}
|
|
44
|
+
export interface Relationship {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly schemaVersion: typeof RELATIONSHIP_SCHEMA_VERSION;
|
|
47
|
+
readonly workspaceId: string;
|
|
48
|
+
readonly source: ObjectReference;
|
|
49
|
+
readonly target: ObjectReference;
|
|
50
|
+
readonly type: RelationshipType;
|
|
51
|
+
readonly lifecycleState: RelationshipLifecycleState;
|
|
52
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
53
|
+
readonly createdAt: string;
|
|
54
|
+
readonly updatedAt: string;
|
|
55
|
+
readonly etag: number;
|
|
56
|
+
}
|
|
57
|
+
export interface RelationshipCardinalityCounts {
|
|
58
|
+
readonly producesEvidenceForSource?: number;
|
|
59
|
+
readonly startsWorkflowForTarget?: number;
|
|
60
|
+
}
|
|
61
|
+
export type RelationshipEndpointStatus = "live" | "tombstoned" | "retired" | "unavailable" | "missing";
|
|
62
|
+
export interface RelationshipEndpointResolverResult {
|
|
63
|
+
readonly source: RelationshipEndpointStatus;
|
|
64
|
+
readonly target: RelationshipEndpointStatus;
|
|
65
|
+
}
|
|
66
|
+
export interface RelationshipValidationContext {
|
|
67
|
+
readonly previousLifecycleState?: RelationshipLifecycleState;
|
|
68
|
+
readonly cardinalityCounts?: RelationshipCardinalityCounts;
|
|
69
|
+
readonly dependsOnReverseEdgeExists?: boolean;
|
|
70
|
+
readonly endpointResolver?: RelationshipEndpointResolverResult;
|
|
71
|
+
}
|
|
72
|
+
export interface RelationshipValidationError {
|
|
73
|
+
readonly code: RelationshipDenialCode;
|
|
74
|
+
readonly field?: string;
|
|
75
|
+
readonly message: string;
|
|
76
|
+
}
|
|
77
|
+
export declare const RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS: readonly ["prompt", "documentcontent", "filecontent", "toolstdout", "toolstderr", "secret", "credential", "apikey", "password", "token"];
|
|
78
|
+
export type RelationshipForbiddenMetadataKeySubstring = (typeof RELATIONSHIP_FORBIDDEN_METADATA_KEY_SUBSTRINGS)[number];
|
|
79
|
+
//# sourceMappingURL=relationships.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../src/relationships.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,2BAA2B,EAAG,GAAY,CAAC;AAMxD,eAAO,MAAM,yBAAyB,6LAe5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMhF,eAAO,MAAM,mCAAmC,mIAUtC,CAAC;AAEX,MAAM,MAAM,+BAA+B,GAAG,CAAC,OAAO,mCAAmC,CAAC,CAAC,MAAM,CAAC,CAAC;AAKnG,eAAO,MAAM,kBAAkB,wIAQrB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAInE,eAAO,MAAM,6BAA6B,uFAQhC,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAOxF,eAAO,MAAM,4BAA4B,0HAU/B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAOtF,eAAO,MAAM,yBAAyB,0kBAmB5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAOhF,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,CAAC;AAC9D,MAAM,MAAM,6BAA6B,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;AAE9E,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC7D,QAAQ,CAAC,gBAAgB,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC7D,QAAQ,CAAC,WAAW,EAAE,uBAAuB,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,8BAA8B,CAAC;IACnD,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,iBAAiB,EAAE,6BAA6B,CAAC;IAC1D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAID,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAClD,MAAM,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,CAuK5C,CAAC;AAOX,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAWD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,CAAC;IAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,0BAA0B,CAAC;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAQD,MAAM,WAAW,6BAA6B;IAG5C,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAK5C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAC3C;AAKD,MAAM,MAAM,0BAA0B,GAClC,MAAM,GACN,YAAY,GACZ,SAAS,GACT,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;CAC7C;AAED,MAAM,WAAW,6BAA6B;IAG5C,QAAQ,CAAC,sBAAsB,CAAC,EAAE,0BAA0B,CAAC;IAI7D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;IAK3D,QAAQ,CAAC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAI9C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,kCAAkC,CAAC;CAChE;AAOD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAaD,eAAO,MAAM,8CAA8C,0IAWjD,CAAC;AAEX,MAAM,MAAM,yCAAyC,GACnD,CAAC,OAAO,8CAA8C,CAAC,CAAC,MAAM,CAAC,CAAC"}
|