@qlever-llc/trellis 0.10.7 → 0.10.9

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.
Files changed (57) hide show
  1. package/esm/auth/protocol.d.ts +120 -3
  2. package/esm/auth/protocol.d.ts.map +1 -1
  3. package/esm/auth/protocol.js +43 -1
  4. package/esm/contract_support/mod.d.ts +1 -1
  5. package/esm/contract_support/mod.d.ts.map +1 -1
  6. package/esm/contract_support/mod.js +1 -1
  7. package/esm/contract_support/protocol.d.ts +67 -0
  8. package/esm/contract_support/protocol.d.ts.map +1 -1
  9. package/esm/contract_support/protocol.js +90 -0
  10. package/esm/generated-sdk/auth/contract.d.ts +1 -1
  11. package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
  12. package/esm/generated-sdk/auth/contract.js +2 -2
  13. package/esm/generated-sdk/auth/schemas.d.ts +329 -2
  14. package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
  15. package/esm/generated-sdk/auth/schemas.js +3 -3
  16. package/esm/generated-sdk/auth/types.d.ts +47 -3
  17. package/esm/generated-sdk/auth/types.d.ts.map +1 -1
  18. package/esm/generated-sdk/auth/types.js +1 -1
  19. package/esm/index.d.ts +2 -2
  20. package/esm/index.d.ts.map +1 -1
  21. package/esm/index.js +1 -1
  22. package/esm/server/service.d.ts +11 -2
  23. package/esm/server/service.d.ts.map +1 -1
  24. package/esm/server/service.js +28 -4
  25. package/package.json +2 -2
  26. package/script/auth/protocol.d.ts +120 -3
  27. package/script/auth/protocol.d.ts.map +1 -1
  28. package/script/auth/protocol.js +47 -5
  29. package/script/contract_support/mod.d.ts +1 -1
  30. package/script/contract_support/mod.d.ts.map +1 -1
  31. package/script/contract_support/mod.js +8 -1
  32. package/script/contract_support/protocol.d.ts +67 -0
  33. package/script/contract_support/protocol.d.ts.map +1 -1
  34. package/script/contract_support/protocol.js +96 -1
  35. package/script/generated-sdk/auth/contract.d.ts +1 -1
  36. package/script/generated-sdk/auth/contract.d.ts.map +1 -1
  37. package/script/generated-sdk/auth/contract.js +2 -2
  38. package/script/generated-sdk/auth/schemas.d.ts +329 -2
  39. package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
  40. package/script/generated-sdk/auth/schemas.js +3 -3
  41. package/script/generated-sdk/auth/types.d.ts +47 -3
  42. package/script/generated-sdk/auth/types.d.ts.map +1 -1
  43. package/script/generated-sdk/auth/types.js +1 -1
  44. package/script/index.d.ts +2 -2
  45. package/script/index.d.ts.map +1 -1
  46. package/script/index.js +9 -2
  47. package/script/server/service.d.ts +11 -2
  48. package/script/server/service.d.ts.map +1 -1
  49. package/script/server/service.js +27 -3
  50. package/src/auth/protocol.ts +55 -1
  51. package/src/contract_support/mod.ts +12 -0
  52. package/src/contract_support/protocol.ts +137 -0
  53. package/src/index.ts +12 -0
  54. package/src/sdk/_generated/auth/contract.ts +2 -2
  55. package/src/sdk/_generated/auth/schemas.ts +3 -3
  56. package/src/sdk/_generated/auth/types.ts +4 -4
  57. package/src/server/service.ts +52 -3
@@ -1,7 +1,7 @@
1
1
  // Generated from ./generated/contracts/manifests/trellis.auth@v1.json
2
2
  export const AuthCapabilitiesListRequestSchema = {"properties":{"limit":{"maximum":500,"minimum":0,"type":"integer"},"offset":{"minimum":0,"type":"integer"}},"required":["limit"],"type":"object"} as const;
3
3
 
