summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-04 00:58:06 -0500
committerFrank <[email protected]>2026-01-04 00:58:06 -0500
commitd3fd6d1a106a9f5ffa0707aa97dcb19a979fdc56 (patch)
tree1f259c9ab09345e770d036d8d3caeafd3aea82bd
parent6b12a0084c2e0d36f5f8c449a4cf5bd34bdaafa4 (diff)
downloadopencode-d3fd6d1a106a9f5ffa0707aa97dcb19a979fdc56.tar.gz
opencode-d3fd6d1a106a9f5ffa0707aa97dcb19a979fdc56.zip
zen: update models
-rw-r--r--infra/console.ts1
-rwxr-xr-xpackages/console/core/script/promote-models.ts5
-rwxr-xr-xpackages/console/core/script/pull-models.ts5
-rwxr-xr-xpackages/console/core/script/update-models.ts14
-rw-r--r--packages/console/core/src/model.ts3
-rw-r--r--packages/console/core/sst-env.d.ts4
-rw-r--r--packages/console/function/sst-env.d.ts4
-rw-r--r--packages/console/resource/sst-env.d.ts4
-rw-r--r--packages/enterprise/sst-env.d.ts4
-rw-r--r--packages/function/sst-env.d.ts4
-rw-r--r--sst-env.d.ts4
11 files changed, 46 insertions, 6 deletions
diff --git a/infra/console.ts b/infra/console.ts
index c69a70683..626697c2f 100644
--- a/infra/console.ts
+++ b/infra/console.ts
@@ -104,6 +104,7 @@ const ZEN_MODELS = [
new sst.Secret("ZEN_MODELS4"),
new sst.Secret("ZEN_MODELS5"),
new sst.Secret("ZEN_MODELS6"),
+ new sst.Secret("ZEN_MODELS7"),
]
const STRIPE_SECRET_KEY = new sst.Secret("STRIPE_SECRET_KEY")
const AUTH_API_URL = new sst.Linkable("AUTH_API_URL", {
diff --git a/packages/console/core/script/promote-models.ts b/packages/console/core/script/promote-models.ts
index 766fe6604..5949efd5c 100755
--- a/packages/console/core/script/promote-models.ts
+++ b/packages/console/core/script/promote-models.ts
@@ -18,15 +18,17 @@ const value3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=")[
const value4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1]
const value5 = lines.find((line) => line.startsWith("ZEN_MODELS5"))?.split("=")[1]
const value6 = lines.find((line) => line.startsWith("ZEN_MODELS6"))?.split("=")[1]
+const value7 = lines.find((line) => line.startsWith("ZEN_MODELS7"))?.split("=")[1]
if (!value1) throw new Error("ZEN_MODELS1 not found")
if (!value2) throw new Error("ZEN_MODELS2 not found")
if (!value3) throw new Error("ZEN_MODELS3 not found")
if (!value4) throw new Error("ZEN_MODELS4 not found")
if (!value5) throw new Error("ZEN_MODELS5 not found")
if (!value6) throw new Error("ZEN_MODELS6 not found")
+if (!value7) throw new Error("ZEN_MODELS7 not found")
// validate value
-ZenData.validate(JSON.parse(value1 + value2 + value3 + value4 + value5 + value6))
+ZenData.validate(JSON.parse(value1 + value2 + value3 + value4 + value5 + value6 + value7))
// update the secret
await $`bun sst secret set ZEN_MODELS1 ${value1} --stage ${stage}`
@@ -35,3 +37,4 @@ await $`bun sst secret set ZEN_MODELS3 ${value3} --stage ${stage}`
await $`bun sst secret set ZEN_MODELS4 ${value4} --stage ${stage}`
await $`bun sst secret set ZEN_MODELS5 ${value5} --stage ${stage}`
await $`bun sst secret set ZEN_MODELS6 ${value6} --stage ${stage}`
+await $`bun sst secret set ZEN_MODELS7 ${value7} --stage ${stage}`
diff --git a/packages/console/core/script/pull-models.ts b/packages/console/core/script/pull-models.ts
index 80b1037b6..91899482a 100755
--- a/packages/console/core/script/pull-models.ts
+++ b/packages/console/core/script/pull-models.ts
@@ -18,14 +18,16 @@ const value3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=")[
const value4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1]
const value5 = lines.find((line) => line.startsWith("ZEN_MODELS5"))?.split("=")[1]
const value6 = lines.find((line) => line.startsWith("ZEN_MODELS6"))?.split("=")[1]
+const value7 = lines.find((line) => line.startsWith("ZEN_MODELS7"))?.split("=")[1]
if (!value1) throw new Error("ZEN_MODELS1 not found")
if (!value2) throw new Error("ZEN_MODELS2 not found")
if (!value3) throw new Error("ZEN_MODELS3 not found")
if (!value4) throw new Error("ZEN_MODELS4 not found")
if (!value5) throw new Error("ZEN_MODELS5 not found")
if (!value6) throw new Error("ZEN_MODELS6 not found")
+if (!value7) throw new Error("ZEN_MODELS7 not found")
// validate value
-ZenData.validate(JSON.parse(value1 + value2 + value3 + value4 + value5 + value6))
+ZenData.validate(JSON.parse(value1 + value2 + value3 + value4 + value5 + value6 + value7))
// update the secret
await $`bun sst secret set ZEN_MODELS1 ${value1}`
@@ -34,3 +36,4 @@ await $`bun sst secret set ZEN_MODELS3 ${value3}`
await $`bun sst secret set ZEN_MODELS4 ${value4}`
await $`bun sst secret set ZEN_MODELS5 ${value5}`
await $`bun sst secret set ZEN_MODELS6 ${value6}`
+await $`bun sst secret set ZEN_MODELS7 ${value7}`
diff --git a/packages/console/core/script/update-models.ts b/packages/console/core/script/update-models.ts
index 7872e2330..68038fd4d 100755
--- a/packages/console/core/script/update-models.ts
+++ b/packages/console/core/script/update-models.ts
@@ -16,18 +16,24 @@ const oldValue3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=
const oldValue4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1]
const oldValue5 = lines.find((line) => line.startsWith("ZEN_MODELS5"))?.split("=")[1]
const oldValue6 = lines.find((line) => line.startsWith("ZEN_MODELS6"))?.split("=")[1]
+const oldValue7 = lines.find((line) => line.startsWith("ZEN_MODELS7"))?.split("=")[1]
if (!oldValue1) throw new Error("ZEN_MODELS1 not found")
if (!oldValue2) throw new Error("ZEN_MODELS2 not found")
if (!oldValue3) throw new Error("ZEN_MODELS3 not found")
if (!oldValue4) throw new Error("ZEN_MODELS4 not found")
if (!oldValue5) throw new Error("ZEN_MODELS5 not found")
if (!oldValue6) throw new Error("ZEN_MODELS6 not found")
+if (!oldValue7) throw new Error("ZEN_MODELS7 not found")
// store the prettified json to a temp file
const filename = `models-${Date.now()}.json`
const tempFile = Bun.file(path.join(os.tmpdir(), filename))
await tempFile.write(
- JSON.stringify(JSON.parse(oldValue1 + oldValue2 + oldValue3 + oldValue4 + oldValue5 + oldValue6), null, 2),
+ JSON.stringify(
+ JSON.parse(oldValue1 + oldValue2 + oldValue3 + oldValue4 + oldValue5 + oldValue6 + oldValue7),
+ null,
+ 2,
+ ),
)
console.log("tempFile", tempFile.name)
@@ -37,13 +43,14 @@ const newValue = JSON.stringify(JSON.parse(await tempFile.text()))
ZenData.validate(JSON.parse(newValue))
// update the secret
-const chunk = Math.ceil(newValue.length / 6)
+const chunk = Math.ceil(newValue.length / 7)
const newValue1 = newValue.slice(0, chunk)
const newValue2 = newValue.slice(chunk, chunk * 2)
const newValue3 = newValue.slice(chunk * 2, chunk * 3)
const newValue4 = newValue.slice(chunk * 3, chunk * 4)
const newValue5 = newValue.slice(chunk * 4, chunk * 5)
-const newValue6 = newValue.slice(chunk * 5)
+const newValue6 = newValue.slice(chunk * 5, chunk * 6)
+const newValue7 = newValue.slice(chunk * 6)
await $`bun sst secret set ZEN_MODELS1 ${newValue1}`
await $`bun sst secret set ZEN_MODELS2 ${newValue2}`
@@ -51,3 +58,4 @@ await $`bun sst secret set ZEN_MODELS3 ${newValue3}`
await $`bun sst secret set ZEN_MODELS4 ${newValue4}`
await $`bun sst secret set ZEN_MODELS5 ${newValue5}`
await $`bun sst secret set ZEN_MODELS6 ${newValue6}`
+await $`bun sst secret set ZEN_MODELS7 ${newValue7}`
diff --git a/packages/console/core/src/model.ts b/packages/console/core/src/model.ts
index 5a4a6e3b6..5d4b755cb 100644
--- a/packages/console/core/src/model.ts
+++ b/packages/console/core/src/model.ts
@@ -73,7 +73,8 @@ export namespace ZenData {
Resource.ZEN_MODELS3.value +
Resource.ZEN_MODELS4.value +
Resource.ZEN_MODELS5.value +
- Resource.ZEN_MODELS6.value,
+ Resource.ZEN_MODELS6.value +
+ Resource.ZEN_MODELS7.value,
)
return ModelsSchema.parse(json)
})
diff --git a/packages/console/core/sst-env.d.ts b/packages/console/core/sst-env.d.ts
index ff2c614b3..27cc09145 100644
--- a/packages/console/core/sst-env.d.ts
+++ b/packages/console/core/sst-env.d.ts
@@ -122,6 +122,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
+ "ZEN_MODELS7": {
+ "type": "sst.sst.Secret"
+ "value": string
+ }
}
}
// cloudflare
diff --git a/packages/console/function/sst-env.d.ts b/packages/console/function/sst-env.d.ts
index ff2c614b3..27cc09145 100644
--- a/packages/console/function/sst-env.d.ts
+++ b/packages/console/function/sst-env.d.ts
@@ -122,6 +122,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
+ "ZEN_MODELS7": {
+ "type": "sst.sst.Secret"
+ "value": string
+ }
}
}
// cloudflare
diff --git a/packages/console/resource/sst-env.d.ts b/packages/console/resource/sst-env.d.ts
index ff2c614b3..27cc09145 100644
--- a/packages/console/resource/sst-env.d.ts
+++ b/packages/console/resource/sst-env.d.ts
@@ -122,6 +122,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
+ "ZEN_MODELS7": {
+ "type": "sst.sst.Secret"
+ "value": string
+ }
}
}
// cloudflare
diff --git a/packages/enterprise/sst-env.d.ts b/packages/enterprise/sst-env.d.ts
index ff2c614b3..27cc09145 100644
--- a/packages/enterprise/sst-env.d.ts
+++ b/packages/enterprise/sst-env.d.ts
@@ -122,6 +122,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
+ "ZEN_MODELS7": {
+ "type": "sst.sst.Secret"
+ "value": string
+ }
}
}
// cloudflare
diff --git a/packages/function/sst-env.d.ts b/packages/function/sst-env.d.ts
index ff2c614b3..27cc09145 100644
--- a/packages/function/sst-env.d.ts
+++ b/packages/function/sst-env.d.ts
@@ -122,6 +122,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
+ "ZEN_MODELS7": {
+ "type": "sst.sst.Secret"
+ "value": string
+ }
}
}
// cloudflare
diff --git a/sst-env.d.ts b/sst-env.d.ts
index d7ef06895..18e2d40d6 100644
--- a/sst-env.d.ts
+++ b/sst-env.d.ts
@@ -148,6 +148,10 @@ declare module "sst" {
"type": "sst.sst.Secret"
"value": string
}
+ "ZEN_MODELS7": {
+ "type": "sst.sst.Secret"
+ "value": string
+ }
"ZenData": {
"name": string
"type": "sst.cloudflare.Bucket"