GeezerVison is showing github.com — ci: new publish method (#1451) · daonb/opencode@33cef07
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/publish.yml +6-12Lines changed: 6 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,13 +2,11 @@ name: publish | 2 | 2 |
| 3 | 3 | on: | 4 | 4 | workflow_dispatch: | 5 | | - push: | 6 | | - branches: | 7 | | - - dev | 8 | | - tags: | 9 | | - - "*" | 10 | | - - "!vscode-v*" | 11 | | - - "!github-v*" | | 5 | + inputs: | | 6 | + version: | | 7 | + description: "Version to publish" | | 8 | + required: true | | 9 | + type: string | 12 | 10 |
| 13 | 11 | concurrency: ${{ github.workflow }}-${{ github.ref }} | 14 | 12 |
| | 53 | 51 | - name: Publish | 54 | 52 | run: | | 55 | 53 | bun install | 56 | | - if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]; then | 57 | | - ./script/publish.ts | 58 | | - else | 59 | | - ./script/publish.ts --snapshot | 60 | | - fi | | 54 | + OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts | 61 | 55 | working-directory: ./packages/opencode | 62 | 56 | env: | 63 | 57 | GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} | |
Collapse file Copy file name to clipboardExpand all lines: bun.lock +84-899Lines changed: 84 additions & 899 deletions Collapse file Copy file name to clipboardExpand all lines: package.json +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | }, | 13 | 13 | "workspaces": { | 14 | 14 | "packages": [ | 15 | | - "packages/*" | | 15 | + "packages/*", | | 16 | + "packages/sdk/js" | 16 | 17 | ], | 17 | 18 | "catalog": { | 18 | 19 | "@types/node": "22.13.9", | | 20 | + "@tsconfig/node22": "22.0.2", | 19 | 21 | "ai": "5.0.0-beta.33", | 20 | 22 | "hono": "4.7.10", | 21 | 23 | "typescript": "5.8.2", | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "$schema": "https://json.schemastore.org/package.json", | 3 | | - "version": "0.0.5", | | 3 | + "version": "0.0.0", | 4 | 4 | "name": "opencode", | 5 | 5 | "type": "module", | 6 | 6 | "private": true, | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/script/publish.ts +5-13Lines changed: 5 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/usr/bin/env bun | 2 | | - | | 2 | +const dir = new URL("..", import.meta.url).pathname | | 3 | +process.chdir(dir) | 3 | 4 | import { $ } from "bun" | 4 | 5 |
| 5 | 6 | import pkg from "../package.json" | 6 | 7 |
| 7 | | -const dry = process.argv.includes("--dry") | 8 | | -const snapshot = process.argv.includes("--snapshot") | 9 | | - | 10 | | -const version = snapshot | 11 | | - ? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}` | 12 | | - : await $`git describe --tags --abbrev=0` | 13 | | - .text() | 14 | | - .then((x) => x.substring(1).trim()) | 15 | | - .catch(() => { | 16 | | - console.error("tag not found") | 17 | | - process.exit(1) | 18 | | - }) | | 8 | +const dry = process.env["OPENCODE_DRY"] === "true" | | 9 | +const version = process.env["OPENCODE_VERSION"]! | | 10 | +const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true" | 19 | 11 |
| 20 | 12 | console.log(`publishing ${version}`) | 21 | 13 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/format/formatter.ts +46-4Lines changed: 46 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { App } from "../app/app" | 2 | 2 | import { BunProc } from "../bun" | 3 | 3 | import { Filesystem } from "../util/filesystem" | 4 | | -import path from "path" | 5 | 4 |
| 6 | 5 | export interface Info { | 7 | 6 | name: string | @@ -65,14 +64,57 @@ export const prettier: Info = { | 65 | 64 | ], | 66 | 65 | async enabled() { | 67 | 66 | const app = App.info() | 68 | | - const nms = await Filesystem.findUp("node_modules", app.path.cwd, app.path.root) | 69 | | - for (const item of nms) { | 70 | | - if (await Bun.file(path.join(item, ".bin", "prettier")).exists()) return true | | 67 | + const items = await Filesystem.findUp("package.json", app.path.cwd, app.path.root) | | 68 | + for (const item of items) { | | 69 | + const json = await Bun.file(item).json() | | 70 | + if (json.dependencies?.prettier) return true | | 71 | + if (json.devDependencies?.prettier) return true | 71 | 72 | } | 72 | 73 | return false | 73 | 74 | }, | 74 | 75 | } | 75 | 76 |
| | 77 | +export const biome: Info = { | | 78 | + name: "biome", | | 79 | + command: [BunProc.which(), "x", "biome", "format", "--write", "$FILE"], | | 80 | + environment: { | | 81 | + BUN_BE_BUN: "1", | | 82 | + }, | | 83 | + extensions: [ | | 84 | + ".js", | | 85 | + ".jsx", | | 86 | + ".mjs", | | 87 | + ".cjs", | | 88 | + ".ts", | | 89 | + ".tsx", | | 90 | + ".mts", | | 91 | + ".cts", | | 92 | + ".html", | | 93 | + ".htm", | | 94 | + ".css", | | 95 | + ".scss", | | 96 | + ".sass", | | 97 | + ".less", | | 98 | + ".vue", | | 99 | + ".svelte", | | 100 | + ".json", | | 101 | + ".jsonc", | | 102 | + ".yaml", | | 103 | + ".yml", | | 104 | + ".toml", | | 105 | + ".xml", | | 106 | + ".md", | | 107 | + ".mdx", | | 108 | + ".graphql", | | 109 | + ".gql", | | 110 | + ], | | 111 | + async enabled() { | | 112 | + const app = App.info() | | 113 | + const items = await Filesystem.findUp("biome.json", app.path.cwd, app.path.root) | | 114 | + return items.length > 0 | | 115 | + }, | | 116 | +} | | 117 | + | 76 | 118 | export const zig: Info = { | 77 | 119 | name: "zig", | 78 | 120 | command: ["zig", "fmt", "$FILE"], | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/server/server.ts +26Lines changed: 26 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -94,6 +94,7 @@ export namespace Server { | 94 | 94 | "/event", | 95 | 95 | describeRoute({ | 96 | 96 | description: "Get events", | | 97 | + operationId: "event.subscribe", | 97 | 98 | responses: { | 98 | 99 | 200: { | 99 | 100 | description: "Event stream", | @@ -137,6 +138,7 @@ export namespace Server { | 137 | 138 | "/app", | 138 | 139 | describeRoute({ | 139 | 140 | description: "Get app info", | | 141 | + operationId: "app.get", | 140 | 142 | responses: { | 141 | 143 | 200: { | 142 | 144 | description: "200", | @@ -156,6 +158,7 @@ export namespace Server { | 156 | 158 | "/app/init", | 157 | 159 | describeRoute({ | 158 | 160 | description: "Initialize the app", | | 161 | + operationId: "app.init", | 159 | 162 | responses: { | 160 | 163 | 200: { | 161 | 164 | description: "Initialize the app", | @@ -176,6 +179,7 @@ export namespace Server { | 176 | 179 | "/config", | 177 | 180 | describeRoute({ | 178 | 181 | description: "Get config info", | | 182 | + operationId: "config.get", | 179 | 183 | responses: { | 180 | 184 | 200: { | 181 | 185 | description: "Get config info", | @@ -195,6 +199,7 @@ export namespace Server { | 195 | 199 | "/session", | 196 | 200 | describeRoute({ | 197 | 201 | description: "List all sessions", | | 202 | + operationId: "session.list", | 198 | 203 | responses: { | 199 | 204 | 200: { | 200 | 205 | description: "List of sessions", | @@ -216,6 +221,7 @@ export namespace Server { | 216 | 221 | "/session", | 217 | 222 | describeRoute({ | 218 | 223 | description: "Create a new session", | | 224 | + operationId: "session.create", | 219 | 225 | responses: { | 220 | 226 | ...ERRORS, | 221 | 227 | 200: { | @@ -237,6 +243,7 @@ export namespace Server { | 237 | 243 | "/session/:id", | 238 | 244 | describeRoute({ | 239 | 245 | description: "Delete a session and all its data", | | 246 | + operationId: "session.delete", | 240 | 247 | responses: { | 241 | 248 | 200: { | 242 | 249 | description: "Successfully deleted session", | @@ -263,6 +270,7 @@ export namespace Server { | 263 | 270 | "/session/:id/init", | 264 | 271 | describeRoute({ | 265 | 272 | description: "Analyze the app and create an AGENTS.md file", | | 273 | + operationId: "session.init", | 266 | 274 | responses: { | 267 | 275 | 200: { | 268 | 276 | description: "200", | @@ -299,6 +307,7 @@ export namespace Server { | 299 | 307 | "/session/:id/abort", | 300 | 308 | describeRoute({ | 301 | 309 | description: "Abort a session", | | 310 | + operationId: "session.abort", | 302 | 311 | responses: { | 303 | 312 | 200: { | 304 | 313 | description: "Aborted session", | @@ -324,6 +333,7 @@ export namespace Server { | 324 | 333 | "/session/:id/share", | 325 | 334 | describeRoute({ | 326 | 335 | description: "Share a session", | | 336 | + operationId: "session.share", | 327 | 337 | responses: { | 328 | 338 | 200: { | 329 | 339 | description: "Successfully shared session", | @@ -352,6 +362,7 @@ export namespace Server { | 352 | 362 | "/session/:id/share", | 353 | 363 | describeRoute({ | 354 | 364 | description: "Unshare the session", | | 365 | + operationId: "session.unshare", | 355 | 366 | responses: { | 356 | 367 | 200: { | 357 | 368 | description: "Successfully unshared session", | @@ -380,6 +391,7 @@ export namespace Server { | 380 | 391 | "/session/:id/summarize", | 381 | 392 | describeRoute({ | 382 | 393 | description: "Summarize the session", | | 394 | + operationId: "session.summarize", | 383 | 395 | responses: { | 384 | 396 | 200: { | 385 | 397 | description: "Summarized session", | @@ -415,6 +427,7 @@ export namespace Server { | 415 | 427 | "/session/:id/message", | 416 | 428 | describeRoute({ | 417 | 429 | description: "List messages for a session", | | 430 | + operationId: "session.messages", | 418 | 431 | responses: { | 419 | 432 | 200: { | 420 | 433 | description: "List of messages", | @@ -448,6 +461,7 @@ export namespace Server { | 448 | 461 | "/session/:id/message", | 449 | 462 | describeRoute({ | 450 | 463 | description: "Create and send a new message to a session", | | 464 | + operationId: "session.chat", | 451 | 465 | responses: { | 452 | 466 | 200: { | 453 | 467 | description: "Created message", | @@ -477,6 +491,7 @@ export namespace Server { | 477 | 491 | "/session/:id/revert", | 478 | 492 | describeRoute({ | 479 | 493 | description: "Revert a message", | | 494 | + operationId: "session.revert", | 480 | 495 | responses: { | 481 | 496 | 200: { | 482 | 497 | description: "Updated session", | @@ -506,6 +521,7 @@ export namespace Server { | 506 | 521 | "/session/:id/unrevert", | 507 | 522 | describeRoute({ | 508 | 523 | description: "Restore all reverted messages", | | 524 | + operationId: "session.unrevert", | 509 | 525 | responses: { | 510 | 526 | 200: { | 511 | 527 | description: "Updated session", | @@ -533,6 +549,7 @@ export namespace Server { | 533 | 549 | "/config/providers", | 534 | 550 | describeRoute({ | 535 | 551 | description: "List all providers", | | 552 | + operationId: "config.providers", | 536 | 553 | responses: { | 537 | 554 | 200: { | 538 | 555 | description: "List of providers", | @@ -561,6 +578,7 @@ export namespace Server { | 561 | 578 | "/find", | 562 | 579 | describeRoute({ | 563 | 580 | description: "Find text in files", | | 581 | + operationId: "find.text", | 564 | 582 | responses: { | 565 | 583 | 200: { | 566 | 584 | description: "Matches", | @@ -593,6 +611,7 @@ export namespace Server { | 593 | 611 | "/find/file", | 594 | 612 | describeRoute({ | 595 | 613 | description: "Find files", | | 614 | + operationId: "find.files", | 596 | 615 | responses: { | 597 | 616 | 200: { | 598 | 617 | description: "File paths", | @@ -625,6 +644,7 @@ export namespace Server { | 625 | 644 | "/find/symbol", | 626 | 645 | describeRoute({ | 627 | 646 | description: "Find workspace symbols", | | 647 | + operationId: "find.symbols", | 628 | 648 | responses: { | 629 | 649 | 200: { | 630 | 650 | description: "Symbols", | @@ -652,6 +672,7 @@ export namespace Server { | 652 | 672 | "/file", | 653 | 673 | describeRoute({ | 654 | 674 | description: "Read a file", | | 675 | + operationId: "file.read", | 655 | 676 | responses: { | 656 | 677 | 200: { | 657 | 678 | description: "File content", | @@ -688,6 +709,7 @@ export namespace Server { | 688 | 709 | "/file/status", | 689 | 710 | describeRoute({ | 690 | 711 | description: "Get file status", | | 712 | + operationId: "file.status", | 691 | 713 | responses: { | 692 | 714 | 200: { | 693 | 715 | description: "File status", | @@ -708,6 +730,7 @@ export namespace Server { | 708 | 730 | "/log", | 709 | 731 | describeRoute({ | 710 | 732 | description: "Write a log entry to the server logs", | | 733 | + operationId: "app.log", | 711 | 734 | responses: { | 712 | 735 | 200: { | 713 | 736 | description: "Log entry written successfully", | @@ -757,6 +780,7 @@ export namespace Server { | 757 | 780 | "/mode", | 758 | 781 | describeRoute({ | 759 | 782 | description: "List all modes", | | 783 | + operationId: "app.modes", | 760 | 784 | responses: { | 761 | 785 | 200: { | 762 | 786 | description: "List of modes", | @@ -777,6 +801,7 @@ export namespace Server { | 777 | 801 | "/tui/append-prompt", | 778 | 802 | describeRoute({ | 779 | 803 | description: "Append prompt to the TUI", | | 804 | + operationId: "tui.appendPrompt", | 780 | 805 | responses: { | 781 | 806 | 200: { | 782 | 807 | description: "Prompt processed successfully", | @@ -800,6 +825,7 @@ export namespace Server { | 800 | 825 | "/tui/open-help", | 801 | 826 | describeRoute({ | 802 | 827 | description: "Open the help dialog", | | 828 | + operationId: "tui.openHelp", | 803 | 829 | responses: { | 804 | 830 | 200: { | 805 | 831 | description: "Help dialog opened successfully", | |
Collapse file Copy file name to clipboardExpand all lines: packages/sdk/.devcontainer/devcontainer.json -15Lines changed: 0 additions & 15 deletions Collapse file Copy file name to clipboardExpand all lines: packages/sdk/.prettierignore -7Lines changed: 0 additions & 7 deletions Collapse file Copy file name to clipboardExpand all lines: packages/sdk/.prettierrc.json -7Lines changed: 0 additions & 7 deletions
|