@uns-kit/core 3.0.42 → 3.0.44

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/MIGRATIONS.md CHANGED
@@ -9,6 +9,40 @@ Agents must inspect the application's existing ownership and shutdown flow
9
9
  before editing it. The examples below describe the intended behavior, not a
10
10
  mechanical search-and-replace operation.
11
11
 
12
+ ## 3.0.44 - Bounded operator JWKS recovery
13
+
14
+ When crossing `<3.0.44` to `>=3.0.44`, ordinary application handlers, standalone
15
+ shutdown and existing input/output journals need no migration. Applications using
16
+ declared operator endpoints receive this correction from `@uns-kit/api`; consume
17
+ the reviewed published API/core versions together with a frozen dependency lock.
18
+ No application-specific retry wrapper, configuration flag or new Controller
19
+ capability is needed.
20
+
21
+ The shared verifier coalesces key refreshes and retries a transient public-key GET
22
+ once within a bounded deadline. It does not retry an operator request or business
23
+ effect, extend the original key-cache lifetime, or skip parent revocation checks.
24
+ Persistent key-source failure remains a503 and a revoked parent remains denied.
25
+ Keep existing service permissions, launch identity, keys, queues, pause policies
26
+ and durable command receipts; never resume a paused target or broaden scopes to
27
+ make an upgrade pass. Follow the normal reviewed upgrade procedure after npm
28
+ publication. See the [operator contract and regression examples](../../docs/operator-api.md#bounded-jwks-recovery-3044).
29
+
30
+ ## 3.0.43 - Shared managed operator route registration
31
+
32
+ This entry describes the prepared 3.0.43 release; npm publication is separate. Existing ordinary
33
+ API endpoints and standalone services require no changes. Applications exposing
34
+ `operatorOperations` must adopt the coordinated API/core release, then be launched
35
+ by a Controller providing the reviewed route-token file and exact launch metadata.
36
+ `UnsApiProxy` registers and renews its own route automatically; no application-name
37
+ branch or custom route publisher is needed. Route credentials grant no data or
38
+ operator-command permissions. See [the contract](../../docs/operator-api.md).
39
+
40
+ Do not replace the owning Controller URL with a generic master URL, copy tokens
41
+ into config, normalize the launch's version tag or broaden service scopes to make
42
+ registration succeed. A Controller-only hot update cannot add launch metadata to
43
+ an already running process. Use the normal reviewed restart/upgrade after the
44
+ coordinated versions are published. Keep old application data and queues intact.
45
+
12
46
  ## 3.0.42 - Opt-in registered operator APIs and Service API body metadata
13
47
 
14
48
  Existing applications require no operator-API change when crossing this version.
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ export declare const RUNTIME_ROUTE_REGISTRATION_PATH = "/api/runtime-services/routes";
3
+ export declare const RUNTIME_ROUTE_REGISTRATION_LEASE_MS = 30000;
4
+ export declare const runtimeRouteDeploymentSchema: z.ZodObject<{
5
+ controllerName: z.ZodString;
6
+ rttNode: z.ZodString;
7
+ version: z.ZodString;
8
+ instanceId: z.ZodString;
9
+ launchId: z.ZodString;
10
+ }, z.core.$strict>;
11
+ export type RuntimeRouteDeployment = z.infer<typeof runtimeRouteDeploymentSchema>;
12
+ export declare function runtimeRouteOrigin(value: string): string;
13
+ export declare const runtimeRouteBindingSchema: z.ZodObject<{
14
+ processName: z.ZodString;
15
+ version: z.ZodString;
16
+ apiHost: z.ZodString;
17
+ controllerName: z.ZodString;
18
+ controllerPublicBase: z.ZodString;
19
+ instanceId: z.ZodString;
20
+ deploymentId: z.ZodString;
21
+ }, z.core.$strict>;
22
+ export type RuntimeRouteBinding = z.infer<typeof runtimeRouteBindingSchema>;
23
+ export declare const runtimeRouteReceiptSchema: z.ZodObject<{
24
+ protocolVersion: z.ZodLiteral<1>;
25
+ expiresInMs: z.ZodLiteral<30000>;
26
+ binding: z.ZodObject<{
27
+ processName: z.ZodString;
28
+ version: z.ZodString;
29
+ apiHost: z.ZodString;
30
+ controllerName: z.ZodString;
31
+ controllerPublicBase: z.ZodString;
32
+ instanceId: z.ZodString;
33
+ deploymentId: z.ZodString;
34
+ }, z.core.$strict>;
35
+ }, z.core.$strict>;
36
+ /** A receipt is ownership evidence only for this exact process launch/origin. */
37
+ export declare function readRuntimeRouteReceipt(value: unknown, expected: RuntimeRouteDeployment & {
38
+ processName: string;
39
+ apiHost: string;
40
+ }): {
41
+ protocolVersion: 1;
42
+ expiresInMs: 30000;
43
+ binding: {
44
+ processName: string;
45
+ version: string;
46
+ apiHost: string;
47
+ controllerName: string;
48
+ controllerPublicBase: string;
49
+ instanceId: string;
50
+ deploymentId: string;
51
+ };
52
+ };
53
+ //# sourceMappingURL=route-registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-registration.d.ts","sourceRoot":"","sources":["../../src/runtime/route-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,+BAA+B,iCAAiC,CAAC;AAC9E,eAAO,MAAM,mCAAmC,QAAS,CAAC;AAE1D,eAAO,MAAM,4BAA4B;;;;;;kBAG9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMxD;AAED,eAAO,MAAM,yBAAyB;;;;;;;;kBAG3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;kBAE3B,CAAC;AAEZ,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;EAQlI"}
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export const RUNTIME_ROUTE_REGISTRATION_PATH = "/api/runtime-services/routes";
3
+ export const RUNTIME_ROUTE_REGISTRATION_LEASE_MS = 30_000;
4
+ const name = z.string().min(1).max(256);
5
+ export const runtimeRouteDeploymentSchema = z.object({
6
+ controllerName: name, rttNode: name, version: name, instanceId: name,
7
+ launchId: z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),
8
+ }).strict();
9
+ export function runtimeRouteOrigin(value) {
10
+ if (typeof value !== "string" || value.length > 2048)
11
+ throw Error("Invalid runtime route origin");
12
+ const url = new URL(value);
13
+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== "/")
14
+ throw Error("Invalid runtime route origin");
15
+ return url.origin;
16
+ }
17
+ export const runtimeRouteBindingSchema = z.object({
18
+ processName: name, version: name, apiHost: z.string().min(1).max(2048), controllerName: name,
19
+ controllerPublicBase: z.string().min(1).max(2048), instanceId: name, deploymentId: z.string().min(1).max(1024),
20
+ }).strict();
21
+ export const runtimeRouteReceiptSchema = z.object({
22
+ protocolVersion: z.literal(1), expiresInMs: z.literal(RUNTIME_ROUTE_REGISTRATION_LEASE_MS), binding: runtimeRouteBindingSchema,
23
+ }).strict();
24
+ /** A receipt is ownership evidence only for this exact process launch/origin. */
25
+ export function readRuntimeRouteReceipt(value, expected) {
26
+ const receipt = runtimeRouteReceiptSchema.parse(value), binding = receipt.binding;
27
+ if (binding.controllerName !== expected.controllerName || binding.instanceId !== expected.instanceId
28
+ || binding.version !== expected.version || binding.processName !== expected.processName
29
+ || runtimeRouteOrigin(binding.apiHost) !== runtimeRouteOrigin(expected.apiHost)
30
+ || !binding.deploymentId.startsWith(expected.launchId + ":"))
31
+ throw Error("Runtime route receipt does not match launch");
32
+ runtimeRouteOrigin(binding.controllerPublicBase);
33
+ return receipt;
34
+ }
35
+ //# sourceMappingURL=route-registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-registration.js","sourceRoot":"","sources":["../../src/runtime/route-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,+BAA+B,GAAG,8BAA8B,CAAC;AAC9E,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAC1D,MAAM,IAAI,GA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 30_000;\nconst name = z.string().min(1).max(256);\nexport const runtimeRouteDeploymentSchema = z.object({\n controllerName: name, rttNode: name, version: name, instanceId: name,\n launchId: z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),\n}).strict();\nexport type RuntimeRouteDeployment = z.infer<typeof runtimeRouteDeploymentSchema>;\n\nexport function runtimeRouteOrigin(value: string): string {\n if (typeof value !== \"string\" || value.length > 2048) throw Error(\"Invalid runtime route origin\");\n const url = new URL(value);\n if (![\"http:\", \"https:\"].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== \"/\")\n throw Error(\"Invalid runtime route origin\");\n return url.origin;\n}\n\nexport const runtimeRouteBindingSchema = z.object({\n processName: name, version: name, apiHost: z.string().min(1).max(2048), controllerName: name,\n controllerPublicBase: z.string().min(1).max(2048), instanceId: name, deploymentId: z.string().min(1).max(1024),\n}).strict();\nexport type RuntimeRouteBinding = z.infer<typeof runtimeRouteBindingSchema>;\nexport const runtimeRouteReceiptSchema = z.object({\n protocolVersion: z.literal(1), expiresInMs: z.literal(RUNTIME_ROUTE_REGISTRATION_LEASE_MS), binding: runtimeRouteBindingSchema,\n}).strict();\n\n/** A receipt is ownership evidence only for this exact process launch/origin. */\nexport function readRuntimeRouteReceipt(value: unknown, expected: RuntimeRouteDeployment & { processName: string; apiHost: string }) {\n const receipt = runtimeRouteReceiptSchema.parse(value), binding = receipt.binding;\n if (binding.controllerName !== expected.controllerName || binding.instanceId !== expected.instanceId\n || binding.version !== expected.version || binding.processName !== expected.processName\n || runtimeRouteOrigin(binding.apiHost) !== runtimeRouteOrigin(expected.apiHost)\n || !binding.deploymentId.startsWith(expected.launchId + \":\")) throw Error(\"Runtime route receipt does not match launch\");\n runtimeRouteOrigin(binding.controllerPublicBase);\n return receipt;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uns-kit/core",
3
- "version": "3.0.42",
3
+ "version": "3.0.44",
4
4
  "description": "Core utilities and runtime building blocks for UNS-based realtime transformers.",
5
5
  "type": "module",
6
6
  "license": "MIT",