@highstate/backend 0.9.21 → 0.9.23
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/{chunk-JNUJ4LTX.js → chunk-5LYHHLFW.js} +6 -9
- package/dist/chunk-5LYHHLFW.js.map +1 -0
- package/dist/index.js +42 -52
- package/dist/index.js.map +1 -1
- package/dist/library/package-resolution-worker.js +1 -1
- package/dist/library/package-resolution-worker.js.map +1 -1
- package/dist/shared/index.js +1 -1
- package/package.json +3 -3
- package/prisma/backend/postgresql/main.prisma +1 -1
- package/prisma/backend/sqlite/main.prisma +2 -2
- package/prisma/project/instance.prisma +5 -5
- package/prisma/project/main.prisma +2 -2
- package/prisma/project/migrations/20250921092621_b/migration.sql +33 -0
- package/prisma/project/migrations/20250921093911_b/migration.sql +1 -0
- package/prisma/project/operation.prisma +3 -0
- package/src/business/instance-state.ts +0 -3
- package/src/database/_generated/project/client.ts +89 -0
- package/src/database/_generated/project/internal/class.ts +3 -3
- package/src/database/_generated/project/internal/prismaNamespace.ts +3 -4
- package/src/database/_generated/project/models/ApiKey.ts +4 -0
- package/src/database/_generated/project/models/InstanceEvaluationState.ts +9 -0
- package/src/database/_generated/project/models/InstanceState.ts +175 -266
- package/src/database/_generated/project/models/Page.ts +8 -1
- package/src/database/_generated/project/models/Secret.ts +11 -0
- package/src/database/_generated/project/models/ServiceAccount.ts +5 -0
- package/src/database/_generated/project/models/Terminal.ts +10 -1
- package/src/database/_generated/project/models/TerminalSession.ts +2 -0
- package/src/database/_generated/project/models/TerminalSessionLog.ts +2 -0
- package/src/database/_generated/project/models/Trigger.ts +6 -1
- package/src/database/_generated/project/models/UnlockMethod.ts +12 -0
- package/src/database/_generated/project/models/Worker.ts +10 -1
- package/src/database/_generated/project/models/WorkerUnitRegistration.ts +8 -1
- package/src/database/_generated/project/models/WorkerVersion.ts +8 -0
- package/src/database/_generated/project/models/WorkerVersionLog.ts +3 -0
- package/src/library/local.ts +1 -5
- package/src/library/package-resolution-worker.ts +1 -1
- package/src/orchestrator/manager.ts +1 -2
- package/src/orchestrator/operation-context.ts +11 -10
- package/src/orchestrator/operation.ts +16 -6
- package/src/orchestrator/plan-test-builder.ts +0 -1
- package/src/project-model/backends/codebase.ts +1 -1
- package/src/project-model/backends/database.ts +1 -1
- package/src/runner/abstractions.ts +0 -5
- package/src/runner/local.ts +7 -21
- package/src/runner/pulumi.ts +0 -11
- package/src/shared/models/project/operation.ts +7 -5
- package/src/shared/models/project/terminal.ts +2 -1
- package/src/shared/resolvers/state.ts +1 -5
- package/dist/chunk-JNUJ4LTX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessError, InstanceLockLostError, globalProjectSpace, codebaseLibrary, hostPulumiBackend, codebaseProjectModelStorage, databaseProjectModelStorage, ProjectLockedError, ProjectNotFoundError, BackendError, forSchema, projectOutputSchema, InstanceStateNotFoundError, InstanceLockedError, waitAll, OperationNotFoundError, InputResolver, CannotDeleteLastUnlockMethodError, InvalidInstanceKindError, operationOutputSchema, terminalOutputSchema, toTerminalOutput, terminalDetailsOutputSchema, toTerminalDetailsOutput, serviceAccountOutputSchema, apiKeyOutputSchema, toApiKeyOutput, workerOutputSchema, toWorkerOutput, workerVersionOutputSchema, toWorkerVersionOutput, pageDetailsOutputSchema, toPageOutput, secretOutputSchema, toSecretOutput, artifactOutputSchema, triggerOutputSchema, unlockMethodOutputSchema, pageOutputSchema, toTerminalSessionOutput, extractDigestFromImage, getWorkerIdentity, WorkerVersionNotFoundError, createAsyncBatcher, operationOptionsSchema, finalOperationStatuses, finalInstanceOperationStatuses, diffLibraries, isTransientInstanceOperationStatus, InputHashResolver, PromiseTracker, workerUnitRegistrationEventSchema, terminalSessionOutputSchema, operationEventSchema, projectModelEventSchema, instanceLockEventSchema, instanceStateEventSchema, projectUnlockStateSchema, isVirtualGhostInstance } from './chunk-
|
|
1
|
+
import { AccessError, InstanceLockLostError, globalProjectSpace, codebaseLibrary, hostPulumiBackend, codebaseProjectModelStorage, databaseProjectModelStorage, ProjectLockedError, ProjectNotFoundError, BackendError, forSchema, projectOutputSchema, InstanceStateNotFoundError, InstanceLockedError, waitAll, OperationNotFoundError, InputResolver, CannotDeleteLastUnlockMethodError, InvalidInstanceKindError, operationOutputSchema, terminalOutputSchema, toTerminalOutput, terminalDetailsOutputSchema, toTerminalDetailsOutput, serviceAccountOutputSchema, apiKeyOutputSchema, toApiKeyOutput, workerOutputSchema, toWorkerOutput, workerVersionOutputSchema, toWorkerVersionOutput, pageDetailsOutputSchema, toPageOutput, secretOutputSchema, toSecretOutput, artifactOutputSchema, triggerOutputSchema, unlockMethodOutputSchema, pageOutputSchema, toTerminalSessionOutput, extractDigestFromImage, getWorkerIdentity, WorkerVersionNotFoundError, createAsyncBatcher, operationOptionsSchema, finalOperationStatuses, finalInstanceOperationStatuses, diffLibraries, isTransientInstanceOperationStatus, InputHashResolver, PromiseTracker, workerUnitRegistrationEventSchema, terminalSessionOutputSchema, operationEventSchema, projectModelEventSchema, instanceLockEventSchema, instanceStateEventSchema, projectUnlockStateSchema, isVirtualGhostInstance } from './chunk-5LYHHLFW.js';
|
|
2
2
|
import { codebaseConfig, stringArrayType, createProjectLogger, isAbortErrorLike, getCodebaseHighstatePath, resolveMainLocalProject, errorToString, waitForAbort, AbortError, renderTree, runWithRetryOnError } from './chunk-VB4YL327.js';
|
|
3
3
|
import { __using, __callDispose } from './chunk-I7BWSAN6.js';
|
|
4
4
|
import { randomBytes, createHash } from 'node:crypto';
|
|
@@ -972,8 +972,8 @@ var config3 = {
|
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
},
|
|
975
|
-
"inlineSchema": 'model ApiKey {\n /// The CUIDv2 of the API key.\n id String @id @default(cuid(2))\n\n /// The metadata of the API key managed by the backend.\n ///\n /// [ApiKeyMeta]\n meta Json\n\n /// The ID of the service account impersonated by this API key.\n serviceAccountId String\n\n /// The API token for authentication.\n token String @unique\n\n /// The time when the API key was created.\n createdAt DateTime @default(now())\n\n /// The time when the API key was last updated.\n updatedAt DateTime @updatedAt\n\n /// The worker version that owns this API key.\n worker WorkerVersion?\n\n /// The service account which this API key impersonates.\n serviceAccount ServiceAccount @relation(fields: [serviceAccountId], references: [id], onDelete: Cascade)\n}\n\n/// The artifact represents a file or folder stored in the system.\n///\n/// It can be produced by units or manually uploaded via API by service accounts.\n///\n/// Since different actors can produce the same artifact with the same content and hash,\n/// there is the ownership/usage concept to track which entities produce or use the artifact.\n/// The "ownership" and "usage" are synonymous in this context and often referred to as "usage".\n///\n/// When no usages are present, the artifact will be automatically garbage collected after a certain period.\nmodel Artifact {\n /// The CUIDv2 of the artifact.\n id String @id @default(cuid(2))\n\n /// The metadata of the artifact managed by the backend.\n ///\n /// Since multiple actors can produce the same artifact,\n /// this metadata is the last one provided by any actor.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The SHA256 hash of the artifact content.\n hash String @unique\n\n /// The size of the compressed artifact content in bytes.\n ///\n /// Does not represent the size of the original file or folder,\n /// but the size used to store the artifact in the system.\n size Int\n\n /// The chunk size of the artifact content in bytes.\n /// Used to split the artifact into smaller chunks for storage.\n chunkSize Int\n\n /// The timestamp when the artifact fist appeared in the system.\n createdAt DateTime @default(now())\n\n /// The timestamp when the artifact was last updated.\n updatedAt DateTime @updatedAt\n\n /// The service accounts using this artifact.\n serviceAccounts ServiceAccount[]\n\n /// The instances using this artifact.\n instances InstanceState[]\n\n /// The terminals using this artifact.\n terminals Terminal[]\n\n /// The pages using this artifact.\n pages Page[]\n}\n\nmodel InstanceCustomStatus {\n /// The ID of the instance state this status belongs to.\n stateId String\n\n /// The ID of the service account which attached this custom status.\n serviceAccountId String\n\n /// The name of the custom status unique within the instance and service account.\n name String\n\n /// The metadata of the custom status managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The status value of the custom status.\n value String\n\n /// The message describing the instance\'s custom status.\n /// \n /// Can be used to provide additional context or information about the status.\n ///\n /// The message will be displayed in the 800x600 ANSI terminal in the UI,\n /// so differenet TUI elements should be drawn within this area.\n message String?\n\n /// The order of the custom status in the list of statuses.\n ///\n /// Should be values from 0 to 100, where 0 is the highest priority.\n /// By default, the order is 50.\n order Int @default(50)\n\n /// The time when the custom status was first attached to the instance.\n createdAt DateTime @default(now())\n\n /// The time when the custom status was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this custom status belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n /// The service account this custom status belongs to.\n serviceAccount ServiceAccount @relation(fields: [serviceAccountId], references: [id])\n\n @@id([stateId, serviceAccountId, name]) // the name must be unique within the instance and service account\n}\n\nenum InstanceEvaluationStatus {\n /// transient statuses (not persisted in the database)\n evaluating\n\n /// stable statuses\n evaluated\n error\n}\n\nmodel InstanceEvaluationState {\n /// The ID of the state of the instance.\n stateId String @id\n\n /// The status of the instance evaluation.\n status InstanceEvaluationStatus\n\n /// The message describing the evaluation status.\n /// If the evaluation is failed, this message will contain the error description.\n message String?\n\n /// The model produced by the evaluation.\n ///\n /// Will be `null` if the evaluation is failed.\n ///\n /// Can be set for both: real composite instances and virtual instances produced by the evaluation.\n ///\n /// [InstanceModel]\n model Json?\n\n /// The time when the last evaluation was finished.\n evaluatedAt DateTime @updatedAt\n\n /// The instance this state belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n}\n\nenum InstanceStatus {\n /// The instance is exists in the model (resident or virtual), but not yet deployed or was completely destroyed.\n ///\n /// "attempted", "deployed" and "failed" instances cannot be transitioned back to "undeployed" after\n /// successful "destroy" operation.\n undeployed\n\n /// The instance was tryied to be initially deployed.\n ///\n /// Normally, this status is very short-lived, and here to indicate that the instance\n /// cannot be safely deleted from the the model until it will be completely destroyed.\n attempted\n\n /// The initial deployment of the instance was successful.\n ///\n /// The transition of "deployed -> failed" is not possible, so consequent failed operations\n /// will not affect this status.\n ///\n /// Like "attempted", that instance cannot be safely deleted from the model until it will be completely destroyed.\n deployed\n\n /// The initial deployment of the instance failed.\n /// It can still be transitioned to "deployed" by a successful operation\n ///\n /// Like "attempted", that instance cannot be safely deleted from the model until it will be completely destroyed.\n failed\n}\n\nenum InstanceSource {\n /// The instance is defined in the project model.\n resident\n\n /// The instance is produced by evaluation of composite instance.\n virtual\n}\n\nmodel InstanceState {\n /// The surrogate CUIDv2 primary key of the instance to allow renaming instances.\n id String @id @default(cuid(2))\n\n /// The ID of the instance managed by the system.\n ///\n /// [InstanceId]\n instanceId String @unique\n\n /// The status of the instance.\n status InstanceStatus\n\n /// The source of the instance.\n source InstanceSource\n\n /// The kind of the instance.\n ///\n /// [InstanceKind]\n kind String\n\n /// The ID of the parent instance state, if this instance is a child of another composite instance.\n parentId String?\n\n /// The 32-bit nonce used to invalidate the input hash when secrets are updated.\n inputHashNonce Int?\n\n /// The status fields produced by the last operation.\n ///\n /// [InstanceStatusFields]\n statusFields Json?\n\n /// The calculated instance CRC32 input hash at the moment of last operation completion.\n ///\n /// This hash covers:\n /// - the instance\'s configuration (name, args, secret hashes);\n /// - tWorkerVersionponent definition hash;\n /// - the unit\'s source hash (if applicable);\n /// - the input hashes and output hashes of all input instances.\n inputHash Int?\n\n /// The CRC32 of the output produced by the instance at the moment of last operation completion.\n ///\n /// Does not depend on anything except the instance\'s output.\n outputHash Int?\n\n /// The calculated CRC32 dependency output hash at the moment of last operation completion.\n ///\n /// This hash is calculated as combination of output hashes of all input instances and nothing else.\n ///\n /// The primary use case of this hash is to "short-circuit" execution:\n /// if the outputs of input instances have not changed, dependent instances can skip execution,\n /// even if their input hashes changed due to upstream config changes.\n /// This prevents unnecessary re-execution of the entire dependency graph when only non-output-affecting inputs are modified.\n dependencyOutputHash Int?\n\n /// The mapping of instance output names to artifact IDs passed via them.\n ///\n /// Used to authorize access to artifacts for other instances connected to these outputs.\n ///\n /// [InstanceArtifactIds]\n exportedArtifactIds Json?\n\n /// The count of Pulumi resources currently managed by this instance.\n currentResourceCount Int?\n\n /// The message describing the current state of the instance.\n message String?\n\n /// The snapshot of the instance model at the moment of last non-preview operation start.\n ///\n /// Null if the instance was never operated on.\n ///\n /// [InstanceModel]\n model Json?\n\n /// The snapshot of the resolved inputs at the moment of last non-preview operation start.\n ///\n /// Null if the instance was never operated on.\n ///\n /// [InstanceResolvedInputs]\n resolvedInputs Json?\n\n /// The parent instance.\n parent InstanceState? @relation("InstanceHierarchy", fields: [parentId], references: [id])\n\n /// The child instances, if any.\n children InstanceState[] @relation("InstanceHierarchy")\n\n /// The evaluation state of this instance.\n evaluationState InstanceEvaluationState?\n\n /// The operation states associated with this instance.\n operationStates InstanceOperationState[]\n\n /// The secrets associated with this instance.\n secrets Secret[]\n\n /// The terminals associated with this instance.\n terminals Terminal[]\n\n /// The pages associated with this instance.\n pages Page[]\n\n /// The triggers associated with this instance.\n triggers Trigger[]\n\n /// Custom statuses for this instance.\n customStatuses InstanceCustomStatus[]\n\n /// The lock that is currently held on this instance.\n lock InstanceLock?\n\n /// Worker registrations associated with this instance.\n workerRegistrations WorkerUnitRegistration[]\n\n /// The artifacts produced or used by this instance.\n artifacts Artifact[]\n\n /// The operation logs associated with this instance.\n operationLogs OperationLog[]\n\n /// The user viewports associated with this instance.\n userViewports UserCompositeViewport[]\n}\n\nmodel UserProjectViewport {\n /// The opaque ID of the user to which this viewport belongs.\n userId String @id\n\n /// The viewport of the user project managed by the frontend.\n viewport Json\n}\n\nmodel UserCompositeViewport {\n /// The opaque ID of the user to which this viewport belongs.\n userId String\n\n /// The ID of the state of the composite instance to which this viewport belongs.\n stateId String\n\n /// The viewport of the user composite instance managed by the frontend.\n viewport Json\n\n /// The instance state to which this viewport belongs.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n @@id([userId, stateId])\n}\n\nmodel InstanceLock {\n /// The ID of the instance state being locked.\n stateId String @id\n\n /// The metadata of the lock managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The CUIDv2 token to ensure ownership of the lock.\n token String\n\n /// The time when the lock was acquired.\n acquiredAt DateTime @default(now())\n\n /// The instance being locked.\n state InstanceState @relation(fields: [stateId], references: [id])\n}\n\ndatasource db {\n provider = "sqlite"\n directUrl = env("HIGHSTATE_MIGRATION_DATABASE_URL")\n}\n\ngenerator client {\n provider = "prisma-client"\n previewFeatures = ["queryCompiler", "driverAdapters"]\n output = "../../src/database/_generated/project"\n moduleFormat = "esm"\n generatedFileExtension = "ts"\n importFileExtension = "ts"\n}\n\ngenerator json {\n provider = "prisma-json-types-generator"\n}\n\n/// The container for project instances. \n///\n/// Only used when "database" project model storage is used.\nmodel InstanceModel {\n /// The ID of the instance in the format of `{type}:{name}`.\n id String @id\n\n /// The model of the instance managed by the backend.\n ///\n /// [InstanceModel]\n model Json\n\n /// The time when the instance model was created.\n createdAt DateTime @default(now())\n\n /// The time when the instance model was last updated.\n updatedAt DateTime @updatedAt\n}\n\n/// The container for project hubs.\n///\n/// Only used when "database" project model storage is used.\nmodel HubModel {\n /// The CUIDv2 of the hub.\n id String @id\n\n /// The model of the hub managed by the backend.\n ///\n /// [HubModel]\n model Json\n\n /// The time when the hub model was created.\n createdAt DateTime @default(now())\n\n /// The time when the hub model was last updated.\n updatedAt DateTime @updatedAt\n}\n\nenum OperationStatus {\n // transient statuses\n pending\n running\n failing\n\n // stable statuses\n completed\n failed\n cancelled\n}\n\nenum OperationType {\n update\n preview\n destroy\n recreate\n refresh\n}\n\nenum InstanceOperationStatus {\n // transient statuses\n updating\n processing_triggers\n previewing\n destroying\n refreshing\n pending\n cancelling\n\n // stable statuses\n updated\n skipped\n destroyed\n refreshed\n cancelled\n failed\n}\n\nmodel Operation {\n /// The CUIDv2 of the operation.\n id String @id @default(cuid(2))\n\n /// The metadata of the operation.\n ///\n /// [OperationMeta]\n meta Json\n\n /// The type of the operation.\n type OperationType\n\n /// The status of the operation.\n status OperationStatus @default(pending)\n\n /// The options of the operation.\n ///\n /// [OperationOptions]\n options Json\n\n /// The IDs of the instances that were exlicitly requested to operate on.\n ///\n /// [InstanceIds]\n requestedInstanceIds Json\n\n /// The execution phases of the operation.\n ///\n /// [OperationPhase[]]\n phases Json?\n\n /// The time when the operation started.\n startedAt DateTime @default(now())\n\n /// The time when the operation was last updated.\n updatedAt DateTime @updatedAt\n\n /// The time when the operation finished.\n finishedAt DateTime?\n\n /// The operation states associated with this operation.\n operationStates InstanceOperationState[]\n\n /// The logs of the operation.\n logs OperationLog[]\n}\n\nmodel InstanceOperationState {\n /// The ID of the operation this state belongs to.\n operationId String\n\n /// The ID of the instance state affected by the operation.\n stateId String\n\n /// The enum representing the current status of the instance from the operation perspective.\n status InstanceOperationStatus\n\n /// The current count of the Pulumi resources being managed by this instance.\n currentResourceCount Int?\n\n /// The total count of the Pulumi resources that this instance is expected to manage.\n totalResourceCount Int?\n\n /// The snapshot of the instance model at the moment of operation start.\n ///\n /// [InstanceModel]\n model Json\n\n /// The snapshot of the resolved inputs at the moment of operation start.\n ///\n /// [InstanceResolvedInputs]\n resolvedInputs Json\n\n /// The time when the operation on this instance started.\n /// Not populated on create, even if the instance is ready to start immediately.\n startedAt DateTime?\n\n /// The time when the operation on this instance finished.\n finishedAt DateTime?\n\n /// The operation this state belongs to.\n operation Operation @relation(fields: [operationId], references: [id])\n\n /// The instance this state belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n @@id([operationId, stateId])\n}\n\nmodel OperationLog {\n /// The ULID of the log. Also used to extract the timestamp.\n id String @id\n\n /// The ID of the operation this log belongs to.\n operationId String\n\n /// The ID of the instance state this log produced by.\n /// Can be `null` if the log is not associated with any instance.\n stateId String?\n\n /// The content of the log.\n content String\n\n /// The operation this log belongs to.\n operation Operation @relation(fields: [operationId], references: [id])\n\n /// The instance this log produced by.\n /// Can be `null` if the log is not associated with any instance.\n state InstanceState? @relation(fields: [stateId], references: [id])\n}\n\nmodel Page {\n /// The CUIDv2 of the page.\n id String @id @default(cuid(2))\n\n /// The metadata of the page managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The ID of the instance state that owns this page.\n stateId String?\n\n /// The name of the page within the instance.\n /// Will be null if the page is not owned by an instance.\n name String?\n\n /// The ID of the service account that owns this page.\n serviceAccountId String?\n\n /// The content of the page managed by the backend.\n ///\n /// [PageContent]\n content Json\n\n /// The time when the page was created.\n createdAt DateTime @default(now())\n\n /// The time when the page was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this page belongs to if any.\n state InstanceState? @relation(fields: [stateId], references: [id])\n\n /// The service account this page belongs to if any. \n serviceAccount ServiceAccount? @relation(fields: [serviceAccountId], references: [id])\n\n /// The artifacts used by this page.\n artifacts Artifact[]\n\n @@unique([stateId, name]) // the name is unique within the instance\n}\n\nmodel Secret {\n /// The CUIDv2 of the secret.\n id String @id @default(cuid(2))\n\n /// The metadata of the secret managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The ID of the state of the instance owning this secret.\n stateId String?\n\n /// The name of the secret within the instance.\n ///\n /// Will be null if the secret is not owned by an instance.\n name String?\n\n /// The name of the secret within the project if the secret is a system secret.\n systemName String? @unique\n\n /// The ID of the service account owning this secret.\n serviceAccountId String?\n\n /// The content of the secret.\n ///\n /// ![unknown]\n content Json\n\n /// The time when the secret was created.\n createdAt DateTime @default(now())\n\n /// The time when the secret was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this secret belongs to.\n state InstanceState? @relation(fields: [stateId], references: [id])\n\n /// The service account this secret belongs to.\n serviceAccount ServiceAccount? @relation(fields: [serviceAccountId], references: [id])\n\n @@unique([stateId, name]) // the name must be unique within the instance\n}\n\nmodel ServiceAccount {\n /// The CUIDv2 of the service account.\n id String @id @default(cuid(2))\n\n /// The metadata of the service account managed by the backend.\n ///\n /// [ServiceAccountMeta]\n meta Json\n\n /// The time when the service account was created.\n createdAt DateTime @default(now())\n\n /// The time when the service account was last updated.\n updatedAt DateTime @updatedAt\n\n /// The workers using this service account.\n workers Worker[]\n\n /// The artifacts used by this service account.\n artifacts Artifact[]\n\n /// The secrets owned by this service account.\n secrets Secret[]\n\n /// The terminals owned by this service account.\n terminals Terminal[]\n\n /// The pages owned by this service account.\n pages Page[]\n\n /// The instance custom statuses attached by this service account.\n customStatuses InstanceCustomStatus[]\n\n /// The API keys impersonating this service account.\n apiKeys ApiKey[]\n}\n\nenum TerminalStatus {\n /// The terminal is currently active and can create new sessions.\n active\n\n /// The instance was destroyed and the tertminal is no longer available, but here for historical purposes.\n unavailable\n}\n\nmodel Terminal {\n /// The CUIDv2 of the terminal.\n id String @id @default(cuid(2))\n\n /// The metadata of the terminal managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The status of the terminal.\n status TerminalStatus @default(active)\n\n /// The specification of the terminal managed by the backend.\n ///\n /// [TerminalSpec]\n spec Json\n\n /// The ID of the instance state owning this terminal.\n stateId String?\n\n /// The name of the terminal within the instance.\n ///\n /// Will be null if the terminal is not owned by an instance.\n name String?\n\n /// The ID of the service account owning this terminal.\n serviceAccountId String?\n\n /// The time when the terminal was created.\n createdAt DateTime @default(now())\n\n /// The time when the terminal was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this terminal belongs to.\n state InstanceState? @relation(fields: [stateId], references: [id], onDelete: Cascade)\n\n /// The service account this terminal belongs to.\n serviceAccount ServiceAccount? @relation(fields: [serviceAccountId], references: [id], onDelete: Cascade)\n\n /// The terminal sessions associated with this terminal.\n sessions TerminalSession[]\n\n /// The artifacts used by this terminal.\n artifacts Artifact[]\n\n @@unique([stateId, name]) // the name is unique within the instance\n}\n\nmodel TerminalSession {\n /// The CUIDv2 of the terminal session.\n id String @id @default(cuid(2))\n\n /// The ID of the terminal this session belongs to.\n terminalId String\n\n /// The time when the terminal session started.\n startedAt DateTime @default(now())\n\n /// The time when the terminal session finished.\n finishedAt DateTime?\n\n /// The terminal this session belongs to.\n terminal Terminal @relation(fields: [terminalId], references: [id], onDelete: Cascade)\n\n /// The logs of the terminal session.\n logs TerminalSessionLog[]\n}\n\nmodel TerminalSessionLog {\n /// The ULID of the session log. Also used to extract the timestamp.\n id String @id\n\n /// The ID of the terminal session this log belongs to.\n sessionId String\n\n /// The content of the log.\n content String\n\n /// The terminal session this log belongs to.\n session TerminalSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)\n}\n\nmodel Trigger {\n /// The CUIDv2 of the trigger.\n id String @id @default(cuid(2))\n\n /// The metadata of the trigger managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The ID of the instance state this trigger belongs to.\n stateId String\n\n /// The name of the trigger within the instance.\n name String\n\n /// The specification of the trigger describing its behavior and configuration.\n ///\n /// [TriggerSpec]\n spec Json\n\n /// The time when the trigger was created.\n createdAt DateTime @default(now())\n\n /// The time when the trigger was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this trigger belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n @@unique([stateId, name]) // the name is unique within the instance\n}\n\nenum UnlockMethodType {\n /// The password is used to unlock the project.\n password\n\n /// The passkey (via WebAuthn) is used to unlock the project.\n passkey\n}\n\nmodel UnlockMethod {\n /// The CUIDv2 of the unlock method.\n id String @id @default(cuid(2))\n\n /// The metadata of the unlock method managed by the backend.\n /// \n /// [UnlockMethodMeta]\n meta Json\n\n /// The type of unlock method.\n type UnlockMethodType\n\n /// The AGE identity encrypted and armored also with AGE.\n encryptedIdentity String\n\n /// The AGE recipient for this unlock method.\n recipient String\n\n /// The time when the unlock method was created.\n createdAt DateTime @default(now())\n\n /// The time when the unlock method was last updated.\n updatedAt DateTime @updatedAt\n}\n\nmodel Worker {\n /// The CUIDv2 of the worker.\n id String @id @default(cuid(2))\n\n /// The ID of the worker.\n ///\n /// This is the fully qualified image name without the tag or digest.\n /// The format is `{<registry>/}[<namespace>/]<name>`.\n ///\n /// For example: `ghcr.io/highstate/worker` or `docker.io/library/ubuntu`.\n identity String @unique\n\n /// The ID of the service account this worker uses.\n serviceAccountId String @unique\n\n /// The time this worker first appeared in the system.\n createdAt DateTime @default(now())\n\n /// The service account impersonating this worker.\n serviceAccount ServiceAccount @relation(fields: [serviceAccountId], references: [id])\n\n /// The versions of this worker.\n versions WorkerVersion[]\n}\n\nenum WorkerVersionStatus {\n /// The status is unknown.\n unknown\n\n /// The worker is being started by one of the runtimes.\n starting\n\n /// The worker is running and serving registrations.\n running\n\n /// The worker is being stopping (after was starting/running and was disabled).\n stopping\n\n /// The worker is stopped and not serving registrations.\n stopped\n\n /// The worker failed to start/crashed more than the allowed number of times.\n error\n}\n\nmodel WorkerVersion {\n /// The CUIDv2 of the worker version.\n id String @id @default(cuid(2))\n\n /// The metadata of the worker version managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The current status of the worker version reported by the runtime.\n status WorkerVersionStatus @default(unknown)\n\n /// Whether this worker version is enabled and will be launched when project is unclocked.\n enabled Boolean @default(true)\n\n /// The ID of the runtime where this worker version currently runs.\n runtimeId String?\n\n /// The ID of the worker this version belongs to.\n workerId String\n\n /// The digest of the worker version used to identify it.\n /// The format is raw SHA256 digest without the `sha256:` prefix.\n digest String @unique\n\n /// The ID of the API key this worker version uses.\n apiKeyId String @unique\n\n /// The time this worker version was created.\n createdAt DateTime @default(now())\n\n /// The time this worker version was last updated.\n updatedAt DateTime @updatedAt\n\n /// The worker this version belongs to.\n worker Worker @relation(fields: [workerId], references: [id])\n\n /// The API key this worker version uses.\n apiKey ApiKey @relation(fields: [apiKeyId], references: [id])\n\n /// The unit registrations for this worker version.\n unitRegistrations WorkerUnitRegistration[]\n\n /// The logs produced by this worker version.\n logs WorkerVersionLog[]\n}\n\nmodel WorkerUnitRegistration {\n /// The ID of the state of the unit instance requesting the registration.\n stateId String\n\n /// The name of the workor within the instance.\n name String\n\n /// The parameters of the registration passed by the unit.\n ///\n /// [WorkerUnitRegistrationParams]\n params Json\n\n /// The ID of the worker version this registration currently uses.\n workerVersionId String\n\n /// The time this registration was created.\n createdAt DateTime @default(now())\n\n /// The time this registration was last updated.\n updatedAt DateTime @updatedAt\n\n /// The unit instance requesting the registration.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n /// The worker version this registration currently uses.\n workerVersion WorkerVersion @relation(fields: [workerVersionId], references: [id])\n\n @@id([stateId, name]) // the registration is identified by the instance and name\n}\n\nmodel WorkerVersionLog {\n /// The ULID of the worker log. Also used to extract the timestamp.\n id String @id @default(ulid())\n\n /// The ID of the worker version that produced this log.\n workerVersionId String\n\n /// The log content.\n content String\n\n /// Whether this log is a system/runtime message (vs worker output).\n isSystem Boolean @default(false)\n\n /// The worker version that produced this log.\n workerVersion WorkerVersion @relation(fields: [workerVersionId], references: [id], onDelete: Cascade)\n}\n',
|
|
976
|
-
"inlineSchemaHash": "
|
|
975
|
+
"inlineSchema": '/// The API key provides authentication tokens for accessing the platform API.\n///\n/// Each API key impersonates a service account, inheriting its permissions and access scope.\n/// Keys are automatically created for worker versions and can be manually created for\n/// external integrations. The token is a 32-byte random hex string that can be regenerated.\nmodel ApiKey {\n /// The CUIDv2 of the API key.\n id String @id @default(cuid(2))\n\n /// The metadata of the API key managed by the backend.\n ///\n /// [ApiKeyMeta]\n meta Json\n\n /// The ID of the service account impersonated by this API key.\n serviceAccountId String\n\n /// The API token for authentication.\n token String @unique\n\n /// The time when the API key was created.\n createdAt DateTime @default(now())\n\n /// The time when the API key was last updated.\n updatedAt DateTime @updatedAt\n\n /// The worker version that owns this API key.\n worker WorkerVersion?\n\n /// The service account which this API key impersonates.\n serviceAccount ServiceAccount @relation(fields: [serviceAccountId], references: [id], onDelete: Cascade)\n}\n\n/// The artifact represents a file or folder stored in the system.\n///\n/// It can be produced by units or manually uploaded via API by service accounts.\n///\n/// Since different actors can produce the same artifact with the same content and hash,\n/// there is the ownership/usage concept to track which entities produce or use the artifact.\n/// The "ownership" and "usage" are synonymous in this context and often referred to as "usage".\n///\n/// When no usages are present, the artifact will be automatically garbage collected after a certain period.\nmodel Artifact {\n /// The CUIDv2 of the artifact.\n id String @id @default(cuid(2))\n\n /// The metadata of the artifact managed by the backend.\n ///\n /// Since multiple actors can produce the same artifact,\n /// this metadata is the last one provided by any actor.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The SHA256 hash of the artifact content.\n hash String @unique\n\n /// The size of the compressed artifact content in bytes.\n ///\n /// Does not represent the size of the original file or folder,\n /// but the size used to store the artifact in the system.\n size Int\n\n /// The chunk size of the artifact content in bytes.\n /// Used to split the artifact into smaller chunks for storage.\n chunkSize Int\n\n /// The timestamp when the artifact fist appeared in the system.\n createdAt DateTime @default(now())\n\n /// The timestamp when the artifact was last updated.\n updatedAt DateTime @updatedAt\n\n /// The service accounts using this artifact.\n serviceAccounts ServiceAccount[]\n\n /// The instances using this artifact.\n instances InstanceState[]\n\n /// The terminals using this artifact.\n terminals Terminal[]\n\n /// The pages using this artifact.\n pages Page[]\n}\n\nmodel InstanceCustomStatus {\n /// The ID of the instance state this status belongs to.\n stateId String\n\n /// The ID of the service account which attached this custom status.\n serviceAccountId String\n\n /// The name of the custom status unique within the instance and service account.\n name String\n\n /// The metadata of the custom status managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The status value of the custom status.\n value String\n\n /// The message describing the instance\'s custom status.\n /// \n /// Can be used to provide additional context or information about the status.\n ///\n /// The message will be displayed in the 800x600 ANSI terminal in the UI,\n /// so differenet TUI elements should be drawn within this area.\n message String?\n\n /// The order of the custom status in the list of statuses.\n ///\n /// Should be values from 0 to 100, where 0 is the highest priority.\n /// By default, the order is 50.\n order Int @default(50)\n\n /// The time when the custom status was first attached to the instance.\n createdAt DateTime @default(now())\n\n /// The time when the custom status was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this custom status belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n /// The service account this custom status belongs to.\n serviceAccount ServiceAccount @relation(fields: [serviceAccountId], references: [id])\n\n @@id([stateId, serviceAccountId, name]) // the name must be unique within the instance and service account\n}\n\nenum InstanceEvaluationStatus {\n /// transient statuses (not persisted in the database)\n evaluating\n\n /// stable statuses\n evaluated\n error\n}\n\n/// The evaluation state tracks the result of evaluating composite instances to produce virtual instances.\n///\n/// Composite instances are template components that generate other instances (virtual instances) when evaluated.\n/// The evaluation process executes the composite\'s create function with resolved inputs to produce a tree\n/// of child instances. These virtual instances exist in the source "virtual" state and can be units\n/// (mapping to Pulumi resources) or other composites (producing more virtual instances recursively).\n///\n/// Evaluation happens automatically after project unlock and library reloads to keep virtual instances\n/// synchronized with their composite definitions. Evaluation state persists the produced instance model\n/// and tracks success/error status with descriptive messages showing the instance tree or error details.\nmodel InstanceEvaluationState {\n /// The ID of the state of the instance.\n stateId String @id\n\n /// The status of the instance evaluation.\n status InstanceEvaluationStatus\n\n /// The message describing the evaluation status.\n /// If the evaluation is failed, this message will contain the error description.\n message String?\n\n /// The model produced by the evaluation.\n ///\n /// Will be `null` if the evaluation is failed.\n ///\n /// Can be set for both: real composite instances and virtual instances produced by the evaluation.\n ///\n /// [InstanceModel]\n model Json?\n\n /// The time when the last evaluation was finished.\n evaluatedAt DateTime @updatedAt\n\n /// The instance this state belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n}\n\nenum InstanceStatus {\n /// The instance is exists in the model (resident or virtual), but not yet deployed or was completely destroyed.\n ///\n /// "attempted", "deployed" and "failed" instances can be transitioned back to "undeployed" after\n /// successful "destroy" operation.\n undeployed\n\n /// The instance is attempted, but not yet fully deployed.\n ///\n /// Normally, this status is very short-lived, and here to indicate that the instance\n /// cannot be safely deleted from the the model until it will be completely destroyed.\n attempted\n\n /// The initial deployment of the instance was successful.\n ///\n /// The transition of "deployed -> failed" is not possible, so consequent failed operations\n /// will not affect this status.\n ///\n /// Like "attempted", that instance cannot be safely deleted from the model until it will be completely destroyed.\n deployed\n\n /// The initial deployment of the instance failed.\n /// It can still be transitioned to "deployed" by a successful operation\n ///\n /// Like "attempted", that instance cannot be safely deleted from the model until it will be completely destroyed.\n failed\n}\n\nenum InstanceSource {\n /// The instance is defined in the project model.\n resident\n\n /// The instance is produced by evaluation of composite instance.\n virtual\n}\n\nmodel InstanceState {\n /// The surrogate CUIDv2 primary key of the instance to allow renaming instances.\n id String @id @default(cuid(2))\n\n /// The ID of the instance managed by the system.\n ///\n /// [InstanceId]\n instanceId String @unique\n\n /// The status of the instance.\n status InstanceStatus\n\n /// The source of the instance.\n source InstanceSource\n\n /// The kind of the instance.\n ///\n /// [InstanceKind]\n kind String\n\n /// The ID of the parent instance state, if this instance is a child of another composite instance.\n parentId String?\n\n /// The 32-bit nonce used to invalidate the input hash when secrets are updated.\n inputHashNonce Int?\n\n /// The calculated instance CRC32 input hash at the moment of last operation completion.\n ///\n /// This hash covers:\n /// - the instance\'s configuration (name, args, secret hashes);\n /// - component definition hash;\n /// - the unit\'s source hash (if applicable);\n /// - the input hashes and output hashes of all input instances.\n inputHash Int?\n\n /// The CRC32 of the SHA256 of the output produced by the instance at the moment of last operation completion.\n ///\n /// Does not depend on anything except the instance\'s output.\n outputHash Int?\n\n /// The calculated CRC32 dependency output hash at the moment of last operation completion.\n ///\n /// This hash is calculated as combination of output hashes of all input instances and nothing else.\n ///\n /// The primary use case of this hash is to "short-circuit" execution:\n /// if the outputs of input instances have not changed, dependent instances can skip execution,\n /// even if their input hashes changed due to upstream config changes.\n /// This prevents unnecessary re-execution of the entire dependency graph when only non-output-affecting inputs are modified.\n dependencyOutputHash Int?\n\n /// The mapping of instance output names to artifact IDs passed via them.\n ///\n /// Used to authorize access to artifacts for other instances connected to these outputs.\n ///\n /// [InstanceArtifactIds]\n exportedArtifactIds Json?\n\n /// The snapshot of the instance model at the moment of last non-preview operation start.\n ///\n /// Null if the instance was never operated on.\n ///\n /// [InstanceModel]\n model Json?\n\n /// The snapshot of the resolved inputs at the moment of last non-preview operation start.\n ///\n /// Null if the instance was never operated on.\n ///\n /// [InstanceResolvedInputs]\n resolvedInputs Json?\n\n /// The count of Pulumi resources currently managed by this instance.\n currentResourceCount Int?\n\n /// The status fields produced by the last operation.\n ///\n /// [InstanceStatusFields]\n statusFields Json?\n\n /// The parent instance.\n parent InstanceState? @relation("InstanceHierarchy", fields: [parentId], references: [id])\n\n /// The child instances, if any.\n children InstanceState[] @relation("InstanceHierarchy")\n\n /// The evaluation state of this instance.\n evaluationState InstanceEvaluationState?\n\n /// The operation states associated with this instance.\n operationStates InstanceOperationState[]\n\n /// The secrets associated with this instance.\n secrets Secret[]\n\n /// The terminals associated with this instance.\n terminals Terminal[]\n\n /// The pages associated with this instance.\n pages Page[]\n\n /// The triggers associated with this instance.\n triggers Trigger[]\n\n /// Custom statuses for this instance.\n customStatuses InstanceCustomStatus[]\n\n /// The lock that is currently held on this instance.\n lock InstanceLock?\n\n /// Worker registrations associated with this instance.\n workerRegistrations WorkerUnitRegistration[]\n\n /// The artifacts produced or used by this instance.\n artifacts Artifact[]\n\n /// The operation logs associated with this instance.\n operationLogs OperationLog[]\n\n /// The user viewports associated with this instance.\n userViewports UserCompositeViewport[]\n}\n\nmodel UserProjectViewport {\n /// The opaque ID of the user to which this viewport belongs.\n userId String @id\n\n /// The viewport of the user project managed by the frontend.\n viewport Json\n}\n\nmodel UserCompositeViewport {\n /// The opaque ID of the user to which this viewport belongs.\n userId String\n\n /// The ID of the state of the composite instance to which this viewport belongs.\n stateId String\n\n /// The viewport of the user composite instance managed by the frontend.\n viewport Json\n\n /// The instance state to which this viewport belongs.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n @@id([userId, stateId])\n}\n\nmodel InstanceLock {\n /// The ID of the instance state being locked.\n stateId String @id\n\n /// The metadata of the lock managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The CUIDv2 token to ensure ownership of the lock.\n token String\n\n /// The time when the lock was acquired.\n acquiredAt DateTime @default(now())\n\n /// The instance being locked.\n state InstanceState @relation(fields: [stateId], references: [id])\n}\n\ndatasource db {\n provider = "sqlite"\n directUrl = env("HIGHSTATE_MIGRATION_DATABASE_URL")\n}\n\ngenerator client {\n provider = "prisma-client"\n previewFeatures = ["queryCompiler", "driverAdapters"]\n output = "../../src/database/_generated/project"\n moduleFormat = "esm"\n generatedFileExtension = "ts"\n importFileExtension = "ts"\n}\n\ngenerator json {\n provider = "prisma-json-types-generator"\n}\n\n/// The container for project instances. \n///\n/// Only used when "database" project model storage is used.\nmodel InstanceModel {\n /// The ID of the instance in the format of `{type}:{name}`.\n id String @id\n\n /// The model of the instance managed by the backend.\n ///\n /// [InstanceModel]\n model Json\n\n /// The time when the instance model was created.\n createdAt DateTime @default(now())\n\n /// The time when the instance model was last updated.\n updatedAt DateTime @updatedAt\n}\n\n/// The container for project hubs.\n///\n/// Only used when "database" project model storage is used.\nmodel HubModel {\n /// The CUIDv2 of the hub.\n id String @id\n\n /// The model of the hub managed by the backend.\n ///\n /// [HubModel]\n model Json\n\n /// The time when the hub model was created.\n createdAt DateTime @default(now())\n\n /// The time when the hub model was last updated.\n updatedAt DateTime @updatedAt\n}\n\nenum OperationStatus {\n // transient statuses\n pending\n running\n failing\n\n // stable statuses\n completed\n failed\n cancelled\n}\n\nenum OperationType {\n update\n preview\n destroy\n recreate\n refresh\n}\n\nenum InstanceOperationStatus {\n // transient statuses\n updating\n processing_triggers\n previewing\n destroying\n refreshing\n pending\n cancelling\n\n // stable statuses\n updated\n skipped\n destroyed\n refreshed\n cancelled\n failed\n}\n\nmodel Operation {\n /// The CUIDv2 of the operation.\n id String @id @default(cuid(2))\n\n /// The metadata of the operation.\n ///\n /// [OperationMeta]\n meta Json\n\n /// The type of the operation.\n type OperationType\n\n /// The status of the operation.\n status OperationStatus @default(pending)\n\n /// The options of the operation.\n ///\n /// [OperationOptions]\n options Json\n\n /// The IDs of the instances that were exlicitly requested to operate on.\n ///\n /// [InstanceIds]\n requestedInstanceIds Json\n\n /// The execution phases of the operation.\n ///\n /// [OperationPhase[]]\n phases Json?\n\n /// The time when the operation started.\n startedAt DateTime @default(now())\n\n /// The time when the operation was last updated.\n updatedAt DateTime @updatedAt\n\n /// The time when the operation finished.\n finishedAt DateTime?\n\n /// The operation states associated with this operation.\n operationStates InstanceOperationState[]\n\n /// The logs of the operation.\n logs OperationLog[]\n}\n\nmodel InstanceOperationState {\n /// The ID of the operation this state belongs to.\n operationId String\n\n /// The ID of the instance state affected by the operation.\n stateId String\n\n /// The enum representing the current status of the instance from the operation perspective.\n status InstanceOperationStatus\n\n /// The current count of the Pulumi resources being managed by this instance.\n currentResourceCount Int?\n\n /// The total count of the Pulumi resources that this instance is expected to manage.\n totalResourceCount Int?\n\n /// The snapshot of the instance model at the moment of operation start.\n ///\n /// [InstanceModel]\n model Json\n\n /// The snapshot of the resolved inputs at the moment of operation start.\n ///\n /// [InstanceResolvedInputs]\n resolvedInputs Json\n\n /// The time when the operation on this instance started.\n /// Not populated on create, even if the instance is ready to start immediately.\n startedAt DateTime?\n\n /// The time when the operation on this instance finished.\n finishedAt DateTime?\n\n /// The operation this state belongs to.\n operation Operation @relation(fields: [operationId], references: [id])\n\n /// The instance this state belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n @@id([operationId, stateId])\n}\n\nmodel OperationLog {\n /// The ULID of the log. Also used to extract the timestamp.\n id String @id\n\n /// The ID of the operation this log belongs to.\n operationId String\n\n /// The ID of the instance state this log produced by.\n /// Can be `null` if the log is not associated with any instance.\n stateId String?\n\n /// The content of the log.\n content String\n\n /// The operation this log belongs to.\n operation Operation @relation(fields: [operationId], references: [id])\n\n /// The instance this log produced by.\n /// Can be `null` if the log is not associated with any instance.\n state InstanceState? @relation(fields: [stateId], references: [id])\n}\n\n/// The page provides custom UI content for instances and service accounts.\n///\n/// Pages can be created by units to display instance-specific information or by service accounts.\n/// The content consists of blocks that support markdown text, QR codes with optional content display,\n/// and file attachments (inline or artifact references). Instance pages are explicitly deleted\n/// when instances are destroyed.\nmodel Page {\n /// The CUIDv2 of the page.\n id String @id @default(cuid(2))\n\n /// The metadata of the page managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The ID of the instance state that owns this page.\n stateId String?\n\n /// The name of the page within the instance.\n /// Will be null if the page is not owned by an instance.\n name String?\n\n /// The ID of the service account that owns this page.\n serviceAccountId String?\n\n /// The content of the page as an array of blocks.\n ///\n /// Supports markdown, QR codes, and file blocks.\n ///\n /// [PageContent]\n content Json\n\n /// The time when the page was created.\n createdAt DateTime @default(now())\n\n /// The time when the page was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this page belongs to if any.\n state InstanceState? @relation(fields: [stateId], references: [id])\n\n /// The service account this page belongs to if any. \n serviceAccount ServiceAccount? @relation(fields: [serviceAccountId], references: [id])\n\n /// The artifacts used by this page.\n artifacts Artifact[]\n\n @@unique([stateId, name]) // the name is unique within the instance\n}\n\n/// The secret stores sensitive configuration values for instances, service accounts, and system components.\n///\n/// Secrets can be instance-owned (for unit configuration), service account-owned, or system-level\n/// (like Pulumi passwords). \n///\n/// Secrets persist through normal destroy (recreate) operations\n/// and are only deleted when explicitly forgetting instance state with the deleteSecrets flag or when manually deleted.\n///\n/// Secret updates invalidate instance input hashes via inputHashNonce, triggering re-execution\n/// during operations. But the content of the secrets itself do not contribute to the input hash.\n///\n/// System secrets like Pulumi passwords are created on-demand and persist for the whole project lifetime.\nmodel Secret {\n /// The CUIDv2 of the secret.\n id String @id @default(cuid(2))\n\n /// The metadata of the secret managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The ID of the state of the instance owning this secret.\n stateId String?\n\n /// The name of the secret within the instance.\n ///\n /// Will be null if the secret is not owned by an instance.\n name String?\n\n /// The name of the secret within the project if the secret is a system secret.\n systemName String? @unique\n\n /// The ID of the service account owning this secret.\n serviceAccountId String?\n\n /// The content of the secret.\n ///\n /// ![unknown]\n content Json\n\n /// The time when the secret was created.\n createdAt DateTime @default(now())\n\n /// The time when the secret was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this secret belongs to.\n state InstanceState? @relation(fields: [stateId], references: [id])\n\n /// The service account this secret belongs to.\n serviceAccount ServiceAccount? @relation(fields: [serviceAccountId], references: [id])\n\n @@unique([stateId, name]) // the name must be unique within the instance\n}\n\n/// The service account represents an identity for non-human actors in the system.\n///\n/// Service accounts are automatically created for workers and can be manually created\n/// for external integrations. They define the access scope for resources like artifacts,\n/// secrets, terminals, and pages. Multiple API keys can impersonate the same service account,\n/// allowing different authentication tokens to share the same permissions.\nmodel ServiceAccount {\n /// The CUIDv2 of the service account.\n id String @id @default(cuid(2))\n\n /// The metadata of the service account managed by the backend.\n ///\n /// [ServiceAccountMeta]\n meta Json\n\n /// The time when the service account was created.\n createdAt DateTime @default(now())\n\n /// The time when the service account was last updated.\n updatedAt DateTime @updatedAt\n\n /// The workers using this service account.\n workers Worker[]\n\n /// The artifacts used by this service account.\n artifacts Artifact[]\n\n /// The secrets owned by this service account.\n secrets Secret[]\n\n /// The terminals owned by this service account.\n terminals Terminal[]\n\n /// The pages owned by this service account.\n pages Page[]\n\n /// The instance custom statuses attached by this service account.\n customStatuses InstanceCustomStatus[]\n\n /// The API keys impersonating this service account.\n apiKeys ApiKey[]\n}\n\n/// The terminal status indicates whether a terminal can accept new connections.\nenum TerminalStatus {\n /// The terminal is currently active and can create new sessions.\n active\n\n /// The instance was destroyed and the terminal is no longer available, but here for historical purposes.\n unavailable\n}\n\n/// The terminal provides interactive shell access to infrastructure resources.\n///\n/// Terminals can be created by units (owned by instances) or by service accounts.\n/// Each terminal maintains a specification for creating containers that power the terminal,\n/// including image, command, environment, and mounted files.\n///\n/// Instance-owned terminals are marked unavailable when the instance is destroyed, preserving session history.\n/// Service account terminals persist independently.\nmodel Terminal {\n /// The CUIDv2 of the terminal.\n id String @id @default(cuid(2))\n\n /// The metadata of the terminal managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The status of the terminal.\n status TerminalStatus @default(active)\n\n /// The specification for creating the container that powers this terminal.\n ///\n /// Includes image, command, working directory, environment variables, and files.\n ///\n /// [TerminalSpec]\n spec Json\n\n /// The ID of the instance state owning this terminal.\n stateId String?\n\n /// The name of the terminal within the instance.\n ///\n /// Will be null if the terminal is not owned by an instance.\n name String?\n\n /// The ID of the service account owning this terminal.\n serviceAccountId String?\n\n /// The time when the terminal was created.\n createdAt DateTime @default(now())\n\n /// The time when the terminal was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this terminal belongs to.\n state InstanceState? @relation(fields: [stateId], references: [id], onDelete: Cascade)\n\n /// The service account this terminal belongs to.\n serviceAccount ServiceAccount? @relation(fields: [serviceAccountId], references: [id], onDelete: Cascade)\n\n /// The terminal sessions associated with this terminal.\n sessions TerminalSession[]\n\n /// The artifacts used by this terminal.\n artifacts Artifact[]\n\n @@unique([stateId, name]) // the name is unique within the instance\n}\n\n/// The terminal session represents a single interactive connection to a terminal.\n///\n/// Each session tracks when it started and finished. All session output is preserved in logs.\nmodel TerminalSession {\n /// The CUIDv2 of the terminal session.\n id String @id @default(cuid(2))\n\n /// The ID of the terminal this session belongs to.\n terminalId String\n\n /// The time when the terminal session started.\n startedAt DateTime @default(now())\n\n /// The time when the terminal session finished.\n finishedAt DateTime?\n\n /// The terminal this session belongs to.\n terminal Terminal @relation(fields: [terminalId], references: [id], onDelete: Cascade)\n\n /// The logs of the terminal session.\n logs TerminalSessionLog[]\n}\n\n/// The terminal session log captures all input and output from a terminal session.\n///\n/// Logs are stored with ULID identifiers for timestamp ordering.\nmodel TerminalSessionLog {\n /// The ULID of the session log. Also used to extract the timestamp.\n id String @id\n\n /// The ID of the terminal session this log belongs to.\n sessionId String\n\n /// The content of the log.\n content String\n\n /// The terminal session this log belongs to.\n session TerminalSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)\n}\n\n/// The trigger defines automated actions that execute in response to specific events.\n///\n/// Triggers are created by units to perform actions at defined points in the instance lifecycle\n/// or on schedule. The spec field determines the trigger type and behavior - currently supporting\n/// before-destroy triggers, with planned support for additional types like cron scheduling.\n/// Triggers are deleted along with their instance.\nmodel Trigger {\n /// The CUIDv2 of the trigger.\n id String @id @default(cuid(2))\n\n /// The metadata of the trigger managed by the backend.\n ///\n /// [GlobalCommonObjectMeta]\n meta Json\n\n /// The ID of the instance state this trigger belongs to.\n stateId String\n\n /// The name of the trigger within the instance.\n name String\n\n /// The specification of the trigger describing its type and behavior.\n ///\n /// [TriggerSpec]\n spec Json\n\n /// The time when the trigger was created.\n createdAt DateTime @default(now())\n\n /// The time when the trigger was last updated.\n updatedAt DateTime @updatedAt\n\n /// The instance this trigger belongs to.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n @@unique([stateId, name]) // the name is unique within the instance\n}\n\n/// The unlock method type determines how users authenticate to decrypt project databases.\nenum UnlockMethodType {\n /// The password is used to unlock the project.\n password\n\n /// The passkey (via WebAuthn) is used to unlock the project.\n passkey\n}\n\n/// The unlock method enables decryption of project databases through user authentication.\n///\n/// Each project database is encrypted with a master key, which is then encrypted for each\n/// unlock method\'s recipient using AGE encryption. Users authenticate (password or passkey)\n/// to decrypt their specific AGE identity, which then decrypts the master key.\n///\n/// Multiple unlock methods can exist per project, allowing different authentication paths\n/// to the same encrypted database. When unlock methods are added/removed, the master key\n/// is re-encrypted for the new set of recipients.\n///\n/// The encryptedIdentity contains the AGE identity encrypted with the user\'s authentication\n/// method (password-derived key or WebAuthn), while the recipient is the public key\n/// corresponding to that identity.\nmodel UnlockMethod {\n /// The CUIDv2 of the unlock method.\n id String @id @default(cuid(2))\n\n /// The metadata of the unlock method managed by the backend.\n /// \n /// [UnlockMethodMeta]\n meta Json\n\n /// The type of unlock method.\n type UnlockMethodType\n\n /// The AGE identity encrypted and armored also with AGE.\n encryptedIdentity String\n\n /// The AGE recipient for this unlock method.\n recipient String\n\n /// The time when the unlock method was created.\n createdAt DateTime @default(now())\n\n /// The time when the unlock method was last updated.\n updatedAt DateTime @updatedAt\n}\n\n/// The worker represents a containerized application that extends unit capabilities beyond Pulumi execution.\n///\n/// Workers enable units to perform runtime operations after Pulumi program completion,\n/// such as attaching custom statuses, monitoring resources, or triggering unit reconfigurations.\n/// Since Pulumi programs cannot affect instances after execution, workers bypass this limitation\n/// by providing persistent runtime behavior.\n///\n/// The worker identity (fully qualified image name) indicates the same publisher/party and services as natural authentication mechanism.\n/// All versions of a worker share the same service account, meaning they operate over\n/// the same resources and have the same access scope within the platform.\nmodel Worker {\n /// The CUIDv2 of the worker.\n id String @id @default(cuid(2))\n\n /// The identity of the worker derived from the container image.\n ///\n /// This is the fully qualified image name without the tag or digest.\n /// The format is `{<registry>/}[<namespace>/]<name>`.\n ///\n /// For example: `ghcr.io/highstate/worker` or `docker.io/library/ubuntu`.\n identity String @unique\n\n /// The ID of the service account this worker uses.\n serviceAccountId String @unique\n\n /// The time this worker first appeared in the system.\n createdAt DateTime @default(now())\n\n /// The service account impersonating this worker.\n serviceAccount ServiceAccount @relation(fields: [serviceAccountId], references: [id])\n\n /// The versions of this worker.\n versions WorkerVersion[]\n}\n\nenum WorkerVersionStatus {\n /// The status is unknown.\n unknown\n\n /// The worker is being started by one of the runtimes.\n starting\n\n /// The worker is running and serving registrations.\n running\n\n /// The worker is being stopping (after was starting/running and was disabled).\n stopping\n\n /// The worker is stopped and not serving registrations.\n stopped\n\n /// The worker failed to start/crashed more than the allowed number of times.\n error\n}\n\n/// The worker version represents a specific container image digest of a worker.\n///\n/// Each version corresponds to an immutable container image identified by its SHA256 digest.\n/// Versions are automatically created when units reference new image digests and deleted\n/// when no longer referenced by any unit registrations.\n///\n/// Each version has its own API key for isolation, but all versions of a worker\n/// share the same service account and thus the same access scope within the platform.\n/// The runtime starts containers when registrations exist and stops them when removed.\nmodel WorkerVersion {\n /// The CUIDv2 of the worker version.\n id String @id @default(cuid(2))\n\n /// The metadata of the worker version managed by the backend.\n ///\n /// [CommonObjectMeta]\n meta Json\n\n /// The current status of the worker version reported by the runtime.\n status WorkerVersionStatus @default(unknown)\n\n /// Whether this worker version is enabled and will be launched when project is unclocked.\n enabled Boolean @default(true)\n\n /// The ID of the runtime where this worker version currently runs.\n runtimeId String?\n\n /// The ID of the worker this version belongs to.\n workerId String\n\n /// The digest of the worker version used to identify it.\n /// The format is raw SHA256 digest without the `sha256:` prefix.\n digest String @unique\n\n /// The ID of the API key this worker version uses.\n apiKeyId String @unique\n\n /// The time this worker version was created.\n createdAt DateTime @default(now())\n\n /// The time this worker version was last updated.\n updatedAt DateTime @updatedAt\n\n /// The worker this version belongs to.\n worker Worker @relation(fields: [workerId], references: [id])\n\n /// The API key this worker version uses.\n apiKey ApiKey @relation(fields: [apiKeyId], references: [id])\n\n /// The unit registrations for this worker version.\n unitRegistrations WorkerUnitRegistration[]\n\n /// The logs produced by this worker version.\n logs WorkerVersionLog[]\n}\n\n/// The worker unit registration tracks which unit instances require specific worker versions.\n///\n/// Units declare worker dependencies through their outputs, creating registrations that\n/// trigger the runtime to start corresponding worker containers. Each registration\n/// includes parameters passed to the worker for unit-specific configuration.\n///\n/// Registrations are managed during operation execution - created when units declare workers\n/// and removed when units are destroyed. Worker versions without registrations are garbage collected.\nmodel WorkerUnitRegistration {\n /// The ID of the state of the unit instance requesting the registration.\n stateId String\n\n /// The name of the worker within the instance.\n name String\n\n /// The parameters of the registration passed by the unit.\n ///\n /// [WorkerUnitRegistrationParams]\n params Json\n\n /// The ID of the worker version this registration currently uses.\n workerVersionId String\n\n /// The time this registration was created.\n createdAt DateTime @default(now())\n\n /// The time this registration was last updated.\n updatedAt DateTime @updatedAt\n\n /// The unit instance requesting the registration.\n state InstanceState @relation(fields: [stateId], references: [id])\n\n /// The worker version this registration currently uses.\n workerVersion WorkerVersion @relation(fields: [workerVersionId], references: [id])\n\n @@id([stateId, name]) // the registration is identified by the instance and name\n}\n\n/// The worker version log captures output from running worker containers.\n///\n/// Logs include both worker-generated output and system messages from the runtime.\n/// The ULID identifier provides timestamp ordering. Logs are deleted with the worker version.\nmodel WorkerVersionLog {\n /// The ULID of the worker log. Also used to extract the timestamp.\n id String @id @default(ulid())\n\n /// The ID of the worker version that produced this log.\n workerVersionId String\n\n /// The log content.\n content String\n\n /// Whether this log is a system/runtime message (vs worker output).\n isSystem Boolean @default(false)\n\n /// The worker version that produced this log.\n workerVersion WorkerVersion @relation(fields: [workerVersionId], references: [id], onDelete: Cascade)\n}\n',
|
|
976
|
+
"inlineSchemaHash": "56f573323bf665e977575ff802fe9d1f0779f20fa18e1b04c625d281406eca55",
|
|
977
977
|
"copyEngine": true,
|
|
978
978
|
"runtimeDataModel": {
|
|
979
979
|
"models": {},
|
|
@@ -982,7 +982,7 @@ var config3 = {
|
|
|
982
982
|
},
|
|
983
983
|
"dirname": ""
|
|
984
984
|
};
|
|
985
|
-
config3.runtimeDataModel = JSON.parse('{"models":{"ApiKey":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"token","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"worker","kind":"object","type":"WorkerVersion","relationName":"ApiKeyToWorkerVersion"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"ApiKeyToServiceAccount"}],"dbName":null},"Artifact":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"hash","kind":"scalar","type":"String"},{"name":"size","kind":"scalar","type":"Int"},{"name":"chunkSize","kind":"scalar","type":"Int"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"serviceAccounts","kind":"object","type":"ServiceAccount","relationName":"ArtifactToServiceAccount"},{"name":"instances","kind":"object","type":"InstanceState","relationName":"ArtifactToInstanceState"},{"name":"terminals","kind":"object","type":"Terminal","relationName":"ArtifactToTerminal"},{"name":"pages","kind":"object","type":"Page","relationName":"ArtifactToPage"}],"dbName":null},"InstanceCustomStatus":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"value","kind":"scalar","type":"String"},{"name":"message","kind":"scalar","type":"String"},{"name":"order","kind":"scalar","type":"Int"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceCustomStatusToInstanceState"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"InstanceCustomStatusToServiceAccount"}],"dbName":null},"InstanceEvaluationState":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"status","kind":"enum","type":"InstanceEvaluationStatus"},{"name":"message","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"evaluatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceEvaluationStateToInstanceState"}],"dbName":null},"InstanceState":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"instanceId","kind":"scalar","type":"String"},{"name":"status","kind":"enum","type":"InstanceStatus"},{"name":"source","kind":"enum","type":"InstanceSource"},{"name":"kind","kind":"scalar","type":"String"},{"name":"parentId","kind":"scalar","type":"String"},{"name":"inputHashNonce","kind":"scalar","type":"Int"},{"name":"statusFields","kind":"scalar","type":"Json"},{"name":"inputHash","kind":"scalar","type":"Int"},{"name":"outputHash","kind":"scalar","type":"Int"},{"name":"dependencyOutputHash","kind":"scalar","type":"Int"},{"name":"exportedArtifactIds","kind":"scalar","type":"Json"},{"name":"currentResourceCount","kind":"scalar","type":"Int"},{"name":"message","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"resolvedInputs","kind":"scalar","type":"Json"},{"name":"parent","kind":"object","type":"InstanceState","relationName":"InstanceHierarchy"},{"name":"children","kind":"object","type":"InstanceState","relationName":"InstanceHierarchy"},{"name":"evaluationState","kind":"object","type":"InstanceEvaluationState","relationName":"InstanceEvaluationStateToInstanceState"},{"name":"operationStates","kind":"object","type":"InstanceOperationState","relationName":"InstanceOperationStateToInstanceState"},{"name":"secrets","kind":"object","type":"Secret","relationName":"InstanceStateToSecret"},{"name":"terminals","kind":"object","type":"Terminal","relationName":"InstanceStateToTerminal"},{"name":"pages","kind":"object","type":"Page","relationName":"InstanceStateToPage"},{"name":"triggers","kind":"object","type":"Trigger","relationName":"InstanceStateToTrigger"},{"name":"customStatuses","kind":"object","type":"InstanceCustomStatus","relationName":"InstanceCustomStatusToInstanceState"},{"name":"lock","kind":"object","type":"InstanceLock","relationName":"InstanceLockToInstanceState"},{"name":"workerRegistrations","kind":"object","type":"WorkerUnitRegistration","relationName":"InstanceStateToWorkerUnitRegistration"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToInstanceState"},{"name":"operationLogs","kind":"object","type":"OperationLog","relationName":"InstanceStateToOperationLog"},{"name":"userViewports","kind":"object","type":"UserCompositeViewport","relationName":"InstanceStateToUserCompositeViewport"}],"dbName":null},"UserProjectViewport":{"fields":[{"name":"userId","kind":"scalar","type":"String"},{"name":"viewport","kind":"scalar","type":"Json"}],"dbName":null},"UserCompositeViewport":{"fields":[{"name":"userId","kind":"scalar","type":"String"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"viewport","kind":"scalar","type":"Json"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToUserCompositeViewport"}],"dbName":null},"InstanceLock":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"token","kind":"scalar","type":"String"},{"name":"acquiredAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceLockToInstanceState"}],"dbName":null},"InstanceModel":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"}],"dbName":null},"HubModel":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"}],"dbName":null},"Operation":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"type","kind":"enum","type":"OperationType"},{"name":"status","kind":"enum","type":"OperationStatus"},{"name":"options","kind":"scalar","type":"Json"},{"name":"requestedInstanceIds","kind":"scalar","type":"Json"},{"name":"phases","kind":"scalar","type":"Json"},{"name":"startedAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"finishedAt","kind":"scalar","type":"DateTime"},{"name":"operationStates","kind":"object","type":"InstanceOperationState","relationName":"InstanceOperationStateToOperation"},{"name":"logs","kind":"object","type":"OperationLog","relationName":"OperationToOperationLog"}],"dbName":null},"InstanceOperationState":{"fields":[{"name":"operationId","kind":"scalar","type":"String"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"status","kind":"enum","type":"InstanceOperationStatus"},{"name":"currentResourceCount","kind":"scalar","type":"Int"},{"name":"totalResourceCount","kind":"scalar","type":"Int"},{"name":"model","kind":"scalar","type":"Json"},{"name":"resolvedInputs","kind":"scalar","type":"Json"},{"name":"startedAt","kind":"scalar","type":"DateTime"},{"name":"finishedAt","kind":"scalar","type":"DateTime"},{"name":"operation","kind":"object","type":"Operation","relationName":"InstanceOperationStateToOperation"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceOperationStateToInstanceState"}],"dbName":null},"OperationLog":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"operationId","kind":"scalar","type":"String"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"String"},{"name":"operation","kind":"object","type":"Operation","relationName":"OperationToOperationLog"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToOperationLog"}],"dbName":null},"Page":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToPage"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"PageToServiceAccount"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToPage"}],"dbName":null},"Secret":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"systemName","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToSecret"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"SecretToServiceAccount"}],"dbName":null},"ServiceAccount":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"workers","kind":"object","type":"Worker","relationName":"ServiceAccountToWorker"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToServiceAccount"},{"name":"secrets","kind":"object","type":"Secret","relationName":"SecretToServiceAccount"},{"name":"terminals","kind":"object","type":"Terminal","relationName":"ServiceAccountToTerminal"},{"name":"pages","kind":"object","type":"Page","relationName":"PageToServiceAccount"},{"name":"customStatuses","kind":"object","type":"InstanceCustomStatus","relationName":"InstanceCustomStatusToServiceAccount"},{"name":"apiKeys","kind":"object","type":"ApiKey","relationName":"ApiKeyToServiceAccount"}],"dbName":null},"Terminal":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"status","kind":"enum","type":"TerminalStatus"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToTerminal"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"ServiceAccountToTerminal"},{"name":"sessions","kind":"object","type":"TerminalSession","relationName":"TerminalToTerminalSession"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToTerminal"}],"dbName":null},"TerminalSession":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"terminalId","kind":"scalar","type":"String"},{"name":"startedAt","kind":"scalar","type":"DateTime"},{"name":"finishedAt","kind":"scalar","type":"DateTime"},{"name":"terminal","kind":"object","type":"Terminal","relationName":"TerminalToTerminalSession"},{"name":"logs","kind":"object","type":"TerminalSessionLog","relationName":"TerminalSessionToTerminalSessionLog"}],"dbName":null},"TerminalSessionLog":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"sessionId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"String"},{"name":"session","kind":"object","type":"TerminalSession","relationName":"TerminalSessionToTerminalSessionLog"}],"dbName":null},"Trigger":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToTrigger"}],"dbName":null},"UnlockMethod":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"type","kind":"enum","type":"UnlockMethodType"},{"name":"encryptedIdentity","kind":"scalar","type":"String"},{"name":"recipient","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"}],"dbName":null},"Worker":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"identity","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"ServiceAccountToWorker"},{"name":"versions","kind":"object","type":"WorkerVersion","relationName":"WorkerToWorkerVersion"}],"dbName":null},"WorkerVersion":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"status","kind":"enum","type":"WorkerVersionStatus"},{"name":"enabled","kind":"scalar","type":"Boolean"},{"name":"runtimeId","kind":"scalar","type":"String"},{"name":"workerId","kind":"scalar","type":"String"},{"name":"digest","kind":"scalar","type":"String"},{"name":"apiKeyId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"worker","kind":"object","type":"Worker","relationName":"WorkerToWorkerVersion"},{"name":"apiKey","kind":"object","type":"ApiKey","relationName":"ApiKeyToWorkerVersion"},{"name":"unitRegistrations","kind":"object","type":"WorkerUnitRegistration","relationName":"WorkerUnitRegistrationToWorkerVersion"},{"name":"logs","kind":"object","type":"WorkerVersionLog","relationName":"WorkerVersionToWorkerVersionLog"}],"dbName":null},"WorkerUnitRegistration":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"params","kind":"scalar","type":"Json"},{"name":"workerVersionId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToWorkerUnitRegistration"},{"name":"workerVersion","kind":"object","type":"WorkerVersion","relationName":"WorkerUnitRegistrationToWorkerVersion"}],"dbName":null},"WorkerVersionLog":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"workerVersionId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"String"},{"name":"isSystem","kind":"scalar","type":"Boolean"},{"name":"workerVersion","kind":"object","type":"WorkerVersion","relationName":"WorkerVersionToWorkerVersionLog"}],"dbName":null}},"enums":{},"types":{}}');
|
|
985
|
+
config3.runtimeDataModel = JSON.parse('{"models":{"ApiKey":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"token","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"worker","kind":"object","type":"WorkerVersion","relationName":"ApiKeyToWorkerVersion"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"ApiKeyToServiceAccount"}],"dbName":null},"Artifact":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"hash","kind":"scalar","type":"String"},{"name":"size","kind":"scalar","type":"Int"},{"name":"chunkSize","kind":"scalar","type":"Int"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"serviceAccounts","kind":"object","type":"ServiceAccount","relationName":"ArtifactToServiceAccount"},{"name":"instances","kind":"object","type":"InstanceState","relationName":"ArtifactToInstanceState"},{"name":"terminals","kind":"object","type":"Terminal","relationName":"ArtifactToTerminal"},{"name":"pages","kind":"object","type":"Page","relationName":"ArtifactToPage"}],"dbName":null},"InstanceCustomStatus":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"value","kind":"scalar","type":"String"},{"name":"message","kind":"scalar","type":"String"},{"name":"order","kind":"scalar","type":"Int"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceCustomStatusToInstanceState"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"InstanceCustomStatusToServiceAccount"}],"dbName":null},"InstanceEvaluationState":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"status","kind":"enum","type":"InstanceEvaluationStatus"},{"name":"message","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"evaluatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceEvaluationStateToInstanceState"}],"dbName":null},"InstanceState":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"instanceId","kind":"scalar","type":"String"},{"name":"status","kind":"enum","type":"InstanceStatus"},{"name":"source","kind":"enum","type":"InstanceSource"},{"name":"kind","kind":"scalar","type":"String"},{"name":"parentId","kind":"scalar","type":"String"},{"name":"inputHashNonce","kind":"scalar","type":"Int"},{"name":"inputHash","kind":"scalar","type":"Int"},{"name":"outputHash","kind":"scalar","type":"Int"},{"name":"dependencyOutputHash","kind":"scalar","type":"Int"},{"name":"exportedArtifactIds","kind":"scalar","type":"Json"},{"name":"model","kind":"scalar","type":"Json"},{"name":"resolvedInputs","kind":"scalar","type":"Json"},{"name":"currentResourceCount","kind":"scalar","type":"Int"},{"name":"statusFields","kind":"scalar","type":"Json"},{"name":"parent","kind":"object","type":"InstanceState","relationName":"InstanceHierarchy"},{"name":"children","kind":"object","type":"InstanceState","relationName":"InstanceHierarchy"},{"name":"evaluationState","kind":"object","type":"InstanceEvaluationState","relationName":"InstanceEvaluationStateToInstanceState"},{"name":"operationStates","kind":"object","type":"InstanceOperationState","relationName":"InstanceOperationStateToInstanceState"},{"name":"secrets","kind":"object","type":"Secret","relationName":"InstanceStateToSecret"},{"name":"terminals","kind":"object","type":"Terminal","relationName":"InstanceStateToTerminal"},{"name":"pages","kind":"object","type":"Page","relationName":"InstanceStateToPage"},{"name":"triggers","kind":"object","type":"Trigger","relationName":"InstanceStateToTrigger"},{"name":"customStatuses","kind":"object","type":"InstanceCustomStatus","relationName":"InstanceCustomStatusToInstanceState"},{"name":"lock","kind":"object","type":"InstanceLock","relationName":"InstanceLockToInstanceState"},{"name":"workerRegistrations","kind":"object","type":"WorkerUnitRegistration","relationName":"InstanceStateToWorkerUnitRegistration"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToInstanceState"},{"name":"operationLogs","kind":"object","type":"OperationLog","relationName":"InstanceStateToOperationLog"},{"name":"userViewports","kind":"object","type":"UserCompositeViewport","relationName":"InstanceStateToUserCompositeViewport"}],"dbName":null},"UserProjectViewport":{"fields":[{"name":"userId","kind":"scalar","type":"String"},{"name":"viewport","kind":"scalar","type":"Json"}],"dbName":null},"UserCompositeViewport":{"fields":[{"name":"userId","kind":"scalar","type":"String"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"viewport","kind":"scalar","type":"Json"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToUserCompositeViewport"}],"dbName":null},"InstanceLock":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"token","kind":"scalar","type":"String"},{"name":"acquiredAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceLockToInstanceState"}],"dbName":null},"InstanceModel":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"}],"dbName":null},"HubModel":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"model","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"}],"dbName":null},"Operation":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"type","kind":"enum","type":"OperationType"},{"name":"status","kind":"enum","type":"OperationStatus"},{"name":"options","kind":"scalar","type":"Json"},{"name":"requestedInstanceIds","kind":"scalar","type":"Json"},{"name":"phases","kind":"scalar","type":"Json"},{"name":"startedAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"finishedAt","kind":"scalar","type":"DateTime"},{"name":"operationStates","kind":"object","type":"InstanceOperationState","relationName":"InstanceOperationStateToOperation"},{"name":"logs","kind":"object","type":"OperationLog","relationName":"OperationToOperationLog"}],"dbName":null},"InstanceOperationState":{"fields":[{"name":"operationId","kind":"scalar","type":"String"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"status","kind":"enum","type":"InstanceOperationStatus"},{"name":"currentResourceCount","kind":"scalar","type":"Int"},{"name":"totalResourceCount","kind":"scalar","type":"Int"},{"name":"model","kind":"scalar","type":"Json"},{"name":"resolvedInputs","kind":"scalar","type":"Json"},{"name":"startedAt","kind":"scalar","type":"DateTime"},{"name":"finishedAt","kind":"scalar","type":"DateTime"},{"name":"operation","kind":"object","type":"Operation","relationName":"InstanceOperationStateToOperation"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceOperationStateToInstanceState"}],"dbName":null},"OperationLog":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"operationId","kind":"scalar","type":"String"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"String"},{"name":"operation","kind":"object","type":"Operation","relationName":"OperationToOperationLog"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToOperationLog"}],"dbName":null},"Page":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToPage"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"PageToServiceAccount"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToPage"}],"dbName":null},"Secret":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"systemName","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToSecret"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"SecretToServiceAccount"}],"dbName":null},"ServiceAccount":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"workers","kind":"object","type":"Worker","relationName":"ServiceAccountToWorker"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToServiceAccount"},{"name":"secrets","kind":"object","type":"Secret","relationName":"SecretToServiceAccount"},{"name":"terminals","kind":"object","type":"Terminal","relationName":"ServiceAccountToTerminal"},{"name":"pages","kind":"object","type":"Page","relationName":"PageToServiceAccount"},{"name":"customStatuses","kind":"object","type":"InstanceCustomStatus","relationName":"InstanceCustomStatusToServiceAccount"},{"name":"apiKeys","kind":"object","type":"ApiKey","relationName":"ApiKeyToServiceAccount"}],"dbName":null},"Terminal":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"status","kind":"enum","type":"TerminalStatus"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToTerminal"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"ServiceAccountToTerminal"},{"name":"sessions","kind":"object","type":"TerminalSession","relationName":"TerminalToTerminalSession"},{"name":"artifacts","kind":"object","type":"Artifact","relationName":"ArtifactToTerminal"}],"dbName":null},"TerminalSession":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"terminalId","kind":"scalar","type":"String"},{"name":"startedAt","kind":"scalar","type":"DateTime"},{"name":"finishedAt","kind":"scalar","type":"DateTime"},{"name":"terminal","kind":"object","type":"Terminal","relationName":"TerminalToTerminalSession"},{"name":"logs","kind":"object","type":"TerminalSessionLog","relationName":"TerminalSessionToTerminalSessionLog"}],"dbName":null},"TerminalSessionLog":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"sessionId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"String"},{"name":"session","kind":"object","type":"TerminalSession","relationName":"TerminalSessionToTerminalSessionLog"}],"dbName":null},"Trigger":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"spec","kind":"scalar","type":"Json"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToTrigger"}],"dbName":null},"UnlockMethod":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"type","kind":"enum","type":"UnlockMethodType"},{"name":"encryptedIdentity","kind":"scalar","type":"String"},{"name":"recipient","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"}],"dbName":null},"Worker":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"identity","kind":"scalar","type":"String"},{"name":"serviceAccountId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"serviceAccount","kind":"object","type":"ServiceAccount","relationName":"ServiceAccountToWorker"},{"name":"versions","kind":"object","type":"WorkerVersion","relationName":"WorkerToWorkerVersion"}],"dbName":null},"WorkerVersion":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"meta","kind":"scalar","type":"Json"},{"name":"status","kind":"enum","type":"WorkerVersionStatus"},{"name":"enabled","kind":"scalar","type":"Boolean"},{"name":"runtimeId","kind":"scalar","type":"String"},{"name":"workerId","kind":"scalar","type":"String"},{"name":"digest","kind":"scalar","type":"String"},{"name":"apiKeyId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"worker","kind":"object","type":"Worker","relationName":"WorkerToWorkerVersion"},{"name":"apiKey","kind":"object","type":"ApiKey","relationName":"ApiKeyToWorkerVersion"},{"name":"unitRegistrations","kind":"object","type":"WorkerUnitRegistration","relationName":"WorkerUnitRegistrationToWorkerVersion"},{"name":"logs","kind":"object","type":"WorkerVersionLog","relationName":"WorkerVersionToWorkerVersionLog"}],"dbName":null},"WorkerUnitRegistration":{"fields":[{"name":"stateId","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"params","kind":"scalar","type":"Json"},{"name":"workerVersionId","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"state","kind":"object","type":"InstanceState","relationName":"InstanceStateToWorkerUnitRegistration"},{"name":"workerVersion","kind":"object","type":"WorkerVersion","relationName":"WorkerUnitRegistrationToWorkerVersion"}],"dbName":null},"WorkerVersionLog":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"workerVersionId","kind":"scalar","type":"String"},{"name":"content","kind":"scalar","type":"String"},{"name":"isSystem","kind":"scalar","type":"Boolean"},{"name":"workerVersion","kind":"object","type":"WorkerVersion","relationName":"WorkerVersionToWorkerVersionLog"}],"dbName":null}},"enums":{},"types":{}}');
|
|
986
986
|
config3.engineWasm = void 0;
|
|
987
987
|
async function decodeBase64AsWasm3(wasmBase64) {
|
|
988
988
|
const { Buffer: Buffer2 } = await import('node:buffer');
|
|
@@ -1275,7 +1275,6 @@ var InstanceStateService = class {
|
|
|
1275
1275
|
inputHash: null,
|
|
1276
1276
|
outputHash: null,
|
|
1277
1277
|
dependencyOutputHash: null,
|
|
1278
|
-
message: null,
|
|
1279
1278
|
currentResourceCount: null,
|
|
1280
1279
|
model: null,
|
|
1281
1280
|
resolvedInputs: null,
|
|
@@ -1324,7 +1323,6 @@ var InstanceStateService = class {
|
|
|
1324
1323
|
inputHash: null,
|
|
1325
1324
|
outputHash: null,
|
|
1326
1325
|
dependencyOutputHash: null,
|
|
1327
|
-
message: null,
|
|
1328
1326
|
currentResourceCount: null,
|
|
1329
1327
|
model: DbNull3,
|
|
1330
1328
|
resolvedInputs: DbNull3
|
|
@@ -3754,9 +3752,7 @@ var LocalLibraryBackend = class _LocalLibraryBackend {
|
|
|
3754
3752
|
resolvedUnitSources = /* @__PURE__ */ new Map();
|
|
3755
3753
|
rebuildStates = /* @__PURE__ */ new Map();
|
|
3756
3754
|
async loadLibrary() {
|
|
3757
|
-
return await this.lock.acquire(async () =>
|
|
3758
|
-
return await this.getLibrary();
|
|
3759
|
-
});
|
|
3755
|
+
return await this.lock.acquire(async () => await this.getLibrary());
|
|
3760
3756
|
}
|
|
3761
3757
|
async *watchLibrary(_libraryId, signal) {
|
|
3762
3758
|
for await (const [library] of on(this.eventEmitter, "library", { signal })) {
|
|
@@ -4585,13 +4581,6 @@ async function pulumiErrorToString(error) {
|
|
|
4585
4581
|
}
|
|
4586
4582
|
return errorToString(error);
|
|
4587
4583
|
}
|
|
4588
|
-
function getOperationSummary(stdout) {
|
|
4589
|
-
const summaryStart = stdout.indexOf("\x1B[38;5;13m\x1B[1mOutputs:");
|
|
4590
|
-
if (summaryStart !== -1) {
|
|
4591
|
-
return stdout.slice(summaryStart);
|
|
4592
|
-
}
|
|
4593
|
-
return null;
|
|
4594
|
-
}
|
|
4595
4584
|
|
|
4596
4585
|
// src/runner/local.ts
|
|
4597
4586
|
var localRunnerBackendConfig = z.object({
|
|
@@ -4687,7 +4676,7 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4687
4676
|
}
|
|
4688
4677
|
await runWithRetryOnError(
|
|
4689
4678
|
async () => {
|
|
4690
|
-
|
|
4679
|
+
await stack[preview ? "preview" : "up"]({
|
|
4691
4680
|
color: "always",
|
|
4692
4681
|
refresh: options.refresh,
|
|
4693
4682
|
signal,
|
|
@@ -4719,12 +4708,7 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4719
4708
|
}
|
|
4720
4709
|
});
|
|
4721
4710
|
const outputs = await stack.outputs();
|
|
4722
|
-
const completionUpdate = this.createCompletionStateUpdate(
|
|
4723
|
-
"update",
|
|
4724
|
-
unitId,
|
|
4725
|
-
outputs,
|
|
4726
|
-
stdout
|
|
4727
|
-
);
|
|
4711
|
+
const completionUpdate = this.createCompletionStateUpdate("update", unitId, outputs);
|
|
4728
4712
|
if (outputs["$artifacts"]) {
|
|
4729
4713
|
const artifacts = z.record(z.string(), unitArtifactSchema.array()).parse(outputs["$artifacts"].value);
|
|
4730
4714
|
await collectAndStoreArtifacts(
|
|
@@ -4821,7 +4805,7 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4821
4805
|
try {
|
|
4822
4806
|
await runWithRetryOnError(
|
|
4823
4807
|
async () => {
|
|
4824
|
-
|
|
4808
|
+
await stack.destroy({
|
|
4825
4809
|
color: "always",
|
|
4826
4810
|
refresh: options.refresh,
|
|
4827
4811
|
remove: true,
|
|
@@ -4844,7 +4828,7 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4844
4828
|
}
|
|
4845
4829
|
}
|
|
4846
4830
|
});
|
|
4847
|
-
await this.emitCompletionStateUpdate("destroy", unitId, stack
|
|
4831
|
+
await this.emitCompletionStateUpdate("destroy", unitId, stack);
|
|
4848
4832
|
},
|
|
4849
4833
|
(error) => this.pulumiProjectHost.tryUnlockStack(stack, error)
|
|
4850
4834
|
);
|
|
@@ -4903,7 +4887,7 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4903
4887
|
});
|
|
4904
4888
|
await runWithRetryOnError(
|
|
4905
4889
|
async () => {
|
|
4906
|
-
|
|
4890
|
+
await stack.refresh({
|
|
4907
4891
|
color: "always",
|
|
4908
4892
|
debug: options.debug,
|
|
4909
4893
|
onEvent: (event) => {
|
|
@@ -4937,8 +4921,7 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4937
4921
|
this.emitStateUpdate({
|
|
4938
4922
|
type: "completion",
|
|
4939
4923
|
operationType: "refresh",
|
|
4940
|
-
unitId
|
|
4941
|
-
message: getOperationSummary(stdout)
|
|
4924
|
+
unitId
|
|
4942
4925
|
// do not emit output-related fields on refresh since they will not change
|
|
4943
4926
|
// some of them (like artifact files) are not even available on refresh
|
|
4944
4927
|
});
|
|
@@ -4955,13 +4938,12 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4955
4938
|
});
|
|
4956
4939
|
}
|
|
4957
4940
|
}
|
|
4958
|
-
createCompletionStateUpdate(opType, unitId, outputs
|
|
4941
|
+
createCompletionStateUpdate(opType, unitId, outputs) {
|
|
4959
4942
|
const unitOutputs = omitBy(outputs, (_, key) => key.startsWith("$"));
|
|
4960
4943
|
return {
|
|
4961
4944
|
unitId,
|
|
4962
4945
|
type: "completion",
|
|
4963
4946
|
operationType: opType,
|
|
4964
|
-
message: getOperationSummary(stdout),
|
|
4965
4947
|
outputHash: crc32(sha256(encode(unitOutputs))),
|
|
4966
4948
|
statusFields: outputs["$statusFields"] ? z.array(instanceStatusFieldSchema).parse(outputs["$statusFields"].value) : null,
|
|
4967
4949
|
terminals: outputs["$terminals"] ? z.array(unitTerminalSchema).parse(outputs["$terminals"].value) : null,
|
|
@@ -4971,9 +4953,9 @@ var LocalRunnerBackend = class _LocalRunnerBackend {
|
|
|
4971
4953
|
secrets: outputs["$secrets"] ? z.record(z.string(), z.unknown()).parse(outputs["$secrets"].value) : null
|
|
4972
4954
|
};
|
|
4973
4955
|
}
|
|
4974
|
-
async emitCompletionStateUpdate(opType, unitId, stack
|
|
4956
|
+
async emitCompletionStateUpdate(opType, unitId, stack) {
|
|
4975
4957
|
const output = await stack.outputs();
|
|
4976
|
-
const update = this.createCompletionStateUpdate(opType, unitId, output
|
|
4958
|
+
const update = this.createCompletionStateUpdate(opType, unitId, output);
|
|
4977
4959
|
return this.emitStateUpdate(update);
|
|
4978
4960
|
}
|
|
4979
4961
|
emitStateUpdate(update) {
|
|
@@ -5877,7 +5859,6 @@ var OperationContext = class _OperationContext {
|
|
|
5877
5859
|
inputHashNodes = /* @__PURE__ */ new Map();
|
|
5878
5860
|
inputHashResolverLock = new BetterLock();
|
|
5879
5861
|
resolvedInstanceInputs = /* @__PURE__ */ new Map();
|
|
5880
|
-
instanceIdToStateIdMap = null;
|
|
5881
5862
|
getInstance(instanceId) {
|
|
5882
5863
|
const instance = this.instanceMap.get(instanceId);
|
|
5883
5864
|
if (!instance) {
|
|
@@ -5999,15 +5980,19 @@ var OperationContext = class _OperationContext {
|
|
|
5999
5980
|
this.setState(state);
|
|
6000
5981
|
}
|
|
6001
5982
|
}
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
5983
|
+
/**
|
|
5984
|
+
* Gets a map of instance IDs to state IDs for dependencies of the given instance.
|
|
5985
|
+
*
|
|
5986
|
+
* @param instanceId The instance ID to get the state ID map for.
|
|
5987
|
+
* @returns A map of instance IDs to state IDs.
|
|
5988
|
+
*/
|
|
5989
|
+
getInstanceIdToStateIdMap(instanceId) {
|
|
6006
5990
|
const map2 = {};
|
|
6007
|
-
|
|
5991
|
+
const dependencies = this.getDependencies(instanceId).map((i) => i.id);
|
|
5992
|
+
for (const dep of dependencies) {
|
|
5993
|
+
const state = this.getState(dep);
|
|
6008
5994
|
map2[instanceId] = state.id;
|
|
6009
5995
|
}
|
|
6010
|
-
this.instanceIdToStateIdMap = map2;
|
|
6011
5996
|
return map2;
|
|
6012
5997
|
}
|
|
6013
5998
|
getUnfinishedOperationStates() {
|
|
@@ -7007,8 +6992,7 @@ ${errors.join("\n")}`
|
|
|
7007
6992
|
finishedAt: /* @__PURE__ */ new Date()
|
|
7008
6993
|
},
|
|
7009
6994
|
instanceState: {
|
|
7010
|
-
status: this.workset.getNextStableInstanceStatus(instance.id)
|
|
7011
|
-
message: null
|
|
6995
|
+
status: this.workset.getNextStableInstanceStatus(instance.id)
|
|
7012
6996
|
}
|
|
7013
6997
|
});
|
|
7014
6998
|
}
|
|
@@ -7022,6 +7006,9 @@ ${errors.join("\n")}`
|
|
|
7022
7006
|
waitForAbort(signal)
|
|
7023
7007
|
]);
|
|
7024
7008
|
signal.throwIfAborted();
|
|
7009
|
+
if (this.operation.status === "failing") {
|
|
7010
|
+
throw new AbortError("The operation is failing, aborting current branch (still not failed)");
|
|
7011
|
+
}
|
|
7025
7012
|
logger.info("updating unit");
|
|
7026
7013
|
await this.workset.updateState(instance.id, {
|
|
7027
7014
|
operationState: {
|
|
@@ -7122,8 +7109,15 @@ ${errors.join("\n")}`
|
|
|
7122
7109
|
const instance2 = this.context.getInstance(dependent.instanceId);
|
|
7123
7110
|
dependentPromises.push(this.getInstancePromiseForOperation(instance2, dependent));
|
|
7124
7111
|
}
|
|
7125
|
-
await
|
|
7112
|
+
await Promise.race([
|
|
7113
|
+
waitAll(dependentPromises),
|
|
7114
|
+
// to immediately abort the operation if requested
|
|
7115
|
+
waitForAbort(signal)
|
|
7116
|
+
]);
|
|
7126
7117
|
signal.throwIfAborted();
|
|
7118
|
+
if (this.operation.status === "failing") {
|
|
7119
|
+
throw new AbortError("The operation is failing, aborting current branch (still not failed)");
|
|
7120
|
+
}
|
|
7127
7121
|
await this.processBeforeDestroyTriggers(instance, state, logger, signal, forceSignal);
|
|
7128
7122
|
signal.throwIfAborted();
|
|
7129
7123
|
logger.info("destroying unit...");
|
|
@@ -7215,7 +7209,7 @@ ${errors.join("\n")}`
|
|
|
7215
7209
|
inputs: mapValues(resolvedInputs ?? {}, (input) => input.map((value) => value.input)),
|
|
7216
7210
|
invokedTriggers,
|
|
7217
7211
|
secretNames: Object.keys(secrets),
|
|
7218
|
-
stateIdMap: this.context.getInstanceIdToStateIdMap()
|
|
7212
|
+
stateIdMap: this.context.getInstanceIdToStateIdMap(instance.id)
|
|
7219
7213
|
};
|
|
7220
7214
|
}
|
|
7221
7215
|
async handleUnitStateUpdate(update, state) {
|
|
@@ -7262,8 +7256,7 @@ ${errors.join("\n")}`
|
|
|
7262
7256
|
await this.workset.updateState(update.unitId, {
|
|
7263
7257
|
instanceState: {
|
|
7264
7258
|
// keep "deployed" status for initially deployed instances even if the operation was failed or cancelled
|
|
7265
|
-
status: state.status === "deployed" ? "deployed" : "failed"
|
|
7266
|
-
message: update.message
|
|
7259
|
+
status: state.status === "deployed" ? "deployed" : "failed"
|
|
7267
7260
|
},
|
|
7268
7261
|
operationState: {
|
|
7269
7262
|
status: isAbortErrorLike(update.message) ? "cancelled" : "failed",
|
|
@@ -7275,7 +7268,6 @@ ${errors.join("\n")}`
|
|
|
7275
7268
|
const instance = this.context.getInstance(update.unitId);
|
|
7276
7269
|
const data = {
|
|
7277
7270
|
status: this.workset.getNextStableInstanceStatus(instance.id),
|
|
7278
|
-
message: update.message,
|
|
7279
7271
|
statusFields: update.statusFields ?? null
|
|
7280
7272
|
};
|
|
7281
7273
|
if (update.operationType !== "destroy") {
|
|
@@ -7291,7 +7283,6 @@ ${errors.join("\n")}`
|
|
|
7291
7283
|
data.parentId = null;
|
|
7292
7284
|
}
|
|
7293
7285
|
} else {
|
|
7294
|
-
data.message = null;
|
|
7295
7286
|
data.inputHash = null;
|
|
7296
7287
|
data.dependencyOutputHash = null;
|
|
7297
7288
|
data.outputHash = null;
|
|
@@ -7490,7 +7481,7 @@ var OperationManager = class {
|
|
|
7490
7481
|
const options = operationOptionsSchema.parse(request.options ?? {});
|
|
7491
7482
|
const operation = await this.operationService.createOperation(
|
|
7492
7483
|
request.projectId,
|
|
7493
|
-
|
|
7484
|
+
request.meta,
|
|
7494
7485
|
request.type,
|
|
7495
7486
|
request.instanceIds,
|
|
7496
7487
|
options
|
|
@@ -7639,8 +7630,7 @@ var OperationManager = class {
|
|
|
7639
7630
|
status: "attempted"
|
|
7640
7631
|
},
|
|
7641
7632
|
data: {
|
|
7642
|
-
status: "failed"
|
|
7643
|
-
message: "Operation was interrupted"
|
|
7633
|
+
status: "failed"
|
|
7644
7634
|
}
|
|
7645
7635
|
});
|
|
7646
7636
|
if (attemptedResult.count > 0) {
|
|
@@ -8207,7 +8197,7 @@ var CodebaseProjectModelBackend = class _CodebaseProjectModelBackend {
|
|
|
8207
8197
|
}
|
|
8208
8198
|
return {};
|
|
8209
8199
|
});
|
|
8210
|
-
this.logger.
|
|
8200
|
+
this.logger.debug(
|
|
8211
8201
|
{ projectId: project.id, instanceCount: instances.length, hubCount: hubs.length },
|
|
8212
8202
|
"created nodes in project model"
|
|
8213
8203
|
);
|
|
@@ -8515,7 +8505,7 @@ var DatabaseProjectModelBackend = class {
|
|
|
8515
8505
|
}) : Promise.resolve()
|
|
8516
8506
|
]);
|
|
8517
8507
|
});
|
|
8518
|
-
this.logger.
|
|
8508
|
+
this.logger.debug(
|
|
8519
8509
|
{ projectId: project.id, instanceCount: instances.length, hubCount: hubs.length },
|
|
8520
8510
|
"created nodes in project model"
|
|
8521
8511
|
);
|