@odla-ai/cli 0.8.0 → 0.9.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/dist/index.d.cts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
2
+ import { HostedSecurityJob, GitHubConnectionStatus, GitHubSecuritySource, HostedSecurityIntentResponse, HostedSecurityPlan, HostedSecurityReport, HostedSecurityJobStatus } from '@odla-ai/security/hosted';
3
+ export { GitHubConnectionAttempt, GitHubConnectionStatus, GitHubSecuritySource, HostedSecurityCounts, HostedSecurityCoverage, HostedSecurityIntent, HostedSecurityIntentResponse, HostedSecurityJob, HostedSecurityJobStatus, HostedSecurityPlan, HostedSecurityPlanRoute, HostedSecurityReport, HostedSecurityReportFinding, HostedSecurityRoute } from '@odla-ai/security/hosted';
2
4
 
3
5
  /** Injectable side-effect boundaries used to run and test the command dispatcher. */
4
6
  interface CliDependencies {
@@ -89,7 +91,7 @@ declare function adminAi(options: AdminAiOptions): Promise<void>;
89
91
  /** Stable, machine-readable division of work between the CLI, coding agent,
90
92
  * human operator, and Studio. Printed by `odla-ai capabilities --json`. */
91
93
  declare const CAPABILITIES: {
92
- readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "connect/revoke source-read-only GitHub sources and drive commit-pinned hosted security jobs without PATs or provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
94
+ readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "store tenant-vault secrets (including the Clerk webhook secret and reserved Clerk secret key) write-only from stdin or an env var", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "connect/revoke source-read-only GitHub sources and drive commit-pinned hosted security jobs without PATs or provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
93
95
  readonly agent: readonly ["install and import the selected odla SDKs", "wrap the Worker with withObservability and choose useful telemetry", "make application-specific schema, rules, auth, UI, and migration decisions"];
94
96
  readonly human: readonly ["approve the odla device code and one-off third-party logins", "consent to production changes with --yes", "request destructive credential rotation explicitly", "review application semantics, security findings, releases, and merges", "approve redacted-source disclosure before hosted security reasoning", "approve GitHub App repository access separately from redacted-snippet disclosure"];
95
97
  readonly studio: readonly ["view telemetry and environment state", "perform manual credential recovery when the CLI's local shown-once copy is unavailable", "configure system AI purposes and view app/environment/run-attributed usage", "connect/revoke GitHub security sources and inspect ref-to-SHA jobs, routes, retention, coverage, and normalized reports"];
@@ -365,6 +367,47 @@ interface SecretsPushOptions {
365
367
  */
366
368
  declare function secretsPush(options: SecretsPushOptions): Promise<void>;
367
369
 
370
+ /**
371
+ * Inputs for one write-only tenant-vault transfer (`secrets set` /
372
+ * `secrets set-clerk-key`). Values may come only from a named environment
373
+ * variable or stdin, so a producer command can be piped straight into the
374
+ * vault without the secret ever being displayed or stored on disk.
375
+ */
376
+ interface SecretsSetOptions {
377
+ configPath: string;
378
+ env: string;
379
+ /** Vault secret name (`secrets set` only; `$`-prefixed names are reserved). */
380
+ name?: string;
381
+ fromEnv?: string;
382
+ stdin?: boolean;
383
+ /** Explicit consent for a prod-named env (and for sk_live_ into a non-prod env). */
384
+ yes?: boolean;
385
+ /** Developer token override; defaults to $ODLA_DEV_TOKEN, the cached token, or a device handshake. */
386
+ token?: string;
387
+ open?: boolean;
388
+ interactive?: boolean;
389
+ openApprovalUrl?: (url: string) => Promise<void>;
390
+ fetch?: typeof fetch;
391
+ readStdin?: () => Promise<string>;
392
+ stdout?: Pick<typeof console, "log" | "error">;
393
+ }
394
+ /**
395
+ * Store one named secret in the env's tenant vault (the same write-only slot
396
+ * Studio's Secrets panel fills), e.g. `clerk_webhook_secret` for synced auth.
397
+ * The value is encrypted at rest and can be read back only by that tenant's
398
+ * app API key — never by this CLI, Studio, or the developer token.
399
+ */
400
+ declare function secretsSet(options: SecretsSetOptions): Promise<void>;
401
+ /**
402
+ * Store the app's Clerk secret key under the reserved `$clerk_secret` slot so
403
+ * odla-db can resolve the app's users (invites, member lookups). Reserved
404
+ * secrets are never readable by app keys; the dedicated endpoint is the only
405
+ * way to set one. Guards against instance/env mismatches: an sk_test_ key
406
+ * never belongs in a prod-named env, and an sk_live_ key entering a non-prod
407
+ * env requires `--yes` (live users would sync into a non-prod tenant).
408
+ */
409
+ declare function secretsSetClerkKey(options: SecretsSetOptions): Promise<void>;
410
+
368
411
  /** Built-in security coverage profile selected for a hosted reasoning run. */
369
412
  type HostedSecurityProfile = "odla" | "cloudflare-app" | "generic";
370
413
  /** Exact attribution and authorization need supplied to a lazy token callback. */
@@ -420,223 +463,15 @@ interface HostedSecurityResult {
420
463
  */
421
464
  declare function runHostedSecurity(options: RunHostedSecurityOptions): Promise<HostedSecurityResult>;
422
465
 
423
- /** GitHub repository connection persisted by odla.ai. GitHub credentials and
424
- * installation identifiers are deliberately absent from this client view. */
425
- interface GitHubSecuritySource {
426
- sourceId: string;
427
- repository: string;
428
- installationAccount: string;
429
- defaultBranch: string;
430
- env: string;
431
- status: "active" | "disabled" | "deleted";
432
- connectedAt: string;
433
- }
434
- /** One browser-mediated GitHub App installation attempt. */
435
- interface GitHubConnectionAttempt {
436
- attemptId: string;
437
- installUrl: string;
438
- expiresAt: string;
439
- }
440
- /** Poll-safe state for a GitHub App installation attempt. */
441
- interface GitHubConnectionStatus {
442
- attemptId: string;
443
- status: "pending" | "connected" | "expired" | "failed";
444
- connectionId?: string;
445
- sourceId?: string;
446
- repository?: string;
447
- installationAccount?: string;
448
- failureCode?: string;
449
- }
450
- /** Model identity selected by platform policy. No provider credential is
451
- * returned to the CLI. */
452
- interface HostedSecurityRoute {
453
- provider: string;
454
- model: string;
455
- policyVersion?: number;
456
- }
457
- /** One purpose-specific System AI route disclosed before a hosted review. */
458
- interface HostedSecurityPlanRoute extends HostedSecurityRoute {
459
- purpose: "security.discovery" | "security.validation";
460
- policyVersion: number;
461
- enabled: boolean;
462
- credentialReady: boolean;
463
- maxCallsPerRun: number;
464
- maxInputBytes: number;
465
- maxOutputTokens: number;
466
- }
467
- /** Owner-readable, versioned disclosure preflight. Provider/model identities
468
- * and bounds are non-secret; the full plan digest binds subsequent consent so
469
- * an admin edit or processing-contract release cannot silently change it. */
470
- interface HostedSecurityPlan {
471
- env: string;
472
- /** Versioned disclosure and processing contract covered by `planDigest`. */
473
- consentContract: "odla.hosted-security-consent.v1";
474
- /** Versioned private report projection covered by `planDigest`. */
475
- reportProjection: "odla.hosted-security-report.v1";
476
- /** Best-effort credential-pattern redaction contract covered by `planDigest`. */
477
- redactionContract: "odla.best-effort-credential-pattern-redaction.v1";
478
- /** Server-owned prompt bundle covered by `planDigest`. */
479
- promptBundle: string;
480
- /** Digest binding this exact disclosure plan to a later enqueue request. */
481
- planDigest: `sha256:${string}`;
482
- ready: boolean;
483
- independent: boolean;
484
- sourceDisclosure: "redacted";
485
- targetExecution: false;
486
- reportRetentionDays: number;
487
- routes: {
488
- discovery: HostedSecurityPlanRoute;
489
- validation: HostedSecurityPlanRoute;
490
- };
491
- }
492
- /** Server-authored preview of the exact source/ref/profile execution choice. */
493
- interface HostedSecurityIntent {
494
- executionContract: "odla.hosted-security-execution-consent.v1";
495
- executionDigest: `sha256:${string}`;
496
- appId: string;
497
- env: string;
498
- sourceId: string;
499
- repository: string;
500
- defaultBranch: string;
501
- /** Explicit requested ref; omitted requests are canonicalized to the source's current default branch. */
502
- requestedRef: string;
503
- profile: "odla" | "cloudflare-app" | "generic";
504
- sourceDisclosure: "redacted";
505
- planDigest: `sha256:${string}`;
506
- }
507
- /** Atomic server response used to review both the processing plan and execution intent. */
508
- interface HostedSecurityIntentResponse {
509
- plan: HostedSecurityPlan;
510
- intent: HostedSecurityIntent;
511
- }
512
- /** Lifecycle state reported for a hosted repository security job. */
513
- type HostedSecurityJobStatus = "queued" | "acquiring" | "analyzing" | "completed" | "failed" | "cancelled";
514
- /** Finding totals summarized on hosted job metadata. */
515
- interface HostedSecurityCounts {
516
- confirmed: number;
517
- needsReproduction: number;
518
- candidates: number;
519
- }
520
- /** Coverage-cell totals summarized on hosted job metadata. */
521
- interface HostedSecurityCoverage {
522
- completeCells?: number;
523
- totalCells?: number;
524
- shallowCells?: number;
525
- blockedCells?: number;
526
- unscheduledCells?: number;
527
- budgetExhaustedCells?: number;
528
- }
529
- /** Bounded job metadata returned by odla.ai; it has no archive, file-body, or
530
- * explicit source-excerpt field. */
531
- interface HostedSecurityJob {
532
- jobId: string;
533
- env: string;
534
- sourceId: string;
535
- repository: string;
536
- requestedRef?: string;
537
- commitSha?: string;
538
- status: HostedSecurityJobStatus;
539
- runId?: string;
540
- profile: string;
541
- routes?: {
542
- discovery: HostedSecurityRoute;
543
- validation: HostedSecurityRoute;
544
- };
545
- sourceDisclosure: "redacted";
546
- planDigest: `sha256:${string}`;
547
- executionContract: "odla.hosted-security-execution-consent.v1";
548
- executionDigest: `sha256:${string}`;
549
- retentionDays: number;
550
- snapshotDigest?: `sha256:${string}`;
551
- fileCount?: number;
552
- inputBytes?: number;
553
- reportDigest?: `sha256:${string}`;
554
- coverageStatus?: "not_run" | "complete" | "incomplete";
555
- coverage?: HostedSecurityCoverage;
556
- counts?: HostedSecurityCounts;
557
- errorCode?: string;
558
- createdAt: string;
559
- updatedAt: string;
560
- startedAt?: string;
561
- completedAt?: string;
562
- }
563
- /** One normalized, bounded finding in a hosted security report. */
564
- interface HostedSecurityReportFinding {
565
- fingerprint: string;
566
- kind: string;
567
- attackClass: string;
568
- title: string;
569
- summary: string;
570
- impact: string;
571
- remediation?: string;
572
- validationRationale?: string;
573
- validationStatus?: string;
574
- confidence: "low" | "medium" | "high";
575
- severity: "critical" | "high" | "medium" | "low" | "informational";
576
- disposition: string;
577
- locations: Array<{
578
- path: string;
579
- line: number;
580
- column?: number;
581
- }>;
582
- }
583
- /** Bounded report projection with normalized model-derived prose and paths.
584
- * Its schema has no dedicated raw-source, archive, source-excerpt, context
585
- * packet, raw-provider-response, credential, execution-trace, or reproduction
586
- * output field. Model prose may reveal or echo source semantics, so the report
587
- * must remain private. */
588
- interface HostedSecurityReport {
589
- schemaVersion: 1;
590
- jobId: string;
591
- runId: string;
592
- repository: string;
593
- revision: string;
594
- snapshotDigest: string;
595
- reportDigest: string;
596
- startedAt: string;
597
- completedAt: string;
598
- mode: "passive" | "autonomous";
599
- coverageStatus: "not_run" | "complete" | "incomplete";
600
- findingsReturned: number;
601
- findingsTotal: number;
602
- coverageReturned: number;
603
- coverageTotal: number;
604
- metrics: HostedSecurityCounts & {
605
- rejected: number;
606
- suppressed: number;
607
- coverageCells: number;
608
- shallowCells: number;
609
- blockedCells: number;
610
- unscheduledCells: number;
611
- budgetExhaustedCells: number;
612
- };
613
- provenance: {
614
- harnessVersion: string;
615
- promptBundle: string;
616
- profile: {
617
- id: string;
618
- version: string;
619
- };
620
- independentValidation: boolean;
621
- discovery?: {
622
- provider?: string;
623
- model?: string;
624
- };
625
- validation?: {
626
- provider?: string;
627
- model?: string;
628
- };
629
- };
630
- coverage: Array<{
631
- area: string;
632
- attackClass: string;
633
- attempts: number;
634
- candidateCount: number;
635
- state: string;
636
- }>;
637
- limitations: string[];
638
- findings: HostedSecurityReportFinding[];
639
- }
466
+ /**
467
+ * The hosted-security client surface. The WIRE types live in @odla-ai/security/hosted — one
468
+ * definition shared with the dashboard and the server that produces them. Re-exported here so
469
+ * this module stays the single import path for the rest of the CLI.
470
+ *
471
+ * What remains below is what is genuinely the CLI's own: transport controls (platform origin,
472
+ * token, fetch, AbortSignal) that no other client shares.
473
+ */
474
+
640
475
  /** Common authenticated transport controls for hosted-security requests. */
641
476
  interface HostedSecurityRequestOptions {
642
477
  platform: string;
@@ -831,4 +666,4 @@ declare function installSkill(options?: SkillInstallOptions): SkillInstallResult
831
666
  */
832
667
  declare function smoke(options: SmokeOptions): Promise<void>;
833
668
 
834
- export { AGENT_HARNESSES, type AdminAiOptions, type AgentHarness, type AgentHarnessSelector, CAPABILITIES, type CliDependencies, type ConnectGitHubSecuritySourceOptions, type DisconnectGitHubSecuritySourceOptions, type FollowHostedSecurityJobOptions, type GetHostedSecurityIntentOptions, type GetHostedSecurityJobOptions, type GitHubConnectionAttempt, type GitHubConnectionStatus, type GitHubSecuritySource, type HarnessInstallResult, type HostedSecurityCounts, type HostedSecurityCoverage, type HostedSecurityIntent, type HostedSecurityIntentResponse, type HostedSecurityJob, type HostedSecurityJobStatus, type HostedSecurityPlan, type HostedSecurityPlanRoute, type HostedSecurityProfile, type HostedSecurityReport, type HostedSecurityReportFinding, type HostedSecurityResult, type HostedSecurityRoute, type HostedSecurityTokenRequest, type ListGitHubSecuritySourcesOptions, type ListHostedSecurityJobsOptions, type LoadedProjectConfig, type LocalCredentials, type OdlaProjectConfig, type ProvisionOptions, type ProvisionPlan, type RunHostedSecurityOptions, SYSTEM_AI_PURPOSES, type ScopedPlatformTokenOptions, type SecretsPushOptions, type SkillInstallOptions, type SkillInstallResult, type SmokeOptions, type StartHostedSecurityJobOptions, type SystemAiPurpose, adminAi, connectGitHubSecuritySource, disconnectGitHubSecuritySource, doctor, followHostedSecurityJob, getHostedSecurityIntent, getHostedSecurityJob, getHostedSecurityPlan, getHostedSecurityReport, getScopedPlatformToken, inferGitHubRepository, initProject, installSkill, isTerminalHostedSecurityStatus, listGitHubSecuritySources, listHostedSecurityJobs, printCapabilities, provision, redactSecrets, repositoryFromGitRemote, runCli, runHostedSecurity, secretsPush, smoke, startHostedSecurityJob };
669
+ export { AGENT_HARNESSES, type AdminAiOptions, type AgentHarness, type AgentHarnessSelector, CAPABILITIES, type CliDependencies, type ConnectGitHubSecuritySourceOptions, type DisconnectGitHubSecuritySourceOptions, type FollowHostedSecurityJobOptions, type GetHostedSecurityIntentOptions, type GetHostedSecurityJobOptions, type HarnessInstallResult, type HostedSecurityProfile, type HostedSecurityResult, type HostedSecurityTokenRequest, type ListGitHubSecuritySourcesOptions, type ListHostedSecurityJobsOptions, type LoadedProjectConfig, type LocalCredentials, type OdlaProjectConfig, type ProvisionOptions, type ProvisionPlan, type RunHostedSecurityOptions, SYSTEM_AI_PURPOSES, type ScopedPlatformTokenOptions, type SecretsPushOptions, type SecretsSetOptions, type SkillInstallOptions, type SkillInstallResult, type SmokeOptions, type StartHostedSecurityJobOptions, type SystemAiPurpose, adminAi, connectGitHubSecuritySource, disconnectGitHubSecuritySource, doctor, followHostedSecurityJob, getHostedSecurityIntent, getHostedSecurityJob, getHostedSecurityPlan, getHostedSecurityReport, getScopedPlatformToken, inferGitHubRepository, initProject, installSkill, isTerminalHostedSecurityStatus, listGitHubSecuritySources, listHostedSecurityJobs, printCapabilities, provision, redactSecrets, repositoryFromGitRemote, runCli, runHostedSecurity, secretsPush, secretsSet, secretsSetClerkKey, smoke, startHostedSecurityJob };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { SecurityReport, PlatformSecurityRun } from '@odla-ai/security';
2
+ import { HostedSecurityJob, GitHubConnectionStatus, GitHubSecuritySource, HostedSecurityIntentResponse, HostedSecurityPlan, HostedSecurityReport, HostedSecurityJobStatus } from '@odla-ai/security/hosted';
3
+ export { GitHubConnectionAttempt, GitHubConnectionStatus, GitHubSecuritySource, HostedSecurityCounts, HostedSecurityCoverage, HostedSecurityIntent, HostedSecurityIntentResponse, HostedSecurityJob, HostedSecurityJobStatus, HostedSecurityPlan, HostedSecurityPlanRoute, HostedSecurityReport, HostedSecurityReportFinding, HostedSecurityRoute } from '@odla-ai/security/hosted';
2
4
 
3
5
  /** Injectable side-effect boundaries used to run and test the command dispatcher. */
4
6
  interface CliDependencies {
@@ -89,7 +91,7 @@ declare function adminAi(options: AdminAiOptions): Promise<void>;
89
91
  /** Stable, machine-readable division of work between the CLI, coding agent,
90
92
  * human operator, and Studio. Printed by `odla-ai capabilities --json`. */
91
93
  declare const CAPABILITIES: {
92
- readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "connect/revoke source-read-only GitHub sources and drive commit-pinned hosted security jobs without PATs or provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
94
+ readonly cli: readonly ["register the app and enable configured services per environment", "issue, persist, and explicitly rotate configured service credentials", "write local Worker values and push deployed Worker secrets through Wrangler stdin", "store tenant-vault secrets (including the Clerk webhook secret and reserved Clerk secret key) write-only from stdin or an env var", "push db schema/rules and configure platform AI, auth, and deployment links", "validate config offline and smoke-test a provisioned db environment", "run app-attributed hosted security discovery and independent validation without provider keys", "connect/revoke source-read-only GitHub sources and drive commit-pinned hosted security jobs without PATs or provider keys", "let admins manage system AI policy and credentials, inspect attributed usage, and read immutable admin changes through separate short-lived capability-only approvals"];
93
95
  readonly agent: readonly ["install and import the selected odla SDKs", "wrap the Worker with withObservability and choose useful telemetry", "make application-specific schema, rules, auth, UI, and migration decisions"];
94
96
  readonly human: readonly ["approve the odla device code and one-off third-party logins", "consent to production changes with --yes", "request destructive credential rotation explicitly", "review application semantics, security findings, releases, and merges", "approve redacted-source disclosure before hosted security reasoning", "approve GitHub App repository access separately from redacted-snippet disclosure"];
95
97
  readonly studio: readonly ["view telemetry and environment state", "perform manual credential recovery when the CLI's local shown-once copy is unavailable", "configure system AI purposes and view app/environment/run-attributed usage", "connect/revoke GitHub security sources and inspect ref-to-SHA jobs, routes, retention, coverage, and normalized reports"];
@@ -365,6 +367,47 @@ interface SecretsPushOptions {
365
367
  */
366
368
  declare function secretsPush(options: SecretsPushOptions): Promise<void>;
367
369
 
370
+ /**
371
+ * Inputs for one write-only tenant-vault transfer (`secrets set` /
372
+ * `secrets set-clerk-key`). Values may come only from a named environment
373
+ * variable or stdin, so a producer command can be piped straight into the
374
+ * vault without the secret ever being displayed or stored on disk.
375
+ */
376
+ interface SecretsSetOptions {
377
+ configPath: string;
378
+ env: string;
379
+ /** Vault secret name (`secrets set` only; `$`-prefixed names are reserved). */
380
+ name?: string;
381
+ fromEnv?: string;
382
+ stdin?: boolean;
383
+ /** Explicit consent for a prod-named env (and for sk_live_ into a non-prod env). */
384
+ yes?: boolean;
385
+ /** Developer token override; defaults to $ODLA_DEV_TOKEN, the cached token, or a device handshake. */
386
+ token?: string;
387
+ open?: boolean;
388
+ interactive?: boolean;
389
+ openApprovalUrl?: (url: string) => Promise<void>;
390
+ fetch?: typeof fetch;
391
+ readStdin?: () => Promise<string>;
392
+ stdout?: Pick<typeof console, "log" | "error">;
393
+ }
394
+ /**
395
+ * Store one named secret in the env's tenant vault (the same write-only slot
396
+ * Studio's Secrets panel fills), e.g. `clerk_webhook_secret` for synced auth.
397
+ * The value is encrypted at rest and can be read back only by that tenant's
398
+ * app API key — never by this CLI, Studio, or the developer token.
399
+ */
400
+ declare function secretsSet(options: SecretsSetOptions): Promise<void>;
401
+ /**
402
+ * Store the app's Clerk secret key under the reserved `$clerk_secret` slot so
403
+ * odla-db can resolve the app's users (invites, member lookups). Reserved
404
+ * secrets are never readable by app keys; the dedicated endpoint is the only
405
+ * way to set one. Guards against instance/env mismatches: an sk_test_ key
406
+ * never belongs in a prod-named env, and an sk_live_ key entering a non-prod
407
+ * env requires `--yes` (live users would sync into a non-prod tenant).
408
+ */
409
+ declare function secretsSetClerkKey(options: SecretsSetOptions): Promise<void>;
410
+
368
411
  /** Built-in security coverage profile selected for a hosted reasoning run. */
369
412
  type HostedSecurityProfile = "odla" | "cloudflare-app" | "generic";
370
413
  /** Exact attribution and authorization need supplied to a lazy token callback. */
@@ -420,223 +463,15 @@ interface HostedSecurityResult {
420
463
  */
421
464
  declare function runHostedSecurity(options: RunHostedSecurityOptions): Promise<HostedSecurityResult>;
422
465
 
423
- /** GitHub repository connection persisted by odla.ai. GitHub credentials and
424
- * installation identifiers are deliberately absent from this client view. */
425
- interface GitHubSecuritySource {
426
- sourceId: string;
427
- repository: string;
428
- installationAccount: string;
429
- defaultBranch: string;
430
- env: string;
431
- status: "active" | "disabled" | "deleted";
432
- connectedAt: string;
433
- }
434
- /** One browser-mediated GitHub App installation attempt. */
435
- interface GitHubConnectionAttempt {
436
- attemptId: string;
437
- installUrl: string;
438
- expiresAt: string;
439
- }
440
- /** Poll-safe state for a GitHub App installation attempt. */
441
- interface GitHubConnectionStatus {
442
- attemptId: string;
443
- status: "pending" | "connected" | "expired" | "failed";
444
- connectionId?: string;
445
- sourceId?: string;
446
- repository?: string;
447
- installationAccount?: string;
448
- failureCode?: string;
449
- }
450
- /** Model identity selected by platform policy. No provider credential is
451
- * returned to the CLI. */
452
- interface HostedSecurityRoute {
453
- provider: string;
454
- model: string;
455
- policyVersion?: number;
456
- }
457
- /** One purpose-specific System AI route disclosed before a hosted review. */
458
- interface HostedSecurityPlanRoute extends HostedSecurityRoute {
459
- purpose: "security.discovery" | "security.validation";
460
- policyVersion: number;
461
- enabled: boolean;
462
- credentialReady: boolean;
463
- maxCallsPerRun: number;
464
- maxInputBytes: number;
465
- maxOutputTokens: number;
466
- }
467
- /** Owner-readable, versioned disclosure preflight. Provider/model identities
468
- * and bounds are non-secret; the full plan digest binds subsequent consent so
469
- * an admin edit or processing-contract release cannot silently change it. */
470
- interface HostedSecurityPlan {
471
- env: string;
472
- /** Versioned disclosure and processing contract covered by `planDigest`. */
473
- consentContract: "odla.hosted-security-consent.v1";
474
- /** Versioned private report projection covered by `planDigest`. */
475
- reportProjection: "odla.hosted-security-report.v1";
476
- /** Best-effort credential-pattern redaction contract covered by `planDigest`. */
477
- redactionContract: "odla.best-effort-credential-pattern-redaction.v1";
478
- /** Server-owned prompt bundle covered by `planDigest`. */
479
- promptBundle: string;
480
- /** Digest binding this exact disclosure plan to a later enqueue request. */
481
- planDigest: `sha256:${string}`;
482
- ready: boolean;
483
- independent: boolean;
484
- sourceDisclosure: "redacted";
485
- targetExecution: false;
486
- reportRetentionDays: number;
487
- routes: {
488
- discovery: HostedSecurityPlanRoute;
489
- validation: HostedSecurityPlanRoute;
490
- };
491
- }
492
- /** Server-authored preview of the exact source/ref/profile execution choice. */
493
- interface HostedSecurityIntent {
494
- executionContract: "odla.hosted-security-execution-consent.v1";
495
- executionDigest: `sha256:${string}`;
496
- appId: string;
497
- env: string;
498
- sourceId: string;
499
- repository: string;
500
- defaultBranch: string;
501
- /** Explicit requested ref; omitted requests are canonicalized to the source's current default branch. */
502
- requestedRef: string;
503
- profile: "odla" | "cloudflare-app" | "generic";
504
- sourceDisclosure: "redacted";
505
- planDigest: `sha256:${string}`;
506
- }
507
- /** Atomic server response used to review both the processing plan and execution intent. */
508
- interface HostedSecurityIntentResponse {
509
- plan: HostedSecurityPlan;
510
- intent: HostedSecurityIntent;
511
- }
512
- /** Lifecycle state reported for a hosted repository security job. */
513
- type HostedSecurityJobStatus = "queued" | "acquiring" | "analyzing" | "completed" | "failed" | "cancelled";
514
- /** Finding totals summarized on hosted job metadata. */
515
- interface HostedSecurityCounts {
516
- confirmed: number;
517
- needsReproduction: number;
518
- candidates: number;
519
- }
520
- /** Coverage-cell totals summarized on hosted job metadata. */
521
- interface HostedSecurityCoverage {
522
- completeCells?: number;
523
- totalCells?: number;
524
- shallowCells?: number;
525
- blockedCells?: number;
526
- unscheduledCells?: number;
527
- budgetExhaustedCells?: number;
528
- }
529
- /** Bounded job metadata returned by odla.ai; it has no archive, file-body, or
530
- * explicit source-excerpt field. */
531
- interface HostedSecurityJob {
532
- jobId: string;
533
- env: string;
534
- sourceId: string;
535
- repository: string;
536
- requestedRef?: string;
537
- commitSha?: string;
538
- status: HostedSecurityJobStatus;
539
- runId?: string;
540
- profile: string;
541
- routes?: {
542
- discovery: HostedSecurityRoute;
543
- validation: HostedSecurityRoute;
544
- };
545
- sourceDisclosure: "redacted";
546
- planDigest: `sha256:${string}`;
547
- executionContract: "odla.hosted-security-execution-consent.v1";
548
- executionDigest: `sha256:${string}`;
549
- retentionDays: number;
550
- snapshotDigest?: `sha256:${string}`;
551
- fileCount?: number;
552
- inputBytes?: number;
553
- reportDigest?: `sha256:${string}`;
554
- coverageStatus?: "not_run" | "complete" | "incomplete";
555
- coverage?: HostedSecurityCoverage;
556
- counts?: HostedSecurityCounts;
557
- errorCode?: string;
558
- createdAt: string;
559
- updatedAt: string;
560
- startedAt?: string;
561
- completedAt?: string;
562
- }
563
- /** One normalized, bounded finding in a hosted security report. */
564
- interface HostedSecurityReportFinding {
565
- fingerprint: string;
566
- kind: string;
567
- attackClass: string;
568
- title: string;
569
- summary: string;
570
- impact: string;
571
- remediation?: string;
572
- validationRationale?: string;
573
- validationStatus?: string;
574
- confidence: "low" | "medium" | "high";
575
- severity: "critical" | "high" | "medium" | "low" | "informational";
576
- disposition: string;
577
- locations: Array<{
578
- path: string;
579
- line: number;
580
- column?: number;
581
- }>;
582
- }
583
- /** Bounded report projection with normalized model-derived prose and paths.
584
- * Its schema has no dedicated raw-source, archive, source-excerpt, context
585
- * packet, raw-provider-response, credential, execution-trace, or reproduction
586
- * output field. Model prose may reveal or echo source semantics, so the report
587
- * must remain private. */
588
- interface HostedSecurityReport {
589
- schemaVersion: 1;
590
- jobId: string;
591
- runId: string;
592
- repository: string;
593
- revision: string;
594
- snapshotDigest: string;
595
- reportDigest: string;
596
- startedAt: string;
597
- completedAt: string;
598
- mode: "passive" | "autonomous";
599
- coverageStatus: "not_run" | "complete" | "incomplete";
600
- findingsReturned: number;
601
- findingsTotal: number;
602
- coverageReturned: number;
603
- coverageTotal: number;
604
- metrics: HostedSecurityCounts & {
605
- rejected: number;
606
- suppressed: number;
607
- coverageCells: number;
608
- shallowCells: number;
609
- blockedCells: number;
610
- unscheduledCells: number;
611
- budgetExhaustedCells: number;
612
- };
613
- provenance: {
614
- harnessVersion: string;
615
- promptBundle: string;
616
- profile: {
617
- id: string;
618
- version: string;
619
- };
620
- independentValidation: boolean;
621
- discovery?: {
622
- provider?: string;
623
- model?: string;
624
- };
625
- validation?: {
626
- provider?: string;
627
- model?: string;
628
- };
629
- };
630
- coverage: Array<{
631
- area: string;
632
- attackClass: string;
633
- attempts: number;
634
- candidateCount: number;
635
- state: string;
636
- }>;
637
- limitations: string[];
638
- findings: HostedSecurityReportFinding[];
639
- }
466
+ /**
467
+ * The hosted-security client surface. The WIRE types live in @odla-ai/security/hosted — one
468
+ * definition shared with the dashboard and the server that produces them. Re-exported here so
469
+ * this module stays the single import path for the rest of the CLI.
470
+ *
471
+ * What remains below is what is genuinely the CLI's own: transport controls (platform origin,
472
+ * token, fetch, AbortSignal) that no other client shares.
473
+ */
474
+
640
475
  /** Common authenticated transport controls for hosted-security requests. */
641
476
  interface HostedSecurityRequestOptions {
642
477
  platform: string;
@@ -831,4 +666,4 @@ declare function installSkill(options?: SkillInstallOptions): SkillInstallResult
831
666
  */
832
667
  declare function smoke(options: SmokeOptions): Promise<void>;
833
668
 
834
- export { AGENT_HARNESSES, type AdminAiOptions, type AgentHarness, type AgentHarnessSelector, CAPABILITIES, type CliDependencies, type ConnectGitHubSecuritySourceOptions, type DisconnectGitHubSecuritySourceOptions, type FollowHostedSecurityJobOptions, type GetHostedSecurityIntentOptions, type GetHostedSecurityJobOptions, type GitHubConnectionAttempt, type GitHubConnectionStatus, type GitHubSecuritySource, type HarnessInstallResult, type HostedSecurityCounts, type HostedSecurityCoverage, type HostedSecurityIntent, type HostedSecurityIntentResponse, type HostedSecurityJob, type HostedSecurityJobStatus, type HostedSecurityPlan, type HostedSecurityPlanRoute, type HostedSecurityProfile, type HostedSecurityReport, type HostedSecurityReportFinding, type HostedSecurityResult, type HostedSecurityRoute, type HostedSecurityTokenRequest, type ListGitHubSecuritySourcesOptions, type ListHostedSecurityJobsOptions, type LoadedProjectConfig, type LocalCredentials, type OdlaProjectConfig, type ProvisionOptions, type ProvisionPlan, type RunHostedSecurityOptions, SYSTEM_AI_PURPOSES, type ScopedPlatformTokenOptions, type SecretsPushOptions, type SkillInstallOptions, type SkillInstallResult, type SmokeOptions, type StartHostedSecurityJobOptions, type SystemAiPurpose, adminAi, connectGitHubSecuritySource, disconnectGitHubSecuritySource, doctor, followHostedSecurityJob, getHostedSecurityIntent, getHostedSecurityJob, getHostedSecurityPlan, getHostedSecurityReport, getScopedPlatformToken, inferGitHubRepository, initProject, installSkill, isTerminalHostedSecurityStatus, listGitHubSecuritySources, listHostedSecurityJobs, printCapabilities, provision, redactSecrets, repositoryFromGitRemote, runCli, runHostedSecurity, secretsPush, smoke, startHostedSecurityJob };
669
+ export { AGENT_HARNESSES, type AdminAiOptions, type AgentHarness, type AgentHarnessSelector, CAPABILITIES, type CliDependencies, type ConnectGitHubSecuritySourceOptions, type DisconnectGitHubSecuritySourceOptions, type FollowHostedSecurityJobOptions, type GetHostedSecurityIntentOptions, type GetHostedSecurityJobOptions, type HarnessInstallResult, type HostedSecurityProfile, type HostedSecurityResult, type HostedSecurityTokenRequest, type ListGitHubSecuritySourcesOptions, type ListHostedSecurityJobsOptions, type LoadedProjectConfig, type LocalCredentials, type OdlaProjectConfig, type ProvisionOptions, type ProvisionPlan, type RunHostedSecurityOptions, SYSTEM_AI_PURPOSES, type ScopedPlatformTokenOptions, type SecretsPushOptions, type SecretsSetOptions, type SkillInstallOptions, type SkillInstallResult, type SmokeOptions, type StartHostedSecurityJobOptions, type SystemAiPurpose, adminAi, connectGitHubSecuritySource, disconnectGitHubSecuritySource, doctor, followHostedSecurityJob, getHostedSecurityIntent, getHostedSecurityJob, getHostedSecurityPlan, getHostedSecurityReport, getScopedPlatformToken, inferGitHubRepository, initProject, installSkill, isTerminalHostedSecurityStatus, listGitHubSecuritySources, listHostedSecurityJobs, printCapabilities, provision, redactSecrets, repositoryFromGitRemote, runCli, runHostedSecurity, secretsPush, secretsSet, secretsSetClerkKey, smoke, startHostedSecurityJob };
package/dist/index.js CHANGED
@@ -26,9 +26,11 @@ import {
26
26
  runCli,
27
27
  runHostedSecurity,
28
28
  secretsPush,
29
+ secretsSet,
30
+ secretsSetClerkKey,
29
31
  smoke,
30
32
  startHostedSecurityJob
31
- } from "./chunk-BHAEDEL2.js";
33
+ } from "./chunk-MJYQ7YDH.js";
32
34
  export {
33
35
  AGENT_HARNESSES,
34
36
  CAPABILITIES,
@@ -56,6 +58,8 @@ export {
56
58
  runCli,
57
59
  runHostedSecurity,
58
60
  secretsPush,
61
+ secretsSet,
62
+ secretsSetClerkKey,
59
63
  smoke,
60
64
  startHostedSecurityJob
61
65
  };