@@ -896,9 +896,43 @@ export class ApiClient {
896896 participantAgents ?: string [ ] ;
897897 participantIdentityIds ?: Array < string | number | bigint > ;
898898 requiredSignatures ?: number ;
899+ /**
900+ * Atomic combined-flow flag. When `true`, the daemon registers the
901+ * CG on-chain in the same call after the local create step
902+ * succeeds. Required when `pcaAccountId` is supplied (a standalone
903+ * `createContextGraph` does NOT persist PCA ids — Codex PR #502
904+ * round-3).
905+ */
906+ register ?: boolean ;
907+ /**
908+ * Publish policy override forwarded to `registerContextGraph` in
909+ * the combined-flow path. Only meaningful together with
910+ * `register: true`. The agent otherwise defaults
911+ * `publishPolicy = curated (0)` for curated/private CGs and
912+ * `publishPolicy = open (1)` for public CGs — which makes the
913+ * valid `{ accessPolicy: 0 (public), publishPolicy: 0 (curated),
914+ * pcaAccountId }` combo unreachable unless the caller can pin
915+ * `publishPolicy` explicitly. Codex PR #502 round-10 (raised by
916+ * @branarakic ).
917+ */
918+ publishPolicy ?: number ;
919+ /**
920+ * Publishing Conviction Account id for PCA-curated registration.
921+ * Only meaningful together with `register: true`. The daemon
922+ * rejects the create-only-with-pcaAccountId combo with a 400
923+ * (Codex PR #502 round-5). For a two-step flow, use
924+ * {@link registerContextGraph} instead.
925+ */
926+ pcaAccountId ?: string | number | bigint ;
899927 } , allowedPeers ?: string [ ] ) : Promise < {
900928 created : string ;
901929 uri : string ;
930+ /** Present only when caller passed `register: true`. */
931+ registered ?: boolean ;
932+ onChainId ?: string ;
933+ /** Present when `register: true` was requested but the register leg failed. */
934+ registerError ?: string ;
935+ hint ?: string ;
902936 } > {
903937 return this . post ( '/api/context-graph/create' , {
904938 id,
@@ -913,6 +947,9 @@ export class ApiClient {
913947 ? { participantIdentityIds : options . participantIdentityIds . map ( ( id ) => id . toString ( ) ) }
914948 : { } ) ,
915949 ...( options ?. requiredSignatures != null ? { requiredSignatures : options . requiredSignatures } : { } ) ,
950+ ...( options ?. register === true ? { register : true } : { } ) ,
951+ ...( options ?. publishPolicy != null ? { publishPolicy : options . publishPolicy } : { } ) ,
952+ ...( options ?. pcaAccountId != null ? { pcaAccountId : options . pcaAccountId . toString ( ) } : { } ) ,
916953 } ) ;
917954 }
918955
@@ -928,6 +965,7 @@ export class ApiClient {
928965 revealOnChain ?: boolean ;
929966 accessPolicy ?: number ;
930967 publishPolicy ?: number ;
968+ pcaAccountId ?: string | number | bigint ;
931969 } ) : Promise < {
932970 registered : string ;
933971 onChainId : string ;
@@ -937,6 +975,7 @@ export class ApiClient {
937975 id,
938976 ...( opts ?. accessPolicy != null ? { accessPolicy : opts . accessPolicy } : { } ) ,
939977 ...( opts ?. publishPolicy != null ? { publishPolicy : opts . publishPolicy } : { } ) ,
978+ ...( opts ?. pcaAccountId != null ? { pcaAccountId : opts . pcaAccountId . toString ( ) } : { } ) ,
940979 } ) ;
941980 }
942981
0 commit comments