mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-06 12:37:37 +00:00
shell: fish functions -> ~/.local/bin executables + bash/zsh ports; manage ~/.agents
- 16 cross-shell utilities converted to sh/bash chezmoi executables: ai c2p cp-appid extract_agents fab gdc gh-sonr-org-migrate ghg-clone ghn gho git-summary launch_omp_livediff_overlay lc-elir mdcp mdp pj (ghg-clone not named ghg: unrelated cargo binary owns that name) - cwd/history helpers stay per-shell: yy c cd clip-last + ghg/ghn/gho cd-wrappers in bash/functions/ and zsh/functions/, loaded by rc files - fish keeps only shell-state functions; converted ones now hit PATH - cp-appid ignore gating moved to .local/bin path - dot_agents/skills: 82 skills materialized from dotstate storage so dot_claude skill symlinks resolve on fresh bootstrap; dotstate profile/symlinks.json released .agents/skills .bashrc .zshrc
This commit is contained in:
1 parent
6776366ce6
commit
6406208b35
637 files changed
+100297
-497
No files matched your search
@@ -0,0 +1,112 @@
|
||||
# DO Storage Configuration
|
||||
|
||||
## SQLite-backed (Recommended)
|
||||
|
||||
**wrangler.jsonc:**
|
||||
```jsonc
|
||||
{
|
||||
"migrations": [
|
||||
{
|
||||
"tag": "v1",
|
||||
"new_sqlite_classes": ["Counter", "Session", "RateLimiter"]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Migration lifecycle:** Migrations run once per deployment. Existing DO instances get new storage backend on next invocation. Renaming/removing classes requires `renamed_classes` or `deleted_classes` entries.
|
||||
|
||||
## KV-backed (Legacy)
|
||||
|
||||
**wrangler.jsonc:**
|
||||
```jsonc
|
||||
{
|
||||
"migrations": [
|
||||
{
|
||||
"tag": "v1",
|
||||
"new_classes": ["OldCounter"]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## TypeScript Setup
|
||||
|
||||
```typescript
|
||||
export class MyDurableObject extends DurableObject {
|
||||
sql: SqlStorage;
|
||||
|
||||
constructor(ctx: DurableObjectState, env: Env) {
|
||||
super(ctx, env);
|
||||
this.sql = ctx.storage.sql;
|
||||
|
||||
// Initialize schema
|
||||
this.sql.exec(`
|
||||
CREATE TABLE IF NOT EXISTS users(
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
email TEXT UNIQUE
|
||||
);
|
||||
`);
|
||||
}
|
||||
}
|
||||
|
||||
// Binding
|
||||
interface Env {
|
||||
MY_DO: DurableObjectNamespace;
|
||||
}
|
||||
|
||||
export default {
|
||||
async fetch(request: Request, env: Env): Promise<Response> {
|
||||
const id = env.MY_DO.idFromName('singleton');
|
||||
const stub = env.MY_DO.get(id);
|
||||
|
||||
// Modern RPC: call methods directly (recommended)
|
||||
const result = await stub.someMethod();
|
||||
return Response.json(result);
|
||||
|
||||
// Legacy: forward request (still works)
|
||||
// return stub.fetch(request);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## CPU Limits
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"limits": {
|
||||
"cpu_ms": 300000 // 5 minutes (default 30s)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Location Control
|
||||
|
||||
```typescript
|
||||
// Jurisdiction (GDPR/FedRAMP)
|
||||
const euNamespace = env.MY_DO.jurisdiction("eu");
|
||||
const id = euNamespace.newUniqueId();
|
||||
const stub = euNamespace.get(id);
|
||||
|
||||
// Location hint (best effort)
|
||||
const stub = env.MY_DO.get(id, { locationHint: "enam" });
|
||||
// Hints: wnam, enam, sam, weur, eeur, apac, oc, afr, me
|
||||
```
|
||||
|
||||
## Initialization
|
||||
|
||||
```typescript
|
||||
export class Counter extends DurableObject {
|
||||
value: number;
|
||||
|
||||
constructor(ctx: DurableObjectState, env: Env) {
|
||||
super(ctx, env);
|
||||
|
||||
// Block concurrent requests during init
|
||||
ctx.blockConcurrencyWhile(async () => {
|
||||
this.value = (await ctx.storage.get("value")) || 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user