@vibesdotdev/infra-doks 0.0.1

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.
Files changed (113) hide show
  1. package/README.md +107 -0
  2. package/SPEC.md +285 -0
  3. package/dist/client/digitalocean-app-deploy.client.d.ts +46 -0
  4. package/dist/client/digitalocean-app-deploy.client.d.ts.map +1 -0
  5. package/dist/client/digitalocean-app-deploy.client.js +135 -0
  6. package/dist/client/digitalocean-app-deploy.client.js.map +1 -0
  7. package/dist/client/index.d.ts +15 -0
  8. package/dist/client/index.d.ts.map +1 -0
  9. package/dist/client/index.js +18 -0
  10. package/dist/client/index.js.map +1 -0
  11. package/dist/cloud/base.d.ts +33 -0
  12. package/dist/cloud/base.d.ts.map +1 -0
  13. package/dist/cloud/base.js +86 -0
  14. package/dist/cloud/base.js.map +1 -0
  15. package/dist/cloud/digitalocean.d.ts +33 -0
  16. package/dist/cloud/digitalocean.d.ts.map +1 -0
  17. package/dist/cloud/digitalocean.js +258 -0
  18. package/dist/cloud/digitalocean.js.map +1 -0
  19. package/dist/cloud/factory.d.ts +28 -0
  20. package/dist/cloud/factory.d.ts.map +1 -0
  21. package/dist/cloud/factory.js +151 -0
  22. package/dist/cloud/factory.js.map +1 -0
  23. package/dist/cloud/index.d.ts +12 -0
  24. package/dist/cloud/index.d.ts.map +1 -0
  25. package/dist/cloud/index.js +11 -0
  26. package/dist/cloud/index.js.map +1 -0
  27. package/dist/doks.plugin.d.ts +41 -0
  28. package/dist/doks.plugin.d.ts.map +1 -0
  29. package/dist/doks.plugin.js +287 -0
  30. package/dist/doks.plugin.js.map +1 -0
  31. package/dist/implementations/deployment.impl.d.ts +34 -0
  32. package/dist/implementations/deployment.impl.d.ts.map +1 -0
  33. package/dist/implementations/deployment.impl.js +86 -0
  34. package/dist/implementations/deployment.impl.js.map +1 -0
  35. package/dist/implementations/droplet.impl.d.ts +85 -0
  36. package/dist/implementations/droplet.impl.d.ts.map +1 -0
  37. package/dist/implementations/droplet.impl.js +113 -0
  38. package/dist/implementations/droplet.impl.js.map +1 -0
  39. package/dist/implementations/gitea.impl.d.ts +68 -0
  40. package/dist/implementations/gitea.impl.d.ts.map +1 -0
  41. package/dist/implementations/gitea.impl.js +295 -0
  42. package/dist/implementations/gitea.impl.js.map +1 -0
  43. package/dist/implementations/managed-db.impl.d.ts +25 -0
  44. package/dist/implementations/managed-db.impl.d.ts.map +1 -0
  45. package/dist/implementations/managed-db.impl.js +31 -0
  46. package/dist/implementations/managed-db.impl.js.map +1 -0
  47. package/dist/implementations/managed-redis.impl.d.ts +37 -0
  48. package/dist/implementations/managed-redis.impl.d.ts.map +1 -0
  49. package/dist/implementations/managed-redis.impl.js +40 -0
  50. package/dist/implementations/managed-redis.impl.js.map +1 -0
  51. package/dist/implementations/spaces.impl.d.ts +36 -0
  52. package/dist/implementations/spaces.impl.d.ts.map +1 -0
  53. package/dist/implementations/spaces.impl.js +40 -0
  54. package/dist/implementations/spaces.impl.js.map +1 -0
  55. package/dist/implementations/statefulset.impl.d.ts +65 -0
  56. package/dist/implementations/statefulset.impl.d.ts.map +1 -0
  57. package/dist/implementations/statefulset.impl.js +165 -0
  58. package/dist/implementations/statefulset.impl.js.map +1 -0
  59. package/dist/implementations/verdaccio.impl.d.ts +65 -0
  60. package/dist/implementations/verdaccio.impl.d.ts.map +1 -0
  61. package/dist/implementations/verdaccio.impl.js +259 -0
  62. package/dist/implementations/verdaccio.impl.js.map +1 -0
  63. package/dist/index.d.ts +15 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +19 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/kubernetes/index.d.ts +95 -0
  68. package/dist/kubernetes/index.d.ts.map +1 -0
  69. package/dist/kubernetes/index.js +625 -0
  70. package/dist/kubernetes/index.js.map +1 -0
  71. package/dist/secrets/index.d.ts +4 -0
  72. package/dist/secrets/index.d.ts.map +1 -0
  73. package/dist/secrets/index.js +4 -0
  74. package/dist/secrets/index.js.map +1 -0
  75. package/dist/secrets/vault.descriptor.d.ts +10 -0
  76. package/dist/secrets/vault.descriptor.d.ts.map +1 -0
  77. package/dist/secrets/vault.descriptor.js +25 -0
  78. package/dist/secrets/vault.descriptor.js.map +1 -0
  79. package/dist/secrets/vault.impl.cloud.d.ts +40 -0
  80. package/dist/secrets/vault.impl.cloud.d.ts.map +1 -0
  81. package/dist/secrets/vault.impl.cloud.js +178 -0
  82. package/dist/secrets/vault.impl.cloud.js.map +1 -0
  83. package/dist/secrets/vault.impl.d.ts +29 -0
  84. package/dist/secrets/vault.impl.d.ts.map +1 -0
  85. package/dist/secrets/vault.impl.js +137 -0
  86. package/dist/secrets/vault.impl.js.map +1 -0
  87. package/dist/types.d.ts +509 -0
  88. package/dist/types.d.ts.map +1 -0
  89. package/dist/types.js +47 -0
  90. package/dist/types.js.map +1 -0
  91. package/package.json +145 -0
  92. package/src/client/digitalocean-app-deploy.client.ts +226 -0
  93. package/src/client/index.ts +24 -0
  94. package/src/cloud/base.ts +149 -0
  95. package/src/cloud/digitalocean.ts +363 -0
  96. package/src/cloud/factory.ts +190 -0
  97. package/src/cloud/index.ts +81 -0
  98. package/src/doks.plugin.ts +401 -0
  99. package/src/implementations/deployment.impl.ts +93 -0
  100. package/src/implementations/droplet.impl.ts +157 -0
  101. package/src/implementations/gitea.impl.ts +319 -0
  102. package/src/implementations/managed-db.impl.ts +37 -0
  103. package/src/implementations/managed-redis.impl.ts +49 -0
  104. package/src/implementations/spaces.impl.ts +52 -0
  105. package/src/implementations/statefulset.impl.ts +186 -0
  106. package/src/implementations/verdaccio.impl.ts +300 -0
  107. package/src/index.ts +136 -0
  108. package/src/kubernetes/index.ts +754 -0
  109. package/src/secrets/index.ts +9 -0
  110. package/src/secrets/vault.descriptor.ts +28 -0
  111. package/src/secrets/vault.impl.cloud.ts +278 -0
  112. package/src/secrets/vault.impl.ts +149 -0
  113. package/src/types.ts +563 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cloud Provider Abstraction Layer
