@camstack/system 1.1.33 → 1.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -11
- package/dist/index.mjs +21 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4917,13 +4917,24 @@ var CapabilityRegistry = class CapabilityRegistry {
|
|
|
4917
4917
|
* this builder's output to that static type at the single documented
|
|
4918
4918
|
* boundary, so the SDK keeps full procedure inference.
|
|
4919
4919
|
*
|
|
4920
|
-
*
|
|
4921
|
-
*
|
|
4922
|
-
*
|
|
4923
|
-
*
|
|
4924
|
-
*
|
|
4925
|
-
*
|
|
4926
|
-
*
|
|
4920
|
+
* The per-method procedure shape is mechanically derived from each
|
|
4921
|
+
* `cap.methods.*` (input zod schema + kind) + the auto-injected
|
|
4922
|
+
* `getStatus` / 3 settings-contribution methods (via `expandCapMethods`).
|
|
4923
|
+
* Provider resolution is derived from the declarative `mount` hint
|
|
4924
|
+
* (`resolveCapMount`) — the same decision the codegen
|
|
4925
|
+
* `generate-cap-mounts.ts` baked in.
|
|
4926
|
+
*
|
|
4927
|
+
* OUTPUT PASS-THROUGH (2026-07-11): unlike the historical codegen, the
|
|
4928
|
+
* builder deliberately does NOT apply `.output(schema)`. Re-validating an
|
|
4929
|
+
* output the hub does not own against the hub's OWN (framework-versioned,
|
|
4930
|
+
* therefore potentially stale) copy of the cap def silently STRIPS fields
|
|
4931
|
+
* a fresher addon added (a self-contained addon bundles its own newer
|
|
4932
|
+
* `@camstack/types`; the hub-closure copy lags). That is exactly how
|
|
4933
|
+
* `models[].group.resolution` vanished from `pipelineExecutor.getSchema`.
|
|
4934
|
+
* Cap dispatch is structural (CLAUDE.md invariant): the owning provider is
|
|
4935
|
+
* typed to return a complete `z.infer<output>` and is the SOLE authority
|
|
4936
|
+
* for the payload shape, so the hub forwards it verbatim. Input validation
|
|
4937
|
+
* is retained (`.input(...)`) — the hub still guards the client boundary.
|
|
4927
4938
|
*
|
|
4928
4939
|
* This module owns NO tRPC primitives of its own: `@camstack/system`
|
|
4929
4940
|
* cannot import the server's `TrpcContext`-bound procedures. The server
|
|
@@ -4996,7 +5007,6 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
4996
5007
|
for (const method of methodsFor(def)) {
|
|
4997
5008
|
const base = primitives.procedures[(0, _camstack_types.procedureAuthKey)(method.auth)];
|
|
4998
5009
|
const inputSchema = method.schema.input;
|
|
4999
|
-
const outputSchema = method.schema.output;
|
|
5000
5010
|
if (method.kind === "subscription") {
|
|
5001
5011
|
procedures[method.name] = base.input(inputSchema).subscription(({ input, ctx }) => {
|
|
5002
5012
|
const provider = requireLocal(capName, () => getLocal(ctx), services);
|
|
@@ -5014,7 +5024,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
5014
5024
|
nodeId: zod.z.string().optional(),
|
|
5015
5025
|
addonId: zod.z.string().optional()
|
|
5016
5026
|
}).optional() : zod.z.object({ nodeId: zod.z.string().optional() }).optional();
|
|
5017
|
-
procedures[method.name] = base.input(voidSelector)
|
|
5027
|
+
procedures[method.name] = base.input(voidSelector)[procKind](({ input, ctx }) => {
|
|
5018
5028
|
const sel = input ?? {};
|
|
5019
5029
|
return (nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services))[method.name]?.();
|
|
5020
5030
|
});
|
|
@@ -5022,7 +5032,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
5022
5032
|
}
|
|
5023
5033
|
if (method.isObject) {
|
|
5024
5034
|
const schema = nodeIdData ? inputSchema : (0, _camstack_types.looseSchema)(inputSchema);
|
|
5025
|
-
procedures[method.name] = base.input(schema)
|
|
5035
|
+
procedures[method.name] = base.input(schema)[procKind](({ input, ctx }) => {
|
|
5026
5036
|
if (nodeIdData) return requireLocal(capName, () => getLocal(ctx), services)[method.name]?.(input);
|
|
5027
5037
|
if (isCollection) {
|
|
5028
5038
|
const { rest, picked } = stripKeys(input, ["nodeId", "addonId"]);
|
|
@@ -5035,7 +5045,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
5035
5045
|
});
|
|
5036
5046
|
continue;
|
|
5037
5047
|
}
|
|
5038
|
-
procedures[method.name] = base.input(inputSchema)
|
|
5048
|
+
procedures[method.name] = base.input(inputSchema)[procKind](({ input, ctx }) => {
|
|
5039
5049
|
return requireLocal(capName, () => getLocal(ctx), services)[method.name]?.(input);
|
|
5040
5050
|
});
|
|
5041
5051
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -4909,13 +4909,24 @@ var CapabilityRegistry = class CapabilityRegistry {
|
|
|
4909
4909
|
* this builder's output to that static type at the single documented
|
|
4910
4910
|
* boundary, so the SDK keeps full procedure inference.
|
|
4911
4911
|
*
|
|
4912
|
-
*
|
|
4913
|
-
*
|
|
4914
|
-
*
|
|
4915
|
-
*
|
|
4916
|
-
*
|
|
4917
|
-
*
|
|
4918
|
-
*
|
|
4912
|
+
* The per-method procedure shape is mechanically derived from each
|
|
4913
|
+
* `cap.methods.*` (input zod schema + kind) + the auto-injected
|
|
4914
|
+
* `getStatus` / 3 settings-contribution methods (via `expandCapMethods`).
|
|
4915
|
+
* Provider resolution is derived from the declarative `mount` hint
|
|
4916
|
+
* (`resolveCapMount`) — the same decision the codegen
|
|
4917
|
+
* `generate-cap-mounts.ts` baked in.
|
|
4918
|
+
*
|
|
4919
|
+
* OUTPUT PASS-THROUGH (2026-07-11): unlike the historical codegen, the
|
|
4920
|
+
* builder deliberately does NOT apply `.output(schema)`. Re-validating an
|
|
4921
|
+
* output the hub does not own against the hub's OWN (framework-versioned,
|
|
4922
|
+
* therefore potentially stale) copy of the cap def silently STRIPS fields
|
|
4923
|
+
* a fresher addon added (a self-contained addon bundles its own newer
|
|
4924
|
+
* `@camstack/types`; the hub-closure copy lags). That is exactly how
|
|
4925
|
+
* `models[].group.resolution` vanished from `pipelineExecutor.getSchema`.
|
|
4926
|
+
* Cap dispatch is structural (CLAUDE.md invariant): the owning provider is
|
|
4927
|
+
* typed to return a complete `z.infer<output>` and is the SOLE authority
|
|
4928
|
+
* for the payload shape, so the hub forwards it verbatim. Input validation
|
|
4929
|
+
* is retained (`.input(...)`) — the hub still guards the client boundary.
|
|
4919
4930
|
*
|
|
4920
4931
|
* This module owns NO tRPC primitives of its own: `@camstack/system`
|
|
4921
4932
|
* cannot import the server's `TrpcContext`-bound procedures. The server
|
|
@@ -4988,7 +4999,6 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
4988
4999
|
for (const method of methodsFor(def)) {
|
|
4989
5000
|
const base = primitives.procedures[procedureAuthKey(method.auth)];
|
|
4990
5001
|
const inputSchema = method.schema.input;
|
|
4991
|
-
const outputSchema = method.schema.output;
|
|
4992
5002
|
if (method.kind === "subscription") {
|
|
4993
5003
|
procedures[method.name] = base.input(inputSchema).subscription(({ input, ctx }) => {
|
|
4994
5004
|
const provider = requireLocal(capName, () => getLocal(ctx), services);
|
|
@@ -5006,7 +5016,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
5006
5016
|
nodeId: z.string().optional(),
|
|
5007
5017
|
addonId: z.string().optional()
|
|
5008
5018
|
}).optional() : z.object({ nodeId: z.string().optional() }).optional();
|
|
5009
|
-
procedures[method.name] = base.input(voidSelector)
|
|
5019
|
+
procedures[method.name] = base.input(voidSelector)[procKind](({ input, ctx }) => {
|
|
5010
5020
|
const sel = input ?? {};
|
|
5011
5021
|
return (nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services))[method.name]?.();
|
|
5012
5022
|
});
|
|
@@ -5014,7 +5024,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
5014
5024
|
}
|
|
5015
5025
|
if (method.isObject) {
|
|
5016
5026
|
const schema = nodeIdData ? inputSchema : looseSchema(inputSchema);
|
|
5017
|
-
procedures[method.name] = base.input(schema)
|
|
5027
|
+
procedures[method.name] = base.input(schema)[procKind](({ input, ctx }) => {
|
|
5018
5028
|
if (nodeIdData) return requireLocal(capName, () => getLocal(ctx), services)[method.name]?.(input);
|
|
5019
5029
|
if (isCollection) {
|
|
5020
5030
|
const { rest, picked } = stripKeys(input, ["nodeId", "addonId"]);
|
|
@@ -5027,7 +5037,7 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
5027
5037
|
});
|
|
5028
5038
|
continue;
|
|
5029
5039
|
}
|
|
5030
|
-
procedures[method.name] = base.input(inputSchema)
|
|
5040
|
+
procedures[method.name] = base.input(inputSchema)[procKind](({ input, ctx }) => {
|
|
5031
5041
|
return requireLocal(capName, () => getLocal(ctx), services)[method.name]?.(input);
|
|
5032
5042
|
});
|
|
5033
5043
|
}
|