@yaklabs-ai/plugin-protocol 0.45.0 → 0.47.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/README.md +1 -1
- package/THIRD-PARTY-INVENTORY.json +14 -2
- package/THIRD-PARTY-NOTICES.md +213 -1
- package/dist/index.d.ts +522 -120
- package/dist/index.js +268 -100
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36,7 +36,13 @@ function declaredUiIconPaths(manifest) {
|
|
|
36
36
|
label: `kay.ui command '${command.localId}' icon`,
|
|
37
37
|
path: command.icon
|
|
38
38
|
}
|
|
39
|
-
])
|
|
39
|
+
]),
|
|
40
|
+
...(contributes?.referencePresentations ?? []).flatMap((presentation) => (presentation.claims ?? []).flatMap((claim) => claim.brandIcon === void 0 ? [] : [
|
|
41
|
+
{
|
|
42
|
+
label: `kay.ui reference presentation '${presentation.localId}' brand icon`,
|
|
43
|
+
path: claim.brandIcon
|
|
44
|
+
}
|
|
45
|
+
]))
|
|
40
46
|
];
|
|
41
47
|
}
|
|
42
48
|
|
|
@@ -254,7 +260,7 @@ var JsonSchema = z4.record(z4.string(), JsonValue);
|
|
|
254
260
|
var KAY_PLUGIN_MANIFEST_SIZE_CAP_BYTES = 1024 * 1024;
|
|
255
261
|
var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
|
|
256
262
|
var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@bonsai/plugin-protocol";
|
|
257
|
-
var KAY_PLUGIN_SDK_VERSION = "0.
|
|
263
|
+
var KAY_PLUGIN_SDK_VERSION = "0.47.0";
|
|
258
264
|
var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
|
|
259
265
|
"0.42.0",
|
|
260
266
|
"0.42.1",
|
|
@@ -379,6 +385,13 @@ function refineWebSessionScopeConfined(webSession, ctx) {
|
|
|
379
385
|
message: "probe.url host must fall within a declared cookie domain"
|
|
380
386
|
});
|
|
381
387
|
}
|
|
388
|
+
if (webSession.signInFirst !== void 0 && !confined(webSession.signInFirst)) {
|
|
389
|
+
ctx.addIssue({
|
|
390
|
+
code: "custom",
|
|
391
|
+
path: ["signInFirst"],
|
|
392
|
+
message: "signInFirst host must fall within a declared cookie domain"
|
|
393
|
+
});
|
|
394
|
+
}
|
|
382
395
|
}
|
|
383
396
|
|
|
384
397
|
// packages/plugin-protocol/dist/app-data-read.js
|
|
@@ -2762,6 +2775,7 @@ __export(contributions_exports, {
|
|
|
2762
2775
|
PluginProductEventContribution: () => PluginProductEventContribution,
|
|
2763
2776
|
PluginSkillSourceDeclaration: () => PluginSkillSourceDeclaration,
|
|
2764
2777
|
ReferenceOpenBehavior: () => ReferenceOpenBehavior,
|
|
2778
|
+
ReferencePresentationAccountLinks: () => ReferencePresentationAccountLinks,
|
|
2765
2779
|
ReferencePresentationAddress: () => ReferencePresentationAddress,
|
|
2766
2780
|
ReferencePresentationContribution: () => ReferencePresentationContribution,
|
|
2767
2781
|
ReferencePresentationTooltip: () => ReferencePresentationTooltip,
|
|
@@ -2771,11 +2785,8 @@ __export(contributions_exports, {
|
|
|
2771
2785
|
ReferencePresentationVariants: () => ReferencePresentationVariants,
|
|
2772
2786
|
ReferencePresentationWords: () => ReferencePresentationWords,
|
|
2773
2787
|
ResourceContribution: () => ResourceContribution,
|
|
2774
|
-
ResultRendererContribution: () => ResultRendererContribution,
|
|
2775
|
-
RichViewContribution: () => RichViewContribution,
|
|
2776
2788
|
SearchProviderContribution: () => SearchProviderContribution,
|
|
2777
2789
|
SessionReaderContribution: () => SessionReaderContribution,
|
|
2778
|
-
SettingsPanelContribution: () => SettingsPanelContribution,
|
|
2779
2790
|
SkillContribution: () => SkillContribution,
|
|
2780
2791
|
ThemeContribution: () => ThemeContribution,
|
|
2781
2792
|
ToolContribution: () => ToolContribution,
|
|
@@ -2793,7 +2804,9 @@ __export(contributions_exports, {
|
|
|
2793
2804
|
WhiteboardTypeContribution: () => WhiteboardTypeContribution,
|
|
2794
2805
|
WhiteboardTypeStorage: () => WhiteboardTypeStorage,
|
|
2795
2806
|
WorkflowContribution: () => WorkflowContribution,
|
|
2796
|
-
canonicalContributionSchemas: () => canonicalContributionSchemas
|
|
2807
|
+
canonicalContributionSchemas: () => canonicalContributionSchemas,
|
|
2808
|
+
isUiAppSourceModule: () => isUiAppSourceModule,
|
|
2809
|
+
uiAppSourceStylePath: () => uiAppSourceStylePath
|
|
2797
2810
|
});
|
|
2798
2811
|
import { z as z12 } from "zod";
|
|
2799
2812
|
|
|
@@ -2950,7 +2963,21 @@ function pluginSignalPayloadJsonSchema() {
|
|
|
2950
2963
|
}
|
|
2951
2964
|
|
|
2952
2965
|
// packages/plugin-protocol/dist/where-expression.js
|
|
2953
|
-
var
|
|
2966
|
+
var NUMBER_SOURCE = String.raw`-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?`;
|
|
2967
|
+
var SEGMENT_SOURCE = "[A-Za-z0-9_][A-Za-z0-9_-]*";
|
|
2968
|
+
var TOKEN = new RegExp(String.raw`\s*(?:(\|\||&&|==|!=|!|\(|\))` + String.raw`|'((?:[^'\\]|\\[\s\S])*)'|"((?:[^"\\]|\\[\s\S])*)"` + // A number that runs on into a key's characters is a key: `1.5.2`, `1-a`.
|
|
2969
|
+
String.raw`|(${NUMBER_SOURCE})(?![A-Za-z0-9_.-])` + `|(${SEGMENT_SOURCE}(?:\\.${SEGMENT_SOURCE})*))`, "y");
|
|
2970
|
+
var WHOLE_NUMBER = new RegExp(`^${NUMBER_SOURCE}$`);
|
|
2971
|
+
var WHOLE_KEY = new RegExp(`^${SEGMENT_SOURCE}(?:\\.${SEGMENT_SOURCE})*$`);
|
|
2972
|
+
function unescapeString(text) {
|
|
2973
|
+
return text.replace(/\\([\s\S])/g, (_, character) => {
|
|
2974
|
+
if (character === "\\" || character === "'" || character === '"') {
|
|
2975
|
+
return character;
|
|
2976
|
+
}
|
|
2977
|
+
throw new Error(`unknown escape '\\${character}'; a string can escape only \\, ' and "`);
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
var MAX_TOKENS = 2e3;
|
|
2954
2981
|
function tokenize(source) {
|
|
2955
2982
|
const tokens = [];
|
|
2956
2983
|
TOKEN.lastIndex = 0;
|
|
@@ -2960,13 +2987,21 @@ function tokenize(source) {
|
|
|
2960
2987
|
if (match === null) {
|
|
2961
2988
|
throw new Error(`unexpected text at '${source.slice(start).trim()}'`);
|
|
2962
2989
|
}
|
|
2963
|
-
|
|
2990
|
+
if (tokens.length === MAX_TOKENS) {
|
|
2991
|
+
throw new Error(`the expression has more than ${MAX_TOKENS} parts`);
|
|
2992
|
+
}
|
|
2993
|
+
const [, operator, single, double, number, word] = match;
|
|
2964
2994
|
if (operator !== void 0)
|
|
2965
2995
|
tokens.push({ kind: "operator", text: operator });
|
|
2996
|
+
else if (number !== void 0)
|
|
2997
|
+
tokens.push({ kind: "number", text: number });
|
|
2966
2998
|
else if (word !== void 0)
|
|
2967
2999
|
tokens.push({ kind: "word", text: word });
|
|
2968
3000
|
else
|
|
2969
|
-
tokens.push({
|
|
3001
|
+
tokens.push({
|
|
3002
|
+
kind: "string",
|
|
3003
|
+
text: unescapeString(single ?? double ?? "")
|
|
3004
|
+
});
|
|
2970
3005
|
}
|
|
2971
3006
|
return tokens;
|
|
2972
3007
|
}
|
|
@@ -3018,6 +3053,14 @@ function parseTokens(tokens, keyTypes) {
|
|
|
3018
3053
|
};
|
|
3019
3054
|
const parseKeyAtom = (key) => {
|
|
3020
3055
|
const keyType = keyTypes?.[key];
|
|
3056
|
+
const next = tokens[position];
|
|
3057
|
+
if (next?.kind === "word" && next.text === "contains") {
|
|
3058
|
+
if (keyTypes !== void 0) {
|
|
3059
|
+
throw new Error(`'${key}' is not a list; compare it with == or !=`);
|
|
3060
|
+
}
|
|
3061
|
+
position += 1;
|
|
3062
|
+
return { kind: "contains", key, value: parseLiteral("contains") };
|
|
3063
|
+
}
|
|
3021
3064
|
const negated = takeOperator("!=");
|
|
3022
3065
|
if (!negated && !takeOperator("==")) {
|
|
3023
3066
|
if (keyType === "string") {
|
|
@@ -3025,22 +3068,29 @@ function parseTokens(tokens, keyTypes) {
|
|
|
3025
3068
|
}
|
|
3026
3069
|
return { kind: "key", key };
|
|
3027
3070
|
}
|
|
3028
|
-
const value = parseLiteral();
|
|
3071
|
+
const value = parseLiteral("== or !=");
|
|
3029
3072
|
if (keyType !== void 0 && typeof value !== keyType) {
|
|
3030
3073
|
throw new Error(`'${key}' compares to a ${keyType}`);
|
|
3031
3074
|
}
|
|
3032
3075
|
return { kind: "equals", key, value, negated };
|
|
3033
3076
|
};
|
|
3034
|
-
const parseLiteral = () => {
|
|
3077
|
+
const parseLiteral = (after) => {
|
|
3035
3078
|
const token = tokens[position];
|
|
3036
3079
|
position += 1;
|
|
3037
3080
|
if (token?.kind === "string")
|
|
3038
3081
|
return token.text;
|
|
3082
|
+
if (token?.kind === "number") {
|
|
3083
|
+
const value = Number(token.text);
|
|
3084
|
+
if (!Number.isFinite(value)) {
|
|
3085
|
+
throw new Error(`the number ${token.text} is too large`);
|
|
3086
|
+
}
|
|
3087
|
+
return value;
|
|
3088
|
+
}
|
|
3039
3089
|
if (token?.kind === "word" && token.text === "true")
|
|
3040
3090
|
return true;
|
|
3041
3091
|
if (token?.kind === "word" && token.text === "false")
|
|
3042
3092
|
return false;
|
|
3043
|
-
throw new Error(
|
|
3093
|
+
throw new Error(`expected a string, number, true or false after ${after}`);
|
|
3044
3094
|
};
|
|
3045
3095
|
const where = parseOr();
|
|
3046
3096
|
const extra = tokens[position];
|
|
@@ -3055,6 +3105,80 @@ function parseWhere(source, keyTypes) {
|
|
|
3055
3105
|
return { ok: false, message: error.message };
|
|
3056
3106
|
}
|
|
3057
3107
|
}
|
|
3108
|
+
function whereKeyUses(where) {
|
|
3109
|
+
switch (where.kind) {
|
|
3110
|
+
case "literal":
|
|
3111
|
+
return [];
|
|
3112
|
+
case "key":
|
|
3113
|
+
return [{ key: where.key, use: "bare" }];
|
|
3114
|
+
case "equals":
|
|
3115
|
+
return [{ key: where.key, use: "compared" }];
|
|
3116
|
+
case "contains":
|
|
3117
|
+
return [{ key: where.key, use: "contained" }];
|
|
3118
|
+
case "not":
|
|
3119
|
+
return whereKeyUses(where.operand);
|
|
3120
|
+
case "and":
|
|
3121
|
+
case "or":
|
|
3122
|
+
return [...whereKeyUses(where.left), ...whereKeyUses(where.right)];
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3125
|
+
function formatWhereLiteral(value) {
|
|
3126
|
+
return typeof value === "string" ? `'${value.replace(/[\\']/g, "\\$&")}'` : String(value);
|
|
3127
|
+
}
|
|
3128
|
+
function whereClausesAsExpression(clauses, looksInsideLists = () => false) {
|
|
3129
|
+
if (!Array.isArray(clauses) || clauses.length === 0)
|
|
3130
|
+
return void 0;
|
|
3131
|
+
const written = [];
|
|
3132
|
+
for (const clause of clauses) {
|
|
3133
|
+
if (typeof clause !== "object" || clause === null)
|
|
3134
|
+
return void 0;
|
|
3135
|
+
const { path, equals } = clause;
|
|
3136
|
+
if (Object.keys(clause).length !== 2 || typeof path !== "string" || !WHOLE_KEY.test(path) || !(typeof equals === "string" || typeof equals === "boolean" || typeof equals === "number" && Number.isFinite(equals))) {
|
|
3137
|
+
return void 0;
|
|
3138
|
+
}
|
|
3139
|
+
if (path === "true" || path === "false" || WHOLE_NUMBER.test(path)) {
|
|
3140
|
+
written.push("false");
|
|
3141
|
+
continue;
|
|
3142
|
+
}
|
|
3143
|
+
const literal = formatWhereLiteral(equals);
|
|
3144
|
+
written.push(looksInsideLists(path) ? `(${path} == ${literal} || ${path} contains ${literal})` : `${path} == ${literal}`);
|
|
3145
|
+
}
|
|
3146
|
+
return written.join(" && ");
|
|
3147
|
+
}
|
|
3148
|
+
function whereNotAStringMessage(value) {
|
|
3149
|
+
const expression = whereClausesAsExpression(value);
|
|
3150
|
+
if (expression !== void 0) {
|
|
3151
|
+
return `where is now an expression, not a list of {path, equals}: write \`${expression}\`, and use \`contains\` to look inside a list`;
|
|
3152
|
+
}
|
|
3153
|
+
return Array.isArray(value) ? "where is now an expression, not a list of {path, equals}, for example `payload.status == 'open' && payload.labels contains 'urgent'`" : "where must be an expression string";
|
|
3154
|
+
}
|
|
3155
|
+
var WHERE_MAX_BYTES = 256 * 1024;
|
|
3156
|
+
function whereProblem(value) {
|
|
3157
|
+
if (typeof value !== "string")
|
|
3158
|
+
return whereNotAStringMessage(value);
|
|
3159
|
+
if (new TextEncoder().encode(value).length > WHERE_MAX_BYTES) {
|
|
3160
|
+
return `where must be at most ${WHERE_MAX_BYTES} bytes of UTF-8`;
|
|
3161
|
+
}
|
|
3162
|
+
const parsed = parseWhere(value);
|
|
3163
|
+
return parsed.ok ? void 0 : `where is not a valid expression: ${parsed.message}`;
|
|
3164
|
+
}
|
|
3165
|
+
var MAX_EVENT_KEY_BYTES = 256;
|
|
3166
|
+
var MAX_EVENT_KEY_SEGMENTS = 10;
|
|
3167
|
+
function eventWhereProblem(value) {
|
|
3168
|
+
const problem = whereProblem(value);
|
|
3169
|
+
if (problem !== void 0)
|
|
3170
|
+
return problem;
|
|
3171
|
+
const parsed = parseWhere(value);
|
|
3172
|
+
if (!parsed.ok)
|
|
3173
|
+
return void 0;
|
|
3174
|
+
for (const { key } of whereKeyUses(parsed.where)) {
|
|
3175
|
+
const segments = key.split(".");
|
|
3176
|
+
if (new TextEncoder().encode(key).length > MAX_EVENT_KEY_BYTES || segments.length > MAX_EVENT_KEY_SEGMENTS || segments.some((segment) => !/^[a-zA-Z_]/.test(segment) || ["__proto__", "prototype", "constructor"].includes(segment))) {
|
|
3177
|
+
return `where key '${key}' must be a safe dot path of at most ${MAX_EVENT_KEY_SEGMENTS} identifier segments and ${MAX_EVENT_KEY_BYTES} bytes`;
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
return void 0;
|
|
3181
|
+
}
|
|
3058
3182
|
function resolve(where, read) {
|
|
3059
3183
|
switch (where.kind) {
|
|
3060
3184
|
case "literal":
|
|
@@ -3069,6 +3193,12 @@ function resolve(where, read) {
|
|
|
3069
3193
|
return void 0;
|
|
3070
3194
|
return value === where.value !== where.negated;
|
|
3071
3195
|
}
|
|
3196
|
+
case "contains": {
|
|
3197
|
+
const value = read(where.key);
|
|
3198
|
+
if (value === void 0)
|
|
3199
|
+
return void 0;
|
|
3200
|
+
return Array.isArray(value) && value.includes(where.value);
|
|
3201
|
+
}
|
|
3072
3202
|
case "not": {
|
|
3073
3203
|
const operand = resolve(where.operand, read);
|
|
3074
3204
|
return operand === void 0 ? void 0 : !operand;
|
|
@@ -3115,6 +3245,15 @@ function declarationsOfKind(plugins, kind) {
|
|
|
3115
3245
|
function declaredReferencePresentations(plugins) {
|
|
3116
3246
|
return plugins.flatMap((plugin) => (plugin.contributes["referencePresentations"] ?? []).map((declaration) => ({ plugin, declaration })));
|
|
3117
3247
|
}
|
|
3248
|
+
function declaredLocalAppSchemes(plugins) {
|
|
3249
|
+
return new Set(declaredReferencePresentations(plugins).flatMap(({ declaration }) => declaration.open?.kind === "local-app" ? declaration.schemes ?? [] : []));
|
|
3250
|
+
}
|
|
3251
|
+
function isDeclaredLocalAppLink(url, plugins) {
|
|
3252
|
+
if (!URL.canParse(url))
|
|
3253
|
+
return false;
|
|
3254
|
+
const scheme = new URL(url).protocol.slice(0, -1).toLowerCase();
|
|
3255
|
+
return declaredReferencePresentations(plugins).some(({ declaration }) => declaration.open?.kind === "local-app" && declaration.open.schemes.includes(scheme));
|
|
3256
|
+
}
|
|
3118
3257
|
function declaredCommandId(pluginId, localId) {
|
|
3119
3258
|
return `${pluginId}/${localId}`;
|
|
3120
3259
|
}
|
|
@@ -3425,14 +3564,19 @@ function createContributionsSchemas(canonical) {
|
|
|
3425
3564
|
// The module's code defines `describeOperation`, the approval card's facts for a call. The
|
|
3426
3565
|
// daemon reads it here because it may hold only the manifest (a plugin that runs in the
|
|
3427
3566
|
// plugin host), and the host refuses a module whose code disagrees.
|
|
3428
|
-
describesOperations: z12.literal(true).optional()
|
|
3567
|
+
describesOperations: z12.literal(true).optional(),
|
|
3568
|
+
// The module's code defines `lookupWebLink`, which finds a resource's page when someone opens
|
|
3569
|
+
// it. The daemon reads it here for the same reason, and the host refuses a module whose code
|
|
3570
|
+
// disagrees.
|
|
3571
|
+
looksUpWebLinks: z12.literal(true).optional()
|
|
3429
3572
|
});
|
|
3430
3573
|
const AppUriModuleContribution2 = UriModuleContribution2.omit({
|
|
3431
3574
|
authActions: true,
|
|
3432
3575
|
authService: true,
|
|
3433
3576
|
authScheme: true,
|
|
3434
3577
|
knownResources: true,
|
|
3435
|
-
describesOperations: true
|
|
3578
|
+
describesOperations: true,
|
|
3579
|
+
looksUpWebLinks: true
|
|
3436
3580
|
});
|
|
3437
3581
|
const AppDataSourceStore = z12.discriminatedUnion("shape", [
|
|
3438
3582
|
z12.strictObject({
|
|
@@ -3496,10 +3640,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3496
3640
|
displayName: NonEmptyString3,
|
|
3497
3641
|
schemaVersion: z12.number().int().positive(),
|
|
3498
3642
|
storage: WhiteboardTypeStorage2,
|
|
3499
|
-
valueSchema: JsonSchema
|
|
3500
|
-
presentation: z12.strictObject({
|
|
3501
|
-
app: LocalContributionId2
|
|
3502
|
-
}).optional()
|
|
3643
|
+
valueSchema: JsonSchema
|
|
3503
3644
|
});
|
|
3504
3645
|
const AppDataMaterializerContribution2 = z12.strictObject({
|
|
3505
3646
|
source: LocalContributionId2
|
|
@@ -3754,7 +3895,7 @@ function createContributionsSchemas(canonical) {
|
|
|
3754
3895
|
localId: LocalContributionId2,
|
|
3755
3896
|
/** The same-plugin `eventDefinitions` local id this rule matches. */
|
|
3756
3897
|
event: PluginEventLocalId2,
|
|
3757
|
-
where: z12.
|
|
3898
|
+
where: z12.string({ error: (issue) => whereNotAStringMessage(issue.input) }).optional(),
|
|
3758
3899
|
rule: JsonObject
|
|
3759
3900
|
});
|
|
3760
3901
|
const PluginProductEventContribution2 = z12.union([
|
|
@@ -3811,15 +3952,15 @@ function createContributionsSchemas(canonical) {
|
|
|
3811
3952
|
slot: NonEmptyString3,
|
|
3812
3953
|
title: NonEmptyString3.optional()
|
|
3813
3954
|
});
|
|
3814
|
-
const
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3955
|
+
const NOT_LOCAL_APP_SCHEMES = /* @__PURE__ */ new Set([
|
|
3956
|
+
"http",
|
|
3957
|
+
"https",
|
|
3958
|
+
"file",
|
|
3959
|
+
"javascript",
|
|
3960
|
+
"data",
|
|
3961
|
+
"blob",
|
|
3962
|
+
"about"
|
|
3963
|
+
]);
|
|
3823
3964
|
const ReferenceOpenBehavior2 = z12.discriminatedUnion("kind", [
|
|
3824
3965
|
z12.strictObject({ kind: z12.literal("working-document") }),
|
|
3825
3966
|
z12.strictObject({ kind: z12.literal("browser-pane") }),
|
|
@@ -3828,14 +3969,22 @@ function createContributionsSchemas(canonical) {
|
|
|
3828
3969
|
* manifest, and the page gets the whole address as its `objectId` unless `addresses` says
|
|
3829
3970
|
* otherwise. Needs no web address, so a plugin-only resource (`user-todo://items/3`) can pill.
|
|
3830
3971
|
*/
|
|
3831
|
-
z12.strictObject({ kind: z12.literal("page"), pageId: NonEmptyString3 })
|
|
3972
|
+
z12.strictObject({ kind: z12.literal("page"), pageId: NonEmptyString3 }),
|
|
3973
|
+
/**
|
|
3974
|
+
* Hand the address's link to an app on this machine. The module's claims fill the link as its
|
|
3975
|
+
* `sourceUrl`, and `schemes` names every scheme those links may use: main opens a link only when
|
|
3976
|
+
* a loaded plugin declares its scheme here. A plugin the person installed can't declare this.
|
|
3977
|
+
*/
|
|
3978
|
+
z12.strictObject({
|
|
3979
|
+
kind: z12.literal("local-app"),
|
|
3980
|
+
schemes: z12.array(UriScheme2.refine((scheme) => !NOT_LOCAL_APP_SCHEMES.has(scheme), "Names the web, a file or script, not an app on this machine")).min(1)
|
|
3981
|
+
})
|
|
3832
3982
|
]);
|
|
3833
3983
|
const ReferencePresentationVariant2 = z12.strictObject({
|
|
3834
3984
|
resourceKind: NonEmptyString3,
|
|
3835
3985
|
presentationPluginId: PluginId2.optional()
|
|
3836
3986
|
});
|
|
3837
3987
|
const ReferencePresentationVariants2 = z12.record(MimeTypeString2, ReferencePresentationVariant2);
|
|
3838
|
-
const InlineSvg = z12.string().max(64 * 1024).refine((value) => /^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[\s\S]*?-->\s*)*(?:<!DOCTYPE[^>]*>\s*)?<svg[\s>]/iu.test(value), { message: "brandIcon must be inline SVG markup." });
|
|
3839
3988
|
const ReferencePresentationUriPattern2 = z12.strictObject({
|
|
3840
3989
|
protocol: NonEmptyString3,
|
|
3841
3990
|
hostname: NonEmptyString3,
|
|
@@ -3847,7 +3996,8 @@ function createContributionsSchemas(canonical) {
|
|
|
3847
3996
|
pattern: ReferencePresentationUriPattern2.extend({
|
|
3848
3997
|
protocol: z12.enum(["http", "https"])
|
|
3849
3998
|
}),
|
|
3850
|
-
|
|
3999
|
+
/** The claim's mark: an SVG file in the plugin, drawn in its own colours. */
|
|
4000
|
+
brandIcon: PackageAssetPath2.optional()
|
|
3851
4001
|
});
|
|
3852
4002
|
const ReferencePresentationTooltip2 = z12.strictObject({
|
|
3853
4003
|
/** Same-plugin kay.ui app mounted with read-only reference URI context. */
|
|
@@ -3859,6 +4009,26 @@ function createContributionsSchemas(canonical) {
|
|
|
3859
4009
|
objectId: NonEmptyString3.optional(),
|
|
3860
4010
|
open: z12.strictObject({ kind: z12.literal("none") }).optional()
|
|
3861
4011
|
});
|
|
4012
|
+
const ReferencePresentationAccountLinkPage = z12.strictObject({
|
|
4013
|
+
/** A literal host name. */
|
|
4014
|
+
hostname: z12.string().regex(/^[a-z0-9.-]+$/, "An account link's hostname is a literal lower-case host name."),
|
|
4015
|
+
pathname: z12.string().optional(),
|
|
4016
|
+
/** A page matching one of these already names its account, so it stays as it is. */
|
|
4017
|
+
unlessPathname: z12.array(z12.string()).min(1).optional(),
|
|
4018
|
+
/** The path the page opens at, in place of its own. */
|
|
4019
|
+
setPathname: z12.string().startsWith("/").optional(),
|
|
4020
|
+
/** Query values to add. A page that already has one of these names stays as it is. */
|
|
4021
|
+
addQuery: z12.record(NonEmptyString3, NonEmptyString3)
|
|
4022
|
+
});
|
|
4023
|
+
const ReferencePresentationAccountLinkAddress = z12.strictObject({
|
|
4024
|
+
pattern: ReferencePresentationUriPattern2,
|
|
4025
|
+
url: z12.string().regex(/^https?:\/\//, "An account link's url is a web page.")
|
|
4026
|
+
});
|
|
4027
|
+
const ReferencePresentationAccountLinks2 = z12.strictObject({
|
|
4028
|
+
label: z12.enum(["email", "name"]).optional(),
|
|
4029
|
+
pages: z12.array(ReferencePresentationAccountLinkPage).min(1).optional(),
|
|
4030
|
+
addresses: z12.array(ReferencePresentationAccountLinkAddress).min(1).optional()
|
|
4031
|
+
});
|
|
3862
4032
|
const ReferencePresentationWords2 = z12.strictObject({
|
|
3863
4033
|
/** The row's mark, for a source with no icon of its own. Left out: the plugin's main icon. */
|
|
3864
4034
|
glyph: z12.enum(TOOL_GLYPHS).optional(),
|
|
@@ -3910,7 +4080,9 @@ function createContributionsSchemas(canonical) {
|
|
|
3910
4080
|
/** Informational app presentation matched against the canonical resource URI. */
|
|
3911
4081
|
tooltip: ReferencePresentationTooltip2.optional(),
|
|
3912
4082
|
/** What the transcript calls this module's addresses. Needs a `uriModule`. */
|
|
3913
|
-
words: ReferencePresentationWords2.optional()
|
|
4083
|
+
words: ReferencePresentationWords2.optional(),
|
|
4084
|
+
/** How this module's web pages open under the right account. Needs a `uriModule`. */
|
|
4085
|
+
accountLinks: ReferencePresentationAccountLinks2.optional()
|
|
3914
4086
|
}).superRefine((value, ctx) => {
|
|
3915
4087
|
if (value.open === void 0 !== (value.resourceKind === void 0)) {
|
|
3916
4088
|
ctx.addIssue({
|
|
@@ -3919,13 +4091,20 @@ function createContributionsSchemas(canonical) {
|
|
|
3919
4091
|
message: "open and resourceKind come together: name both or neither."
|
|
3920
4092
|
});
|
|
3921
4093
|
}
|
|
3922
|
-
if (value.open === void 0 && value.words === void 0) {
|
|
4094
|
+
if (value.open === void 0 && value.words === void 0 && value.accountLinks === void 0) {
|
|
3923
4095
|
ctx.addIssue({
|
|
3924
4096
|
code: "custom",
|
|
3925
4097
|
path: ["words"],
|
|
3926
4098
|
message: "A reference presentation that opens nothing must have words."
|
|
3927
4099
|
});
|
|
3928
4100
|
}
|
|
4101
|
+
if (value.accountLinks !== void 0 && value.uriModule === void 0) {
|
|
4102
|
+
ctx.addIssue({
|
|
4103
|
+
code: "custom",
|
|
4104
|
+
path: ["accountLinks"],
|
|
4105
|
+
message: "Account links belong to a URI module: name its uriModule."
|
|
4106
|
+
});
|
|
4107
|
+
}
|
|
3929
4108
|
if (value.words !== void 0 && value.uriModule === void 0) {
|
|
3930
4109
|
ctx.addIssue({
|
|
3931
4110
|
code: "custom",
|
|
@@ -3980,11 +4159,6 @@ function createContributionsSchemas(canonical) {
|
|
|
3980
4159
|
});
|
|
3981
4160
|
}
|
|
3982
4161
|
});
|
|
3983
|
-
const RichViewContribution2 = z12.strictObject({
|
|
3984
|
-
localId: LocalContributionId2,
|
|
3985
|
-
title: NonEmptyString3,
|
|
3986
|
-
route: NonEmptyString3.optional()
|
|
3987
|
-
});
|
|
3988
4162
|
const KayUiAppHostCapability2 = z12.enum([
|
|
3989
4163
|
"navigation.open-session",
|
|
3990
4164
|
// Lets `navigation.openChat` create a blank chat (no message, no model
|
|
@@ -4163,10 +4337,7 @@ function createContributionsSchemas(canonical) {
|
|
|
4163
4337
|
"mcpServer",
|
|
4164
4338
|
"uiCommand",
|
|
4165
4339
|
"uiSlot",
|
|
4166
|
-
"settingsPanel",
|
|
4167
|
-
"resultRenderer",
|
|
4168
4340
|
"referencePresentation",
|
|
4169
|
-
"view",
|
|
4170
4341
|
"app",
|
|
4171
4342
|
"theme",
|
|
4172
4343
|
"authService",
|
|
@@ -4215,8 +4386,6 @@ function createContributionsSchemas(canonical) {
|
|
|
4215
4386
|
SessionReaderContribution: SessionReaderContribution2,
|
|
4216
4387
|
UiCommandContribution: UiCommandContribution2,
|
|
4217
4388
|
UiSlotContribution: UiSlotContribution2,
|
|
4218
|
-
SettingsPanelContribution: SettingsPanelContribution2,
|
|
4219
|
-
ResultRendererContribution: ResultRendererContribution2,
|
|
4220
4389
|
ReferenceOpenBehavior: ReferenceOpenBehavior2,
|
|
4221
4390
|
ReferencePresentationVariant: ReferencePresentationVariant2,
|
|
4222
4391
|
ReferencePresentationVariants: ReferencePresentationVariants2,
|
|
@@ -4224,9 +4393,9 @@ function createContributionsSchemas(canonical) {
|
|
|
4224
4393
|
ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2,
|
|
4225
4394
|
ReferencePresentationTooltip: ReferencePresentationTooltip2,
|
|
4226
4395
|
ReferencePresentationAddress: ReferencePresentationAddress2,
|
|
4396
|
+
ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2,
|
|
4227
4397
|
ReferencePresentationWords: ReferencePresentationWords2,
|
|
4228
4398
|
ReferencePresentationContribution: ReferencePresentationContribution2,
|
|
4229
|
-
RichViewContribution: RichViewContribution2,
|
|
4230
4399
|
KayUiAppHostCapability: KayUiAppHostCapability2,
|
|
4231
4400
|
UiAppCapabilities: UiAppCapabilities2,
|
|
4232
4401
|
UiRailEntryContribution: UiRailEntryContribution2,
|
|
@@ -4239,8 +4408,15 @@ function createContributionsSchemas(canonical) {
|
|
|
4239
4408
|
PluginContributionKind: PluginContributionKind2
|
|
4240
4409
|
};
|
|
4241
4410
|
}
|
|
4242
|
-
var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution,
|
|
4411
|
+
var { ApprovalCardForm, ApprovalCardStoredForm, ApprovalTypeContribution, UriModuleFacts, ToolContribution, ToolPermission, AgentToolContribution, ConverterContribution, UriModuleContribution, AppUriModuleContribution, AppDataSourceContribution, WhiteboardTypeStorage, WhiteboardTypeContribution, AppDataMaterializerContribution, ArtifactUriModuleContribution, CliBindingContribution, GitHostContribution, ResourceContribution, SkillContribution, PluginSkillSourceDeclaration, SearchProviderContribution, InteractionDriverContribution, EntityResolverContribution, AgentRenderContribution, EndpointContribution, PluginCardContribution, WorkflowContribution, McpServerUrl, McpServerAuthMode, McpServerContribution, McpServerContributions, AppEventSubscription, ContextContributorContribution, PluginEventDefinitionContribution, PluginNotificationRuleContribution, PluginProductEventContribution, UiEventSubscriptionContribution, DeviceDelegationContribution, SessionReaderContribution, UiCommandContribution, UiSlotContribution, ReferenceOpenBehavior, ReferencePresentationVariant, ReferencePresentationVariants, ReferencePresentationUriPattern, ReferencePresentationUrlClaim, ReferencePresentationTooltip, ReferencePresentationAddress, ReferencePresentationAccountLinks, ReferencePresentationWords, ReferencePresentationContribution, KayUiAppHostCapability, UiAppCapabilities, UiRailEntryContribution, UiToastPreviewContribution, UiPageContribution, UiAppContribution, ThemeContribution, CommandHandler, CommandContribution, PluginContributionKind } = createContributionsSchemas(false);
|
|
4243
4412
|
var canonicalContributionSchemas = createContributionsSchemas(true);
|
|
4413
|
+
var UI_APP_SOURCE_MODULE = /\.(?:tsx|ts|jsx)$/;
|
|
4414
|
+
function isUiAppSourceModule(module) {
|
|
4415
|
+
return UI_APP_SOURCE_MODULE.test(module);
|
|
4416
|
+
}
|
|
4417
|
+
function uiAppSourceStylePath(module) {
|
|
4418
|
+
return module.replace(UI_APP_SOURCE_MODULE, ".css");
|
|
4419
|
+
}
|
|
4244
4420
|
|
|
4245
4421
|
// packages/plugin-protocol/dist/icon-shape.js
|
|
4246
4422
|
var SVG_PROLOG = String.raw`^\s*(?:<\?xml[^>]*>\s*)?(?:<!--[\s\S]*?-->\s*)*(?:<!DOCTYPE[^>]*>\s*)?`;
|
|
@@ -4313,7 +4489,7 @@ var KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS = [
|
|
|
4313
4489
|
var KAY_UI_NATIVE_EVENT_ALLOWLIST = new Set(KAY_UI_NATIVE_EVENT_SUBSCRIPTIONS);
|
|
4314
4490
|
var RETIRED_COMPATIBILITY_KEYS = ["policy"];
|
|
4315
4491
|
function createManifestSchemas(canonical) {
|
|
4316
|
-
const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, PluginCardContribution: PluginCardContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2,
|
|
4492
|
+
const { AgentRenderContribution: AgentRenderContribution2, ApprovalTypeContribution: ApprovalTypeContribution2, WorkflowContribution: WorkflowContribution2, PluginCardContribution: PluginCardContribution2, AppDataMaterializerContribution: AppDataMaterializerContribution2, AppDataSourceContribution: AppDataSourceContribution2, AppUriModuleContribution: AppUriModuleContribution2, AppEventSubscription: AppEventSubscription2, ArtifactUriModuleContribution: ArtifactUriModuleContribution2, CliBindingContribution: CliBindingContribution2, CommandContribution: CommandContribution2, ContextContributorContribution: ContextContributorContribution2, ConverterContribution: ConverterContribution2, SessionReaderContribution: SessionReaderContribution2, DeviceDelegationContribution: DeviceDelegationContribution2, EndpointContribution: EndpointContribution2, EntityResolverContribution: EntityResolverContribution2, GitHostContribution: GitHostContribution2, McpServerContributions: McpServerContributions2, PluginEventDefinitionContribution: PluginEventDefinitionContribution2, PluginNotificationRuleContribution: PluginNotificationRuleContribution2, PluginProductEventContribution: PluginProductEventContribution2, ResourceContribution: ResourceContribution2, ReferencePresentationContribution: ReferencePresentationContribution2, PluginSkillSourceDeclaration: PluginSkillSourceDeclaration2, InteractionDriverContribution: InteractionDriverContribution2, SearchProviderContribution: SearchProviderContribution2, SkillContribution: SkillContribution2, ThemeContribution: ThemeContribution2, AgentToolContribution: AgentToolContribution2, ToolContribution: ToolContribution2, UiCommandContribution: UiCommandContribution2, UiAppContribution: UiAppContribution2, UiRailEntryContribution: UiRailEntryContribution2, UiToastPreviewContribution: UiToastPreviewContribution2, UiPageContribution: UiPageContribution2, UiEventSubscriptionContribution: UiEventSubscriptionContribution2, UiSlotContribution: UiSlotContribution2, UriModuleContribution: UriModuleContribution2, WhiteboardTypeContribution: WhiteboardTypeContribution2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
4317
4493
|
const { HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
4318
4494
|
const { PluginPermissionManifest: PluginPermissionManifest2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
4319
4495
|
const KayAgentTargetManifest2 = z13.strictObject({
|
|
@@ -4432,10 +4608,7 @@ function createManifestSchemas(canonical) {
|
|
|
4432
4608
|
contributes: z13.strictObject({
|
|
4433
4609
|
commands: z13.array(UiCommandContribution2).optional(),
|
|
4434
4610
|
slots: z13.array(UiSlotContribution2).optional(),
|
|
4435
|
-
settingsPanels: z13.array(SettingsPanelContribution2).optional(),
|
|
4436
|
-
resultRenderers: z13.array(ResultRendererContribution2).optional(),
|
|
4437
4611
|
referencePresentations: z13.array(ReferencePresentationContribution2).optional(),
|
|
4438
|
-
views: z13.array(RichViewContribution2).optional(),
|
|
4439
4612
|
apps: z13.array(UiAppContribution2).optional(),
|
|
4440
4613
|
railEntries: z13.array(UiRailEntryContribution2).optional(),
|
|
4441
4614
|
toastPreviews: z13.array(UiToastPreviewContribution2).optional(),
|
|
@@ -4716,7 +4889,13 @@ function createManifestSchemas(canonical) {
|
|
|
4716
4889
|
loginUrl: HttpsUrl2,
|
|
4717
4890
|
cookieDomains: z13.array(RegistrableDomain2).min(1),
|
|
4718
4891
|
probe: PluginWebSessionProbe2,
|
|
4719
|
-
oauthVenue: z13.enum(["embedded", "external"])
|
|
4892
|
+
oauthVenue: z13.enum(["embedded", "external"]),
|
|
4893
|
+
/**
|
|
4894
|
+
* Where a page goes first when it opens in one of Bonsai's browser panes and this site login
|
|
4895
|
+
* is missing: a sign-in page that continues to the page. A template with `:email` and `:url`
|
|
4896
|
+
* (see `UriClaimTemplate`), on a host within `cookieDomains`.
|
|
4897
|
+
*/
|
|
4898
|
+
signInFirst: z13.string().optional()
|
|
4720
4899
|
}).superRefine(refineWebSessionScopeConfined);
|
|
4721
4900
|
const PluginAuthService2 = z13.strictObject({
|
|
4722
4901
|
localId: LocalContributionId2,
|
|
@@ -4950,24 +5129,6 @@ function createManifestSchemas(canonical) {
|
|
|
4950
5129
|
}
|
|
4951
5130
|
reportDuplicateLocalIds(ctx, ["targets", "kay", "app", "contributes", "whiteboardTypes"], manifest.targets?.kay?.app?.contributes?.whiteboardTypes, "Whiteboard type");
|
|
4952
5131
|
const uiAppIds = new Set(manifest.targets?.kay?.ui?.contributes?.apps?.map((app) => app.localId) ?? []);
|
|
4953
|
-
for (const [index, type] of (manifest.targets?.kay?.app?.contributes?.whiteboardTypes ?? []).entries()) {
|
|
4954
|
-
if (type.presentation !== void 0 && !uiAppIds.has(type.presentation.app)) {
|
|
4955
|
-
ctx.addIssue({
|
|
4956
|
-
code: "custom",
|
|
4957
|
-
path: [
|
|
4958
|
-
"targets",
|
|
4959
|
-
"kay",
|
|
4960
|
-
"app",
|
|
4961
|
-
"contributes",
|
|
4962
|
-
"whiteboardTypes",
|
|
4963
|
-
index,
|
|
4964
|
-
"presentation",
|
|
4965
|
-
"app"
|
|
4966
|
-
],
|
|
4967
|
-
message: `Whiteboard type ${type.localId} references unknown ui app ${type.presentation.app}`
|
|
4968
|
-
});
|
|
4969
|
-
}
|
|
4970
|
-
}
|
|
4971
5132
|
for (const [index, entry] of (manifest.targets?.kay?.ui?.contributes?.railEntries ?? []).entries()) {
|
|
4972
5133
|
const body = entry.panel?.body;
|
|
4973
5134
|
const app = manifest.targets?.kay?.ui?.contributes?.apps?.find((candidate) => candidate.localId === body);
|
|
@@ -5825,10 +5986,7 @@ function collectDeclaredContributionIds(manifest) {
|
|
|
5825
5986
|
const ui = manifest.targets?.kay?.ui?.contributes;
|
|
5826
5987
|
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "commands"], ui?.commands);
|
|
5827
5988
|
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "slots"], ui?.slots);
|
|
5828
|
-
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "settingsPanels"], ui?.settingsPanels);
|
|
5829
|
-
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "resultRenderers"], ui?.resultRenderers);
|
|
5830
5989
|
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "referencePresentations"], ui?.referencePresentations);
|
|
5831
|
-
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "views"], ui?.views);
|
|
5832
5990
|
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "apps"], ui?.apps);
|
|
5833
5991
|
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "themes"], ui?.themes);
|
|
5834
5992
|
pushContributionIds(output, ["targets", "kay", "ui", "contributes", "eventSubscriptions"], ui?.eventSubscriptions);
|
|
@@ -5867,7 +6025,7 @@ function boundPluginDiagnosticMessage(message) {
|
|
|
5867
6025
|
import { z as z14 } from "zod";
|
|
5868
6026
|
function createResolvedContractSchemas(canonical) {
|
|
5869
6027
|
const { PluginEventLocalId: PluginEventLocalId2 } = canonical ? canonicalPluginEventSchemas : plugin_events_exports;
|
|
5870
|
-
const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
6028
|
+
const { ApprovalTypeContribution: ApprovalTypeContribution2, KayUiAppHostCapability: KayUiAppHostCapability2, McpServerAuthMode: McpServerAuthMode2, McpServerUrl: McpServerUrl2, PluginContributionKind: PluginContributionKindSchema, ReferenceOpenBehavior: ReferenceOpenBehavior2, ReferencePresentationUriPattern: ReferencePresentationUriPattern2, ReferencePresentationAccountLinks: ReferencePresentationAccountLinks2, ReferencePresentationAddress: ReferencePresentationAddress2, ReferencePresentationUrlClaim: ReferencePresentationUrlClaim2, ReferencePresentationVariants: ReferencePresentationVariants2, ReferencePresentationWords: ReferencePresentationWords2, UriModuleFacts: UriModuleFacts2, WhiteboardTypeStorage: WhiteboardTypeStorage2 } = canonical ? canonicalContributionSchemas : contributions_exports;
|
|
5871
6029
|
const { FileExtensionToken: FileExtensionToken2, GitBasicAuthUser: GitBasicAuthUser2, GitHostName: GitHostName2, GlobalContributionId: GlobalContributionId2, HttpsUrl: HttpsUrl2, LocalContributionId: LocalContributionId2, MimeTypeString: MimeTypeString2, NonEmptyString: NonEmptyString3, PackageAssetPath: PackageAssetPath2, PluginId: PluginId2, PluginNamespace: PluginNamespace2, PluginToolName: PluginToolName2, RegistrableDomain: RegistrableDomain2, SignedInStatusCode: SignedInStatusCode2, TargetEntrypoint: TargetEntrypoint2, UriScheme: UriScheme2 } = canonical ? canonicalCommonSchemas : common_exports;
|
|
5872
6030
|
const { PluginExternalCliConnect: PluginExternalCliConnect2, PluginOAuthClientSupplier: PluginOAuthClientSupplier2 } = canonical ? canonicalManifestSchemas : manifest_exports;
|
|
5873
6031
|
const { ResolvedPluginGrants: ResolvedPluginGrants2 } = canonical ? canonicalPermissionSchemas : permissions_exports;
|
|
@@ -5986,10 +6144,7 @@ function createResolvedContractSchemas(canonical) {
|
|
|
5986
6144
|
displayName: NonEmptyString3,
|
|
5987
6145
|
schemaVersion: z14.number().int().positive(),
|
|
5988
6146
|
storage: WhiteboardTypeStorage2,
|
|
5989
|
-
valueSchema: JsonSchema
|
|
5990
|
-
presentation: z14.strictObject({
|
|
5991
|
-
app: GlobalContributionId2
|
|
5992
|
-
}).optional()
|
|
6147
|
+
valueSchema: JsonSchema
|
|
5993
6148
|
});
|
|
5994
6149
|
const ResolvedKayAppMcpServer2 = z14.strictObject({
|
|
5995
6150
|
name: LocalContributionId2,
|
|
@@ -6010,6 +6165,8 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6010
6165
|
knownResources: z14.literal(true).optional(),
|
|
6011
6166
|
/** Mirrors `UriModuleContribution.describesOperations`. */
|
|
6012
6167
|
describesOperations: z14.literal(true).optional(),
|
|
6168
|
+
/** Mirrors `UriModuleContribution.looksUpWebLinks`. */
|
|
6169
|
+
looksUpWebLinks: z14.literal(true).optional(),
|
|
6013
6170
|
...UriModuleFacts2.shape
|
|
6014
6171
|
});
|
|
6015
6172
|
const ResolvedKayAgentArtifactUriModule2 = z14.strictObject({
|
|
@@ -6046,6 +6203,9 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6046
6203
|
mimeTypes: z14.array(MimeTypeString2).min(1),
|
|
6047
6204
|
extensions: z14.array(FileExtensionToken2).min(1).optional()
|
|
6048
6205
|
});
|
|
6206
|
+
const ResolvedReferencePresentationUrlClaim = ReferencePresentationUrlClaim2.extend({
|
|
6207
|
+
brandIcon: z14.string().max(64 * 1024).optional()
|
|
6208
|
+
});
|
|
6049
6209
|
const ResolvedReferencePresentation2 = z14.strictObject({
|
|
6050
6210
|
localId: LocalContributionId2,
|
|
6051
6211
|
globalId: GlobalContributionId2,
|
|
@@ -6054,13 +6214,16 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6054
6214
|
schemes: z14.array(UriScheme2).min(1).optional(),
|
|
6055
6215
|
/** The module's `displayName`: the source's name in a row. */
|
|
6056
6216
|
displayName: NonEmptyString3.optional(),
|
|
6217
|
+
/** The module's auth service, qualified: whose accounts `accountLinks` reads. */
|
|
6218
|
+
authService: GlobalContributionId2.optional(),
|
|
6219
|
+
accountLinks: ReferencePresentationAccountLinks2.optional(),
|
|
6057
6220
|
addresses: z14.array(ReferencePresentationAddress2).min(1).optional(),
|
|
6058
6221
|
/** Comes with `open`. A presentation with neither only words its module's addresses. */
|
|
6059
6222
|
resourceKind: NonEmptyString3.optional(),
|
|
6060
6223
|
open: ReferenceOpenBehavior2.optional(),
|
|
6061
6224
|
/** MIME-specific resource kinds; absent keys use the base presentation. */
|
|
6062
6225
|
variants: ReferencePresentationVariants2.optional(),
|
|
6063
|
-
claims: z14.array(
|
|
6226
|
+
claims: z14.array(ResolvedReferencePresentationUrlClaim).optional(),
|
|
6064
6227
|
tooltip: z14.strictObject({
|
|
6065
6228
|
app: GlobalContributionId2,
|
|
6066
6229
|
pattern: ReferencePresentationUriPattern2
|
|
@@ -6165,7 +6328,8 @@ function createResolvedContractSchemas(canonical) {
|
|
|
6165
6328
|
method: z14.enum(["GET", "POST"]),
|
|
6166
6329
|
signedInStatuses: z14.array(SignedInStatusCode2).min(1)
|
|
6167
6330
|
}),
|
|
6168
|
-
oauthVenue: z14.enum(["embedded", "external"])
|
|
6331
|
+
oauthVenue: z14.enum(["embedded", "external"]),
|
|
6332
|
+
signInFirst: z14.string().optional()
|
|
6169
6333
|
}).superRefine(refineWebSessionScopeConfined);
|
|
6170
6334
|
const ResolvedPluginAuthService2 = z14.strictObject({
|
|
6171
6335
|
localId: LocalContributionId2,
|
|
@@ -6316,10 +6480,7 @@ function collectContributionSources(manifest) {
|
|
|
6316
6480
|
const ui = manifest.targets?.kay?.ui?.contributes;
|
|
6317
6481
|
pushAll(output, "kay.ui", "uiCommand", ui?.commands);
|
|
6318
6482
|
pushAll(output, "kay.ui", "uiSlot", ui?.slots);
|
|
6319
|
-
pushAll(output, "kay.ui", "settingsPanel", ui?.settingsPanels);
|
|
6320
|
-
pushAll(output, "kay.ui", "resultRenderer", ui?.resultRenderers);
|
|
6321
6483
|
pushAll(output, "kay.ui", "referencePresentation", ui?.referencePresentations);
|
|
6322
|
-
pushAll(output, "kay.ui", "view", ui?.views);
|
|
6323
6484
|
pushAll(output, "kay.ui", "app", ui?.apps);
|
|
6324
6485
|
pushAll(output, "kay.ui", "theme", ui?.themes);
|
|
6325
6486
|
pushAll(output, "kay.ui", "eventSubscription", ui?.eventSubscriptions);
|
|
@@ -6435,7 +6596,8 @@ function resolveAuthServices(namespace, manifest) {
|
|
|
6435
6596
|
method: service.webSession.probe.method ?? "GET",
|
|
6436
6597
|
signedInStatuses: [...service.webSession.probe.signedInStatuses]
|
|
6437
6598
|
},
|
|
6438
|
-
oauthVenue: service.webSession.oauthVenue
|
|
6599
|
+
oauthVenue: service.webSession.oauthVenue,
|
|
6600
|
+
...service.webSession.signInFirst === void 0 ? {} : { signInFirst: service.webSession.signInFirst }
|
|
6439
6601
|
}
|
|
6440
6602
|
},
|
|
6441
6603
|
schemes: service.schemes.map((scheme) => {
|
|
@@ -6645,12 +6807,7 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
6645
6807
|
displayName: type.displayName,
|
|
6646
6808
|
schemaVersion: type.schemaVersion,
|
|
6647
6809
|
storage: type.storage,
|
|
6648
|
-
valueSchema: type.valueSchema
|
|
6649
|
-
...type.presentation === void 0 ? {} : {
|
|
6650
|
-
presentation: {
|
|
6651
|
-
app: resolveGlobalContributionId(namespace, type.presentation.app)
|
|
6652
|
-
}
|
|
6653
|
-
}
|
|
6810
|
+
valueSchema: type.valueSchema
|
|
6654
6811
|
}));
|
|
6655
6812
|
const kayAppMcpServers = Object.entries(manifest.targets?.kay?.app?.contributes?.mcpServers ?? {}).map(([name, server]) => ({
|
|
6656
6813
|
name,
|
|
@@ -6674,6 +6831,7 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
6674
6831
|
},
|
|
6675
6832
|
...module.knownResources === void 0 ? {} : { knownResources: module.knownResources },
|
|
6676
6833
|
...module.describesOperations === void 0 ? {} : { describesOperations: module.describesOperations },
|
|
6834
|
+
...module.looksUpWebLinks === void 0 ? {} : { looksUpWebLinks: module.looksUpWebLinks },
|
|
6677
6835
|
...uriModuleFacts(module)
|
|
6678
6836
|
}));
|
|
6679
6837
|
const kayAgentArtifactUriModules = manifest.targets?.kay?.agent?.contributes?.artifactUriModules?.map((module) => ({
|
|
@@ -6709,13 +6867,14 @@ function resolveKayPluginContractV1(manifest) {
|
|
|
6709
6867
|
...presentation.uriModule === void 0 ? {} : {
|
|
6710
6868
|
uriModule: resolveGlobalContributionId(namespace, presentation.uriModule)
|
|
6711
6869
|
},
|
|
6712
|
-
...presentationSource(manifest, presentation),
|
|
6870
|
+
...presentationSource(namespace, manifest, presentation),
|
|
6713
6871
|
...presentation.addresses === void 0 ? {} : { addresses: presentation.addresses },
|
|
6714
6872
|
...presentation.open === void 0 || presentation.resourceKind === void 0 ? {} : {
|
|
6715
6873
|
resourceKind: presentation.resourceKind,
|
|
6716
6874
|
open: presentation.open
|
|
6717
6875
|
},
|
|
6718
6876
|
...presentation.words === void 0 ? {} : { words: { ...presentation.words } },
|
|
6877
|
+
...presentation.accountLinks === void 0 ? {} : { accountLinks: presentation.accountLinks },
|
|
6719
6878
|
...presentation.tooltip === void 0 ? {} : {
|
|
6720
6879
|
tooltip: {
|
|
6721
6880
|
app: resolveGlobalContributionId(namespace, presentation.tooltip.app),
|
|
@@ -6800,19 +6959,23 @@ function safeResolveKayPluginContractV1(manifest) {
|
|
|
6800
6959
|
throw error;
|
|
6801
6960
|
}
|
|
6802
6961
|
}
|
|
6803
|
-
function presentationSource(manifest, presentation) {
|
|
6962
|
+
function presentationSource(namespace, manifest, presentation) {
|
|
6804
6963
|
const contributes = manifest.targets?.kay;
|
|
6805
6964
|
const module = [
|
|
6806
6965
|
...contributes?.agent?.contributes?.uriModules ?? [],
|
|
6807
6966
|
...contributes?.app?.contributes?.uriModules ?? []
|
|
6808
6967
|
].find((candidate) => candidate.localId === presentation.uriModule);
|
|
6809
6968
|
const schemes = presentation.scheme === void 0 ? module?.schemes : [presentation.scheme];
|
|
6969
|
+
const authService = module !== void 0 && "authService" in module ? module.authService : void 0;
|
|
6810
6970
|
return {
|
|
6811
6971
|
...schemes === void 0 ? {} : { schemes: [...schemes] },
|
|
6812
|
-
...module?.displayName === void 0 ? {} : { displayName: module.displayName }
|
|
6972
|
+
...module?.displayName === void 0 ? {} : { displayName: module.displayName },
|
|
6973
|
+
...typeof authService === "string" ? {
|
|
6974
|
+
authService: isQualifiedAuthServiceRef(authService) ? authService : resolveGlobalContributionId(namespace, authService)
|
|
6975
|
+
} : {}
|
|
6813
6976
|
};
|
|
6814
6977
|
}
|
|
6815
|
-
function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _displayName, authService: _authService, authScheme: _authScheme, knownResources: _knownResources, describesOperations: _describesOperations, ...facts }) {
|
|
6978
|
+
function uriModuleFacts({ localId: _localId, schemes: _schemes, displayName: _displayName, authService: _authService, authScheme: _authScheme, knownResources: _knownResources, describesOperations: _describesOperations, looksUpWebLinks: _looksUpWebLinks, ...facts }) {
|
|
6816
6979
|
return facts;
|
|
6817
6980
|
}
|
|
6818
6981
|
|
|
@@ -7408,11 +7571,7 @@ var WhiteboardTypeInfo = z19.strictObject({
|
|
|
7408
7571
|
typeId: GlobalContributionId,
|
|
7409
7572
|
displayName: NonEmptyString,
|
|
7410
7573
|
schemaVersion: z19.number().int().positive(),
|
|
7411
|
-
available: z19.boolean()
|
|
7412
|
-
/** A plugin-owned readonly presentation; absent types use the host fallback. */
|
|
7413
|
-
presentation: z19.strictObject({
|
|
7414
|
-
app: GlobalContributionId
|
|
7415
|
-
}).optional()
|
|
7574
|
+
available: z19.boolean()
|
|
7416
7575
|
});
|
|
7417
7576
|
|
|
7418
7577
|
// packages/plugin-protocol/dist/product-events.js
|
|
@@ -7746,6 +7905,7 @@ export {
|
|
|
7746
7905
|
RETIRED_PLUGIN_CAPABILITY_SLUGS,
|
|
7747
7906
|
RETIRED_WEB_SESSION_ROW_KEYS,
|
|
7748
7907
|
ReferenceOpenBehavior,
|
|
7908
|
+
ReferencePresentationAccountLinks,
|
|
7749
7909
|
ReferencePresentationAddress,
|
|
7750
7910
|
ReferencePresentationContribution,
|
|
7751
7911
|
ReferencePresentationTooltip,
|
|
@@ -7782,8 +7942,6 @@ export {
|
|
|
7782
7942
|
ResolvedReferencePresentation,
|
|
7783
7943
|
ResolvedTargetGrantSet,
|
|
7784
7944
|
ResourceContribution,
|
|
7785
|
-
ResultRendererContribution,
|
|
7786
|
-
RichViewContribution,
|
|
7787
7945
|
SEMVER_PATTERN,
|
|
7788
7946
|
SESSION_HEALTH_CLASSIFIER_IDS,
|
|
7789
7947
|
SESSION_HEALTH_CUSTOM_TYPE,
|
|
@@ -7802,7 +7960,6 @@ export {
|
|
|
7802
7960
|
SessionProvenanceRecord,
|
|
7803
7961
|
SessionReaderContribution,
|
|
7804
7962
|
SessionRelationship,
|
|
7805
|
-
SettingsPanelContribution,
|
|
7806
7963
|
SignedInStatusCode,
|
|
7807
7964
|
SkillContribution,
|
|
7808
7965
|
StorageGrantRequest,
|
|
@@ -7824,6 +7981,7 @@ export {
|
|
|
7824
7981
|
UriModuleContribution,
|
|
7825
7982
|
UriScheme,
|
|
7826
7983
|
WEB_SESSION_CSRF_SELECTOR_PATTERN,
|
|
7984
|
+
WHERE_MAX_BYTES,
|
|
7827
7985
|
WebSessionCsrfSelector,
|
|
7828
7986
|
WebSessionGrantRequest,
|
|
7829
7987
|
WhiteboardCapabilityClaimV1,
|
|
@@ -7851,25 +8009,30 @@ export {
|
|
|
7851
8009
|
configSectionKeysForManifest,
|
|
7852
8010
|
declarationsOfKind,
|
|
7853
8011
|
declaredCommandId,
|
|
8012
|
+
declaredLocalAppSchemes,
|
|
7854
8013
|
declaredReferencePresentations,
|
|
7855
8014
|
declaredUiIconPaths,
|
|
7856
8015
|
dedupeClaims,
|
|
7857
8016
|
deriveDirectoryPluginToolName,
|
|
7858
8017
|
evaluateCommandWhere,
|
|
7859
8018
|
evaluateWhere,
|
|
8019
|
+
eventWhereProblem,
|
|
7860
8020
|
finalizeArtifactProvenanceEnvelope,
|
|
7861
8021
|
findSkillSuggestionCitations,
|
|
8022
|
+
formatWhereLiteral,
|
|
7862
8023
|
hasClaim,
|
|
7863
8024
|
hostWithinDomain,
|
|
7864
8025
|
isCanonicalArtifactOutputUri,
|
|
7865
8026
|
isCompatible,
|
|
7866
8027
|
isCredentialShapedText,
|
|
8028
|
+
isDeclaredLocalAppLink,
|
|
7867
8029
|
isKayPluginCompatibilityRefusal,
|
|
7868
8030
|
isPluginProductEventName,
|
|
7869
8031
|
isPrivateCapabilityClaim,
|
|
7870
8032
|
isQualifiedAuthSchemeRef,
|
|
7871
8033
|
isQualifiedAuthServiceRef,
|
|
7872
8034
|
isSupportedSemverRange,
|
|
8035
|
+
isUiAppSourceModule,
|
|
7873
8036
|
judgeKayPluginDirectory,
|
|
7874
8037
|
kayPluginCompatibilityAdvisories,
|
|
7875
8038
|
kayPluginHostCompatibility,
|
|
@@ -7910,8 +8073,13 @@ export {
|
|
|
7910
8073
|
skillSuggestionEvidenceKey,
|
|
7911
8074
|
turnMessageOrigin,
|
|
7912
8075
|
turnPacket,
|
|
8076
|
+
uiAppSourceStylePath,
|
|
7913
8077
|
urlHostWithinDomain,
|
|
7914
8078
|
validateKayUiEventSubscription,
|
|
7915
8079
|
webSessionPathWithinPrefix,
|
|
8080
|
+
whereClausesAsExpression,
|
|
8081
|
+
whereKeyUses,
|
|
8082
|
+
whereNotAStringMessage,
|
|
8083
|
+
whereProblem,
|
|
7916
8084
|
whiteboardCapabilityClaim
|
|
7917
8085
|
};
|