3
+ *
4
+ * Provides a unified interface for managing cloud resources across
5
+ * different providers (DigitalOcean, AWS, GCP, Azure).
6
+ */
7
+ export { CloudProviderError, K8sError, K8sAuthError, K8sNotFoundError, } from "../types.js";
8
+ export { BaseCloudProvider } from "./base.js";
9
+ export { DigitalOceanProvider } from "./digitalocean.js";
10
+ export { createCloudProvider, getCloudProviderFromEnv, validateCloudProviderConfig } from "./factory.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloud/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+DH,OAAO,EACN,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,gBAAgB,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,MAAM,cAAc,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * DOKS Runtime Plugin
3
+ *
4
+ * Registers DigitalOcean Kubernetes infrastructure implementations with the runtime.
5
+ */
6
+ import { type DoksDeploymentDescriptorInput } from './implementations/deployment.impl';
7
+ import type { K8sDeployment } from './types.ts';
8
+ import { type DoksQueueDescriptorInput, type DoksDatabaseDescriptorInput } from './implementations/statefulset.impl';
9
+ import { type DOManagedPostgresDescriptorInput } from './implementations/managed-db.impl';
10
+ import { type DOManagedRedisDescriptorInput } from './implementations/managed-redis.impl';
11
+ import { type DOSpacesDescriptorInput } from './implementations/spaces.impl';
12
+ import { type GiteaDoksDescriptorInput } from './implementations/gitea.impl';
13
+ import { type VerdaccioDoksDescriptorInput } from './implementations/verdaccio.impl';
14
+ declare function createDeploymentImpl(input: DoksDeploymentDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
15
+ generateConfig: () => K8sDeployment;
16
+ }>;
17
+ declare function createQueueStatefulSetImpl(input: DoksQueueDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
18
+ generateConfig: () => import("./types.ts").K8sStatefulSet;
19
+ }>;
20
+ declare function createDatabaseStatefulSetImpl(input: DoksDatabaseDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
21
+ generateConfig: () => import("./types.ts").K8sStatefulSet;
22
+ }>;
23
+ declare function createManagedPostgresImpl(input: DOManagedPostgresDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
24
+ generateConfig: () => import("./types.ts").DOManagedDBSpec;
25
+ }>;
26
+ declare function createManagedRedisImpl(input: DOManagedRedisDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
27
+ generateConfig: () => import("./types.ts").DOManagedRedisSpec;
28
+ }>;
29
+ declare function createSpacesImpl(input: DOSpacesDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
30
+ generateConfig: () => import("./types.ts").DOSpacesSpec;
31
+ }>;
32
+ declare function createGiteaImpl(input: GiteaDoksDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
33
+ generateConfig: () => import("./index.ts").GiteaManifest;
34
+ }>;
35
+ declare function createVerdaccioImpl(input: VerdaccioDoksDescriptorInput): import("@vibesdotdev/runtime").RuntimeImplementationWrapper<{
36
+ generateConfig: () => import("./index.ts").VerdaccioManifest;
37
+ }>;
38
+ export { createDeploymentImpl, createQueueStatefulSetImpl, createDatabaseStatefulSetImpl, createManagedPostgresImpl, createManagedRedisImpl, createSpacesImpl, createGiteaImpl, createVerdaccioImpl };
39
+ declare const _default: import("@vibesdotdev/runtime").RuntimePlugin;
40
+ export default _default;
41
+ //# sourceMappingURL=doks.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doks.plugin.d.ts","sourceRoot":"","sources":["../src/doks.plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAGN,KAAK,6BAA6B,EAClC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAIN,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGN,KAAK,gCAAgC,EACrC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGN,KAAK,6BAA6B,EAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGN,KAAK,wBAAwB,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAGN,KAAK,4BAA4B,EACjC,MAAM,kCAAkC,CAAC;AAK1C,iBAAS,oBAAoB,CAAC,KAAK,EAAE,6BAA6B;;GAUjE;AAED,iBAAS,0BAA0B,CAAC,KAAK,EAAE,wBAAwB;;GAUlE;AAED,iBAAS,6BAA6B,CAAC,KAAK,EAAE,2BAA2B;;GAUxE;AAED,iBAAS,yBAAyB,CAAC,KAAK,EAAE,gCAAgC;;GAUzE;AAED,iBAAS,sBAAsB,CAAC,KAAK,EAAE,6BAA6B;;GAUnE;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,uBAAuB;;GAUvD;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,wBAAwB;;GAUvD;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,4BAA4B;;GAU/D;AAED,OAAO,EACN,oBAAoB,EACpB,0BAA0B,EAC1B,6BAA6B,EAC7B,yBAAyB,EACzB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,CAAC;;AAEF,wBAkPG"}
@@ -0,0 +1,287 @@
1
+ /**
2
+ * DOKS Runtime Plugin
3
+ *
4
+ * Registers DigitalOcean Kubernetes infrastructure implementations with the runtime.
5
+ */
6
+ import { createRuntimePlugin, createRuntimeImplementation, createRuntimeAsset } from '@vibesdotdev/runtime';
7
+ import { generateK8sDeployment, DoksDeploymentDescriptorSchema } from './implementations/deployment.impl.js';
8
+ import { stringify } from 'yaml';
9
+ import { resolve } from 'node:path';
10
+ import { generateK8sStatefulSet, DoksQueueDescriptorSchema, DoksDatabaseDescriptorSchema } from './implementations/statefulset.impl.js';
11
+ import { generateDOManagedDB, DOManagedPostgresDescriptorSchema } from './implementations/managed-db.impl.js';
12
+ import { generateDOManagedRedis, DOManagedRedisDescriptorSchema } from './implementations/managed-redis.impl.js';
13
+ import { generateDOSpaces, DOSpacesDescriptorSchema } from './implementations/spaces.impl.js';
14
+ import { generateGiteaManifest, GiteaDoksDescriptorSchema } from './implementations/gitea.impl.js';
15
+ import { generateVerdaccioManifest, VerdaccioDoksDescriptorSchema } from './implementations/verdaccio.impl.js';
16
+ import { createDoDropletImpl } from './implementations/droplet.impl.js';
17
+ // Factory functions that wrap implementation generators in RuntimeImplementation
18
+ function createDeploymentImpl(input) {
19
+ const descriptor = DoksDeploymentDescriptorSchema.parse(input);
20
+ return createRuntimeImplementation({
21
+ id: 'doks-deployment',
22
+ kind: 'infra/worker',
23
+ priority: 20,
24
+ implementation: {
25
+ generateConfig: () => generateK8sDeployment(descriptor)
26
+ }
27
+ });
28
+ }
29
+ function createQueueStatefulSetImpl(input) {
30
+ const descriptor = DoksQueueDescriptorSchema.parse(input);
31
+ return createRuntimeImplementation({
32
+ id: 'doks-statefulset',
33
+ kind: 'infra/queue',
34
+ priority: 20,
35
+ implementation: {
36
+ generateConfig: () => generateK8sStatefulSet(descriptor)
37
+ }
38
+ });
39
+ }
40
+ function createDatabaseStatefulSetImpl(input) {
41
+ const descriptor = DoksDatabaseDescriptorSchema.parse(input);
42
+ return createRuntimeImplementation({
43
+ id: 'doks-statefulset',
44
+ kind: 'infra/database',
45
+ priority: 20,
46
+ implementation: {
47
+ generateConfig: () => generateK8sStatefulSet(descriptor)
48
+ }
49
+ });
50
+ }
51
+ function createManagedPostgresImpl(input) {
52
+ const descriptor = DOManagedPostgresDescriptorSchema.parse(input);
53
+ return createRuntimeImplementation({
54
+ id: 'do-managed-postgres',
55
+ kind: 'infra/database',
56
+ priority: 30,
57
+ implementation: {
58
+ generateConfig: () => generateDOManagedDB(descriptor)
59
+ }
60
+ });
61
+ }
62
+ function createManagedRedisImpl(input) {
63
+ const descriptor = DOManagedRedisDescriptorSchema.parse(input);
64
+ return createRuntimeImplementation({
65
+ id: 'do-managed-redis',
66
+ kind: 'infra/cache',
67
+ priority: 20,
68
+ implementation: {
69
+ generateConfig: () => generateDOManagedRedis(descriptor)
70
+ }
71
+ });
72
+ }
73
+ function createSpacesImpl(input) {
74
+ const descriptor = DOSpacesDescriptorSchema.parse(input);
75
+ return createRuntimeImplementation({
76
+ id: 'do-spaces',
77
+ kind: 'infra/object-storage',
78
+ priority: 20,
79
+ implementation: {
80
+ generateConfig: () => generateDOSpaces(descriptor)
81
+ }
82
+ });
83
+ }
84
+ function createGiteaImpl(input) {
85
+ const descriptor = GiteaDoksDescriptorSchema.parse(input);
86
+ return createRuntimeImplementation({
87
+ id: 'gitea-doks',
88
+ kind: 'infra/git-hosting',
89
+ priority: 20,
90
+ implementation: {
91
+ generateConfig: () => generateGiteaManifest(descriptor)
92
+ }
93
+ });
94
+ }
95
+ function createVerdaccioImpl(input) {
96
+ const descriptor = VerdaccioDoksDescriptorSchema.parse(input);
97
+ return createRuntimeImplementation({
98
+ id: 'verdaccio-doks',
99
+ kind: 'infra/package-registry',
100
+ priority: 20,
101
+ implementation: {
102
+ generateConfig: () => generateVerdaccioManifest(descriptor)
103
+ }
104
+ });
105
+ }
106
+ export { createDeploymentImpl, createQueueStatefulSetImpl, createDatabaseStatefulSetImpl, createManagedPostgresImpl, createManagedRedisImpl, createSpacesImpl, createGiteaImpl, createVerdaccioImpl };
107
+ export default createRuntimePlugin({
108
+ id: 'infra-doks',
109
+ name: 'DigitalOcean Kubernetes Infrastructure',
110
+ dependencies: ['infra'],
111
+ onActivate: async (runtime) => {
112
+ // infra/worker: DOKS Deployment
113
+ runtime.registerLoader('infra/worker', 'doks-deployment', async () => {
114
+ return createDeploymentImpl({
115
+ kind: 'infra/worker',
116
+ id: 'default-worker',
117
+ entrypoint: 'src/worker.ts',
118
+ queues: [],
119
+ concurrency: 1,
120
+ config: {
121
+ adapter: 'doks-deployment'
122
+ }
123
+ });
124
+ }, { priority: 20, origin: 'infra-doks' });
125
+ // infra/queue: DOKS StatefulSet for Kafka/Redpanda
126
+ runtime.registerLoader('infra/queue', 'doks-statefulset', async () => {
127
+ return createQueueStatefulSetImpl({
128
+ kind: 'infra/queue',
129
+ id: 'default-queue',
130
+ engine: 'kafka',
131
+ config: {
132
+ adapter: 'doks-statefulset'
133
+ }
134
+ });
135
+ }, { priority: 20, origin: 'infra-doks' });
136
+ // infra/database: DOKS StatefulSet for self-hosted Postgres
137
+ runtime.registerLoader('infra/database', 'doks-statefulset', async () => {
138
+ return createDatabaseStatefulSetImpl({
139
+ kind: 'infra/database',
140
+ id: 'default-db',
141
+ engine: 'postgres',
142
+ replicas: 0,
143
+ config: {
144
+ adapter: 'doks-statefulset'
145
+ }
146
+ });
147
+ }, { priority: 20, origin: 'infra-doks' });
148
+ // infra/database: DO Managed Postgres (higher priority than StatefulSet)
149
+ runtime.registerLoader('infra/database', 'do-managed-postgres', async () => {
150
+ return createManagedPostgresImpl({
151
+ kind: 'infra/database',
152
+ id: 'default-managed-db',
153
+ engine: 'postgres',
154
+ replicas: 0,
155
+ config: {
156
+ adapter: 'do-managed-postgres'
157
+ }
158
+ });
159
+ }, { priority: 30, origin: 'infra-doks' });
160
+ // infra/cache: DO Managed Redis
161
+ runtime.registerLoader('infra/cache', 'do-managed-redis', async () => {
162
+ return createManagedRedisImpl({
163
+ kind: 'infra/cache',
164
+ id: 'default-redis',
165
+ engine: 'redis',
166
+ config: {
167
+ adapter: 'do-managed-redis'
168
+ }
169
+ });
170
+ }, { priority: 20, origin: 'infra-doks' });
171
+ // infra/object-storage: DO Spaces
172
+ runtime.registerLoader('infra/object-storage', 'do-spaces', async () => {
173
+ return createSpacesImpl({
174
+ kind: 'infra/object-storage',
175
+ id: 'default-spaces',
176
+ publicAccess: false,
177
+ config: {
178
+ adapter: 'do-spaces'
179
+ }
180
+ });
181
+ }, { priority: 20, origin: 'infra-doks' });
182
+ // infra/git-hosting: Gitea on DOKS
183
+ runtime.registerLoader('infra/git-hosting', 'gitea-doks', async () => {
184
+ return createGiteaImpl({
185
+ kind: 'infra/git-hosting',
186
+ id: 'gitea',
187
+ url: 'https://git.vibes.dev',
188
+ hostname: 'git.vibes.dev',
189
+ type: 'gitea',
190
+ storagePath: '/data',
191
+ authMethod: 'token',
192
+ ssl: true,
193
+ config: {
194
+ adapter: 'gitea-doks',
195
+ dropletSize: 's-2vcpu-2gb',
196
+ dockerImage: 'gitea/gitea:1.21',
197
+ volumeSizeGb: 50,
198
+ domain: 'git.vibes.dev',
199
+ sshPort: 22,
200
+ httpPort: 3000
201
+ }
202
+ });
203
+ }, { priority: 20, origin: 'infra-doks' });
204
+ // infra/sandbox: DigitalOcean droplet provisioner
205
+ runtime.registerLoader('infra/sandbox', 'digitalocean-droplet', async () => createRuntimeImplementation({
206
+ id: 'digitalocean-droplet',
207
+ kind: 'infra/sandbox',
208
+ priority: 20,
209
+ implementation: createDoDropletImpl()
210
+ }), { priority: 20, origin: 'infra-doks' });
211
+ // infra/package-registry: Verdaccio on DOKS
212
+ runtime.registerLoader('infra/package-registry', 'verdaccio-doks', async () => {
213
+ return createVerdaccioImpl({
214
+ kind: 'infra/package-registry',
215
+ id: 'verdaccio',
216
+ url: 'https://packages.vibes.dev',
217
+ registryType: 'npm',
218
+ scope: '@vibesdotdev',
219
+ upstreamUrl: 'https://registry.npmjs.org',
220
+ authRequired: true,
221
+ ssl: true,
222
+ config: {
223
+ adapter: 'verdaccio-doks',
224
+ dockerImage: 'verdaccio/verdaccio:5',
225
+ storageSize: '10Gi',
226
+ domain: 'packages.vibes.dev',
227
+ upstreamNpmUrl: 'https://registry.npmjs.org',
228
+ authEnabled: true
229
+ }
230
+ });
231
+ }, { priority: 20, origin: 'infra-doks' });
232
+ // Canonical DigitalOcean App Platform Deploy client (`runtime/client` kind).
233
+ // Consumers resolve via `getDigitalOceanAppDeployClient()` or
234
+ // `getVibesClient<DigitalOceanAppDeployClient>('digitalocean-app-deploy')`.
235
+ runtime.registerDescriptor('runtime/client', {
236
+ id: 'digitalocean-app-deploy',
237
+ kind: 'runtime/client',
238
+ description: 'DigitalOcean App Platform deploy client — creates/updates DO Apps from AppDeployment manifests.'
239
+ });
240
+ runtime.registerLoader('runtime/client', 'digitalocean-app-deploy', async () => {
241
+ const { DigitalOceanAppDeployClient } = await import('./client/digitalocean-app-deploy.client.js');
242
+ return { impl: DigitalOceanAppDeployClient };
243
+ });
244
+ // infra/artifact: K8s Deployment generator
245
+ runtime.registerDescriptor('infra/artifact', {
246
+ id: 'k8s-deployment',
247
+ kind: 'infra/artifact',
248
+ description: 'Generates Kubernetes Deployment YAML from infra/worker descriptors'
249
+ });
250
+ runtime.registerLoader('infra/artifact', 'k8s-deployment', async () => {
251
+ return createRuntimeImplementation({
252
+ id: 'k8s-deployment',
253
+ kind: 'infra/artifact',
254
+ priority: 20,
255
+ implementation: {
256
+ async generate(context) {
257
+ const resources = context?.resources || [];
258
+ const outputDir = context?.outputDir || './infra/generated';
259
+ const workerDescriptors = resources.filter((r) => r.kind === 'infra/worker');
260
+ if (workerDescriptors.length === 0) {
261
+ return {
262
+ content: '# No infra/worker descriptors found\n',
263
+ filename: 'k8s-deployment.yaml',
264
+ path: resolve(outputDir, 'kubernetes', 'k8s-deployment.yaml'),
265
+ metadata: { sourceKind: 'infra/worker', format: 'yaml', generator: 'k8s-deployment' }
266
+ };
267
+ }
268
+ const artifacts = [];
269
+ for (const descriptor of workerDescriptors) {
270
+ const parsed = DoksDeploymentDescriptorSchema.parse(descriptor);
271
+ const deployment = generateK8sDeployment(parsed);
272
+ const yamlContent = stringify(deployment);
273
+ artifacts.push(`---\n# Resource: ${descriptor.id}\n${yamlContent}`);
274
+ }
275
+ return {
276
+ content: artifacts.join('\n'),
277
+ filename: 'k8s-deployment.yaml',
278
+ path: resolve(outputDir, 'kubernetes', 'k8s-deployment.yaml'),
279
+ metadata: { sourceKind: 'infra/worker', format: 'yaml', generator: 'k8s-deployment' }
280
+ };
281
+ }
282
+ }
283
+ });
284
+ });
285
+ }
286
+ });
287
+ //# sourceMappingURL=doks.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doks.plugin.js","sourceRoot":"","sources":["../src/doks.plugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EACN,qBAAqB,EACrB,8BAA8B,EAE9B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAG5B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,mBAAmB,EACnB,iCAAiC,EAEjC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAE9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,gBAAgB,EAChB,wBAAwB,EAExB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,qBAAqB,EACrB,yBAAyB,EAEzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,yBAAyB,EACzB,6BAA6B,EAE7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,iFAAiF;AAEjF,SAAS,oBAAoB,CAAC,KAAoC;IACjE,MAAM,UAAU,GAAG,8BAA8B,CAAC,KAAK,CAAC,KAAK,CAA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CACD,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Implementation: infra/worker -> kubernetes (doks-deployment)
3
+ *
4
+ * Generates a K8s Deployment manifest for worker descriptors.
5
+ */
6
+ import * as z from 'zod/v4';
7
+ import type { K8sDeployment } from '../types.ts';
8
+ export declare const DoksDeploymentDescriptorSchema: z.ZodObject<{
9
+ kind: z.ZodLiteral<"infra/worker">;
10
+ id: z.ZodString;
11
+ name: z.ZodOptional<z.ZodString>;
12
+ description: z.ZodOptional<z.ZodString>;
13
+ entrypoint: z.ZodString;
14
+ queues: z.ZodDefault<z.ZodArray<z.ZodString>>;
15
+ concurrency: z.ZodDefault<z.ZodNumber>;
16
+ scaling: z.ZodOptional<z.ZodObject<{
17
+ min: z.ZodDefault<z.ZodNumber>;
18
+ max: z.ZodDefault<z.ZodNumber>;
19
+ cpu: z.ZodOptional<z.ZodString>;
20
+ memory: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>>;
22
+ config: z.ZodObject<{
23
+ namespace: z.ZodDefault<z.ZodString>;
24
+ image: z.ZodOptional<z.ZodString>;
25
+ healthPort: z.ZodDefault<z.ZodNumber>;
26
+ healthPath: z.ZodDefault<z.ZodString>;
27
+ readyPath: z.ZodDefault<z.ZodString>;
28
+ adapter: z.ZodLiteral<"doks-deployment">;
29
+ }, z.core.$strip>;
30
+ }, z.core.$strip>;
31
+ export type DoksDeploymentDescriptorInput = z.input<typeof DoksDeploymentDescriptorSchema>;
32
+ export type DoksDeploymentDescriptor = z.infer<typeof DoksDeploymentDescriptorSchema>;
33
+ export declare function generateK8sDeployment(descriptor: DoksDeploymentDescriptor): K8sDeployment;
34
+ //# sourceMappingURL=deployment.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment.impl.d.ts","sourceRoot":"","sources":["../../src/implementations/deployment.impl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;iBAuBzC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAC3F,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,wBAAwB,GAAG,aAAa,CAsDzF"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Implementation: infra/worker -> kubernetes (doks-deployment)
3
+ *
4
+ * Generates a K8s Deployment manifest for worker descriptors.
5
+ */
6
+ import * as z from 'zod/v4';
7
+ import { DoksDeploymentWorkerConfigSchema } from '@vibesdotdev/infra-core/kinds';
8
+ export const DoksDeploymentDescriptorSchema = z.object({
9
+ kind: z.literal('infra/worker'),
10
+ id: z.string().min(1),
11
+ name: z.string().optional(),
12
+ description: z.string().optional(),
13
+ /** Path to worker entrypoint */
14
+ entrypoint: z.string().min(1),
15
+ /** Queue names to consume from */
16
+ queues: z.array(z.string().min(1)).default([]),
17
+ /** Worker concurrency */
18
+ concurrency: z.number().int().positive().default(1),
19
+ /** Scaling configuration */
20
+ scaling: z
21
+ .object({
22
+ min: z.number().int().nonnegative().default(1),
23
+ max: z.number().int().positive().default(1),
24
+ cpu: z.string().optional(),
25
+ memory: z.string().optional()
26
+ })
27
+ .optional(),
28
+ config: DoksDeploymentWorkerConfigSchema.extend({
29
+ adapter: z.literal('doks-deployment')
30
+ })
31
+ });
32
+ export function generateK8sDeployment(descriptor) {
33
+ const parsed = DoksDeploymentDescriptorSchema.parse(descriptor);
34
+ const ns = parsed.config?.namespace ?? 'vibes';
35
+ const image = parsed.config?.image ?? `vibes/${parsed.id}:latest`;
36
+ const healthPort = parsed.config?.healthPort ?? 8080;
37
+ const healthPath = parsed.config?.healthPath ?? '/healthz';
38
+ const readyPath = parsed.config?.readyPath ?? '/readyz';
39
+ return {
40
+ apiVersion: 'apps/v1',
41
+ kind: 'Deployment',
42
+ metadata: {
43
+ name: `vibes-${parsed.id}`,
44
+ namespace: ns,
45
+ labels: { app: parsed.id, 'app.kubernetes.io/part-of': 'vibes' }
46
+ },
47
+ spec: {
48
+ replicas: parsed.scaling?.min ?? 1,
49
+ selector: { matchLabels: { app: parsed.id } },
50
+ template: {
51
+ metadata: {
52
+ labels: { app: parsed.id }
53
+ },
54
+ spec: {
55
+ containers: [
56
+ {
57
+ name: parsed.id,
58
+ image,
59
+ command: ['bun', 'run', parsed.entrypoint],
60
+ resources: {
61
+ requests: {
62
+ cpu: parsed.scaling?.cpu ?? '250m',
63
+ memory: parsed.scaling?.memory ?? '256Mi'
64
+ },
65
+ limits: {
66
+ cpu: parsed.scaling?.cpu ?? '1',
67
+ memory: parsed.scaling?.memory ?? '512Mi'
68
+ }
69
+ },
70
+ envFrom: [{ configMapRef: { name: `vibes-${parsed.id}-config` } }],
71
+ livenessProbe: {
72
+ httpGet: { path: healthPath, port: healthPort },
73
+ periodSeconds: 30
74
+ },
75
+ readinessProbe: {
76
+ httpGet: { path: readyPath, port: healthPort },
77
+ periodSeconds: 10
78
+ }
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ }
84
+ };
85
+ }
86
+ //# sourceMappingURL=deployment.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment.impl.js","sourceRoot":"","sources":["../../src/implementations/deployment.impl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IAC/B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,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AAO,EAAE,GAAG,IAAI,GAAG;oCAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,OAAO;iCACzC;6BACD;4BACD,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;4BAClE,aAAa,EAAE;gCACd,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;gCAC/C,aAAa,EAAE,EAAE;6BACjB;4BACD,cAAc,EAAE;gCACf,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;gCAC9C,aAAa,EAAE,EAAE;6BACjB;yBACD;qBACD;iBACD;aACD;SACD;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Implementation: infra/sandbox → digitalocean-droplet
3
+ *
4
+ * Wires the existing `DigitalOceanProvider` (./cloud/digitalocean.ts) into
5
+ * the runtime kind resolution path. The resolved impl exposes a
6
+ * `provision(descriptor)` method that creates a DigitalOcean droplet via
7
+ * the v2 API, waits for `status: 'active'`, and returns the platform-side
8
+ * `SandboxProvisionResult` shape that
9
+ * `apps/platform-web/src/lib/hosts/server/queries/host-provision.ts`
10
+ * consumes.
11
+ *
12
+ * The DO API token resolves in this order:
13
+ * 1. `descriptor.config.apiToken` (explicit override; tests use this).
14
+ * 2. `process.env.DIGITALOCEAN_API_TOKEN` (the existing dev fallback,
15
+ * matching the `DigitalOceanAppDeployClient` in `./client/`).
16
+ * 3. `packages/secrets` `cloud-credentials.digitalocean.token` —
17
+ * brokerage path, currently DEFERRED to the migration debt entry
18
+ * in `infra-deploy/SPEC.md`. When that lands, this impl resolves
19
+ * the same secret per actor scope.
20
+ */
21
+ import * as z from 'zod/v4';
22
+ import type { CloudInstance } from '../types.ts';
23
+ export declare const DoDropletConfigSchema: z.ZodObject<{
24
+ dropletSize: z.ZodString;
25
+ adapter: z.ZodLiteral<"digitalocean-droplet">;
26
+ region: z.ZodDefault<z.ZodString>;
27
+ image: z.ZodDefault<z.ZodString>;
28
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
29
+ sshKeyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
30
+ apiToken: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>;
32
+ export declare const DoDropletDescriptorSchema: z.ZodObject<{
33
+ kind: z.ZodLiteral<"infra/sandbox">;
34
+ id: z.ZodString;
35
+ name: z.ZodOptional<z.ZodString>;
36
+ description: z.ZodOptional<z.ZodString>;
37
+ config: z.ZodObject<{
38
+ dropletSize: z.ZodString;
39
+ adapter: z.ZodLiteral<"digitalocean-droplet">;
40
+ region: z.ZodDefault<z.ZodString>;
41
+ image: z.ZodDefault<z.ZodString>;
42
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
43
+ sshKeyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
44
+ apiToken: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>;
46
+ cloudInitScript: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ export type DoDropletDescriptorInput = z.input<typeof DoDropletDescriptorSchema>;
49
+ export type DoDropletDescriptor = z.infer<typeof DoDropletDescriptorSchema>;
50
+ export interface SandboxProvisionResult {
51
+ instanceId: string;
52
+ publicIp?: string;
53
+ privateIp?: string;
54
+ region: string;
55
+ createdAt: Date;
56
+ }
57
+ import type { InstanceFilters } from '../types.ts';
58
+ export type ProviderFactory = (apiToken: string, defaultRegion: string) => {
59
+ createInstance(config: {
60
+ name: string;
61
+ type: string;
62
+ region: string;
63
+ image: string;
64
+ sshKeys?: string[];
65
+ userData?: string;
66
+ tags: Record<string, string>;
67
+ }): Promise<CloudInstance>;
68
+ listInstances(filters?: InstanceFilters): Promise<CloudInstance[]>;
69
+ };
70
+ /**
71
+ * `DoDropletSandbox` is a singleton-friendly impl: a single instance is
72
+ * registered per worker and serves every `provision(descriptor)` call.
73
+ * Per-call descriptors carry their own API token + region, so multi-tenant
74
+ * use is safe — the impl holds no per-tenant state.
75
+ *
76
+ * For unit tests, pass `providerFactory` to swap in a mock
77
+ * `DigitalOceanProvider`.
78
+ */
79
+ export declare class DoDropletSandbox {
80
+ private readonly providerFactory;
81
+ constructor(providerFactory?: ProviderFactory);
82
+ provision(descriptorInput: DoDropletDescriptorInput): Promise<SandboxProvisionResult>;
83
+ }
84
+ export declare function createDoDropletImpl(providerFactory?: ProviderFactory): DoDropletSandbox;
85
+ //# sourceMappingURL=droplet.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"droplet.impl.d.ts","sourceRoot":"","sources":["../../src/implementations/droplet.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,qBAAqB;;;;;;;;iBAOhC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;iBAOpC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;CAChB;AAED,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG,CAC7B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,KACjB;IACJ,cAAc,CAAC,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