@xemahq/kernel-contracts 0.16.1 → 0.17.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://xema.dev/schemas/awp-spec.v1.json",
3
- "emittedAt": "2026-06-26T19:58:40.979Z",
3
+ "emittedAt": "2026-06-27T10:32:41.919Z",
4
4
  "spec": {
5
5
  "id": "awp/v1",
6
6
  "version": "1.2.0",
@@ -0,0 +1,2 @@
1
+ export * from './lib/lifecycle-events';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lifecycle-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lib/lifecycle-events"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lifecycle-events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare enum LifecycleEventType {
3
+ OrganizationDeleted = "organization.organization.deleted",
4
+ ProjectDeleted = "project.project.deleted",
5
+ UserDeleted = "user.user.deleted"
6
+ }
7
+ export declare const IDENTITY_LIFECYCLE_EVENT_SOURCE: "/services/identity-api";
8
+ export declare const PROJECT_LIFECYCLE_EVENT_SOURCE: "/services/project-registry-api";
9
+ export declare const LIFECYCLE_EVENT_SCHEMA_VERSION: "1.0.0";
10
+ export declare const OrganizationDeletedEventSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ }, z.core.$strict>;
13
+ export declare const ProjectDeletedEventSchema: z.ZodObject<{
14
+ id: z.ZodString;
15
+ orgId: z.ZodString;
16
+ projectId: z.ZodString;
17
+ }, z.core.$strict>;
18
+ export declare const UserDeletedEventSchema: z.ZodObject<{
19
+ id: z.ZodString;
20
+ orgId: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strict>;
22
+ export type OrganizationDeletedEventPayload = z.infer<typeof OrganizationDeletedEventSchema>;
23
+ export type ProjectDeletedEventPayload = z.infer<typeof ProjectDeletedEventSchema>;
24
+ export type UserDeletedEventPayload = z.infer<typeof UserDeletedEventSchema>;
25
+ //# sourceMappingURL=lifecycle-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-events.d.ts","sourceRoot":"","sources":["../../../src/lifecycle-events/lib/lifecycle-events.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,oBAAY,kBAAkB;IAE5B,mBAAmB,sCAAsC;IAEzD,cAAc,4BAA4B;IAS1C,WAAW,sBAAsB;CAClC;AAGD,eAAO,MAAM,+BAA+B,EAAG,wBAAiC,CAAC;AAGjF,eAAO,MAAM,8BAA8B,EACzC,gCAAyC,CAAC;AAG5C,eAAO,MAAM,8BAA8B,EAAG,OAAgB,CAAC;AAO/D,eAAO,MAAM,8BAA8B;;kBAIhC,CAAC;AAOZ,eAAO,MAAM,yBAAyB;;;;kBAM3B,CAAC;AAOZ,eAAO,MAAM,sBAAsB;;;kBAKxB,CAAC;AAEZ,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserDeletedEventSchema = exports.ProjectDeletedEventSchema = exports.OrganizationDeletedEventSchema = exports.LIFECYCLE_EVENT_SCHEMA_VERSION = exports.PROJECT_LIFECYCLE_EVENT_SOURCE = exports.IDENTITY_LIFECYCLE_EVENT_SOURCE = exports.LifecycleEventType = void 0;
4
+ const zod_1 = require("zod");
5
+ var LifecycleEventType;
6
+ (function (LifecycleEventType) {
7
+ LifecycleEventType["OrganizationDeleted"] = "organization.organization.deleted";
8
+ LifecycleEventType["ProjectDeleted"] = "project.project.deleted";
9
+ LifecycleEventType["UserDeleted"] = "user.user.deleted";
10
+ })(LifecycleEventType || (exports.LifecycleEventType = LifecycleEventType = {}));
11
+ exports.IDENTITY_LIFECYCLE_EVENT_SOURCE = '/services/identity-api';
12
+ exports.PROJECT_LIFECYCLE_EVENT_SOURCE = '/services/project-registry-api';
13
+ exports.LIFECYCLE_EVENT_SCHEMA_VERSION = '1.0.0';
14
+ exports.OrganizationDeletedEventSchema = zod_1.z
15
+ .object({
16
+ id: zod_1.z.string(),
17
+ })
18
+ .strict();
19
+ exports.ProjectDeletedEventSchema = zod_1.z
20
+ .object({
21
+ id: zod_1.z.string(),
22
+ orgId: zod_1.z.string(),
23
+ projectId: zod_1.z.string(),
24
+ })
25
+ .strict();
26
+ exports.UserDeletedEventSchema = zod_1.z
27
+ .object({
28
+ id: zod_1.z.string(),
29
+ orgId: zod_1.z.string().optional(),
30
+ })
31
+ .strict();
32
+ //# sourceMappingURL=lifecycle-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-events.js","sourceRoot":"","sources":["../../../src/lifecycle-events/lib/lifecycle-events.ts"],"names":[],"mappings":";;;AA2BA,6BAAwB;AAOxB,IAAY,kBAcX;AAdD,WAAY,kBAAkB;IAE5B,+EAAyD,CAAA;IAEzD,gEAA0C,CAAA;IAS1C,uDAAiC,CAAA;AACnC,CAAC,EAdW,kBAAkB,kCAAlB,kBAAkB,QAc7B;AAGY,QAAA,+BAA+B,GAAG,wBAAiC,CAAC;AAGpE,QAAA,8BAA8B,GACzC,gCAAyC,CAAC;AAG/B,QAAA,8BAA8B,GAAG,OAAgB,CAAC;AAOlD,QAAA,8BAA8B,GAAG,OAAC;KAC5C,MAAM,CAAC;IACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC;KACD,MAAM,EAAE,CAAC;AAOC,QAAA,yBAAyB,GAAG,OAAC;KACvC,MAAM,CAAC;IACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;CACtB,CAAC;KACD,MAAM,EAAE,CAAC;AAOC,QAAA,sBAAsB,GAAG,OAAC;KACpC,MAAM,CAAC;IACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -17,6 +17,7 @@ export interface IndexableDocument {
17
17
  readonly createdAt?: string;
18
18
  readonly updatedAt?: string;
19
19
  readonly metadata?: Readonly<Record<string, unknown>>;
20
+ readonly embeddingEligible?: boolean;
20
21
  }