4
- export const AuthCapabilitiesListResponseSchema = {"properties":{"count":{"minimum":0,"type":"integer"},"entries":{"default":[],"items":{"properties":{"consequence":{"minLength":1,"type":"string"},"contractDigest":{"pattern":"^[A-Za-z0-9_-]+$","type":"string"},"contractDisplayName":{"minLength":1,"type":"string"},"contractId":{"minLength":1,"type":"string"},"description":{"minLength":1,"type":"string"},"displayName":{"minLength":1,"type":"string"},"key":{"minLength":1,"type":"string"},"source":{"anyOf":[{"const":"contract","type":"string"},{"const":"platform","type":"string"}]}},"required":["key","displayName","description","source"],"type":"object"},"type":"array"},"limit":{"minimum":0,"type":"integer"},"nextOffset":{"minimum":0,"type":"integer"},"offset":{"minimum":0,"type":"integer"}},"required":["entries","count","offset","limit"],"type":"object"} as const;
4
+ export const AuthCapabilitiesListResponseSchema = {"properties":{"count":{"minimum":0,"type":"integer"},"entries":{"default":[],"items":{"properties":{"consequence":{"minLength":1,"type":"string"},"contractDigest":{"pattern":"^[A-Za-z0-9_-]+$","type":"string"},"contractDisplayName":{"minLength":1,"type":"string"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"description":{"minLength":1,"type":"string"},"direction":{"anyOf":[{"const":"creates","type":"string"},{"const":"given","type":"string"}]},"displayName":{"minLength":1,"type":"string"},"key":{"minLength":1,"type":"string"},"source":{"anyOf":[{"const":"contract","type":"string"},{"const":"platform","type":"string"}]}},"required":["key","displayName","description","source"],"type":"object"},"type":"array"},"limit":{"minimum":0,"type":"integer"},"nextOffset":{"minimum":0,"type":"integer"},"offset":{"minimum":0,"type":"integer"}},"required":["entries","count","offset","limit"],"type":"object"} as const;
5
5
 
6
6
  export const AuthCapabilityGroupsDeleteRequestSchema = {"properties":{"groupKey":{"minLength":1,"type":"string"}},"required":["groupKey"],"type":"object"} as const;
7
7
 
@@ -45,7 +45,7 @@ export const AuthDeploymentAuthorityAcceptUpdateRequestSchema = {"properties":{"
45
45
 
46
46
  export const AuthDeploymentAuthorityGetRequestSchema = {"properties":{"deploymentId":{"minLength":1,"type":"string"}},"required":["deploymentId"],"type":"object"} as const;
47
47
 
48
- export const AuthDeploymentAuthorityGetResponseSchema = {"properties":{"authority":{"properties":{"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"desiredState":{"properties":{"capabilities":{"items":{"minLength":1,"type":"string"},"type":"array"},"needs":{"items":{"anyOf":[{"properties":{"contractId":{"minLength":1,"type":"string"},"kind":{"const":"contract","type":"string"},"required":{"type":"boolean"}},"required":["kind","contractId","required"],"type":"object"},{"properties":{"kind":{"const":"surface","type":"string"},"required":{"type":"boolean"},"surface":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"}},"required":["kind","surface","required"],"type":"object"},{"properties":{"capability":{"minLength":1,"type":"string"},"kind":{"const":"capability","type":"string"},"required":{"type":"boolean"}},"required":["kind","capability","required"],"type":"object"},{"properties":{"kind":{"const":"resource","type":"string"},"required":{"type":"boolean"},"resource":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"}},"required":["kind","resource","required"],"type":"object"}]},"type":"array"},"resources":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"},"type":"array"},"surfaces":{"items":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"},"type":"array"}},"required":["needs","capabilities","resources","surfaces"],"type":"object"},"disabled":{"type":"boolean"},"kind":{"anyOf":[{"const":"service","type":"string"},{"const":"device","type":"string"},{"const":"app","type":"string"},{"const":"cli","type":"string"},{"const":"native","type":"string"},{"const":"device-user","type":"string"}]},"updatedAt":{"format":"date-time","type":"string"},"version":{"minLength":1,"type":"string"}},"required":["deploymentId","kind","disabled","desiredState","version","createdAt","updatedAt"],"type":"object"},"grantOverrides":{"items":{"anyOf":[{"properties":{"capability":{"minLength":1,"type":"string"},"capabilityGroupKey":{"type":"null"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability","type":"string"},"identityKind":{"const":"web","type":"string"},"origin":{"minLength":1,"type":"string"},"sessionPublicKey":{"type":"null"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"},{"properties":{"capability":{"type":"null"},"capabilityGroupKey":{"minLength":1,"type":"string"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability-group","type":"string"},"identityKind":{"const":"web","type":"string"},"origin":{"minLength":1,"type":"string"},"sessionPublicKey":{"type":"null"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"},{"properties":{"capability":{"minLength":1,"type":"string"},"capabilityGroupKey":{"type":"null"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability","type":"string"},"identityKind":{"const":"session","type":"string"},"origin":{"type":"null"},"sessionPublicKey":{"minLength":1,"type":"string"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"},{"properties":{"capability":{"type":"null"},"capabilityGroupKey":{"minLength":1,"type":"string"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability-group","type":"string"},"identityKind":{"const":"session","type":"string"},"origin":{"type":"null"},"sessionPublicKey":{"minLength":1,"type":"string"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"}]},"type":"array"},"materializedAuthority":{"anyOf":[{"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"},"error":{"minLength":1,"type":"string"},"grants":{"items":{"type":"object"},"type":"array"},"reconciledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"resourceBindings":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"binding":{"patternProperties":{"^.*$":{}},"type":"object"},"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"limits":{"anyOf":[{"patternProperties":{"^.*$":{}},"type":"object"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}},"required":["deploymentId","kind","alias","binding","limits","createdAt","updatedAt"],"type":"object"},"type":"array"},"status":{"anyOf":[{"const":"current","type":"string"},{"const":"pending","type":"string"},{"const":"failed","type":"string"}]}},"required":["deploymentId","desiredVersion","status","resourceBindings","grants","reconciledAt"],"type":"object"},{"type":"null"}]},"portalRoute":{"anyOf":[{"properties":{"deploymentId":{"minLength":1,"type":"string"},"disabled":{"type":"boolean"},"entryUrl":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"portalId":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}},"required":["deploymentId","portalId","entryUrl","disabled","updatedAt"],"type":"object"},{"type":"null"}]}},"required":["authority","materializedAuthority","portalRoute","grantOverrides"],"type":"object"} as const;
48
+ export const AuthDeploymentAuthorityGetResponseSchema = {"properties":{"authority":{"properties":{"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"desiredState":{"properties":{"capabilities":{"items":{"minLength":1,"type":"string"},"type":"array"},"needs":{"items":{"anyOf":[{"properties":{"contractId":{"minLength":1,"type":"string"},"kind":{"const":"contract","type":"string"},"required":{"type":"boolean"}},"required":["kind","contractId","required"],"type":"object"},{"properties":{"kind":{"const":"surface","type":"string"},"required":{"type":"boolean"},"surface":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"}},"required":["kind","surface","required"],"type":"object"},{"properties":{"capability":{"minLength":1,"type":"string"},"kind":{"const":"capability","type":"string"},"required":{"type":"boolean"}},"required":["kind","capability","required"],"type":"object"},{"properties":{"kind":{"const":"resource","type":"string"},"required":{"type":"boolean"},"resource":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"}},"required":["kind","resource","required"],"type":"object"}]},"type":"array"},"resources":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"},"type":"array"},"surfaces":{"items":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"},"type":"array"}},"required":["needs","capabilities","resources","surfaces"],"type":"object"},"disabled":{"type":"boolean"},"kind":{"anyOf":[{"const":"service","type":"string"},{"const":"device","type":"string"},{"const":"app","type":"string"},{"const":"cli","type":"string"},{"const":"native","type":"string"},{"const":"device-user","type":"string"}]},"updatedAt":{"format":"date-time","type":"string"},"version":{"minLength":1,"type":"string"}},"required":["deploymentId","kind","disabled","desiredState","version","createdAt","updatedAt"],"type":"object"},"grantOverrides":{"items":{"anyOf":[{"properties":{"capability":{"minLength":1,"type":"string"},"capabilityGroupKey":{"type":"null"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability","type":"string"},"identityKind":{"const":"web","type":"string"},"origin":{"minLength":1,"type":"string"},"sessionPublicKey":{"type":"null"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"},{"properties":{"capability":{"type":"null"},"capabilityGroupKey":{"minLength":1,"type":"string"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability-group","type":"string"},"identityKind":{"const":"web","type":"string"},"origin":{"minLength":1,"type":"string"},"sessionPublicKey":{"type":"null"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"},{"properties":{"capability":{"minLength":1,"type":"string"},"capabilityGroupKey":{"type":"null"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability","type":"string"},"identityKind":{"const":"session","type":"string"},"origin":{"type":"null"},"sessionPublicKey":{"minLength":1,"type":"string"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"},{"properties":{"capability":{"type":"null"},"capabilityGroupKey":{"minLength":1,"type":"string"},"contractId":{"minLength":1,"type":"string"},"deploymentId":{"minLength":1,"type":"string"},"grantKind":{"const":"capability-group","type":"string"},"identityKind":{"const":"session","type":"string"},"origin":{"type":"null"},"sessionPublicKey":{"minLength":1,"type":"string"}},"required":["deploymentId","identityKind","grantKind","contractId","origin","sessionPublicKey","capability","capabilityGroupKey"],"type":"object"}]},"type":"array"},"materializedAuthority":{"anyOf":[{"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"},"error":{"minLength":1,"type":"string"},"grants":{"items":{"anyOf":[{"properties":{"capability":{"minLength":1,"type":"string"},"kind":{"const":"capability","type":"string"}},"required":["kind","capability"],"type":"object"},{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"const":"surface","type":"string"},"name":{"minLength":1,"type":"string"},"surfaceKind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]}},"required":["kind","contractId","surfaceKind","name"],"type":"object"},{"properties":{"direction":{"anyOf":[{"const":"publish","type":"string"},{"const":"subscribe","type":"string"}]},"grantSource":{"anyOf":[{"const":"owned-surface","type":"string"},{"const":"used-surface","type":"string"},{"const":"resource-binding","type":"string"},{"const":"platform-service","type":"string"},{"const":"transfer","type":"string"}]},"kind":{"const":"nats","type":"string"},"requiredCapabilities":{"items":{"minLength":1,"type":"string"},"type":"array"},"subject":{"minLength":1,"type":"string"},"surface":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"}},"required":["kind","direction","subject","requiredCapabilities","grantSource"],"type":"object"}]},"type":"array"},"reconciledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"resourceBindings":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"binding":{"patternProperties":{"^.*$":{}},"type":"object"},"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"limits":{"anyOf":[{"patternProperties":{"^.*$":{}},"type":"object"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}},"required":["deploymentId","kind","alias","binding","limits","createdAt","updatedAt"],"type":"object"},"type":"array"},"status":{"anyOf":[{"const":"current","type":"string"},{"const":"pending","type":"string"},{"const":"failed","type":"string"}]}},"required":["deploymentId","desiredVersion","status","resourceBindings","grants","reconciledAt"],"type":"object"},{"type":"null"}]},"portalRoute":{"anyOf":[{"properties":{"deploymentId":{"minLength":1,"type":"string"},"disabled":{"type":"boolean"},"entryUrl":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"portalId":{"anyOf":[{"minLength":1,"type":"string"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}},"required":["deploymentId","portalId","entryUrl","disabled","updatedAt"],"type":"object"},{"type":"null"}]}},"required":["authority","materializedAuthority","portalRoute","grantOverrides"],"type":"object"} as const;
49
49
 
50
50
  export const AuthDeploymentAuthorityGrantOverridesListRequestSchema = {"properties":{"limit":{"maximum":500,"minimum":0,"type":"integer"},"offset":{"minimum":0,"type":"integer"}},"required":["limit"],"type":"object"} as const;
51
51
 
@@ -75,7 +75,7 @@ export const AuthDeploymentAuthorityPlansListResponseSchema = {"properties":{"co
75
75
 
76
76
  export const AuthDeploymentAuthorityReconcileRequestSchema = {"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"}},"required":["deploymentId"],"type":"object"} as const;
77
77
 
78
- export const AuthDeploymentAuthorityReconcileResponseSchema = {"properties":{"authority":{"properties":{"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"desiredState":{"properties":{"capabilities":{"items":{"minLength":1,"type":"string"},"type":"array"},"needs":{"items":{"anyOf":[{"properties":{"contractId":{"minLength":1,"type":"string"},"kind":{"const":"contract","type":"string"},"required":{"type":"boolean"}},"required":["kind","contractId","required"],"type":"object"},{"properties":{"kind":{"const":"surface","type":"string"},"required":{"type":"boolean"},"surface":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"}},"required":["kind","surface","required"],"type":"object"},{"properties":{"capability":{"minLength":1,"type":"string"},"kind":{"const":"capability","type":"string"},"required":{"type":"boolean"}},"required":["kind","capability","required"],"type":"object"},{"properties":{"kind":{"const":"resource","type":"string"},"required":{"type":"boolean"},"resource":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"}},"required":["kind","resource","required"],"type":"object"}]},"type":"array"},"resources":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"},"type":"array"},"surfaces":{"items":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"},"type":"array"}},"required":["needs","capabilities","resources","surfaces"],"type":"object"},"disabled":{"type":"boolean"},"kind":{"anyOf":[{"const":"service","type":"string"},{"const":"device","type":"string"},{"const":"app","type":"string"},{"const":"cli","type":"string"},{"const":"native","type":"string"},{"const":"device-user","type":"string"}]},"updatedAt":{"format":"date-time","type":"string"},"version":{"minLength":1,"type":"string"}},"required":["deploymentId","kind","disabled","desiredState","version","createdAt","updatedAt"],"type":"object"},"materializedAuthority":{"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"},"error":{"minLength":1,"type":"string"},"grants":{"items":{"type":"object"},"type":"array"},"reconciledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"resourceBindings":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"binding":{"patternProperties":{"^.*$":{}},"type":"object"},"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"limits":{"anyOf":[{"patternProperties":{"^.*$":{}},"type":"object"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}},"required":["deploymentId","kind","alias","binding","limits","createdAt","updatedAt"],"type":"object"},"type":"array"},"status":{"anyOf":[{"const":"current","type":"string"},{"const":"pending","type":"string"},{"const":"failed","type":"string"}]}},"required":["deploymentId","desiredVersion","status","resourceBindings","grants","reconciledAt"],"type":"object"},"reconciliation":{"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"message":{"minLength":1,"type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"state":{"anyOf":[{"const":"idle","type":"string"},{"const":"running","type":"string"},{"const":"succeeded","type":"string"},{"const":"failed","type":"string"}]}},"required":["deploymentId","desiredVersion","state","startedAt","finishedAt"],"type":"object"}},"required":["authority","materializedAuthority"],"type":"object"} as const;
78
+ export const AuthDeploymentAuthorityReconcileResponseSchema = {"properties":{"authority":{"properties":{"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"desiredState":{"properties":{"capabilities":{"items":{"minLength":1,"type":"string"},"type":"array"},"needs":{"items":{"anyOf":[{"properties":{"contractId":{"minLength":1,"type":"string"},"kind":{"const":"contract","type":"string"},"required":{"type":"boolean"}},"required":["kind","contractId","required"],"type":"object"},{"properties":{"kind":{"const":"surface","type":"string"},"required":{"type":"boolean"},"surface":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"}},"required":["kind","surface","required"],"type":"object"},{"properties":{"capability":{"minLength":1,"type":"string"},"kind":{"const":"capability","type":"string"},"required":{"type":"boolean"}},"required":["kind","capability","required"],"type":"object"},{"properties":{"kind":{"const":"resource","type":"string"},"required":{"type":"boolean"},"resource":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"}},"required":["kind","resource","required"],"type":"object"}]},"type":"array"},"resources":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"definition":{"type":"object"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"required":{"type":"boolean"}},"required":["kind","alias","required"],"type":"object"},"type":"array"},"surfaces":{"items":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"},"type":"array"}},"required":["needs","capabilities","resources","surfaces"],"type":"object"},"disabled":{"type":"boolean"},"kind":{"anyOf":[{"const":"service","type":"string"},{"const":"device","type":"string"},{"const":"app","type":"string"},{"const":"cli","type":"string"},{"const":"native","type":"string"},{"const":"device-user","type":"string"}]},"updatedAt":{"format":"date-time","type":"string"},"version":{"minLength":1,"type":"string"}},"required":["deploymentId","kind","disabled","desiredState","version","createdAt","updatedAt"],"type":"object"},"materializedAuthority":{"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"},"error":{"minLength":1,"type":"string"},"grants":{"items":{"anyOf":[{"properties":{"capability":{"minLength":1,"type":"string"},"kind":{"const":"capability","type":"string"}},"required":["kind","capability"],"type":"object"},{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"const":"surface","type":"string"},"name":{"minLength":1,"type":"string"},"surfaceKind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]}},"required":["kind","contractId","surfaceKind","name"],"type":"object"},{"properties":{"direction":{"anyOf":[{"const":"publish","type":"string"},{"const":"subscribe","type":"string"}]},"grantSource":{"anyOf":[{"const":"owned-surface","type":"string"},{"const":"used-surface","type":"string"},{"const":"resource-binding","type":"string"},{"const":"platform-service","type":"string"},{"const":"transfer","type":"string"}]},"kind":{"const":"nats","type":"string"},"requiredCapabilities":{"items":{"minLength":1,"type":"string"},"type":"array"},"subject":{"minLength":1,"type":"string"},"surface":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"},{"const":"cancel","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"name":{"minLength":1,"type":"string"}},"required":["contractId","kind","name"],"type":"object"}},"required":["kind","direction","subject","requiredCapabilities","grantSource"],"type":"object"}]},"type":"array"},"reconciledAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"resourceBindings":{"items":{"properties":{"alias":{"minLength":1,"type":"string"},"binding":{"patternProperties":{"^.*$":{}},"type":"object"},"createdAt":{"format":"date-time","type":"string"},"deploymentId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"kv","type":"string"},{"const":"store","type":"string"},{"const":"jobs","type":"string"},{"const":"event-consumer","type":"string"},{"const":"transfer","type":"string"}]},"limits":{"anyOf":[{"patternProperties":{"^.*$":{}},"type":"object"},{"type":"null"}]},"updatedAt":{"format":"date-time","type":"string"}},"required":["deploymentId","kind","alias","binding","limits","createdAt","updatedAt"],"type":"object"},"type":"array"},"status":{"anyOf":[{"const":"current","type":"string"},{"const":"pending","type":"string"},{"const":"failed","type":"string"}]}},"required":["deploymentId","desiredVersion","status","resourceBindings","grants","reconciledAt"],"type":"object"},"reconciliation":{"properties":{"deploymentId":{"minLength":1,"type":"string"},"desiredVersion":{"minLength":1,"type":"string"},"finishedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"message":{"minLength":1,"type":"string"},"startedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"state":{"anyOf":[{"const":"idle","type":"string"},{"const":"running","type":"string"},{"const":"succeeded","type":"string"},{"const":"failed","type":"string"}]}},"required":["deploymentId","desiredVersion","state","startedAt","finishedAt"],"type":"object"}},"required":["authority","materializedAuthority"],"type":"object"} as const;
79
79
 
80
80
  export const AuthDeploymentAuthorityRejectRequestSchema = {"properties":{"planId":{"minLength":1,"type":"string"},"reason":{"minLength":1,"type":"string"}},"required":["planId"],"type":"object"} as const;
81
81
 
@@ -3,10 +3,10 @@ import type { RpcHandlerFn } from "../../../index.js";
3
3
  import type { API } from "./api.js";
4
4
 
5
5
  export const CONTRACT_ID = "trellis.auth@v1" as const;
6
- export const CONTRACT_DIGEST = "gLadyuZkZX2uxa3wnVMUJkDDddoVgRrDEzH8TIdeDyw" as const;
6
+ export const CONTRACT_DIGEST = "XdqgSxkrIhWOu1ODbOk6-QHLTlI52ZP-6qhYJpIdCMc" as const;
7
7
 
8
8
  export type AuthCapabilitiesListInput = { limit: number; offset?: number; };
9
- export type AuthCapabilitiesListOutput = { count: number; entries: Array<{ consequence?: string; contractDigest?: string; contractDisplayName?: string; contractId?: string; description: string; displayName: string; key: string; source: ("contract" | "platform"); }>; limit: number; nextOffset?: number; offset: number; };
9
+ export type AuthCapabilitiesListOutput = { count: number; entries: Array<{ consequence?: string; contractDigest?: string; contractDisplayName?: string; contractId?: string; deploymentId?: string; description: string; direction?: ("creates" | "given"); displayName: string; key: string; source: ("contract" | "platform"); }>; limit: number; nextOffset?: number; offset: number; };
10
10
 
11
11
  export type AuthCapabilityGroupsDeleteInput = { groupKey: string; };
12
12
  export type AuthCapabilityGroupsDeleteOutput = { success: boolean; };
@@ -36,7 +36,7 @@ export type AuthDeploymentAuthorityAcceptUpdateInput = { expectedDesiredVersion?
36
36
  export type AuthDeploymentAuthorityAcceptUpdateOutput = { authority: { createdAt: string; deploymentId: string; desiredState: { capabilities: Array<string>; needs: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; resources: Array<{ alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }>; surfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; }; disabled: boolean; kind: ("service" | "device" | "app" | "cli" | "native" | "device-user"); updatedAt: string; version: string; }; };
37
37
 
38
38
  export type AuthDeploymentAuthorityGetInput = { deploymentId: string; };
39
- export type AuthDeploymentAuthorityGetOutput = { authority: { createdAt: string; deploymentId: string; desiredState: { capabilities: Array<string>; needs: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; resources: Array<{ alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }>; surfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; }; disabled: boolean; kind: ("service" | "device" | "app" | "cli" | "native" | "device-user"); updatedAt: string; version: string; }; grantOverrides: Array<({ capability: string; capabilityGroupKey: null; contractId: string; deploymentId: string; grantKind: "capability"; identityKind: "web"; origin: string; sessionPublicKey: null; } | { capability: null; capabilityGroupKey: string; contractId: string; deploymentId: string; grantKind: "capability-group"; identityKind: "web"; origin: string; sessionPublicKey: null; } | { capability: string; capabilityGroupKey: null; contractId: string; deploymentId: string; grantKind: "capability"; identityKind: "session"; origin: null; sessionPublicKey: string; } | { capability: null; capabilityGroupKey: string; contractId: string; deploymentId: string; grantKind: "capability-group"; identityKind: "session"; origin: null; sessionPublicKey: string; })>; materializedAuthority: ({ deploymentId: string; desiredVersion: string; error?: string; grants: Array<{ }>; reconciledAt: (string | null); resourceBindings: Array<{ alias: string; binding: { [k: string]: unknown; }; createdAt: string; deploymentId: string; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); limits: ({ [k: string]: unknown; } | null); updatedAt: string; }>; status: ("current" | "pending" | "failed"); } | null); portalRoute: ({ deploymentId: string; disabled: boolean; entryUrl: (string | null); portalId: (string | null); updatedAt: string; } | null); };
39
+ export type AuthDeploymentAuthorityGetOutput = { authority: { createdAt: string; deploymentId: string; desiredState: { capabilities: Array<string>; needs: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; resources: Array<{ alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }>; surfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; }; disabled: boolean; kind: ("service" | "device" | "app" | "cli" | "native" | "device-user"); updatedAt: string; version: string; }; grantOverrides: Array<({ capability: string; capabilityGroupKey: null; contractId: string; deploymentId: string; grantKind: "capability"; identityKind: "web"; origin: string; sessionPublicKey: null; } | { capability: null; capabilityGroupKey: string; contractId: string; deploymentId: string; grantKind: "capability-group"; identityKind: "web"; origin: string; sessionPublicKey: null; } | { capability: string; capabilityGroupKey: null; contractId: string; deploymentId: string; grantKind: "capability"; identityKind: "session"; origin: null; sessionPublicKey: string; } | { capability: null; capabilityGroupKey: string; contractId: string; deploymentId: string; grantKind: "capability-group"; identityKind: "session"; origin: null; sessionPublicKey: string; })>; materializedAuthority: ({ deploymentId: string; desiredVersion: string; error?: string; grants: Array<({ capability: string; kind: "capability"; } | { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: "surface"; name: string; surfaceKind: ("rpc" | "operation" | "event" | "feed"); } | { direction: ("publish" | "subscribe"); grantSource: ("owned-surface" | "used-surface" | "resource-binding" | "platform-service" | "transfer"); kind: "nats"; requiredCapabilities: Array<string>; subject: string; surface?: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; })>; reconciledAt: (string | null); resourceBindings: Array<{ alias: string; binding: { [k: string]: unknown; }; createdAt: string; deploymentId: string; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); limits: ({ [k: string]: unknown; } | null); updatedAt: string; }>; status: ("current" | "pending" | "failed"); } | null); portalRoute: ({ deploymentId: string; disabled: boolean; entryUrl: (string | null); portalId: (string | null); updatedAt: string; } | null); };
40
40
 
41
41
  export type AuthDeploymentAuthorityGrantOverridesListInput = { limit: number; offset?: number; };
42
42
  export type AuthDeploymentAuthorityGrantOverridesListOutput = { count: number; entries: Array<({ capability: string; capabilityGroupKey: null; contractId: string; deploymentId: string; grantKind: "capability"; identityKind: "web"; origin: string; sessionPublicKey: null; } | { capability: null; capabilityGroupKey: string; contractId: string; deploymentId: string; grantKind: "capability-group"; identityKind: "web"; origin: string; sessionPublicKey: null; } | { capability: string; capabilityGroupKey: null; contractId: string; deploymentId: string; grantKind: "capability"; identityKind: "session"; origin: null; sessionPublicKey: string; } | { capability: null; capabilityGroupKey: string; contractId: string; deploymentId: string; grantKind: "capability-group"; identityKind: "session"; origin: null; sessionPublicKey: string; })>; limit: number; nextOffset?: number; offset: number; };
@@ -60,7 +60,7 @@ export type AuthDeploymentAuthorityPlansListInput = { classification?: ("update"
60
60
  export type AuthDeploymentAuthorityPlansListOutput = { count: number; entries: Array<({ classification: "update"; createdAt: string; decisionAt?: (string | null); decisionBy?: ({ [k: string]: unknown; } | null); decisionReason?: (string | null); deploymentId: string; desiredChange: { }; expiresAt?: string; materializationPreview: { }; planId: string; proposal: { contract?: { }; contractDigest: string; contractId: string; deploymentId: string; proposalId?: string; providedSurfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; requestedNeeds: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; summary?: { }; }; state?: ("pending" | "accepted" | "rejected" | "expired"); warnings: Array<string>; } | { acknowledgementRequired: boolean; classification: "migration"; createdAt: string; decisionAt?: (string | null); decisionBy?: ({ [k: string]: unknown; } | null); decisionReason?: (string | null); deploymentId: string; desiredChange: { }; expiresAt?: string; materializationPreview: { }; planId: string; proposal: { contract?: { }; contractDigest: string; contractId: string; deploymentId: string; proposalId?: string; providedSurfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; requestedNeeds: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; summary?: { }; }; state?: ("pending" | "accepted" | "rejected" | "expired"); warnings: Array<string>; })>; limit: number; nextOffset?: number; offset: number; };
61
61
 
62
62
  export type AuthDeploymentAuthorityReconcileInput = { deploymentId: string; desiredVersion?: string; };
63
- export type AuthDeploymentAuthorityReconcileOutput = { authority: { createdAt: string; deploymentId: string; desiredState: { capabilities: Array<string>; needs: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; resources: Array<{ alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }>; surfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; }; disabled: boolean; kind: ("service" | "device" | "app" | "cli" | "native" | "device-user"); updatedAt: string; version: string; }; materializedAuthority: { deploymentId: string; desiredVersion: string; error?: string; grants: Array<{ }>; reconciledAt: (string | null); resourceBindings: Array<{ alias: string; binding: { [k: string]: unknown; }; createdAt: string; deploymentId: string; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); limits: ({ [k: string]: unknown; } | null); updatedAt: string; }>; status: ("current" | "pending" | "failed"); }; reconciliation?: { deploymentId: string; desiredVersion: string; finishedAt: (string | null); message?: string; startedAt: (string | null); state: ("idle" | "running" | "succeeded" | "failed"); }; };
63
+ export type AuthDeploymentAuthorityReconcileOutput = { authority: { createdAt: string; deploymentId: string; desiredState: { capabilities: Array<string>; needs: Array<({ contractId: string; kind: "contract"; required: boolean; } | { kind: "surface"; required: boolean; surface: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; } | { capability: string; kind: "capability"; required: boolean; } | { kind: "resource"; required: boolean; resource: { alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }; })>; resources: Array<{ alias: string; definition?: { }; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); required: boolean; }>; surfaces: Array<{ action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }>; }; disabled: boolean; kind: ("service" | "device" | "app" | "cli" | "native" | "device-user"); updatedAt: string; version: string; }; materializedAuthority: { deploymentId: string; desiredVersion: string; error?: string; grants: Array<({ capability: string; kind: "capability"; } | { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: "surface"; name: string; surfaceKind: ("rpc" | "operation" | "event" | "feed"); } | { direction: ("publish" | "subscribe"); grantSource: ("owned-surface" | "used-surface" | "resource-binding" | "platform-service" | "transfer"); kind: "nats"; requiredCapabilities: Array<string>; subject: string; surface?: { action?: ("call" | "publish" | "subscribe" | "observe" | "cancel"); contractId: string; kind: ("rpc" | "operation" | "event" | "feed"); name: string; }; })>; reconciledAt: (string | null); resourceBindings: Array<{ alias: string; binding: { [k: string]: unknown; }; createdAt: string; deploymentId: string; kind: ("kv" | "store" | "jobs" | "event-consumer" | "transfer"); limits: ({ [k: string]: unknown; } | null); updatedAt: string; }>; status: ("current" | "pending" | "failed"); }; reconciliation?: { deploymentId: string; desiredVersion: string; finishedAt: (string | null); message?: string; startedAt: (string | null); state: ("idle" | "running" | "succeeded" | "failed"); }; };
64
64
 
65
65
  export type AuthDeploymentAuthorityRejectInput = { planId: string; reason?: string; };
66
66
  export type AuthDeploymentAuthorityRejectOutput = { success: boolean; };
@@ -49,7 +49,12 @@ import {
49
49
  } from "@qlever-llc/result";
50
50
  import { Type } from "typebox";
51
51
  import { Value } from "typebox/value";
52
- import { type HealthCheckFn, ServiceHealth } from "./health.js";
52
+ import {
53
+ type HealthCheckFn,
54
+ ServiceHealth,
55
+ type ServiceHealthCheck,
56
+ type ServiceHealthInfo,
57
+ } from "./health.js";
53
58
  import { mountStandardHealthRpc } from "./health_rpc.js";
54
59
  import type { EventDesc, RPCDesc } from "../contracts.js";
55
60
  import type {
@@ -1320,6 +1325,23 @@ type BoundJobsFacadeOf<
1320
1325
  >;
1321
1326
  };
1322
1327
 
1328
+ type BoundServiceHealth<TDeps> = Omit<ServiceHealth, "add" | "setInfo"> & {
1329
+ setInfo(
1330
+ info:
1331
+ | ServiceHealthInfo
1332
+ | ((args: { deps: TDeps }) =>
1333
+ | ServiceHealthInfo
1334
+ | undefined
1335
+ | Promise<ServiceHealthInfo | undefined>),
1336
+ ): void;
1337
+ add(
1338
+ name: string,
1339
+ check: (args: { deps: TDeps }) =>
1340
+ | ServiceHealthCheck
1341
+ | Promise<ServiceHealthCheck>,
1342
+ ): () => void;
1343
+ };
1344
+
1323
1345
  /** Service wrapper returned by `TrellisService.with(deps)`. */
1324
1346
  export type BoundTrellisService<
1325
1347
  TOwnedApi extends TrellisAPI = TrellisAPI,
@@ -1335,7 +1357,6 @@ export type BoundTrellisService<
1335
1357
  | "nc"
1336
1358
  | "kv"
1337
1359
  | "store"
1338
- | "health"
1339
1360
  | "connection"
1340
1361
  | "createTransfer"
1341
1362
  | "completeOperation"
@@ -1350,6 +1371,7 @@ export type BoundTrellisService<
1350
1371
  TJobs,
1351
1372
  TDeps
1352
1373
  >;
1374
+ readonly health: BoundServiceHealth<TDeps>;
1353
1375
  readonly jobs: BoundJobsFacadeOf<TJobs, TTrellisApi, TKv, TDeps>;
1354
1376
  readonly handle: BoundTypedServiceHandleFacade<
1355
1377
  TOwnedApi,
@@ -2691,7 +2713,7 @@ export class TrellisService<
2691
2713
  kv: this.kv,
2692
2714
  store: this.store,
2693
2715
  jobs: createBoundJobsFacade({ jobs: this.jobs, deps }),
2694
- health: this.health,
2716
+ health: this.#createBoundHealth(deps),
2695
2717
  handle: this.#createBoundHandleFacade(deps),
2696
2718
  connection: this.connection,
2697
2719
  createTransfer: (args) => this.createTransfer(args),
@@ -2703,6 +2725,33 @@ export class TrellisService<
2703
2725
  };
2704
2726
  }
2705
2727
 
2728
+ #createBoundHealth<TDeps>(deps: TDeps): BoundServiceHealth<TDeps> {
2729
+ const health = this.health;
2730
+ return {
2731
+ serviceName: health.serviceName,
2732
+ kind: health.kind,
2733
+ instanceId: health.instanceId,
2734
+ contractId: health.contractId,
2735
+ contractDigest: health.contractDigest,
2736
+ startedAt: health.startedAt,
2737
+ publishIntervalMs: health.publishIntervalMs,
2738
+ setInfo(info) {
2739
+ if (typeof info !== "function") {
2740
+ health.setInfo(info);
2741
+ return;
2742
+ }
2743
+
2744
+ health.setInfo(() => info({ deps }));
2745
+ },
2746
+ add(name, check) {
2747
+ return health.add(name, () => check({ deps }));
2748
+ },
2749
+ checks: () => health.checks(),
2750
+ response: () => health.response(),
2751
+ heartbeat: () => health.heartbeat(),
2752
+ };
2753
+ }
2754
+
2706
2755
  #createBoundEventFacade<TDeps>(
2707
2756
  deps: TDeps,
2708
2757
  ): BoundActiveEventFacade<TTrellisApi, TTrellisApi, TKv, TJobs, TDeps> {