@inf-monkeys-tech/monkeys 1.0.68 → 1.0.70
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/lib/contracts/declarative-control-http.d.ts +1681 -369
- package/lib/contracts/declarative-control-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control.d.ts +740 -23
- package/lib/contracts/declarative-control.d.ts.map +1 -1
- package/lib/contracts/declarative-control.js +22 -3
- package/lib/contracts/declarative-control.js.map +1 -1
- package/lib/contracts/index.d.ts +1 -0
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +1 -0
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/workflow-column.d.ts +130 -0
- package/lib/contracts/workflow-column.d.ts.map +1 -0
- package/lib/contracts/workflow-column.js +72 -0
- package/lib/contracts/workflow-column.js.map +1 -0
- package/lib/esm/contracts/index.mjs +103 -25
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +225 -25
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +207 -15
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +81 -3
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/index.json +1 -0
- package/lib/json-schema/navigation-release.schema.json +582 -0
- package/lib/json-schema/navigation-runtime-bundle.schema.json +579 -0
- package/lib/json-schema/workflow-column-binding.schema.json +386 -0
- package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
- package/lib/runtime/declarative-control-compiler.js +26 -0
- package/lib/runtime/declarative-control-compiler.js.map +1 -1
- package/lib/runtime/index.d.ts +2 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +2 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/menu-compiler.d.ts +19 -1
- package/lib/runtime/menu-compiler.d.ts.map +1 -1
- package/lib/runtime/menu-compiler.js +34 -0
- package/lib/runtime/menu-compiler.js.map +1 -1
- package/lib/runtime/navigation-availability.d.ts +6 -0
- package/lib/runtime/navigation-availability.d.ts.map +1 -0
- package/lib/runtime/navigation-availability.js +17 -0
- package/lib/runtime/navigation-availability.js.map +1 -0
- package/lib/runtime/workflow-column.d.ts +8 -0
- package/lib/runtime/workflow-column.d.ts.map +1 -0
- package/lib/runtime/workflow-column.js +57 -0
- package/lib/runtime/workflow-column.js.map +1 -0
- package/lib/schemas/index.d.ts +310 -1
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +13 -4
- package/lib/schemas/index.js.map +1 -1
- package/package.json +1 -1
- package/test/fixtures/navigation-three-roots-topology.json +275 -0
package/lib/esm/index.mjs
CHANGED
|
@@ -9236,6 +9236,12 @@ var ResolvedNavigationTargetSchema = z10.object({
|
|
|
9236
9236
|
targetRevisionRef: RevisionRefSchema,
|
|
9237
9237
|
releaseRevisionRef: RevisionRefSchema.optional()
|
|
9238
9238
|
}).strict();
|
|
9239
|
+
var UnavailableNavigationTargetSchema = z10.object({
|
|
9240
|
+
nodeId: ContractIdentifierSchema,
|
|
9241
|
+
stableTargetRef: StableRefSchema.refine((reference) => reference.kind === "page", "Only missing Pages can be isolated."),
|
|
9242
|
+
reason: z10.literal("page-missing"),
|
|
9243
|
+
accessPolicy: AccessPolicySchema.nullable()
|
|
9244
|
+
}).strict();
|
|
9239
9245
|
var NavigationReleaseSchema = z10.object({
|
|
9240
9246
|
contract: z10.literal("NavigationRelease"),
|
|
9241
9247
|
...ReleaseBaseShape,
|
|
@@ -9245,13 +9251,17 @@ var NavigationReleaseSchema = z10.object({
|
|
|
9245
9251
|
surface: ProductSurfaceSchema,
|
|
9246
9252
|
placement: ContractIdentifierSchema
|
|
9247
9253
|
}).strict(),
|
|
9248
|
-
resolvedTargets: z10.array(ResolvedNavigationTargetSchema)
|
|
9254
|
+
resolvedTargets: z10.array(ResolvedNavigationTargetSchema),
|
|
9255
|
+
unavailableTargets: z10.array(UnavailableNavigationTargetSchema).optional()
|
|
9249
9256
|
}).strict().superRefine((value, context) => {
|
|
9250
9257
|
validateDependencySnapshot(value.dependencySnapshot, context);
|
|
9251
9258
|
validateReleaseExpectedHead(value, "navigation-release", context);
|
|
9252
9259
|
if (value.navigationRevisionRef.kind !== "navigation") context.addIssue({ code: "custom", path: ["navigationRevisionRef", "kind"], message: "Expected a navigation revision." });
|
|
9253
9260
|
if (value.target.environmentRef.kind !== "environment") context.addIssue({ code: "custom", path: ["target", "environmentRef", "kind"], message: "Navigation release target requires an environment reference." });
|
|
9254
9261
|
if (uniqueArray(value.resolvedTargets, (target) => target.nodeId)) context.addIssue({ code: "custom", path: ["resolvedTargets"], message: "Resolved Navigation node IDs must be unique." });
|
|
9262
|
+
if (uniqueArray([...value.resolvedTargets, ...value.unavailableTargets ?? []], (target) => target.nodeId)) {
|
|
9263
|
+
context.addIssue({ code: "custom", path: ["unavailableTargets"], message: "Navigation target resolutions must have unique node IDs." });
|
|
9264
|
+
}
|
|
9255
9265
|
});
|
|
9256
9266
|
var RuntimeDiagnosticSchema = z10.object({
|
|
9257
9267
|
code: ContractIdentifierSchema,
|
|
@@ -9339,7 +9349,8 @@ var CompiledNavigationDomainCommandTargetSchema = ResolvedNavigationTargetSchema
|
|
|
9339
9349
|
var CompiledNavigationResolvedTargetSchema = z10.discriminatedUnion("kind", [
|
|
9340
9350
|
CompiledNavigationTargetSchema,
|
|
9341
9351
|
CompiledNavigationRegisteredMenuActionTargetSchema,
|
|
9342
|
-
CompiledNavigationDomainCommandTargetSchema
|
|
9352
|
+
CompiledNavigationDomainCommandTargetSchema,
|
|
9353
|
+
UnavailableNavigationTargetSchema.omit({ reason: true }).extend({ kind: z10.literal("unavailable") }).strict()
|
|
9343
9354
|
]);
|
|
9344
9355
|
var CompiledNavigationGroupNodeSchema = NavigationGroupNodeSchema.extend({
|
|
9345
9356
|
ancestorAccessPolicies: z10.array(AccessPolicySchema)
|
|
@@ -9347,7 +9358,14 @@ var CompiledNavigationGroupNodeSchema = NavigationGroupNodeSchema.extend({
|
|
|
9347
9358
|
var CompiledNavigationTargetNodeSchema = NavigationTargetNodeSchema.extend({
|
|
9348
9359
|
ancestorAccessPolicies: z10.array(AccessPolicySchema),
|
|
9349
9360
|
resolvedTarget: CompiledNavigationResolvedTargetSchema
|
|
9350
|
-
}).strict()
|
|
9361
|
+
}).strict().superRefine((node, context) => {
|
|
9362
|
+
if (node.resolvedTarget.nodeId !== node.nodeId || stableRefIdentity(node.resolvedTarget.stableTargetRef) !== stableRefIdentity(node.targetRef)) {
|
|
9363
|
+
context.addIssue({ code: "custom", path: ["resolvedTarget"], message: "Resolved target identity must match the source node." });
|
|
9364
|
+
}
|
|
9365
|
+
if (node.resolvedTarget.kind === "unavailable" && (node.disabled !== true || Object.keys(node.parameterMapping).length > 0)) {
|
|
9366
|
+
context.addIssue({ code: "custom", path: ["resolvedTarget"], message: "Unavailable targets must be disabled and contain no executable input." });
|
|
9367
|
+
}
|
|
9368
|
+
});
|
|
9351
9369
|
var CompiledNavigationSeparatorNodeSchema = NavigationSeparatorNodeSchema.extend({
|
|
9352
9370
|
ancestorAccessPolicies: z10.array(AccessPolicySchema)
|
|
9353
9371
|
}).strict();
|
|
@@ -14845,22 +14863,75 @@ var WorkflowDefinitionSchema = z19.object({
|
|
|
14845
14863
|
if (definition.revision.kind === "release" && definition.metadata.version !== definition.revision.recordVersion) context.addIssue({ code: "custom", path: ["revision", "recordVersion"], message: "Release recordVersion must equal metadata.version." });
|
|
14846
14864
|
});
|
|
14847
14865
|
|
|
14848
|
-
// src/contracts/workflow-
|
|
14866
|
+
// src/contracts/workflow-column.ts
|
|
14849
14867
|
import { z as z20 } from "zod";
|
|
14850
|
-
var
|
|
14851
|
-
|
|
14868
|
+
var WorkflowColumnFieldRefSchema = z20.object({
|
|
14869
|
+
ontologyId: ContractIdentifierSchema,
|
|
14870
|
+
fieldKey: ContractIdentifierSchema
|
|
14871
|
+
}).strict();
|
|
14872
|
+
var WorkflowColumnInputSchema = z20.discriminatedUnion("kind", [
|
|
14873
|
+
z20.object({ kind: z20.literal("default") }).strict(),
|
|
14874
|
+
z20.object({ kind: z20.literal("constant"), value: JsonValueSchema }).strict(),
|
|
14875
|
+
z20.object({ kind: z20.literal("field"), field: WorkflowColumnFieldRefSchema }).strict(),
|
|
14876
|
+
z20.object({
|
|
14877
|
+
kind: z20.literal("context"),
|
|
14878
|
+
field: z20.enum(["assetId", "teamId", "ontologyId", "columnId"])
|
|
14879
|
+
}).strict()
|
|
14880
|
+
]);
|
|
14881
|
+
var WorkflowColumnDependencySchema = z20.discriminatedUnion("kind", [
|
|
14882
|
+
z20.object({ kind: z20.literal("field"), field: WorkflowColumnFieldRefSchema }).strict(),
|
|
14883
|
+
z20.object({
|
|
14884
|
+
kind: z20.literal("relation"),
|
|
14885
|
+
relation: WorkflowColumnFieldRefSchema,
|
|
14886
|
+
direction: z20.enum(["incoming", "outgoing"]),
|
|
14887
|
+
fields: z20.array(WorkflowColumnFieldRefSchema).max(100)
|
|
14888
|
+
}).strict()
|
|
14889
|
+
]);
|
|
14890
|
+
var WorkflowColumnOutputPathSchema = z20.array(z20.string().min(1).max(256)).max(20);
|
|
14891
|
+
var WorkflowColumnOutputSchema = z20.object({
|
|
14892
|
+
type: z20.enum(["number", "text", "json"]),
|
|
14893
|
+
path: WorkflowColumnOutputPathSchema,
|
|
14894
|
+
nullable: z20.boolean().default(false)
|
|
14895
|
+
}).strict();
|
|
14896
|
+
var WorkflowColumnBindingSchema = z20.object({
|
|
14897
|
+
contract: z20.literal("WorkflowColumnBinding"),
|
|
14898
|
+
version: z20.literal(1),
|
|
14899
|
+
enabled: z20.boolean(),
|
|
14900
|
+
paused: z20.boolean().default(false),
|
|
14901
|
+
workflow: z20.object({
|
|
14902
|
+
id: ContractIdentifierSchema,
|
|
14903
|
+
version: z20.number().int().positive(),
|
|
14904
|
+
inputSchemaHash: Sha256Schema
|
|
14905
|
+
}).strict(),
|
|
14906
|
+
inputs: z20.record(z20.string().min(1).max(128), WorkflowColumnInputSchema),
|
|
14907
|
+
dependencies: z20.array(WorkflowColumnDependencySchema).max(100).default([]),
|
|
14908
|
+
output: WorkflowColumnOutputSchema,
|
|
14909
|
+
policy: z20.object({
|
|
14910
|
+
debounceMs: z20.number().int().min(0).max(3e4).default(5e3),
|
|
14911
|
+
maxDelayMs: z20.number().int().min(0).max(3e4).default(3e4),
|
|
14912
|
+
concurrency: z20.number().int().min(1).max(32).default(2)
|
|
14913
|
+
}).strict().default({ debounceMs: 5e3, maxDelayMs: 3e4, concurrency: 2 }),
|
|
14914
|
+
// The workflow supplies an ISO datetime with offset for one future expiry.
|
|
14915
|
+
// Scheduling infrastructure needs no knowledge of months or business periods.
|
|
14916
|
+
expiry: z20.object({ path: WorkflowColumnOutputPathSchema }).strict().optional()
|
|
14917
|
+
}).strict();
|
|
14918
|
+
|
|
14919
|
+
// src/contracts/workflow-runtime.ts
|
|
14920
|
+
import { z as z21 } from "zod";
|
|
14921
|
+
var WorkflowCatalogEntrySchema = z21.object({
|
|
14922
|
+
contract: z21.literal("WorkflowCatalogEntry"),
|
|
14852
14923
|
workflowId: ContractIdentifierSchema,
|
|
14853
14924
|
teamId: ContractIdentifierSchema,
|
|
14854
14925
|
creatorRef: EntityRefSchema,
|
|
14855
14926
|
currentDefinitionRef: EntityRefSchema,
|
|
14856
|
-
lifecycle:
|
|
14857
|
-
asset:
|
|
14858
|
-
preset:
|
|
14859
|
-
marketplacePublished:
|
|
14927
|
+
lifecycle: z21.enum(["ACTIVE", "DELETED"]),
|
|
14928
|
+
asset: z21.object({
|
|
14929
|
+
preset: z21.boolean(),
|
|
14930
|
+
marketplacePublished: z21.boolean(),
|
|
14860
14931
|
publishConfig: JsonObjectSchema.optional(),
|
|
14861
|
-
sort:
|
|
14932
|
+
sort: z21.number().int(),
|
|
14862
14933
|
forkFromRef: EntityRefSchema.optional(),
|
|
14863
|
-
notAuthorized:
|
|
14934
|
+
notAuthorized: z21.boolean()
|
|
14864
14935
|
}).strict(),
|
|
14865
14936
|
createdAt: IsoDateTimeSchema,
|
|
14866
14937
|
updatedAt: IsoDateTimeSchema,
|
|
@@ -14895,17 +14966,17 @@ var WorkflowCatalogEntrySchema = z20.object({
|
|
|
14895
14966
|
});
|
|
14896
14967
|
}
|
|
14897
14968
|
});
|
|
14898
|
-
var WorkflowPublicationSchema =
|
|
14899
|
-
contract:
|
|
14969
|
+
var WorkflowPublicationSchema = z21.object({
|
|
14970
|
+
contract: z21.literal("WorkflowPublication"),
|
|
14900
14971
|
publicationId: ContractIdentifierSchema,
|
|
14901
14972
|
definitionRef: EntityRefSchema,
|
|
14902
14973
|
runtimeDefinitionRef: EntityRefSchema,
|
|
14903
14974
|
sourceHash: Sha256Schema,
|
|
14904
14975
|
compiledHash: Sha256Schema,
|
|
14905
|
-
status:
|
|
14976
|
+
status: z21.enum(["PENDING", "PUBLISHED", "FAILED", "RETIRED"]),
|
|
14906
14977
|
publisherRef: EntityRefSchema,
|
|
14907
14978
|
publishedAt: IsoDateTimeSchema.optional(),
|
|
14908
|
-
failureReason:
|
|
14979
|
+
failureReason: z21.string().trim().min(1).optional()
|
|
14909
14980
|
}).strict().superRefine((publication, context) => {
|
|
14910
14981
|
if (publication.definitionRef.kind !== "workflow-definition") {
|
|
14911
14982
|
context.addIssue({
|
|
@@ -14936,12 +15007,12 @@ var WorkflowPublicationSchema = z20.object({
|
|
|
14936
15007
|
});
|
|
14937
15008
|
}
|
|
14938
15009
|
});
|
|
14939
|
-
var WorkflowCompletionCommitSchema =
|
|
14940
|
-
contract:
|
|
15010
|
+
var WorkflowCompletionCommitSchema = z21.object({
|
|
15011
|
+
contract: z21.literal("WorkflowCompletionCommit"),
|
|
14941
15012
|
commitId: ContractIdentifierSchema,
|
|
14942
15013
|
run: ApplicationRunSchema,
|
|
14943
|
-
outputs:
|
|
14944
|
-
artifacts:
|
|
15014
|
+
outputs: z21.array(OutputRecordSchema),
|
|
15015
|
+
artifacts: z21.array(ArtifactManifestSchema),
|
|
14945
15016
|
lineage: LineageRecordSchema,
|
|
14946
15017
|
completedAt: IsoDateTimeSchema
|
|
14947
15018
|
}).strict().superRefine((commit, context) => {
|
|
@@ -14983,15 +15054,15 @@ var WorkflowCompletionCommitSchema = z20.object({
|
|
|
14983
15054
|
}
|
|
14984
15055
|
});
|
|
14985
15056
|
});
|
|
14986
|
-
var WorkflowCompletionReceiptSchema =
|
|
14987
|
-
contract:
|
|
15057
|
+
var WorkflowCompletionReceiptSchema = z21.object({
|
|
15058
|
+
contract: z21.literal("WorkflowCompletionReceipt"),
|
|
14988
15059
|
commitId: ContractIdentifierSchema,
|
|
14989
15060
|
runRef: EntityRefSchema,
|
|
14990
|
-
outputRefs:
|
|
14991
|
-
artifactRefs:
|
|
15061
|
+
outputRefs: z21.array(EntityRefSchema),
|
|
15062
|
+
artifactRefs: z21.array(EntityRefSchema),
|
|
14992
15063
|
contentHash: Sha256Schema,
|
|
14993
15064
|
committedAt: IsoDateTimeSchema,
|
|
14994
|
-
idempotentReplay:
|
|
15065
|
+
idempotentReplay: z21.boolean()
|
|
14995
15066
|
}).strict().superRefine((receipt, context) => {
|
|
14996
15067
|
if (receipt.runRef.kind !== "application-run") {
|
|
14997
15068
|
context.addIssue({
|
|
@@ -15022,6 +15093,7 @@ var WorkflowCompletionReceiptSchema = z20.object({
|
|
|
15022
15093
|
|
|
15023
15094
|
// src/schemas/index.ts
|
|
15024
15095
|
var canonicalContractSchemas = {
|
|
15096
|
+
"workflow-column-binding": WorkflowColumnBindingSchema,
|
|
15025
15097
|
"agent-session-command": AgentSessionCommandSchema,
|
|
15026
15098
|
"agent-session-targeted-command": AgentSessionTargetedCommandSchema,
|
|
15027
15099
|
"agent-session-command-result": AgentSessionCommandResultSchema,
|
|
@@ -16388,7 +16460,14 @@ var compileNavigationRuntimeBundle = (input) => {
|
|
|
16388
16460
|
assertUniqueRegistryKeys(targetRegistry.map((registration) => stableRefKey(registration.stableTargetRef)), "targetRegistry");
|
|
16389
16461
|
const targetsByStableRef = new Map(targetRegistry.map((registration) => [stableRefKey(registration.stableTargetRef), registration]));
|
|
16390
16462
|
const releasedByNodeId = new Map(release.resolvedTargets.map((target) => [target.nodeId, target]));
|
|
16463
|
+
const unavailableByNodeId = new Map((release.unavailableTargets ?? []).map((target) => [target.nodeId, target]));
|
|
16391
16464
|
const nodesById = new Map(navigation.nodes.map((node) => [node.nodeId, node]));
|
|
16465
|
+
for (const target of release.unavailableTargets ?? []) {
|
|
16466
|
+
const node = nodesById.get(target.nodeId);
|
|
16467
|
+
if (node?.kind !== "target" || !sameStableRef(node.targetRef, target.stableTargetRef)) {
|
|
16468
|
+
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", "release.unavailableTargets", "An unavailable target must identify its source Page node exactly.");
|
|
16469
|
+
}
|
|
16470
|
+
}
|
|
16392
16471
|
const nodes = orderedNavigationNodes(navigation).map((node, index) => {
|
|
16393
16472
|
const ancestors = [];
|
|
16394
16473
|
let parentId = node.parentNodeId;
|
|
@@ -16403,6 +16482,25 @@ var compileNavigationRuntimeBundle = (input) => {
|
|
|
16403
16482
|
}
|
|
16404
16483
|
const registration = targetsByStableRef.get(stableRefKey(node.targetRef));
|
|
16405
16484
|
const released = releasedByNodeId.get(node.nodeId);
|
|
16485
|
+
const unavailable = unavailableByNodeId.get(node.nodeId);
|
|
16486
|
+
if (!registration && unavailable && node.targetRef.kind === "page" && sameStableRef(unavailable.stableTargetRef, node.targetRef)) {
|
|
16487
|
+
assertTenantCompatible(node.targetRef, scope, `nodes[${index}].targetRef`);
|
|
16488
|
+
if (unavailable.accessPolicy && !accessPolicyChainImplies([...ancestors, node.audience], unavailable.accessPolicy)) {
|
|
16489
|
+
throw new DeclarativeControlCompilationError("AUDIENCE_WIDER_THAN_TARGET", `nodes[${index}].audience`, "Effective Navigation audience is wider than the last verified target audience.");
|
|
16490
|
+
}
|
|
16491
|
+
return {
|
|
16492
|
+
...node,
|
|
16493
|
+
disabled: true,
|
|
16494
|
+
parameterMapping: {},
|
|
16495
|
+
ancestorAccessPolicies: ancestors,
|
|
16496
|
+
resolvedTarget: {
|
|
16497
|
+
kind: "unavailable",
|
|
16498
|
+
nodeId: node.nodeId,
|
|
16499
|
+
stableTargetRef: node.targetRef,
|
|
16500
|
+
accessPolicy: unavailable.accessPolicy
|
|
16501
|
+
}
|
|
16502
|
+
};
|
|
16503
|
+
}
|
|
16406
16504
|
if (!registration || !released || !sameStableRef(registration.stableTargetRef, stableFromRevision(registration.targetRevisionRef)) || !sameStableRef(registration.stableTargetRef, released.stableTargetRef) || !sameRevisionRef(registration.targetRevisionRef, released.targetRevisionRef) || registration.kind === "route" && (Boolean(registration.releaseRevisionRef) !== Boolean(released.releaseRevisionRef) || registration.releaseRevisionRef && released.releaseRevisionRef && !sameRevisionRef(registration.releaseRevisionRef, released.releaseRevisionRef))) {
|
|
16407
16505
|
throw new DeclarativeControlCompilationError("NAV_TARGET_UNRELEASED", `nodes[${index}].targetRef`, "Navigation target is not resolved to the exact active release recorded by NavigationRelease.");
|
|
16408
16506
|
}
|
|
@@ -16532,6 +16630,16 @@ var resolveWorkbenchEntry = (input) => {
|
|
|
16532
16630
|
return { status: "forbidden", workbenchId: "" };
|
|
16533
16631
|
};
|
|
16534
16632
|
|
|
16633
|
+
// src/runtime/navigation-availability.ts
|
|
16634
|
+
var NAVIGATION_UNAVAILABLE_CAPABILITY_HEADER = "x-monkeys-navigation-capabilities";
|
|
16635
|
+
var NAVIGATION_UNAVAILABLE_CAPABILITY = "unavailable-pages-v1";
|
|
16636
|
+
function projectNavigationCompatibility(bundle, supportsUnavailable) {
|
|
16637
|
+
if (supportsUnavailable || !bundle.nodes.some((node) => node.kind === "target" && node.resolvedTarget.kind === "unavailable")) return bundle;
|
|
16638
|
+
const { contentHash: _hash, ...unsigned } = bundle;
|
|
16639
|
+
const nodes = bundle.nodes.filter((node) => node.kind !== "target" || node.resolvedTarget.kind !== "unavailable");
|
|
16640
|
+
return NavigationRuntimeBundleSchema.parse({ ...unsigned, nodes, contentHash: canonicalContentHash({ ...unsigned, nodes }) });
|
|
16641
|
+
}
|
|
16642
|
+
|
|
16535
16643
|
// src/runtime/menu-compiler.ts
|
|
16536
16644
|
var MenuCompilationError = class extends Error {
|
|
16537
16645
|
constructor(code, path, message) {
|
|
@@ -16804,6 +16912,13 @@ var compileMenuRuntimeBundle = (input) => {
|
|
|
16804
16912
|
const contributionProviders = input.contributionProviders.map((registration) => MenuContributionProviderRegistrationSchema.parse(registration));
|
|
16805
16913
|
const inputValidators = input.inputValidators ?? /* @__PURE__ */ new Map();
|
|
16806
16914
|
const knownPermissions = new Set(input.permissionCodes.map((permission) => ContractIdentifierSchema.parse(permission)));
|
|
16915
|
+
const completeApplications = new Set(input.missingPagePolicy?.completeApplicationIds.map((id) => ContractIdentifierSchema.parse(id)) ?? []);
|
|
16916
|
+
const unavailableAccess = input.missingPagePolicy ? MenuAccessRequirementSchema.parse(input.missingPagePolicy.unavailableAccess) : void 0;
|
|
16917
|
+
if (unavailableAccess) {
|
|
16918
|
+
validatePermissionCodes(unavailableAccess.permissionAllOf, knownPermissions, "missingPagePolicy.unavailableAccess.permissionAllOf");
|
|
16919
|
+
validatePermissionCodes(unavailableAccess.permissionAnyOf, knownPermissions, "missingPagePolicy.unavailableAccess.permissionAnyOf");
|
|
16920
|
+
}
|
|
16921
|
+
const diagnostics = [];
|
|
16807
16922
|
pages.forEach((registration, index) => {
|
|
16808
16923
|
if (!registration.page.visibility.productContexts.some((context) => context === registration.applicationId)) {
|
|
16809
16924
|
throw new MenuCompilationError(
|
|
@@ -16868,6 +16983,35 @@ var compileMenuRuntimeBundle = (input) => {
|
|
|
16868
16983
|
if (node.behavior.kind === "navigate") {
|
|
16869
16984
|
const registration = pagesByKey.get(pageKey(node.behavior.page));
|
|
16870
16985
|
if (!registration) {
|
|
16986
|
+
if (unavailableAccess && completeApplications.has(node.behavior.page.applicationId)) {
|
|
16987
|
+
const activationId2 = resolveMenuActivationId(node.behavior.page, node.behavior.activationId);
|
|
16988
|
+
const identity2 = targetKey(node.behavior.page, activationId2);
|
|
16989
|
+
const signature2 = stableSerialize2({ ...node.behavior, activationId: activationId2 });
|
|
16990
|
+
const previous = targetSourceSignatures.get(identity2);
|
|
16991
|
+
if (previous !== void 0 && previous !== signature2) {
|
|
16992
|
+
throw new MenuCompilationError("conflicting-navigation-target", `${nodePath}.behavior`, "Missing navigation target has conflicting behavior or input.");
|
|
16993
|
+
}
|
|
16994
|
+
targetSourceSignatures.set(identity2, signature2);
|
|
16995
|
+
if (definition.applicationId === applicationId) {
|
|
16996
|
+
diagnostics.push({
|
|
16997
|
+
code: "missing-page",
|
|
16998
|
+
severity: "warning",
|
|
16999
|
+
applicationId: definition.applicationId,
|
|
17000
|
+
surface: definition.surface,
|
|
17001
|
+
menuId: definition.menuId,
|
|
17002
|
+
nodeId: node.nodeId,
|
|
17003
|
+
page: node.behavior.page,
|
|
17004
|
+
path: `${nodePath}.behavior.page`
|
|
17005
|
+
});
|
|
17006
|
+
}
|
|
17007
|
+
const { requiredPermission: requiredPermission3, behavior: _behavior3, ...presentation3 } = node;
|
|
17008
|
+
return CompiledMenuItemNodeSchema.parse({
|
|
17009
|
+
...presentation3,
|
|
17010
|
+
disabled: true,
|
|
17011
|
+
behavior: { kind: "navigate", page: node.behavior.page, activationId: activationId2 },
|
|
17012
|
+
access: { ...unavailableAccess, requiredPermission: requiredPermission3 }
|
|
17013
|
+
});
|
|
17014
|
+
}
|
|
16871
17015
|
throw new MenuCompilationError(
|
|
16872
17016
|
"unknown-page",
|
|
16873
17017
|
`${nodePath}.behavior.page`,
|
|
@@ -17030,6 +17174,7 @@ var compileMenuRuntimeBundle = (input) => {
|
|
|
17030
17174
|
};
|
|
17031
17175
|
return Object.freeze({
|
|
17032
17176
|
document: deepFreeze2(document),
|
|
17177
|
+
diagnostics: deepFreeze2(diagnostics),
|
|
17033
17178
|
menusByKey,
|
|
17034
17179
|
navigationTargetsByKey: documentTargetsByKey,
|
|
17035
17180
|
serverInputByTargetKey,
|
|
@@ -17714,6 +17859,49 @@ var compileWorkflowPersistenceProjection = (input) => {
|
|
|
17714
17859
|
});
|
|
17715
17860
|
};
|
|
17716
17861
|
|
|
17862
|
+
// src/runtime/workflow-column.ts
|
|
17863
|
+
function parseWorkflowColumnBinding(value) {
|
|
17864
|
+
const binding = WorkflowColumnBindingSchema.parse(value);
|
|
17865
|
+
if (Object.keys(binding.inputs).length > 100)
|
|
17866
|
+
throw new Error("Workflow column supports at most 100 input bindings.");
|
|
17867
|
+
if (binding.policy.maxDelayMs < binding.policy.debounceMs)
|
|
17868
|
+
throw new Error("Workflow column maxDelayMs must be at least debounceMs.");
|
|
17869
|
+
for (const name of Object.keys(binding.inputs)) {
|
|
17870
|
+
if (name !== name.trim() || name.startsWith("__") || name === "constructor" || name === "prototype") {
|
|
17871
|
+
throw new Error(`Invalid Workflow input name: ${name}`);
|
|
17872
|
+
}
|
|
17873
|
+
}
|
|
17874
|
+
return binding;
|
|
17875
|
+
}
|
|
17876
|
+
function selectOwnValue(payload, path) {
|
|
17877
|
+
let value = payload;
|
|
17878
|
+
for (const key of path) {
|
|
17879
|
+
if (value === null || typeof value !== "object" || !Object.prototype.hasOwnProperty.call(value, key)) {
|
|
17880
|
+
throw new Error(`Workflow output is missing the configured path: ${JSON.stringify(path)}`);
|
|
17881
|
+
}
|
|
17882
|
+
value = value[key];
|
|
17883
|
+
}
|
|
17884
|
+
if (value === void 0) throw new Error("Workflow output is absent.");
|
|
17885
|
+
return value;
|
|
17886
|
+
}
|
|
17887
|
+
function resolveWorkflowColumnResult(binding, payload, nowMs = Date.now()) {
|
|
17888
|
+
const selected = selectOwnValue(payload, binding.output.path);
|
|
17889
|
+
if (selected === null && !binding.output.nullable)
|
|
17890
|
+
throw new Error("Workflow output is null but this column does not allow null results.");
|
|
17891
|
+
if (selected !== null) {
|
|
17892
|
+
if (binding.output.type === "number" && (typeof selected !== "number" || !Number.isFinite(selected)))
|
|
17893
|
+
throw new Error("Workflow output must be a finite number.");
|
|
17894
|
+
if (binding.output.type === "text" && typeof selected !== "string")
|
|
17895
|
+
throw new Error("Workflow output must be text.");
|
|
17896
|
+
}
|
|
17897
|
+
const value = JsonValueSchema.parse(selected);
|
|
17898
|
+
if (!binding.expiry) return { value };
|
|
17899
|
+
const expiresAt = IsoDateTimeSchema.parse(selectOwnValue(payload, binding.expiry.path));
|
|
17900
|
+
if (!Number.isFinite(nowMs) || Date.parse(expiresAt) <= nowMs)
|
|
17901
|
+
throw new Error("Workflow expiry must be a future datetime.");
|
|
17902
|
+
return { value, expiresAt };
|
|
17903
|
+
}
|
|
17904
|
+
|
|
17717
17905
|
// src/runtime/access-compiler.ts
|
|
17718
17906
|
var uniqueBy = (values, key, label) => {
|
|
17719
17907
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -18033,6 +18221,8 @@ export {
|
|
|
18033
18221
|
MenuRuntimeBundleSchema,
|
|
18034
18222
|
MenuRuntimeInputBindingSchema,
|
|
18035
18223
|
MenuSourceInputBindingSchema,
|
|
18224
|
+
NAVIGATION_UNAVAILABLE_CAPABILITY,
|
|
18225
|
+
NAVIGATION_UNAVAILABLE_CAPABILITY_HEADER,
|
|
18036
18226
|
NavigationGroupNodeSchema,
|
|
18037
18227
|
NavigationNodeSchema,
|
|
18038
18228
|
NavigationReleaseSchema,
|
|
@@ -18167,6 +18357,7 @@ export {
|
|
|
18167
18357
|
TrendRadarCollectionSubjectRefSchema,
|
|
18168
18358
|
TrendSourceRecordSchema,
|
|
18169
18359
|
TrendSourceSchema,
|
|
18360
|
+
UnavailableNavigationTargetSchema,
|
|
18170
18361
|
ValidationIssueType,
|
|
18171
18362
|
ValidationReasonType,
|
|
18172
18363
|
ViewProviderDescriptorSchema,
|
|
@@ -18177,6 +18368,12 @@ export {
|
|
|
18177
18368
|
WorkbenchRuntimeBundleSchema,
|
|
18178
18369
|
WorkbenchSchema,
|
|
18179
18370
|
WorkflowCatalogEntrySchema,
|
|
18371
|
+
WorkflowColumnBindingSchema,
|
|
18372
|
+
WorkflowColumnDependencySchema,
|
|
18373
|
+
WorkflowColumnFieldRefSchema,
|
|
18374
|
+
WorkflowColumnInputSchema,
|
|
18375
|
+
WorkflowColumnOutputPathSchema,
|
|
18376
|
+
WorkflowColumnOutputSchema,
|
|
18180
18377
|
WorkflowCompletionCommitSchema,
|
|
18181
18378
|
WorkflowCompletionReceiptSchema,
|
|
18182
18379
|
WorkflowDefinitionSchema,
|
|
@@ -18245,7 +18442,9 @@ export {
|
|
|
18245
18442
|
normalizeAgentMode,
|
|
18246
18443
|
normalizeStudioAgentMode,
|
|
18247
18444
|
parseApplicationHandoff,
|
|
18445
|
+
parseWorkflowColumnBinding,
|
|
18248
18446
|
projectAgentSessionEvents,
|
|
18447
|
+
projectNavigationCompatibility,
|
|
18249
18448
|
publishOpenApiToolCapabilityManifests,
|
|
18250
18449
|
readApplicationHandoffFromUrl,
|
|
18251
18450
|
readMenuActivationFromSearch,
|
|
@@ -18254,6 +18453,7 @@ export {
|
|
|
18254
18453
|
resolveMenuActivationId,
|
|
18255
18454
|
resolveThemeTokens,
|
|
18256
18455
|
resolveWorkbenchEntry,
|
|
18456
|
+
resolveWorkflowColumnResult,
|
|
18257
18457
|
revisionRefKey,
|
|
18258
18458
|
sameRevisionRef,
|
|
18259
18459
|
sameStableRef,
|