21
22
  export declare const IndexableDocumentSchema: z.ZodObject<{
22
23
  sourceKey: z.ZodString;
@@ -36,5 +37,6 @@ export declare const IndexableDocumentSchema: z.ZodObject<{
36
37
  createdAt: z.ZodOptional<z.ZodString>;
37
38
  updatedAt: z.ZodOptional<z.ZodString>;
38
39
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
40
+ embeddingEligible: z.ZodOptional<z.ZodBoolean>;
39
41
  }, z.core.$strict>;
40
42
  //# sourceMappingURL=indexable-document.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexable-document.d.ts","sourceRoot":"","sources":["../../../src/search-source/lib/indexable-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,MAAM,WAAW,iBAAiB;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,QAAQ,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EAAE,OAAO,CAAC;CACtC;AAMD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;kBAqBzB,CAAC"}
@@ -21,6 +21,7 @@ exports.IndexableDocumentSchema = zod_1.z
21
21
  createdAt: zod_1.z.string().optional(),
22
22
  updatedAt: zod_1.z.string().optional(),
23
23
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
24
+ embeddingEligible: zod_1.z.boolean().optional(),
24
25
  })
25
26
  .strict();
26
27
  //# sourceMappingURL=indexable-document.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexable-document.js","sourceRoot":"","sources":["../../../src/search-source/lib/indexable-document.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAiDX,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,CAAC;IACN,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpC,MA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QAAQ,EAAE;IAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtD,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -39,6 +39,7 @@ export declare const SearchIndexUpsertSchema: z.ZodObject<{
39
39
  createdAt: z.ZodOptional<z.ZodString>;
40
40
  updatedAt: z.ZodOptional<z.ZodString>;
