@odla-ai/cli 0.8.0 → 0.10.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.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,79 +91,78 @@ 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"];
93
- 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
- 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
- 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"];
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", "apply read-only Google calendar mirror and public booking-page config, then drive state-bound consent, status, discovery, resync, and disconnect flows", "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"];
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", "wire @odla-ai/calendar into trusted Worker code and keep the app admin key out of browsers"];
96
+ readonly human: readonly ["approve the odla device code and one-off third-party logins", "review mirrored calendar/attendee disclosure and complete the server-issued Google consent flow", "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"];
97
+ readonly studio: readonly ["view telemetry and environment state", "review calendar connection, granted read scope, selected calendars, and sync health without exposing provider tokens", "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"];
96
98
  };
97
99
  type Output = Pick<typeof console, "log">;
98
100
  /** Print the stable responsibility boundary for humans or agent tooling. */
99
101
  declare function printCapabilities(json?: boolean, out?: Output): void;
100
102
 
101
- interface DoctorOptions {
102
- configPath: string;
103
- stdout?: Pick<typeof console, "log" | "error">;
103
+ declare const CALENDAR_STATES: readonly ["not_connected", "authorizing", "needs_sync", "initial_sync", "healthy", "degraded", "disconnected", "failed"];
104
+ type CalendarConnectionState = (typeof CALENDAR_STATES)[number];
105
+ /** Owner-visible, secret-free calendar connection and sync health. */
106
+ interface CalendarStatus {
107
+ env: string;
108
+ enabled: boolean;
109
+ /** True when the platform has provider credentials for this connection. */
110
+ connected: boolean;
111
+ provider: "google" | null;
112
+ status: CalendarConnectionState;
113
+ access?: "read";
114
+ calendars: string[];
115
+ attendeePolicy?: "full" | "hashed";
116
+ /** True once a booking projection may have established the DB privacy policy. */
117
+ attendeePolicyLocked?: boolean;
118
+ bookingPageUrl?: string | null;
119
+ grantedScopes: string[];
120
+ attemptId?: string;
121
+ lastSuccessfulSyncAt?: number;
122
+ lastFullSyncAt?: number;
123
+ watchExpiresAt?: number;
124
+ bookingCount?: number;
125
+ error?: {
126
+ code?: string;
127
+ message?: string;
128
+ };
129
+ }
130
+ /** One Google calendar the connected identity may select for mirroring. */
131
+ interface AvailableGoogleCalendar {
132
+ id: string;
133
+ summary?: string;
134
+ primary?: boolean;
135
+ selected?: boolean;
136
+ accessRole?: "freeBusyReader" | "reader" | "writer" | "owner";
104
137
  }
105
- /**
106
- * Validate and summarize an odla project config entirely offline — no network
107
- * calls and no file writes. Loads `configPath`, builds the provision plan, and
108
- * resolves the schema and rules (synthesizing deny-all rules from the schema
109
- * when `db.rules` is omitted and `db.defaultRules` isn't `false`), then prints a
110
- * summary line for the app, envs, services, schema entity count, rules namespace
111
- * count, and AI provider.
112
- *
113
- * It then collects warnings for the mistakes provision can't fix silently: a
114
- * schema with no entities, a rules namespace with no matching entity, the `ai`
115
- * service enabled without an `ai.provider`, `auth.clerk` entries that reference
116
- * an unset env var (`$FOO`), an `ai.keyEnv` that isn't set (provider key upload
117
- * will be skipped), and — when `o11y` is enabled — any env whose local
118
- * credentials lack an ingest token. It also folds in the shared rule linter,
119
- * git-tracked secret-shaped files, and wrangler config warnings. Prints `ok`
120
- * when clean, otherwise the warning list. Purely advisory: never throws on
121
- * warnings and never mutates anything.
122
- *
123
- * @param options.configPath Path to the `odla.config.mjs` to inspect.
124
- * @param options.stdout Optional console-like sink (defaults to `console`).
125
- */
126
- declare function doctor(options: DoctorOptions): Promise<void>;
127
138
 
128
- interface InitOptions {
129
- rootDir?: string;
130
- configPath?: string;
131
- appId: string;
132
- name: string;
133
- envs?: string[];
134
- services?: string[];
135
- aiProvider?: string;
136
- force?: boolean;
139
+ interface CalendarLifecycleOptions {
140
+ configPath: string;
141
+ env?: string;
142
+ token?: string;
143
+ open?: boolean;
144
+ interactive?: boolean;
145
+ yes?: boolean;
146
+ json?: boolean;
147
+ fetch?: typeof fetch;
137
148
  stdout?: Pick<typeof console, "log" | "error">;
149
+ openConsentUrl?: (url: string) => Promise<void>;
150
+ wait?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
151
+ pollTimeoutMs?: number;
152
+ now?: () => number;
153
+ signal?: AbortSignal;
138
154
  }
139
- /**
140
- * Scaffold a new odla project into `rootDir` (default: cwd). Writes an
141
- * `odla.config.mjs` (default name, overridable via `configPath`) plus starter
142
- * `src/odla/schema.mjs` (a single `notes` entity) and `src/odla/rules.mjs`
143
- * (deny-all), and creates the `src/odla` and `.odla` directories. Also runs
144
- * `ensureGitignore` so the local token/credentials paths are ignored.
145
- *
146
- * Fully local and synchronous — no network calls. The config file is only
147
- * written when it doesn't already exist unless `force` is set (otherwise it
148
- * throws); the schema/rules files are written only when missing (never
149
- * overwritten, even with `force`). `appId` must match `^[a-z0-9][a-z0-9-]*$` or
150
- * it throws. Defaults: `envs` → `["dev"]`, `services` → `["db","ai"]`,
151
- * `aiProvider` → `"anthropic"` (which also picks the `keyEnv`, e.g.
152
- * `ANTHROPIC_API_KEY`/`OPENAI_API_KEY`/`GOOGLE_API_KEY`).
153
- *
154
- * @param options.appId Slug for the app (lowercase alphanumerics and hyphens).
155
- * @param options.name Human-readable app name embedded in the config.
156
- * @param options.rootDir Project root (defaults to `process.cwd()`).
157
- * @param options.configPath Config filename relative to root (default `odla.config.mjs`).
158
- * @param options.envs Environment names (default `["dev"]`; production is an explicit opt-in).
159
- * @param options.services Enabled services (default `["db","ai"]`).
160
- * @param options.aiProvider AI provider slug (default `"anthropic"`).
161
- * @param options.force Overwrite an existing config file instead of throwing.
162
- * @param options.stdout Optional console-like sink (defaults to `console`).
163
- */
164
- declare function initProject(options: InitOptions): void;
155
+ /** Read the owner-visible Google connection and mirror health for one env. */
156
+ declare function calendarStatus(options: CalendarLifecycleOptions): Promise<CalendarStatus>;
157
+ /** List calendars visible to the connected Google identity for config authoring. */
158
+ declare function calendarCalendars(options: CalendarLifecycleOptions): Promise<AvailableGoogleCalendar[]>;
159
+ /** Apply the public booking page setting, then complete Google consent + initial sync. */
160
+ declare function calendarConnect(options: CalendarLifecycleOptions): Promise<CalendarStatus>;
161
+ /** Ask the hosted connector for an immediate incremental/full recovery sync. */
162
+ declare function calendarResync(options: CalendarLifecycleOptions): Promise<CalendarStatus>;
163
+ /** Stop watches and delete this connection's encrypted platform token/cursors
164
+ * without purging the mirror or revoking the shared Google project grant. */
165
+ declare function calendarDisconnect(options: CalendarLifecycleOptions): Promise<CalendarStatus>;
165
166
 
166
167
  interface RunResult {
167
168
  code: number;
@@ -186,6 +187,41 @@ interface ClerkAuthConfig {
186
187
  audience?: string;
187
188
  mode?: "client" | "full";
188
189
  }
190
+ /** Read-only event selection applied by the hosted Google calendar connector. */
191
+ interface GoogleCalendarMatchConfig {
192
+ /** Mirror only events whose summary begins with this value. */
193
+ summaryPrefix?: string;
194
+ /** Require the connected identity to organize the event. Defaults to true. */
195
+ organizerSelf?: boolean;
196
+ /** Require at least one attendee. Defaults to true. */
197
+ requireAttendees?: boolean;
198
+ }
199
+ /** Google Calendar intent. OAuth credentials never belong in this config. */
200
+ interface GoogleCalendarConfig {
201
+ /** One through ten provider calendar ids to mirror in each odla environment. */
202
+ calendars: Record<OdlaEnvName, string[]>;
203
+ /** Public Google Appointment Schedule URL for static embed/link mode. */
204
+ bookingPageUrl?: Record<OdlaEnvName, string | null>;
205
+ match?: GoogleCalendarMatchConfig;
206
+ /** Store normalized attendee addresses, or only SHA-256 match keys. */
207
+ attendeePolicy?: "full" | "hashed";
208
+ }
209
+ interface CalendarConfig {
210
+ google: GoogleCalendarConfig;
211
+ }
212
+ /** Canonical, environment-specific config sent to the calendar controller. */
213
+ interface CalendarServiceConfig extends Record<string, unknown> {
214
+ provider: "google";
215
+ access: "read";
216
+ /** Deduplicated provider ids; the hosted connector accepts at most ten. */
217
+ calendars: string[];
218
+ match: {
219
+ organizerSelf: boolean;
220
+ requireAttendees: boolean;
221
+ summaryPrefix?: string;
222
+ };
223
+ attendeePolicy: "full" | "hashed";
224
+ }
189
225
  /** Authored `odla.config.mjs` contract consumed by doctor and provision. */
190
226
  interface OdlaProjectConfig {
191
227
  platformUrl?: string;
@@ -214,6 +250,7 @@ interface OdlaProjectConfig {
214
250
  /** Vault secret name. Defaults to @odla-ai/ai's provider default. */
215
251
  secretName?: string;
216
252
  };
253
+ calendar?: CalendarConfig;
217
254
  o11y?: {
218
255
  /** This service's name in the collector. Defaults to the app id. */
219
256
  service?: string;
@@ -278,6 +315,10 @@ interface ProvisionOptions {
278
315
  interactive?: boolean;
279
316
  /** Test/embedding override for opening the approval URL. Defaults to the OS browser opener. */
280
317
  openApprovalUrl?: (url: string) => Promise<void>;
318
+ /** Test/embedding override for calendar connection polling. */
319
+ calendarPollWait?: (milliseconds: number, signal?: AbortSignal) => Promise<void>;
320
+ /** Maximum calendar consent + initial-sync wait. Defaults to ten minutes. */
321
+ calendarPollTimeoutMs?: number;
281
322
  /** Explicit consent for a non-dry-run plan containing `prod` or `production`. */
282
323
  yes?: boolean;
283
324
  fetch?: typeof fetch;
@@ -301,10 +342,86 @@ interface ProvisionPlan {
301
342
  interface SmokeOptions {
302
343
  configPath: string;
303
344
  env?: string;
345
+ /** Developer-token override used only for owner-visible calendar health. */
346
+ token?: string;
347
+ open?: boolean;
348
+ interactive?: boolean;
349
+ openApprovalUrl?: (url: string) => Promise<void>;
304
350
  fetch?: typeof fetch;
305
351
  stdout?: Pick<typeof console, "log" | "error">;
306
352
  }
307
353
 
354
+ declare const GOOGLE_CALENDAR_READ_SCOPE = "https://www.googleapis.com/auth/calendar.events.readonly";
355
+ /** Resolve the checked-in calendar block into one controller-safe env payload. */
356
+ declare function calendarServiceConfig(cfg: LoadedProjectConfig, env: string): CalendarServiceConfig;
357
+ /** Public Appointment Schedule URL to apply separately from connector config. */
358
+ declare function calendarBookingPageUrl(cfg: LoadedProjectConfig, env: string): string | null | undefined;
359
+
360
+ interface DoctorOptions {
361
+ configPath: string;
362
+ stdout?: Pick<typeof console, "log" | "error">;
363
+ }
364
+ /**
365
+ * Validate and summarize an odla project config entirely offline — no network
366
+ * calls and no file writes. Loads `configPath`, builds the provision plan, and
367
+ * resolves the schema and rules (synthesizing deny-all rules from the schema
368
+ * when `db.rules` is omitted and `db.defaultRules` isn't `false`), then prints a
369
+ * summary line for the app, envs, services, schema entity count, rules namespace
370
+ * count, and AI provider.
371
+ *
372
+ * It then collects warnings for the mistakes provision can't fix silently: a
373
+ * schema with no entities, a rules namespace with no matching entity, the `ai`
374
+ * service enabled without an `ai.provider`, `auth.clerk` entries that reference
375
+ * an unset env var (`$FOO`), an `ai.keyEnv` that isn't set (provider key upload
376
+ * will be skipped), and — when `o11y` is enabled — any env whose local
377
+ * credentials lack an ingest token. It also folds in the shared rule linter,
378
+ * git-tracked secret-shaped files, and wrangler config warnings. Prints `ok`
379
+ * when clean, otherwise the warning list. Purely advisory: never throws on
380
+ * warnings and never mutates anything.
381
+ *
382
+ * @param options.configPath Path to the `odla.config.mjs` to inspect.
383
+ * @param options.stdout Optional console-like sink (defaults to `console`).
384
+ */
385
+ declare function doctor(options: DoctorOptions): Promise<void>;
386
+
387
+ interface InitOptions {
388
+ rootDir?: string;
389
+ configPath?: string;
390
+ appId: string;
391
+ name: string;
392
+ envs?: string[];
393
+ services?: string[];
394
+ aiProvider?: string;
395
+ force?: boolean;
396
+ stdout?: Pick<typeof console, "log" | "error">;
397
+ }
398
+ /**
399
+ * Scaffold a new odla project into `rootDir` (default: cwd). Writes an
400
+ * `odla.config.mjs` (default name, overridable via `configPath`) plus starter
401
+ * `src/odla/schema.mjs` (a single `notes` entity) and `src/odla/rules.mjs`
402
+ * (deny-all), and creates the `src/odla` and `.odla` directories. Also runs
403
+ * `ensureGitignore` so the local token/credentials paths are ignored.
404
+ *
405
+ * Fully local and synchronous — no network calls. The config file is only
406
+ * written when it doesn't already exist unless `force` is set (otherwise it
407
+ * throws); the schema/rules files are written only when missing (never
408
+ * overwritten, even with `force`). `appId` must match `^[a-z0-9][a-z0-9-]*$` or
409
+ * it throws. Defaults: `envs` → `["dev"]`, `services` → `["db","ai"]`,
410
+ * `aiProvider` → `"anthropic"` (which also picks the `keyEnv`, e.g.
411
+ * `ANTHROPIC_API_KEY`/`OPENAI_API_KEY`/`GOOGLE_API_KEY`).
412
+ *
413
+ * @param options.appId Slug for the app (lowercase alphanumerics and hyphens).
414
+ * @param options.name Human-readable app name embedded in the config.
415
+ * @param options.rootDir Project root (defaults to `process.cwd()`).
416
+ * @param options.configPath Config filename relative to root (default `odla.config.mjs`).
417
+ * @param options.envs Environment names (default `["dev"]`; production is an explicit opt-in).
418
+ * @param options.services Enabled services (default `["db","ai"]`).
419
+ * @param options.aiProvider AI provider slug (default `"anthropic"`).
420
+ * @param options.force Overwrite an existing config file instead of throwing.
421
+ * @param options.stdout Optional console-like sink (defaults to `console`).
422
+ */
423
+ declare function initProject(options: InitOptions): void;
424
+
308
425
  /**
309
426
  * Provision an app end-to-end from its config — the primary deploy path, and
310
427
  * (apart from key rotation) idempotent, so re-running is safe. Obtains a
@@ -365,6 +482,47 @@ interface SecretsPushOptions {
365
482
  */
366
483
  declare function secretsPush(options: SecretsPushOptions): Promise<void>;
367
484
 
485
+ /**
486
+ * Inputs for one write-only tenant-vault transfer (`secrets set` /
487
+ * `secrets set-clerk-key`). Values may come only from a named environment
488
+ * variable or stdin, so a producer command can be piped straight into the
489
+ * vault without the secret ever being displayed or stored on disk.
490
+ */
491
+ interface SecretsSetOptions {
492
+ configPath: string;
493
+ env: string;
494
+ /** Vault secret name (`secrets set` only; `$`-prefixed names are reserved). */
495
+ name?: string;
496
+ fromEnv?: string;
497
+ stdin?: boolean;
498
+ /** Explicit consent for a prod-named env (and for sk_live_ into a non-prod env). */
499
+ yes?: boolean;
500
+ /** Developer token override; defaults to $ODLA_DEV_TOKEN, the cached token, or a device handshake. */
501
+ token?: string;
502
+ open?: boolean;
503
+ interactive?: boolean;
504
+ openApprovalUrl?: (url: string) => Promise<void>;
505
+ fetch?: typeof fetch;
506
+ readStdin?: () => Promise<string>;
507
+ stdout?: Pick<typeof console, "log" | "error">;
508
+ }
509
+ /**
510
+ * Store one named secret in the env's tenant vault (the same write-only slot
511
+ * Studio's Secrets panel fills), e.g. `clerk_webhook_secret` for synced auth.
512
+ * The value is encrypted at rest and can be read back only by that tenant's
513
+ * app API key — never by this CLI, Studio, or the developer token.
514
+ */
515
+ declare function secretsSet(options: SecretsSetOptions): Promise<void>;
516
+ /**
517
+ * Store the app's Clerk secret key under the reserved `$clerk_secret` slot so
518
+ * odla-db can resolve the app's users (invites, member lookups). Reserved
519
+ * secrets are never readable by app keys; the dedicated endpoint is the only
520
+ * way to set one. Guards against instance/env mismatches: an sk_test_ key
521
+ * never belongs in a prod-named env, and an sk_live_ key entering a non-prod
522
+ * env requires `--yes` (live users would sync into a non-prod tenant).
523
+ */
524
+ declare function secretsSetClerkKey(options: SecretsSetOptions): Promise<void>;
525
+
368
526
  /** Built-in security coverage profile selected for a hosted reasoning run. */
369
527
  type HostedSecurityProfile = "odla" | "cloudflare-app" | "generic";
370
528
  /** Exact attribution and authorization need supplied to a lazy token callback. */
@@ -420,223 +578,15 @@ interface HostedSecurityResult {
420
578
  */
421
579
  declare function runHostedSecurity(options: RunHostedSecurityOptions): Promise<HostedSecurityResult>;
422
580
 
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
- }
581
+ /**
582
+ * The hosted-security client surface. The WIRE types live in @odla-ai/security/hosted — one
583
+ * definition shared with the dashboard and the server that produces them. Re-exported here so
584
+ * this module stays the single import path for the rest of the CLI.
585
+ *
586
+ * What remains below is what is genuinely the CLI's own: transport controls (platform origin,
587
+ * token, fetch, AbortSignal) that no other client shares.
588
+ */
589
+
640
590
  /** Common authenticated transport controls for hosted-security requests. */
641
591
  interface HostedSecurityRequestOptions {
642
592
  platform: string;
@@ -831,4 +781,4 @@ declare function installSkill(options?: SkillInstallOptions): SkillInstallResult
831
781
  */
832
782
  declare function smoke(options: SmokeOptions): Promise<void>;
833
783
 
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 };
784
+ export { AGENT_HARNESSES, type AdminAiOptions, type AgentHarness, type AgentHarnessSelector, type AvailableGoogleCalendar, CAPABILITIES, type CalendarConfig, type CalendarConnectionState, type CalendarLifecycleOptions, type CalendarServiceConfig, type CalendarStatus, type CliDependencies, type ConnectGitHubSecuritySourceOptions, type DisconnectGitHubSecuritySourceOptions, type FollowHostedSecurityJobOptions, GOOGLE_CALENDAR_READ_SCOPE, type GetHostedSecurityIntentOptions, type GetHostedSecurityJobOptions, type GoogleCalendarConfig, type GoogleCalendarMatchConfig, 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, calendarBookingPageUrl, calendarCalendars, calendarConnect, calendarDisconnect, calendarResync, calendarServiceConfig, calendarStatus, 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
@@ -2,8 +2,16 @@
2
2
  import {
3
3
  AGENT_HARNESSES,
4
4
  CAPABILITIES,
5
+ GOOGLE_CALENDAR_READ_SCOPE,
5
6
  SYSTEM_AI_PURPOSES,
6
7
  adminAi,
8
+ calendarBookingPageUrl,
9
+ calendarCalendars,
10
+ calendarConnect,
11
+ calendarDisconnect,
12
+ calendarResync,
13
+ calendarServiceConfig,
14
+ calendarStatus,
7
15
  connectGitHubSecuritySource,
8
16
  disconnectGitHubSecuritySource,
9
17
  doctor,
@@ -26,14 +34,24 @@ import {
26
34
  runCli,
27
35
  runHostedSecurity,
28
36
  secretsPush,
37
+ secretsSet,
38
+ secretsSetClerkKey,
29
39
  smoke,
30
40
  startHostedSecurityJob
31
- } from "./chunk-BHAEDEL2.js";
41
+ } from "./chunk-WDKBW4BE.js";
32
42
  export {
33
43
  AGENT_HARNESSES,
34
44
  CAPABILITIES,
45
+ GOOGLE_CALENDAR_READ_SCOPE,
35
46
  SYSTEM_AI_PURPOSES,
36
47
  adminAi,
48
+ calendarBookingPageUrl,
49
+ calendarCalendars,
50
+ calendarConnect,
51
+ calendarDisconnect,
52
+ calendarResync,
53
+ calendarServiceConfig,
54
+ calendarStatus,
37
55
  connectGitHubSecuritySource,
38
56
  disconnectGitHubSecuritySource,
39
57
  doctor,
@@ -56,6 +74,8 @@ export {
56
74
  runCli,
57
75
  runHostedSecurity,
58
76
  secretsPush,
77
+ secretsSet,
78
+ secretsSetClerkKey,
59
79
  smoke,
60
80
  startHostedSecurityJob
61
81
  };