@xemahq/kernel-contracts 0.40.0 → 0.41.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/connector/lib/canonical-operation-binding.d.ts +1 -1
- package/dist/connector/lib/canonical-operation-binding.d.ts.map +1 -1
- package/dist/connector/lib/canonical-operation-binding.js +2 -2
- package/dist/connector/lib/canonical-operation-binding.js.map +1 -1
- package/dist/connector/lib/integration-provider-contribution.d.ts +2 -2
- package/dist/enterprise-context/index.d.ts +5 -0
- package/dist/enterprise-context/index.d.ts.map +1 -0
- package/dist/enterprise-context/index.js +21 -0
- package/dist/enterprise-context/index.js.map +1 -0
- package/dist/enterprise-context/lib/context-bundle.d.ts +13 -0
- package/dist/enterprise-context/lib/context-bundle.d.ts.map +1 -0
- package/dist/enterprise-context/lib/context-bundle.js +3 -0
- package/dist/enterprise-context/lib/context-bundle.js.map +1 -0
- package/dist/enterprise-context/lib/context-document.d.ts +9 -0
- package/dist/enterprise-context/lib/context-document.d.ts.map +1 -0
- package/dist/enterprise-context/lib/context-document.js +3 -0
- package/dist/enterprise-context/lib/context-document.js.map +1 -0
- package/dist/enterprise-context/lib/context-mount-entry.d.ts +8 -0
- package/dist/enterprise-context/lib/context-mount-entry.d.ts.map +1 -0
- package/dist/enterprise-context/lib/context-mount-entry.js +5 -0
- package/dist/enterprise-context/lib/context-mount-entry.js.map +1 -0
- package/dist/enterprise-context/lib/dropped-context.d.ts +9 -0
- package/dist/enterprise-context/lib/dropped-context.d.ts.map +1 -0
- package/dist/enterprise-context/lib/dropped-context.js +8 -0
- package/dist/enterprise-context/lib/dropped-context.js.map +1 -0
- package/package.json +1 -1
- package/src/connector/lib/canonical-operation-binding.ts +1 -1
- package/src/enterprise-context/index.ts +4 -0
- package/src/enterprise-context/lib/context-bundle.ts +35 -0
- package/src/enterprise-context/lib/context-document.ts +23 -0
- package/src/enterprise-context/lib/context-mount-entry.ts +29 -0
- package/src/enterprise-context/lib/dropped-context.ts +24 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type CanonicalObjectTypeRef } from '../../canonical-object
|
|
2
|
+
import { type CanonicalObjectTypeRef } from '../../canonical-object';
|
|
3
3
|
export declare enum CanonicalMappingDirection {
|
|
4
4
|
Read = "read",
|
|
5
5
|
Write = "write"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-operation-binding.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/canonical-operation-binding.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"canonical-operation-binding.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/canonical-operation-binding.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAGhC,oBAAY,yBAAyB;IAEnC,IAAI,SAAS;IAEb,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,+BAA+B,6CAA0C,CAAC;AAqCvF,MAAM,WAAW,yBAAyB;IAExC,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAE5C,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAM9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAK1B,CAAC;AAGxD,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAShE;AAGD,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,IAAI,CAYN;AAOD,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACzC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB;AAMD,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAClD,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACzC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB"}
|
|
@@ -6,7 +6,7 @@ exports.setByPath = setByPath;
|
|
|
6
6
|
exports.projectProviderToCanonical = projectProviderToCanonical;
|
|
7
7
|
exports.projectCanonicalToProvider = projectCanonicalToProvider;
|
|
8
8
|
const zod_1 = require("zod");
|
|
9
|
-
const
|
|
9
|
+
const canonical_object_1 = require("../../canonical-object");
|
|
10
10
|
var CanonicalMappingDirection;
|
|
11
11
|
(function (CanonicalMappingDirection) {
|
|
12
12
|
CanonicalMappingDirection["Read"] = "read";
|
|
@@ -26,7 +26,7 @@ const CanonicalFieldMapSchema = zod_1.z
|
|
|
26
26
|
.regex(/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/, 'provider path must be a dot-path of identifier segments'))
|
|
27
27
|
.refine((m) => Object.keys(m).length <= CANONICAL_FIELD_MAP_MAX, `at most ${CANONICAL_FIELD_MAP_MAX} mapped fields`);
|
|
28
28
|
exports.CanonicalOperationBindingSchema = zod_1.z.strictObject({
|
|
29
|
-
objectType:
|
|
29
|
+
objectType: canonical_object_1.CanonicalObjectTypeRefSchema,
|
|
30
30
|
direction: exports.CanonicalMappingDirectionSchema,
|
|
31
31
|
fieldMap: CanonicalFieldMapSchema.optional(),
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-operation-binding.js","sourceRoot":"","sources":["../../../src/connector/lib/canonical-operation-binding.ts"],"names":[],"mappings":";;;AA8FA,8BASC;AAGD,8BAgBC;AAOD,gEAYC;AAMD,gEAYC;AA1ID,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"canonical-operation-binding.js","sourceRoot":"","sources":["../../../src/connector/lib/canonical-operation-binding.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,9 +3,9 @@ import { ConnectorAdapterKind } from './connector-adapter-kind';
|
|
|
3
3
|
export declare const ContributedProviderDescriptorSchema: z.ZodObject<{
|
|
4
4
|
description: z.ZodString;
|
|
5
5
|
displayName: z.ZodString;
|
|
6
|
+
category: z.ZodString;
|
|
6
7
|
providerKey: z.ZodString;
|
|
7
8
|
iconName: z.ZodString;
|
|
8
|
-
category: z.ZodString;
|
|
9
9
|
apiBaseUrl: z.ZodOptional<z.ZodString>;
|
|
10
10
|
appAuthKind: z.ZodEnum<typeof import("./provider-descriptor").ProviderAppAuthKind>;
|
|
11
11
|
appCredentialSchema: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -31,9 +31,9 @@ export declare const IntegrationProviderContributionManifestSchema: z.ZodObject<
|
|
|
31
31
|
provider: z.ZodObject<{
|
|
32
32
|
description: z.ZodString;
|
|
33
33
|
displayName: z.ZodString;
|
|
34
|
+
category: z.ZodString;
|
|
34
35
|
providerKey: z.ZodString;
|
|
35
36
|
iconName: z.ZodString;
|
|
36
|
-
category: z.ZodString;
|
|
37
37
|
apiBaseUrl: z.ZodOptional<z.ZodString>;
|
|
38
38
|
appAuthKind: z.ZodEnum<typeof import("./provider-descriptor").ProviderAppAuthKind>;
|
|
39
39
|
appCredentialSchema: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enterprise-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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/context-document"), exports);
|
|
18
|
+
__exportStar(require("./lib/context-mount-entry"), exports);
|
|
19
|
+
__exportStar(require("./lib/dropped-context"), exports);
|
|
20
|
+
__exportStar(require("./lib/context-bundle"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enterprise-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,4DAA0C;AAC1C,wDAAsC;AACtC,uDAAqC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ContextDocument } from './context-document';
|
|
2
|
+
import type { ContextMountEntry } from './context-mount-entry';
|
|
3
|
+
import type { DroppedContextDocument } from './dropped-context';
|
|
4
|
+
export interface ContextBundle {
|
|
5
|
+
readonly objectType: string;
|
|
6
|
+
readonly primary?: Readonly<Record<string, unknown>>;
|
|
7
|
+
readonly documents: readonly ContextDocument[];
|
|
8
|
+
readonly mountPlan: readonly ContextMountEntry[];
|
|
9
|
+
readonly dropped: readonly DroppedContextDocument[];
|
|
10
|
+
readonly byteBudget: number;
|
|
11
|
+
readonly bytesUsed: number;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=context-bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-bundle.d.ts","sourceRoot":"","sources":["../../../src/enterprise-context/lib/context-bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAoBhE,MAAM,WAAW,aAAa;IAE5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAEpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-bundle.js","sourceRoot":"","sources":["../../../src/enterprise-context/lib/context-bundle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-document.d.ts","sourceRoot":"","sources":["../../../src/enterprise-context/lib/context-document.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAE9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,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,KAAK,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-document.js","sourceRoot":"","sources":["../../../src/enterprise-context/lib/context-document.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MountSource } from '../../workflow';
|
|
2
|
+
export declare const CONTEXT_MOUNT_MODE: "read-only";
|
|
3
|
+
export type ContextMountMode = typeof CONTEXT_MOUNT_MODE;
|
|
4
|
+
export interface ContextMountEntry {
|
|
5
|
+
readonly mode: ContextMountMode;
|
|
6
|
+
readonly source: MountSource;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=context-mount-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-mount-entry.d.ts","sourceRoot":"","sources":["../../../src/enterprise-context/lib/context-mount-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAWlD,eAAO,MAAM,kBAAkB,EAAG,WAAoB,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG,OAAO,kBAAkB,CAAC;AAYzD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-mount-entry.js","sourceRoot":"","sources":["../../../src/enterprise-context/lib/context-mount-entry.ts"],"names":[],"mappings":";;;AAWa,QAAA,kBAAkB,GAAG,WAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare enum DroppedContextReason {
|
|
2
|
+
BYTE_BUDGET_EXCEEDED = "BYTE_BUDGET_EXCEEDED"
|
|
3
|
+
}
|
|
4
|
+
export interface DroppedContextDocument {
|
|
5
|
+
readonly ref: string;
|
|
6
|
+
readonly bytes: number;
|
|
7
|
+
readonly reason: DroppedContextReason;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=dropped-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropped-context.d.ts","sourceRoot":"","sources":["../../../src/enterprise-context/lib/dropped-context.ts"],"names":[],"mappings":"AAWA,oBAAY,oBAAoB;IAE9B,oBAAoB,yBAAyB;CAC9C;AAGD,MAAM,WAAW,sBAAsB;IAErC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;CACvC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DroppedContextReason = void 0;
|
|
4
|
+
var DroppedContextReason;
|
|
5
|
+
(function (DroppedContextReason) {
|
|
6
|
+
DroppedContextReason["BYTE_BUDGET_EXCEEDED"] = "BYTE_BUDGET_EXCEEDED";
|
|
7
|
+
})(DroppedContextReason || (exports.DroppedContextReason = DroppedContextReason = {}));
|
|
8
|
+
//# sourceMappingURL=dropped-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropped-context.js","sourceRoot":"","sources":["../../../src/enterprise-context/lib/dropped-context.ts"],"names":[],"mappings":";;;AAWA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAE9B,qEAA6C,CAAA;AAC/C,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
|
|
@@ -24,7 +24,7 @@ import { z } from 'zod';
|
|
|
24
24
|
import {
|
|
25
25
|
CanonicalObjectTypeRefSchema,
|
|
26
26
|
type CanonicalObjectTypeRef,
|
|
27
|
-
} from '../../canonical-object
|
|
27
|
+
} from '../../canonical-object';
|
|
28
28
|
|
|
29
29
|
/** Which way a bound operation maps between provider records and canonical objects. */
|
|
30
30
|
export enum CanonicalMappingDirection {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ContextDocument } from './context-document';
|
|
2
|
+
import type { ContextMountEntry } from './context-mount-entry';
|
|
3
|
+
import type { DroppedContextDocument } from './dropped-context';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The assembled Enterprise-Context bundle — the result of retrieving and
|
|
7
|
+
* ranking documents about a canonical object and packing them into a
|
|
8
|
+
* budget-bounded, materialisable mount plan.
|
|
9
|
+
*
|
|
10
|
+
* The bundle is producer-neutral: the first producer is
|
|
11
|
+
* connector-gateway-api's enterprise-context module, but the shape is a
|
|
12
|
+
* kernel contract so any assembler and any consumer (e.g. an agent-session
|
|
13
|
+
* launch that materialises the mount plan) agree on the wire.
|
|
14
|
+
*
|
|
15
|
+
* `primary` is the canonical entity echoed back verbatim (the retrieval
|
|
16
|
+
* subject), serialised into the first `static-literal` mount entry. It is
|
|
17
|
+
* the raw object, not a ranked {@link ContextDocument}. `documents` are the
|
|
18
|
+
* ranked retrieval hits; `mountPlan` materialises the entity plus every
|
|
19
|
+
* document that fit the budget; `dropped` lists documents excluded by the
|
|
20
|
+
* budget. `bytesUsed` is the total content bytes actually placed in the
|
|
21
|
+
* mount plan and never exceeds `byteBudget`.
|
|
22
|
+
*/
|
|
23
|
+
export interface ContextBundle {
|
|
24
|
+
/** The canonical object type this bundle was assembled for. */
|
|
25
|
+
readonly objectType: string;
|
|
26
|
+
/** The canonical entity echoed back (the retrieval subject). */
|
|
27
|
+
readonly primary?: Readonly<Record<string, unknown>>;
|
|
28
|
+
readonly documents: readonly ContextDocument[];
|
|
29
|
+
readonly mountPlan: readonly ContextMountEntry[];
|
|
30
|
+
readonly dropped: readonly DroppedContextDocument[];
|
|
31
|
+
/** Total content-byte budget applied while packing the mount plan. */
|
|
32
|
+
readonly byteBudget: number;
|
|
33
|
+
/** Total content bytes materialised in the mount plan (≤ `byteBudget`). */
|
|
34
|
+
readonly bytesUsed: number;
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One retrieved, ranked document included in an assembled
|
|
3
|
+
* {@link ContextBundle}. Sourced from a search/retrieval pass over the
|
|
4
|
+
* canonical-object corpus; `score` is the fused relevance (max across
|
|
5
|
+
* retrieval passes).
|
|
6
|
+
*
|
|
7
|
+
* `content` is the retrieved body (a summary/snippet when the retrieval
|
|
8
|
+
* pass does not return full content). It is the same string materialised
|
|
9
|
+
* as the document's `static-literal` mount bytes when the document fits
|
|
10
|
+
* the byte budget.
|
|
11
|
+
*/
|
|
12
|
+
export interface ContextDocument {
|
|
13
|
+
/** Stable document reference, e.g. `kb_page:src_abc123`. */
|
|
14
|
+
readonly ref: string;
|
|
15
|
+
/** Document type discriminator, e.g. `kb_page`. */
|
|
16
|
+
readonly docType: string;
|
|
17
|
+
readonly title?: string;
|
|
18
|
+
readonly summary?: string;
|
|
19
|
+
/** Retrieved content (summary/snippet when full content is unavailable). */
|
|
20
|
+
readonly content?: string;
|
|
21
|
+
/** Fused relevance score (max across retrieval passes). */
|
|
22
|
+
readonly score: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MountSource } from '../../workflow';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Access mode of a context mount entry. Assembled enterprise context is
|
|
5
|
+
* never written by the agent, so the mode is closed to `read-only`.
|
|
6
|
+
*
|
|
7
|
+
* Modelled as a single-value closed type (const + `typeof` type) rather
|
|
8
|
+
* than a two-member enum: the domain today has exactly one legal value and
|
|
9
|
+
* a wider mode would misrepresent the contract. A future read-write context
|
|
10
|
+
* mode is a deliberate contract change, not an open string.
|
|
11
|
+
*/
|
|
12
|
+
export const CONTEXT_MOUNT_MODE = 'read-only' as const;
|
|
13
|
+
|
|
14
|
+
export type ContextMountMode = typeof CONTEXT_MOUNT_MODE;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* One materialisable mount entry in an assembled {@link ContextBundle}.
|
|
18
|
+
*
|
|
19
|
+
* `source` is the full kernel {@link MountSource} discriminated union — not
|
|
20
|
+
* narrowed to the `static-literal` variant the first producer
|
|
21
|
+
* (connector-gateway-api) emits — so future producers can attach other
|
|
22
|
+
* kinds (e.g. `kb-pages`) without a contract change. The session's
|
|
23
|
+
* mount-apply pipeline materialises every entry as a typed mount, so the
|
|
24
|
+
* assembled context lands under `/workspace/` as real files.
|
|
25
|
+
*/
|
|
26
|
+
export interface ContextMountEntry {
|
|
27
|
+
readonly mode: ContextMountMode;
|
|
28
|
+
readonly source: MountSource;
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a retrieved document was excluded from an assembled
|
|
3
|
+
* {@link ContextBundle}. Closed set — a dropped document is always
|
|
4
|
+
* reported (never silently discarded), and the reason is a typed enum so
|
|
5
|
+
* consumers can branch on it without string matching.
|
|
6
|
+
*
|
|
7
|
+
* Today the only exclusion path is the byte-budget cap applied while
|
|
8
|
+
* charging ranked documents against the bundle's `byteBudget`. New
|
|
9
|
+
* exclusion reasons extend this enum (one member) — do not introduce a
|
|
10
|
+
* free-form reason string.
|
|
11
|
+
*/
|
|
12
|
+
export enum DroppedContextReason {
|
|
13
|
+
/** Adding the document's content would exceed the bundle byte budget. */
|
|
14
|
+
BYTE_BUDGET_EXCEEDED = 'BYTE_BUDGET_EXCEEDED',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** A document excluded from the bundle — reported, never silently dropped. */
|
|
18
|
+
export interface DroppedContextDocument {
|
|
19
|
+
/** Stable document reference of the excluded document. */
|
|
20
|
+
readonly ref: string;
|
|
21
|
+
/** Content byte-size that would have been added had it been included. */
|
|
22
|
+
readonly bytes: number;
|
|
23
|
+
readonly reason: DroppedContextReason;
|
|
24
|
+
}
|