41
41
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42
+ embeddingEligible: z.ZodOptional<z.ZodBoolean>;
42
43
  }, z.core.$strict>;
43
44
  }, z.core.$strict>;
44
45
  export declare const SearchIndexDeleteSchema: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"search-index-event.d.ts","sourceRoot":"","sources":["../../../src/search-source/lib/search-index-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA2B,K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AE,aAAa,CAAC,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;CACtC;AAGD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAC,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;kBAKzB,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;;;kBASzB,CAAC"}
@@ -39,6 +39,7 @@ export declare const SearchReplayResponseSchema: z.ZodObject<{
39
39
  createdAt: z.ZodOptional<z.ZodString>;
40
40
  updatedAt: z.ZodOptional<z.ZodString>;
41
41
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
42
+ embeddingEligible: z.ZodOptional<z.ZodBoolean>;
42
43
  }, z.core.$strict>>;
43
44
  nextCursor: z.ZodOptional<z.ZodString>;
44
45
  }, z.core.$strict>;
@@ -1 +1 @@
1
- {"version":3,"file":"search-replay.d.ts","sourceRoot":"","sources":["../../../src/search-source/lib/search-replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AASvF,eAAO,MAAM,6BAA6B,EAAG,eAAwB,CAAC;AAOtE,eAAO,MAAM,8BAA8B,EAAG,CAAU,CAAC;AAWzD,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnE;A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AQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,yBAAyB;;;;;kBAO3B,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;kBAK5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/kernel-contracts",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the 32 kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -0,0 +1 @@
1
+ export * from './lib/lifecycle-events';
@@ -0,0 +1,103 @@
1
+ // ═══════════════════════════════════════════════════════════════════════════
2
+ // ── Canonical platform lifecycle-deletion event contracts ──
3
+ //
4
+ // `organization.organization.deleted`, `project.project.deleted`, and
5
+ // `identity.user.deleted` are the three CANONICAL cascade-cleanup signals every
6
+ // stateful biome subscribes to. Before this contract existed, each of the
7
+ // ~14 consumers hand-re-declared the same `type` string, `source`, and payload
8
+ // `data` shape in its own `consumed-events.registry.ts` — drift waiting to
9
+ // happen on a producer-side change.
10
+ //
11
+ // These contracts live in the KERNEL (Layer 0) so a subscriber depends on the
12
+ // kernel package, never on the producer service. The producers
13
+ // (`project-registry-api` for project, `identity-api` for org + user) import
14
+ // the SAME enum + schema to emit; subscribers import them to match — one source
15
+ // of truth, zero service-to-service code coupling. This mirrors the
16
+ // search-source / mail-source registries (`@xemahq/kernel-contracts/*`) that
17
+ // let a consumer act on any producer's events without importing its client.
18
+ //
19
+ // NOTE: This subpath holds the type strings + payload schemas ONLY. The
20
+ // descriptor wrapper (`defineEvent(...)`) lives in the Layer-1 runtime package
21
+ // `@xemahq/events`, which Layer 0 must not depend on. A consumer keeps its
22
+ // `defineEvent({ type: ..., data: ... })` call but sources the `type` from
23
+ // `LifecycleEventType` and the `data` from these schemas instead of re-typing
24
+ // them. Do not change a `type` string without a coordinated migration — every
25
+ // other service matches on it.
26
+ // ═══════════════════════════════════════════════════════════════════════════
27
+
28
+ import { z } from 'zod';
29
+
30
+ /**
31
+ * Closed set of canonical platform lifecycle-deletion event `type`s. These are
32
+ * the wire identifiers consumers subscribe to for cascade cleanup — never a
33
+ * free-form string at a call site.
34
+ */
35
+ export enum LifecycleEventType {
36
+ /** An organization was deleted — cascade-delete all of the org's data. */
37
+ OrganizationDeleted = 'organization.organization.deleted',
38
+ /** A project was deleted — cascade-delete all project-scoped data. */
39
+ ProjectDeleted = 'project.project.deleted',
40
+ /**
41
+ * A user was deleted — cascade-delete that user's user-scoped data.
42
+ *
43
+ * The wire string is `user.user.deleted` — the value identity-api (the
44
+ * producer) actually emits (`WebhookEvents.USER_DELETED`). The lone
45
+ * consumer that today declares `identity.user.deleted` (memory-api) never
46
+ * fires on a real delete; adopting this descriptor fixes that mismatch.
47
+ */
48
+ UserDeleted = 'user.user.deleted',
49
+ }
50
+
51
+ /** Producer URI of the org + user deletion events (identity is the source). */
52
+ export const IDENTITY_LIFECYCLE_EVENT_SOURCE = '/services/identity-api' as const;
53
+
54
+ /** Producer URI of the project deletion event. */
55
+ export const PROJECT_LIFECYCLE_EVENT_SOURCE =
56
+ '/services/project-registry-api' as const;
57
+
58
+ /** Schema version stamped on every canonical lifecycle-deletion event. */
59
+ export const LIFECYCLE_EVENT_SCHEMA_VERSION = '1.0.0' as const;
60
+
61
+ /**
62
+ * `organization.organization.deleted` payload. Identity emits only the org id;
63
+ * the org id also rides the envelope's `ehorgid` extension, so consumers that
64
+ * scope by extension never even read the body.
65
+ */
66
+ export const OrganizationDeletedEventSchema = z
67
+ .object({
68
+ id: z.string(),
69
+ })
70
+ .strict();
71
+
72
+ /**
73
+ * `project.project.deleted` payload. Canonical cascade signal — carries the
74
+ * full project triple so a consumer can scope deletes by `orgId` and/or
75
+ * `projectId` without a lookup.
76
+ */
77
+ export const ProjectDeletedEventSchema = z
78
+ .object({
79
+ id: z.string(),
80
+ orgId: z.string(),
81
+ projectId: z.string(),
82
+ })
83
+ .strict();
84
+
85
+ /**
86
+ * `identity.user.deleted` payload. `orgId` is optional because a user is a
87
+ * cross-org subject; an org-scoped consumer reads `ehorgid` from the envelope
88
+ * to bound the cascade to its own org.
89
+ */
90
+ export const UserDeletedEventSchema = z
91
+ .object({
92
+ id: z.string(),
93
+ orgId: z.string().optional(),
94
+ })
95
+ .strict();
96
+
97
+ export type OrganizationDeletedEventPayload = z.infer<
98
+ typeof OrganizationDeletedEventSchema
99
+ >;
100
+ export type ProjectDeletedEventPayload = z.infer<
101
+ typeof ProjectDeletedEventSchema
102
+ >;
103
+ export type UserDeletedEventPayload = z.infer<typeof UserDeletedEventSchema>;
@@ -41,6 +41,19 @@ export interface IndexableDocument {
41
41
  readonly updatedAt?: string;
42
42
  /** Free-form per-source metadata carried verbatim onto the index document. */
43
43
  readonly metadata?: Readonly<Record<string, unknown>>;
44
+ /**
45
+ * Whether this document should receive a vector embedding (semantic search),
46
+ * declared by the SOURCE. Search is source-agnostic: it never inspects a
47
+ * source's `docType`/`metadata` taxonomy to decide embedding admission — the
48
+ * producer that owns the entity schema knows whether the text carries
49
+ * retrieval-worthy semantic content.
50
+ *
51
+ * Deterministic default when OMITTED: `false` — the document is text-indexed
52
+ * (keyword search) only, never embedded. A source that wants semantic search
53
+ * for a document MUST set this to `true` explicitly. There is no inference
54
+ * from any other field.
55
+ */
56
+ readonly embeddingEligible?: boolean;
44
57
  }
45
58
 
46
59
  /**
@@ -66,5 +79,6 @@ export const IndexableDocumentSchema = z
66
79
  createdAt: z.string().optional(),
67
80
  updatedAt: z.string().optional(),
68
81
  metadata: z.record(z.string(), z.unknown()).optional(),
82
+ embeddingEligible: z.boolean().optional(),
69
83
  })
70
84
  .strict();