@omnicross/subscriptions 0.1.10 → 0.2.0
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/LICENSE +21 -21
- package/NOTICE +12 -12
- package/README.md +15 -15
- package/dist/index.cjs +874 -2
- package/dist/index.d.cts +97 -1
- package/dist/index.d.ts +97 -1
- package/dist/index.js +872 -0
- package/package.json +60 -59
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,8 @@ import { TransformerService } from '@omnicross/core/transformer/TransformerServi
|
|
|
10
10
|
import { Transformer } from '@omnicross/core/transformer/types';
|
|
11
11
|
export { FetchLike } from '@omnicross/core/auth/GeminiCodeAssistProjectResolver';
|
|
12
12
|
export { claudeOAuth, codexOAuth, geminiOAuth } from './oauth.cjs';
|
|
13
|
+
import { ImageProvider } from '@omnicross/core/image-generation';
|
|
14
|
+
import { ImageCapabilityEvidenceLayer, ImageQuality, ImageBackground, ImageOutputFormat, ImageModeration } from '@omnicross/contracts/image-generation-types';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* SubscriptionCredentialStore — the credential port the subscription block
|
|
@@ -349,4 +351,98 @@ declare class SubscriptionDispatcher {
|
|
|
349
351
|
private buildRequestSummary;
|
|
350
352
|
}
|
|
351
353
|
|
|
352
|
-
|
|
354
|
+
/** Safe evidence request; accountId is trusted-process input and must not be logged. */
|
|
355
|
+
interface CodexImageCapabilityEvidenceRequest {
|
|
356
|
+
readonly accountId: string;
|
|
357
|
+
readonly signal: AbortSignal;
|
|
358
|
+
}
|
|
359
|
+
interface CodexImageCapabilityEvidence {
|
|
360
|
+
readonly account: ImageCapabilityEvidenceLayer;
|
|
361
|
+
readonly upstream: ImageCapabilityEvidenceLayer;
|
|
362
|
+
/** Enable only when these response fields have separate verified provenance. */
|
|
363
|
+
readonly verifiedResponseFields?: {
|
|
364
|
+
readonly usage?: boolean;
|
|
365
|
+
readonly revisedPrompt?: boolean;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
interface CodexImageCapabilityEvidenceSource {
|
|
369
|
+
resolve(request: CodexImageCapabilityEvidenceRequest): Promise<CodexImageCapabilityEvidence>;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
declare const imageExecutionAccountKeyBrand: unique symbol;
|
|
373
|
+
/** A daemon-keyed, non-public scheduling identity for one selected account. */
|
|
374
|
+
type ImageExecutionAccountKey = string & {
|
|
375
|
+
readonly [imageExecutionAccountKeyBrand]: 'image-execution-account-key';
|
|
376
|
+
};
|
|
377
|
+
/** Credential- and content-blind admission input for selected-account work. */
|
|
378
|
+
interface ImageExecutionSchedulerRequest {
|
|
379
|
+
readonly tenantId: string;
|
|
380
|
+
readonly accountKey: ImageExecutionAccountKey;
|
|
381
|
+
readonly signal: AbortSignal;
|
|
382
|
+
}
|
|
383
|
+
interface ImageExecutionSchedulerGrant {
|
|
384
|
+
/** Optional scheduler-owned cancellation used for retirement/shutdown. */
|
|
385
|
+
readonly signal?: AbortSignal;
|
|
386
|
+
/** Release is required to be idempotent and safe on every terminal path. */
|
|
387
|
+
release(): Promise<void> | void;
|
|
388
|
+
}
|
|
389
|
+
interface ImageExecutionScheduler {
|
|
390
|
+
/**
|
|
391
|
+
* Immediately derive a local opaque key. The raw identity is transient and
|
|
392
|
+
* must never enter scheduler state, status, logs, or metrics.
|
|
393
|
+
*/
|
|
394
|
+
deriveAccountKey(selectedAccountId: string): ImageExecutionAccountKey;
|
|
395
|
+
/** The scheduler instance and its limits are bound to one runtime snapshot. */
|
|
396
|
+
acquire(request: ImageExecutionSchedulerRequest): Promise<ImageExecutionSchedulerGrant> | ImageExecutionSchedulerGrant;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface CodexSubscriptionImageProviderOptions {
|
|
400
|
+
readonly authStrategy: AuthStrategy;
|
|
401
|
+
readonly evidenceSource?: CodexImageCapabilityEvidenceSource;
|
|
402
|
+
readonly executionScheduler?: ImageExecutionScheduler;
|
|
403
|
+
readonly generationTimeoutMs?: number;
|
|
404
|
+
readonly now?: () => number;
|
|
405
|
+
}
|
|
406
|
+
/** Create the dormant, account-bound Codex subscription image provider. */
|
|
407
|
+
declare function createCodexSubscriptionImageProvider(options: CodexSubscriptionImageProviderOptions): ImageProvider;
|
|
408
|
+
|
|
409
|
+
interface CodexImageCapabilityTestedRequest {
|
|
410
|
+
readonly action: 'generate';
|
|
411
|
+
readonly n: 1;
|
|
412
|
+
readonly quality: ImageQuality;
|
|
413
|
+
readonly size: string;
|
|
414
|
+
readonly background: ImageBackground;
|
|
415
|
+
readonly outputFormat: ImageOutputFormat;
|
|
416
|
+
readonly moderation: ImageModeration;
|
|
417
|
+
readonly stream: false;
|
|
418
|
+
readonly partialImages: 0;
|
|
419
|
+
readonly outputCompression?: number;
|
|
420
|
+
}
|
|
421
|
+
interface CodexImageCapabilityObservedResponseFields {
|
|
422
|
+
readonly usage?: true;
|
|
423
|
+
readonly revisedPrompt?: true;
|
|
424
|
+
}
|
|
425
|
+
interface CodexImageCapabilityObservation {
|
|
426
|
+
/** Sensitive transient identity. Persist only after a local keyed HMAC. */
|
|
427
|
+
readonly accountId: string;
|
|
428
|
+
readonly model: 'gpt-image-2';
|
|
429
|
+
readonly request: CodexImageCapabilityTestedRequest;
|
|
430
|
+
readonly responseFields?: CodexImageCapabilityObservedResponseFields;
|
|
431
|
+
}
|
|
432
|
+
interface CodexImageLiveVerificationRequest {
|
|
433
|
+
readonly signal: AbortSignal;
|
|
434
|
+
readonly sessionKey?: string;
|
|
435
|
+
readonly preferredAccountId?: string;
|
|
436
|
+
readonly preferredAccountGroup?: string;
|
|
437
|
+
readonly boundAccountFallbackPolicy?: 'strict' | 'pool';
|
|
438
|
+
}
|
|
439
|
+
interface CodexImageLiveVerifierOptions {
|
|
440
|
+
readonly authStrategy: AuthStrategy;
|
|
441
|
+
readonly generationTimeoutMs?: number;
|
|
442
|
+
}
|
|
443
|
+
interface CodexImageLiveVerifier {
|
|
444
|
+
verify(request: CodexImageLiveVerificationRequest): Promise<CodexImageCapabilityObservation>;
|
|
445
|
+
}
|
|
446
|
+
declare function createCodexImageLiveVerifier(options: CodexImageLiveVerifierOptions): CodexImageLiveVerifier;
|
|
447
|
+
|
|
448
|
+
export { type CodexImageCapabilityEvidence, type CodexImageCapabilityEvidenceRequest, type CodexImageCapabilityEvidenceSource, type CodexImageCapabilityObservation, type CodexImageCapabilityObservedResponseFields, type CodexImageCapabilityTestedRequest, type CodexImageLiveVerificationRequest, type CodexImageLiveVerifier, type CodexImageLiveVerifierOptions, type CodexSubscriptionImageProviderOptions, DEFAULT_ACCOUNT_PRIORITY, type DispatchRequest, type DispatcherHooks, type ImageExecutionAccountKey, type ImageExecutionScheduler, type ImageExecutionSchedulerGrant, type ImageExecutionSchedulerRequest, LAST_USED_PERSIST_THROTTLE_MS, SESSION_AFFINITY_TTL_MS, type SchedulableAccount, type SelectInput, type SelectResult, SubscriptionAccountSelector, SubscriptionAccountService, type SubscriptionCredentialStore, SubscriptionDispatcher, SubscriptionProviderRegistry, createCodexImageLiveVerifier, createCodexSubscriptionImageProvider, getSubscriptionAccountService, getSubscriptionProviderRegistry, setSubscriptionAccountService, setSubscriptionProviderRegistry };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import { TransformerService } from '@omnicross/core/transformer/TransformerServi
|
|
|
10
10
|
import { Transformer } from '@omnicross/core/transformer/types';
|
|
11
11
|
export { FetchLike } from '@omnicross/core/auth/GeminiCodeAssistProjectResolver';
|
|
12
12
|
export { claudeOAuth, codexOAuth, geminiOAuth } from './oauth.js';
|
|
13
|
+
import { ImageProvider } from '@omnicross/core/image-generation';
|
|
14
|
+
import { ImageCapabilityEvidenceLayer, ImageQuality, ImageBackground, ImageOutputFormat, ImageModeration } from '@omnicross/contracts/image-generation-types';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* SubscriptionCredentialStore — the credential port the subscription block
|
|
@@ -349,4 +351,98 @@ declare class SubscriptionDispatcher {
|
|
|
349
351
|
private buildRequestSummary;
|
|
350
352
|
}
|
|
351
353
|
|
|
352
|
-
|
|
354
|
+
/** Safe evidence request; accountId is trusted-process input and must not be logged. */
|
|
355
|
+
interface CodexImageCapabilityEvidenceRequest {
|
|
356
|
+
readonly accountId: string;
|
|
357
|
+
readonly signal: AbortSignal;
|
|
358
|
+
}
|
|
359
|
+
interface CodexImageCapabilityEvidence {
|
|
360
|
+
readonly account: ImageCapabilityEvidenceLayer;
|
|
361
|
+
readonly upstream: ImageCapabilityEvidenceLayer;
|
|
362
|
+
/** Enable only when these response fields have separate verified provenance. */
|
|
363
|
+
readonly verifiedResponseFields?: {
|
|
364
|
+
readonly usage?: boolean;
|
|
365
|
+
readonly revisedPrompt?: boolean;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
interface CodexImageCapabilityEvidenceSource {
|
|
369
|
+
resolve(request: CodexImageCapabilityEvidenceRequest): Promise<CodexImageCapabilityEvidence>;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
declare const imageExecutionAccountKeyBrand: unique symbol;
|
|
373
|
+
/** A daemon-keyed, non-public scheduling identity for one selected account. */
|
|
374
|
+
type ImageExecutionAccountKey = string & {
|
|
375
|
+
readonly [imageExecutionAccountKeyBrand]: 'image-execution-account-key';
|
|
376
|
+
};
|
|
377
|
+
/** Credential- and content-blind admission input for selected-account work. */
|
|
378
|
+
interface ImageExecutionSchedulerRequest {
|
|
379
|
+
readonly tenantId: string;
|
|
380
|
+
readonly accountKey: ImageExecutionAccountKey;
|
|
381
|
+
readonly signal: AbortSignal;
|
|
382
|
+
}
|
|
383
|
+
interface ImageExecutionSchedulerGrant {
|
|
384
|
+
/** Optional scheduler-owned cancellation used for retirement/shutdown. */
|
|
385
|
+
readonly signal?: AbortSignal;
|
|
386
|
+
/** Release is required to be idempotent and safe on every terminal path. */
|
|
387
|
+
release(): Promise<void> | void;
|
|
388
|
+
}
|
|
389
|
+
interface ImageExecutionScheduler {
|
|
390
|
+
/**
|
|
391
|
+
* Immediately derive a local opaque key. The raw identity is transient and
|
|
392
|
+
* must never enter scheduler state, status, logs, or metrics.
|
|
393
|
+
*/
|
|
394
|
+
deriveAccountKey(selectedAccountId: string): ImageExecutionAccountKey;
|
|
395
|
+
/** The scheduler instance and its limits are bound to one runtime snapshot. */
|
|
396
|
+
acquire(request: ImageExecutionSchedulerRequest): Promise<ImageExecutionSchedulerGrant> | ImageExecutionSchedulerGrant;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface CodexSubscriptionImageProviderOptions {
|
|
400
|
+
readonly authStrategy: AuthStrategy;
|
|
401
|
+
readonly evidenceSource?: CodexImageCapabilityEvidenceSource;
|
|
402
|
+
readonly executionScheduler?: ImageExecutionScheduler;
|
|
403
|
+
readonly generationTimeoutMs?: number;
|
|
404
|
+
readonly now?: () => number;
|
|
405
|
+
}
|
|
406
|
+
/** Create the dormant, account-bound Codex subscription image provider. */
|
|
407
|
+
declare function createCodexSubscriptionImageProvider(options: CodexSubscriptionImageProviderOptions): ImageProvider;
|
|
408
|
+
|
|
409
|
+
interface CodexImageCapabilityTestedRequest {
|
|
410
|
+
readonly action: 'generate';
|
|
411
|
+
readonly n: 1;
|
|
412
|
+
readonly quality: ImageQuality;
|
|
413
|
+
readonly size: string;
|
|
414
|
+
readonly background: ImageBackground;
|
|
415
|
+
readonly outputFormat: ImageOutputFormat;
|
|
416
|
+
readonly moderation: ImageModeration;
|
|
417
|
+
readonly stream: false;
|
|
418
|
+
readonly partialImages: 0;
|
|
419
|
+
readonly outputCompression?: number;
|
|
420
|
+
}
|
|
421
|
+
interface CodexImageCapabilityObservedResponseFields {
|
|
422
|
+
readonly usage?: true;
|
|
423
|
+
readonly revisedPrompt?: true;
|
|
424
|
+
}
|
|
425
|
+
interface CodexImageCapabilityObservation {
|
|
426
|
+
/** Sensitive transient identity. Persist only after a local keyed HMAC. */
|
|
427
|
+
readonly accountId: string;
|
|
428
|
+
readonly model: 'gpt-image-2';
|
|
429
|
+
readonly request: CodexImageCapabilityTestedRequest;
|
|
430
|
+
readonly responseFields?: CodexImageCapabilityObservedResponseFields;
|
|
431
|
+
}
|
|
432
|
+
interface CodexImageLiveVerificationRequest {
|
|
433
|
+
readonly signal: AbortSignal;
|
|
434
|
+
readonly sessionKey?: string;
|
|
435
|
+
readonly preferredAccountId?: string;
|
|
436
|
+
readonly preferredAccountGroup?: string;
|
|
437
|
+
readonly boundAccountFallbackPolicy?: 'strict' | 'pool';
|
|
438
|
+
}
|
|
439
|
+
interface CodexImageLiveVerifierOptions {
|
|
440
|
+
readonly authStrategy: AuthStrategy;
|
|
441
|
+
readonly generationTimeoutMs?: number;
|
|
442
|
+
}
|
|
443
|
+
interface CodexImageLiveVerifier {
|
|
444
|
+
verify(request: CodexImageLiveVerificationRequest): Promise<CodexImageCapabilityObservation>;
|
|
445
|
+
}
|
|
446
|
+
declare function createCodexImageLiveVerifier(options: CodexImageLiveVerifierOptions): CodexImageLiveVerifier;
|
|
447
|
+
|
|
448
|
+
export { type CodexImageCapabilityEvidence, type CodexImageCapabilityEvidenceRequest, type CodexImageCapabilityEvidenceSource, type CodexImageCapabilityObservation, type CodexImageCapabilityObservedResponseFields, type CodexImageCapabilityTestedRequest, type CodexImageLiveVerificationRequest, type CodexImageLiveVerifier, type CodexImageLiveVerifierOptions, type CodexSubscriptionImageProviderOptions, DEFAULT_ACCOUNT_PRIORITY, type DispatchRequest, type DispatcherHooks, type ImageExecutionAccountKey, type ImageExecutionScheduler, type ImageExecutionSchedulerGrant, type ImageExecutionSchedulerRequest, LAST_USED_PERSIST_THROTTLE_MS, SESSION_AFFINITY_TTL_MS, type SchedulableAccount, type SelectInput, type SelectResult, SubscriptionAccountSelector, SubscriptionAccountService, type SubscriptionCredentialStore, SubscriptionDispatcher, SubscriptionProviderRegistry, createCodexImageLiveVerifier, createCodexSubscriptionImageProvider, getSubscriptionAccountService, getSubscriptionProviderRegistry, setSubscriptionAccountService, setSubscriptionProviderRegistry };
|