@kya-os/create-molti 0.1.0-canary.2 → 0.1.0-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates/github-workflow.d.ts.map +1 -1
- package/dist/templates/github-workflow.js +4 -3
- 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 +4 -3
- package/src/templates/worker-index.ts +4 -4
- package/src/templates/wrangler.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAgB,sBAAsB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"github-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAgB,sBAAsB,IAAI,MAAM,CAgD/C"}
|
|
@@ -39,6 +39,8 @@ jobs:
|
|
|
39
39
|
uses: cloudflare/wrangler-action@v3
|
|
40
40
|
with:
|
|
41
41
|
apiToken: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
42
|
+
# Required when your API token has access to multiple CF accounts.
|
|
43
|
+
accountId: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
42
44
|
# Secrets listed here are uploaded as Wrangler secrets.
|
|
43
45
|
# IMPORTANT: Every secret listed MUST exist in your GitHub
|
|
44
46
|
# repository's Settings > Secrets. Remove or comment out
|
|
@@ -46,12 +48,11 @@ jobs:
|
|
|
46
48
|
secrets: |
|
|
47
49
|
MCP_IDENTITY_PRIVATE_KEY
|
|
48
50
|
AGENTSHIELD_API_KEY
|
|
49
|
-
ANTHROPIC_API_KEY
|
|
50
51
|
env:
|
|
51
52
|
MCP_IDENTITY_PRIVATE_KEY: \${{ secrets.MCP_IDENTITY_PRIVATE_KEY }}
|
|
52
53
|
AGENTSHIELD_API_KEY: \${{ secrets.AGENTSHIELD_API_KEY }}
|
|
53
|
-
|
|
54
|
-
#
|
|
54
|
+
# Uncomment the AI provider you use (at least one is required):
|
|
55
|
+
# ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
55
56
|
# OPENAI_API_KEY: \${{ secrets.OPENAI_API_KEY }}
|
|
56
57
|
`;
|
|
57
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-workflow.js","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,UAAU,sBAAsB;IACpC,OAAO
|
|
1
|
+
{"version":3,"file":"github-workflow.js","sourceRoot":"","sources":["../../src/templates/github-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CR,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
|
@@ -40,6 +40,8 @@ jobs:
|
|
|
40
40
|
uses: cloudflare/wrangler-action@v3
|
|
41
41
|
with:
|
|
42
42
|
apiToken: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
43
|
+
# Required when your API token has access to multiple CF accounts.
|
|
44
|
+
accountId: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
43
45
|
# Secrets listed here are uploaded as Wrangler secrets.
|
|
44
46
|
# IMPORTANT: Every secret listed MUST exist in your GitHub
|
|
45
47
|
# repository's Settings > Secrets. Remove or comment out
|
|
@@ -47,12 +49,11 @@ jobs:
|
|
|
47
49
|
secrets: |
|
|
48
50
|
MCP_IDENTITY_PRIVATE_KEY
|
|
49
51
|
AGENTSHIELD_API_KEY
|
|
50
|
-
ANTHROPIC_API_KEY
|
|
51
52
|
env:
|
|
52
53
|
MCP_IDENTITY_PRIVATE_KEY: \${{ secrets.MCP_IDENTITY_PRIVATE_KEY }}
|
|
53
54
|
AGENTSHIELD_API_KEY: \${{ secrets.AGENTSHIELD_API_KEY }}
|
|
54
|
-
|
|
55
|
-
#
|
|
55
|
+
# Uncomment the AI provider you use (at least one is required):
|
|
56
|
+
# ANTHROPIC_API_KEY: \${{ secrets.ANTHROPIC_API_KEY }}
|
|
56
57
|
# OPENAI_API_KEY: \${{ secrets.OPENAI_API_KEY }}
|
|
57
58
|
`;
|
|
58
59
|
}
|
|
@@ -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" }
|