Skip to content

Commit 6ce5c01

Browse files
committed
ignore: v2 experiments
1 parent a53fae1 commit 6ce5c01

11 files changed

Lines changed: 1306 additions & 120 deletions

File tree

.opencode/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ plans
33
package.json
44
bun.lock
55
.gitignore
6-
package-lock.json
6+
package-lock.json
7+
references/

.opencode/skills/effect/SKILL.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
"hono": "catalog:",
144144
"hono-openapi": "catalog:",
145145
"ignore": "7.0.5",
146+
"immer": "11.1.4",
146147
"jsonc-parser": "3.3.1",
147148
"mime-types": "3.0.2",
148149
"minimatch": "10.0.3",

packages/opencode/src/id/id.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ export namespace Identifier {
2727
let counter = 0
2828

2929
export function ascending(prefix: keyof typeof prefixes, given?: string) {
30-
return generateID(prefix, false, given)
30+
return generateID(prefix, "ascending", given)
3131
}
3232

3333
export function descending(prefix: keyof typeof prefixes, given?: string) {
34-
return generateID(prefix, true, given)
34+
return generateID(prefix, "descending", given)
3535
}
3636

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 {
3838
if (!given) {
39-
return create(prefix, descending)
39+
return create(prefixes[prefix], direction)
4040
}
4141

4242
if (!given.startsWith(prefixes[prefix])) {
@@ -55,7 +55,7 @@ export namespace Identifier {
5555
return result
5656
}
5757

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 {
5959
const currentTimestamp = timestamp ?? Date.now()
6060

6161
if (currentTimestamp !== lastTimestamp) {
@@ -66,14 +66,14 @@ export namespace Identifier {
6666

6767
let now = BigInt(currentTimestamp) * BigInt(0x1000) + BigInt(counter)
6868

69-
now = descending ? ~now : now
69+
now = direction === "descending" ? ~now : now
7070

7171
const timeBytes = Buffer.alloc(6)
7272
for (let i = 0; i < 6; i++) {
7373
timeBytes[i] = Number((now >> BigInt(40 - 8 * i)) & BigInt(0xff))
7474
}
7575

76-
return prefixes[prefix] + "_" + timeBytes.toString("hex") + randomBase62(LENGTH - 12)
76+
return prefix + "_" + timeBytes.toString("hex") + randomBase62(LENGTH - 12)
7777
}
7878

7979
/** Extract timestamp from an ascending ID. Does not work with descending IDs. */

packages/opencode/src/tool/truncate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ export namespace Truncate {
4848
const fs = yield* AppFileSystem.Service
4949

5050
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+
)
5254
const entries = yield* fs.readDirectory(TRUNCATION_DIR).pipe(
5355
Effect.map((all) => all.filter((name) => name.startsWith("tool_"))),
5456
Effect.catch(() => Effect.succeed([])),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export namespace SessionCommon {}

0 commit comments

Comments
 (0)