phala 1.2.3 → 1.2.4

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.
@@ -1,4 +1,5 @@
1
- import { CvmInfoDetailV20260522 } from '@phala/cloud';
1
+ import { CvmLogEntry, CvmLogChannel, CvmInfoDetailV20260522 } from '@phala/cloud';
2
+ export { CvmLogChannel, LogAccessError } from '@phala/cloud';
2
3
  import { z } from 'zod';
3
4
 
4
5
  declare const dockerConfigSchema: z.ZodObject<{
@@ -338,66 +339,30 @@ declare function resizeCvm(appId: string, vcpu?: number, memory?: number, diskSi
338
339
  * @returns Nodes, KMS resources, gateway resources, and instance types for CVM creation
339
340
  */
340
341
  declare function getCvmCreateResources(): Promise<CvmCreateResourcesResponse>;
342
+
343
+ type LogEntry = CvmLogEntry;
341
344
  interface SerialLogsOptions {
342
345
  tail?: number;
343
346
  timestamps?: boolean;
344
- /** RFC3339 timestamp or relative time (backend-dependent) */
345
- since?: string;
346
- /** RFC3339 timestamp or relative time (backend-dependent) */
347
- until?: string;
348
- /** Ask backend to return human-readable text output (recommended default). */
349
- text?: boolean;
350
- /** Ask backend to omit metadata wrappers if supported. */
351
- bare?: boolean;
352
- }
353
- type LogChannel = "stdout" | "stderr";
354
- interface LogEntry {
355
- channel: LogChannel;
356
- message: string;
347
+ /** Absolute Unix seconds resolved at command start. */
348
+ since?: number;
349
+ /** Absolute Unix seconds resolved at command start. */
350
+ until?: number;
357
351
  }
358
352
  interface ContainerLogsOptions extends SerialLogsOptions {
359
353
  container?: string;
360
- /**
361
- * Whether to allow matching a container by its ID prefix.
362
- *
363
- * - cvms logs: true (default, for backward compatibility)
364
- * - logs: false (only match by container name)
365
- */
366
354
  matchContainerIdPrefix?: boolean;
367
355
  }
368
- type CvmLogChannel = "serial" | "stdout" | "stderr";
369
- /** Get CVM-level (syslog) log endpoint URL for a given channel */
370
356
  declare function getCvmLogEndpoint(appId: string, channel: CvmLogChannel): Promise<string>;
371
- /** Fetch serial logs from a CVM */
372
357
  declare function fetchSerialLogs(appId: string, options?: SerialLogsOptions): Promise<string>;
373
- /**
374
- * Fetch container logs from a CVM
375
- * Note: Fetches from a single container. Use --container to specify which one,
376
- * otherwise fetches from the first container with a log endpoint.
377
- */
378
358
  declare function fetchContainerLogs(appId: string, options?: ContainerLogsOptions): Promise<string>;
379
- /**
380
- * Fetch container logs as structured entries.
381
- *
382
- * This is useful when you want to route container stderr to process.stderr
383
- * (like docker does internally).
384
- */
385
359
  declare function fetchContainerLogsEntries(appId: string, options?: ContainerLogsOptions): Promise<LogEntry[]>;
386
- /** Stream container logs as structured entries. */
387
360
  declare function streamContainerLogsEntries(appId: string, onEntry: (entry: LogEntry) => void, options?: ContainerLogsOptions, signal?: AbortSignal): Promise<void>;
388
- /** Stream serial logs from a CVM */
389
361
  declare function streamSerialLogs(appId: string, onData: (data: string) => void, options?: SerialLogsOptions, signal?: AbortSignal): Promise<void>;
390
- /**
391
- * Stream container logs from a CVM
392
- * Note: Streams from a single container. Use --container to specify which one,
393
- * otherwise streams from the first container with a log endpoint.
394
- */
395
362
  declare function streamContainerLogs(appId: string, onData: (data: string) => void, options?: ContainerLogsOptions, signal?: AbortSignal): Promise<void>;
396
- /** Fetch CVM-level channel logs (serial/stdout/stderr) */
397
363
  declare function fetchCvmChannelLogs(appId: string, channel: CvmLogChannel, options?: SerialLogsOptions): Promise<string>;
398
- /** Stream CVM-level channel logs (serial/stdout/stderr) */
399
364
  declare function streamCvmChannelLogs(appId: string, channel: CvmLogChannel, onData: (data: string) => void, options?: SerialLogsOptions, signal?: AbortSignal): Promise<void>;
400
365
  /** Get CVM status string (e.g. "running", "stopped") */
401
366
  declare function getCvmStatus(appId: string): Promise<string>;
402
367
 
403
- export { type AvailableNodesResponse, type CertificateInfo, type CertificateNameInfo, type ComposeFile, type ContainerLogsOptions, type CvmAttestationResponse, type CvmCreateGatewayResource, type CvmCreateInstanceTypeResource, type CvmCreateNodeKmsRelation, type CvmCreateResourcesResponse, type CvmListResponse, type CvmLogChannel, type DockerConfig, type EncryptedEnvItem, type GetCvmNetworkResponse, type GpuAvailability, type Image, type KmsListItem, type LogChannel, type LogEntry, type ProductGpuAvailability, type ReplicateCvmResponse, type ResizeCvmPayload, type SerialLogsOptions, type TCBEventLogEntry, type TCBInfo, type TEEPod, type UserInfoResponse, composeFileSchema, cvmAttestationResponseSchema, dockerConfigSchema, encryptedEnvItemSchema, fetchContainerLogs, fetchContainerLogsEntries, fetchCvmChannelLogs, fetchSerialLogs, getCvmAttestation, getCvmByAppId, getCvmCreateResources, getCvmLogEndpoint, getCvmNetwork, getCvmNetworkResponseSchema, getCvmStatus, imageSchema, replicateCvmResponseSchema, resizeCvm, selectCvm, streamContainerLogs, streamContainerLogsEntries, streamCvmChannelLogs, streamSerialLogs, teepodSchema };
368
+ export { type AvailableNodesResponse, type CertificateInfo, type CertificateNameInfo, type ComposeFile, type ContainerLogsOptions, type CvmAttestationResponse, type CvmCreateGatewayResource, type CvmCreateInstanceTypeResource, type CvmCreateNodeKmsRelation, type CvmCreateResourcesResponse, type CvmListResponse, type DockerConfig, type EncryptedEnvItem, type GetCvmNetworkResponse, type GpuAvailability, type Image, type KmsListItem, type LogEntry, type ProductGpuAvailability, type ReplicateCvmResponse, type ResizeCvmPayload, type SerialLogsOptions, type TCBEventLogEntry, type TCBInfo, type TEEPod, type UserInfoResponse, composeFileSchema, cvmAttestationResponseSchema, dockerConfigSchema, encryptedEnvItemSchema, fetchContainerLogs, fetchContainerLogsEntries, fetchCvmChannelLogs, fetchSerialLogs, getCvmAttestation, getCvmByAppId, getCvmCreateResources, getCvmLogEndpoint, getCvmNetwork, getCvmNetworkResponseSchema, getCvmStatus, imageSchema, replicateCvmResponseSchema, resizeCvm, selectCvm, streamContainerLogs, streamContainerLogsEntries, streamCvmChannelLogs, streamSerialLogs, teepodSchema };