GeezerVison is showing github.com — ignore: v2 experiments · madflow/opencode@6ce5c01
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .opencode/.gitignore +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | package.json | 4 | 4 | bun.lock | 5 | 5 | .gitignore | 6 | | -package-lock.json | | 6 | +package-lock.json | | 7 | +references/ |
Collapse file Copy file name to clipboard +21Lines changed: 21 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +--- | | 2 | +name: effect | | 3 | +description: Answer questions about the Effect framework | | 4 | +--- | | 5 | + | | 6 | +# Effect | | 7 | + | | 8 | +This codebase uses Effect, a framework for writing typescript. | | 9 | + | | 10 | +## How to Answer Effect Questions | | 11 | + | | 12 | +1. Clone the Effect repository: `https://github.com/Effect-TS/effect-smol` to | | 13 | + `.opencode/references/effect-smol` in this project NOT the skill folder. | | 14 | +2. Use the explore agent to search the codebase for answers about Effect patterns, APIs, and concepts | | 15 | +3. Provide responses based on the actual Effect source code and documentation | | 16 | + | | 17 | +## Guidelines | | 18 | + | | 19 | +- Always use the explore agent with the cloned repository when answering Effect-related questions | | 20 | +- Reference specific files and patterns found in the Effect codebase | | 21 | +- Do not answer from memory - always verify against the source |
Collapse file Copy file name to clipboardExpand all lines: bun.lock +3Lines changed: 3 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: packages/opencode/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 143 | 143 | "hono": "catalog:", | 144 | 144 | "hono-openapi": "catalog:", | 145 | 145 | "ignore": "7.0.5", | | 146 | + "immer": "11.1.4", | 146 | 147 | "jsonc-parser": "3.3.1", | 147 | 148 | "mime-types": "3.0.2", | 148 | 149 | "minimatch": "10.0.3", | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/id/id.ts +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,16 +27,16 @@ export namespace Identifier { | 27 | 27 | let counter = 0 | 28 | 28 |
| 29 | 29 | export function ascending(prefix: keyof typeof prefixes, given?: string) { | 30 | | - return generateID(prefix, false, given) | | 30 | + return generateID(prefix, "ascending", given) | 31 | 31 | } | 32 | 32 |
| 33 | 33 | export function descending(prefix: keyof typeof prefixes, given?: string) { | 34 | | - return generateID(prefix, true, given) | | 34 | + return generateID(prefix, "descending", given) | 35 | 35 | } | 36 | 36 |
| 37 | | - function generateID(prefix: keyof typeof prefixes, descending: boolean, given?: string): string { | | 37 | + function generateID(prefix: keyof typeof prefixes, direction: "descending" | "ascending", given?: string): string { | 38 | 38 | if (!given) { | 39 | | - return create(prefix, descending) | | 39 | + return create(prefixes[prefix], direction) | 40 | 40 | } | 41 | 41 |
| 42 | 42 | if (!given.startsWith(prefixes[prefix])) { | @@ -55,7 +55,7 @@ export namespace Identifier { | 55 | 55 | return result | 56 | 56 | } | 57 | 57 |
| 58 | | - export function create(prefix: keyof typeof prefixes, descending: boolean, timestamp?: number): string { | | 58 | + export function create(prefix: string, direction: "descending" | "ascending", timestamp?: number): string { | 59 | 59 | const currentTimestamp = timestamp ?? Date.now() | 60 | 60 |
| 61 | 61 | if (currentTimestamp !== lastTimestamp) { | @@ -66,14 +66,14 @@ export namespace Identifier { | 66 | 66 |
| 67 | 67 | let now = BigInt(currentTimestamp) * BigInt(0x1000) + BigInt(counter) | 68 | 68 |
| 69 | | - now = descending ? ~now : now | | 69 | + now = direction === "descending" ? ~now : now | 70 | 70 |
| 71 | 71 | const timeBytes = Buffer.alloc(6) | 72 | 72 | for (let i = 0; i < 6; i++) { | 73 | 73 | timeBytes[i] = Number((now >> BigInt(40 - 8 * i)) & BigInt(0xff)) | 74 | 74 | } | 75 | 75 |
| 76 | | - return prefixes[prefix] + "_" + timeBytes.toString("hex") + randomBase62(LENGTH - 12) | | 76 | + return prefix + "_" + timeBytes.toString("hex") + randomBase62(LENGTH - 12) | 77 | 77 | } | 78 | 78 |
| 79 | 79 | /** Extract timestamp from an ascending ID. Does not work with descending IDs. */ | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/tool/truncate.ts +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -48,7 +48,9 @@ export namespace Truncate { | 48 | 48 | const fs = yield* AppFileSystem.Service | 49 | 49 |
| 50 | 50 | const cleanup = Effect.fn("Truncate.cleanup")(function* () { | 51 | | - const cutoff = Identifier.timestamp(Identifier.create("tool", false, Date.now() - Duration.toMillis(RETENTION))) | | 51 | + const cutoff = Identifier.timestamp( | | 52 | + Identifier.create("tool", "ascending", Date.now() - Duration.toMillis(RETENTION)), | | 53 | + ) | 52 | 54 | const entries = yield* fs.readDirectory(TRUNCATION_DIR).pipe( | 53 | 55 | Effect.map((all) => all.filter((name) => name.startsWith("tool_"))), | 54 | 56 | Effect.catch(() => Effect.succeed([])), | |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +export namespace SessionCommon {} |
|