@kya-os/create-molti 0.1.0-canary.1 → 0.1.0-canary.3
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/templates/github-workflow.d.ts +4 -0
- package/dist/templates/github-workflow.d.ts.map +1 -1
- package/dist/templates/github-workflow.js +10 -0
- package/dist/templates/github-workflow.js.map +1 -1
- package/dist/templates/worker-index.js +4 -4
- package/dist/templates/wrangler.d.ts.map +1 -1
- package/dist/templates/wrangler.js +5 -0
- package/dist/templates/wrangler.js.map +1 -1
- package/package.json +1 -1
- package/src/templates/github-workflow.ts +10 -0
- package/src/templates/worker-index.ts +4 -4
- package/src/templates/wrangler.ts +5 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* GitHub Actions Workflow Template
|
|
3
3
|
*
|
|
4
4
|
* Generates the deploy.yml for CI/CD to Cloudflare.
|
|
5
|
+
* Only required secrets are uploaded in the deploy step.
|
|
6
|
+
* Optional AI provider keys (ANTHROPIC_API_KEY / OPENAI_API_KEY) are
|
|
7
|
+
* included but commented out — uncomment once you've added them as
|
|
8
|
+
* GitHub Secrets to avoid "Value not found in environment" errors.
|
|
5
9
|
*/
|
|
6
10
|
export declare function generateDeployWorkflow(): string;
|
|
7
11
|
//# sourceMappingURL=github-workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"github-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAgB,sBAAsB,IAAI,MAAM,CA+C/C"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* GitHub Actions Workflow Template
|
|
3
3
|
*
|
|
4
4
|
* Generates the deploy.yml for CI/CD to Cloudflare.
|
|
5
|
+
* Only required secrets are uploaded in the deploy step.
|
|
6
|
+
* Optional AI provider keys (ANTHROPIC_API_KEY / OPENAI_API_KEY) are
|
|
7
|
+
* included but commented out — uncomment once you've added them as
|
|
8
|
+
* GitHub Secrets to avoid "Value not found in environment" errors.
|
|
5
9
|
*/
|
|
6
10
|
export function generateDeployWorkflow() {
|
|
7
11
|
return `name: Deploy to Cloudflare
|
|
@@ -35,6 +39,10 @@ jobs:
|
|
|
35
39
|
uses: cloudflare/wrangler-action@v3
|
|
36
40
|
with:
|
|
37
41
|
apiToken: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
42
|
+
# Secrets listed here are uploaded as Wrangler secrets.
|
|
43
|
+
# IMPORTANT: Every secret listed MUST exist in your GitHub
|
|
44
|
+
# repository's Settings > Secrets. Remove or comment out
|
|
45
|
+
# any line for a secret you haven't added yet.
|
|
38
46
|
secrets: |
|
|
39
47
|
MCP_IDENTITY_PRIVATE_KEY
|
|
40
48
|
AGENTSHIELD_API_KEY
|
|
@@ -43,6 +51,8 @@ jobs:
|
|
|
43
51
|
MCP_IDENTITY_PRIVATE_KEY: \${{ secrets.MCP_IDENTITY_PRIVATE_KEY }}
|
|
44
52
|
AGENTSHIELD_API_KEY: \${{ secrets.AGENTSHIELD_API_KEY }}
|
|
45
53
|
ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
54
|
+
# Uncomment the provider you use (at least one is required):
|
|
55
|
+
# OPENAI_API_KEY: \${{ secrets.OPENAI_API_KEY }}
|
|
46
56
|
`;
|
|
47
57
|
}
|
|
48
58
|
//# sourceMappingURL=github-workflow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-workflow.js","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"github-workflow.js","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CR,CAAC;AACF,CAAC"}
|
|
@@ -17,7 +17,7 @@ export function generateWorkerIndex(projectName) {
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { Hono } from "hono";
|
|
20
|
-
import { getSandbox,
|
|
20
|
+
import { getSandbox, type SandboxOptions } from "@cloudflare/sandbox";
|
|
21
21
|
import type { MoltbotEnv, AppEnv } from "./types";
|
|
22
22
|
import { publicRoutes } from "./routes/public";
|
|
23
23
|
import { createAccessMiddleware } from "./auth";
|
|
@@ -28,9 +28,9 @@ const app = new Hono<AppEnv>();
|
|
|
28
28
|
|
|
29
29
|
// Initialize sandbox for all requests
|
|
30
30
|
app.use("*", async (c, next) => {
|
|
31
|
-
const options =
|
|
31
|
+
const options: SandboxOptions = {
|
|
32
32
|
sleepAfter: Number(c.env.SANDBOX_SLEEP_AFTER) || 300,
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
const sandbox = getSandbox(c.env.Sandbox, "moltbot", options);
|
|
35
35
|
c.set("sandbox", sandbox);
|
|
36
36
|
await next();
|
|
@@ -85,7 +85,7 @@ function loadingPage(): string {
|
|
|
85
85
|
export default {
|
|
86
86
|
fetch: app.fetch,
|
|
87
87
|
async scheduled(_event: ScheduledEvent, env: MoltbotEnv, _ctx: ExecutionContext) {
|
|
88
|
-
const options =
|
|
88
|
+
const options: SandboxOptions = { sleepAfter: 300 };
|
|
89
89
|
const sandbox = getSandbox(env.Sandbox, "moltbot", options);
|
|
90
90
|
// Scheduled backup can be added here
|
|
91
91
|
void sandbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrangler.d.ts","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"wrangler.d.ts","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CA4EnE"}
|
|
@@ -37,6 +37,11 @@ export function generateWranglerJsonc(opts) {
|
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
// Durable Object migrations (required by wrangler)
|
|
41
|
+
"migrations": [
|
|
42
|
+
{ "tag": "v1", "new_sqlite_classes": ["Sandbox"] }
|
|
43
|
+
],
|
|
44
|
+
|
|
40
45
|
// R2 bucket for persistent storage
|
|
41
46
|
"r2_buckets": [
|
|
42
47
|
{ "binding": "MOLTBOT_BUCKET", "bucket_name": "${projectName}-data" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,UAAU,qBAAqB,CAAC,IAAqB;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEtF,MAAM,eAAe,GAAG,oBAAoB;QAC1C,CAAC,CAAC;+BACyB,oBAAoB;mDACA;QAC/C,CAAC,CAAC;;sDAEgD,CAAC;IAErD,OAAO;aACI,WAAW;;;;;;;;;;;0BAWE,YAAY
|
|
1
|
+
{"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,UAAU,qBAAqB,CAAC,IAAqB;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEtF,MAAM,eAAe,GAAG,oBAAoB;QAC1C,CAAC,CAAC;+BACyB,oBAAoB;mDACA;QAC/C,CAAC,CAAC;;sDAEgD,CAAC;IAErD,OAAO;aACI,WAAW;;;;;;;;;;;0BAWE,YAAY;;;;;;;;;;;;;;;;;;;qDAmBe,WAAW;;;;;;;;;;;;;;;;;;;iCAmB/B,QAAQ;kCACP,SAAS;;EAEzC,eAAe;;;;;;;;;;;CAWhB,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* GitHub Actions Workflow Template
|
|
3
3
|
*
|
|
4
4
|
* Generates the deploy.yml for CI/CD to Cloudflare.
|
|
5
|
+
* Only required secrets are uploaded in the deploy step.
|
|
6
|
+
* Optional AI provider keys (ANTHROPIC_API_KEY / OPENAI_API_KEY) are
|
|
7
|
+
* included but commented out — uncomment once you've added them as
|
|
8
|
+
* GitHub Secrets to avoid "Value not found in environment" errors.
|
|
5
9
|
*/
|
|
6
10
|
|
|
7
11
|
export function generateDeployWorkflow(): string {
|
|
@@ -36,6 +40,10 @@ jobs:
|
|
|
36
40
|
uses: cloudflare/wrangler-action@v3
|
|
37
41
|
with:
|
|
38
42
|
apiToken: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
43
|
+
# Secrets listed here are uploaded as Wrangler secrets.
|
|
44
|
+
# IMPORTANT: Every secret listed MUST exist in your GitHub
|
|
45
|
+
# repository's Settings > Secrets. Remove or comment out
|
|
46
|
+
# any line for a secret you haven't added yet.
|
|
39
47
|
secrets: |
|
|
40
48
|
MCP_IDENTITY_PRIVATE_KEY
|
|
41
49
|
AGENTSHIELD_API_KEY
|
|
@@ -44,5 +52,7 @@ jobs:
|
|
|
44
52
|
MCP_IDENTITY_PRIVATE_KEY: \${{ secrets.MCP_IDENTITY_PRIVATE_KEY }}
|
|
45
53
|
AGENTSHIELD_API_KEY: \${{ secrets.AGENTSHIELD_API_KEY }}
|
|
46
54
|
ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
55
|
+
# Uncomment the provider you use (at least one is required):
|
|
56
|
+
# OPENAI_API_KEY: \${{ secrets.OPENAI_API_KEY }}
|
|
47
57
|
`;
|
|
48
58
|
}
|
|
@@ -18,7 +18,7 @@ export function generateWorkerIndex(projectName: string): string {
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { Hono } from "hono";
|
|
21
|
-
import { getSandbox,
|
|
21
|
+
import { getSandbox, type SandboxOptions } from "@cloudflare/sandbox";
|
|
22
22
|
import type { MoltbotEnv, AppEnv } from "./types";
|
|
23
23
|
import { publicRoutes } from "./routes/public";
|
|
24
24
|
import { createAccessMiddleware } from "./auth";
|
|
@@ -29,9 +29,9 @@ const app = new Hono<AppEnv>();
|
|
|
29
29
|
|
|
30
30
|
// Initialize sandbox for all requests
|
|
31
31
|
app.use("*", async (c, next) => {
|
|
32
|
-
const options =
|
|
32
|
+
const options: SandboxOptions = {
|
|
33
33
|
sleepAfter: Number(c.env.SANDBOX_SLEEP_AFTER) || 300,
|
|
34
|
-
}
|
|
34
|
+
};
|
|
35
35
|
const sandbox = getSandbox(c.env.Sandbox, "moltbot", options);
|
|
36
36
|
c.set("sandbox", sandbox);
|
|
37
37
|
await next();
|
|
@@ -86,7 +86,7 @@ function loadingPage(): string {
|
|
|
86
86
|
export default {
|
|
87
87
|
fetch: app.fetch,
|
|
88
88
|
async scheduled(_event: ScheduledEvent, env: MoltbotEnv, _ctx: ExecutionContext) {
|
|
89
|
-
const options =
|
|
89
|
+
const options: SandboxOptions = { sleepAfter: 300 };
|
|
90
90
|
const sandbox = getSandbox(env.Sandbox, "moltbot", options);
|
|
91
91
|
// Scheduled backup can be added here
|
|
92
92
|
void sandbox;
|
|
@@ -50,6 +50,11 @@ export function generateWranglerJsonc(opts: WranglerOptions): string {
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
|
|
53
|
+
// Durable Object migrations (required by wrangler)
|
|
54
|
+
"migrations": [
|
|
55
|
+
{ "tag": "v1", "new_sqlite_classes": ["Sandbox"] }
|
|
56
|
+
],
|
|
57
|
+
|
|
53
58
|
// R2 bucket for persistent storage
|
|
54
59
|
"r2_buckets": [
|
|
55
60
|
{ "binding": "MOLTBOT_BUCKET", "bucket_name": "${projectName}-data" }
|