@inf-monkeys-tech/monkeys 1.1.17 → 1.1.19
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 +20 -0
- package/lib/contracts/action-program-http.d.ts +1021 -0
- package/lib/contracts/action-program-http.d.ts.map +1 -0
- package/lib/contracts/action-program-http.js +42 -0
- package/lib/contracts/action-program-http.js.map +1 -0
- package/lib/contracts/declarative-control-http.d.ts +11365 -18
- package/lib/contracts/declarative-control-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control.d.ts +3263 -1022
- package/lib/contracts/declarative-control.d.ts.map +1 -1
- package/lib/contracts/declarative-control.js +278 -5
- package/lib/contracts/declarative-control.js.map +1 -1
- package/lib/contracts/declarative-publication-job.d.ts +3356 -8
- package/lib/contracts/declarative-publication-job.d.ts.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/esm/contracts/index.mjs +342 -3
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +696 -31
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +646 -31
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +4088 -3797
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/action-program-artifact.schema.json +1226 -0
- package/lib/json-schema/action-program-definition.schema.json +1205 -0
- package/lib/json-schema/index.json +2 -0
- package/lib/json-schema/navigation-release.schema.json +1 -0
- package/lib/json-schema/navigation-runtime-bundle.schema.json +1 -0
- package/lib/json-schema/page-release.schema.json +1 -0
- package/lib/json-schema/page-runtime-bundle.schema.json +2436 -0
- package/lib/json-schema/page.schema.json +941 -0
- package/lib/json-schema/workbench-release.schema.json +1 -0
- package/lib/json-schema/workbench-runtime-bundle.schema.json +1 -0
- package/lib/runtime/action-program-author.d.ts +40 -0
- package/lib/runtime/action-program-author.d.ts.map +1 -0
- package/lib/runtime/action-program-author.js +178 -0
- package/lib/runtime/action-program-author.js.map +1 -0
- package/lib/runtime/declarative-control-compiler.d.ts +9 -1
- package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
- package/lib/runtime/declarative-control-compiler.js +123 -7
- package/lib/runtime/declarative-control-compiler.js.map +1 -1
- package/lib/runtime/declarative-runtime-contract.d.ts.map +1 -1
- package/lib/runtime/declarative-runtime-contract.js +46 -2
- package/lib/runtime/declarative-runtime-contract.js.map +1 -1
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/schemas/index.d.ts +2216 -1232
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +116 -111
- package/lib/schemas/index.js.map +1 -1
- package/package.json +4 -2
|
@@ -9576,6 +9576,7 @@ var ReleaseDependencyRoleSchema = z15.enum([
|
|
|
9576
9576
|
"view",
|
|
9577
9577
|
"projection",
|
|
9578
9578
|
"action",
|
|
9579
|
+
"action-program",
|
|
9579
9580
|
"token",
|
|
9580
9581
|
"schema",
|
|
9581
9582
|
"compiler",
|
|
@@ -9606,6 +9607,7 @@ var DependencyKindByRole = {
|
|
|
9606
9607
|
view: "view",
|
|
9607
9608
|
projection: "projection",
|
|
9608
9609
|
action: "domain-command",
|
|
9610
|
+
"action-program": "action-program",
|
|
9609
9611
|
token: "design-token",
|
|
9610
9612
|
schema: "schema",
|
|
9611
9613
|
compiler: "compiler",
|
|
@@ -10558,8 +10560,14 @@ var QueryBindingSchema = z15.object({
|
|
|
10558
10560
|
}).strict().superRefine((value, context) => {
|
|
10559
10561
|
if (value.draftRetention) {
|
|
10560
10562
|
const names = value.draftRetention.identityParameters;
|
|
10561
|
-
if (value.execution !== "server" || new Set(names).size !== names.length || names.some(
|
|
10562
|
-
|
|
10563
|
+
if (value.execution !== "server" || new Set(names).size !== names.length || names.some(
|
|
10564
|
+
(name) => !Object.prototype.hasOwnProperty.call(value.parameters, name)
|
|
10565
|
+
)) {
|
|
10566
|
+
context.addIssue({
|
|
10567
|
+
code: "custom",
|
|
10568
|
+
path: ["draftRetention"],
|
|
10569
|
+
message: "Draft retention requires distinct declared Server query identity parameters."
|
|
10570
|
+
});
|
|
10563
10571
|
}
|
|
10564
10572
|
}
|
|
10565
10573
|
if (value.targetProjection) {
|
|
@@ -11253,6 +11261,237 @@ var PageDataSchema = QueryBindingSchema.omit({
|
|
|
11253
11261
|
cursorWindow: PageCursorWindowSchema.optional(),
|
|
11254
11262
|
resultStateBindings: z15.array(PageResultStateBindingSchema).max(32).optional()
|
|
11255
11263
|
}).strict();
|
|
11264
|
+
var ACTION_PROGRAM_ABI = "monkeys.action-program/2";
|
|
11265
|
+
var ActionProgramBudgetsSchema = z15.object({
|
|
11266
|
+
rpcMs: z15.number().int().positive().max(3e4),
|
|
11267
|
+
concurrentCalls: z15.number().int().positive().max(4),
|
|
11268
|
+
calls: z15.number().int().positive().max(128),
|
|
11269
|
+
messageBytes: z15.number().int().positive().max(1048576),
|
|
11270
|
+
activeMs: z15.number().int().positive().max(12e4),
|
|
11271
|
+
formMs: z15.number().int().positive().max(3e5),
|
|
11272
|
+
wallMs: z15.number().int().positive().max(6e5)
|
|
11273
|
+
}).strict();
|
|
11274
|
+
var DEFAULT_ACTION_PROGRAM_BUDGETS = Object.freeze({
|
|
11275
|
+
rpcMs: 3e4,
|
|
11276
|
+
concurrentCalls: 4,
|
|
11277
|
+
calls: 128,
|
|
11278
|
+
messageBytes: 1048576,
|
|
11279
|
+
activeMs: 12e4,
|
|
11280
|
+
formMs: 3e5,
|
|
11281
|
+
wallMs: 6e5
|
|
11282
|
+
});
|
|
11283
|
+
var ProgramSchemaRefSchema = RevisionRefSchema.refine(
|
|
11284
|
+
(ref) => ref.kind === "schema",
|
|
11285
|
+
"Expected an exact Schema reference."
|
|
11286
|
+
);
|
|
11287
|
+
var ActionProgramDependencySchema = z15.object({
|
|
11288
|
+
kind: z15.enum(["query", "command"]),
|
|
11289
|
+
revisionRef: RevisionRefSchema,
|
|
11290
|
+
inputSchemaRevisionRef: ProgramSchemaRefSchema,
|
|
11291
|
+
resultSchemaRevisionRef: ProgramSchemaRefSchema,
|
|
11292
|
+
download: ActionBindingSchema.shape.success.shape.download,
|
|
11293
|
+
// Fixed/identity arguments are injected by the trusted caller, never by guest code.
|
|
11294
|
+
dynamicInputKeys: z15.array(ContractIdentifierSchema).max(128)
|
|
11295
|
+
}).strict().superRefine((value, context) => {
|
|
11296
|
+
const expected = value.kind === "query" ? "domain-query-definition" : "domain-command";
|
|
11297
|
+
if (value.revisionRef.kind !== expected)
|
|
11298
|
+
context.addIssue({
|
|
11299
|
+
code: "custom",
|
|
11300
|
+
path: ["revisionRef", "kind"],
|
|
11301
|
+
message: `Expected ${expected}.`
|
|
11302
|
+
});
|
|
11303
|
+
if (new Set(value.dynamicInputKeys).size !== value.dynamicInputKeys.length)
|
|
11304
|
+
context.addIssue({
|
|
11305
|
+
code: "custom",
|
|
11306
|
+
path: ["dynamicInputKeys"],
|
|
11307
|
+
message: "Dynamic input keys must be unique."
|
|
11308
|
+
});
|
|
11309
|
+
});
|
|
11310
|
+
var ActionProgramDefinitionSchema = z15.object({
|
|
11311
|
+
contract: z15.literal("ActionProgramDefinition"),
|
|
11312
|
+
schemaVersion: z15.literal(1),
|
|
11313
|
+
programId: ContractIdentifierSchema,
|
|
11314
|
+
ownerRepo: ContractIdentifierSchema,
|
|
11315
|
+
tenantScope: TenantScopeSchema,
|
|
11316
|
+
supportedSurface: z15.literal("studio"),
|
|
11317
|
+
inputSchemaRevisionRef: ProgramSchemaRefSchema,
|
|
11318
|
+
resultSchemaRevisionRef: ProgramSchemaRefSchema,
|
|
11319
|
+
entry: z15.literal("main"),
|
|
11320
|
+
abi: z15.literal(ACTION_PROGRAM_ABI),
|
|
11321
|
+
compiler: z15.string().trim().min(1).max(128),
|
|
11322
|
+
target: z15.literal("browser-worker-es2020"),
|
|
11323
|
+
sourceHash: Sha256Schema,
|
|
11324
|
+
compiledHash: Sha256Schema,
|
|
11325
|
+
sourceMapHash: Sha256Schema,
|
|
11326
|
+
dependencies: z15.array(ActionProgramDependencySchema).max(128),
|
|
11327
|
+
effects: z15.array(
|
|
11328
|
+
z15.enum([
|
|
11329
|
+
"form",
|
|
11330
|
+
"toast",
|
|
11331
|
+
"refresh",
|
|
11332
|
+
"download",
|
|
11333
|
+
"state.get",
|
|
11334
|
+
"state.set"
|
|
11335
|
+
])
|
|
11336
|
+
).max(6),
|
|
11337
|
+
refreshAliases: z15.array(ContractIdentifierSchema).max(128),
|
|
11338
|
+
stateAliases: z15.array(
|
|
11339
|
+
z15.object({
|
|
11340
|
+
alias: ContractIdentifierSchema,
|
|
11341
|
+
schemaRevisionRef: ProgramSchemaRefSchema
|
|
11342
|
+
}).strict()
|
|
11343
|
+
).max(128),
|
|
11344
|
+
budgets: ActionProgramBudgetsSchema
|
|
11345
|
+
}).strict().superRefine((value, context) => {
|
|
11346
|
+
for (const [name, keys] of [
|
|
11347
|
+
[
|
|
11348
|
+
"dependencies",
|
|
11349
|
+
value.dependencies.map((dep) => `${dep.kind}:${dep.revisionRef.id}`)
|
|
11350
|
+
],
|
|
11351
|
+
["effects", value.effects],
|
|
11352
|
+
["refreshAliases", value.refreshAliases],
|
|
11353
|
+
["stateAliases", value.stateAliases.map((entry) => entry.alias)]
|
|
11354
|
+
])
|
|
11355
|
+
if (new Set(keys).size !== keys.length)
|
|
11356
|
+
context.addIssue({
|
|
11357
|
+
code: "custom",
|
|
11358
|
+
path: [name],
|
|
11359
|
+
message: "Program declarations must be unique."
|
|
11360
|
+
});
|
|
11361
|
+
const refs = [
|
|
11362
|
+
value.inputSchemaRevisionRef,
|
|
11363
|
+
value.resultSchemaRevisionRef,
|
|
11364
|
+
...value.dependencies.flatMap((dep) => [
|
|
11365
|
+
dep.revisionRef,
|
|
11366
|
+
dep.inputSchemaRevisionRef,
|
|
11367
|
+
dep.resultSchemaRevisionRef
|
|
11368
|
+
]),
|
|
11369
|
+
...value.stateAliases.map((entry) => entry.schemaRevisionRef)
|
|
11370
|
+
];
|
|
11371
|
+
refs.forEach((ref, index) => {
|
|
11372
|
+
if (ref.visibility === "tenant" && ref.tenantScope && tenantScopeKey(ref.tenantScope) !== tenantScopeKey(value.tenantScope))
|
|
11373
|
+
context.addIssue({
|
|
11374
|
+
code: "custom",
|
|
11375
|
+
path: ["dependencies"],
|
|
11376
|
+
message: `Cross-tenant program reference ${index}.`
|
|
11377
|
+
});
|
|
11378
|
+
});
|
|
11379
|
+
});
|
|
11380
|
+
var ActionProgramArtifactSchema = z15.object({
|
|
11381
|
+
definition: ActionProgramDefinitionSchema,
|
|
11382
|
+
// Hashes use canonicalContentHash of the exact UTF-8 string, not engine bytecode.
|
|
11383
|
+
javascript: z15.string().min(1).max(262144).refine(
|
|
11384
|
+
(value) => new TextEncoder().encode(value).length <= 262144,
|
|
11385
|
+
"Program exceeds 256 KiB."
|
|
11386
|
+
),
|
|
11387
|
+
sourceMap: z15.string().min(1).max(524288).refine(
|
|
11388
|
+
(value) => new TextEncoder().encode(value).length <= 524288,
|
|
11389
|
+
"Source map exceeds 512 KiB."
|
|
11390
|
+
)
|
|
11391
|
+
}).strict();
|
|
11392
|
+
var ProgramInputSourceSchema = z15.discriminatedUnion("kind", [
|
|
11393
|
+
...BindingSourceSchema.options,
|
|
11394
|
+
ExpressionBindingSourceSchema
|
|
11395
|
+
]);
|
|
11396
|
+
var ProgramBindingShape = {
|
|
11397
|
+
bindingId: ContractIdentifierSchema,
|
|
11398
|
+
inputMapping: z15.record(ContractIdentifierSchema, ProgramInputSourceSchema),
|
|
11399
|
+
dependencyInputs: z15.record(
|
|
11400
|
+
ContractIdentifierSchema,
|
|
11401
|
+
z15.record(ContractIdentifierSchema, ProgramInputSourceSchema)
|
|
11402
|
+
),
|
|
11403
|
+
accessPolicy: AccessPolicySchema,
|
|
11404
|
+
confirmation: I18nTextSchema.optional(),
|
|
11405
|
+
when: PageExpressionSchema.optional(),
|
|
11406
|
+
concurrencyKeyPath: PageValuePathSchema.min(1),
|
|
11407
|
+
refreshAliases: z15.record(
|
|
11408
|
+
ContractIdentifierSchema,
|
|
11409
|
+
z15.array(ContractIdentifierSchema).min(1).max(128)
|
|
11410
|
+
),
|
|
11411
|
+
stateAliases: z15.record(ContractIdentifierSchema, ContractIdentifierSchema)
|
|
11412
|
+
};
|
|
11413
|
+
var PageProgramActionSchema = z15.object({
|
|
11414
|
+
...ProgramBindingShape,
|
|
11415
|
+
program: ContractIdentifierSchema,
|
|
11416
|
+
port: ContractIdentifierSchema
|
|
11417
|
+
}).strict();
|
|
11418
|
+
var ProgramBindingSchema = z15.object({
|
|
11419
|
+
...ProgramBindingShape,
|
|
11420
|
+
source: z15.object({
|
|
11421
|
+
capabilityInstanceId: ContractIdentifierSchema,
|
|
11422
|
+
port: ContractIdentifierSchema
|
|
11423
|
+
}).strict(),
|
|
11424
|
+
sourceIntentSchemaRevisionRef: ProgramSchemaRefSchema,
|
|
11425
|
+
programRevisionRef: RevisionRefSchema.refine(
|
|
11426
|
+
(ref) => ref.kind === "action-program",
|
|
11427
|
+
"Expected action-program reference."
|
|
11428
|
+
),
|
|
11429
|
+
definition: ActionProgramDefinitionSchema
|
|
11430
|
+
}).strict();
|
|
11431
|
+
function validateProgramBindingTargets(page, context) {
|
|
11432
|
+
const ids = new Set(page.actionBindings.map((binding) => binding.bindingId));
|
|
11433
|
+
const ports = new Set(
|
|
11434
|
+
page.actionBindings.map(
|
|
11435
|
+
(binding) => `${binding.source.capabilityInstanceId}:${binding.source.port}`
|
|
11436
|
+
)
|
|
11437
|
+
);
|
|
11438
|
+
const dataIds = new Set(
|
|
11439
|
+
[...page.ontologyBindings, ...page.queryBindings ?? []].map(
|
|
11440
|
+
(binding) => binding.bindingId
|
|
11441
|
+
)
|
|
11442
|
+
);
|
|
11443
|
+
for (const [index, binding] of (page.programBindings ?? []).entries()) {
|
|
11444
|
+
const issue = (message) => context.addIssue({
|
|
11445
|
+
code: "custom",
|
|
11446
|
+
path: ["programBindings", index],
|
|
11447
|
+
message
|
|
11448
|
+
});
|
|
11449
|
+
const port = `${binding.source.capabilityInstanceId}:${binding.source.port}`;
|
|
11450
|
+
if (ids.has(binding.bindingId) || ports.has(port))
|
|
11451
|
+
issue("Program binding id and event must be exclusive.");
|
|
11452
|
+
ids.add(binding.bindingId);
|
|
11453
|
+
ports.add(port);
|
|
11454
|
+
if (!page.capabilityInstances.some(
|
|
11455
|
+
(instance) => instance.instanceId === binding.source.capabilityInstanceId
|
|
11456
|
+
))
|
|
11457
|
+
issue("Program source instance is missing.");
|
|
11458
|
+
const exactKeys = (keys, expected) => keys.length === expected.length && keys.every((key) => expected.includes(key));
|
|
11459
|
+
if (!exactKeys(
|
|
11460
|
+
Object.keys(binding.refreshAliases),
|
|
11461
|
+
binding.definition.refreshAliases
|
|
11462
|
+
) || Object.values(binding.refreshAliases).some(
|
|
11463
|
+
(targets) => targets.some((target) => !dataIds.has(target))
|
|
11464
|
+
))
|
|
11465
|
+
issue(
|
|
11466
|
+
"Program refresh aliases must resolve exactly to declared data bindings."
|
|
11467
|
+
);
|
|
11468
|
+
if (!exactKeys(
|
|
11469
|
+
Object.keys(binding.stateAliases),
|
|
11470
|
+
binding.definition.stateAliases.map((entry) => entry.alias)
|
|
11471
|
+
))
|
|
11472
|
+
issue("Program state aliases must match its manifest.");
|
|
11473
|
+
for (const entry of binding.definition.stateAliases) {
|
|
11474
|
+
const state = page.stateDefinitions?.find(
|
|
11475
|
+
(state2) => state2.stateId === binding.stateAliases[entry.alias]
|
|
11476
|
+
);
|
|
11477
|
+
if (!state || !exactRevisionRef(state.schemaRevisionRef, entry.schemaRevisionRef))
|
|
11478
|
+
issue("Program state alias has an incompatible Schema.");
|
|
11479
|
+
}
|
|
11480
|
+
const dependencyIds = binding.definition.dependencies.map(
|
|
11481
|
+
(dep) => dep.revisionRef.id
|
|
11482
|
+
);
|
|
11483
|
+
if (!Object.keys(binding.dependencyInputs).every(
|
|
11484
|
+
(key) => dependencyIds.includes(key)
|
|
11485
|
+
))
|
|
11486
|
+
issue("Unknown program dependency input mapping.");
|
|
11487
|
+
for (const dep of binding.definition.dependencies) {
|
|
11488
|
+
if (Object.keys(binding.dependencyInputs[dep.revisionRef.id] ?? {}).some(
|
|
11489
|
+
(key) => dep.dynamicInputKeys.includes(key)
|
|
11490
|
+
))
|
|
11491
|
+
issue("Fixed dependency arguments cannot also be guest-writable.");
|
|
11492
|
+
}
|
|
11493
|
+
}
|
|
11494
|
+
}
|
|
11256
11495
|
var PageActionSchema = ActionBindingSchema.omit({
|
|
11257
11496
|
commandRevisionRef: true,
|
|
11258
11497
|
source: true,
|
|
@@ -11295,6 +11534,7 @@ var PageNodeSchema = z15.lazy(
|
|
|
11295
11534
|
}).strict().optional(),
|
|
11296
11535
|
data: z15.array(PageDataSchema).optional(),
|
|
11297
11536
|
actions: z15.array(PageActionSchema).optional(),
|
|
11537
|
+
programActions: z15.array(PageProgramActionSchema).max(128).optional(),
|
|
11298
11538
|
on: z15.array(PageInteractionSchema).optional(),
|
|
11299
11539
|
effects: z15.array(PageEventEffectSchema).optional(),
|
|
11300
11540
|
eventPayloads: z15.array(
|
|
@@ -11373,6 +11613,7 @@ var PageSchema = z15.object({
|
|
|
11373
11613
|
for (const [field, values, target] of [
|
|
11374
11614
|
["data", node.data ?? [], dataIds],
|
|
11375
11615
|
["actions", node.actions ?? [], actionIds],
|
|
11616
|
+
["programActions", node.programActions ?? [], actionIds],
|
|
11376
11617
|
["on", node.on ?? [], interactionIds]
|
|
11377
11618
|
])
|
|
11378
11619
|
for (const [index, value] of values.entries()) {
|
|
@@ -11426,6 +11667,7 @@ var ResolvedPageSchema = z15.object({
|
|
|
11426
11667
|
ontologyBindings: z15.array(PersistedOntologyBindingSchema),
|
|
11427
11668
|
queryBindings: z15.array(QueryBindingSchema).optional(),
|
|
11428
11669
|
actionBindings: z15.array(ActionBindingSchema),
|
|
11670
|
+
programBindings: z15.array(ProgramBindingSchema).max(128).optional(),
|
|
11429
11671
|
pageAccessPolicy: AccessPolicySchema,
|
|
11430
11672
|
managementAccess: ManagementAccessSchema,
|
|
11431
11673
|
tokenRevisionRefs: z15.array(RevisionRefSchema).min(1),
|
|
@@ -11438,6 +11680,7 @@ var ResolvedPageSchema = z15.object({
|
|
|
11438
11680
|
"restricted"
|
|
11439
11681
|
])
|
|
11440
11682
|
}).strict().superRefine((value, context) => {
|
|
11683
|
+
validateProgramBindingTargets(value, context);
|
|
11441
11684
|
validateDeclaredRouteSurfaces(
|
|
11442
11685
|
value.supportedSurfaces,
|
|
11443
11686
|
value.routeClaims,
|
|
@@ -11795,6 +12038,35 @@ var ResolvedPageSchema = z15.object({
|
|
|
11795
12038
|
)
|
|
11796
12039
|
);
|
|
11797
12040
|
}
|
|
12041
|
+
(value.programBindings ?? []).forEach((binding, index) => {
|
|
12042
|
+
const scopes = scopesForNode(
|
|
12043
|
+
instanceNodes.get(binding.source.capabilityInstanceId)
|
|
12044
|
+
);
|
|
12045
|
+
checkScopedSources(binding.inputMapping, scopes, [
|
|
12046
|
+
"programBindings",
|
|
12047
|
+
index,
|
|
12048
|
+
"inputMapping"
|
|
12049
|
+
]);
|
|
12050
|
+
for (const [id, mapping] of Object.entries(binding.dependencyInputs))
|
|
12051
|
+
checkScopedSources(mapping, scopes, [
|
|
12052
|
+
"programBindings",
|
|
12053
|
+
index,
|
|
12054
|
+
"dependencyInputs",
|
|
12055
|
+
id
|
|
12056
|
+
]);
|
|
12057
|
+
if (binding.when) {
|
|
12058
|
+
const reads = collectPageExpressionReads(binding.when);
|
|
12059
|
+
checkScopedReads(reads, scopes, ["programBindings", index, "when"]);
|
|
12060
|
+
if (reads.some(
|
|
12061
|
+
(read) => read.root === "state" && !stateIds.has(read.path[0])
|
|
12062
|
+
))
|
|
12063
|
+
context.addIssue({
|
|
12064
|
+
code: "custom",
|
|
12065
|
+
path: ["programBindings", index, "when"],
|
|
12066
|
+
message: "Program condition references an unknown Page state."
|
|
12067
|
+
});
|
|
12068
|
+
}
|
|
12069
|
+
});
|
|
11798
12070
|
value.actionBindings.forEach((binding, index) => {
|
|
11799
12071
|
const scopes = scopesForNode(
|
|
11800
12072
|
instanceNodes.get(binding.source.capabilityInstanceId)
|
|
@@ -12375,7 +12647,10 @@ var ResolvedPageSchema = z15.object({
|
|
|
12375
12647
|
const conflictingInteraction = interactionBindings.some(
|
|
12376
12648
|
(candidate) => candidate.source.capabilityInstanceId === sourceId && candidate.source.port === binding.cursorWindow.pageChangePort
|
|
12377
12649
|
);
|
|
12378
|
-
const conflictingAction =
|
|
12650
|
+
const conflictingAction = [
|
|
12651
|
+
...value.actionBindings,
|
|
12652
|
+
...value.programBindings ?? []
|
|
12653
|
+
].some(
|
|
12379
12654
|
(candidate) => candidate.source.capabilityInstanceId === sourceId && candidate.source.port === binding.cursorWindow.pageChangePort
|
|
12380
12655
|
);
|
|
12381
12656
|
if (conflictingInteraction || conflictingAction) {
|
|
@@ -12386,6 +12661,20 @@ var ResolvedPageSchema = z15.object({
|
|
|
12386
12661
|
});
|
|
12387
12662
|
}
|
|
12388
12663
|
});
|
|
12664
|
+
(value.programBindings ?? []).forEach((binding, index) => {
|
|
12665
|
+
validatePageStateSources(binding.inputMapping, [
|
|
12666
|
+
"programBindings",
|
|
12667
|
+
index,
|
|
12668
|
+
"inputMapping"
|
|
12669
|
+
]);
|
|
12670
|
+
for (const [id, mapping] of Object.entries(binding.dependencyInputs))
|
|
12671
|
+
validatePageStateSources(mapping, [
|
|
12672
|
+
"programBindings",
|
|
12673
|
+
index,
|
|
12674
|
+
"dependencyInputs",
|
|
12675
|
+
id
|
|
12676
|
+
]);
|
|
12677
|
+
});
|
|
12389
12678
|
value.actionBindings.forEach((binding, index) => {
|
|
12390
12679
|
if (!instanceIds.has(binding.source.capabilityInstanceId)) {
|
|
12391
12680
|
context.addIssue({
|
|
@@ -13226,6 +13515,7 @@ var CompatiblePageRuntimeBundleSchema = z15.object({
|
|
|
13226
13515
|
ontologyBindings: z15.array(PersistedOntologyBindingSchema),
|
|
13227
13516
|
queryBindings: z15.array(QueryBindingSchema).default([]),
|
|
13228
13517
|
actionBindings: z15.array(ActionBindingSchema),
|
|
13518
|
+
programBindings: z15.array(ProgramBindingSchema).max(128).optional(),
|
|
13229
13519
|
pageAccessPolicy: AccessPolicySchema,
|
|
13230
13520
|
tokenRevisionRefs: z15.array(RevisionRefSchema),
|
|
13231
13521
|
performanceBudgetRef: RevisionRefSchema,
|
|
@@ -13248,6 +13538,7 @@ var CompatiblePageRuntimeBundleSchema = z15.object({
|
|
|
13248
13538
|
message: "Denied capability identities must be unique declared instances."
|
|
13249
13539
|
});
|
|
13250
13540
|
}
|
|
13541
|
+
validateProgramBindingTargets(value, context);
|
|
13251
13542
|
validateRuntimeBundleBase(value, "page-release", context);
|
|
13252
13543
|
value.routeClaims.forEach((claim, index) => {
|
|
13253
13544
|
if (claim.surface !== value.surface) {
|
|
@@ -20495,13 +20786,50 @@ var pageStreamRoutes = {
|
|
|
20495
20786
|
control: (releaseSlotId, bindingId, streamId) => `${route(releaseSlotId, bindingId, streamId)}/control`
|
|
20496
20787
|
};
|
|
20497
20788
|
var PageStreamControlResultSchema = z30.object({ requestId: z30.string().uuid(), accepted: z30.literal(true) }).strict();
|
|
20789
|
+
|
|
20790
|
+
// src/contracts/action-program-http.ts
|
|
20791
|
+
import { z as z31 } from "zod";
|
|
20792
|
+
var PrepareActionProgramRequestSchema = z31.object({
|
|
20793
|
+
artifact: ActionProgramArtifactSchema,
|
|
20794
|
+
expectedVersion: z31.number().int().min(0)
|
|
20795
|
+
}).strict();
|
|
20796
|
+
var RegisterActionProgramRequestSchema = PrepareActionProgramRequestSchema.extend({
|
|
20797
|
+
planHash: Sha256Schema,
|
|
20798
|
+
idempotencyKey: ContractIdentifierSchema
|
|
20799
|
+
}).strict();
|
|
20800
|
+
var ReadActionProgramRequestSchema = z31.object({ revisionRef: RevisionRefSchema }).strict();
|
|
20801
|
+
var RuntimeProgramLoadRequestSchema = z31.object({
|
|
20802
|
+
context: DeclarativeRuntimeActionExecuteIntentSchema
|
|
20803
|
+
}).strict();
|
|
20804
|
+
var RuntimeProgramCallRequestSchema = RuntimeProgramLoadRequestSchema.extend({
|
|
20805
|
+
kind: z31.enum(["query", "command"]),
|
|
20806
|
+
dependencyId: ContractIdentifierSchema,
|
|
20807
|
+
args: JsonObjectSchema,
|
|
20808
|
+
stepKey: z31.string().min(1).max(128),
|
|
20809
|
+
recoveryOnly: z31.literal(true).optional()
|
|
20810
|
+
}).strict();
|
|
20811
|
+
var RuntimeProgramLoadResultSchema = z31.object({
|
|
20812
|
+
artifact: ActionProgramArtifactSchema,
|
|
20813
|
+
input: JsonObjectSchema,
|
|
20814
|
+
schemas: z31.array(z31.object({ revisionRef: RevisionRefSchema, document: JsonObjectSchema }).strict()).max(512)
|
|
20815
|
+
}).strict();
|
|
20816
|
+
var RuntimeProgramCallResultSchema = z31.object({ value: JsonObjectSchema }).strict();
|
|
20817
|
+
var RuntimeProgramDownloadResultSchema = z31.discriminatedUnion("kind", [
|
|
20818
|
+
z31.object({ kind: z31.literal("native"), download: DeclarativeNativeDownloadSchema }).strict(),
|
|
20819
|
+
z31.object({ kind: z31.literal("text-artifact"), fileName: z31.string().min(1).max(255), mimeType: z31.enum(["application/json", "text/plain", "text/csv"]), content: z31.string().max(1048576) }).strict()
|
|
20820
|
+
]);
|
|
20498
20821
|
export {
|
|
20822
|
+
ACTION_PROGRAM_ABI,
|
|
20499
20823
|
AGENT_MODE_CAPABILITIES,
|
|
20500
20824
|
AGENT_SESSION_CAPABILITY_EVIDENCE,
|
|
20501
20825
|
AGENT_SESSION_COMMAND_POLICIES,
|
|
20502
20826
|
AGENT_SESSION_RUNTIME_CAPABILITIES,
|
|
20503
20827
|
AccessPolicySchema,
|
|
20504
20828
|
ActionBindingSchema,
|
|
20829
|
+
ActionProgramArtifactSchema,
|
|
20830
|
+
ActionProgramBudgetsSchema,
|
|
20831
|
+
ActionProgramDefinitionSchema,
|
|
20832
|
+
ActionProgramDependencySchema,
|
|
20505
20833
|
ActionResultBindingEffectSchema,
|
|
20506
20834
|
ActionResultBindingEffectSourceSchema,
|
|
20507
20835
|
ActionResultClipboardEffectSchema,
|
|
@@ -20640,6 +20968,7 @@ export {
|
|
|
20640
20968
|
DECLARATIVE_CONTROL_ONTOLOGY_DEFINITIONS,
|
|
20641
20969
|
DECLARATIVE_CONTROL_SCHEMA_VERSION,
|
|
20642
20970
|
DECLARATIVE_MIGRATION_ERROR_CODES,
|
|
20971
|
+
DEFAULT_ACTION_PROGRAM_BUDGETS,
|
|
20643
20972
|
DEFAULT_AGENT_WORKBENCH_SIDEBAR_SECTIONS,
|
|
20644
20973
|
DataContinuityEnvelopeSchema,
|
|
20645
20974
|
DeclarationGraphEdgeSchema,
|
|
@@ -20860,6 +21189,7 @@ export {
|
|
|
20860
21189
|
PageNavigationProjectionSchema,
|
|
20861
21190
|
PageNodeSchema,
|
|
20862
21191
|
PageOperatorSchema,
|
|
21192
|
+
PageProgramActionSchema,
|
|
20863
21193
|
PagePropertyBindingSchema,
|
|
20864
21194
|
PageReleaseSchema,
|
|
20865
21195
|
PageRendererProjectionSchema,
|
|
@@ -20887,6 +21217,7 @@ export {
|
|
|
20887
21217
|
PermissionBundleSchema,
|
|
20888
21218
|
PermissionDefinitionSchema,
|
|
20889
21219
|
PersistedOntologyBindingSchema,
|
|
21220
|
+
PrepareActionProgramRequestSchema,
|
|
20890
21221
|
ProductAccessDeclarationSchema,
|
|
20891
21222
|
ProductBodySchema,
|
|
20892
21223
|
ProductContextSchema,
|
|
@@ -20894,6 +21225,7 @@ export {
|
|
|
20894
21225
|
ProductDeclarativeAuthoringCatalogSchema,
|
|
20895
21226
|
ProductDeclarativeCapabilityRegistrationSchema,
|
|
20896
21227
|
ProductSurfaceSchema,
|
|
21228
|
+
ProgramBindingSchema,
|
|
20897
21229
|
ProjectionSpecSchema,
|
|
20898
21230
|
PublicationPlanOperationSchema,
|
|
20899
21231
|
PublicationPlanSchema,
|
|
@@ -20914,6 +21246,7 @@ export {
|
|
|
20914
21246
|
RadarScoreProjectionSchema,
|
|
20915
21247
|
RadarSelectionSchema,
|
|
20916
21248
|
RadarWritebackRecordSchema,
|
|
21249
|
+
ReadActionProgramRequestSchema,
|
|
20917
21250
|
ReadablePageRuntimeBundleSchema,
|
|
20918
21251
|
RecordEditorDraftOperationSchema,
|
|
20919
21252
|
RecordEditorDraftSchema,
|
|
@@ -20922,6 +21255,7 @@ export {
|
|
|
20922
21255
|
RecordEditorSubmissionSnapshotSchema,
|
|
20923
21256
|
RecordEditorValidationDetailsSchema,
|
|
20924
21257
|
ReferenceVisibilitySchema,
|
|
21258
|
+
RegisterActionProgramRequestSchema,
|
|
20925
21259
|
RegisteredServiceDomainQueryDataSourceSchema,
|
|
20926
21260
|
ReleaseDependencyRoleSchema,
|
|
20927
21261
|
ReleaseDependencySchema,
|
|
@@ -20952,6 +21286,11 @@ export {
|
|
|
20952
21286
|
RoutePathTemplateSchema,
|
|
20953
21287
|
RouteSpaceParameterSchema,
|
|
20954
21288
|
RouteSpaceSchema,
|
|
21289
|
+
RuntimeProgramCallRequestSchema,
|
|
21290
|
+
RuntimeProgramCallResultSchema,
|
|
21291
|
+
RuntimeProgramDownloadResultSchema,
|
|
21292
|
+
RuntimeProgramLoadRequestSchema,
|
|
21293
|
+
RuntimeProgramLoadResultSchema,
|
|
20955
21294
|
SavedRadarQuerySchema,
|
|
20956
21295
|
SchemaDefinitionSchema,
|
|
20957
21296
|
ScopedIdentityRefSchema,
|