@xemahq/kernel-contracts 0.56.0 → 0.58.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/capability/index.d.ts +1 -0
- package/dist/capability/index.d.ts.map +1 -1
- package/dist/capability/index.js +1 -0
- package/dist/capability/index.js.map +1 -1
- package/dist/capability/lib/capability-contribution.d.ts +2 -0
- package/dist/capability/lib/capability-contribution.d.ts.map +1 -1
- package/dist/capability/lib/capability-contribution.js +2 -0
- package/dist/capability/lib/capability-contribution.js.map +1 -1
- package/dist/capability/lib/capability-reach.d.ts +16 -0
- package/dist/capability/lib/capability-reach.d.ts.map +1 -0
- package/dist/capability/lib/capability-reach.js +47 -0
- package/dist/capability/lib/capability-reach.js.map +1 -0
- package/dist/capability/lib/first-party-capability-domains.d.ts +30 -0
- package/dist/capability/lib/first-party-capability-domains.d.ts.map +1 -0
- package/dist/capability/lib/first-party-capability-domains.js +36 -0
- package/dist/capability/lib/first-party-capability-domains.js.map +1 -0
- package/dist/contribution/lib/contribution-kind.d.ts +0 -2
- package/dist/contribution/lib/contribution-kind.d.ts.map +1 -1
- package/dist/contribution/lib/contribution-kind.js +0 -2
- package/dist/contribution/lib/contribution-kind.js.map +1 -1
- package/dist/search/lib/search-contribution.d.ts +2 -2
- package/dist/search/lib/search-contribution.d.ts.map +1 -1
- package/dist/search/lib/search-contribution.js +12 -3
- package/dist/search/lib/search-contribution.js.map +1 -1
- package/package.json +1 -1
- package/src/capability/index.ts +1 -0
- package/src/capability/lib/capability-contribution.ts +23 -0
- package/src/capability/lib/capability-reach.ts +165 -0
- package/src/contribution/lib/contribution-kind.ts +142 -39
- package/src/search/lib/search-contribution.ts +54 -20
|
@@ -2,6 +2,7 @@ export * from './lib/capability-ref';
|
|
|
2
2
|
export * from './lib/connector-capability-ref';
|
|
3
3
|
export * from './lib/capability-domain';
|
|
4
4
|
export * from './lib/authority-effect';
|
|
5
|
+
export * from './lib/capability-reach';
|
|
5
6
|
export * from './lib/capability-grant';
|
|
6
7
|
export * from './lib/capability-policy';
|
|
7
8
|
export * from './lib/permission-profile';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capability/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capability/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,cAAc,CAAC"}
|
package/dist/capability/index.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./lib/capability-ref"), exports);
|
|
|
18
18
|
__exportStar(require("./lib/connector-capability-ref"), exports);
|
|
19
19
|
__exportStar(require("./lib/capability-domain"), exports);
|
|
20
20
|
__exportStar(require("./lib/authority-effect"), exports);
|
|
21
|
+
__exportStar(require("./lib/capability-reach"), exports);
|
|
21
22
|
__exportStar(require("./lib/capability-grant"), exports);
|
|
22
23
|
__exportStar(require("./lib/capability-policy"), exports);
|
|
23
24
|
__exportStar(require("./lib/permission-profile"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iEAA+C;AAC/C,0DAAwC;AACxC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,iEAA+C;AAC/C,kDAAgC;AAChC,gEAA8C;AAC9C,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,iEAA+C;AAC/C,0DAAwC;AACxC,yDAAuC;AACvC,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,iEAA+C;AAC/C,kDAAgC;AAChC,gEAA8C;AAC9C,+CAA6B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type CapabilityRef } from './capability-ref';
|
|
3
3
|
import { type CapabilityAuthorityEffect } from './authority-effect';
|
|
4
|
+
import { type CapabilityReach } from './capability-reach';
|
|
4
5
|
import { type CapabilityRiskTier } from './permission-profile';
|
|
5
6
|
import { type DataClassification } from '../../space';
|
|
6
7
|
export interface CapabilityContributionManifest {
|
|
@@ -17,6 +18,7 @@ export interface CapabilityContributionManifest {
|
|
|
17
18
|
readonly defaultCredentialBindingRef?: string;
|
|
18
19
|
readonly outputClassification?: DataClassification;
|
|
19
20
|
readonly authorityEffect?: CapabilityAuthorityEffect;
|
|
21
|
+
readonly reach?: CapabilityReach;
|
|
20
22
|
}
|
|
21
23
|
export declare const CapabilityContributionManifestSchema: z.ZodType<CapabilityContributionManifest>;
|
|
22
24
|
//# sourceMappingURL=capability-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-contribution.d.ts","sourceRoot":"","sources":["../../../src/capability/lib/capability-contribution.ts"],"names":[],"mapp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require("zod");
|
|
5
5
|
const capability_ref_1 = require("./capability-ref");
|
|
6
6
|
const authority_effect_1 = require("./authority-effect");
|
|
7
|
+
const capability_reach_1 = require("./capability-reach");
|
|
7
8
|
const permission_profile_1 = require("./permission-profile");
|
|
8
9
|
const space_1 = require("../../space");
|
|
9
10
|
exports.CapabilityContributionManifestSchema = zod_1.z.object({
|
|
@@ -23,5 +24,6 @@ exports.CapabilityContributionManifestSchema = zod_1.z.object({
|
|
|
23
24
|
defaultCredentialBindingRef: zod_1.z.string().min(1).max(200).optional(),
|
|
24
25
|
outputClassification: space_1.DataClassificationSchema.optional(),
|
|
25
26
|
authorityEffect: authority_effect_1.CapabilityAuthorityEffectSchema.optional(),
|
|
27
|
+
reach: capability_reach_1.CapabilityReachSchema.optional(),
|
|
26
28
|
});
|
|
27
29
|
//# sourceMappingURL=capability-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-contribution.js","sourceRoot":"","sources":["../../../src/capability/lib/capability-contribution.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qDAA2E;AAC3E,yDAG4B;AAC5B,6DAG8B;AAC9B,uCAGqB;
|
|
1
|
+
{"version":3,"file":"capability-contribution.js","sourceRoot":"","sources":["../../../src/capability/lib/capability-contribution.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qDAA2E;AAC3E,yDAG4B;AAC5B,yDAAiF;AACjF,6DAG8B;AAC9B,uCAGqB;AAuIR,QAAA,oCAAoC,GAC/C,OAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,oCAAmB;IACxB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACpC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;IACxC,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;IAC9C,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;IAC/C,QAAQ,EAAE,6CAAwB;IAClC,gBAAgB,EAAE,OAAC,CAAC,OAAO,EAAE;IAC7B,QAAQ,EAAE,OAAC;SACR,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC;SACxC,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;IACb,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACzD,2BAA2B,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAClE,oBAAoB,EAAE,gCAAwB,CAAC,QAAQ,EAAE;IACzD,eAAe,EAAE,kDAA+B,CAAC,QAAQ,EAAE;IAC3D,KAAK,EAAE,wCAAqB,CAAC,QAAQ,EAAE;CACxC,CAA8C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare enum CapabilityReach {
|
|
3
|
+
Owner = "owner",
|
|
4
|
+
Integration = "integration",
|
|
5
|
+
Platform = "platform"
|
|
6
|
+
}
|
|
7
|
+
export declare const CapabilityReachSchema: z.ZodEnum<typeof CapabilityReach>;
|
|
8
|
+
export declare const DEFAULT_CAPABILITY_REACH = CapabilityReach.Owner;
|
|
9
|
+
export declare const REACH_RANK: Readonly<Record<CapabilityReach, number>>;
|
|
10
|
+
export declare function reachWithin(candidate: CapabilityReach, ceiling: CapabilityReach): boolean;
|
|
11
|
+
export declare function joinReach(derived: CapabilityReach, declared?: CapabilityReach | undefined): CapabilityReach;
|
|
12
|
+
export declare function deriveCapabilityReach(input: {
|
|
13
|
+
readonly ref?: string;
|
|
14
|
+
readonly invocationKind?: string;
|
|
15
|
+
}): CapabilityReach;
|
|
16
|
+
//# sourceMappingURL=capability-reach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-reach.d.ts","sourceRoot":"","sources":["../../../src/capability/lib/capability-reach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqCxB,oBAAY,eAAe;IAKzB,KAAK,UAAU;IAMf,WAAW,gBAAgB;IAM3B,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,qBAAqB,mCAAgC,CAAC;AAQnE,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAQ9D,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAI/D,CAAC;AAGH,wBAAgB,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAEzF;AAeD,wBAAgB,SAAS,CACvB,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,eAAe,GAAG,SAAS,GACrC,eAAe,CAGjB;AA6BD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAE3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC,GAAG,eAAe,CAWlB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REACH_RANK = exports.DEFAULT_CAPABILITY_REACH = exports.CapabilityReachSchema = exports.CapabilityReach = void 0;
|
|
4
|
+
exports.reachWithin = reachWithin;
|
|
5
|
+
exports.joinReach = joinReach;
|
|
6
|
+
exports.deriveCapabilityReach = deriveCapabilityReach;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const connector_capability_ref_1 = require("./connector-capability-ref");
|
|
9
|
+
var CapabilityReach;
|
|
10
|
+
(function (CapabilityReach) {
|
|
11
|
+
CapabilityReach["Owner"] = "owner";
|
|
12
|
+
CapabilityReach["Integration"] = "integration";
|
|
13
|
+
CapabilityReach["Platform"] = "platform";
|
|
14
|
+
})(CapabilityReach || (exports.CapabilityReach = CapabilityReach = {}));
|
|
15
|
+
exports.CapabilityReachSchema = zod_1.z.nativeEnum(CapabilityReach);
|
|
16
|
+
exports.DEFAULT_CAPABILITY_REACH = CapabilityReach.Owner;
|
|
17
|
+
exports.REACH_RANK = Object.freeze({
|
|
18
|
+
[CapabilityReach.Owner]: 0,
|
|
19
|
+
[CapabilityReach.Integration]: 1,
|
|
20
|
+
[CapabilityReach.Platform]: 2,
|
|
21
|
+
});
|
|
22
|
+
function reachWithin(candidate, ceiling) {
|
|
23
|
+
return exports.REACH_RANK[candidate] <= exports.REACH_RANK[ceiling];
|
|
24
|
+
}
|
|
25
|
+
function joinReach(derived, declared) {
|
|
26
|
+
if (declared === undefined)
|
|
27
|
+
return derived;
|
|
28
|
+
return exports.REACH_RANK[declared] > exports.REACH_RANK[derived] ? declared : derived;
|
|
29
|
+
}
|
|
30
|
+
function deriveCapabilityReach(input) {
|
|
31
|
+
if (input.invocationKind === 'connector') {
|
|
32
|
+
return CapabilityReach.Integration;
|
|
33
|
+
}
|
|
34
|
+
if (input.ref !== undefined &&
|
|
35
|
+
refDomain(input.ref) === connector_capability_ref_1.CONNECTOR_CAPABILITY_DOMAIN) {
|
|
36
|
+
return CapabilityReach.Integration;
|
|
37
|
+
}
|
|
38
|
+
return exports.DEFAULT_CAPABILITY_REACH;
|
|
39
|
+
}
|
|
40
|
+
function refDomain(ref) {
|
|
41
|
+
const separator = ref.indexOf(':');
|
|
42
|
+
if (separator <= 0) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
return ref.slice(0, separator);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=capability-reach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-reach.js","sourceRoot":"","sources":["../../../src/capability/lib/capability-reach.ts"],"names":[],"mappings":";;;AAgFA,kCAEC;AAeD,8BAMC;AA6BD,sDAgBC;AApJD,6BAAwB;AAExB,yEAAyE;AAmCzE,IAAY,eAkBX;AAlBD,WAAY,eAAe;IAKzB,kCAAe,CAAA;IAMf,8CAA2B,CAAA;IAM3B,wCAAqB,CAAA;AACvB,CAAC,EAlBW,eAAe,+BAAf,eAAe,QAkB1B;AAEY,QAAA,qBAAqB,GAAG,OAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAQtD,QAAA,wBAAwB,GAAG,eAAe,CAAC,KAAK,CAAC;AAQjD,QAAA,UAAU,GAA8C,MAAM,CAAC,MAAM,CAAC;IACjF,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;IAC1B,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC;IAChC,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;CAC9B,CAAC,CAAC;AAGH,SAAgB,WAAW,CAAC,SAA0B,EAAE,OAAwB;IAC9E,OAAO,kBAAU,CAAC,SAAS,CAAC,IAAI,kBAAU,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC;AAeD,SAAgB,SAAS,CACvB,OAAwB,EACxB,QAAsC;IAEtC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,kBAAU,CAAC,QAAQ,CAAC,GAAG,kBAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AACzE,CAAC;AA6BD,SAAgB,qBAAqB,CAAC,KAKrC;IACC,IAAI,KAAK,CAAC,cAAc,KAAK,WAAW,EAAE,CAAC;QACzC,OAAO,eAAe,CAAC,WAAW,CAAC;IACrC,CAAC;IACD,IACE,KAAK,CAAC,GAAG,KAAK,SAAS;QACvB,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,sDAA2B,EACpD,CAAC;QACD,OAAO,eAAe,CAAC,WAAW,CAAC;IACrC,CAAC;IACD,OAAO,gCAAwB,CAAC;AAClC,CAAC;AAUD,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FIRST_PARTY_CAPABILITY_DOMAINS: readonly ["xema-shell", "store", "biome", "connector", "kb", "agent", "memory", "model", "model-resolution", "mcp-tool", "workflow", "studio", "interactive-session", "agent-session", "document", "notification", "space", "mailops", "workspace", "worker-runtime", "artifact", "search", "app"];
|
|
3
|
+
export type FirstPartyCapabilityDomain = (typeof FIRST_PARTY_CAPABILITY_DOMAINS)[number];
|
|
4
|
+
export declare const FirstPartyCapabilityDomainSchema: z.ZodEnum<{
|
|
5
|
+
search: "search";
|
|
6
|
+
kb: "kb";
|
|
7
|
+
memory: "memory";
|
|
8
|
+
agent: "agent";
|
|
9
|
+
studio: "studio";
|
|
10
|
+
"agent-session": "agent-session";
|
|
11
|
+
document: "document";
|
|
12
|
+
artifact: "artifact";
|
|
13
|
+
app: "app";
|
|
14
|
+
workflow: "workflow";
|
|
15
|
+
connector: "connector";
|
|
16
|
+
biome: "biome";
|
|
17
|
+
model: "model";
|
|
18
|
+
"xema-shell": "xema-shell";
|
|
19
|
+
store: "store";
|
|
20
|
+
"model-resolution": "model-resolution";
|
|
21
|
+
"mcp-tool": "mcp-tool";
|
|
22
|
+
"interactive-session": "interactive-session";
|
|
23
|
+
notification: "notification";
|
|
24
|
+
space: "space";
|
|
25
|
+
mailops: "mailops";
|
|
26
|
+
workspace: "workspace";
|
|
27
|
+
"worker-runtime": "worker-runtime";
|
|
28
|
+
}>;
|
|
29
|
+
export declare function isFirstPartyCapabilityDomain(domain: string): domain is FirstPartyCapabilityDomain;
|
|
30
|
+
//# sourceMappingURL=first-party-capability-domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-party-capability-domains.d.ts","sourceRoot":"","sources":["../../../src/capability/lib/first-party-capability-domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,eAAO,MAAM,8BAA8B,oSAwBjC,CAAC;AAEX,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;EAK5C,CAAC;AAYF,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,GACb,MAAM,IAAI,0BAA0B,CAEtC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FirstPartyCapabilityDomainSchema = exports.FIRST_PARTY_CAPABILITY_DOMAINS = void 0;
|
|
4
|
+
exports.isFirstPartyCapabilityDomain = isFirstPartyCapabilityDomain;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.FIRST_PARTY_CAPABILITY_DOMAINS = [
|
|
7
|
+
'xema-shell',
|
|
8
|
+
'store',
|
|
9
|
+
'biome',
|
|
10
|
+
'connector',
|
|
11
|
+
'kb',
|
|
12
|
+
'agent',
|
|
13
|
+
'memory',
|
|
14
|
+
'model',
|
|
15
|
+
'model-resolution',
|
|
16
|
+
'mcp-tool',
|
|
17
|
+
'workflow',
|
|
18
|
+
'studio',
|
|
19
|
+
'interactive-session',
|
|
20
|
+
'agent-session',
|
|
21
|
+
'document',
|
|
22
|
+
'notification',
|
|
23
|
+
'space',
|
|
24
|
+
'mailops',
|
|
25
|
+
'workspace',
|
|
26
|
+
'worker-runtime',
|
|
27
|
+
'artifact',
|
|
28
|
+
'search',
|
|
29
|
+
'app',
|
|
30
|
+
];
|
|
31
|
+
exports.FirstPartyCapabilityDomainSchema = zod_1.z.enum(exports.FIRST_PARTY_CAPABILITY_DOMAINS);
|
|
32
|
+
const FIRST_PARTY_CAPABILITY_DOMAIN_SET = new Set(exports.FIRST_PARTY_CAPABILITY_DOMAINS);
|
|
33
|
+
function isFirstPartyCapabilityDomain(domain) {
|
|
34
|
+
return FIRST_PARTY_CAPABILITY_DOMAIN_SET.has(domain);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=first-party-capability-domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-party-capability-domains.js","sourceRoot":"","sources":["../../../src/capability/lib/first-party-capability-domains.ts"],"names":[],"mappings":";;;AAwEA,oEAIC;AA5ED,6BAAwB;AA0BX,QAAA,8BAA8B,GAAG;IAC5C,YAAY;IACZ,OAAO;IACP,OAAO;IACP,WAAW;IACX,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,OAAO;IACP,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,qBAAqB;IACrB,eAAe;IACf,UAAU;IACV,cAAc;IACd,OAAO;IACP,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,UAAU;IACV,QAAQ;IACR,KAAK;CACG,CAAC;AAKE,QAAA,gCAAgC,GAAG,OAAC,CAAC,IAAI,CACpD,sCAGC,CACF,CAAC;AAEF,MAAM,iCAAiC,GAAwB,IAAI,GAAG,CACpE,sCAA8B,CAC/B,CAAC;AAQF,SAAgB,4BAA4B,CAC1C,MAAc;IAEd,OAAO,iCAAiC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare enum ContributionKind {
|
|
3
3
|
MountSource = "mount-source",
|
|
4
|
-
McpTool = "mcp-tool",
|
|
5
4
|
WorkflowStep = "workflow-step",
|
|
6
5
|
AgentSkill = "agent-skill",
|
|
7
6
|
AgentKernel = "agent-kernel",
|
|
@@ -19,7 +18,6 @@ export declare enum ContributionKind {
|
|
|
19
18
|
WorkflowConfig = "workflow-config",
|
|
20
19
|
DeliverableSpec = "deliverable-spec",
|
|
21
20
|
WorkspaceManifest = "workspace-manifest",
|
|
22
|
-
WorkspaceManifestTemplate = "workspace-manifest-template",
|
|
23
21
|
ToolProfile = "tool-profile",
|
|
24
22
|
McpCatalog = "mcp-catalog",
|
|
25
23
|
OpenCodeTool = "opencode-tool",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution-kind.d.ts","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"contribution-kind.d.ts","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsExB,oBAAY,gBAAgB;IAS1B,WAAW,iBAAiB;IAU5B,YAAY,kBAAkB;IAC9B,UAAU,gBAAgB;IAC1B,WAAW,iBAAiB;IAS5B,wBAAwB,+BAA+B;IACvD,UAAU,gBAAgB;IAsB1B,WAAW,iBAAiB;IAQ5B,YAAY,kBAAkB;IAM9B,WAAW,iBAAiB;IAW5B,cAAc,oBAAoB;IAclC,kBAAkB,yBAAyB;IAY3C,IAAI,SAAS;IAEb,UAAU,gBAAgB;IAe1B,oBAAoB,0BAA0B;IAG9C,gBAAgB,sBAAsB;IAItC,cAAc,oBAAoB;IAElC,eAAe,qBAAqB;IAEpC,iBAAiB,uBAAuB;IAaxC,WAAW,iBAAiB;IAI5B,UAAU,gBAAgB;IA4C1B,YAAY,kBAAkB;IAuB9B,cAAc,oBAAoB;IAkBlC,UAAU,eAAe;IAezB,iBAAiB,uBAAuB;IAcxC,YAAY,kBAAkB;IAkB9B,UAAU,gBAAgB;IAoB1B,kBAAkB,wBAAwB;IAmB1C,mBAAmB,0BAA0B;IAkB7C,eAAe,qBAAqB;CACrC;AAMD,eAAO,MAAM,sBAAsB,oCAAiC,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,GAAG,gBAAgB,EAAE,CAAC"}
|
|
@@ -5,7 +5,6 @@ const zod_1 = require("zod");
|
|
|
5
5
|
var ContributionKind;
|
|
6
6
|
(function (ContributionKind) {
|
|
7
7
|
ContributionKind["MountSource"] = "mount-source";
|
|
8
|
-
ContributionKind["McpTool"] = "mcp-tool";
|
|
9
8
|
ContributionKind["WorkflowStep"] = "workflow-step";
|
|
10
9
|
ContributionKind["AgentSkill"] = "agent-skill";
|
|
11
10
|
ContributionKind["AgentKernel"] = "agent-kernel";
|
|
@@ -23,7 +22,6 @@ var ContributionKind;
|
|
|
23
22
|
ContributionKind["WorkflowConfig"] = "workflow-config";
|
|
24
23
|
ContributionKind["DeliverableSpec"] = "deliverable-spec";
|
|
25
24
|
ContributionKind["WorkspaceManifest"] = "workspace-manifest";
|
|
26
|
-
ContributionKind["WorkspaceManifestTemplate"] = "workspace-manifest-template";
|
|
27
25
|
ContributionKind["ToolProfile"] = "tool-profile";
|
|
28
26
|
ContributionKind["McpCatalog"] = "mcp-catalog";
|
|
29
27
|
ContributionKind["OpenCodeTool"] = "opencode-tool";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution-kind.js","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"contribution-kind.js","sourceRoot":"","sources":["../../../src/contribution/lib/contribution-kind.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAsExB,IAAY,gBAmVX;AAnVD,WAAY,gBAAgB;IAS1B,gDAA4B,CAAA;IAU5B,kDAA8B,CAAA;IAC9B,8CAA0B,CAAA;IAC1B,gDAA4B,CAAA;IAS5B,2EAAuD,CAAA;IACvD,8CAA0B,CAAA;IAsB1B,gDAA4B,CAAA;IAQ5B,kDAA8B,CAAA;IAM9B,gDAA4B,CAAA;IAW5B,sDAAkC,CAAA;IAclC,+DAA2C,CAAA;IAY3C,iCAAa,CAAA;IAEb,8CAA0B,CAAA;IAe1B,kEAA8C,CAAA;IAG9C,0DAAsC,CAAA;IAItC,sDAAkC,CAAA;IAElC,wDAAoC,CAAA;IAEpC,4DAAwC,CAAA;IAaxC,gDAA4B,CAAA;IAI5B,8CAA0B,CAAA;IA4C1B,kDAA8B,CAAA;IAuB9B,sDAAkC,CAAA;IAkBlC,6CAAyB,CAAA;IAezB,4DAAwC,CAAA;IAcxC,kDAA8B,CAAA;IAkB9B,8CAA0B,CAAA;IAoB1B,8DAA0C,CAAA;IAmB1C,iEAA6C,CAAA;IAkB7C,wDAAoC,CAAA;AACtC,CAAC,EAnVW,gBAAgB,gCAAhB,gBAAgB,QAmV3B;AAMY,QAAA,sBAAsB,GAAG,OAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -16,7 +16,7 @@ export interface SearchTypeAuthzMapping {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const SearchTypeAuthzMappingSchema: z.ZodType<SearchTypeAuthzMapping>;
|
|
18
18
|
export interface SearchTypeContributionManifest {
|
|
19
|
-
readonly objectKind
|
|
19
|
+
readonly objectKind?: XemaObjectKind;
|
|
20
20
|
readonly docType?: string;
|
|
21
21
|
readonly renderHints: SearchTypeRenderHints;
|
|
22
22
|
readonly searchableFields: readonly string[];
|
|
@@ -25,5 +25,5 @@ export interface SearchTypeContributionManifest {
|
|
|
25
25
|
readonly searchReplayCapabilityRef?: CapabilityRef;
|
|
26
26
|
}
|
|
27
27
|
export declare const SearchTypeContributionManifestSchema: z.ZodType<SearchTypeContributionManifest>;
|
|
28
|
-
export declare function searchTypeNaturalKey(objectKind
|
|
28
|
+
export declare function searchTypeNaturalKey(objectKind?: XemaObjectKind, docType?: string): string;
|
|
29
29
|
//# sourceMappingURL=search-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-contribution.d.ts","sourceRoot":"","sources":["../../../src/search/lib/search-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAwB,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,yBAAyB,EAE1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,2BAA2B,EAE5B,MAAM,kBAAkB,CAAC;AA6B1B,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAevB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAiBhC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAC/D;AASD,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CA2C/B,CAAC;AAW3C,MAAM,WAAW,sBAAsB;IAErC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;CACvD;AAED,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAA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IAE3C,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IAOvC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,aAAa,CAAC;CACpD;AASD,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAsB9B,CAAC;AAY9D,wBAAgB,oBAAoB,CAClC,UAAU,CAAC,EAAE,cAAc,EAC3B,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CASR"}
|
|
@@ -55,8 +55,9 @@ exports.SearchTypeAuthzMappingSchema = zod_1.z.object({
|
|
|
55
55
|
resourceType: zod_1.z.string().min(1).max(SEARCH_TYPE_STRING_MAX),
|
|
56
56
|
defaultVisibility: resource_1.ResourceVisibilityPatternSchema,
|
|
57
57
|
});
|
|
58
|
-
exports.SearchTypeContributionManifestSchema = zod_1.z
|
|
59
|
-
|
|
58
|
+
exports.SearchTypeContributionManifestSchema = zod_1.z
|
|
59
|
+
.object({
|
|
60
|
+
objectKind: object_1.XemaObjectKindSchema.optional(),
|
|
60
61
|
docType: zod_1.z.string().min(1).max(SEARCH_TYPE_STRING_MAX).optional(),
|
|
61
62
|
renderHints: exports.SearchTypeRenderHintsSchema,
|
|
62
63
|
searchableFields: zod_1.z
|
|
@@ -66,8 +67,16 @@ exports.SearchTypeContributionManifestSchema = zod_1.z.object({
|
|
|
66
67
|
embeddingEligibleDefault: zod_1.z.boolean(),
|
|
67
68
|
authz: exports.SearchTypeAuthzMappingSchema,
|
|
68
69
|
searchReplayCapabilityRef: capability_1.CapabilityRefSchema.optional(),
|
|
69
|
-
})
|
|
70
|
+
})
|
|
71
|
+
.refine((m) => m.objectKind !== undefined || m.docType !== undefined, 'a search-type contribution must declare objectKind, docType, or both — ' +
|
|
72
|
+
'the natural key is (objectKind, docType) and cannot be empty');
|
|
70
73
|
function searchTypeNaturalKey(objectKind, docType) {
|
|
74
|
+
if (objectKind === undefined && docType === undefined) {
|
|
75
|
+
throw new Error('searchTypeNaturalKey: neither objectKind nor docType was supplied — ' +
|
|
76
|
+
'a result-type must be addressable by at least one.');
|
|
77
|
+
}
|
|
78
|
+
if (objectKind === undefined)
|
|
79
|
+
return String(docType);
|
|
71
80
|
return docType ? `${objectKind}/${docType}` : String(objectKind);
|
|
72
81
|
}
|
|
73
82
|
//# sourceMappingURL=search-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-contribution.js","sourceRoot":"","sources":["../../../src/search/lib/search-contribution.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"search-contribution.js","sourceRoot":"","sources":["../../../src/search/lib/search-contribution.ts"],"names":[],"mappings":";;;AAmQA,oDAYC;AA/QD,6BAAwB;AAExB,iDAA2E;AAC3E,yCAAoE;AACpE,6CAGwB;AACxB,qDAK0B;AAO1B,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAOnC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAO3C,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAoDnC,MAAM,4BAA4B,GAAG,iDAAgC,CAAC,IAAI,CAAC;AAE9D,QAAA,2BAA2B,GACtC,OAAC;KACE,MAAM,CAAC;IACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC;IACpD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IAC9D,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,8BAA8B,CAAC;SACnC,QAAQ,EAAE;IACb,WAAW,EAAE,OAAC;SACX,KAAK,CAAC,OAAC,CAAC,UAAU,CAAC,4CAA2B,CAAC,CAAC;SAChD,GAAG,CAAC,4BAA4B,CAAC;SACjC,QAAQ,EAAE;CACd,CAAC;KACD,WAAW,CAAC,CAA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IACjE,WAAW,EAAE,mCAA2B;IACxC,gBAAgB,EAAE,OAAC;SAChB,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,sBAAsB,CAAC;IAC9B,wBAAwB,EAAE,OAAC,CAAC,OAAO,EAAE;IACrC,KAAK,EAAE,oCAA4B;IACnC,yBAAyB,EAAE,gCAAmB,CAAC,QAAQ,EAAE;CAC1D,CAAC;KAKD,MAAM,CACL,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,EAC5D,yEAAyE;IACvE,8DAA8D,CACT,CAAC;AAY9D,SAAgB,oBAAoB,CAClC,UAA2B,EAC3B,OAAgB;IAEhB,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,sEAAsE;YACpE,oDAAoD,CACvD,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACnE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.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)",
|
package/src/capability/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './lib/capability-ref';
|
|
|
2
2
|
export * from './lib/connector-capability-ref';
|
|
3
3
|
export * from './lib/capability-domain';
|
|
4
4
|
export * from './lib/authority-effect';
|
|
5
|
+
export * from './lib/capability-reach';
|
|
5
6
|
export * from './lib/capability-grant';
|
|
6
7
|
export * from './lib/capability-policy';
|
|
7
8
|
export * from './lib/permission-profile';
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
CapabilityAuthorityEffectSchema,
|
|
6
6
|
type CapabilityAuthorityEffect,
|
|
7
7
|
} from './authority-effect';
|
|
8
|
+
import { CapabilityReachSchema, type CapabilityReach } from './capability-reach';
|
|
8
9
|
import {
|
|
9
10
|
CapabilityRiskTierSchema,
|
|
10
11
|
type CapabilityRiskTier,
|
|
@@ -112,6 +113,27 @@ export interface CapabilityContributionManifest {
|
|
|
112
113
|
* and the denial message precise, not to obtain a bypass.
|
|
113
114
|
*/
|
|
114
115
|
readonly authorityEffect?: CapabilityAuthorityEffect;
|
|
116
|
+
/**
|
|
117
|
+
* OPTIONAL declared answer to "how far outside the invoking subject does this
|
|
118
|
+
* capability reach?" — consumed by the `AgentReachTier` resolver to decide
|
|
119
|
+
* which capabilities the `connected` and `full` tiers open up.
|
|
120
|
+
*
|
|
121
|
+
* Absent ⇒ derived, and the derivation is the SAFE floor, not a guess: a
|
|
122
|
+
* `connector`-kind invocation binding reaches an external system by
|
|
123
|
+
* construction and derives {@link CapabilityReach.Integration}; everything
|
|
124
|
+
* else derives {@link CapabilityReach.Owner}, which grants nothing beyond
|
|
125
|
+
* what the owner already holds.
|
|
126
|
+
*
|
|
127
|
+
* Declare it to RAISE reach above that floor — an http-bound capability that
|
|
128
|
+
* nonetheless touches org-wide shared state (the knowledge base) or the
|
|
129
|
+
* control plane. A declaration cannot LOWER the derived reach, so a producer
|
|
130
|
+
* cannot opt its own connector out of the tier system.
|
|
131
|
+
*
|
|
132
|
+
* This replaced a hand-maintained roster in `authorization-api`. The fact now
|
|
133
|
+
* lives on the capability, so a new integration capability cannot be
|
|
134
|
+
* forgotten by a list in another repo.
|
|
135
|
+
*/
|
|
136
|
+
readonly reach?: CapabilityReach;
|
|
115
137
|
}
|
|
116
138
|
|
|
117
139
|
/**
|
|
@@ -144,4 +166,5 @@ export const CapabilityContributionManifestSchema: z.ZodType<CapabilityContribut
|
|
|
144
166
|
defaultCredentialBindingRef: z.string().min(1).max(200).optional(),
|
|
145
167
|
outputClassification: DataClassificationSchema.optional(),
|
|
146
168
|
authorityEffect: CapabilityAuthorityEffectSchema.optional(),
|
|
169
|
+
reach: CapabilityReachSchema.optional(),
|
|
147
170
|
}) as z.ZodType<CapabilityContributionManifest>;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { CONNECTOR_CAPABILITY_DOMAIN } from './connector-capability-ref';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `CapabilityReach` — DECLARED answer to "how far outside the owner does
|
|
7
|
+
* invoking this capability reach?".
|
|
8
|
+
*
|
|
9
|
+
* WHY THIS EXISTS
|
|
10
|
+
* ---------------
|
|
11
|
+
* `AgentReachTier` (sandbox | as-owner | connected | full) is the CEILING a
|
|
12
|
+
* user picks for an agent. Turning that ceiling into a concrete capability set
|
|
13
|
+
* used to require a hand-maintained list in `authorization-api`
|
|
14
|
+
* (`CONNECTED_TIER_STARTER_CAPABILITIES`) — a central roster that every new
|
|
15
|
+
* integration capability had to be added to, in a different repo from the
|
|
16
|
+
* capability itself. That is the classic drift shape this platform has been
|
|
17
|
+
* removing everywhere else: the fact lives on the thing, not in a list about
|
|
18
|
+
* the thing.
|
|
19
|
+
*
|
|
20
|
+
* A capability now declares its own reach, and the tier resolves from the
|
|
21
|
+
* declarations. Adding an integration capability is a one-line declaration at
|
|
22
|
+
* the producer; no edit to `authorization-api`, and no way to forget one.
|
|
23
|
+
*
|
|
24
|
+
* PRECEDENCE — declared RAISES, derivation is the floor
|
|
25
|
+
* -----------------------------------------------------
|
|
26
|
+
* Absent ⇒ derived. A capability that is a connector — by its invocation
|
|
27
|
+
* binding OR by its ref domain, see {@link deriveCapabilityReach} — derives
|
|
28
|
+
* {@link CapabilityReach.Integration} with no declaration at all. Everything
|
|
29
|
+
* else derives {@link CapabilityReach.Owner}, which is the SAFE default: it
|
|
30
|
+
* grants nothing beyond what the owner already holds.
|
|
31
|
+
*
|
|
32
|
+
* A declaration may therefore only ever be needed to RAISE reach above the
|
|
33
|
+
* derived floor (an http-bound capability that nonetheless touches org-wide
|
|
34
|
+
* state, e.g. the knowledge base). It is deliberately NOT possible to declare
|
|
35
|
+
* a capability as lower-reach than its binding implies — that would let a
|
|
36
|
+
* producer opt its own connector out of the tier system.
|
|
37
|
+
*/
|
|
38
|
+
export enum CapabilityReach {
|
|
39
|
+
/**
|
|
40
|
+
* Confined to what the invoking subject already holds. The default, and the
|
|
41
|
+
* only reach an `as-owner` agent gets. Grants no additional authority.
|
|
42
|
+
*/
|
|
43
|
+
Owner = 'owner',
|
|
44
|
+
/**
|
|
45
|
+
* Reaches a connected external system (SCM, tracker, mail, the governed
|
|
46
|
+
* public web) or org-wide shared state (the knowledge base). This is exactly
|
|
47
|
+
* the set the `connected` tier opens up.
|
|
48
|
+
*/
|
|
49
|
+
Integration = 'integration',
|
|
50
|
+
/**
|
|
51
|
+
* Reaches the Xema control plane itself — installing biomes, minting
|
|
52
|
+
* credentials, altering grants. Only the `full` tier admits these, and the
|
|
53
|
+
* self-escalation guard applies independently.
|
|
54
|
+
*/
|
|
55
|
+
Platform = 'platform',
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const CapabilityReachSchema = z.nativeEnum(CapabilityReach);
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The reach a capability has when it declares none. Kept as a named constant so
|
|
62
|
+
* the projector, the tier resolver and any future consumer cannot disagree
|
|
63
|
+
* about what "absent" means — and so the safe value is stated once, not
|
|
64
|
+
* repeated at each call site.
|
|
65
|
+
*/
|
|
66
|
+
export const DEFAULT_CAPABILITY_REACH = CapabilityReach.Owner;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Which reaches a given {@link CapabilityReach} tier admits, most-restrictive
|
|
70
|
+
* first. Exported so the tier resolver reads a declared table rather than
|
|
71
|
+
* re-deriving the ordering, and so a new reach member is a compile error at
|
|
72
|
+
* every consumer rather than a silent omission.
|
|
73
|
+
*/
|
|
74
|
+
export const REACH_RANK: Readonly<Record<CapabilityReach, number>> = Object.freeze({
|
|
75
|
+
[CapabilityReach.Owner]: 0,
|
|
76
|
+
[CapabilityReach.Integration]: 1,
|
|
77
|
+
[CapabilityReach.Platform]: 2,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/** True when `candidate` is within `ceiling`. Total over the closed set. */
|
|
81
|
+
export function reachWithin(candidate: CapabilityReach, ceiling: CapabilityReach): boolean {
|
|
82
|
+
return REACH_RANK[candidate] <= REACH_RANK[ceiling];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Combine a DERIVED reach with an optional DECLARED one, taking the wider of
|
|
87
|
+
* the two.
|
|
88
|
+
*
|
|
89
|
+
* This is a monotone join, NOT `declared ?? derived`, and the asymmetry is the
|
|
90
|
+
* whole safety property: a declaration may RAISE reach (the knowledge base is
|
|
91
|
+
* `Integration` despite riding an ordinary http route) but can never LOWER it.
|
|
92
|
+
* Without that, a producer could declare its own connector as `Owner` and quietly
|
|
93
|
+
* escape the tier system — the same bypass `joinAuthorityEffect` exists to
|
|
94
|
+
* prevent for the self-escalation guard.
|
|
95
|
+
*
|
|
96
|
+
* Absent declaration ⇒ the derived value, unchanged.
|
|
97
|
+
*/
|
|
98
|
+
export function joinReach(
|
|
99
|
+
derived: CapabilityReach,
|
|
100
|
+
declared?: CapabilityReach | undefined,
|
|
101
|
+
): CapabilityReach {
|
|
102
|
+
if (declared === undefined) return derived;
|
|
103
|
+
return REACH_RANK[declared] > REACH_RANK[derived] ? declared : derived;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The reach a capability has by construction, before any declaration.
|
|
108
|
+
*
|
|
109
|
+
* TWO independent structural signals, either of which is sufficient. Both are
|
|
110
|
+
* facts about the capability that the platform already holds — neither is a
|
|
111
|
+
* guess, and neither needs an author to remember anything:
|
|
112
|
+
*
|
|
113
|
+
* 1. **The invocation binding kind.** A `connector`-kind binding reaches a
|
|
114
|
+
* connected external system — that is what a connector IS.
|
|
115
|
+
* 2. **The ref domain.** A ref in the `connector` domain
|
|
116
|
+
* ({@link CONNECTOR_CAPABILITY_DOMAIN}) is a connector capability by the
|
|
117
|
+
* ref grammar itself, which is a typed contract, not a naming convention.
|
|
118
|
+
*
|
|
119
|
+
* Signal 2 is not redundant, and leaving it out was a real bug: connector
|
|
120
|
+
* capabilities are today published with `http` invocation bindings (they are
|
|
121
|
+
* invoked through the connector gateway over HTTP), so binding-kind alone
|
|
122
|
+
* derives `owner` and every `connector:*` ref silently drops out of the
|
|
123
|
+
* `connected` reach tier. That is the exact failure mode — a capability quietly
|
|
124
|
+
* outside the tier that names it — this whole mechanism replaced a
|
|
125
|
+
* hand-maintained roster to prevent.
|
|
126
|
+
*
|
|
127
|
+
* Everything else derives the safe floor; raising it is the author's explicit
|
|
128
|
+
* act via a declared `reach`.
|
|
129
|
+
*
|
|
130
|
+
* Kept here, beside the enum, so the projector, the registry and the tier
|
|
131
|
+
* resolver cannot drift on what "derived" means.
|
|
132
|
+
*/
|
|
133
|
+
export function deriveCapabilityReach(input: {
|
|
134
|
+
/** Canonical capability ref. Unparseable refs contribute no signal. */
|
|
135
|
+
readonly ref?: string;
|
|
136
|
+
/** `CapabilityInvocationBinding.kind`, when the capability declares one. */
|
|
137
|
+
readonly invocationKind?: string;
|
|
138
|
+
}): CapabilityReach {
|
|
139
|
+
if (input.invocationKind === 'connector') {
|
|
140
|
+
return CapabilityReach.Integration;
|
|
141
|
+
}
|
|
142
|
+
if (
|
|
143
|
+
input.ref !== undefined &&
|
|
144
|
+
refDomain(input.ref) === CONNECTOR_CAPABILITY_DOMAIN
|
|
145
|
+
) {
|
|
146
|
+
return CapabilityReach.Integration;
|
|
147
|
+
}
|
|
148
|
+
return DEFAULT_CAPABILITY_REACH;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Domain segment of a capability ref, or `undefined` when the ref does not
|
|
153
|
+
* parse.
|
|
154
|
+
*
|
|
155
|
+
* Deliberately does NOT throw: this is a derivation input, and a malformed ref
|
|
156
|
+
* must contribute no reach signal rather than abort the read path that is
|
|
157
|
+
* validating it. The ref's own validation happens where it is written.
|
|
158
|
+
*/
|
|
159
|
+
function refDomain(ref: string): string | undefined {
|
|
160
|
+
const separator = ref.indexOf(':');
|
|
161
|
+
if (separator <= 0) {
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
return ref.slice(0, separator);
|
|
165
|
+
}
|
|
@@ -29,13 +29,22 @@ import { z } from 'zod';
|
|
|
29
29
|
* parser.
|
|
30
30
|
* 3. RESERVED — declared for protocol/catalog completeness but with NO
|
|
31
31
|
* contribution-protocol ingestion path today. Every remaining RESERVED
|
|
32
|
-
* member has a REAL delivery path
|
|
33
|
-
*
|
|
34
|
-
* that
|
|
35
|
-
* `
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
32
|
+
* member has a REAL, verified delivery path that is deliberately NOT the
|
|
33
|
+
* contribution protocol — either a biome-host-api HTTP content endpoint
|
|
34
|
+
* that reads the biome's convention directory off disk ON DEMAND
|
|
35
|
+
* (`Icon`, `BiomeInstallSchema`, `ProvisioningScaffold`), or a build-time
|
|
36
|
+
* bake into the agent-runtime image (`OpenCodeTool`, `OpenCodePlugin`).
|
|
37
|
+
* None of them is "seeded": nothing walks those directories at boot.
|
|
38
|
+
* A member with NO delivery path at all is DELETED rather than left as
|
|
39
|
+
* decoration — `GateAction`, `ChartRuntime`, `WorkspaceSpecOverlay` and
|
|
40
|
+
* `SystemOverlayContribution` in the first cleanup; `McpTool` and
|
|
41
|
+
* `WorkspaceManifestTemplate` in the second (each had zero readers, zero
|
|
42
|
+
* on-disk instances anywhere in the tree, no manifest schema, and a live
|
|
43
|
+
* superseding kind — `McpCatalog` and `AgentSkill` respectively). Do NOT
|
|
44
|
+
* assume a biome-host parser exists for a RESERVED member, and do not
|
|
45
|
+
* ship a biome contribution of that kind expecting it to be ingested —
|
|
46
|
+
* biome-host's `assertContributionKindsAreIngestable` coverage guard
|
|
47
|
+
* rejects it fail-fast, naming the file.
|
|
39
48
|
*
|
|
40
49
|
* This doc-comment is kept HONEST by review: a member with no biome-host parser
|
|
41
50
|
* MUST be annotated with its true category (2 or 3). An earlier revision falsely
|
|
@@ -48,7 +57,16 @@ import { z } from 'zod';
|
|
|
48
57
|
* Enum string values match the slug spoken by the rest of the protocol
|
|
49
58
|
* (Capability References, manifest declarations) so that round-tripping
|
|
50
59
|
* between the enum and the wire is lossless. The values themselves are a WIRE
|
|
51
|
-
* CONTRACT — never rename or delete a member without a migration plan.
|
|
60
|
+
* CONTRACT — never rename or delete a member without a migration plan. The
|
|
61
|
+
* migration plan for the two deletions above is EMPTY BY CONSTRUCTION, and that
|
|
62
|
+
* is the bar any future deletion must clear: neither value had a producer (no
|
|
63
|
+
* biome ships the directory, no parser emits the envelope), a consumer (no
|
|
64
|
+
* routing-table row, no sync handler), or a persisted row (the contribution-sync
|
|
65
|
+
* store's `kind` column is an open `string`, and biome-host's coverage guard has
|
|
66
|
+
* been rejecting envelopes of both kinds fail-fast). The only downstream churn is
|
|
67
|
+
* mechanical regeneration: biome-host-api's `openapi.public.json`, the generated
|
|
68
|
+
* `@xemahq/biome-host-api-client` `contributionKind` model, and the frontend
|
|
69
|
+
* mirror of both (via `pnpm sync:frontend`).
|
|
52
70
|
*/
|
|
53
71
|
export enum ContributionKind {
|
|
54
72
|
// -- v1 seed ---------------------------------------------------------------
|
|
@@ -60,13 +78,15 @@ export enum ContributionKind {
|
|
|
60
78
|
* stays the authoritative owner and read path; there is NO biome-host parser.
|
|
61
79
|
*/
|
|
62
80
|
MountSource = 'mount-source',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
// `McpTool = 'mcp-tool'` was DELETED here. It claimed delivery through a
|
|
82
|
+
// `mcp-tools/` convention directory that NO biome ships and NO code reads:
|
|
83
|
+
// the only references were the `CONTENT_KIND_DIR` / `CONTENT_KIND_EXTENSIONS`
|
|
84
|
+
// table rows and biome-host's generic presence loop. There was no manifest
|
|
85
|
+
// schema (kernel or SDK), no owning registry, and no sync handler. The live
|
|
86
|
+
// MCP contribution path is `McpCatalog` (parser + routes to BOTH
|
|
87
|
+
// llm-registry-api and mcp-gateway-api); the live per-biome code-tool
|
|
88
|
+
// declaration is the manifest block `xema.mcpTools[]`, which is unrelated to
|
|
89
|
+
// this enum despite the shared name.
|
|
70
90
|
WorkflowStep = 'workflow-step',
|
|
71
91
|
AgentSkill = 'agent-skill',
|
|
72
92
|
AgentKernel = 'agent-kernel',
|
|
@@ -128,22 +148,46 @@ export enum ContributionKind {
|
|
|
128
148
|
/** A role capability bundle contributed by a biome. */
|
|
129
149
|
RoleCapability = 'role-capability',
|
|
130
150
|
/**
|
|
131
|
-
* RESERVED (category 3). No
|
|
132
|
-
* resource-selection schema
|
|
133
|
-
*
|
|
151
|
+
* RESERVED (category 3). No parser, and none is wanted: the install-wizard
|
|
152
|
+
* resource-selection schema is an OPAQUE, browser-facing JSON Schema that
|
|
153
|
+
* biome-host-api serves on demand from the biome's convention
|
|
154
|
+
* `install-schema/` directory (`install.json` plus an optional
|
|
155
|
+
* `ui-schema.json`) via `GET /platform/biomes/server/:id/install-schema`. It
|
|
156
|
+
* is not seeded at boot and never crosses a service boundary as a
|
|
157
|
+
* contribution — the only consumer is the frontend install wizard, which
|
|
158
|
+
* pulls it over HTTP and renders it with rjsf. There is nothing for a kernel
|
|
159
|
+
* manifest schema to validate: the body is an arbitrary draft-2020-12 JSON
|
|
160
|
+
* Schema, and a parser could only pass it through verbatim to a registry
|
|
161
|
+
* that does not exist.
|
|
134
162
|
*/
|
|
135
163
|
BiomeInstallSchema = 'biome-install-schema',
|
|
136
164
|
/**
|
|
137
|
-
* RESERVED (category 3). No parser
|
|
138
|
-
*
|
|
165
|
+
* RESERVED (category 3). No parser, and none is wanted: icons are BYTE
|
|
166
|
+
* ASSETS, not manifests — biome-host-api serves each one straight off disk
|
|
167
|
+
* from the biome's convention `icons/` directory via the public CDN-asset
|
|
168
|
+
* route `GET /platform/biomes/server/:id/icons/:slug.svg`, discovered by
|
|
169
|
+
* on-disk presence and never indexed. Nothing queries "which icons exist":
|
|
170
|
+
* the caller already knows the slug (it is the workflow activity kind) and
|
|
171
|
+
* builds the URL deterministically, so a third-party biome overrides an icon
|
|
172
|
+
* simply by shipping the file. Routing SVG bytes through the contribution
|
|
173
|
+
* outbox would mean base64-in-JSON into a database row only to re-serve it.
|
|
139
174
|
*/
|
|
140
175
|
Icon = 'icon',
|
|
141
176
|
/** A project-kit bundle contributed by a biome. */
|
|
142
177
|
ProjectKit = 'project-kit',
|
|
143
178
|
/**
|
|
144
|
-
* RESERVED (category 3). No parser
|
|
145
|
-
*
|
|
146
|
-
* `
|
|
179
|
+
* RESERVED (category 3). No parser: a provisioning scaffold is declared in
|
|
180
|
+
* the manifest's `xema.provisioning[]` and authored as
|
|
181
|
+
* `provisioning/<id>.yaml` plus an optional `provisioning/<id>/` template
|
|
182
|
+
* tree, and agent-session-api's `provisioning-plan-resolver` PULLS it over
|
|
183
|
+
* HTTP per session bootstrap from biome-host-api's
|
|
184
|
+
* `GET /platform/biomes/server/:id/provisioning-scaffolds`. The render
|
|
185
|
+
* depends on that session's runtime `customConfig`, so there is no static
|
|
186
|
+
* descriptor to upsert into a registry, and agent-session-api has no
|
|
187
|
+
* contribution-sync seam. NOTE the declaration-vs-disk parity check is LAZY,
|
|
188
|
+
* not boot-time: it runs inside `loadProvisioningScaffolds` when the
|
|
189
|
+
* scaffolds are fetched, so a biome whose `provisioning[]` disagrees with its
|
|
190
|
+
* `provisioning/` directory boots green and fails at first provision.
|
|
147
191
|
*/
|
|
148
192
|
ProvisioningScaffold = 'provisioning-scaffold',
|
|
149
193
|
/** A concrete connector provider contributed by a biome inside an
|
|
@@ -157,29 +201,88 @@ export enum ContributionKind {
|
|
|
157
201
|
DeliverableSpec = 'deliverable-spec',
|
|
158
202
|
/** A workspace manifest contributed by a biome. */
|
|
159
203
|
WorkspaceManifest = 'workspace-manifest',
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
204
|
+
// `WorkspaceManifestTemplate = 'workspace-manifest-template'` was DELETED
|
|
205
|
+
// here. It claimed delivery through a `workspace-manifest-templates/`
|
|
206
|
+
// convention directory that NOTHING reads — no seeder, no endpoint, and no
|
|
207
|
+
// `walkContent` call for that kind exists anywhere. The manifest templates a
|
|
208
|
+
// workspace actually renders (`spec.seedFiles[].template`) are resolved at
|
|
209
|
+
// compose time by `buildSkillBundleTemplateResolver` from SKILL BUNDLE
|
|
210
|
+
// resources at `assets/templates/<name>.hbs`, fetched from
|
|
211
|
+
// skill-registry-api — i.e. they ship as `AgentSkill`, which HAS a parser and
|
|
212
|
+
// a route. Re-adding a second delivery path for the same artifact would fork
|
|
213
|
+
// ownership away from skill-registry (bundle fetch, 5-tier scope ladder,
|
|
214
|
+
// shared Handlebars compile) for no gain.
|
|
166
215
|
/** A tool-profile contributed by a biome. */
|
|
167
216
|
ToolProfile = 'tool-profile',
|
|
168
|
-
/** An MCP catalog entry contributed by a biome
|
|
169
|
-
*
|
|
170
|
-
*
|
|
217
|
+
/** An MCP catalog entry contributed by a biome — a catalog manifest naming a
|
|
218
|
+
* connectable MCP service and the tools it exposes. This is the ONLY
|
|
219
|
+
* enum-dispatched MCP contribution path. */
|
|
171
220
|
McpCatalog = 'mcp-catalog',
|
|
172
221
|
/**
|
|
173
|
-
* RESERVED (category 3). No
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
222
|
+
* RESERVED (category 3). No parser, and one CANNOT be shipped without first
|
|
223
|
+
* closing the build-time gap tracked as H10 in
|
|
224
|
+
* `.claude/plans/canopy-universal-agent.md` §11.1, which carries the full,
|
|
225
|
+
* component-by-component write-down of what a runtime path would require;
|
|
226
|
+
* this note is the summary. Agent-runtime custom tools are EXECUTABLE
|
|
227
|
+
* `.ts`/`.js` files that reach an agent ONLY by being copied into the
|
|
228
|
+
* agent-runtime worker image at build time — every kernel biome that ships a
|
|
229
|
+
* tools directory has its own explicit `COPY` line in that image's
|
|
230
|
+
* Dockerfile, landing the files in the runtime's tool slot, which the runtime
|
|
231
|
+
* auto-discovers when its process starts. So a third-party biome tool costs a
|
|
232
|
+
* Dockerfile edit plus an image rebuild. The one runtime seam that exists is
|
|
233
|
+
* a WHOLE-DIRECTORY swap, not a merge: when the templates read-only volume is
|
|
234
|
+
* mounted, workspace-proxy deletes the image-baked tool directory and
|
|
235
|
+
* symlinks that volume's copy in its place — and the volume is populated
|
|
236
|
+
* entirely out of band.
|
|
237
|
+
*
|
|
238
|
+
* Do NOT ship a parser that fakes the missing half. A real runtime path needs
|
|
239
|
+
* FOUR things, none of which exists:
|
|
240
|
+
* 1. An owning registry that stores tool SOURCE and can be reconciled by
|
|
241
|
+
* the contribution outbox. It cannot be a plain descriptor table: the
|
|
242
|
+
* payload is code, so the store has to carry the bytes AND the trust
|
|
243
|
+
* decision (signature verification + static analysis — the pipeline
|
|
244
|
+
* `biome-fetcher-api` already runs for biome bundles), not just a row.
|
|
245
|
+
* 2. Materialization in the workspace composer, which starts with a new
|
|
246
|
+
* `WorkspaceMount` slot: that enum is CLOSED and has no tools entry, and
|
|
247
|
+
* workspace-proxy rejects a mount whose slot is not in it. The composer
|
|
248
|
+
* (`@xemahq/agent-session-runtime`) already writes the skill-bundle and
|
|
249
|
+
* slash-command slots the same way; a tools slot additionally needs
|
|
250
|
+
* biome-NAMESPACED filenames (two biomes must not collide on a tool
|
|
251
|
+
* name) that stay FLAT — the runtime's discovery glob is one level deep,
|
|
252
|
+
* so a nested directory is invisible — and it must compose with, not be
|
|
253
|
+
* clobbered by, the templates-volume symlink above.
|
|
254
|
+
* 3. A per-session tool allow/deny decision. Filtering is static today,
|
|
255
|
+
* baked into the image's runtime config, so a dynamically mounted tool
|
|
256
|
+
* has no visibility story.
|
|
257
|
+
* 4. Sandboxing/permission review, because a contributed tool executes in
|
|
258
|
+
* the agent's workspace with the agent's credentials.
|
|
259
|
+
*
|
|
260
|
+
* Timing is the one part already solved: discovery runs once per runtime
|
|
261
|
+
* PROCESS, and workspace-proxy already restarts that process after every
|
|
262
|
+
* session-bundle apply.
|
|
177
263
|
*/
|
|
178
264
|
OpenCodeTool = 'opencode-tool',
|
|
179
265
|
/**
|
|
180
|
-
* RESERVED (category 3). No parser
|
|
181
|
-
* does NOT route this kind
|
|
182
|
-
*
|
|
266
|
+
* RESERVED (category 3). No parser, and the contribution-registrar
|
|
267
|
+
* deliberately does NOT route this kind — its own unit test uses this member
|
|
268
|
+
* as the canonical "not routed" fixture. Plugins are baked harder than tools:
|
|
269
|
+
* a kernel biome's plugin directory is installed under a read-only `/opt`
|
|
270
|
+
* prefix during the image build, with its dependency tree resolved there, and
|
|
271
|
+
* the generated runtime config references it by ABSOLUTE IMAGE PATH. That
|
|
272
|
+
* `/opt` location is load-bearing — plugins once lived under the workspace
|
|
273
|
+
* root, where the per-session volume mount SHADOWED them and both shipped
|
|
274
|
+
* plugins silently failed to load.
|
|
275
|
+
*
|
|
276
|
+
* On top of the four prerequisites listed on
|
|
277
|
+
* {@link ContributionKind.OpenCodeTool}, a runtime plugin path additionally
|
|
278
|
+
* needs (a) the plugin list in the generated runtime config to become
|
|
279
|
+
* per-session paths instead of image constants, (b) a dependency story, since
|
|
280
|
+
* a plugin's dependencies are installed at image-build time and the runtime
|
|
281
|
+
* workspace has neither an install step nor network egress for one, and (c) a
|
|
282
|
+
* process restart, because the runtime resolves plugins once at process
|
|
283
|
+
* start. Until all of that lands, treat plugins as an image concern — tools
|
|
284
|
+
* are the cheaper half to make runtime-loadable first. See
|
|
285
|
+
* `.claude/plans/canopy-universal-agent.md` §11.1.
|
|
183
286
|
*/
|
|
184
287
|
OpenCodePlugin = 'opencode-plugin',
|
|
185
288
|
// -- Capability self-registration ------------------------------------------
|
|
@@ -170,14 +170,26 @@ export const SearchTypeAuthzMappingSchema: z.ZodType<SearchTypeAuthzMapping> =
|
|
|
170
170
|
*/
|
|
171
171
|
export interface SearchTypeContributionManifest {
|
|
172
172
|
/**
|
|
173
|
-
* The `XemaObjectKind` this result-type covers
|
|
174
|
-
*
|
|
173
|
+
* The `XemaObjectKind` this result-type covers, when one genuinely applies.
|
|
174
|
+
*
|
|
175
|
+
* OPTIONAL BY DESIGN. `XemaObjectKind` is a CLOSED kernel enum; a biome
|
|
176
|
+
* concept that has no kernel kind (an email, a backlog item, a design idea)
|
|
177
|
+
* must not be forced to mislabel itself as the nearest neighbour. Four of the
|
|
178
|
+
* five first-party contributions did exactly that — all declaring `artifact`
|
|
179
|
+
* as a closest fit — which is worse than declaring nothing: it makes the
|
|
180
|
+
* object registry claim kinds it cannot enumerate, and it reads as a real
|
|
181
|
+
* classification to anything that consumes it.
|
|
182
|
+
*
|
|
183
|
+
* Absent ⇒ the result-type is discriminated by the OPEN `docType` alone,
|
|
184
|
+
* which is what `IndexableDocument.kind` being optional already anticipates.
|
|
185
|
+
* The natural key remains `(objectKind, docType)`; a contribution must carry
|
|
186
|
+
* at least one of the two, enforced by the schema below.
|
|
175
187
|
*/
|
|
176
|
-
readonly objectKind
|
|
188
|
+
readonly objectKind?: XemaObjectKind;
|
|
177
189
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* The natural key of a result-type is `(objectKind, docType)`.
|
|
190
|
+
* Biome sub-facet under `objectKind` (e.g. `kb_page` under `knowledge-page`),
|
|
191
|
+
* or — when no kernel kind applies — the sole discriminator for this
|
|
192
|
+
* result-type. The natural key of a result-type is `(objectKind, docType)`.
|
|
181
193
|
*/
|
|
182
194
|
readonly docType?: string;
|
|
183
195
|
/** Generic render/route hints so the frontend presents hits without a per-kind switch. */
|
|
@@ -212,27 +224,49 @@ export interface SearchTypeContributionManifest {
|
|
|
212
224
|
* `CapabilityContributionManifestSchema`).
|
|
213
225
|
*/
|
|
214
226
|
export const SearchTypeContributionManifestSchema: z.ZodType<SearchTypeContributionManifest> =
|
|
215
|
-
z
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
+
z
|
|
228
|
+
.object({
|
|
229
|
+
objectKind: XemaObjectKindSchema.optional(),
|
|
230
|
+
docType: z.string().min(1).max(SEARCH_TYPE_STRING_MAX).optional(),
|
|
231
|
+
renderHints: SearchTypeRenderHintsSchema,
|
|
232
|
+
searchableFields: z
|
|
233
|
+
.array(z.string().min(1).max(SEARCH_TYPE_STRING_MAX))
|
|
234
|
+
.min(1)
|
|
235
|
+
.max(SEARCH_TYPE_FIELDS_MAX),
|
|
236
|
+
embeddingEligibleDefault: z.boolean(),
|
|
237
|
+
authz: SearchTypeAuthzMappingSchema,
|
|
238
|
+
searchReplayCapabilityRef: CapabilityRefSchema.optional(),
|
|
239
|
+
})
|
|
240
|
+
// Both may not be absent: the natural key is `(objectKind, docType)`, so a
|
|
241
|
+
// contribution declaring neither has no identity at all. Making `objectKind`
|
|
242
|
+
// optional must not open a hole where a result-type is unaddressable —
|
|
243
|
+
// fail fast at the boundary, exactly as before.
|
|
244
|
+
.refine(
|
|
245
|
+
(m) => m.objectKind !== undefined || m.docType !== undefined,
|
|
246
|
+
'a search-type contribution must declare objectKind, docType, or both — ' +
|
|
247
|
+
'the natural key is (objectKind, docType) and cannot be empty',
|
|
248
|
+
) as unknown as z.ZodType<SearchTypeContributionManifest>;
|
|
227
249
|
|
|
228
250
|
/**
|
|
229
|
-
* The stable natural key of a result-type: `objectKind` when no `docType`,
|
|
251
|
+
* The stable natural key of a result-type: `objectKind` when no `docType`,
|
|
252
|
+
* `docType` when no `objectKind` (a biome concept with no kernel kind), else
|
|
230
253
|
* `objectKind/docType`. Centralized so the parser slug, the DB unique key, and
|
|
231
254
|
* the reconciler's `seenKeyOf` all agree.
|
|
255
|
+
*
|
|
256
|
+
* The schema guarantees at least one is present; this throws rather than
|
|
257
|
+
* returning `"undefined"` if that guarantee is ever bypassed, because a
|
|
258
|
+
* silently-stringified key would collide every unkeyed result-type into one row.
|
|
232
259
|
*/
|
|
233
260
|
export function searchTypeNaturalKey(
|
|
234
|
-
objectKind
|
|
261
|
+
objectKind?: XemaObjectKind,
|
|
235
262
|
docType?: string,
|
|
236
263
|
): string {
|
|
264
|
+
if (objectKind === undefined && docType === undefined) {
|
|
265
|
+
throw new Error(
|
|
266
|
+
'searchTypeNaturalKey: neither objectKind nor docType was supplied — ' +
|
|
267
|
+
'a result-type must be addressable by at least one.',
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
if (objectKind === undefined) return String(docType);
|
|
237
271
|
return docType ? `${objectKind}/${docType}` : String(objectKind);
|
|
238
272
|
}
|