Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .oxlintrc.json +51 -0
- .prettierignore +4 -0
- CONTEXT.md +225 -0
- LICENSE +21 -0
- README.ar.md +129 -0
- README.bn.md +129 -0
- README.br.md +129 -0
- README.bs.md +129 -0
- README.da.md +129 -0
- README.de.md +129 -0
- README.es.md +129 -0
- README.fr.md +129 -0
- README.it.md +129 -0
- README.tr.md +129 -0
- README.uk.md +130 -0
- README.zh.md +128 -0
- STATS.md +217 -0
- bunfig.toml +8 -0
- flake.lock +27 -0
- install +460 -0
- packages/cli/bunfig.toml +1 -0
- packages/cli/package.json +36 -0
- packages/cli/sst-env.d.ts +10 -0
- packages/cli/tsconfig.json +10 -0
- packages/client/README.md +27 -0
- packages/client/package.json +39 -0
- packages/client/sst-env.d.ts +10 -0
- packages/client/tsconfig.json +9 -0
- packages/codemode/AGENTS.md +23 -0
- packages/codemode/README.md +369 -0
- packages/codemode/codemode.md +176 -0
- packages/codemode/package.json +26 -0
- packages/codemode/sst-env.d.ts +10 -0
- packages/codemode/tsconfig.json +7 -0
- packages/containers/README.md +38 -0
- packages/containers/tsconfig.json +8 -0
- packages/desktop/.gitignore +29 -0
- packages/desktop/AGENTS.md +14 -0
- packages/desktop/README.md +19 -0
- packages/desktop/electron-builder.config.test.ts +91 -0
- packages/desktop/electron-builder.config.ts +160 -0
- packages/desktop/electron.vite.config.ts +106 -0
- packages/desktop/package.json +76 -0
- packages/desktop/sst-env.d.ts +10 -0
- packages/desktop/tsconfig.json +23 -0
- packages/docs/LICENSE +21 -0
- packages/docs/README.md +44 -0
- packages/docs/development.mdx +96 -0
- packages/docs/docs.json +53 -0
- packages/docs/favicon-v3.svg +19 -0
.oxlintrc.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://raw.githubusercontent.com/nicolo-ribaudo/oxc-project.github.io/refs/heads/json-schema/src/public/.oxlintrc.schema.json",
|
| 3 |
+
"options": {
|
| 4 |
+
"typeAware": true
|
| 5 |
+
},
|
| 6 |
+
"categories": {
|
| 7 |
+
"suspicious": "warn"
|
| 8 |
+
},
|
| 9 |
+
"rules": {
|
| 10 |
+
"typescript/no-base-to-string": "warn",
|
| 11 |
+
// Effect uses `function*` with Effect.gen/Effect.fnUntraced that don't always yield
|
| 12 |
+
"require-yield": "off",
|
| 13 |
+
// SolidJS uses `let ref: T | undefined` for JSX ref bindings assigned at runtime
|
| 14 |
+
"no-unassigned-vars": "off",
|
| 15 |
+
// SolidJS tracks reactive deps by reading properties inside createEffect
|
| 16 |
+
"no-unused-expressions": "off",
|
| 17 |
+
// Intentional control char matching (ANSI escapes, null byte sanitization)
|
| 18 |
+
"no-control-regex": "off",
|
| 19 |
+
// SST and plugin tools require triple-slash references
|
| 20 |
+
"triple-slash-reference": "off",
|
| 21 |
+
|
| 22 |
+
// Suspicious category: suppress noisy rules
|
| 23 |
+
// Effect's nested function* closures inherently shadow outer scope
|
| 24 |
+
"no-shadow": "off",
|
| 25 |
+
// Namespace-heavy codebase makes this too noisy
|
| 26 |
+
"unicorn/consistent-function-scoping": "off",
|
| 27 |
+
// Opinionated — .sort()/.reverse() mutation is fine in this codebase
|
| 28 |
+
"unicorn/no-array-sort": "off",
|
| 29 |
+
"unicorn/no-array-reverse": "off",
|
| 30 |
+
// Not relevant — this isn't a DOM event handler codebase
|
| 31 |
+
"unicorn/prefer-add-event-listener": "off",
|
| 32 |
+
// Bundler handles module resolution
|
| 33 |
+
"unicorn/require-module-specifiers": "off",
|
| 34 |
+
// postMessage target origin not relevant for this codebase
|
| 35 |
+
"unicorn/require-post-message-target-origin": "off",
|
| 36 |
+
// Side-effectful constructors are intentional in some places
|
| 37 |
+
"no-new": "off",
|
| 38 |
+
|
| 39 |
+
// Type-aware: catch unhandled promises
|
| 40 |
+
"typescript/no-floating-promises": "warn",
|
| 41 |
+
// Warn when spreading non-plain objects (Headers, class instances, etc.)
|
| 42 |
+
"typescript/no-misused-spread": "warn"
|
| 43 |
+
},
|
| 44 |
+
"options": {
|
| 45 |
+
"typeAware": true
|
| 46 |
+
},
|
| 47 |
+
"options": {
|
| 48 |
+
"typeAware": true
|
| 49 |
+
},
|
| 50 |
+
"ignorePatterns": ["**/node_modules", "**/dist", "**/.build", "**/.sst", "**/*.d.ts", "**/sdk.gen.ts"]
|
| 51 |
+
}
|
.prettierignore
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
sst-env.d.ts
|
| 2 |
+
packages/desktop/src/bindings.ts
|
| 3 |
+
packages/client/src/generated/
|
| 4 |
+
packages/client/src/generated-effect/
|
CONTEXT.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenCode Session Runtime
|
| 2 |
+
|
| 3 |
+
OpenCode sessions preserve durable conversational history while assembling the runtime context an agent needs to act correctly in its current environment.
|
| 4 |
+
|
| 5 |
+
## Language
|
| 6 |
+
|
| 7 |
+
**System Context**:
|
| 8 |
+
The structured collection of contextual facts presented to the model as initial instructions and chronological updates.
|
| 9 |
+
_Avoid_: System prompt
|
| 10 |
+
|
| 11 |
+
**Session History**:
|
| 12 |
+
The projected chronological conversation selected for a provider turn after applying the active compaction and **Context Epoch** cutoffs.
|
| 13 |
+
_Avoid_: Session Context
|
| 14 |
+
|
| 15 |
+
**Context Source**:
|
| 16 |
+
One independently observed typed value within the **System Context**, represented by a stable key, JSON codec, infallible loader, pure baseline/update renderers, and an optional removal renderer for dynamic sources.
|
| 17 |
+
_Avoid_: Prompt fragment
|
| 18 |
+
|
| 19 |
+
**System Context Registry**:
|
| 20 |
+
The Location-scoped registry of ordered, scoped producers that contribute to the current **System Context**.
|
| 21 |
+
|
| 22 |
+
**Mid-Conversation System Message**:
|
| 23 |
+
A durable chronological instruction that tells the model the newly effective state of a changed **Context Source**.
|
| 24 |
+
_Avoid_: System update, system notification, raw text diff
|
| 25 |
+
|
| 26 |
+
**Context Epoch**:
|
| 27 |
+
The span during which one initially rendered **System Context** remains the immutable provider-cache baseline, ending at completed compaction, Session movement, or an incompatible context transition that requires a fresh baseline.
|
| 28 |
+
|
| 29 |
+
**Baseline System Context**:
|
| 30 |
+
The full **System Context** rendered at the start of a **Context Epoch**.
|
| 31 |
+
_Avoid_: Live system prompt
|
| 32 |
+
|
| 33 |
+
**Context Snapshot**:
|
| 34 |
+
The overwriteable model-hidden JSON state used to compare each **Context Source** with the value last admitted to a provider turn.
|
| 35 |
+
|
| 36 |
+
**Unavailable Context**:
|
| 37 |
+
An expected temporary inability to observe a **Context Source** value; the runtime retains its prior effective state and emits no update, or omits it until first successfully loaded.
|
| 38 |
+
|
| 39 |
+
**Safe Provider-Turn Boundary**:
|
| 40 |
+
The point immediately before a provider call, after durable input promotion and any required tool settlement, where context changes may be admitted chronologically.
|
| 41 |
+
|
| 42 |
+
**Admitted Prompt**:
|
| 43 |
+
A durable user input accepted into the Session inbox but not yet included in **Session History**.
|
| 44 |
+
|
| 45 |
+
**Prompt Promotion**:
|
| 46 |
+
The durable transition that removes an **Admitted Prompt** from pending input and appends its user message to **Session History**.
|
| 47 |
+
|
| 48 |
+
**Provider Turn**:
|
| 49 |
+
One request to a model provider and the response projected from that request.
|
| 50 |
+
|
| 51 |
+
**Session Drain**:
|
| 52 |
+
One process-local execution span that promotes eligible input and runs required **Provider Turns** until no immediate continuation remains. A Session Drain has no durable identity or transcript boundary.
|
| 53 |
+
|
| 54 |
+
**Model Tool Output**:
|
| 55 |
+
The bounded projection of a Core-executed tool result persisted in Session history and replayed to the model. A tool may shape this projection semantically, but the Tool Registry enforces the final size limit.
|
| 56 |
+
|
| 57 |
+
**Managed Tool Output File**:
|
| 58 |
+
A temporary file created under OpenCode's shared tool-output directory to retain complete output that was too large for Session history.
|
| 59 |
+
|
| 60 |
+
**Model Request Options**:
|
| 61 |
+
Provider-semantic model settings selected from the Catalog and active Session variant before the LLM protocol adapter encodes them for a provider request.
|
| 62 |
+
_Avoid_: Request body, wire options
|
| 63 |
+
|
| 64 |
+
**Generation Controls**:
|
| 65 |
+
Provider-neutral sampling and output controls, partitioned from provider semantics and compatibility wire fields when model metadata enters the Catalog.
|
| 66 |
+
|
| 67 |
+
**Native Continuation Metadata**:
|
| 68 |
+
Opaque protocol-shaped data attached to assistant content and required to continue that content natively with a compatible model, such as a reasoning signature or provider-hosted item identifier.
|
| 69 |
+
|
| 70 |
+
**PTY Environment**:
|
| 71 |
+
The host-supplied environment overlay applied by the server when creating a PTY, observed for the request Location and resolved PTY working directory.
|
| 72 |
+
|
| 73 |
+
**OpenCode Client**:
|
| 74 |
+
The generated Promise and Effect APIs derived from the public `HttpApi`; **Embedded OpenCode** shares the Effect API through an in-memory `HttpClient` against the same router and handlers.
|
| 75 |
+
_Avoid_: Remote client
|
| 76 |
+
|
| 77 |
+
**SDK Contract IR**:
|
| 78 |
+
The runtime-neutral compiled representation of the authoritative `HttpApi`, preserving encoded and decoded type projections plus transport metadata so independent SDK emitters can choose their public value model and runtime interpreter.
|
| 79 |
+
|
| 80 |
+
**Embedded OpenCode**:
|
| 81 |
+
A scoped in-process host that structurally extends the **OpenCode Client**, supplies an in-memory HTTP transport, and exposes additional same-process capabilities directly.
|
| 82 |
+
_Avoid_: Local implementation
|
| 83 |
+
|
| 84 |
+
**Page**:
|
| 85 |
+
A bounded ordered result containing `items` and opaque `previous` and `next` cursor links for navigating the same query in either direction.
|
| 86 |
+
_Avoid_: Response envelope
|
| 87 |
+
|
| 88 |
+
## Relationships
|
| 89 |
+
|
| 90 |
+
- A **System Context** is an opaque carrier composed from zero or more **Context Sources**.
|
| 91 |
+
- **Session History** contains projected conversational messages and admitted **Mid-Conversation System Messages**; the active **Baseline System Context** remains separate provider-request state.
|
| 92 |
+
- The **System Context Registry** uses stable-keyed scoped contributions to assemble the current **System Context**; contributor removal naturally removes its sources at the next **Safe Provider-Turn Boundary**.
|
| 93 |
+
- A changed **Context Source** may produce one **Mid-Conversation System Message** containing its newly effective state.
|
| 94 |
+
- A **Mid-Conversation System Message** persists the exact combined rendered text sent to the model.
|
| 95 |
+
- The current **Context Snapshot** advances atomically with the corresponding durable **Mid-Conversation System Message**.
|
| 96 |
+
- A **Context Snapshot** stores one codec-encoded JSON value and, for removable dynamic sources, a pre-rendered removal message per stable **Context Source** key.
|
| 97 |
+
- Changes from multiple **Context Sources** admitted at one safe boundary combine into one **Mid-Conversation System Message**.
|
| 98 |
+
- Context changes are sampled and admitted lazily at a **Safe Provider-Turn Boundary**, never pushed asynchronously when their source changes.
|
| 99 |
+
- At a **Safe Provider-Turn Boundary**, newly promoted user input or settled tool results precede any combined **Mid-Conversation System Message**.
|
| 100 |
+
- An **Admitted Prompt** is replayable pending input, not yet model-visible **Session History**.
|
| 101 |
+
- **Prompt Promotion** atomically consumes the pending inbox entry and appends its model-visible user message.
|
| 102 |
+
- Steering prompts promote at the next **Safe Provider-Turn Boundary** while the current **Session Drain** still requires continuation. Promoting any newly admitted user input resets the selected agent's provider-turn allowance; multiple prompts promoted at one boundary reset it once.
|
| 103 |
+
- A queued prompt does not promote while the current **Session Drain** requires continuation. The runner promotes one queued prompt when the Session would otherwise become idle, then reevaluates continuation before promoting another.
|
| 104 |
+
- A **Session Drain** is process-local coordination rather than a durable domain entity. Durable recovery must reason from prompts, projected history, provider attempts, and tool state rather than inventing an enclosing execution identity.
|
| 105 |
+
- The first provider turn renders the latest complete **Baseline System Context** and initializes its **Context Snapshot** without emitting a redundant **Mid-Conversation System Message**; unavailable initial context blocks the turn instead of persisting an incomplete baseline.
|
| 106 |
+
- Initial **System Context** preparation precedes the first durable input promotion so an unavailable baseline leaves that input pending and retryable; ordinary reconciliation remains after promotion.
|
| 107 |
+
- Compaction starts a new **Context Epoch** with a freshly rendered **Baseline System Context** and **Context Snapshot**; prior **Mid-Conversation System Messages** remain durable audit history but leave projected model history.
|
| 108 |
+
- A newly registered core or plugin-defined **Context Source** absent from the current snapshot emits its baseline rendering once at the next **Safe Provider-Turn Boundary**.
|
| 109 |
+
- **Context Source** keys are stable and namespaced; duplicate keys fail composition. `SystemContext.combine(...)` preserves caller order; the **System Context Registry** evaluates producers concurrently and combines them in stable contribution-key order so rendered context remains deterministic.
|
| 110 |
+
- Each **Context Source** loader returns one coherent typed value. `SystemContext.make(...)` hides that value type so differently typed sources compose uniformly. Its codec compares and stores that value; its pure renderers produce model-visible baseline, update, and removal text only when needed.
|
| 111 |
+
- `SystemContext.initialize(...)` observes a composed **System Context** once and produces a fresh **Baseline System Context** with its **Context Snapshot**.
|
| 112 |
+
- `SystemContext.reconcile(...)` observes a composed **System Context** once and returns exactly one next action: unchanged, updated, replacement ready, or replacement blocked.
|
| 113 |
+
- `SystemContext.replace(...)` renders a fresh generation after completed compaction or another baseline-replacing transition; it reports replacement blocked while previously admitted context is unavailable.
|
| 114 |
+
- **Unavailable Context** uses stale-while-revalidate semantics and is distinct from a successfully loaded absence, which may emit removal text.
|
| 115 |
+
- Ordinary **Context Source** loaders return values directly; loaders that intentionally use stale-while-revalidate may explicitly return **Unavailable Context**.
|
| 116 |
+
- Nested project instruction discovery after successful reads remains a follow-up; when implemented, discovered instructions must be admitted durably at the next **Safe Provider-Turn Boundary**.
|
| 117 |
+
- Location-scoped services naturally re-resolve effective context when a moved session next runs in its destination location.
|
| 118 |
+
- Moving a Session clears its active **Context Epoch**, so the destination must initialize a complete baseline before another prompt can promote.
|
| 119 |
+
- Instruction discovery, source identity, persistence, and file loading belong to the instruction service; the **System Context** abstraction only composes effectful producers and renders loaded values.
|
| 120 |
+
- The first instruction-service slice observes global and upward project `AGENTS.md` files as one ordered aggregate **Context Source** at each **Safe Provider-Turn Boundary**.
|
| 121 |
+
- Built-in and instruction context producers register through the **System Context Registry** with stable contribution keys. Plugin-defined context registration and hot-reload lifecycle remain a follow-up built on the same scoped registry seam.
|
| 122 |
+
- Selected-agent available-skill guidance is a **Context Source** composed with Location-wide registry sources immediately before Context Epoch admission. It lists only names and descriptions permitted for that agent; skill bodies and locations are exposed only through the permission-checked `skill` tool.
|
| 123 |
+
- The selected agent and model are sampled when a provider turn starts. Changes admitted after that boundary apply to the next provider turn and do not restart the current turn.
|
| 124 |
+
- Selected-agent available-skill guidance remains a **Context Source**. An agent switch that changes that guidance produces a **Mid-Conversation System Message** while preserving the current baseline.
|
| 125 |
+
- Local tool authorization and pending permission requests retain the effective agent of the provider turn that issued the call; a later agent switch cannot change that call's policy.
|
| 126 |
+
- Context source changes never wake idle sessions; the next naturally scheduled **Safe Provider-Turn Boundary** loads and compares current values lazily.
|
| 127 |
+
- Once admitted, a **Mid-Conversation System Message** remains durable even if the following provider attempt fails and is replayed unchanged on retry.
|
| 128 |
+
- **Mid-Conversation System Messages** remain durable Session-message history; normal user-facing transcript surfaces may hide them.
|
| 129 |
+
- The date **Context Source** initially preserves host-local calendar-date behavior; a configured user timezone may replace that default later.
|
| 130 |
+
- A **Context Epoch** begins with one immutable **Baseline System Context**.
|
| 131 |
+
- A **Baseline System Context** is stored durably and reused verbatim across process restarts within its **Context Epoch**.
|
| 132 |
+
- A **Baseline System Context** durably preserves the exact joined text used for the active provider-cache prefix.
|
| 133 |
+
- Completed compaction starts a new **Context Epoch** on the next provider attempt, folding the current complete **System Context** into a fresh baseline and removing earlier **Mid-Conversation System Messages** from active model history.
|
| 134 |
+
- A model/provider switch preserves the current **Context Epoch** and chronological conversation history; the new selection applies to the next provider turn.
|
| 135 |
+
- **Native Continuation Metadata** remains in durable history. Provider-turn projection includes it only for a successful exact originating provider/model match; failed turns and incompatible models omit opaque metadata, while non-empty visible reasoning lowers to ordinary assistant text after a model switch. This conservative relation may widen only when recorded provider tests establish compatibility.
|
| 136 |
+
- **Model Request Options** remain provider-semantic through Catalog resolution. The Session runner maps them into the LLM package's provider-option namespace; the selected protocol adapter alone owns provider wire encoding.
|
| 137 |
+
- **Generation Controls**, protocol-semantic **Model Request Options**, and compatibility request body fields are separate Catalog domains. A shared ingestion adapter partitions legacy and models.dev AI-SDK-shaped options before routing.
|
| 138 |
+
- The **PTY Environment** is a server concern rather than a Core PTY concern. PTY creation merges caller values, then the host overlay, then Core-forced terminal invariants such as `TERM` and `OPENCODE_TERMINAL`.
|
| 139 |
+
- Networked and **Embedded OpenCode** use the same **OpenCode Client** and preserve the full HTTP encoding, routing, middleware, and decoding boundary; only the `HttpClient` transport differs.
|
| 140 |
+
- The Effect-native network constructor obtains `HttpClient.HttpClient` from its environment so callers own transport selection, recording, tracing, retries, and tests. Convenience runtimes may provide a fetch transport separately.
|
| 141 |
+
- Creating **Embedded OpenCode** is scoped. Closing its owning Scope releases the in-process server resources, database resources, registrations, and fibers.
|
| 142 |
+
- **Embedded OpenCode** exposes shared client capabilities and embedded-only capabilities on one object; consumers do not navigate through a nested `.client` property.
|
| 143 |
+
- The beta **OpenCode Client** currently uses plural consumer-facing capability groups such as `sessions`; whether the stable Session namespace should instead be singular `session` must be settled before stabilization. Internal server identifiers do not implicitly define public client names.
|
| 144 |
+
- Server's concrete `HttpApi` is authoritative for shared **OpenCode Client** capabilities. Codegen compiles its Session group directly; the Effect runtime uses an equivalent Protocol-only projection so generated artifacts remain independent of Core and Server.
|
| 145 |
+
- SDK generation reflects the public `HttpApi` once into an **SDK Contract IR**. Promise and Effect emitters share endpoint structure and transport metadata without being required to expose identical public values: an emitter may select encoded wire types, decoded domain types, compile-time brands, runtime validation, and its own execution abstraction independently.
|
| 146 |
+
- The first Effect emitter is the rich projection: it exposes decoded Effect-native values, preserves brands and schema transformations, performs runtime schema decoding, and delegates transport interpretation to `HttpApiClient`. Lighter wire-shaped Effect output remains possible through another emitter policy rather than constraining the shared IR.
|
| 147 |
+
- The rich Effect emitter regenerates private executable schemas when the **SDK Contract IR** proves that their transport semantics can be reproduced exactly. Contracts with authoritative custom transformations use the import-based Effect emitter against a Protocol-only client projection whose generated transport output is tested against Server's concrete API; the Promise emitter still derives zero-Effect structural wire types from the same IR.
|
| 148 |
+
- `@opencode-ai/protocol` owns Session endpoint construction and middleware placement. Server supplies concrete middleware keys to produce the authoritative build-time API; the client projection supplies transport-only keys without importing Core or Server at runtime.
|
| 149 |
+
- The first Promise emitter targets the same clean domain-oriented method organization rather than Hey API source compatibility. It returns unwrapped values directly, rejects declared and infrastructure failures, and begins with minimal client-level transport configuration; result wrappers, interceptors, and legacy generated signatures are outside the initial surface.
|
| 150 |
+
- The first Promise emitter parses response syntax and trusts its generated structural types; it does not perform runtime structural validation. Malformed payload syntax fails, while a syntactically valid shape mismatch is not detected at the SDK boundary. Standalone validator generation remains an optional future emitter policy.
|
| 151 |
+
- Declared Promise-client failures retain their tagged structural wire values and have generated type guards. Consumers do not depend on generated `Error` subclass identity, preserving discrimination across package copies and realms while remaining structurally aligned with Effect domain errors.
|
| 152 |
+
- Promise-client infrastructure failures use one generated `ClientError` class with a structured reason such as transport failure, unexpected status, unsupported content type, or malformed response. Promise methods reject with either a tagged declared domain failure or `ClientError`, matching the Effect client's conceptual domain/infrastructure error division.
|
| 153 |
+
- Promise methods accept a separate optional per-call transport-options argument containing `AbortSignal` and header overrides. Cancellation and transport metadata do not enter the domain input object; broader interceptor and response-mode APIs remain deferred.
|
| 154 |
+
- Promise streaming methods return a lazy `AsyncIterable` directly rather than a Promise-wrapped stream object. Iteration opens the connection, `AbortSignal` cancels it, and ending iteration closes the underlying request; the Effect emitter analogously returns `Stream` directly.
|
| 155 |
+
- Promise SSE connection establishment, declared HTTP failures, and infrastructure failures occur during `AsyncIterable` iteration, beginning with its first `next()` call, rather than during synchronous method construction.
|
| 156 |
+
- Neither generated streaming runtime automatically reconnects after disconnection. Promise `AsyncIterable` and Effect `Stream` fail explicitly; live consumers refresh and resubscribe, while durable sequence-based resume remains explicit composition above the generated client.
|
| 157 |
+
- Promise client construction is synchronous and network-free. It requires `baseUrl`, defaults to `globalThis.fetch`, accepts client-level headers, and merges them with per-call header overrides.
|
| 158 |
+
- Effect client construction accepts an explicit `baseUrl` and obtains `HttpClient.HttpClient` from the Effect environment. It does not install fetch or duplicate per-call transport policy; callers transform/provide the client for headers, tracing, retries, recording, and tests, while fiber interruption owns cancellation.
|
| 159 |
+
- Promise and Effect emitters each own their generated public type modules. The **SDK Contract IR**, not a physically shared generated type package, is the common source; this permits zero-Effect wire types and rich decoded Effect types to evolve independently.
|
| 160 |
+
- Promise and Effect network clients ship from `@opencode-ai/client` behind isolated root and `/effect` exports. The root has no runtime path to Effect; `/effect` imports only Effect, Schema, and Protocol.
|
| 161 |
+
- The Effect-native scoped host belongs to `@opencode-ai/sdk-next`, which will assume the existing `@opencode-ai/sdk` name after legacy consumers migrate. Client remains network-only and SDK depends one-way on Client.
|
| 162 |
+
- SDK executes Server's assembled `HttpRouter` in memory. It opens no listener and performs no network I/O, while preserving Server routing, middleware, codecs, handlers, and errors.
|
| 163 |
+
- The Effect Client and SDK re-export their decoded datatype facade from Schema so callers do not depend on internal package locations or Core's versioned names.
|
| 164 |
+
- A capability intended for both networked and **Embedded OpenCode** belongs in the authoritative public `HttpApi`; embedded-only same-process capabilities extend **Embedded OpenCode** separately.
|
| 165 |
+
- `sessions.events({ sessionID, after })` is a public durable Session event stream. It verifies the Session, replays durable events after the optional aggregate sequence, continues with newly committed durable events, excludes live-only fragments, and is transported as SSE in both networked and embedded modes.
|
| 166 |
+
- `events.subscribe()` is a distinct public instance-wide live stream for Session and non-Session activity. It has no replay guarantee and includes connection, heartbeat, and instance-disposal lifecycle events; consumers recover from disconnection by refreshing authoritative state.
|
| 167 |
+
- A Session ID is not an optional filter on `events.subscribe()`: instance-wide live events and durable Session events have different schemas, replay guarantees, cursors, lifecycle events, and failure behavior.
|
| 168 |
+
- The initial common OpenCode Client does not expose server-global event aggregation. `events.subscribe()` is bounded to the connected OpenCode instance or workspace; any future cross-instance administrative stream requires a separately designed API.
|
| 169 |
+
- `events.subscribe()` does not automatically reconnect after transport loss. The live-only stream fails with `ClientError`; consumers refresh authoritative state before explicitly opening a new subscription because events missed during disconnection cannot be replayed.
|
| 170 |
+
- `sessions.events({ sessionID, after })` returns the generated HTTP client's cold durable event stream and does not build reconnection policy into the endpoint or client constructor. Transport loss fails the stream with `ClientError`. Callers may compose an explicit resuming stream above it by retaining the last observed durable sequence and opening a new subscription with `after`; any reusable resume helper remains a separate API design question.
|
| 171 |
+
- The stable `sessions.list(...)` design returns a **Page** in both networked and **Embedded OpenCode**; embedded execution does not define a separate unbounded array-returning list operation. The beta client currently preserves the existing HTTP `{ data, cursor }` envelope until emitter-level Page projection is implemented.
|
| 172 |
+
- Session list cursors are opaque branded values carrying continuation query and ordering state. Consumers pass them back unchanged and do not inspect storage anchors or encoded filter fields.
|
| 173 |
+
- A Session list continuation accepts only its opaque cursor. Scope, filters, ordering, and page size are fixed by the initial query and carried by that cursor.
|
| 174 |
+
- `sessions.messages(...)` returns a **Page** and uses the same cursor discipline as `sessions.list(...)`: the initial request supplies `sessionID`, ordering, and page size; continuation supplies `sessionID` plus only an opaque branded message cursor carrying ordering, page size, direction, and message anchor. Using a cursor with another Session is invalid.
|
| 175 |
+
- `sessions.message({ sessionID, messageID })` is a required resource lookup. An unknown Session fails with `SessionNotFoundError`; a known Session with an absent or differently owned message fails with `MessageNotFoundError` without disclosing cross-Session ownership. Absence is not represented as `undefined` across the public HTTP boundary.
|
| 176 |
+
- `sessions.interrupt({ sessionID })` first verifies that the durable Session exists, failing with `SessionNotFoundError` otherwise. For a known Session, interruption is idempotent: idle, already-settled, or locally unowned execution is a no-op.
|
| 177 |
+
- `sessions.active()` snapshots the current process's foreground Session drain registry as a record of Session IDs to `{ type: "running" }`. Missing IDs are inactive; background subagents and tasks do not make their parent Session active, and process restart clears the registry.
|
| 178 |
+
- `sessions.context({ sessionID })` preserves the existing message-only operation. It returns projected conversational messages selected as Session context; it does not include or represent the complete provider request context, whose baseline system context and other contributions remain separate.
|
| 179 |
+
- **Open question**: Should a future, separately named operation expose the complete provider request context, including baseline system context, selected source contributions, and context-epoch metadata?
|
| 180 |
+
- `sessions.prompt(...)` exposes `resume?: boolean`. Omitting it preserves durable admission followed by an advisory execution wake; `resume: false` requests durable admit-only behavior.
|
| 181 |
+
- The public operation remains `sessions.prompt(...)`; `SessionInput.admit` is the internal primitive, while the public `Admission` result and `resume` option express its durable admission semantics.
|
| 182 |
+
- `sessions.create(...)` accepts an optional `location`. Omission resolves through the connected OpenCode instance's default or current location; an explicit value selects a known location. Networked and embedded transports use the same handler semantics.
|
| 183 |
+
- `sessions.switchAgent({ sessionID, agent })` is part of the common client alongside `sessions.switchModel(...)`. It affects subsequent Session activity and fails with `SessionNotFoundError` for an unknown Session.
|
| 184 |
+
- The **Embedded OpenCode** Layer delegates to the same scoped creation path; it does not define a second implementation.
|
| 185 |
+
- A **PTY Environment** adapter observes plugins in the request Location while passing the resolved PTY working directory to the hook; standalone servers use an empty adapter.
|
| 186 |
+
- A **Mid-Conversation System Message** lowers to the provider's native chronological instruction role when supported and to a wrapped chronological fallback otherwise.
|
| 187 |
+
- When the effective aggregate instruction set changes, its **Mid-Conversation System Message** includes the complete current ordered set and supersedes the prior aggregate value; when no ambient instructions remain, the message states that previously loaded instructions no longer apply.
|
| 188 |
+
- Ambient project instruction discovery honors `OPENCODE_DISABLE_PROJECT_CONFIG`; global instructions remain eligible.
|
| 189 |
+
- Oversized textual **Model Tool Output** retains a bounded preview in Session history while its complete text moves to managed tool-output storage. Arbitrary structured-result size is a separate concern.
|
| 190 |
+
- One tool settlement receives one aggregate textual limit, using the configured maximum lines or UTF-8 bytes, whichever is reached first. The limit is provider-independent; token pressure belongs to context assembly and compaction.
|
| 191 |
+
- Generic truncation preserves the beginning and end of textual output. Tools may apply a more meaningful strategy before the Tool Registry enforces the final limit.
|
| 192 |
+
- A truncated **Model Tool Output** identifies its complete text both in the bounded model-visible preview and as a typed managed output path. Managed output paths do not modify the tool's validated structured result.
|
| 193 |
+
- A **Managed Tool Output File** is temporary and may expire after its retention period. The bounded **Model Tool Output**, not the file, is the durable replayable record.
|
| 194 |
+
- Failure to retain a **Managed Tool Output File** does not change a successful tool operation into a failed one. The Session records an explicitly lossy bounded output without a path, while operators receive diagnostics for the storage failure.
|
| 195 |
+
- Once a tool operation succeeds, bounding its **Model Tool Output** and publishing its one durable settlement form an interruption-safe completion region. Raw oversized success is never published before a later correction.
|
| 196 |
+
- When a structured-only result would exceed the **Model Tool Output** limit, its validated structured value remains unchanged for Session consumers while model replay uses a bounded textual JSON preview and optional managed output path.
|
| 197 |
+
- Existing tool-managed output paths survive generic bounding. A fallback file retains exactly the complete projected text received by the Tool Registry and never claims to reconstruct output already discarded by tool-specific shaping.
|
| 198 |
+
- **Managed Tool Output Files** use globally unique names in one shared flat directory. Their absolute paths are readable and searchable by ordinary tools; other absolute paths remain outside Location-scoped filesystem authority.
|
| 199 |
+
- Provider-executed tool results remain provider-native transcript facts outside generic Tool Registry bounding. Their context control requires provider-aware pruning or compaction because some providers require exact structured round-trip payloads.
|
| 200 |
+
|
| 201 |
+
## Client contract architecture
|
| 202 |
+
|
| 203 |
+
Semantic values that mean the same thing internally and publicly live in the lightweight Schema leaf. Core consumes Schema for domain behavior; Protocol composes Schema values into paths, payloads, envelopes, errors, cursors, and streams; Server imports both, hosts Protocol's exact groups, and owns protocol/domain adaptation. The root Promise client remains zero-Effect, `/effect` depends on Effect plus Schema and Protocol, and `@opencode-ai/sdk-next` composes the scoped in-process host above Client, Core, and Server.
|
| 204 |
+
|
| 205 |
+
Shared public records are plain objects declared with `Schema.Struct`. A same-name inferred interface gives object records readable TypeScript signatures without constructors, prototypes, or nominal identity; unions retain explicit type aliases.
|
| 206 |
+
|
| 207 |
+
Before stabilizing the client API:
|
| 208 |
+
|
| 209 |
+
- Keep additional public schemas in Schema and additional network groups in Protocol; neither package may transitively load databases, Drizzle, Session execution, providers, watchers, native modules, or WASM.
|
| 210 |
+
- Keep concrete Location middleware keys in Server while Protocol owns their placement. Client projections may supply transport-only keys, but must prove generated equivalence with Server's concrete API.
|
| 211 |
+
- Project the existing list response envelope to the stable client **Page** shape and enforce separate initial-query and cursor-continuation inputs without changing the hosted V2 wire contract.
|
| 212 |
+
- Settle the stable consumer namespace (`session` versus the current beta `sessions`) and use an explicit codegen annotation if the consumer name should differ from the server group identifier.
|
| 213 |
+
- Preserve V2 route paths, operation IDs, codecs, errors, middleware behavior, and OpenAPI output while making this change.
|
| 214 |
+
- Preserve browser-safe `@opencode-ai/client` and `@opencode-ai/client/effect` bundles through import-boundary tests.
|
| 215 |
+
- Define embedded-host placement before supporting multiple hosts over one database. Hosts that share durable Session storage must also share process-local Session execution coordination, or each host must receive isolated storage explicitly.
|
| 216 |
+
- Keep an embedded request scope alive until any streamed response body finishes. The initial non-streaming Session surface does not exercise this lifetime boundary; Session and instance event streams must do so before joining the embedded client.
|
| 217 |
+
|
| 218 |
+
## Example dialogue
|
| 219 |
+
|
| 220 |
+
> **Dev:** "The date changed while the session was active. Should the **Mid-Conversation System Message** say what the old date was?"
|
| 221 |
+
> **Domain expert:** "No. Emit the newly effective date so the agent can act on the current **System Context**."
|
| 222 |
+
|
| 223 |
+
## Flagged ambiguities
|
| 224 |
+
|
| 225 |
+
- Legacy `experimental.chat.system.transform` can mutate the assembled baseline system prompt arbitrarily, but V2 plugins do not yet expose an equivalent hook. Decide separately whether to port it, replace dynamic uses with plugin-defined **Context Sources**, or narrow its semantics.
|
LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2025 opencode
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.ar.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="شعار OpenCode">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">وكيل برمجة بالذكاء الاصطناعي مفتوح المصدر.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### التثبيت
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# مديري الحزم
|
| 53 |
+
npm i -g opencode-ai@latest # او bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS و Linux (موصى به، دائما محدث)
|
| 57 |
+
brew install opencode # macOS و Linux (صيغة brew الرسمية، تحديث اقل)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # اي نظام
|
| 61 |
+
nix run nixpkgs#opencode # او github:anomalyco/opencode لاحدث فرع dev
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> احذف الاصدارات الاقدم من 0.1.x قبل التثبيت.
|
| 66 |
+
|
| 67 |
+
### تطبيق سطح المكتب (BETA)
|
| 68 |
+
|
| 69 |
+
يتوفر OpenCode ايضا كتطبيق سطح مكتب. قم بالتنزيل مباشرة من [صفحة الاصدارات](https://github.com/anomalyco/opencode/releases) او من [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| المنصة | التنزيل |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb` او `.rpm` او AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### مجلد التثبيت
|
| 86 |
+
|
| 87 |
+
يحترم سكربت التثبيت ترتيب الاولوية التالي لمسار التثبيت:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - مجلد تثبيت مخصص
|
| 90 |
+
2. `$XDG_BIN_DIR` - مسار متوافق مع مواصفات XDG Base Directory
|
| 91 |
+
3. `$HOME/bin` - مجلد الثنائيات القياسي للمستخدم (ان وجد او امكن انشاؤه)
|
| 92 |
+
4. `$HOME/.opencode/bin` - المسار الافتراضي الاحتياطي
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# امثلة
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agents
|
| 101 |
+
|
| 102 |
+
يتضمن OpenCode وكيليْن (Agents) مدمجين يمكنك التبديل بينهما باستخدام زر `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** - الافتراضي، وكيل بصلاحيات كاملة لاعمال التطوير
|
| 105 |
+
- **plan** - وكيل للقراءة فقط للتحليل واستكشاف الكود
|
| 106 |
+
- يرفض تعديل الملفات افتراضيا
|
| 107 |
+
- يطلب الاذن قبل تشغيل اوامر bash
|
| 108 |
+
- مثالي لاستكشاف قواعد كود غير مألوفة او لتخطيط التغييرات
|
| 109 |
+
|
| 110 |
+
بالاضافة الى ذل�� يوجد وكيل فرعي **general** للبحث المعقد والمهام متعددة الخطوات.
|
| 111 |
+
يستخدم داخليا ويمكن استدعاؤه بكتابة `@general` في الرسائل.
|
| 112 |
+
|
| 113 |
+
تعرف على المزيد حول [agents](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### التوثيق
|
| 116 |
+
|
| 117 |
+
لمزيد من المعلومات حول كيفية ضبط OpenCode، [**راجع التوثيق**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### المساهمة
|
| 120 |
+
|
| 121 |
+
اذا كنت مهتما بالمساهمة في OpenCode، يرجى قراءة [contributing docs](./CONTRIBUTING.md) قبل ارسال pull request.
|
| 122 |
+
|
| 123 |
+
### البناء فوق OpenCode
|
| 124 |
+
|
| 125 |
+
اذا كنت تعمل على مشروع مرتبط بـ OpenCode ويستخدم "opencode" كجزء من اسمه (مثل "opencode-dashboard" او "opencode-mobile")، يرجى اضافة ملاحظة في README توضح انه ليس مبنيا بواسطة فريق OpenCode ولا يرتبط بنا بأي شكل.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**انضم الى مجتمعنا** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.bn.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">ওপেন সোর্স এআই কোডিং এজেন্ট।</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### ইনস্টলেশন (Installation)
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Package managers
|
| 53 |
+
npm i -g opencode-ai@latest # or bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
|
| 57 |
+
brew install opencode # macOS and Linux (official brew formula, updated less)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # Any OS
|
| 61 |
+
nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branch
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> ইনস্টল করার আগে ০.১.x এর চেয়ে পুরোনো ভার্সনগুলো মুছে ফেলুন।
|
| 66 |
+
|
| 67 |
+
### ডেস্কটপ অ্যাপ (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode ডেস্কটপ অ্যাপ্লিকেশন হিসেবেও উপলব্ধ। সরাসরি [রিলিজ পেজ](https://github.com/anomalyco/opencode/releases) অথবা [opencode.ai/download](https://opencode.ai/download) থেকে ডাউনলোড করুন।
|
| 70 |
+
|
| 71 |
+
| প্ল্যাটফর্ম | ডাউনলোড |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm`, or `.AppImage` |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### ইনস্টলেশন ডিরেক্টরি (Installation Directory)
|
| 86 |
+
|
| 87 |
+
ইনস্টল স্ক্রিপ্টটি ইনস্টলেশন পাতের জন্য নিম্নলিখিত অগ্রাধিকার ক্রম মেনে চলে:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - কাস্টম ইনস্টলেশন ডিরেক্টরি
|
| 90 |
+
2. `$XDG_BIN_DIR` - XDG বেস ডিরেক্টরি স্পেসিফিকেশন সমর্থিত পাথ
|
| 91 |
+
3. `$HOME/bin` - সাধারণ ব্যবহারকারী বাইনারি ডিরেক্টরি (যদি বিদ্যমান থাকে বা তৈরি করা যায়)
|
| 92 |
+
4. `$HOME/.opencode/bin` - ডিফল্ট ফলব্যাক
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# উদাহরণ
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### এজেন্টস (Agents)
|
| 101 |
+
|
| 102 |
+
OpenCode এ দুট��� বিল্ট-ইন এজেন্ট রয়েছে যা আপনি `Tab` কি(key) দিয়ে পরিবর্তন করতে পারবেন।
|
| 103 |
+
|
| 104 |
+
- **build** - ডিফল্ট, ডেভেলপমেন্টের কাজের জন্য সম্পূর্ণ অ্যাক্সেসযুক্ত এজেন্ট
|
| 105 |
+
- **plan** - বিশ্লেষণ এবং কোড এক্সপ্লোরেশনের জন্য রিড-ওনলি এজেন্ট
|
| 106 |
+
- ডিফল্টভাবে ফাইল এডিট করতে দেয় না
|
| 107 |
+
- ব্যাশ কমান্ড চালানোর আগে অনুমতি চায়
|
| 108 |
+
- অপরিচিত কোডবেস এক্সপ্লোর করা বা পরিবর্তনের পরিকল্পনা করার জন্য আদর্শ
|
| 109 |
+
|
| 110 |
+
এছাড়াও জটিল অনুসন্ধান এবং মাল্টিস্টেপ টাস্কের জন্য একটি **general** সাবএজেন্ট অন্তর্ভুক্ত রয়েছে।
|
| 111 |
+
এটি অভ্যন্তরীণভাবে ব্যবহৃত হয় এবং মেসেজে `@general` লিখে ব্যবহার করা যেতে পারে।
|
| 112 |
+
|
| 113 |
+
এজেন্টদের সম্পর্কে আরও জানুন: [docs](https://opencode.ai/docs/agents)।
|
| 114 |
+
|
| 115 |
+
### ডকুমেন্টেশন (Documentation)
|
| 116 |
+
|
| 117 |
+
কিভাবে OpenCode কনফিগার করবেন সে সম্পর্কে আরও তথ্যের জন্য, [**আমাদের ডকস দেখুন**](https://opencode.ai/docs)।
|
| 118 |
+
|
| 119 |
+
### অবদান (Contributing)
|
| 120 |
+
|
| 121 |
+
আপনি যদি OpenCode এ অবদান রাখতে চান, অনুগ্রহ করে একটি পুল রিকোয়েস্ট সাবমিট করার আগে আমাদের [কন্ট্রিবিউটিং ডকস](./CONTRIBUTING.md) পড়ে নিন।
|
| 122 |
+
|
| 123 |
+
### OpenCode এর উপর বিল্ডিং (Building on OpenCode)
|
| 124 |
+
|
| 125 |
+
আপনি যদি এমন প্রজেক্টে কাজ করেন যা OpenCode এর সাথে সম্পর্কিত এবং প্রজেক্টের নামের অংশ হিসেবে "opencode" ব্যবহার করেন, উদাহরণস্বরূপ "opencode-dashboard" বা "opencode-mobile", তবে দয়া করে আপনার README তে একটি নোট যোগ করে স্পষ্ট করুন যে এই প্রজেক্টটি OpenCode দল দ্বারা তৈরি হয়নি এবং আমাদের সাথে এর কোনো সরাসরি সম্পর্ক নেই।
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**আমাদের কমিউনিটিতে যুক্ত হোন** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.br.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="Logo do OpenCode">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">O agente de programação com IA de código aberto.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Instalação
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Gerenciadores de pacotes
|
| 53 |
+
npm i -g opencode-ai@latest # ou bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS e Linux (recomendado, sempre atualizado)
|
| 57 |
+
brew install opencode # macOS e Linux (fórmula oficial do brew, atualiza menos)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # qualquer sistema
|
| 61 |
+
nix run nixpkgs#opencode # ou github:anomalyco/opencode para a branch dev mais recente
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Remova versões anteriores a 0.1.x antes de instalar.
|
| 66 |
+
|
| 67 |
+
### App desktop (BETA)
|
| 68 |
+
|
| 69 |
+
O OpenCode também está disponível como aplicativo desktop. Baixe diretamente pela [página de releases](https://github.com/anomalyco/opencode/releases) ou em [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Plataforma | Download |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm` ou AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Diretório de instalação
|
| 86 |
+
|
| 87 |
+
O script de instalação respeita a seguinte ordem de prioridade para o caminho de instalação:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Diretório de instalação personalizado
|
| 90 |
+
2. `$XDG_BIN_DIR` - Caminho compatível com a especificação XDG Base Directory
|
| 91 |
+
3. `$HOME/bin` - Diretório binário padrão do usuário (se existir ou puder ser criado)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Fallback padrão
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Exemplos
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agents
|
| 101 |
+
|
| 102 |
+
O OpenCode inclui dois agents integrados, que você pode alternar com a tecla `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** - Padrão, agent com acesso total para trabalho de desenvolvimento
|
| 105 |
+
- **plan** - Agent somente leitura para análise e exploração de código
|
| 106 |
+
- Nega edições de arquivos por padrão
|
| 107 |
+
- Pede permissão antes de executar comandos bash
|
| 108 |
+
- Ideal para explorar codebases desconhecidas ou planejar mudanças
|
| 109 |
+
|
| 110 |
+
Também há um subagent **general** para buscas complexas e tarefas em várias etapas.
|
| 111 |
+
Ele é usado internamente e pode ser invocado com `@general` nas mensagens.
|
| 112 |
+
|
| 113 |
+
Saiba mais sobre [agents](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Documentação
|
| 116 |
+
|
| 117 |
+
Para mais informações sobre como configurar o OpenCode, [**veja nossa documentação**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Contribuir
|
| 120 |
+
|
| 121 |
+
Se você tem interesse em contribuir com o OpenCode, leia os [contributing docs](./CONTRIBUTING.md) antes de enviar um pull request.
|
| 122 |
+
|
| 123 |
+
### Construindo com OpenCode
|
| 124 |
+
|
| 125 |
+
Se você estiver trabalhando em um projeto relacionado ao OpenCode e estiver usando "opencode" como parte do nome (por exemplo, "opencode-dashboard" ou "opencode-mobile"), adicione uma nota no README para deixar claro que não foi construído pela equipe do OpenCode e não é afiliado a nós de nenhuma forma.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Junte-se à nossa comunidade** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.bs.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">OpenCode je open source AI agent za programiranje.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Instalacija
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Package manageri
|
| 53 |
+
npm i -g opencode-ai@latest # ili bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS i Linux (preporučeno, uvijek ažurno)
|
| 57 |
+
brew install opencode # macOS i Linux (zvanična brew formula, rjeđe se ažurira)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # Bilo koji OS
|
| 61 |
+
nix run nixpkgs#opencode # ili github:anomalyco/opencode za najnoviji dev branch
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Ukloni verzije starije od 0.1.x prije instalacije.
|
| 66 |
+
|
| 67 |
+
### Desktop aplikacija (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode je dostupan i kao desktop aplikacija. Preuzmi je direktno sa [stranice izdanja](https://github.com/anomalyco/opencode/releases) ili sa [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Platforma | Preuzimanje |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm`, ili AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Instalacijski direktorij
|
| 86 |
+
|
| 87 |
+
Instalacijska skripta koristi sljedeći redoslijed prioriteta za putanju instalacije:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Prilagođeni instalacijski direktorij
|
| 90 |
+
2. `$XDG_BIN_DIR` - Putanja usklađena sa XDG Base Directory specifikacijom
|
| 91 |
+
3. `$HOME/bin` - Standardni korisnički bin direktorij (ako postoji ili se može kreirati)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Podrazumijevana rezervna lokacija
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Primjeri
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agenti
|
| 101 |
+
|
| 102 |
+
OpenCode uključuje dva ugrađena agenta između kojih možeš prebacivati tasterom `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** - Podrazumijevani agent sa punim pristupom za razvoj
|
| 105 |
+
- **plan** - Agent samo za čitanje za analizu i istraživanje koda
|
| 106 |
+
- Podrazumijevano zabranjuje izmjene datoteka
|
| 107 |
+
- Traži dozvolu prije pokretanja bash komandi
|
| 108 |
+
- Idealan za istraživanje nepoznatih codebase-ova ili planiranje izmjena
|
| 109 |
+
|
| 110 |
+
Uključen je i **general** pod-agent za složene pretrage i višekoračne zadatke.
|
| 111 |
+
Koristi se interno i može se pozvati pomoću `@general` u porukama.
|
| 112 |
+
|
| 113 |
+
Saznaj više o [agentima](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Dokumentacija
|
| 116 |
+
|
| 117 |
+
Za više informacija o konfiguraciji OpenCode-a, [**pogledaj dokumentaciju**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Doprinosi
|
| 120 |
+
|
| 121 |
+
Ako želiš doprinositi OpenCode-u, pročitaj [upute za doprinošenje](./CONTRIBUTING.md) prije slanja pull requesta.
|
| 122 |
+
|
| 123 |
+
### Gradnja na OpenCode-u
|
| 124 |
+
|
| 125 |
+
Ako radiš na projektu koji je povezan s OpenCode-om i koristi "opencode" kao dio naziva, npr. "opencode-dashboard" ili "opencode-mobile", dodaj napomenu u svoj README da projekat nije napravio OpenCode tim i da nije povezan s nama.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Pridruži se našoj zajednici** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.da.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">Den open source AI-kodeagent.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Installation
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Pakkehåndteringer
|
| 53 |
+
npm i -g opencode-ai@latest # eller bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS og Linux (anbefalet, altid up to date)
|
| 57 |
+
brew install opencode # macOS og Linux (officiel brew formula, opdateres sjældnere)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # alle OS
|
| 61 |
+
nix run nixpkgs#opencode # eller github:anomalyco/opencode for nyeste dev-branch
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Fjern versioner ældre end 0.1.x før installation.
|
| 66 |
+
|
| 67 |
+
### Desktop-app (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode findes også som desktop-app. Download direkte fra [releases-siden](https://github.com/anomalyco/opencode/releases) eller [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Platform | Download |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm`, eller AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Installationsmappe
|
| 86 |
+
|
| 87 |
+
Installationsscriptet bruger følgende prioriteringsrækkefølge for installationsstien:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Tilpasset installationsmappe
|
| 90 |
+
2. `$XDG_BIN_DIR` - Sti der følger XDG Base Directory Specification
|
| 91 |
+
3. `$HOME/bin` - Standard bruger-bin-mappe (hvis den findes eller kan oprettes)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Standard fallback
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Eksempler
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agents
|
| 101 |
+
|
| 102 |
+
OpenCode har to indbyggede agents, som du kan skifte mellem med `Tab`-tasten.
|
| 103 |
+
|
| 104 |
+
- **build** - Standard, agent med fuld adgang til udviklingsarbejde
|
| 105 |
+
- **plan** - Skrivebeskyttet agent til analyse og kodeudforskning
|
| 106 |
+
- Afviser filredigering som standard
|
| 107 |
+
- Spørger om tilladelse før bash-kommandoer
|
| 108 |
+
- Ideel til at udforske ukendte kodebaser eller planlægge ændringer
|
| 109 |
+
|
| 110 |
+
Derudover findes der en **general**-subagent til komplekse søgninger og flertrinsopgaver.
|
| 111 |
+
Den bruges internt og kan kaldes via `@general` i beskeder.
|
| 112 |
+
|
| 113 |
+
Læs mere om [agents](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Dokumentation
|
| 116 |
+
|
| 117 |
+
For mere info om konfiguration af OpenCode, [**se vores docs**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Bidrag
|
| 120 |
+
|
| 121 |
+
Hvis du vil bidrage til OpenCode, så læs vores [contributing docs](./CONTRIBUTING.md) før du sender en pull request.
|
| 122 |
+
|
| 123 |
+
### Bygget på OpenCode
|
| 124 |
+
|
| 125 |
+
Hvis du arbejder på et projekt der er relateret til OpenCode og bruger "opencode" som en del af navnet; f.eks. "opencode-dashboard" eller "opencode-mobile", så tilføj en note i din README, der tydeliggør at projektet ikke er bygget af OpenCode-teamet og ikke er tilknyttet os på nogen måde.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Bliv en del af vores community** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.de.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">Der Open-Source KI-Coding-Agent.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Installation
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Paketmanager
|
| 53 |
+
npm i -g opencode-ai@latest # oder bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS und Linux (empfohlen, immer aktuell)
|
| 57 |
+
brew install opencode # macOS und Linux (offizielle Brew-Formula, seltener aktualisiert)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # jedes Betriebssystem
|
| 61 |
+
nix run nixpkgs#opencode # oder github:anomalyco/opencode für den neuesten dev-Branch
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Entferne Versionen älter als 0.1.x vor der Installation.
|
| 66 |
+
|
| 67 |
+
### Desktop-App (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode ist auch als Desktop-Anwendung verfügbar. Lade sie direkt von der [Releases-Seite](https://github.com/anomalyco/opencode/releases) oder [opencode.ai/download](https://opencode.ai/download) herunter.
|
| 70 |
+
|
| 71 |
+
| Plattform | Download |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm` oder AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Installationsverzeichnis
|
| 86 |
+
|
| 87 |
+
Das Installationsskript beachtet die folgende Prioritätsreihenfolge für den Installationspfad:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Benutzerdefiniertes Installationsverzeichnis
|
| 90 |
+
2. `$XDG_BIN_DIR` - XDG Base Directory Specification-konformer Pfad
|
| 91 |
+
3. `$HOME/bin` - Standard-Binärverzeichnis des Users (falls vorhanden oder erstellbar)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Standard-Fallback
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Beispiele
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agents
|
| 101 |
+
|
| 102 |
+
OpenCode enthält zwei eingebaute Agents, zwischen denen du mit der `Tab`-Taste wechseln kannst.
|
| 103 |
+
|
| 104 |
+
- **build** - Standard-Agent mit vollem Zugriff für Entwicklungsarbeit
|
| 105 |
+
- **plan** - Nur-Lese-Agent für Analyse und Code-Exploration
|
| 106 |
+
- Verweigert Datei-Edits standardmäßig
|
| 107 |
+
- Fragt vor dem Ausführen von bash-Befehlen nach
|
| 108 |
+
- Ideal zum Erkunden unbekannter Codebases oder zum Planen von Änderungen
|
| 109 |
+
|
| 110 |
+
Außerdem ist ein **general**-Subagent für komplexe Suchen und mehrstufige Aufgaben enthalten.
|
| 111 |
+
Dieser wird intern genutzt und kann in Nachrichten mit `@general` aufgerufen werden.
|
| 112 |
+
|
| 113 |
+
Mehr dazu unter [Agents](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Dokumentation
|
| 116 |
+
|
| 117 |
+
Mehr Infos zur Konfiguration von OpenCode findest du in unseren [**Docs**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Beitragen
|
| 120 |
+
|
| 121 |
+
Wenn du zu OpenCode beitragen möchtest, lies bitte unsere [Contributing Docs](./CONTRIBUTING.md), bevor du einen Pull Request einreichst.
|
| 122 |
+
|
| 123 |
+
### Auf OpenCode aufbauen
|
| 124 |
+
|
| 125 |
+
Wenn du an einem Projekt arbeitest, das mit OpenCode zusammenhängt und "opencode" als Teil seines Namens verwendet (z.B. "opencode-dashboard" oder "opencode-mobile"), füge bitte einen Hinweis in deine README ein, dass es nicht vom OpenCode-Team gebaut wird und nicht in irgendeiner Weise mit uns verbunden ist.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Tritt unserer Community bei** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.es.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">El agente de programación con IA de código abierto.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Instalación
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Gestores de paquetes
|
| 53 |
+
npm i -g opencode-ai@latest # o bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS y Linux (recomendado, siempre al día)
|
| 57 |
+
brew install opencode # macOS y Linux (fórmula oficial de brew, se actualiza menos)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # cualquier sistema
|
| 61 |
+
nix run nixpkgs#opencode # o github:anomalyco/opencode para la rama dev más reciente
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Elimina versiones anteriores a 0.1.x antes de instalar.
|
| 66 |
+
|
| 67 |
+
### App de escritorio (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode también está disponible como aplicación de escritorio. Descárgala directamente desde la [página de releases](https://github.com/anomalyco/opencode/releases) o desde [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Plataforma | Descarga |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm`, o AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Directorio de instalación
|
| 86 |
+
|
| 87 |
+
El script de instalación respeta el siguiente orden de prioridad para la ruta de instalación:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Directorio de instalación personalizado
|
| 90 |
+
2. `$XDG_BIN_DIR` - Ruta compatible con la especificación XDG Base Directory
|
| 91 |
+
3. `$HOME/bin` - Directorio binario estándar del usuario (si existe o se puede crear)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Alternativa por defecto
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Ejemplos
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agentes
|
| 101 |
+
|
| 102 |
+
OpenCode incluye dos agentes integrados que puedes alternar con la tecla `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** - Por defecto, agente con acceso completo para tareas de desarrollo
|
| 105 |
+
- **plan** - Agente de solo lectura para análisis y exploración de código
|
| 106 |
+
- Deniega ediciones de archivos por defecto
|
| 107 |
+
- Pide permiso antes de ejecutar comandos bash
|
| 108 |
+
- Ideal para explorar codebases desconocidas o planificar cambios
|
| 109 |
+
|
| 110 |
+
Además, incluye un subagente **general** para búsquedas complejas y tareas de varios pasos.
|
| 111 |
+
Se usa internamente y se puede invocar con `@general` en los mensajes.
|
| 112 |
+
|
| 113 |
+
Más información sobre [agentes](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Documentación
|
| 116 |
+
|
| 117 |
+
Para más información sobre cómo configurar OpenCode, [**ve a nuestra documentación**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Contribuir
|
| 120 |
+
|
| 121 |
+
Si te interesa contribuir a OpenCode, lee nuestras [docs de contribución](./CONTRIBUTING.md) antes de enviar un pull request.
|
| 122 |
+
|
| 123 |
+
### Proyectos basados en OpenCode
|
| 124 |
+
|
| 125 |
+
Si estás trabajando en un proyecto basado en OpenCode y usas "opencode" como parte del nombre, por ejemplo, "opencode-dashboard" u "opencode-mobile", agrega una nota en tu README para aclarar que no está hecho por el equipo de OpenCode y que no está afiliado con nosotros de ninguna manera.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Únete a nuestra comunidad** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.fr.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="Logo OpenCode">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">L'agent de codage IA open source.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Installation
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Gestionnaires de paquets
|
| 53 |
+
npm i -g opencode-ai@latest # ou bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS et Linux (recommandé, toujours à jour)
|
| 57 |
+
brew install opencode # macOS et Linux (formule officielle brew, mise à jour moins fréquente)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # n'importe quel OS
|
| 61 |
+
nix run nixpkgs#opencode # ou github:anomalyco/opencode pour la branche dev la plus récente
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Supprimez les versions antérieures à 0.1.x avant d'installer.
|
| 66 |
+
|
| 67 |
+
### Application de bureau (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode est aussi disponible en application de bureau. Téléchargez-la directement depuis la [page des releases](https://github.com/anomalyco/opencode/releases) ou [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Plateforme | Téléchargement |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm`, ou AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Répertoire d'installation
|
| 86 |
+
|
| 87 |
+
Le script d'installation respecte l'ordre de priorité suivant pour le chemin d'installation :
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Répertoire d'installation personnalisé
|
| 90 |
+
2. `$XDG_BIN_DIR` - Chemin conforme à la spécification XDG Base Directory
|
| 91 |
+
3. `$HOME/bin` - Répertoire binaire utilisateur standard (s'il existe ou peut être créé)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Repli par défaut
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Exemples
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agents
|
| 101 |
+
|
| 102 |
+
OpenCode inclut deux agents intégrés que vous pouvez basculer avec la touche `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** - Par défaut, agent avec accès complet pour le travail de développement
|
| 105 |
+
- **plan** - Agent en lecture seule pour l'analyse et l'exploration du code
|
| 106 |
+
- Refuse les modifications de fichiers par défaut
|
| 107 |
+
- Demande l'autorisation avant d'exécuter des commandes bash
|
| 108 |
+
- Idéal pour explorer une base de code inconnue ou planifier des changements
|
| 109 |
+
|
| 110 |
+
Un sous-agent **general** est aussi inclus pour les recherches complexes et les tâches en plusieurs étapes.
|
| 111 |
+
Il est utilisé en interne et peut être invoqué via `@general` dans les messages.
|
| 112 |
+
|
| 113 |
+
En savoir plus sur les [agents](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Documentation
|
| 116 |
+
|
| 117 |
+
Pour plus d'informations sur la configuration d'OpenCode, [**consultez notre documentation**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Contribuer
|
| 120 |
+
|
| 121 |
+
Si vous souhaitez contribuer à OpenCode, lisez nos [docs de contribution](./CONTRIBUTING.md) avant de soumettre une pull request.
|
| 122 |
+
|
| 123 |
+
### Construire avec OpenCode
|
| 124 |
+
|
| 125 |
+
Si vous travaillez sur un projet lié à OpenCode et que vous utilisez "opencode" dans le nom du projet (par exemple, "opencode-dashboard" ou "opencode-mobile"), ajoutez une note dans votre README pour préciser qu'il n'est pas construit par l'équipe OpenCode et qu'il n'est pas affilié à nous.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Rejoignez notre communauté** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.it.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="Logo OpenCode">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">L’agente di coding AI open source.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Installazione
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Package manager
|
| 53 |
+
npm i -g opencode-ai@latest # oppure bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS e Linux (consigliato, sempre aggiornato)
|
| 57 |
+
brew install opencode # macOS e Linux (formula brew ufficiale, aggiornata meno spesso)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # Qualsiasi OS
|
| 61 |
+
nix run nixpkgs#opencode # oppure github:anomalyco/opencode per l’ultima branch di sviluppo
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Rimuovi le versioni precedenti alla 0.1.x prima di installare.
|
| 66 |
+
|
| 67 |
+
### App Desktop (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode è disponibile anche come applicazione desktop. Puoi scaricarla direttamente dalla [pagina delle release](https://github.com/anomalyco/opencode/releases) oppure da [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Piattaforma | Download |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm`, oppure AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Directory di installazione
|
| 86 |
+
|
| 87 |
+
Lo script di installazione rispetta il seguente ordine di priorità per il percorso di installazione:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` – Directory di installazione personalizzata
|
| 90 |
+
2. `$XDG_BIN_DIR` – Percorso conforme alla XDG Base Directory Specification
|
| 91 |
+
3. `$HOME/bin` – Directory binaria standard dell’utente (se esiste o può essere creata)
|
| 92 |
+
4. `$HOME/.opencode/bin` – Fallback predefinito
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Esempi
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agenti
|
| 101 |
+
|
| 102 |
+
OpenCode include due agenti integrati tra cui puoi passare usando il tasto `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** – Predefinito, agente con accesso completo per il lavoro di sviluppo
|
| 105 |
+
- **plan** – Agente in sola lettura per analisi ed esplorazione del codice
|
| 106 |
+
- Nega le modifiche ai file per impostazione predefinita
|
| 107 |
+
- Chiede il permesso prima di eseguire comandi bash
|
| 108 |
+
- Ideale per esplorare codebase sconosciute o pianificare modifiche
|
| 109 |
+
|
| 110 |
+
È inoltre incluso un sotto-agente **general** per ricerche complesse e attività multi-step.
|
| 111 |
+
Viene utilizzato internamente e può essere invocato usando `@general` nei messaggi.
|
| 112 |
+
|
| 113 |
+
Scopri di più sugli [agenti](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Documentazione
|
| 116 |
+
|
| 117 |
+
Per maggiori informazioni su come configurare OpenCode, [**consulta la nostra documentazione**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Contribuire
|
| 120 |
+
|
| 121 |
+
Se sei interessato a contribuire a OpenCode, leggi la nostra [guida alla contribuzione](./CONTRIBUTING.md) prima di inviare una pull request.
|
| 122 |
+
|
| 123 |
+
### Costruire su OpenCode
|
| 124 |
+
|
| 125 |
+
Se stai lavorando a un progetto correlato a OpenCode e che utilizza “opencode” come parte del nome (ad esempio “opencode-dashboard” o “opencode-mobile”), aggiungi una nota nel tuo README per chiarire che non è sviluppato dal team OpenCode e che non è affiliato in alcun modo con noi.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Unisciti alla nostra community** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.tr.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">Açık kaynaklı yapay zeka kodlama asistanı.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Kurulum
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Paket yöneticileri
|
| 53 |
+
npm i -g opencode-ai@latest # veya bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS ve Linux (önerilir, her zaman güncel)
|
| 57 |
+
brew install opencode # macOS ve Linux (resmi brew formülü, daha az güncellenir)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # Tüm işletim sistemleri
|
| 61 |
+
nix run nixpkgs#opencode # veya en güncel geliştirme dalı için github:anomalyco/opencode
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Kurulumdan önce 0.1.x'ten eski sürümleri kaldırın.
|
| 66 |
+
|
| 67 |
+
### Masaüstü Uygulaması (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode ayrıca masaüstü uygulaması olarak da mevcuttur. Doğrudan [sürüm sayfasından](https://github.com/anomalyco/opencode/releases) veya [opencode.ai/download](https://opencode.ai/download) adresinden indirebilirsiniz.
|
| 70 |
+
|
| 71 |
+
| Platform | İndirme |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm` veya AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Kurulum Dizini (Installation Directory)
|
| 86 |
+
|
| 87 |
+
Kurulum betiği (install script), kurulum yolu (installation path) için aşağıdaki öncelik sırasını takip eder:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Özel kurulum dizini
|
| 90 |
+
2. `$XDG_BIN_DIR` - XDG Base Directory Specification uyumlu yol
|
| 91 |
+
3. `$HOME/bin` - Standart kullanıcı binary dizini (varsa veya oluşturulabiliyorsa)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Varsayılan yedek konum
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Örnekler
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Ajanlar
|
| 101 |
+
|
| 102 |
+
OpenCode, `Tab` tuşuyla aralarında geçiş yapabileceğiniz iki yerleşik (built-in) ajan içerir.
|
| 103 |
+
|
| 104 |
+
- **build** - Varsayılan, geliştirme çalışmaları için tam erişimli ajan
|
| 105 |
+
- **plan** - Analiz ve kod keşfi için salt okunur ajan
|
| 106 |
+
- Varsayılan olarak dosya düzenlemelerini reddeder
|
| 107 |
+
- Bash komutlarını çalıştırmadan önce izin ister
|
| 108 |
+
- Tanımadığınız kod tabanlarını keşfetmek veya değişiklikleri planlamak için ideal
|
| 109 |
+
|
| 110 |
+
Ayrıca, karmaşık aramalar ve çok adımlı görevler için bir **genel** alt ajan bulunmaktadır.
|
| 111 |
+
Bu dahili olarak kullanılır ve mesajlarda `@general` ile çağrılabilir.
|
| 112 |
+
|
| 113 |
+
[Ajanlar](https://opencode.ai/docs/agents) hakkında daha fazla bilgi edinin.
|
| 114 |
+
|
| 115 |
+
### Dokümantasyon
|
| 116 |
+
|
| 117 |
+
OpenCode'u nasıl yapılandıracağınız hakkında daha fazla bilgi için [**dokümantasyonumuza göz atın**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Katkıda Bulunma
|
| 120 |
+
|
| 121 |
+
OpenCode'a katkıda bulunmak istiyorsanız, lütfen bir pull request göndermeden önce [katkıda bulunma dokümanlarımızı](./CONTRIBUTING.md) okuyun.
|
| 122 |
+
|
| 123 |
+
### OpenCode Üzerine Geliştirme
|
| 124 |
+
|
| 125 |
+
OpenCode ile ilgili bir proje üzerinde çalışıyorsanız ve projenizin adının bir parçası olarak "opencode" kullanıyorsanız (örneğin, "opencode-dashboard" veya "opencode-mobile"), lütfen README dosyanıza projenin OpenCode ekibi tarafından geliştirilmediğini ve bizimle hiçbir şekilde bağlantılı olmadığını belirten bir not ekleyin.
|
| 126 |
+
|
| 127 |
+
---
|
| 128 |
+
|
| 129 |
+
**Topluluğumuza katılın** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.uk.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">AI-агент для програмування з відкритим кодом.</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### Встановлення
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# YOLO
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# Менеджери пакетів
|
| 53 |
+
npm i -g opencode-ai@latest # або bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS і Linux (рекомендовано, завжди актуально)
|
| 57 |
+
brew install opencode # macOS і Linux (офіційна формула Homebrew, оновлюється рідше)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # Будь-яка ОС
|
| 61 |
+
nix run nixpkgs#opencode # або github:anomalyco/opencode для найновішої dev-гілки
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> Перед встановленням видаліть версії старші за 0.1.x.
|
| 66 |
+
|
| 67 |
+
### Десктопний застосунок (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode також доступний як десктопний застосунок. Завантажуйте напряму зі [сторінки релізів](https://github.com/anomalyco/opencode/releases) або [opencode.ai/download](https://opencode.ai/download).
|
| 70 |
+
|
| 71 |
+
| Платформа | Завантаження |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`, `.rpm` або AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### Каталог встановлення
|
| 86 |
+
|
| 87 |
+
Скрипт встановлення дотримується такого порядку пріоритету для шляху встановлення:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - Користувацький каталог встановлення
|
| 90 |
+
2. `$XDG_BIN_DIR` - Шлях, сумісний зі специфікацією XDG Base Directory
|
| 91 |
+
3. `$HOME/bin` - Стандартний каталог користувацьких бінарників (якщо існує або його можна створити)
|
| 92 |
+
4. `$HOME/.opencode/bin` - Резервний варіант за замовчуванням
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# Приклади
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Агенти
|
| 101 |
+
|
| 102 |
+
OpenCode містить два вбудовані агенти, між якими можна перемикатися клавішею `Tab`.
|
| 103 |
+
|
| 104 |
+
- **build** - Агент за замовчува��ням із повним доступом для завдань розробки
|
| 105 |
+
- **plan** - Агент лише для читання для аналізу та дослідження коду
|
| 106 |
+
- За замовчуванням забороняє редагування файлів
|
| 107 |
+
- Запитує дозвіл перед запуском bash-команд
|
| 108 |
+
- Ідеально підходить для дослідження незнайомих кодових баз або планування змін
|
| 109 |
+
|
| 110 |
+
Також доступний допоміжний агент **general** для складного пошуку та багатокрокових завдань.
|
| 111 |
+
Він використовується всередині системи й може бути викликаний у повідомленнях через `@general`.
|
| 112 |
+
|
| 113 |
+
Дізнайтеся більше про [agents](https://opencode.ai/docs/agents).
|
| 114 |
+
|
| 115 |
+
### Документація
|
| 116 |
+
|
| 117 |
+
Щоб дізнатися більше про налаштування OpenCode, [**перейдіть до нашої документації**](https://opencode.ai/docs).
|
| 118 |
+
|
| 119 |
+
### Внесок
|
| 120 |
+
|
| 121 |
+
Якщо ви хочете зробити внесок в OpenCode, будь ласка, прочитайте нашу [документацію для контриб'юторів](./CONTRIBUTING.md) перед надсиланням pull request.
|
| 122 |
+
|
| 123 |
+
### Проєкти на базі OpenCode
|
| 124 |
+
|
| 125 |
+
Якщо ви працюєте над проєктом, пов'язаним з OpenCode, і використовуєте "opencode" у назві, наприклад "opencode-dashboard" або "opencode-mobile", додайте примітку до свого README.
|
| 126 |
+
Уточніть, що цей проєкт не створений командою OpenCode і жодним чином не афілійований із нами.
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
**Приєднуйтеся до нашої спільноти** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
|
README.zh.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<a href="https://opencode.ai">
|
| 3 |
+
<picture>
|
| 4 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-dark.svg" media="(prefers-color-scheme: dark)">
|
| 5 |
+
<source srcset="packages/console/app/src/asset/logo-ornate-light.svg" media="(prefers-color-scheme: light)">
|
| 6 |
+
<img src="packages/console/app/src/asset/logo-ornate-light.svg" alt="OpenCode logo">
|
| 7 |
+
</picture>
|
| 8 |
+
</a>
|
| 9 |
+
</p>
|
| 10 |
+
<p align="center">开源的 AI Coding Agent。</p>
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://opencode.ai/discord"><img alt="Discord" src="https://img.shields.io/discord/1391832426048651334?style=flat-square&label=discord" /></a>
|
| 13 |
+
<a href="https://www.npmjs.com/package/opencode-ai"><img alt="npm" src="https://img.shields.io/npm/v/opencode-ai?style=flat-square" /></a>
|
| 14 |
+
<a href="https://github.com/anomalyco/opencode/actions/workflows/publish.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/anomalyco/opencode/publish.yml?style=flat-square&branch=dev" /></a>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="README.md">English</a> |
|
| 19 |
+
<a href="README.zh.md">简体中文</a> |
|
| 20 |
+
<a href="README.zht.md">繁體中文</a> |
|
| 21 |
+
<a href="README.ko.md">한국어</a> |
|
| 22 |
+
<a href="README.de.md">Deutsch</a> |
|
| 23 |
+
<a href="README.es.md">Español</a> |
|
| 24 |
+
<a href="README.fr.md">Français</a> |
|
| 25 |
+
<a href="README.it.md">Italiano</a> |
|
| 26 |
+
<a href="README.da.md">Dansk</a> |
|
| 27 |
+
<a href="README.ja.md">日本語</a> |
|
| 28 |
+
<a href="README.pl.md">Polski</a> |
|
| 29 |
+
<a href="README.ru.md">Русский</a> |
|
| 30 |
+
<a href="README.bs.md">Bosanski</a> |
|
| 31 |
+
<a href="README.ar.md">العربية</a> |
|
| 32 |
+
<a href="README.no.md">Norsk</a> |
|
| 33 |
+
<a href="README.br.md">Português (Brasil)</a> |
|
| 34 |
+
<a href="README.th.md">ไทย</a> |
|
| 35 |
+
<a href="README.tr.md">Türkçe</a> |
|
| 36 |
+
<a href="README.uk.md">Українська</a> |
|
| 37 |
+
<a href="README.bn.md">বাংলা</a> |
|
| 38 |
+
<a href="README.gr.md">Ελληνικά</a> |
|
| 39 |
+
<a href="README.vi.md">Tiếng Việt</a>
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
[](https://opencode.ai)
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
### 安装
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
# 直接安装 (YOLO)
|
| 50 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 51 |
+
|
| 52 |
+
# 软件包管理器
|
| 53 |
+
npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn
|
| 54 |
+
scoop install opencode # Windows
|
| 55 |
+
choco install opencode # Windows
|
| 56 |
+
brew install anomalyco/tap/opencode # macOS 和 Linux(推荐,始终保持最新)
|
| 57 |
+
brew install opencode # macOS 和 Linux(官方 brew formula,更新频率较低)
|
| 58 |
+
sudo pacman -S opencode # Arch Linux (Stable)
|
| 59 |
+
paru -S opencode-bin # Arch Linux (Latest from AUR)
|
| 60 |
+
mise use -g opencode # 任意系统
|
| 61 |
+
nix run nixpkgs#opencode # 或用 github:anomalyco/opencode 获取最新 dev 分支
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
> [!TIP]
|
| 65 |
+
> 安装前请先移除 0.1.x 之前的旧版本。
|
| 66 |
+
|
| 67 |
+
### 桌面应用程序 (BETA)
|
| 68 |
+
|
| 69 |
+
OpenCode 也提供桌面版应用。可直接从 [发布页 (releases page)](https://github.com/anomalyco/opencode/releases) 或 [opencode.ai/download](https://opencode.ai/download) 下载。
|
| 70 |
+
|
| 71 |
+
| 平台 | 下载文件 |
|
| 72 |
+
| --------------------- | ---------------------------------- |
|
| 73 |
+
| macOS (Apple Silicon) | `opencode-desktop-mac-arm64.dmg` |
|
| 74 |
+
| macOS (Intel) | `opencode-desktop-mac-x64.dmg` |
|
| 75 |
+
| Windows | `opencode-desktop-windows-x64.exe` |
|
| 76 |
+
| Linux | `.deb`、`.rpm` 或 AppImage |
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
# macOS (Homebrew Cask)
|
| 80 |
+
brew install --cask opencode-desktop
|
| 81 |
+
# Windows (Scoop)
|
| 82 |
+
scoop bucket add extras; scoop install extras/opencode-desktop
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
#### 安装目录
|
| 86 |
+
|
| 87 |
+
安装脚本按照以下优先级决定安装路径:
|
| 88 |
+
|
| 89 |
+
1. `$OPENCODE_INSTALL_DIR` - 自定义安装目录
|
| 90 |
+
2. `$XDG_BIN_DIR` - 符合 XDG 基础目录规范的路径
|
| 91 |
+
3. `$HOME/bin` - 如果存在或可创建的用户二进制目录
|
| 92 |
+
4. `$HOME/.opencode/bin` - 默认备用路径
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
# 示例
|
| 96 |
+
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
|
| 97 |
+
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
### Agents
|
| 101 |
+
|
| 102 |
+
OpenCode 内置两种 Agent,可用 `Tab` 键快速切换:
|
| 103 |
+
|
| 104 |
+
- **build** - 默认模式,具备完整权限,适合开发工作
|
| 105 |
+
- **plan** - 只读模式,适合代码分析与探索
|
| 106 |
+
- 默认拒绝修改文件
|
| 107 |
+
- 运行 bash 命令前会询问
|
| 108 |
+
- 便于探索未知代码库或规划改动
|
| 109 |
+
|
| 110 |
+
另外还包含一个 **general** 子 Agent,用于复杂搜索和多步任务,内部使用,也可在消息中输入 `@general` 调用。
|
| 111 |
+
|
| 112 |
+
了解更多 [Agents](https://opencode.ai/docs/agents) 相关信息。
|
| 113 |
+
|
| 114 |
+
### 文档
|
| 115 |
+
|
| 116 |
+
更多配置说明请查看我们的 [**官方文档**](https://opencode.ai/docs)。
|
| 117 |
+
|
| 118 |
+
### 参与贡献
|
| 119 |
+
|
| 120 |
+
如有兴趣贡献代码,请在提交 PR 前阅读 [贡献指南 (Contributing Docs)](./CONTRIBUTING.md)。
|
| 121 |
+
|
| 122 |
+
### 基于 OpenCode 进行开发
|
| 123 |
+
|
| 124 |
+
如果你在项目名中使用了 “opencode”(如 “opencode-dashboard” 或 “opencode-mobile”),请在 README 里注明该项目不是 OpenCode 团队官方开发,且不存在隶属关系。
|
| 125 |
+
|
| 126 |
+
---
|
| 127 |
+
|
| 128 |
+
**加入我们的社区** [飞书](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=52ao9352-5623-4fa0-b7dd-3407c392c1af&qr_code=true) | [X.com](https://x.com/opencode)
|
STATS.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Download Stats
|
| 2 |
+
|
| 3 |
+
| Date | GitHub Downloads | npm Downloads | Total |
|
| 4 |
+
| ---------- | -------------------- | -------------------- | --------------------- |
|
| 5 |
+
| 2025-06-29 | 18,789 (+0) | 39,420 (+0) | 58,209 (+0) |
|
| 6 |
+
| 2025-06-30 | 20,127 (+1,338) | 41,059 (+1,639) | 61,186 (+2,977) |
|
| 7 |
+
| 2025-07-01 | 22,108 (+1,981) | 43,745 (+2,686) | 65,853 (+4,667) |
|
| 8 |
+
| 2025-07-02 | 24,814 (+2,706) | 46,168 (+2,423) | 70,982 (+5,129) |
|
| 9 |
+
| 2025-07-03 | 27,834 (+3,020) | 49,955 (+3,787) | 77,789 (+6,807) |
|
| 10 |
+
| 2025-07-04 | 30,608 (+2,774) | 54,758 (+4,803) | 85,366 (+7,577) |
|
| 11 |
+
| 2025-07-05 | 32,524 (+1,916) | 58,371 (+3,613) | 90,895 (+5,529) |
|
| 12 |
+
| 2025-07-06 | 33,766 (+1,242) | 59,694 (+1,323) | 93,460 (+2,565) |
|
| 13 |
+
| 2025-07-08 | 38,052 (+4,286) | 64,468 (+4,774) | 102,520 (+9,060) |
|
| 14 |
+
| 2025-07-09 | 40,924 (+2,872) | 67,935 (+3,467) | 108,859 (+6,339) |
|
| 15 |
+
| 2025-07-10 | 43,796 (+2,872) | 71,402 (+3,467) | 115,198 (+6,339) |
|
| 16 |
+
| 2025-07-11 | 46,982 (+3,186) | 77,462 (+6,060) | 124,444 (+9,246) |
|
| 17 |
+
| 2025-07-12 | 49,302 (+2,320) | 82,177 (+4,715) | 131,479 (+7,035) |
|
| 18 |
+
| 2025-07-13 | 50,803 (+1,501) | 86,394 (+4,217) | 137,197 (+5,718) |
|
| 19 |
+
| 2025-07-14 | 53,283 (+2,480) | 87,860 (+1,466) | 141,143 (+3,946) |
|
| 20 |
+
| 2025-07-15 | 57,590 (+4,307) | 91,036 (+3,176) | 148,626 (+7,483) |
|
| 21 |
+
| 2025-07-16 | 62,313 (+4,723) | 95,258 (+4,222) | 157,571 (+8,945) |
|
| 22 |
+
| 2025-07-17 | 66,684 (+4,371) | 100,048 (+4,790) | 166,732 (+9,161) |
|
| 23 |
+
| 2025-07-18 | 70,379 (+3,695) | 102,587 (+2,539) | 172,966 (+6,234) |
|
| 24 |
+
| 2025-07-19 | 73,497 (+3,117) | 105,904 (+3,317) | 179,401 (+6,434) |
|
| 25 |
+
| 2025-07-20 | 76,453 (+2,956) | 109,044 (+3,140) | 185,497 (+6,096) |
|
| 26 |
+
| 2025-07-21 | 80,197 (+3,744) | 113,537 (+4,493) | 193,734 (+8,237) |
|
| 27 |
+
| 2025-07-22 | 84,251 (+4,054) | 118,073 (+4,536) | 202,324 (+8,590) |
|
| 28 |
+
| 2025-07-23 | 88,589 (+4,338) | 121,436 (+3,363) | 210,025 (+7,701) |
|
| 29 |
+
| 2025-07-24 | 92,469 (+3,880) | 124,091 (+2,655) | 216,560 (+6,535) |
|
| 30 |
+
| 2025-07-25 | 96,417 (+3,948) | 126,985 (+2,894) | 223,402 (+6,842) |
|
| 31 |
+
| 2025-07-26 | 100,646 (+4,229) | 131,411 (+4,426) | 232,057 (+8,655) |
|
| 32 |
+
| 2025-07-27 | 102,644 (+1,998) | 134,736 (+3,325) | 237,380 (+5,323) |
|
| 33 |
+
| 2025-07-28 | 105,446 (+2,802) | 136,016 (+1,280) | 241,462 (+4,082) |
|
| 34 |
+
| 2025-07-29 | 108,998 (+3,552) | 137,542 (+1,526) | 246,540 (+5,078) |
|
| 35 |
+
| 2025-07-30 | 113,544 (+4,546) | 140,317 (+2,775) | 253,861 (+7,321) |
|
| 36 |
+
| 2025-07-31 | 118,339 (+4,795) | 143,344 (+3,027) | 261,683 (+7,822) |
|
| 37 |
+
| 2025-08-01 | 123,539 (+5,200) | 146,680 (+3,336) | 270,219 (+8,536) |
|
| 38 |
+
| 2025-08-02 | 127,864 (+4,325) | 149,236 (+2,556) | 277,100 (+6,881) |
|
| 39 |
+
| 2025-08-03 | 131,397 (+3,533) | 150,451 (+1,215) | 281,848 (+4,748) |
|
| 40 |
+
| 2025-08-04 | 136,266 (+4,869) | 153,260 (+2,809) | 289,526 (+7,678) |
|
| 41 |
+
| 2025-08-05 | 141,596 (+5,330) | 155,752 (+2,492) | 297,348 (+7,822) |
|
| 42 |
+
| 2025-08-06 | 147,067 (+5,471) | 158,309 (+2,557) | 305,376 (+8,028) |
|
| 43 |
+
| 2025-08-07 | 152,591 (+5,524) | 160,889 (+2,580) | 313,480 (+8,104) |
|
| 44 |
+
| 2025-08-08 | 158,187 (+5,596) | 163,448 (+2,559) | 321,635 (+8,155) |
|
| 45 |
+
| 2025-08-09 | 162,770 (+4,583) | 165,721 (+2,273) | 328,491 (+6,856) |
|
| 46 |
+
| 2025-08-10 | 165,695 (+2,925) | 167,109 (+1,388) | 332,804 (+4,313) |
|
| 47 |
+
| 2025-08-11 | 169,297 (+3,602) | 167,953 (+844) | 337,250 (+4,446) |
|
| 48 |
+
| 2025-08-12 | 176,307 (+7,010) | 171,876 (+3,923) | 348,183 (+10,933) |
|
| 49 |
+
| 2025-08-13 | 182,997 (+6,690) | 177,182 (+5,306) | 360,179 (+11,996) |
|
| 50 |
+
| 2025-08-14 | 189,063 (+6,066) | 179,741 (+2,559) | 368,804 (+8,625) |
|
| 51 |
+
| 2025-08-15 | 193,608 (+4,545) | 181,792 (+2,051) | 375,400 (+6,596) |
|
| 52 |
+
| 2025-08-16 | 198,118 (+4,510) | 184,558 (+2,766) | 382,676 (+7,276) |
|
| 53 |
+
| 2025-08-17 | 201,299 (+3,181) | 186,269 (+1,711) | 387,568 (+4,892) |
|
| 54 |
+
| 2025-08-18 | 204,559 (+3,260) | 187,399 (+1,130) | 391,958 (+4,390) |
|
| 55 |
+
| 2025-08-19 | 209,814 (+5,255) | 189,668 (+2,269) | 399,482 (+7,524) |
|
| 56 |
+
| 2025-08-20 | 214,497 (+4,683) | 191,481 (+1,813) | 405,978 (+6,496) |
|
| 57 |
+
| 2025-08-21 | 220,465 (+5,968) | 194,784 (+3,303) | 415,249 (+9,271) |
|
| 58 |
+
| 2025-08-22 | 225,899 (+5,434) | 197,204 (+2,420) | 423,103 (+7,854) |
|
| 59 |
+
| 2025-08-23 | 229,005 (+3,106) | 199,238 (+2,034) | 428,243 (+5,140) |
|
| 60 |
+
| 2025-08-24 | 232,098 (+3,093) | 201,157 (+1,919) | 433,255 (+5,012) |
|
| 61 |
+
| 2025-08-25 | 236,607 (+4,509) | 202,650 (+1,493) | 439,257 (+6,002) |
|
| 62 |
+
| 2025-08-26 | 242,783 (+6,176) | 205,242 (+2,592) | 448,025 (+8,768) |
|
| 63 |
+
| 2025-08-27 | 248,409 (+5,626) | 205,242 (+0) | 453,651 (+5,626) |
|
| 64 |
+
| 2025-08-28 | 252,796 (+4,387) | 205,242 (+0) | 458,038 (+4,387) |
|
| 65 |
+
| 2025-08-29 | 256,045 (+3,249) | 211,075 (+5,833) | 467,120 (+9,082) |
|
| 66 |
+
| 2025-08-30 | 258,863 (+2,818) | 212,397 (+1,322) | 471,260 (+4,140) |
|
| 67 |
+
| 2025-08-31 | 262,004 (+3,141) | 213,944 (+1,547) | 475,948 (+4,688) |
|
| 68 |
+
| 2025-09-01 | 265,359 (+3,355) | 215,115 (+1,171) | 480,474 (+4,526) |
|
| 69 |
+
| 2025-09-02 | 270,483 (+5,124) | 217,075 (+1,960) | 487,558 (+7,084) |
|
| 70 |
+
| 2025-09-03 | 274,793 (+4,310) | 219,755 (+2,680) | 494,548 (+6,990) |
|
| 71 |
+
| 2025-09-04 | 280,430 (+5,637) | 222,103 (+2,348) | 502,533 (+7,985) |
|
| 72 |
+
| 2025-09-05 | 283,769 (+3,339) | 223,793 (+1,690) | 507,562 (+5,029) |
|
| 73 |
+
| 2025-09-06 | 286,245 (+2,476) | 225,036 (+1,243) | 511,281 (+3,719) |
|
| 74 |
+
| 2025-09-07 | 288,623 (+2,378) | 225,866 (+830) | 514,489 (+3,208) |
|
| 75 |
+
| 2025-09-08 | 293,341 (+4,718) | 227,073 (+1,207) | 520,414 (+5,925) |
|
| 76 |
+
| 2025-09-09 | 300,036 (+6,695) | 229,788 (+2,715) | 529,824 (+9,410) |
|
| 77 |
+
| 2025-09-10 | 307,287 (+7,251) | 233,435 (+3,647) | 540,722 (+10,898) |
|
| 78 |
+
| 2025-09-11 | 314,083 (+6,796) | 237,356 (+3,921) | 551,439 (+10,717) |
|
| 79 |
+
| 2025-09-12 | 321,046 (+6,963) | 240,728 (+3,372) | 561,774 (+10,335) |
|
| 80 |
+
| 2025-09-13 | 324,894 (+3,848) | 245,539 (+4,811) | 570,433 (+8,659) |
|
| 81 |
+
| 2025-09-14 | 328,876 (+3,982) | 248,245 (+2,706) | 577,121 (+6,688) |
|
| 82 |
+
| 2025-09-15 | 334,201 (+5,325) | 250,983 (+2,738) | 585,184 (+8,063) |
|
| 83 |
+
| 2025-09-16 | 342,609 (+8,408) | 255,264 (+4,281) | 597,873 (+12,689) |
|
| 84 |
+
| 2025-09-17 | 351,117 (+8,508) | 260,970 (+5,706) | 612,087 (+14,214) |
|
| 85 |
+
| 2025-09-18 | 358,717 (+7,600) | 266,922 (+5,952) | 625,639 (+13,552) |
|
| 86 |
+
| 2025-09-19 | 365,401 (+6,684) | 271,859 (+4,937) | 637,260 (+11,621) |
|
| 87 |
+
| 2025-09-20 | 372,092 (+6,691) | 276,917 (+5,058) | 649,009 (+11,749) |
|
| 88 |
+
| 2025-09-21 | 377,079 (+4,987) | 280,261 (+3,344) | 657,340 (+8,331) |
|
| 89 |
+
| 2025-09-22 | 382,492 (+5,413) | 284,009 (+3,748) | 666,501 (+9,161) |
|
| 90 |
+
| 2025-09-23 | 387,008 (+4,516) | 289,129 (+5,120) | 676,137 (+9,636) |
|
| 91 |
+
| 2025-09-24 | 393,325 (+6,317) | 294,927 (+5,798) | 688,252 (+12,115) |
|
| 92 |
+
| 2025-09-25 | 398,879 (+5,554) | 301,663 (+6,736) | 700,542 (+12,290) |
|
| 93 |
+
| 2025-09-26 | 404,334 (+5,455) | 306,713 (+5,050) | 711,047 (+10,505) |
|
| 94 |
+
| 2025-09-27 | 411,618 (+7,284) | 317,763 (+11,050) | 729,381 (+18,334) |
|
| 95 |
+
| 2025-09-28 | 414,910 (+3,292) | 322,522 (+4,759) | 737,432 (+8,051) |
|
| 96 |
+
| 2025-09-29 | 419,919 (+5,009) | 328,033 (+5,511) | 747,952 (+10,520) |
|
| 97 |
+
| 2025-09-30 | 427,991 (+8,072) | 336,472 (+8,439) | 764,463 (+16,511) |
|
| 98 |
+
| 2025-10-01 | 433,591 (+5,600) | 341,742 (+5,270) | 775,333 (+10,870) |
|
| 99 |
+
| 2025-10-02 | 440,852 (+7,261) | 348,099 (+6,357) | 788,951 (+13,618) |
|
| 100 |
+
| 2025-10-03 | 446,829 (+5,977) | 359,937 (+11,838) | 806,766 (+17,815) |
|
| 101 |
+
| 2025-10-04 | 452,561 (+5,732) | 370,386 (+10,449) | 822,947 (+16,181) |
|
| 102 |
+
| 2025-10-05 | 455,559 (+2,998) | 374,745 (+4,359) | 830,304 (+7,357) |
|
| 103 |
+
| 2025-10-06 | 460,927 (+5,368) | 379,489 (+4,744) | 840,416 (+10,112) |
|
| 104 |
+
| 2025-10-07 | 467,336 (+6,409) | 385,438 (+5,949) | 852,774 (+12,358) |
|
| 105 |
+
| 2025-10-08 | 474,643 (+7,307) | 394,139 (+8,701) | 868,782 (+16,008) |
|
| 106 |
+
| 2025-10-09 | 479,203 (+4,560) | 400,526 (+6,387) | 879,729 (+10,947) |
|
| 107 |
+
| 2025-10-10 | 484,374 (+5,171) | 406,015 (+5,489) | 890,389 (+10,660) |
|
| 108 |
+
| 2025-10-11 | 488,427 (+4,053) | 414,699 (+8,684) | 903,126 (+12,737) |
|
| 109 |
+
| 2025-10-12 | 492,125 (+3,698) | 418,745 (+4,046) | 910,870 (+7,744) |
|
| 110 |
+
| 2025-10-14 | 505,130 (+13,005) | 429,286 (+10,541) | 934,416 (+23,546) |
|
| 111 |
+
| 2025-10-15 | 512,717 (+7,587) | 439,290 (+10,004) | 952,007 (+17,591) |
|
| 112 |
+
| 2025-10-16 | 517,719 (+5,002) | 447,137 (+7,847) | 964,856 (+12,849) |
|
| 113 |
+
| 2025-10-17 | 526,239 (+8,520) | 457,467 (+10,330) | 983,706 (+18,850) |
|
| 114 |
+
| 2025-10-18 | 531,564 (+5,325) | 465,272 (+7,805) | 996,836 (+13,130) |
|
| 115 |
+
| 2025-10-19 | 536,209 (+4,645) | 469,078 (+3,806) | 1,005,287 (+8,451) |
|
| 116 |
+
| 2025-10-20 | 541,264 (+5,055) | 472,952 (+3,874) | 1,014,216 (+8,929) |
|
| 117 |
+
| 2025-10-21 | 548,721 (+7,457) | 479,703 (+6,751) | 1,028,424 (+14,208) |
|
| 118 |
+
| 2025-10-22 | 557,949 (+9,228) | 491,395 (+11,692) | 1,049,344 (+20,920) |
|
| 119 |
+
| 2025-10-23 | 564,716 (+6,767) | 498,736 (+7,341) | 1,063,452 (+14,108) |
|
| 120 |
+
| 2025-10-24 | 572,692 (+7,976) | 506,905 (+8,169) | 1,079,597 (+16,145) |
|
| 121 |
+
| 2025-10-25 | 578,927 (+6,235) | 516,129 (+9,224) | 1,095,056 (+15,459) |
|
| 122 |
+
| 2025-10-26 | 584,409 (+5,482) | 521,179 (+5,050) | 1,105,588 (+10,532) |
|
| 123 |
+
| 2025-10-27 | 589,999 (+5,590) | 526,001 (+4,822) | 1,116,000 (+10,412) |
|
| 124 |
+
| 2025-10-28 | 595,776 (+5,777) | 532,438 (+6,437) | 1,128,214 (+12,214) |
|
| 125 |
+
| 2025-10-29 | 606,259 (+10,483) | 542,064 (+9,626) | 1,148,323 (+20,109) |
|
| 126 |
+
| 2025-10-30 | 613,746 (+7,487) | 542,064 (+0) | 1,155,810 (+7,487) |
|
| 127 |
+
| 2025-10-30 | 617,846 (+4,100) | 555,026 (+12,962) | 1,172,872 (+17,062) |
|
| 128 |
+
| 2025-10-31 | 626,612 (+8,766) | 564,579 (+9,553) | 1,191,191 (+18,319) |
|
| 129 |
+
| 2025-11-01 | 636,100 (+9,488) | 581,806 (+17,227) | 1,217,906 (+26,715) |
|
| 130 |
+
| 2025-11-02 | 644,067 (+7,967) | 590,004 (+8,198) | 1,234,071 (+16,165) |
|
| 131 |
+
| 2025-11-03 | 653,130 (+9,063) | 597,139 (+7,135) | 1,250,269 (+16,198) |
|
| 132 |
+
| 2025-11-04 | 663,912 (+10,782) | 608,056 (+10,917) | 1,271,968 (+21,699) |
|
| 133 |
+
| 2025-11-05 | 675,074 (+11,162) | 619,690 (+11,634) | 1,294,764 (+22,796) |
|
| 134 |
+
| 2025-11-06 | 686,252 (+11,178) | 630,885 (+11,195) | 1,317,137 (+22,373) |
|
| 135 |
+
| 2025-11-07 | 696,646 (+10,394) | 642,146 (+11,261) | 1,338,792 (+21,655) |
|
| 136 |
+
| 2025-11-08 | 706,035 (+9,389) | 653,489 (+11,343) | 1,359,524 (+20,732) |
|
| 137 |
+
| 2025-11-09 | 713,462 (+7,427) | 660,459 (+6,970) | 1,373,921 (+14,397) |
|
| 138 |
+
| 2025-11-10 | 722,288 (+8,826) | 668,225 (+7,766) | 1,390,513 (+16,592) |
|
| 139 |
+
| 2025-11-11 | 729,769 (+7,481) | 677,501 (+9,276) | 1,407,270 (+16,757) |
|
| 140 |
+
| 2025-11-12 | 740,180 (+10,411) | 686,454 (+8,953) | 1,426,634 (+19,364) |
|
| 141 |
+
| 2025-11-13 | 749,905 (+9,725) | 696,157 (+9,703) | 1,446,062 (+19,428) |
|
| 142 |
+
| 2025-11-14 | 759,928 (+10,023) | 705,237 (+9,080) | 1,465,165 (+19,103) |
|
| 143 |
+
| 2025-11-15 | 765,955 (+6,027) | 712,870 (+7,633) | 1,478,825 (+13,660) |
|
| 144 |
+
| 2025-11-16 | 771,069 (+5,114) | 716,596 (+3,726) | 1,487,665 (+8,840) |
|
| 145 |
+
| 2025-11-17 | 780,161 (+9,092) | 723,339 (+6,743) | 1,503,500 (+15,835) |
|
| 146 |
+
| 2025-11-18 | 791,563 (+11,402) | 732,544 (+9,205) | 1,524,107 (+20,607) |
|
| 147 |
+
| 2025-11-19 | 804,409 (+12,846) | 747,624 (+15,080) | 1,552,033 (+27,926) |
|
| 148 |
+
| 2025-11-20 | 814,620 (+10,211) | 757,907 (+10,283) | 1,572,527 (+20,494) |
|
| 149 |
+
| 2025-11-21 | 826,309 (+11,689) | 769,307 (+11,400) | 1,595,616 (+23,089) |
|
| 150 |
+
| 2025-11-22 | 837,269 (+10,960) | 780,996 (+11,689) | 1,618,265 (+22,649) |
|
| 151 |
+
| 2025-11-23 | 846,609 (+9,340) | 795,069 (+14,073) | 1,641,678 (+23,413) |
|
| 152 |
+
| 2025-11-24 | 856,733 (+10,124) | 804,033 (+8,964) | 1,660,766 (+19,088) |
|
| 153 |
+
| 2025-11-25 | 869,423 (+12,690) | 817,339 (+13,306) | 1,686,762 (+25,996) |
|
| 154 |
+
| 2025-11-26 | 881,414 (+11,991) | 832,518 (+15,179) | 1,713,932 (+27,170) |
|
| 155 |
+
| 2025-11-27 | 893,960 (+12,546) | 846,180 (+13,662) | 1,740,140 (+26,208) |
|
| 156 |
+
| 2025-11-28 | 901,741 (+7,781) | 856,482 (+10,302) | 1,758,223 (+18,083) |
|
| 157 |
+
| 2025-11-29 | 908,689 (+6,948) | 863,361 (+6,879) | 1,772,050 (+13,827) |
|
| 158 |
+
| 2025-11-30 | 916,116 (+7,427) | 870,194 (+6,833) | 1,786,310 (+14,260) |
|
| 159 |
+
| 2025-12-01 | 925,898 (+9,782) | 876,500 (+6,306) | 1,802,398 (+16,088) |
|
| 160 |
+
| 2025-12-02 | 939,250 (+13,352) | 890,919 (+14,419) | 1,830,169 (+27,771) |
|
| 161 |
+
| 2025-12-03 | 952,249 (+12,999) | 903,713 (+12,794) | 1,855,962 (+25,793) |
|
| 162 |
+
| 2025-12-04 | 965,611 (+13,362) | 916,471 (+12,758) | 1,882,082 (+26,120) |
|
| 163 |
+
| 2025-12-05 | 977,996 (+12,385) | 930,616 (+14,145) | 1,908,612 (+26,530) |
|
| 164 |
+
| 2025-12-06 | 987,884 (+9,888) | 943,773 (+13,157) | 1,931,657 (+23,045) |
|
| 165 |
+
| 2025-12-07 | 994,046 (+6,162) | 951,425 (+7,652) | 1,945,471 (+13,814) |
|
| 166 |
+
| 2025-12-08 | 1,000,898 (+6,852) | 957,149 (+5,724) | 1,958,047 (+12,576) |
|
| 167 |
+
| 2025-12-09 | 1,011,488 (+10,590) | 973,922 (+16,773) | 1,985,410 (+27,363) |
|
| 168 |
+
| 2025-12-10 | 1,025,891 (+14,403) | 991,708 (+17,786) | 2,017,599 (+32,189) |
|
| 169 |
+
| 2025-12-11 | 1,045,110 (+19,219) | 1,010,559 (+18,851) | 2,055,669 (+38,070) |
|
| 170 |
+
| 2025-12-12 | 1,061,340 (+16,230) | 1,030,838 (+20,279) | 2,092,178 (+36,509) |
|
| 171 |
+
| 2025-12-13 | 1,073,561 (+12,221) | 1,044,608 (+13,770) | 2,118,169 (+25,991) |
|
| 172 |
+
| 2025-12-14 | 1,082,042 (+8,481) | 1,052,425 (+7,817) | 2,134,467 (+16,298) |
|
| 173 |
+
| 2025-12-15 | 1,093,632 (+11,590) | 1,059,078 (+6,653) | 2,152,710 (+18,243) |
|
| 174 |
+
| 2025-12-16 | 1,120,477 (+26,845) | 1,078,022 (+18,944) | 2,198,499 (+45,789) |
|
| 175 |
+
| 2025-12-17 | 1,151,067 (+30,590) | 1,097,661 (+19,639) | 2,248,728 (+50,229) |
|
| 176 |
+
| 2025-12-18 | 1,178,658 (+27,591) | 1,113,418 (+15,757) | 2,292,076 (+43,348) |
|
| 177 |
+
| 2025-12-19 | 1,203,485 (+24,827) | 1,129,698 (+16,280) | 2,333,183 (+41,107) |
|
| 178 |
+
| 2025-12-20 | 1,223,000 (+19,515) | 1,146,258 (+16,560) | 2,369,258 (+36,075) |
|
| 179 |
+
| 2025-12-21 | 1,242,675 (+19,675) | 1,158,909 (+12,651) | 2,401,584 (+32,326) |
|
| 180 |
+
| 2025-12-22 | 1,262,522 (+19,847) | 1,169,121 (+10,212) | 2,431,643 (+30,059) |
|
| 181 |
+
| 2025-12-23 | 1,286,548 (+24,026) | 1,186,439 (+17,318) | 2,472,987 (+41,344) |
|
| 182 |
+
| 2025-12-24 | 1,309,323 (+22,775) | 1,203,767 (+17,328) | 2,513,090 (+40,103) |
|
| 183 |
+
| 2025-12-25 | 1,333,032 (+23,709) | 1,217,283 (+13,516) | 2,550,315 (+37,225) |
|
| 184 |
+
| 2025-12-26 | 1,352,411 (+19,379) | 1,227,615 (+10,332) | 2,580,026 (+29,711) |
|
| 185 |
+
| 2025-12-27 | 1,371,771 (+19,360) | 1,238,236 (+10,621) | 2,610,007 (+29,981) |
|
| 186 |
+
| 2025-12-28 | 1,390,388 (+18,617) | 1,245,690 (+7,454) | 2,636,078 (+26,071) |
|
| 187 |
+
| 2025-12-29 | 1,415,560 (+25,172) | 1,257,101 (+11,411) | 2,672,661 (+36,583) |
|
| 188 |
+
| 2025-12-30 | 1,445,450 (+29,890) | 1,272,689 (+15,588) | 2,718,139 (+45,478) |
|
| 189 |
+
| 2025-12-31 | 1,479,598 (+34,148) | 1,293,235 (+20,546) | 2,772,833 (+54,694) |
|
| 190 |
+
| 2026-01-01 | 1,508,883 (+29,285) | 1,309,874 (+16,639) | 2,818,757 (+45,924) |
|
| 191 |
+
| 2026-01-02 | 1,563,474 (+54,591) | 1,320,959 (+11,085) | 2,884,433 (+65,676) |
|
| 192 |
+
| 2026-01-03 | 1,618,065 (+54,591) | 1,331,914 (+10,955) | 2,949,979 (+65,546) |
|
| 193 |
+
| 2026-01-04 | 1,672,656 (+39,702) | 1,339,883 (+7,969) | 3,012,539 (+62,560) |
|
| 194 |
+
| 2026-01-05 | 1,738,171 (+65,515) | 1,353,043 (+13,160) | 3,091,214 (+78,675) |
|
| 195 |
+
| 2026-01-06 | 1,960,988 (+222,817) | 1,377,377 (+24,334) | 3,338,365 (+247,151) |
|
| 196 |
+
| 2026-01-07 | 2,123,239 (+162,251) | 1,398,648 (+21,271) | 3,521,887 (+183,522) |
|
| 197 |
+
| 2026-01-08 | 2,272,630 (+149,391) | 1,432,480 (+33,832) | 3,705,110 (+183,223) |
|
| 198 |
+
| 2026-01-09 | 2,443,565 (+170,935) | 1,469,451 (+36,971) | 3,913,016 (+207,906) |
|
| 199 |
+
| 2026-01-10 | 2,632,023 (+188,458) | 1,503,670 (+34,219) | 4,135,693 (+222,677) |
|
| 200 |
+
| 2026-01-11 | 2,836,394 (+204,371) | 1,530,479 (+26,809) | 4,366,873 (+231,180) |
|
| 201 |
+
| 2026-01-12 | 3,053,594 (+217,200) | 1,553,671 (+23,192) | 4,607,265 (+240,392) |
|
| 202 |
+
| 2026-01-13 | 3,297,078 (+243,484) | 1,595,062 (+41,391) | 4,892,140 (+284,875) |
|
| 203 |
+
| 2026-01-14 | 3,568,928 (+271,850) | 1,645,362 (+50,300) | 5,214,290 (+322,150) |
|
| 204 |
+
| 2026-01-16 | 4,121,550 (+552,622) | 1,754,418 (+109,056) | 5,875,968 (+661,678) |
|
| 205 |
+
| 2026-01-17 | 4,389,558 (+268,008) | 1,805,315 (+50,897) | 6,194,873 (+318,905) |
|
| 206 |
+
| 2026-01-18 | 4,627,623 (+238,065) | 1,839,171 (+33,856) | 6,466,794 (+271,921) |
|
| 207 |
+
| 2026-01-19 | 4,861,108 (+233,485) | 1,863,112 (+23,941) | 6,724,220 (+257,426) |
|
| 208 |
+
| 2026-01-20 | 5,128,999 (+267,891) | 1,903,665 (+40,553) | 7,032,664 (+308,444) |
|
| 209 |
+
| 2026-01-21 | 5,444,842 (+315,843) | 1,962,531 (+58,866) | 7,407,373 (+374,709) |
|
| 210 |
+
| 2026-01-22 | 5,766,340 (+321,498) | 2,029,487 (+66,956) | 7,795,827 (+388,454) |
|
| 211 |
+
| 2026-01-23 | 6,096,236 (+329,896) | 2,096,235 (+66,748) | 8,192,471 (+396,644) |
|
| 212 |
+
| 2026-01-24 | 6,371,019 (+274,783) | 2,156,870 (+60,635) | 8,527,889 (+335,418) |
|
| 213 |
+
| 2026-01-25 | 6,639,082 (+268,063) | 2,187,853 (+30,983) | 8,826,935 (+299,046) |
|
| 214 |
+
| 2026-01-26 | 6,941,620 (+302,538) | 2,232,115 (+44,262) | 9,173,735 (+346,800) |
|
| 215 |
+
| 2026-01-27 | 7,208,093 (+266,473) | 2,280,762 (+48,647) | 9,488,855 (+315,120) |
|
| 216 |
+
| 2026-01-28 | 7,489,370 (+281,277) | 2,314,849 (+34,087) | 9,804,219 (+315,364) |
|
| 217 |
+
| 2026-01-29 | 7,815,471 (+326,101) | 2,374,982 (+60,133) | 10,190,453 (+386,234) |
|
bunfig.toml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[install]
|
| 2 |
+
exact = true
|
| 3 |
+
# Only install newly resolved package versions published at least 3 days ago.
|
| 4 |
+
minimumReleaseAge = 259200
|
| 5 |
+
minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"]
|
| 6 |
+
|
| 7 |
+
[test]
|
| 8 |
+
root = "./do-not-run-tests-from-root"
|
flake.lock
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"nodes": {
|
| 3 |
+
"nixpkgs": {
|
| 4 |
+
"locked": {
|
| 5 |
+
"lastModified": 1776683584,
|
| 6 |
+
"narHash": "sha256-NuTLMrr10Tng72hurYG8jYQ4XKK8wnpJmOGcPiis96g=",
|
| 7 |
+
"owner": "NixOS",
|
| 8 |
+
"repo": "nixpkgs",
|
| 9 |
+
"rev": "9dd5558b06dbdacbf635a3dd36dce1b1a7ee3a89",
|
| 10 |
+
"type": "github"
|
| 11 |
+
},
|
| 12 |
+
"original": {
|
| 13 |
+
"owner": "NixOS",
|
| 14 |
+
"ref": "nixpkgs-unstable",
|
| 15 |
+
"repo": "nixpkgs",
|
| 16 |
+
"type": "github"
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"root": {
|
| 20 |
+
"inputs": {
|
| 21 |
+
"nixpkgs": "nixpkgs"
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"root": "root",
|
| 26 |
+
"version": 7
|
| 27 |
+
}
|
install
ADDED
|
@@ -0,0 +1,460 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
APP=opencode
|
| 4 |
+
|
| 5 |
+
MUTED='\033[0;2m'
|
| 6 |
+
RED='\033[0;31m'
|
| 7 |
+
ORANGE='\033[38;5;214m'
|
| 8 |
+
NC='\033[0m' # No Color
|
| 9 |
+
|
| 10 |
+
usage() {
|
| 11 |
+
cat <<EOF
|
| 12 |
+
OpenCode Installer
|
| 13 |
+
|
| 14 |
+
Usage: install.sh [options]
|
| 15 |
+
|
| 16 |
+
Options:
|
| 17 |
+
-h, --help Display this help message
|
| 18 |
+
-v, --version <version> Install a specific version (e.g., 1.0.180)
|
| 19 |
+
-b, --binary <path> Install from a local binary instead of downloading
|
| 20 |
+
--no-modify-path Don't modify shell config files (.zshrc, .bashrc, etc.)
|
| 21 |
+
|
| 22 |
+
Examples:
|
| 23 |
+
curl -fsSL https://opencode.ai/install | bash
|
| 24 |
+
curl -fsSL https://opencode.ai/install | bash -s -- --version 1.0.180
|
| 25 |
+
./install --binary /path/to/opencode
|
| 26 |
+
EOF
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
requested_version=${VERSION:-}
|
| 30 |
+
no_modify_path=false
|
| 31 |
+
binary_path=""
|
| 32 |
+
|
| 33 |
+
while [[ $# -gt 0 ]]; do
|
| 34 |
+
case "$1" in
|
| 35 |
+
-h|--help)
|
| 36 |
+
usage
|
| 37 |
+
exit 0
|
| 38 |
+
;;
|
| 39 |
+
-v|--version)
|
| 40 |
+
if [[ -n "${2:-}" ]]; then
|
| 41 |
+
requested_version="$2"
|
| 42 |
+
shift 2
|
| 43 |
+
else
|
| 44 |
+
echo -e "${RED}Error: --version requires a version argument${NC}"
|
| 45 |
+
exit 1
|
| 46 |
+
fi
|
| 47 |
+
;;
|
| 48 |
+
-b|--binary)
|
| 49 |
+
if [[ -n "${2:-}" ]]; then
|
| 50 |
+
binary_path="$2"
|
| 51 |
+
shift 2
|
| 52 |
+
else
|
| 53 |
+
echo -e "${RED}Error: --binary requires a path argument${NC}"
|
| 54 |
+
exit 1
|
| 55 |
+
fi
|
| 56 |
+
;;
|
| 57 |
+
--no-modify-path)
|
| 58 |
+
no_modify_path=true
|
| 59 |
+
shift
|
| 60 |
+
;;
|
| 61 |
+
*)
|
| 62 |
+
echo -e "${ORANGE}Warning: Unknown option '$1'${NC}" >&2
|
| 63 |
+
shift
|
| 64 |
+
;;
|
| 65 |
+
esac
|
| 66 |
+
done
|
| 67 |
+
|
| 68 |
+
INSTALL_DIR=$HOME/.opencode/bin
|
| 69 |
+
mkdir -p "$INSTALL_DIR"
|
| 70 |
+
|
| 71 |
+
# If --binary is provided, skip all download/detection logic
|
| 72 |
+
if [ -n "$binary_path" ]; then
|
| 73 |
+
if [ ! -f "$binary_path" ]; then
|
| 74 |
+
echo -e "${RED}Error: Binary not found at ${binary_path}${NC}"
|
| 75 |
+
exit 1
|
| 76 |
+
fi
|
| 77 |
+
specific_version="local"
|
| 78 |
+
else
|
| 79 |
+
raw_os=$(uname -s)
|
| 80 |
+
os=$(echo "$raw_os" | tr '[:upper:]' '[:lower:]')
|
| 81 |
+
case "$raw_os" in
|
| 82 |
+
Darwin*) os="darwin" ;;
|
| 83 |
+
Linux*) os="linux" ;;
|
| 84 |
+
MINGW*|MSYS*|CYGWIN*) os="windows" ;;
|
| 85 |
+
esac
|
| 86 |
+
|
| 87 |
+
arch=$(uname -m)
|
| 88 |
+
if [[ "$arch" == "aarch64" ]]; then
|
| 89 |
+
arch="arm64"
|
| 90 |
+
fi
|
| 91 |
+
if [[ "$arch" == "x86_64" ]]; then
|
| 92 |
+
arch="x64"
|
| 93 |
+
fi
|
| 94 |
+
|
| 95 |
+
if [ "$os" = "darwin" ] && [ "$arch" = "x64" ]; then
|
| 96 |
+
rosetta_flag=$(sysctl -n sysctl.proc_translated 2>/dev/null || echo 0)
|
| 97 |
+
if [ "$rosetta_flag" = "1" ]; then
|
| 98 |
+
arch="arm64"
|
| 99 |
+
fi
|
| 100 |
+
fi
|
| 101 |
+
|
| 102 |
+
combo="$os-$arch"
|
| 103 |
+
case "$combo" in
|
| 104 |
+
linux-x64|linux-arm64|darwin-x64|darwin-arm64|windows-x64)
|
| 105 |
+
;;
|
| 106 |
+
*)
|
| 107 |
+
echo -e "${RED}Unsupported OS/Arch: $os/$arch${NC}"
|
| 108 |
+
exit 1
|
| 109 |
+
;;
|
| 110 |
+
esac
|
| 111 |
+
|
| 112 |
+
archive_ext=".zip"
|
| 113 |
+
if [ "$os" = "linux" ]; then
|
| 114 |
+
archive_ext=".tar.gz"
|
| 115 |
+
fi
|
| 116 |
+
|
| 117 |
+
is_musl=false
|
| 118 |
+
if [ "$os" = "linux" ]; then
|
| 119 |
+
if [ -f /etc/alpine-release ]; then
|
| 120 |
+
is_musl=true
|
| 121 |
+
fi
|
| 122 |
+
|
| 123 |
+
if command -v ldd >/dev/null 2>&1; then
|
| 124 |
+
if ldd --version 2>&1 | grep -qi musl; then
|
| 125 |
+
is_musl=true
|
| 126 |
+
fi
|
| 127 |
+
fi
|
| 128 |
+
fi
|
| 129 |
+
|
| 130 |
+
needs_baseline=false
|
| 131 |
+
if [ "$arch" = "x64" ]; then
|
| 132 |
+
if [ "$os" = "linux" ]; then
|
| 133 |
+
if ! grep -qwi avx2 /proc/cpuinfo 2>/dev/null; then
|
| 134 |
+
needs_baseline=true
|
| 135 |
+
fi
|
| 136 |
+
fi
|
| 137 |
+
|
| 138 |
+
if [ "$os" = "darwin" ]; then
|
| 139 |
+
avx2=$(sysctl -n hw.optional.avx2_0 2>/dev/null || echo 0)
|
| 140 |
+
if [ "$avx2" != "1" ]; then
|
| 141 |
+
needs_baseline=true
|
| 142 |
+
fi
|
| 143 |
+
fi
|
| 144 |
+
|
| 145 |
+
if [ "$os" = "windows" ]; then
|
| 146 |
+
ps="(Add-Type -MemberDefinition \"[DllImport(\"\"kernel32.dll\"\")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);\" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)"
|
| 147 |
+
out=""
|
| 148 |
+
if command -v powershell.exe >/dev/null 2>&1; then
|
| 149 |
+
out=$(powershell.exe -NoProfile -NonInteractive -Command "$ps" 2>/dev/null || true)
|
| 150 |
+
elif command -v pwsh >/dev/null 2>&1; then
|
| 151 |
+
out=$(pwsh -NoProfile -NonInteractive -Command "$ps" 2>/dev/null || true)
|
| 152 |
+
fi
|
| 153 |
+
out=$(echo "$out" | tr -d '\r' | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')
|
| 154 |
+
if [ "$out" != "true" ] && [ "$out" != "1" ]; then
|
| 155 |
+
needs_baseline=true
|
| 156 |
+
fi
|
| 157 |
+
fi
|
| 158 |
+
fi
|
| 159 |
+
|
| 160 |
+
target="$os-$arch"
|
| 161 |
+
if [ "$needs_baseline" = "true" ]; then
|
| 162 |
+
target="$target-baseline"
|
| 163 |
+
fi
|
| 164 |
+
if [ "$is_musl" = "true" ]; then
|
| 165 |
+
target="$target-musl"
|
| 166 |
+
fi
|
| 167 |
+
|
| 168 |
+
filename="$APP-$target$archive_ext"
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
if [ "$os" = "linux" ]; then
|
| 172 |
+
if ! command -v tar >/dev/null 2>&1; then
|
| 173 |
+
echo -e "${RED}Error: 'tar' is required but not installed.${NC}"
|
| 174 |
+
exit 1
|
| 175 |
+
fi
|
| 176 |
+
else
|
| 177 |
+
if ! command -v unzip >/dev/null 2>&1; then
|
| 178 |
+
echo -e "${RED}Error: 'unzip' is required but not installed.${NC}"
|
| 179 |
+
exit 1
|
| 180 |
+
fi
|
| 181 |
+
fi
|
| 182 |
+
|
| 183 |
+
if [ -z "$requested_version" ]; then
|
| 184 |
+
url="https://github.com/anomalyco/opencode/releases/latest/download/$filename"
|
| 185 |
+
specific_version=$(curl -s https://api.github.com/repos/anomalyco/opencode/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p')
|
| 186 |
+
|
| 187 |
+
if [[ $? -ne 0 || -z "$specific_version" ]]; then
|
| 188 |
+
echo -e "${RED}Failed to fetch version information${NC}"
|
| 189 |
+
exit 1
|
| 190 |
+
fi
|
| 191 |
+
else
|
| 192 |
+
# Strip leading 'v' if present
|
| 193 |
+
requested_version="${requested_version#v}"
|
| 194 |
+
url="https://github.com/anomalyco/opencode/releases/download/v${requested_version}/$filename"
|
| 195 |
+
specific_version=$requested_version
|
| 196 |
+
|
| 197 |
+
# Verify the release exists before downloading
|
| 198 |
+
http_status=$(curl -sI -o /dev/null -w "%{http_code}" "https://github.com/anomalyco/opencode/releases/tag/v${requested_version}")
|
| 199 |
+
if [ "$http_status" = "404" ]; then
|
| 200 |
+
echo -e "${RED}Error: Release v${requested_version} not found${NC}"
|
| 201 |
+
echo -e "${MUTED}Available releases: https://github.com/anomalyco/opencode/releases${NC}"
|
| 202 |
+
exit 1
|
| 203 |
+
fi
|
| 204 |
+
fi
|
| 205 |
+
fi
|
| 206 |
+
|
| 207 |
+
print_message() {
|
| 208 |
+
local level=$1
|
| 209 |
+
local message=$2
|
| 210 |
+
local color=""
|
| 211 |
+
|
| 212 |
+
case $level in
|
| 213 |
+
info) color="${NC}" ;;
|
| 214 |
+
warning) color="${NC}" ;;
|
| 215 |
+
error) color="${RED}" ;;
|
| 216 |
+
esac
|
| 217 |
+
|
| 218 |
+
echo -e "${color}${message}${NC}"
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
check_version() {
|
| 222 |
+
if command -v opencode >/dev/null 2>&1; then
|
| 223 |
+
opencode_path=$(which opencode)
|
| 224 |
+
|
| 225 |
+
## Check the installed version
|
| 226 |
+
installed_version=$(opencode --version 2>/dev/null || echo "")
|
| 227 |
+
|
| 228 |
+
if [[ "$installed_version" != "$specific_version" ]]; then
|
| 229 |
+
print_message info "${MUTED}Installed version: ${NC}$installed_version."
|
| 230 |
+
else
|
| 231 |
+
print_message info "${MUTED}Version ${NC}$specific_version${MUTED} already installed"
|
| 232 |
+
exit 0
|
| 233 |
+
fi
|
| 234 |
+
fi
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
unbuffered_sed() {
|
| 238 |
+
if echo | sed -u -e "" >/dev/null 2>&1; then
|
| 239 |
+
sed -nu "$@"
|
| 240 |
+
elif echo | sed -l -e "" >/dev/null 2>&1; then
|
| 241 |
+
sed -nl "$@"
|
| 242 |
+
else
|
| 243 |
+
local pad="$(printf "\n%512s" "")"
|
| 244 |
+
sed -ne "s/$/\\${pad}/" "$@"
|
| 245 |
+
fi
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
print_progress() {
|
| 249 |
+
local bytes="$1"
|
| 250 |
+
local length="$2"
|
| 251 |
+
[ "$length" -gt 0 ] || return 0
|
| 252 |
+
|
| 253 |
+
local width=50
|
| 254 |
+
local percent=$(( bytes * 100 / length ))
|
| 255 |
+
[ "$percent" -gt 100 ] && percent=100
|
| 256 |
+
local on=$(( percent * width / 100 ))
|
| 257 |
+
local off=$(( width - on ))
|
| 258 |
+
|
| 259 |
+
local filled=$(printf "%*s" "$on" "")
|
| 260 |
+
filled=${filled// /■}
|
| 261 |
+
local empty=$(printf "%*s" "$off" "")
|
| 262 |
+
empty=${empty// /・}
|
| 263 |
+
|
| 264 |
+
printf "\r${ORANGE}%s%s %3d%%${NC}" "$filled" "$empty" "$percent" >&4
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
download_with_progress() {
|
| 268 |
+
local url="$1"
|
| 269 |
+
local output="$2"
|
| 270 |
+
|
| 271 |
+
if [ -t 2 ]; then
|
| 272 |
+
exec 4>&2
|
| 273 |
+
else
|
| 274 |
+
exec 4>/dev/null
|
| 275 |
+
fi
|
| 276 |
+
|
| 277 |
+
local tmp_dir=${TMPDIR:-/tmp}
|
| 278 |
+
local basename="${tmp_dir}/opencode_install_$$"
|
| 279 |
+
local tracefile="${basename}.trace"
|
| 280 |
+
|
| 281 |
+
rm -f "$tracefile"
|
| 282 |
+
mkfifo "$tracefile"
|
| 283 |
+
|
| 284 |
+
# Hide cursor
|
| 285 |
+
printf "\033[?25l" >&4
|
| 286 |
+
|
| 287 |
+
trap "trap - RETURN; rm -f \"$tracefile\"; printf '\033[?25h' >&4; exec 4>&-" RETURN
|
| 288 |
+
|
| 289 |
+
(
|
| 290 |
+
curl --trace-ascii "$tracefile" -s -L -o "$output" "$url"
|
| 291 |
+
) &
|
| 292 |
+
local curl_pid=$!
|
| 293 |
+
|
| 294 |
+
unbuffered_sed \
|
| 295 |
+
-e 'y/ACDEGHLNORTV/acdeghlnortv/' \
|
| 296 |
+
-e '/^0000: content-length:/p' \
|
| 297 |
+
-e '/^<= recv data/p' \
|
| 298 |
+
"$tracefile" | \
|
| 299 |
+
{
|
| 300 |
+
local length=0
|
| 301 |
+
local bytes=0
|
| 302 |
+
|
| 303 |
+
while IFS=" " read -r -a line; do
|
| 304 |
+
[ "${#line[@]}" -lt 2 ] && continue
|
| 305 |
+
local tag="${line[0]} ${line[1]}"
|
| 306 |
+
|
| 307 |
+
if [ "$tag" = "0000: content-length:" ]; then
|
| 308 |
+
length="${line[2]}"
|
| 309 |
+
length=$(echo "$length" | tr -d '\r')
|
| 310 |
+
bytes=0
|
| 311 |
+
elif [ "$tag" = "<= recv" ]; then
|
| 312 |
+
local size="${line[3]}"
|
| 313 |
+
bytes=$(( bytes + size ))
|
| 314 |
+
if [ "$length" -gt 0 ]; then
|
| 315 |
+
print_progress "$bytes" "$length"
|
| 316 |
+
fi
|
| 317 |
+
fi
|
| 318 |
+
done
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
wait $curl_pid
|
| 322 |
+
local ret=$?
|
| 323 |
+
echo "" >&4
|
| 324 |
+
return $ret
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
download_and_install() {
|
| 328 |
+
print_message info "\n${MUTED}Installing ${NC}opencode ${MUTED}version: ${NC}$specific_version"
|
| 329 |
+
local tmp_dir="${TMPDIR:-/tmp}/opencode_install_$$"
|
| 330 |
+
mkdir -p "$tmp_dir"
|
| 331 |
+
|
| 332 |
+
if [[ "$os" == "windows" ]] || ! [ -t 2 ] || ! download_with_progress "$url" "$tmp_dir/$filename"; then
|
| 333 |
+
# Fallback to standard curl on Windows, non-TTY environments, or if custom progress fails
|
| 334 |
+
curl -# -L -o "$tmp_dir/$filename" "$url"
|
| 335 |
+
fi
|
| 336 |
+
|
| 337 |
+
if [ "$os" = "linux" ]; then
|
| 338 |
+
tar -xzf "$tmp_dir/$filename" -C "$tmp_dir"
|
| 339 |
+
else
|
| 340 |
+
unzip -q "$tmp_dir/$filename" -d "$tmp_dir"
|
| 341 |
+
fi
|
| 342 |
+
|
| 343 |
+
mv "$tmp_dir/opencode" "$INSTALL_DIR"
|
| 344 |
+
chmod 755 "${INSTALL_DIR}/opencode"
|
| 345 |
+
rm -rf "$tmp_dir"
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
install_from_binary() {
|
| 349 |
+
print_message info "\n${MUTED}Installing ${NC}opencode ${MUTED}from: ${NC}$binary_path"
|
| 350 |
+
cp "$binary_path" "${INSTALL_DIR}/opencode"
|
| 351 |
+
chmod 755 "${INSTALL_DIR}/opencode"
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
if [ -n "$binary_path" ]; then
|
| 355 |
+
install_from_binary
|
| 356 |
+
else
|
| 357 |
+
check_version
|
| 358 |
+
download_and_install
|
| 359 |
+
fi
|
| 360 |
+
|
| 361 |
+
|
| 362 |
+
add_to_path() {
|
| 363 |
+
local config_file=$1
|
| 364 |
+
local command=$2
|
| 365 |
+
|
| 366 |
+
if grep -Fxq "$command" "$config_file"; then
|
| 367 |
+
print_message info "Command already exists in $config_file, skipping write."
|
| 368 |
+
elif [[ -w $config_file ]]; then
|
| 369 |
+
echo -e "\n# opencode" >> "$config_file"
|
| 370 |
+
echo "$command" >> "$config_file"
|
| 371 |
+
print_message info "${MUTED}Successfully added ${NC}opencode ${MUTED}to \$PATH in ${NC}$config_file"
|
| 372 |
+
else
|
| 373 |
+
print_message warning "Manually add the directory to $config_file (or similar):"
|
| 374 |
+
print_message info " $command"
|
| 375 |
+
fi
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
| 379 |
+
|
| 380 |
+
current_shell=$(basename "$SHELL")
|
| 381 |
+
case $current_shell in
|
| 382 |
+
fish)
|
| 383 |
+
config_files="$HOME/.config/fish/config.fish"
|
| 384 |
+
;;
|
| 385 |
+
zsh)
|
| 386 |
+
config_files="${ZDOTDIR:-$HOME}/.zshrc ${ZDOTDIR:-$HOME}/.zshenv $XDG_CONFIG_HOME/zsh/.zshrc $XDG_CONFIG_HOME/zsh/.zshenv"
|
| 387 |
+
;;
|
| 388 |
+
bash)
|
| 389 |
+
config_files="$HOME/.bashrc $HOME/.bash_profile $HOME/.profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile"
|
| 390 |
+
;;
|
| 391 |
+
ash)
|
| 392 |
+
config_files="$HOME/.ashrc $HOME/.profile /etc/profile"
|
| 393 |
+
;;
|
| 394 |
+
sh)
|
| 395 |
+
config_files="$HOME/.ashrc $HOME/.profile /etc/profile"
|
| 396 |
+
;;
|
| 397 |
+
*)
|
| 398 |
+
# Default case if none of the above matches
|
| 399 |
+
config_files="$HOME/.bashrc $HOME/.bash_profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile"
|
| 400 |
+
;;
|
| 401 |
+
esac
|
| 402 |
+
|
| 403 |
+
if [[ "$no_modify_path" != "true" ]]; then
|
| 404 |
+
config_file=""
|
| 405 |
+
for file in $config_files; do
|
| 406 |
+
if [[ -f $file ]]; then
|
| 407 |
+
config_file=$file
|
| 408 |
+
break
|
| 409 |
+
fi
|
| 410 |
+
done
|
| 411 |
+
|
| 412 |
+
if [[ -z $config_file ]]; then
|
| 413 |
+
print_message warning "No config file found for $current_shell. You may need to manually add to PATH:"
|
| 414 |
+
print_message info " export PATH=$INSTALL_DIR:\$PATH"
|
| 415 |
+
elif [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
|
| 416 |
+
case $current_shell in
|
| 417 |
+
fish)
|
| 418 |
+
add_to_path "$config_file" "fish_add_path $INSTALL_DIR"
|
| 419 |
+
;;
|
| 420 |
+
zsh)
|
| 421 |
+
add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"
|
| 422 |
+
;;
|
| 423 |
+
bash)
|
| 424 |
+
add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"
|
| 425 |
+
;;
|
| 426 |
+
ash)
|
| 427 |
+
add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"
|
| 428 |
+
;;
|
| 429 |
+
sh)
|
| 430 |
+
add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH"
|
| 431 |
+
;;
|
| 432 |
+
*)
|
| 433 |
+
export PATH=$INSTALL_DIR:$PATH
|
| 434 |
+
print_message warning "Manually add the directory to $config_file (or similar):"
|
| 435 |
+
print_message info " export PATH=$INSTALL_DIR:\$PATH"
|
| 436 |
+
;;
|
| 437 |
+
esac
|
| 438 |
+
fi
|
| 439 |
+
fi
|
| 440 |
+
|
| 441 |
+
if [ -n "${GITHUB_ACTIONS-}" ] && [ "${GITHUB_ACTIONS}" == "true" ]; then
|
| 442 |
+
echo "$INSTALL_DIR" >> $GITHUB_PATH
|
| 443 |
+
print_message info "Added $INSTALL_DIR to \$GITHUB_PATH"
|
| 444 |
+
fi
|
| 445 |
+
|
| 446 |
+
echo -e ""
|
| 447 |
+
echo -e "${MUTED} ${NC} ▄ "
|
| 448 |
+
echo -e "${MUTED}█▀▀█ █▀▀█ █▀▀█ █▀▀▄ ${NC}█▀▀▀ █▀▀█ █▀▀█ █▀▀█"
|
| 449 |
+
echo -e "${MUTED}█░░█ █░░█ █▀▀▀ █░░█ ${NC}█░░░ █░░█ █░░█ █▀▀▀"
|
| 450 |
+
echo -e "${MUTED}▀▀▀▀ █▀▀▀ ▀▀▀▀ ▀ ▀ ${NC}▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"
|
| 451 |
+
echo -e ""
|
| 452 |
+
echo -e ""
|
| 453 |
+
echo -e "${MUTED}OpenCode includes free models, to start:${NC}"
|
| 454 |
+
echo -e ""
|
| 455 |
+
echo -e "cd <project> ${MUTED}# Open directory${NC}"
|
| 456 |
+
echo -e "opencode ${MUTED}# Run command${NC}"
|
| 457 |
+
echo -e ""
|
| 458 |
+
echo -e "${MUTED}For more information visit ${NC}https://opencode.ai/docs"
|
| 459 |
+
echo -e ""
|
| 460 |
+
echo -e ""
|
packages/cli/bunfig.toml
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
preload = ["@opentui/solid/preload"]
|
packages/cli/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/package.json",
|
| 3 |
+
"name": "@opencode-ai/cli",
|
| 4 |
+
"version": "1.18.31",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"license": "MIT",
|
| 7 |
+
"bin": {
|
| 8 |
+
"lildax": "./bin/lildax.cjs"
|
| 9 |
+
},
|
| 10 |
+
"files": [
|
| 11 |
+
"bin"
|
| 12 |
+
],
|
| 13 |
+
"scripts": {
|
| 14 |
+
"build": "bun run script/build.ts",
|
| 15 |
+
"dev": "bun run src/index.ts",
|
| 16 |
+
"typecheck": "tsgo --noEmit"
|
| 17 |
+
},
|
| 18 |
+
"dependencies": {
|
| 19 |
+
"@effect/platform-node": "catalog:",
|
| 20 |
+
"@opencode-ai/core": "workspace:*",
|
| 21 |
+
"@opencode-ai/sdk": "workspace:*",
|
| 22 |
+
"@opencode-ai/server": "workspace:*",
|
| 23 |
+
"@opencode-ai/tui": "workspace:*",
|
| 24 |
+
"@opentui/core": "catalog:",
|
| 25 |
+
"@opentui/solid": "catalog:",
|
| 26 |
+
"@parcel/watcher": "2.5.1",
|
| 27 |
+
"effect": "catalog:",
|
| 28 |
+
"solid-js": "catalog:"
|
| 29 |
+
},
|
| 30 |
+
"devDependencies": {
|
| 31 |
+
"@opencode-ai/script": "workspace:*",
|
| 32 |
+
"@tsconfig/bun": "catalog:",
|
| 33 |
+
"@types/bun": "catalog:",
|
| 34 |
+
"@typescript/native-preview": "catalog:"
|
| 35 |
+
}
|
| 36 |
+
}
|
packages/cli/sst-env.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file is auto-generated by SST. Do not edit. */
|
| 2 |
+
/* tslint:disable */
|
| 3 |
+
/* eslint-disable */
|
| 4 |
+
/* deno-fmt-ignore-file */
|
| 5 |
+
/* biome-ignore-all lint: auto-generated */
|
| 6 |
+
|
| 7 |
+
/// <reference path="../../sst-env.d.ts" />
|
| 8 |
+
|
| 9 |
+
import "sst"
|
| 10 |
+
export {}
|
packages/cli/tsconfig.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/tsconfig",
|
| 3 |
+
"extends": "@tsconfig/bun/tsconfig.json",
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"jsx": "preserve",
|
| 6 |
+
"jsxImportSource": "@opentui/solid",
|
| 7 |
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
| 8 |
+
"noUncheckedIndexedAccess": false
|
| 9 |
+
}
|
| 10 |
+
}
|
packages/client/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @opencode-ai/client
|
| 2 |
+
|
| 3 |
+
Private generation target for clients derived directly from OpenCode's authoritative Effect `HttpApi`.
|
| 4 |
+
|
| 5 |
+
## Entrypoints
|
| 6 |
+
|
| 7 |
+
- `@opencode-ai/client`: zero-Effect Promise client using `fetch`.
|
| 8 |
+
- `@opencode-ai/client/effect`: rich Effect network client using an environment-provided `HttpClient`.
|
| 9 |
+
|
| 10 |
+
The generated surface includes every standard HTTP group from Server's concrete API. The build compiler reads `@opencode-ai/server/api`; the generated Effect runtime imports a client-local projection built from Protocol, with a generation-equivalence test preventing transport drift. Custom transports such as the PTY WebSocket connection remain outside the generic HTTP client. Run `bun run generate` after changing the contract and `bun run check:generated` to detect committed-output drift.
|
| 11 |
+
|
| 12 |
+
The Effect entrypoint uses canonical decoded values such as `Session.ID`, `Location.Ref`, and `Prompt`. These datatypes come from the lightweight `@opencode-ai/schema` package and are re-exported so callers depend only on the client surface. Protocol owns endpoint construction and middleware placement; Server supplies the concrete middleware keys used by the build-time API.
|
| 13 |
+
|
| 14 |
+
The Promise root remains structural and has no Core or Effect runtime dependency. `/effect` depends only on Effect, Schema, and Protocol and is browser-bundle safe. Bundle-boundary tests enforce both import graphs.
|
| 15 |
+
|
| 16 |
+
Effect consumers construct canonical decoded inputs:
|
| 17 |
+
|
| 18 |
+
```ts
|
| 19 |
+
import { AbsolutePath, Location, OpenCode, Prompt } from "@opencode-ai/client/effect"
|
| 20 |
+
|
| 21 |
+
const client = yield * OpenCode.make({ baseUrl: "https://opencode.example" })
|
| 22 |
+
yield *
|
| 23 |
+
client.sessions.create({
|
| 24 |
+
location: Location.Ref.make({ directory: AbsolutePath.make("/workspace") }),
|
| 25 |
+
})
|
| 26 |
+
yield * client.sessions.prompt({ sessionID, prompt: Prompt.make({ text: "Hello" }) })
|
| 27 |
+
```
|
packages/client/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/package.json",
|
| 3 |
+
"name": "@opencode-ai/client",
|
| 4 |
+
"private": true,
|
| 5 |
+
"type": "module",
|
| 6 |
+
"license": "MIT",
|
| 7 |
+
"exports": {
|
| 8 |
+
".": "./src/index.ts",
|
| 9 |
+
"./effect": "./src/effect.ts"
|
| 10 |
+
},
|
| 11 |
+
"scripts": {
|
| 12 |
+
"generate": "bun run script/build.ts",
|
| 13 |
+
"check:generated": "bun run generate && git diff --exit-code -- src/generated src/generated-effect",
|
| 14 |
+
"test": "bun test --timeout 5000",
|
| 15 |
+
"typecheck": "tsgo --noEmit"
|
| 16 |
+
},
|
| 17 |
+
"dependencies": {
|
| 18 |
+
"@opencode-ai/schema": "workspace:*",
|
| 19 |
+
"@opencode-ai/protocol": "workspace:*"
|
| 20 |
+
},
|
| 21 |
+
"peerDependencies": {
|
| 22 |
+
"effect": "4.0.0-beta.83"
|
| 23 |
+
},
|
| 24 |
+
"peerDependenciesMeta": {
|
| 25 |
+
"effect": {
|
| 26 |
+
"optional": true
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"devDependencies": {
|
| 30 |
+
"@effect/platform-node": "catalog:",
|
| 31 |
+
"@opencode-ai/core": "workspace:*",
|
| 32 |
+
"@opencode-ai/httpapi-codegen": "workspace:*",
|
| 33 |
+
"@opencode-ai/server": "workspace:*",
|
| 34 |
+
"@tsconfig/bun": "catalog:",
|
| 35 |
+
"@types/bun": "catalog:",
|
| 36 |
+
"@typescript/native-preview": "catalog:",
|
| 37 |
+
"effect": "catalog:"
|
| 38 |
+
}
|
| 39 |
+
}
|
packages/client/sst-env.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file is auto-generated by SST. Do not edit. */
|
| 2 |
+
/* tslint:disable */
|
| 3 |
+
/* eslint-disable */
|
| 4 |
+
/* deno-fmt-ignore-file */
|
| 5 |
+
/* biome-ignore-all lint: auto-generated */
|
| 6 |
+
|
| 7 |
+
/// <reference path="../../sst-env.d.ts" />
|
| 8 |
+
|
| 9 |
+
import "sst"
|
| 10 |
+
export {}
|
packages/client/tsconfig.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/tsconfig",
|
| 3 |
+
"extends": "@tsconfig/bun/tsconfig.json",
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
| 6 |
+
"noUncheckedIndexedAccess": false
|
| 7 |
+
},
|
| 8 |
+
"include": ["src"]
|
| 9 |
+
}
|
packages/codemode/AGENTS.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @opencode-ai/codemode
|
| 2 |
+
|
| 3 |
+
- This local package owns confined execution over explicit schema-described tools. Applications own authorization, persistence, external authority, and tool-specific delivery semantics.
|
| 4 |
+
- Do not add a speculative generic permission or approval policy. A host omits tools it does not expose and enforces domain authorization inside each provided tool.
|
| 5 |
+
- Keep Code Mode unaware of host session, channel, and conversation models. The hosting application supplies trusted execution scope around it.
|
| 6 |
+
- Tool schemas are the model-facing Interface. Keep arguments minimal and natural to the operation; never add unrelated IDs as ambient capability tokens.
|
| 7 |
+
|
| 8 |
+
## OpenAPI
|
| 9 |
+
|
| 10 |
+
- Generate an operation only when its transport semantics are supported; otherwise return a precise `skipped` reason.
|
| 11 |
+
- Never guess parameter serialization or malformed security semantics. Unsupported serialization is skipped and malformed security fails closed.
|
| 12 |
+
- Render unresolved schema constructs as `unknown`, never as invented TypeScript names.
|
| 13 |
+
- Keep network reads bounded and map expected encoding, transport, and decoding failures to model-safe `ToolError` values.
|
| 14 |
+
- Test supported behavior directly; do not reproduce adapter algorithms in tests.
|
| 15 |
+
|
| 16 |
+
## Future Design Notes
|
| 17 |
+
|
| 18 |
+
- If a captured user-visible output channel returns (an earlier `output.text`/`output.file`/`output.image` API was removed from v1), keep `output` as its name, distinct from the program return value: `return` stays the structured result for the model, while `output.*` describes artifacts the host may render into a conversation or UI after execution. Keep this host-neutral and let applications decide how captured output is delivered. In v1, hosts collect media host-side (outside the sandbox) instead.
|
| 19 |
+
- Improve the sandbox failure taxonomy. Distinguish parse/compile mistakes, unsupported syntax, user-thrown errors, invalid returned data, tool refusal, tool internal failure, timeout, and genuine runtime defects so agents can recover accurately instead of treating everything as a generic execution failure.
|
| 20 |
+
- Preserve the public/private error split. Tool authors should be able to return a safe model-visible message while retaining a private cause for host diagnostics. Unknown host failures must remain sanitized by default.
|
| 21 |
+
- Think deliberately about richer binary boundaries before allowing `Blob`, `File`, `ArrayBuffer`, streams, or typed arrays beyond today's JSON-like values. If CodeMode supports binary tool args/results, use explicit tagged data shapes and clear size limits rather than relying on ambient runtime serialization.
|
| 22 |
+
- Keep host capabilities explicit. Globals such as `fetch`, `crypto`, filesystem handles, extra modules, or network clients should be opt-in runtime capabilities with obvious policy defaults, not ambient authority. Default to unavailable unless a host deliberately provides the capability.
|
| 23 |
+
- If `fetch` is added, model it as a host-provided outbound capability with policy controls: allowed origins, methods, headers, response size, timeout, and whether response bodies may be returned, emitted, or only summarized through a tool.
|
packages/codemode/README.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @opencode-ai/codemode
|
| 2 |
+
|
| 3 |
+
Effect-native confined code execution over explicit, schema-described tools.
|
| 4 |
+
|
| 5 |
+
CodeMode lets a model write a small JavaScript program that can call only the tools supplied by the host. The program can sequence calls, transform plain data, branch, loop, and run independent calls in parallel without receiving ambient filesystem, process, network, module, or application authority.
|
| 6 |
+
|
| 7 |
+
The package is currently private to this workspace. Its API is designed around one-shot and reusable execution:
|
| 8 |
+
|
| 9 |
+
```ts
|
| 10 |
+
// One execution
|
| 11 |
+
yield * CodeMode.execute({ tools, code })
|
| 12 |
+
|
| 13 |
+
// A reusable runtime
|
| 14 |
+
const runtime = CodeMode.make({ tools, limits })
|
| 15 |
+
yield * runtime.execute(code)
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
## Install
|
| 19 |
+
|
| 20 |
+
Within this workspace:
|
| 21 |
+
|
| 22 |
+
```json
|
| 23 |
+
{
|
| 24 |
+
"dependencies": {
|
| 25 |
+
"@opencode-ai/codemode": "workspace:*"
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
Hosts interact with CodeMode through `effect` (tool `run` implementations, `Effect`-typed results), so they should depend on `effect` themselves.
|
| 31 |
+
|
| 32 |
+
## Quick Start
|
| 33 |
+
|
| 34 |
+
Define tools with Effect Schema, then place them in the object tree exposed to programs as `tools`:
|
| 35 |
+
|
| 36 |
+
```ts
|
| 37 |
+
import { CodeMode, Tool } from "@opencode-ai/codemode"
|
| 38 |
+
import { Effect, Schema } from "effect"
|
| 39 |
+
|
| 40 |
+
const lookupOrder = Tool.make({
|
| 41 |
+
description: "Look up an order by ID",
|
| 42 |
+
input: Schema.Struct({ id: Schema.String }),
|
| 43 |
+
output: Schema.Struct({ id: Schema.String, status: Schema.String }),
|
| 44 |
+
run: ({ id }) => Effect.succeed({ id, status: "open" }),
|
| 45 |
+
})
|
| 46 |
+
|
| 47 |
+
const runtime = CodeMode.make({
|
| 48 |
+
tools: {
|
| 49 |
+
orders: {
|
| 50 |
+
lookup: lookupOrder,
|
| 51 |
+
},
|
| 52 |
+
},
|
| 53 |
+
})
|
| 54 |
+
|
| 55 |
+
const result =
|
| 56 |
+
yield *
|
| 57 |
+
runtime.execute(`
|
| 58 |
+
const order = await tools.orders.lookup({ id: "order_42" })
|
| 59 |
+
return { id: order.id, needsAttention: order.status !== "complete" }
|
| 60 |
+
`)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
`result` is always a `CodeMode.Result`. Program, validation, limit, and tool failures are returned as diagnostics rather than failing the Effect. Host interruption remains interruption.
|
| 64 |
+
|
| 65 |
+
Successful result values are JSON-safe data. A program that returns `undefined`, including by reaching the end without `return`, produces `null`; nested `undefined` values are normalized to `null` as well.
|
| 66 |
+
|
| 67 |
+
## API
|
| 68 |
+
|
| 69 |
+
### `Tool.make`
|
| 70 |
+
|
| 71 |
+
```ts
|
| 72 |
+
const tool = Tool.make({
|
| 73 |
+
description,
|
| 74 |
+
input, // Effect Schema (validating) or JSON Schema (render-only)
|
| 75 |
+
output, // optional; same choice
|
| 76 |
+
run,
|
| 77 |
+
})
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
`input` and `output` each accept a validating Effect Schema or a render-only JSON Schema document (the natural shape for adapter-provided tools whose schemas arrive as JSON Schema, e.g. MCP definitions). Effect Schema input is decoded before `run` is invoked, and `run` returns the encoded representation of an Effect Schema `output`, which CodeMode decodes and copies before exposing it to the program. JSON Schemas only shape the model-visible signature; values pass through unvalidated (they still cross the plain-data boundary).
|
| 81 |
+
|
| 82 |
+
`output` is optional. Without it the tool's signature advertises `Promise<unknown>` and the host result is exposed as-is.
|
| 83 |
+
|
| 84 |
+
The description and schemas are part of the model-visible tool contract. Keep descriptions concrete and put authorization in `run` or in the service it calls.
|
| 85 |
+
|
| 86 |
+
Public tool types are grouped under the same namespace: `Tool.Definition`, `Tool.Options`, `Tool.SchemaType`, and `Tool.JsonSchema`.
|
| 87 |
+
|
| 88 |
+
### `CodeMode.execute`
|
| 89 |
+
|
| 90 |
+
Use `CodeMode.execute` for a single execution:
|
| 91 |
+
|
| 92 |
+
```ts
|
| 93 |
+
const result =
|
| 94 |
+
yield *
|
| 95 |
+
CodeMode.execute({
|
| 96 |
+
tools: { orders: { lookup: lookupOrder } },
|
| 97 |
+
code: `return await tools.orders.lookup({ id: "order_42" })`,
|
| 98 |
+
limits: { maxToolCalls: 10 },
|
| 99 |
+
onToolCallStart: (call) => Effect.logDebug("CodeMode tool started", call),
|
| 100 |
+
onToolCallEnd: (call) => Effect.logDebug("CodeMode tool settled", call),
|
| 101 |
+
})
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
The Effect environment is inferred from the supplied tools. CodeMode does not erase service requirements introduced by tool implementations.
|
| 105 |
+
|
| 106 |
+
### `CodeMode.make`
|
| 107 |
+
|
| 108 |
+
Use `CodeMode.make` when the tool set and execution policy are reused:
|
| 109 |
+
|
| 110 |
+
```ts
|
| 111 |
+
const runtime = CodeMode.make({
|
| 112 |
+
tools: { orders: { lookup: lookupOrder } },
|
| 113 |
+
limits: { timeoutMs: 30_000 },
|
| 114 |
+
})
|
| 115 |
+
|
| 116 |
+
runtime.catalog() // structured tool descriptions
|
| 117 |
+
runtime.instructions() // model-facing syntax and tool guide
|
| 118 |
+
runtime.execute(source) // CodeMode.Result
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
`CodeMode.Input`, `CodeMode.Result`, `CodeMode.Success`, `CodeMode.Failure`, `CodeMode.Diagnostic`, and `CodeMode.DiagnosticKind` are both Effect schemas and their inferred TypeScript types. Hosts can combine `CodeMode.Input` and `CodeMode.Result` with `runtime.instructions()` and `runtime.execute()` when constructing a framework-specific agent tool.
|
| 122 |
+
|
| 123 |
+
All other CodeMode types use the same namespace: `CodeMode.Options`, `CodeMode.ExecuteOptions`, `CodeMode.Runtime`, `CodeMode.ExecutionLimits`, `CodeMode.DiscoveryOptions`, `CodeMode.DataValue`, `CodeMode.ToolDescription`, and the `CodeMode.ToolCall*` observation types.
|
| 124 |
+
|
| 125 |
+
### Results
|
| 126 |
+
|
| 127 |
+
```ts
|
| 128 |
+
type Result = Success | Failure
|
| 129 |
+
|
| 130 |
+
interface Success {
|
| 131 |
+
readonly ok: true
|
| 132 |
+
readonly value: CodeMode.DataValue
|
| 133 |
+
readonly logs?: ReadonlyArray<string>
|
| 134 |
+
readonly truncated?: boolean
|
| 135 |
+
readonly toolCalls: ReadonlyArray<CodeMode.ToolCall>
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
interface Failure {
|
| 139 |
+
readonly ok: false
|
| 140 |
+
readonly error: CodeMode.Diagnostic
|
| 141 |
+
readonly logs?: ReadonlyArray<string>
|
| 142 |
+
readonly truncated?: boolean
|
| 143 |
+
readonly toolCalls: ReadonlyArray<CodeMode.ToolCall>
|
| 144 |
+
}
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
`toolCalls` contains the names of calls admitted by the runtime in call order. It is retained on failure so hosts can audit partial execution without exposing inputs or host failures. `truncated` is present when the value or logs were cut to fit `maxOutputBytes` (see Execution Limits).
|
| 148 |
+
|
| 149 |
+
### Tool-call hooks
|
| 150 |
+
|
| 151 |
+
`onToolCallStart` receives `{ index, name, input }` after input decoding and before tool execution. The input is decoded host-side data and may include values produced by schema transformations; applications should avoid logging sensitive tool arguments indiscriminately.
|
| 152 |
+
|
| 153 |
+
`onToolCallEnd` receives `{ index, name, input, durationMs, outcome, message? }` when an admitted call settles. `outcome` is `"success"` or `"failure"`; `message` is the model-safe failure message and is present only on failure. Interrupted calls (for example when the execution timeout fires) do not produce an end event. Both hooks are Effect-returning and must not fail.
|
| 154 |
+
|
| 155 |
+
### OpenAPI tools
|
| 156 |
+
|
| 157 |
+
`OpenAPI.fromSpec` turns an OpenAPI 3.x document into a tool subtree - one tool per operation. Dotted `operationId` values form namespaces such as `v2.session.get`. Missing IDs receive a flat method/path fallback such as `getUsersById`; names are sanitized and deduplicated. The host places the subtree under a key in its `tools` tree; that key is the model-visible namespace.
|
| 158 |
+
|
| 159 |
+
```ts
|
| 160 |
+
import { CodeMode, OpenAPI } from "@opencode-ai/codemode"
|
| 161 |
+
import { Effect } from "effect"
|
| 162 |
+
import { FetchHttpClient } from "effect/unstable/http"
|
| 163 |
+
|
| 164 |
+
const api = OpenAPI.fromSpec({
|
| 165 |
+
spec: await Bun.file("openapi.json").json(), // parsed document (no YAML)
|
| 166 |
+
auth: {
|
| 167 |
+
resolve: ({ name, scopes, operation }) =>
|
| 168 |
+
name === "BearerAuth" ? Effect.succeed({ type: "bearer", token }) : Effect.succeed(undefined),
|
| 169 |
+
},
|
| 170 |
+
})
|
| 171 |
+
|
| 172 |
+
const runtime = CodeMode.make({ tools: { opencode: api.tools } })
|
| 173 |
+
const result = await Effect.runPromise(runtime.execute(code).pipe(Effect.provide(FetchHttpClient.layer)))
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
`fromSpec` is synchronous and returns `{ tools, skipped }`. The initial adapter supports query `form`/`deepObject`, path/header `simple`, JSON request bodies, JSON responses, and text responses; unsupported parameter encodings, non-JSON request bodies, binary responses, and streaming operations land in `skipped` instead of producing broken tools. Operation and path servers take precedence over document servers unless `baseUrl` explicitly overrides all of them. Tool inputs flatten path, query, header, and closed object-body fields into one model-facing object while retaining their HTTP locations internally. Cross-location name collisions receive a location prefix such as `path_id` and `query_id`; composed, nullable, dictionary, conditionally-required, and non-object JSON bodies remain under `body`. Auth is never model-visible. Responses are limited to 50 MiB, and non-2xx responses become safe tool failures carrying the status and a size-capped body summary. Deferred capabilities are tracked in `src/openapi/TODO.md`.
|
| 177 |
+
|
| 178 |
+
Supported bearer, basic, header, and query authentication follows OpenAPI `security` semantics and is resolved host-side via `auth.resolve` - credential storage, OAuth flows, and token refresh never enter the compiler. Cookie authentication alternatives are discarded; an operation is skipped when it has no supported alternative. See the option docstrings in `src/openapi/types.ts` for the full semantics. Generated tools require `HttpClient.HttpClient` (from `effect/unstable/http`) in the Effect environment - provide `FetchHttpClient.layer` or a custom/test client layer at execution. The supplied client owns redirect policy; credentialed hosts should reject redirects or strip credentials when the origin changes.
|
| 179 |
+
|
| 180 |
+
## Discovery
|
| 181 |
+
|
| 182 |
+
The agent-tool instructions use a budgeted catalog. Every tool namespace is always listed with its tool count regardless of budget, and as many complete, JSDoc-annotated tool signatures (each with a one-line description) as fit an estimated-token budget are inlined. Schema field descriptions and tags are part of each signature's measured cost. Selection is round-robin across namespaces for fairness: in each round (namespaces alphabetical), every namespace still holding un-inlined tools attempts to place its next-cheapest signature against the shared budget, and a namespace whose next signature does not fit drops out while the others keep going - so every namespace gets some representation before any namespace gets everything. The instructions state exactly how comprehensive the list is, both overall (`COMPLETE list` vs `PARTIAL - N of M shown`) and per namespace (`(3 tools)`, `(3 tools, 1 shown)`, `(3 tools, none shown)`).
|
| 183 |
+
|
| 184 |
+
The catalog-entry budget defaults to 2,000 estimated tokens (characters / 4, the same heuristic OpenCode uses). It applies only to full tool entries shown in the catalog; fixed instructions and namespace summaries are not counted. Override it when constructing a runtime:
|
| 185 |
+
|
| 186 |
+
```ts
|
| 187 |
+
const runtime = CodeMode.make({
|
| 188 |
+
tools,
|
| 189 |
+
discovery: { catalogBudget: 6_000 },
|
| 190 |
+
})
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
The budget must be a non-negative safe integer.
|
| 194 |
+
|
| 195 |
+
The runtime search tool is always registered - including when the catalog is fully inlined - so a speculative `tools.$codemode.search` call never fails as an unknown tool. It is only advertised in the instructions when the inlined list is partial:
|
| 196 |
+
|
| 197 |
+
```ts
|
| 198 |
+
const matches = await tools.$codemode.search({
|
| 199 |
+
query: "order status",
|
| 200 |
+
namespace: "orders", // optional: scope to one top-level namespace
|
| 201 |
+
limit: 10,
|
| 202 |
+
offset: 0,
|
| 203 |
+
})
|
| 204 |
+
```
|
| 205 |
+
|
| 206 |
+
`search` performs deterministic, additive field-weighted matching. The query is tokenized (camelCase boundaries split; every non-alphanumeric character is a separator; empties and `*` are dropped), and each term scores every tool: exact path or path-segment match (20), path substring (8), description substring (4), and searchable-text substring (2). Each term also carries naive singular variants (trailing `s`/`es` stripped), and a field check passes when the term or any variant matches - so a plural query term (`issues`) still finds a tool whose text only says `issue`, without changing the weights. The searchable text also includes the input schema's property names and their description strings, so a query naming a parameter finds its tool, and substring matching means partial words match. Scores sum across terms; matches are sorted by score (ties broken alphabetically by path), then sliced from the zero-based `offset` (default 0) to the configured `limit` (default 10). `remaining` counts matches after the current page. `next` is `{ offset }` when another page exists and `null` on the final page; spread it into the original request to preserve its query, namespace, and limit.
|
| 207 |
+
|
| 208 |
+
```ts
|
| 209 |
+
const request = { query: "order status", namespace: "orders", limit: 10 }
|
| 210 |
+
const page = await tools.$codemode.search(request)
|
| 211 |
+
const nextPage = page.next ? await tools.$codemode.search({ ...request, ...page.next }) : undefined
|
| 212 |
+
```
|
| 213 |
+
|
| 214 |
+
Each result contains the path, description, and the same generated TypeScript signature used by the inline catalog, so no second lookup is needed. Signatures use the JSDoc-annotated multiline form: each described input/output field carries its schema `description` as a `/** ... */` comment, and constraints TypeScript cannot express ride along as tags (`@deprecated`, `@default`, `@format`, `@minItems`, `@maxItems`).
|
| 215 |
+
|
| 216 |
+
```ts
|
| 217 |
+
tools.github.list_issues(input: {
|
| 218 |
+
/** Repository owner */
|
| 219 |
+
owner: string,
|
| 220 |
+
/** Cursor from the previous response's pageInfo */
|
| 221 |
+
after?: string,
|
| 222 |
+
/**
|
| 223 |
+
* Results per page
|
| 224 |
+
* @default 30
|
| 225 |
+
*/
|
| 226 |
+
perPage?: number,
|
| 227 |
+
}): Promise<unknown>
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
Result paths are rendered as JavaScript expressions rooted at `tools` (`tools.orders.lookup`, or `tools.context7["resolve-library-id"]` for non-identifier segments), so each `path` is directly usable as the call site. An empty query browses the catalog alphabetically by path; combined with `namespace` (`{ query: "", namespace: "orders" }`) it lists everything in that namespace. A query that names one tool path exactly (canonical path, `tools.`-prefixed path, or rendered JavaScript expression) is treated as a lookup and returns that tool alone.
|
| 231 |
+
|
| 232 |
+
The instructions are structured markdown, ordered so the workflow sits at the top and the catalog at the bottom: a `## Workflow` section with numbered steps (find a tool via search when the catalog is partial, or pick from the inlined list when it is complete; call the exact path as-is; return only the needed fields), a `## Rules` section holding only guidance the workflow does not already cover (only listed/search-result Code Mode tools and internal runtime tools exist inside `tools`; filter and aggregate collections in code; narrow `Promise<unknown>` results at runtime; run independent calls through `Promise.all`; enumerate `tools` with `Object.keys`/`for...in`; browse a namespace and paginate search results when search is advertised), a short `## Language` section that identifies the runtime as a restricted JavaScript orchestration language and names its major unavailable capabilities, and the budgeted `## Available tools` catalog. Example call forms use explicit `<namespace>.<tool>`/`<field>` placeholders - never a real or fabricated tool name.
|
| 233 |
+
|
| 234 |
+
A host cannot define its own `$codemode` top-level namespace.
|
| 235 |
+
|
| 236 |
+
## Supported Programs
|
| 237 |
+
|
| 238 |
+
CodeMode executes a deliberately bounded JavaScript subset. It supports:
|
| 239 |
+
|
| 240 |
+
- Plain data literals, property access, assignment, and destructuring.
|
| 241 |
+
- `if`, conditional expressions, `switch`, `for`, `for...of` (arrays, strings, Maps, Sets), `for...in` (own keys of plain objects, index strings of arrays, and namespace/tool names of `tools` references - anything else is an error suggesting `for...of` or `Object.keys`, rather than real JS's surprising behavior of indices for strings and zero iterations for Maps/Sets), `while`, and `do...while`.
|
| 242 |
+
- Arrow functions and function declarations with closures, defaults, rest parameters, and destructuring.
|
| 243 |
+
- Optional chaining, nullish coalescing, templates, spread (arrays, strings, Maps, Sets), and `try`/`catch`.
|
| 244 |
+
- Common array, string, number, `Object`, `Math`, and `JSON` operations. Mutating array methods include `push`/`pop`/`shift`/`unshift`/`splice` (removes in place and returns the removed elements)/`fill`/`copyWithin`; array `keys`/`values`/`entries` return **arrays** (matching the Map/Set convention) and work with `for...of` and spread. String methods include `localeCompare` (locale/options arguments ignored), `normalize`, and the `trimLeft`/`trimRight` aliases. `Object.keys` also accepts arrays (index strings, as in JS) and tool references: `Object.keys(tools)` lists the top-level namespaces, including `$codemode`, and `Object.keys(tools.ns)` lists the names at that node (a callable tool enumerates as `[]`; an unknown path is an `UnknownTool` diagnostic). `Object.values`/`Object.entries` on a tool reference fail with a pointer at `Object.keys(tools)` and `tools.$codemode.search`.
|
| 245 |
+
- `Date` - `Date.now()`/`Date.parse()`/`Date.UTC()`, `new Date(...)`, the getter methods, and date arithmetic/comparison via the time value. Dates stringify as ISO (`toString` included, for determinism across host timezones).
|
| 246 |
+
- Regular expressions - `/literals/` and `new RegExp(...)` with `test`/`exec` (stateful `lastIndex` for `g`), plus string `match`/`matchAll`/`replace`/`replaceAll`/`split`/`search` with patterns. Match results are arrays carrying `index` and named `groups` as own properties (`input` is omitted). `replace` and `replaceAll` accept function replacers with captures, offset, input, and named groups; callbacks run sequentially, may await tool calls, and have their results coerced to strings. Invalid patterns, invalid flags, and missing-`g` calls fail with catchable errors that say what was wrong and how to fix it (escaping hints, the exact `/pattern/g` to write). Patterns run on the host engine, so pathological backtracking is bounded only by the execution timeout.
|
| 247 |
+
- `Map` and `Set` - construction from entries/arrays/strings, `get`/`set`/`add`/`has`/`delete`/`clear`/`size`/`forEach`, and `keys`/`values`/`entries` returning **arrays** (not iterators).
|
| 248 |
+
- URL helpers - `URL` resolution and mutation, linked `URLSearchParams`, `URL.canParse`/`URL.parse`, URI and URI-component encoding/decoding, and query parameter construction, lookup, mutation, sorting, callbacks, and materialization. URLSearchParams iteration methods return arrays, matching the Map/Set convention.
|
| 249 |
+
- First-class promises - an un-awaited `tools.ns.tool(...)` is a promise value whose call starts immediately on a supervised fiber; `await` resolves it (awaiting a non-promise value is a no-op, and `return tools.ns.tool(...)` resolves like an async-function return). `Promise.all`, `Promise.allSettled`, and `Promise.race` accept any array mixing promises and plain values (built inline, beforehand, or via spread); `Promise.resolve`/`Promise.reject` construct settled promises. `Promise.allSettled` rejection reasons are the same plain `{ name?, message }` data a `catch` binding sees, and `Promise.race` interrupts its losing in-flight calls. At most 8 tool calls run concurrently. When a program completes, still-running un-awaited calls are awaited before the execution ends; a failure from a call that was never awaited surfaces as an unhandled-rejection diagnostic.
|
| 250 |
+
- `throw value` and `throw new Error(message)` for explicit program failure. `Error` (and `TypeError`/`RangeError`/`SyntaxError`/`ReferenceError`/`EvalError`/`URIError`) are real constructors, callable with or without `new`; error values are plain `{ name, message }` data that additionally satisfy `instanceof Error` (a specific type matches itself and `Error`, as in JS). Every caught failure - thrown errors, interpreter runtime errors, and tool failures - is `instanceof Error` in a `catch` block; a thrown non-error value (`throw "text"`) is not, matching JS. Caught failures carry the `name` the equivalent real-JS failure would have - `JSON.parse` and invalid regex patterns produce a `SyntaxError` (satisfying `instanceof SyntaxError`), an unknown identifier a `ReferenceError`, assigning to a constant a `TypeError`, a bad `normalize` form a `RangeError`; failures with no specific analogue (including tool failures) are named `"Error"`. `instanceof` also recognizes `Date`, `RegExp`, `Map`, `Set`, `URL`, `URLSearchParams`, `Array`, `Object`, and `Promise`; any other right-hand side is a catchable error.
|
| 251 |
+
|
| 252 |
+
Inside a program, standard-library values stay live everywhere: the internal data checkpoints (`Object.*` helpers, spread, coercion inputs) preserve the instances, so `Object.values({ d: date })[0].getTime()` and a spread copy of an object holding a Map keep working. Only at the host boundary (final result, tool arguments, `JSON.stringify`) do they serialize exactly as `JSON.stringify` would: Date and URL become strings (an invalid Date becomes `null`), while RegExp, Map, Set, and URLSearchParams become `{}`. Promise values never cross a data boundary: an un-awaited promise in a result or tool argument produces a diagnostic that says to await it, instead of serializing to `{}`.
|
| 253 |
+
|
| 254 |
+
It does not expose `eval`, dynamic imports, modules, classes, generators, timers, host globals, prototype mutation, custom promise constructors (`new Promise`), promise chaining (`.then`/`.catch`/`.finally` - `await` with `try`/`catch` is the supported style), or arbitrary method calls. Unsupported syntax returns an `UnsupportedSyntax` diagnostic with a source location when available.
|
| 255 |
+
|
| 256 |
+
CodeMode is an orchestration language, not a general JavaScript runtime.
|
| 257 |
+
|
| 258 |
+
## Execution Limits
|
| 259 |
+
|
| 260 |
+
The limits are exactly three knobs:
|
| 261 |
+
|
| 262 |
+
| Limit | Default | Bounds |
|
| 263 |
+
| ---------------- | -------------------: | -------------------------------------------------------------------- |
|
| 264 |
+
| `timeoutMs` | none - no timeout | Wall-clock execution time. |
|
| 265 |
+
| `maxToolCalls` | none - unlimited | Tool calls admitted during the execution. |
|
| 266 |
+
| `maxOutputBytes` | none - no truncation | Model-facing output: the serialized result value plus captured logs. |
|
| 267 |
+
|
| 268 |
+
No limit has a default, on purpose: execution budgets are host policy, not library policy - a host that wants a bound sets one; a host that can interrupt the execution fiber (as OpenCode does on user cancel) may set no timeout, and a host with its own tool-output truncation (as OpenCode has) may leave `maxOutputBytes` unset. A host with neither should set `maxOutputBytes`, or oversized results silently flood model context.
|
| 269 |
+
|
| 270 |
+
Pass only the overrides you need:
|
| 271 |
+
|
| 272 |
+
```ts
|
| 273 |
+
const runtime = CodeMode.make({
|
| 274 |
+
tools,
|
| 275 |
+
limits: {
|
| 276 |
+
maxToolCalls: 20,
|
| 277 |
+
timeoutMs: 60_000,
|
| 278 |
+
},
|
| 279 |
+
})
|
| 280 |
+
```
|
| 281 |
+
|
| 282 |
+
Limits are safe integers. `timeoutMs` must be at least `1`; the others may be `0`. Invalid configuration throws a `RangeError` when `CodeMode.make` or `CodeMode.execute` is called. An explicitly `undefined` value is the same as leaving the limit unset.
|
| 283 |
+
|
| 284 |
+
Exceeding a configured `maxOutputBytes` never fails the execution. An oversized result value is replaced by its truncated serialized text plus an explanatory marker, logs are kept from the start until the remaining budget is exhausted (with a final marker line noting the cut), and the result carries `truncated: true`.
|
| 285 |
+
|
| 286 |
+
When configured, the timeout interrupts in-flight tool Effects, including eagerly started calls the program has not awaited (their fibers are supervised by the execution). The interpreter yields cooperatively between steps, so the timeout also interrupts pure busy loops (`while (true) {}`) - no separate work budget exists. Tool implementations remain responsible for making their external operations interruptible or independently bounded.
|
| 287 |
+
|
| 288 |
+
Two interpreter internals are fixed constants rather than knobs: at most 8 tool calls run concurrently, and values crossing a data boundary may nest at most 32 levels deep (deeper values fail as `InvalidDataValue`, which reads better than a native stack-overflow error). Neither is part of the public contract.
|
| 289 |
+
|
| 290 |
+
## Diagnostics
|
| 291 |
+
|
| 292 |
+
Failures are data:
|
| 293 |
+
|
| 294 |
+
| Kind | Meaning |
|
| 295 |
+
| ----------------------- | -------------------------------------------------------------------------------------------------------- |
|
| 296 |
+
| `ParseError` | Source is empty or cannot be parsed. |
|
| 297 |
+
| `UnsupportedSyntax` | Parsed JavaScript is outside the supported subset. |
|
| 298 |
+
| `UnknownTool` | A program referenced a tool the host did not provide. |
|
| 299 |
+
| `InvalidToolInput` | Tool input failed schema decoding or safe-data copying. |
|
| 300 |
+
| `InvalidToolOutput` | Tool output failed schema decoding or safe-data copying. |
|
| 301 |
+
| `InvalidDataValue` | Program data violated the plain-data contract (depth, circularity, blocked properties, non-data values). |
|
| 302 |
+
| `ToolCallLimitExceeded` | Calls exceeded `maxToolCalls`. |
|
| 303 |
+
| `TimeoutExceeded` | Execution exceeded `timeoutMs`. |
|
| 304 |
+
| `ToolFailure` | A tool refused or failed. |
|
| 305 |
+
| `ExecutionFailure` | The program threw or another execution error occurred. |
|
| 306 |
+
|
| 307 |
+
Unknown host failures, defects, invalid outputs, and copying failures are sanitized. To return a safe operational refusal, fail with `toolError`:
|
| 308 |
+
|
| 309 |
+
```ts
|
| 310 |
+
import { toolError } from "@opencode-ai/codemode"
|
| 311 |
+
|
| 312 |
+
run: ({ id }) => (authorized(id) ? loadOrder(id) : Effect.fail(toolError("Order is unavailable")))
|
| 313 |
+
```
|
| 314 |
+
|
| 315 |
+
Only the supplied message is model-visible. The optional cause is never returned in `CodeMode.Result`; hosts should perform any required internal logging before crossing this boundary.
|
| 316 |
+
|
| 317 |
+
## Authority Boundary
|
| 318 |
+
|
| 319 |
+
CodeMode confines programs to the supplied tool tree, but it does not decide what those tools may do.
|
| 320 |
+
|
| 321 |
+
The host owns:
|
| 322 |
+
|
| 323 |
+
- Authentication and authorization.
|
| 324 |
+
- Tool selection and immutable scope.
|
| 325 |
+
- Credentials and network clients.
|
| 326 |
+
- Persistence, idempotency, approval, and durable side effects.
|
| 327 |
+
- Logging and redaction policy.
|
| 328 |
+
|
| 329 |
+
CodeMode owns:
|
| 330 |
+
|
| 331 |
+
- Parsing and interpreting the supported subset without `eval`.
|
| 332 |
+
- Schema boundaries around tool calls.
|
| 333 |
+
- Plain-data copying and blocked prototype members.
|
| 334 |
+
- Resource limits, call accounting, and normalized diagnostics.
|
| 335 |
+
- Model-facing tool discovery and instructions.
|
| 336 |
+
|
| 337 |
+
A program cannot gain authority through prose or generated code. It can only exercise authority already present in the supplied tools. Do not expose a broad tool and expect the prompt to restrict it.
|
| 338 |
+
|
| 339 |
+
## Laws
|
| 340 |
+
|
| 341 |
+
The public contract is guided by these equivalences:
|
| 342 |
+
|
| 343 |
+
- `CodeMode.execute({ ...options, code })` is equivalent to `CodeMode.make(options).execute(code)`.
|
| 344 |
+
- A tool implementation is not invoked unless its input has decoded successfully.
|
| 345 |
+
- A tool result is not visible to the program unless its output has decoded and crossed the plain-data boundary successfully.
|
| 346 |
+
- Unknown host failures do not become model-visible diagnostics; `ToolError` is the explicit safe-message channel.
|
| 347 |
+
- Host interruption remains interruption rather than a `CodeMode.Failure`.
|
| 348 |
+
|
| 349 |
+
## Non-Goals
|
| 350 |
+
|
| 351 |
+
- Generic permission prompts or approval workflows.
|
| 352 |
+
- Durable pause/resume, replay, or storage adapters.
|
| 353 |
+
- Exactly-once external side effects.
|
| 354 |
+
- Application authorization or product policy.
|
| 355 |
+
- A filesystem or process sandbox for arbitrary JavaScript.
|
| 356 |
+
- Compatibility with the full JavaScript language or npm ecosystem.
|
| 357 |
+
|
| 358 |
+
Applications that need approval or durable consequences should model those above CodeMode and expose only the currently authorized tools.
|
| 359 |
+
|
| 360 |
+
## Testing
|
| 361 |
+
|
| 362 |
+
From the package directory:
|
| 363 |
+
|
| 364 |
+
```sh
|
| 365 |
+
bun test
|
| 366 |
+
bun run typecheck
|
| 367 |
+
```
|
| 368 |
+
|
| 369 |
+
The direct suite covers public projections, discovery, schema boundaries, diagnostic sanitization, resource limits, tool-call observation, and interruption.
|
packages/codemode/codemode.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CodeMode Design and Status
|
| 2 |
+
|
| 3 |
+
This is the living design and status document for `@opencode-ai/codemode` and its existing V2 OpenCode adapter.
|
| 4 |
+
It records current behavior, intentional boundaries, durable rationale, and material remaining work.
|
| 5 |
+
|
| 6 |
+
Completed implementation history, branch names, test counts, and closed findings belong in git, not here. Remove
|
| 7 |
+
completed work instead of preserving checked-off chronology.
|
| 8 |
+
|
| 9 |
+
Detailed package API documentation lives in [README.md](./README.md). OpenAPI-specific follow-ups live in
|
| 10 |
+
[src/openapi/TODO.md](./src/openapi/TODO.md).
|
| 11 |
+
|
| 12 |
+
## How CodeMode Works
|
| 13 |
+
|
| 14 |
+
### Purpose
|
| 15 |
+
|
| 16 |
+
CodeMode gives a model one `execute` tool backed by a confined JavaScript interpreter. Inside the program, the model
|
| 17 |
+
can call an explicit tree of schema-described tools, sequence dependent work, run independent calls concurrently,
|
| 18 |
+
and filter or aggregate results before returning them to the agent loop.
|
| 19 |
+
|
| 20 |
+
The goals are:
|
| 21 |
+
|
| 22 |
+
- Reduce model context consumed by large tool catalogs.
|
| 23 |
+
- Avoid an agent round-trip between every dependent tool call.
|
| 24 |
+
- Keep large intermediate results inside the program instead of sending them through model context.
|
| 25 |
+
- Give generated code only the authority explicitly supplied by the host.
|
| 26 |
+
|
| 27 |
+
CodeMode is an orchestration language, not a general JavaScript runtime or an application authorization system.
|
| 28 |
+
|
| 29 |
+
### Runtime
|
| 30 |
+
|
| 31 |
+
The generic runtime lives in `packages/codemode` and is host-neutral:
|
| 32 |
+
|
| 33 |
+
1. The host builds a tree of `Tool.make(...)` definitions and calls `CodeMode.make(...)` or `CodeMode.execute(...)`.
|
| 34 |
+
2. CodeMode generates model instructions, a budgeted inline catalog, and the internal `$codemode.search` tool.
|
| 35 |
+
3. TypeScript syntax is transpiled away, Acorn parses the resulting JavaScript, and an owned tree-walking interpreter
|
| 36 |
+
executes it without `eval`.
|
| 37 |
+
4. Tool inputs and outputs cross schema and plain-data boundaries before they become visible on either side.
|
| 38 |
+
5. Execution returns `CodeMode.Result`. Expected program and tool failures are diagnostic data; host interruption
|
| 39 |
+
remains Effect interruption.
|
| 40 |
+
|
| 41 |
+
Effect Schemas validate and transform tool inputs and outputs. JSON Schemas render model-facing signatures but do not
|
| 42 |
+
validate values; adapter-provided values still cross the plain-data boundary. A tool without an output schema is
|
| 43 |
+
advertised as `Promise<unknown>`.
|
| 44 |
+
|
| 45 |
+
### Discovery and model workflow
|
| 46 |
+
|
| 47 |
+
The model sees a token-budgeted catalog. Every namespace remains visible, and complete signatures are selected
|
| 48 |
+
round-robin across namespaces so one large namespace cannot starve the others. `$codemode.search` is always callable
|
| 49 |
+
and is advertised when the inline catalog is partial.
|
| 50 |
+
|
| 51 |
+
The intended workflow is:
|
| 52 |
+
|
| 53 |
+
1. Pick an exact signature from the inline catalog, or return `$codemode.search(...)` results and use a selected path
|
| 54 |
+
in the next execution.
|
| 55 |
+
2. Call the exact returned path without guessing or normalizing segments.
|
| 56 |
+
3. Narrow `Promise<unknown>` results before reading fields.
|
| 57 |
+
4. Start independent calls together and await them with `Promise.all`.
|
| 58 |
+
5. Filter and aggregate inside the program, then return only the data needed by the model.
|
| 59 |
+
|
| 60 |
+
Search returns directly usable JavaScript paths, descriptions, and complete TypeScript signatures. It supports exact
|
| 61 |
+
path lookup, namespace browsing, deterministic ranking, and pagination.
|
| 62 |
+
|
| 63 |
+
### Tool execution
|
| 64 |
+
|
| 65 |
+
Calling a tool starts its Effect eagerly on a supervised fiber. The returned sandbox promise is run-once and can be
|
| 66 |
+
awaited directly or through the supported `Promise` combinators. At most eight tool calls execute concurrently.
|
| 67 |
+
Unfinished calls are drained before successful program completion, and an unhandled call failure becomes a diagnostic.
|
| 68 |
+
|
| 69 |
+
The public execution-policy knobs are `timeoutMs`, `maxToolCalls`, and `maxOutputBytes`. The package supplies no
|
| 70 |
+
defaults because budgets are host policy. The interpreter also enforces fixed internal boundaries for tool-call
|
| 71 |
+
concurrency and data nesting depth.
|
| 72 |
+
|
| 73 |
+
### Data, files, and failures
|
| 74 |
+
|
| 75 |
+
Program results and tool arguments are JSON-like data. Dates become ISO strings at host boundaries; RegExp, Map, and
|
| 76 |
+
Set values become `{}` as they do under JSON serialization. Promise and runtime reference values cannot cross the
|
| 77 |
+
boundary.
|
| 78 |
+
|
| 79 |
+
Unknown host failures and invalid outputs are sanitized. `ToolError` is the explicit channel for a safe message that a
|
| 80 |
+
tool wants the model to see. Diagnostic categories distinguish parsing, unsupported syntax, unknown tools, invalid
|
| 81 |
+
data, tool failures, limits, timeouts, and execution failures.
|
| 82 |
+
|
| 83 |
+
Files and other attachment content stay outside the interpreter. A host may collect them while child tools execute and
|
| 84 |
+
attach them to the outer result, but the program receives only the structured tool output.
|
| 85 |
+
|
| 86 |
+
### V2 OpenCode adapter
|
| 87 |
+
|
| 88 |
+
This section describes the `v2` branch integration. On `dev`, CodeMode is integrated through
|
| 89 |
+
`packages/opencode/src/tool/code-mode.ts`, where nested MCP calls run the `tool.execute.before` and
|
| 90 |
+
`tool.execute.after` plugin hooks.
|
| 91 |
+
|
| 92 |
+
CodeMode is integrated into V2 through `packages/core/src/tool/registry.ts` and
|
| 93 |
+
`packages/core/src/tool/execute.ts`:
|
| 94 |
+
|
| 95 |
+
- Core has one canonical `Tool` representation. Location-scoped producers register direct or deferred tools through
|
| 96 |
+
`Tools.Service`.
|
| 97 |
+
- Each model step snapshots effective registrations, applies catalog visibility filtering, and exposes direct tools
|
| 98 |
+
normally.
|
| 99 |
+
- When visible deferred tools exist, Core reserves and materializes one `execute` tool. Grouped deferred tools become
|
| 100 |
+
CodeMode namespaces instead of flattened model-facing names.
|
| 101 |
+
- Each nested call checks that its captured registration is still current before dispatching it.
|
| 102 |
+
- Authorization and side-effect ordering remain responsibilities of the leaf tool. Catalog visibility is not execution
|
| 103 |
+
authorization.
|
| 104 |
+
- Structured child output enters the interpreter. File parts are collected host-side and attached to the outer result.
|
| 105 |
+
- Nested call statuses are returned as final `execute` metadata for the TUI.
|
| 106 |
+
- `execute` is the one model-facing tool invocation. Nested calls reuse its invocation context and do not independently
|
| 107 |
+
run registry hooks or model-output bounding; this keeps complete intermediate structured values available for
|
| 108 |
+
in-program filtering. The outer `execute` settlement is the single model-output bounding boundary.
|
| 109 |
+
- Core supplies no CodeMode timeout or tool-call limit. User cancellation interrupts the outer invocation and its
|
| 110 |
+
supervised children; the outer settlement applies Core's normal output-retention policy.
|
| 111 |
+
|
| 112 |
+
MCP tools use this canonical path: they register as grouped tools and are deferred while CodeMode is enabled. Existing
|
| 113 |
+
output schemas are preserved in generated signatures. Direct Core tools remain direct and are not ambient globals
|
| 114 |
+
inside CodeMode.
|
| 115 |
+
|
| 116 |
+
## Intentionally Unsupported
|
| 117 |
+
|
| 118 |
+
These are product boundaries rather than DSL backlog:
|
| 119 |
+
|
| 120 |
+
- Ambient filesystem, process, environment, network, credential, or application access. External work must go through
|
| 121 |
+
supplied tools.
|
| 122 |
+
- Modules, imports, dynamic imports, `eval`, arbitrary host globals, npm packages, and prototype mutation.
|
| 123 |
+
- Generic permission prompts, authorization policy, durable pause/resume, replay, storage, or exactly-once external
|
| 124 |
+
side effects. Hosts and tools own those concerns.
|
| 125 |
+
- Heuristic parsing of text tool results as JSON. A result should not silently change type based on its contents.
|
| 126 |
+
|
| 127 |
+
The OpenAPI adapter may gain more transports and encodings, but it must continue skipping operations it cannot
|
| 128 |
+
represent accurately rather than guessing semantics.
|
| 129 |
+
|
| 130 |
+
## Decisions and Rationale
|
| 131 |
+
|
| 132 |
+
| Decision | Rationale |
|
| 133 |
+
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
| 134 |
+
| Keep an owned tree-walking interpreter. | The product need is bounded tool orchestration, not arbitrary JavaScript. Owning the language surface keeps authority and behavior explicit. |
|
| 135 |
+
| Treat schemas as the model-facing interface. | Signatures drive correct calls; Effect Schema also provides the runtime validation boundary, while JSON Schema supports adapter interoperability. |
|
| 136 |
+
| Keep authority host-owned. | CodeMode can only confine programs to supplied tools. The host chooses those tools, and each tool enforces its own authorization and side-effect policy. |
|
| 137 |
+
| Use progressive catalog disclosure plus search. | Large tool sets should not consume the prompt, but every namespace must remain discoverable and speculative search calls should remain valid. |
|
| 138 |
+
| Start tool promises eagerly and supervise them. | This preserves normal call-time parallelism while giving each call run-once settlement and interruption safety. |
|
| 139 |
+
| Keep files outside the sandbox value space. | Models should compose structured data without routing binary payloads through generated code or context. |
|
| 140 |
+
| Treat `execute` as the model-facing invocation boundary. | Nested calls are implementation details of one orchestration program. Reusing the outer context and bounding only the final result preserves complete intermediate data without inventing durable child-call identities. |
|
| 141 |
+
| Return expected failures as data. | Models need actionable diagnostics without exposing private host causes; host interruption and defects must still propagate correctly. |
|
| 142 |
+
| Leave execution-limit defaults to hosts. | Appropriate budgets depend on the surrounding product and its own cancellation, retention, and output-bounding policies. |
|
| 143 |
+
| Skip unsupported OpenAPI operations. | Incorrect parameter encoding, authentication, or transport behavior is worse than a precise `skipped` reason. |
|
| 144 |
+
|
| 145 |
+
## Remaining Work
|
| 146 |
+
|
| 147 |
+
Keep only material unresolved work here. Small isolated defects should be GitHub issues; adapter-only work belongs in
|
| 148 |
+
the adapter TODO. Delete entries when completed.
|
| 149 |
+
|
| 150 |
+
### DSL expansion
|
| 151 |
+
|
| 152 |
+
The supported JavaScript subset should grow when common model-generated code improves tool orchestration. These are
|
| 153 |
+
current omissions to implement, not intentional product boundaries.
|
| 154 |
+
|
| 155 |
+
- [ ] Design proper multi-stage promise pipelines. Supporting `.then`, `.catch`, and `.finally` should preserve promise
|
| 156 |
+
assimilation, cancellation, failure handling, and concurrent per-item pipelines rather than adding syntax-only
|
| 157 |
+
shims. Consider `Promise.any` in the same pass.
|
| 158 |
+
- [ ] Support async iteration and `for await...of`. Define behavior first for the runtime's supported promise and
|
| 159 |
+
collection values, then extend it to bounded host streams when a stream boundary exists.
|
| 160 |
+
- [ ] Support callback-bearing standard-library variants that models commonly generate: the mapper argument to
|
| 161 |
+
`Array.from(...)` and replacers for `JSON.stringify(...)`, including Effect-aware callbacks where needed.
|
| 162 |
+
- [ ] Close basic `Object` parity gaps: let `Object.values`/`Object.entries` accept arrays, make `Object.assign` validate
|
| 163 |
+
and mutate its target, add `Object.is`, and let `Object.fromEntries` consume every supported iterable.
|
| 164 |
+
- [ ] Add deterministic modern collection conveniences where they improve orchestration: `Object.groupBy`, Set
|
| 165 |
+
composition methods, and `Array.prototype.toSpliced`.
|
| 166 |
+
- [ ] Complete the deterministic `Math` surface beyond the current arithmetic, rounding, root, power, and logarithm
|
| 167 |
+
helpers. Decide separately whether nondeterministic `Math.random` belongs in the runtime.
|
| 168 |
+
- [ ] Refine diagnostics so user throws, expected tool failures, unexpected host/tool defects, and genuine interpreter
|
| 169 |
+
defects are distinguishable without leaking private causes.
|
| 170 |
+
|
| 171 |
+
### Tool and result contracts
|
| 172 |
+
|
| 173 |
+
- [ ] Design explicit tagged representations and size rules before allowing Blob, File, ArrayBuffer, typed arrays, or
|
| 174 |
+
host streams to cross the sandbox boundary.
|
| 175 |
+
- [ ] Define one consistent policy for tool path segments named `__proto__`, `constructor`, or `prototype`. They must
|
| 176 |
+
either be safely callable, rejected before catalog generation, or use one documented escaping rule.
|
packages/codemode/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/package.json",
|
| 3 |
+
"name": "@opencode-ai/codemode",
|
| 4 |
+
"version": "1.18.31",
|
| 5 |
+
"description": "Effect-native confined code execution over schema-described tools",
|
| 6 |
+
"private": true,
|
| 7 |
+
"type": "module",
|
| 8 |
+
"license": "MIT",
|
| 9 |
+
"exports": {
|
| 10 |
+
".": "./src/index.ts"
|
| 11 |
+
},
|
| 12 |
+
"scripts": {
|
| 13 |
+
"typecheck": "tsgo --noEmit",
|
| 14 |
+
"test": "bun test"
|
| 15 |
+
},
|
| 16 |
+
"dependencies": {
|
| 17 |
+
"acorn": "8.15.0",
|
| 18 |
+
"effect": "catalog:",
|
| 19 |
+
"typescript": "catalog:"
|
| 20 |
+
},
|
| 21 |
+
"devDependencies": {
|
| 22 |
+
"@tsconfig/bun": "catalog:",
|
| 23 |
+
"@types/bun": "catalog:",
|
| 24 |
+
"@typescript/native-preview": "catalog:"
|
| 25 |
+
}
|
| 26 |
+
}
|
packages/codemode/sst-env.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file is auto-generated by SST. Do not edit. */
|
| 2 |
+
/* tslint:disable */
|
| 3 |
+
/* eslint-disable */
|
| 4 |
+
/* deno-fmt-ignore-file */
|
| 5 |
+
/* biome-ignore-all lint: auto-generated */
|
| 6 |
+
|
| 7 |
+
/// <reference path="../../sst-env.d.ts" />
|
| 8 |
+
|
| 9 |
+
import "sst"
|
| 10 |
+
export {}
|
packages/codemode/tsconfig.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/tsconfig",
|
| 3 |
+
"extends": "@tsconfig/bun/tsconfig.json",
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"noUncheckedIndexedAccess": false
|
| 6 |
+
}
|
| 7 |
+
}
|
packages/containers/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CI containers
|
| 2 |
+
|
| 3 |
+
Prebuilt images intended to speed up GitHub Actions jobs by baking in
|
| 4 |
+
large, slow-to-install dependencies. These are designed for Linux jobs
|
| 5 |
+
that can use `job.container` in workflows.
|
| 6 |
+
|
| 7 |
+
Images
|
| 8 |
+
|
| 9 |
+
- `base`: Ubuntu 24.04 with common build tools and utilities
|
| 10 |
+
- `bun-node`: `base` plus Bun and Node.js 24
|
| 11 |
+
- `rust`: `bun-node` plus Rust (stable, minimal profile)
|
| 12 |
+
- `tauri-linux`: `rust` plus Tauri Linux build dependencies
|
| 13 |
+
- `publish`: `bun-node` plus Docker CLI and AUR tooling
|
| 14 |
+
|
| 15 |
+
Build
|
| 16 |
+
|
| 17 |
+
```
|
| 18 |
+
REGISTRY=ghcr.io/anomalyco TAG=24.04 bun ./packages/containers/script/build.ts
|
| 19 |
+
REGISTRY=ghcr.io/anomalyco TAG=24.04 bun ./packages/containers/script/build.ts --push
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
Workflow usage
|
| 23 |
+
|
| 24 |
+
```
|
| 25 |
+
jobs:
|
| 26 |
+
build-cli:
|
| 27 |
+
runs-on: ubuntu-latest
|
| 28 |
+
container:
|
| 29 |
+
image: ghcr.io/anomalyco/build/bun-node:24.04
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
Notes
|
| 33 |
+
|
| 34 |
+
- These images only help Linux jobs. macOS and Windows jobs cannot run
|
| 35 |
+
inside Linux containers.
|
| 36 |
+
- `--push` publishes multi-arch (amd64 + arm64) images using Buildx.
|
| 37 |
+
- If a job uses Docker Buildx, the container needs access to the host
|
| 38 |
+
Docker daemon (or `docker-in-docker` with privileged mode).
|
packages/containers/tsconfig.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://json.schemastore.org/tsconfig",
|
| 3 |
+
"extends": "@tsconfig/bun/tsconfig.json",
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
| 6 |
+
"noUncheckedIndexedAccess": false
|
| 7 |
+
}
|
| 8 |
+
}
|
packages/desktop/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Logs
|
| 2 |
+
logs
|
| 3 |
+
*.log
|
| 4 |
+
npm-debug.log*
|
| 5 |
+
yarn-debug.log*
|
| 6 |
+
yarn-error.log*
|
| 7 |
+
pnpm-debug.log*
|
| 8 |
+
lerna-debug.log*
|
| 9 |
+
|
| 10 |
+
node_modules
|
| 11 |
+
dist
|
| 12 |
+
dist-ssr
|
| 13 |
+
*.local
|
| 14 |
+
|
| 15 |
+
# Editor directories and files
|
| 16 |
+
.vscode/*
|
| 17 |
+
!.vscode/extensions.json
|
| 18 |
+
.idea
|
| 19 |
+
.DS_Store
|
| 20 |
+
*.suo
|
| 21 |
+
*.ntvs*
|
| 22 |
+
*.njsproj
|
| 23 |
+
*.sln
|
| 24 |
+
*.sw?
|
| 25 |
+
out/
|
| 26 |
+
|
| 27 |
+
resources/opencode-cli*
|
| 28 |
+
resources/icons
|
| 29 |
+
resources/*.metainfo.xml
|
packages/desktop/AGENTS.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Desktop package notes
|
| 2 |
+
|
| 3 |
+
- Renderer process should only call `window.api` from `src/preload`.
|
| 4 |
+
- Main process should register IPC handlers in `src/main/ipc.ts`.
|
| 5 |
+
- NEVER hardcode user-visible English strings in production code. ALWAYS use an i18n key for native menus, picker titles, dialogs, buttons, accessible labels, and displayed errors.
|
| 6 |
+
- When migrating existing copy to i18n, preserve the English text byte-for-byte unless the task explicitly requests a copy change.
|
| 7 |
+
- NEVER change existing English text or English keys to facilitate translation. English is intentional, designer-written source copy; adapt locale-specific translations and i18n mechanics around it.
|
| 8 |
+
- Keep locale and grammar logic in the shared typed i18n layer. Renderer code should resolve copy through the app language API, and the main process should consume typed native-translation bundles through `nativeT(...)`; native menus, dialogs, and IPC handlers must not inspect locales, choose plural categories, or assemble translated sentence fragments.
|
| 9 |
+
- Prefer complete translated phrases with only irreducible dynamic placeholders. If native UI needs richer grammar, deepen the shared bundle/API instead of adding locale branches to desktop feature code.
|
| 10 |
+
- Do not translate from model knowledge alone. Verify terminology and grammar with Unicode CLDR locale/plural data, Microsoft Localization Style Guides and terminology, Apple localization/style guidance and localized platform UI, Mozilla localization style guides, Mozilla Pontoon, and the Firefox localization corpus at `github.com/mozilla-l10n/firefox-l10n`.
|
| 11 |
+
- For developer-facing terminology, prefer established usage in the target language's developer community over literal translations. Cross-check maintained Firefox, KDE, and VS Code localizations, using at least two independent corpora when available. Keep established English loanwords and acronyms instead of inventing unfamiliar terms.
|
| 12 |
+
- Translate whole native-menu and dialog phrases in context. Audit recurring concepts for consistency and review every exact-English value; retain it only when it is an intentional product/provider/tool name, URL, code token, keyboard legend, acronym, asset name, or established borrowing.
|
| 13 |
+
- Record the corpora used and flag uncertain or regional terminology in review notes.
|
| 14 |
+
- Also use the relevant language authority or official dictionary for the locale (for example RAE/Fundéu, FranceTerme, Duden, TDK, Kotus/Kielitoimiston sanakirja, Språkrådet/Bokmålsordboka, Rada Języka Polskiego/PWN, the Russian and Arabic language academies, the Ukrainian Orthography, Taiwan MOE dictionaries, or the Royal Society of Thailand). Treat the English dictionary as the semantic source of truth and preserve placeholders, code identifiers, product names, and keyboard labels.
|
packages/desktop/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenCode Desktop
|
| 2 |
+
|
| 3 |
+
The OpenCode Desktop app, built with Electron.
|
| 4 |
+
|
| 5 |
+
## Development
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
bun install
|
| 9 |
+
bun dev
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
## Build
|
| 13 |
+
|
| 14 |
+
Run the `build` script to build the app's JS assets, then `package` to
|
| 15 |
+
bundle the assets as an application. The resulting app will be in `dist/`.
|
| 16 |
+
|
| 17 |
+
```bash
|
| 18 |
+
bun run build && bun run package
|
| 19 |
+
```
|
packages/desktop/electron-builder.config.test.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { expect, test } from "bun:test"
|
| 2 |
+
import type { Configuration } from "electron-builder"
|
| 3 |
+
|
| 4 |
+
const legacyDesktopEntry = "resources/linux/opencode-desktop.desktop"
|
| 5 |
+
|
| 6 |
+
const channels = [
|
| 7 |
+
{ channel: "dev", appId: "ai.opencode.desktop.dev" },
|
| 8 |
+
{ channel: "beta", appId: "ai.opencode.desktop.beta" },
|
| 9 |
+
{ channel: "prod", appId: "ai.opencode.desktop" },
|
| 10 |
+
] as const
|
| 11 |
+
|
| 12 |
+
for (const channel of channels) {
|
| 13 |
+
test(`uses one Linux desktop identity for ${channel.channel}`, async () => {
|
| 14 |
+
const previous = process.env.OPENCODE_CHANNEL
|
| 15 |
+
process.env.OPENCODE_CHANNEL = channel.channel
|
| 16 |
+
|
| 17 |
+
const module = await import(`./electron-builder.config.ts?channel=${channel.channel}`)
|
| 18 |
+
const config = module.default as Configuration
|
| 19 |
+
|
| 20 |
+
if (previous === undefined) delete process.env.OPENCODE_CHANNEL
|
| 21 |
+
else process.env.OPENCODE_CHANNEL = previous
|
| 22 |
+
|
| 23 |
+
expect(config.appId).toBe(channel.appId)
|
| 24 |
+
expect(config.extraMetadata?.desktopName).toBe(`${channel.appId}.desktop`)
|
| 25 |
+
expect(config.linux?.executableName).toBe(channel.appId)
|
| 26 |
+
expect(config.linux?.desktop?.entry?.StartupWMClass).toBe(channel.appId)
|
| 27 |
+
expect(config.deb?.fpm).toContainEqual(expect.stringContaining(`/usr/share/metainfo/${channel.appId}.metainfo.xml`))
|
| 28 |
+
expect(config.rpm?.fpm).toContainEqual(expect.stringContaining(`/usr/share/metainfo/${channel.appId}.metainfo.xml`))
|
| 29 |
+
})
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
test("keeps a hidden prod launcher for old Linux pins", async () => {
|
| 33 |
+
const previous = process.env.OPENCODE_CHANNEL
|
| 34 |
+
process.env.OPENCODE_CHANNEL = "prod"
|
| 35 |
+
|
| 36 |
+
const module = await import("./electron-builder.config.ts?compat=prod")
|
| 37 |
+
const config = module.default as Configuration
|
| 38 |
+
|
| 39 |
+
if (previous === undefined) delete process.env.OPENCODE_CHANNEL
|
| 40 |
+
else process.env.OPENCODE_CHANNEL = previous
|
| 41 |
+
|
| 42 |
+
expect(
|
| 43 |
+
config.deb?.fpm?.some((entry) =>
|
| 44 |
+
entry.endsWith("opencode-desktop.desktop=/usr/share/applications/opencode-desktop.desktop"),
|
| 45 |
+
),
|
| 46 |
+
).toBe(true)
|
| 47 |
+
expect(
|
| 48 |
+
config.rpm?.fpm?.some((entry) =>
|
| 49 |
+
entry.endsWith("opencode-desktop.desktop=/usr/share/applications/opencode-desktop.desktop"),
|
| 50 |
+
),
|
| 51 |
+
).toBe(true)
|
| 52 |
+
|
| 53 |
+
const desktop = await Bun.file(legacyDesktopEntry).text()
|
| 54 |
+
expect(desktop).toContain("Exec=/opt/OpenCode/ai.opencode.desktop %U")
|
| 55 |
+
expect(desktop).toContain("Icon=ai.opencode.desktop")
|
| 56 |
+
expect(desktop).toContain("StartupWMClass=ai.opencode.desktop")
|
| 57 |
+
expect(desktop).toContain("NoDisplay=true")
|
| 58 |
+
})
|
| 59 |
+
|
| 60 |
+
test("bundles the CLI outside the dev app archive", async () => {
|
| 61 |
+
const previous = process.env.OPENCODE_CHANNEL
|
| 62 |
+
process.env.OPENCODE_CHANNEL = "dev"
|
| 63 |
+
const module = await import("./electron-builder.config.ts?cli-resource")
|
| 64 |
+
const config = module.default as Configuration
|
| 65 |
+
if (previous === undefined) delete process.env.OPENCODE_CHANNEL
|
| 66 |
+
else process.env.OPENCODE_CHANNEL = previous
|
| 67 |
+
|
| 68 |
+
expect(config.files).toContain("!resources/opencode-cli*")
|
| 69 |
+
expect(config.extraResources).toContainEqual({
|
| 70 |
+
from: "resources/",
|
| 71 |
+
to: "",
|
| 72 |
+
filter: ["opencode-cli*"],
|
| 73 |
+
})
|
| 74 |
+
})
|
| 75 |
+
|
| 76 |
+
for (const channel of ["beta", "prod"] as const) {
|
| 77 |
+
test(`does not bundle the CLI in ${channel} builds`, async () => {
|
| 78 |
+
const previous = process.env.OPENCODE_CHANNEL
|
| 79 |
+
process.env.OPENCODE_CHANNEL = channel
|
| 80 |
+
const module = await import(`./electron-builder.config.ts?no-cli-resource=${channel}`)
|
| 81 |
+
const config = module.default as Configuration
|
| 82 |
+
if (previous === undefined) delete process.env.OPENCODE_CHANNEL
|
| 83 |
+
else process.env.OPENCODE_CHANNEL = previous
|
| 84 |
+
|
| 85 |
+
expect(config.extraResources).not.toContainEqual({
|
| 86 |
+
from: "resources/",
|
| 87 |
+
to: "",
|
| 88 |
+
filter: ["opencode-cli*"],
|
| 89 |
+
})
|
| 90 |
+
})
|
| 91 |
+
}
|
packages/desktop/electron-builder.config.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { execFile } from "node:child_process"
|
| 2 |
+
import path from "node:path"
|
| 3 |
+
import { fileURLToPath } from "node:url"
|
| 4 |
+
import { promisify } from "node:util"
|
| 5 |
+
|
| 6 |
+
import type { Configuration } from "electron-builder"
|
| 7 |
+
|
| 8 |
+
const execFileAsync = promisify(execFile)
|
| 9 |
+
const packageDir = path.dirname(fileURLToPath(import.meta.url))
|
| 10 |
+
const rootDir = path.resolve(packageDir, "../..")
|
| 11 |
+
const signScript = path.join(rootDir, "script", "sign-windows.ps1")
|
| 12 |
+
// The Electron 42 packaging update briefly installed Linux launchers/icons under
|
| 13 |
+
// "opencode-desktop". Keep that hidden desktop entry around so existing GNOME/KDE
|
| 14 |
+
// pins still resolve after the canonical app id changes back to ai.opencode.desktop.
|
| 15 |
+
const legacyDesktopEntry = path.join(packageDir, "resources", "linux", "opencode-desktop.desktop")
|
| 16 |
+
const legacyDesktopEntryFpm = `${legacyDesktopEntry}=/usr/share/applications/opencode-desktop.desktop`
|
| 17 |
+
|
| 18 |
+
const metainfoFpm = (appId: string) =>
|
| 19 |
+
`${path.join(packageDir, "resources", `${appId}.metainfo.xml`)}=/usr/share/metainfo/${appId}.metainfo.xml`
|
| 20 |
+
|
| 21 |
+
async function signWindows(configuration: { path: string }) {
|
| 22 |
+
if (process.platform !== "win32") return
|
| 23 |
+
if (process.env.GITHUB_ACTIONS !== "true") return
|
| 24 |
+
|
| 25 |
+
await execFileAsync(
|
| 26 |
+
"pwsh",
|
| 27 |
+
["-NoLogo", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", signScript, configuration.path],
|
| 28 |
+
{ cwd: rootDir },
|
| 29 |
+
)
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
const channel = (() => {
|
| 33 |
+
const raw = process.env.OPENCODE_CHANNEL
|
| 34 |
+
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
|
| 35 |
+
return "dev"
|
| 36 |
+
})()
|
| 37 |
+
|
| 38 |
+
const APP_IDS = {
|
| 39 |
+
dev: "ai.opencode.desktop.dev",
|
| 40 |
+
beta: "ai.opencode.desktop.beta",
|
| 41 |
+
prod: "ai.opencode.desktop",
|
| 42 |
+
} as const
|
| 43 |
+
|
| 44 |
+
const getBase = (appId: string): Configuration => ({
|
| 45 |
+
artifactName: "opencode-desktop-${os}-${arch}.${ext}",
|
| 46 |
+
directories: {
|
| 47 |
+
output: "dist",
|
| 48 |
+
buildResources: "resources",
|
| 49 |
+
},
|
| 50 |
+
// Linux launchers are .desktop files, so this is the desktop file name,
|
| 51 |
+
// not just the app id. For prod, app id "ai.opencode.desktop" becomes
|
| 52 |
+
// "ai.opencode.desktop.desktop".
|
| 53 |
+
// https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html
|
| 54 |
+
// https://www.electron.build/docs/linux/
|
| 55 |
+
extraMetadata: {
|
| 56 |
+
desktopName: `${appId}.desktop`,
|
| 57 |
+
},
|
| 58 |
+
files: ["out/**/*", "resources/**/*", "!resources/opencode-cli*"],
|
| 59 |
+
extraResources: [
|
| 60 |
+
...(channel === "dev"
|
| 61 |
+
? [
|
| 62 |
+
{
|
| 63 |
+
from: "resources/",
|
| 64 |
+
to: "",
|
| 65 |
+
filter: ["opencode-cli*"],
|
| 66 |
+
},
|
| 67 |
+
]
|
| 68 |
+
: []),
|
| 69 |
+
{
|
| 70 |
+
from: "native/",
|
| 71 |
+
to: "native/",
|
| 72 |
+
filter: ["index.js", "index.d.ts", "build/Release/mac_window.node", "swift-build/**"],
|
| 73 |
+
},
|
| 74 |
+
],
|
| 75 |
+
mac: {
|
| 76 |
+
category: "public.app-category.developer-tools",
|
| 77 |
+
icon: `resources/icons/icon.icns`,
|
| 78 |
+
hardenedRuntime: true,
|
| 79 |
+
gatekeeperAssess: false,
|
| 80 |
+
entitlements: "resources/entitlements.plist",
|
| 81 |
+
entitlementsInherit: "resources/entitlements.plist",
|
| 82 |
+
notarize: true,
|
| 83 |
+
target: ["dmg", "zip"],
|
| 84 |
+
},
|
| 85 |
+
dmg: {
|
| 86 |
+
sign: true,
|
| 87 |
+
},
|
| 88 |
+
protocols: {
|
| 89 |
+
name: "OpenCode",
|
| 90 |
+
schemes: ["opencode"],
|
| 91 |
+
},
|
| 92 |
+
win: {
|
| 93 |
+
icon: `resources/icons/icon.ico`,
|
| 94 |
+
signtoolOptions: {
|
| 95 |
+
sign: signWindows,
|
| 96 |
+
},
|
| 97 |
+
target: ["nsis"],
|
| 98 |
+
verifyUpdateCodeSignature: false,
|
| 99 |
+
},
|
| 100 |
+
nsis: {
|
| 101 |
+
oneClick: true,
|
| 102 |
+
perMachine: false,
|
| 103 |
+
installerIcon: `resources/icons/icon.ico`,
|
| 104 |
+
installerHeaderIcon: `resources/icons/icon.ico`,
|
| 105 |
+
},
|
| 106 |
+
linux: {
|
| 107 |
+
icon: `resources/icons`,
|
| 108 |
+
category: "Development",
|
| 109 |
+
executableName: appId,
|
| 110 |
+
desktop: {
|
| 111 |
+
entry: {
|
| 112 |
+
// Match the installed .desktop file and hicolor icon basename so
|
| 113 |
+
// Linux shells can associate the running Electron window with its launcher.
|
| 114 |
+
StartupWMClass: appId,
|
| 115 |
+
},
|
| 116 |
+
},
|
| 117 |
+
target: ["AppImage", "deb", "rpm"],
|
| 118 |
+
},
|
| 119 |
+
})
|
| 120 |
+
|
| 121 |
+
function getConfig() {
|
| 122 |
+
const appId = APP_IDS[channel]
|
| 123 |
+
const base = getBase(appId)
|
| 124 |
+
|
| 125 |
+
switch (channel) {
|
| 126 |
+
case "dev": {
|
| 127 |
+
return {
|
| 128 |
+
...base,
|
| 129 |
+
appId,
|
| 130 |
+
productName: "OpenCode Dev",
|
| 131 |
+
deb: { fpm: [metainfoFpm(appId)] },
|
| 132 |
+
rpm: { packageName: "opencode-dev", fpm: [metainfoFpm(appId)] },
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
case "beta": {
|
| 136 |
+
return {
|
| 137 |
+
...base,
|
| 138 |
+
appId,
|
| 139 |
+
productName: "OpenCode Beta",
|
| 140 |
+
protocols: { name: "OpenCode Beta", schemes: ["opencode"] },
|
| 141 |
+
publish: { provider: "github", owner: "anomalyco", repo: "opencode-beta", channel: "latest" },
|
| 142 |
+
deb: { fpm: [metainfoFpm(appId)] },
|
| 143 |
+
rpm: { packageName: "opencode-beta", fpm: [metainfoFpm(appId)] },
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
case "prod": {
|
| 147 |
+
return {
|
| 148 |
+
...base,
|
| 149 |
+
appId,
|
| 150 |
+
productName: "OpenCode",
|
| 151 |
+
protocols: { name: "OpenCode", schemes: ["opencode"] },
|
| 152 |
+
publish: { provider: "github", owner: "anomalyco", repo: "opencode", channel: "latest" },
|
| 153 |
+
deb: { fpm: [metainfoFpm(appId), legacyDesktopEntryFpm] },
|
| 154 |
+
rpm: { packageName: "opencode", fpm: [metainfoFpm(appId), legacyDesktopEntryFpm] },
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
export default getConfig()
|
packages/desktop/electron.vite.config.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { sentryVitePlugin } from "@sentry/vite-plugin"
|
| 2 |
+
import { defineConfig } from "electron-vite"
|
| 3 |
+
import appPlugin from "@opencode-ai/app/vite"
|
| 4 |
+
import * as fs from "node:fs/promises"
|
| 5 |
+
|
| 6 |
+
const OPENCODE_SERVER_DIST = "../opencode/dist/node"
|
| 7 |
+
|
| 8 |
+
const channel = (() => {
|
| 9 |
+
const raw = process.env.OPENCODE_CHANNEL
|
| 10 |
+
if (raw === "dev" || raw === "beta" || raw === "prod") return raw
|
| 11 |
+
if (process.env.OPENCODE_CHANNEL === "latest") return "prod"
|
| 12 |
+
return "dev"
|
| 13 |
+
})()
|
| 14 |
+
|
| 15 |
+
const nodePtyPkg = `@lydell/node-pty-${process.platform}-${process.arch}`
|
| 16 |
+
|
| 17 |
+
const sentry =
|
| 18 |
+
process.env.SENTRY_AUTH_TOKEN && process.env.SENTRY_ORG && process.env.SENTRY_PROJECT
|
| 19 |
+
? sentryVitePlugin({
|
| 20 |
+
authToken: process.env.SENTRY_AUTH_TOKEN,
|
| 21 |
+
org: process.env.SENTRY_ORG,
|
| 22 |
+
project: process.env.SENTRY_PROJECT,
|
| 23 |
+
telemetry: false,
|
| 24 |
+
release: {
|
| 25 |
+
name: process.env.SENTRY_RELEASE ?? process.env.VITE_SENTRY_RELEASE,
|
| 26 |
+
},
|
| 27 |
+
sourcemaps: {
|
| 28 |
+
assets: "./out/renderer/**",
|
| 29 |
+
filesToDeleteAfterUpload: "./out/renderer/**/*.map",
|
| 30 |
+
},
|
| 31 |
+
})
|
| 32 |
+
: false
|
| 33 |
+
|
| 34 |
+
export default defineConfig({
|
| 35 |
+
main: {
|
| 36 |
+
define: {
|
| 37 |
+
"import.meta.env.OPENCODE_CHANNEL": JSON.stringify(channel),
|
| 38 |
+
},
|
| 39 |
+
build: {
|
| 40 |
+
rollupOptions: {
|
| 41 |
+
input: { index: "src/main/index.ts", sidecar: "src/main/sidecar.ts" },
|
| 42 |
+
// Keep this identical to electron-vite's Node 20.11+ shim. Its regex insertion can
|
| 43 |
+
// corrupt bundled TypeScript, while a Rollup banner places the shim safely.
|
| 44 |
+
output: {
|
| 45 |
+
banner: `
|
| 46 |
+
// -- CommonJS Shims --
|
| 47 |
+
import __cjs_mod__ from 'node:module';
|
| 48 |
+
const __filename = import.meta.filename;
|
| 49 |
+
const __dirname = import.meta.dirname;
|
| 50 |
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
| 51 |
+
`,
|
| 52 |
+
},
|
| 53 |
+
},
|
| 54 |
+
externalizeDeps: { include: [nodePtyPkg] },
|
| 55 |
+
},
|
| 56 |
+
plugins: [
|
| 57 |
+
{
|
| 58 |
+
name: "opencode:node-pty-narrower",
|
| 59 |
+
enforce: "pre",
|
| 60 |
+
resolveId(s) {
|
| 61 |
+
if (s === "@lydell/node-pty") return nodePtyPkg
|
| 62 |
+
},
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
name: "opencode:virtual-server-module",
|
| 66 |
+
enforce: "pre",
|
| 67 |
+
resolveId(id) {
|
| 68 |
+
if (id === "virtual:opencode-server") return this.resolve(`${OPENCODE_SERVER_DIST}/node.js`)
|
| 69 |
+
},
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
name: "opencode:copy-server-assets",
|
| 73 |
+
async writeBundle() {
|
| 74 |
+
for (const l of await fs.readdir(OPENCODE_SERVER_DIST)) {
|
| 75 |
+
if (!l.endsWith(".wasm")) continue
|
| 76 |
+
await fs.writeFile(`./out/main/chunks/${l}`, await fs.readFile(`${OPENCODE_SERVER_DIST}/${l}`))
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
},
|
| 80 |
+
],
|
| 81 |
+
},
|
| 82 |
+
preload: {
|
| 83 |
+
build: {
|
| 84 |
+
rollupOptions: {
|
| 85 |
+
input: { index: "src/preload/index.ts" },
|
| 86 |
+
output: {
|
| 87 |
+
format: "cjs",
|
| 88 |
+
entryFileNames: "[name].js",
|
| 89 |
+
},
|
| 90 |
+
},
|
| 91 |
+
},
|
| 92 |
+
},
|
| 93 |
+
renderer: {
|
| 94 |
+
plugins: [appPlugin, sentry],
|
| 95 |
+
publicDir: "../../../app/public",
|
| 96 |
+
root: "src/renderer",
|
| 97 |
+
build: {
|
| 98 |
+
sourcemap: true,
|
| 99 |
+
rollupOptions: {
|
| 100 |
+
input: {
|
| 101 |
+
main: "src/renderer/index.html",
|
| 102 |
+
},
|
| 103 |
+
},
|
| 104 |
+
},
|
| 105 |
+
},
|
| 106 |
+
})
|
packages/desktop/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@opencode-ai/desktop",
|
| 3 |
+
"private": true,
|
| 4 |
+
"version": "1.18.31",
|
| 5 |
+
"type": "module",
|
| 6 |
+
"license": "MIT",
|
| 7 |
+
"homepage": "https://opencode.ai",
|
| 8 |
+
"author": {
|
| 9 |
+
"name": "OpenCode",
|
| 10 |
+
"email": "hello@opencode.ai"
|
| 11 |
+
},
|
| 12 |
+
"scripts": {
|
| 13 |
+
"typecheck": "tsgo -b",
|
| 14 |
+
"predev": "bun ./scripts/predev.ts",
|
| 15 |
+
"dev": "electron-vite dev",
|
| 16 |
+
"prebuild": "bun ./scripts/prebuild.ts",
|
| 17 |
+
"build": "electron-vite build",
|
| 18 |
+
"preview": "electron-vite preview",
|
| 19 |
+
"package": "electron-builder --config electron-builder.config.ts",
|
| 20 |
+
"package:mac": "electron-builder --mac --config electron-builder.config.ts",
|
| 21 |
+
"package:win": "electron-builder --win --config electron-builder.config.ts",
|
| 22 |
+
"package:linux": "electron-builder --linux --config electron-builder.config.ts",
|
| 23 |
+
"native:build": "bun install --cwd native"
|
| 24 |
+
},
|
| 25 |
+
"main": "./out/main/index.js",
|
| 26 |
+
"dependencies": {
|
| 27 |
+
"@zip.js/zip.js": "2.7.62",
|
| 28 |
+
"effect": "catalog:",
|
| 29 |
+
"electron-context-menu": "4.1.2",
|
| 30 |
+
"electron-log": "^5",
|
| 31 |
+
"electron-store": "11.0.2",
|
| 32 |
+
"electron-updater": "6.8.9",
|
| 33 |
+
"electron-window-state": "^5.0.3",
|
| 34 |
+
"drizzle-orm": "catalog:"
|
| 35 |
+
},
|
| 36 |
+
"devDependencies": {
|
| 37 |
+
"@actions/artifact": "4.0.0",
|
| 38 |
+
"@lydell/node-pty": "catalog:",
|
| 39 |
+
"@opencode-ai/app": "workspace:*",
|
| 40 |
+
"@opencode-ai/ui": "workspace:*",
|
| 41 |
+
"@sentry/solid": "catalog:",
|
| 42 |
+
"@sentry/vite-plugin": "catalog:",
|
| 43 |
+
"@solid-primitives/i18n": "2.2.1",
|
| 44 |
+
"@solid-primitives/storage": "catalog:",
|
| 45 |
+
"@solidjs/meta": "catalog:",
|
| 46 |
+
"@solidjs/router": "0.15.4",
|
| 47 |
+
"@types/bun": "catalog:",
|
| 48 |
+
"@types/node": "catalog:",
|
| 49 |
+
"@typescript/native-preview": "catalog:",
|
| 50 |
+
"@valibot/to-json-schema": "1.6.0",
|
| 51 |
+
"electron": "42.3.3",
|
| 52 |
+
"electron-builder": "26.15.2",
|
| 53 |
+
"electron-vite": "^5",
|
| 54 |
+
"solid-js": "catalog:",
|
| 55 |
+
"sury": "11.0.0-alpha.4",
|
| 56 |
+
"typescript": "~5.6.2",
|
| 57 |
+
"vite": "catalog:",
|
| 58 |
+
"zod-openapi": "5.4.6"
|
| 59 |
+
},
|
| 60 |
+
"optionalDependencies": {
|
| 61 |
+
"@lydell/node-pty-darwin-arm64": "1.2.0-beta.12",
|
| 62 |
+
"@lydell/node-pty-darwin-x64": "1.2.0-beta.12",
|
| 63 |
+
"@lydell/node-pty-linux-arm64": "1.2.0-beta.12",
|
| 64 |
+
"@lydell/node-pty-linux-x64": "1.2.0-beta.12",
|
| 65 |
+
"@lydell/node-pty-win32-arm64": "1.2.0-beta.12",
|
| 66 |
+
"@lydell/node-pty-win32-x64": "1.2.0-beta.12",
|
| 67 |
+
"@parcel/watcher-darwin-arm64": "2.5.1",
|
| 68 |
+
"@parcel/watcher-darwin-x64": "2.5.1",
|
| 69 |
+
"@parcel/watcher-linux-arm64-glibc": "2.5.1",
|
| 70 |
+
"@parcel/watcher-linux-arm64-musl": "2.5.1",
|
| 71 |
+
"@parcel/watcher-linux-x64-glibc": "2.5.1",
|
| 72 |
+
"@parcel/watcher-linux-x64-musl": "2.5.1",
|
| 73 |
+
"@parcel/watcher-win32-arm64": "2.5.1",
|
| 74 |
+
"@parcel/watcher-win32-x64": "2.5.1"
|
| 75 |
+
}
|
| 76 |
+
}
|
packages/desktop/sst-env.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This file is auto-generated by SST. Do not edit. */
|
| 2 |
+
/* tslint:disable */
|
| 3 |
+
/* eslint-disable */
|
| 4 |
+
/* deno-fmt-ignore-file */
|
| 5 |
+
/* biome-ignore-all lint: auto-generated */
|
| 6 |
+
|
| 7 |
+
/// <reference path="../../sst-env.d.ts" />
|
| 8 |
+
|
| 9 |
+
import "sst"
|
| 10 |
+
export {}
|
packages/desktop/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compilerOptions": {
|
| 3 |
+
"target": "ESNext",
|
| 4 |
+
"module": "ESNext",
|
| 5 |
+
"skipLibCheck": true,
|
| 6 |
+
"moduleResolution": "bundler",
|
| 7 |
+
"allowSyntheticDefaultImports": true,
|
| 8 |
+
"esModuleInterop": true,
|
| 9 |
+
"jsx": "preserve",
|
| 10 |
+
"jsxImportSource": "solid-js",
|
| 11 |
+
"allowJs": true,
|
| 12 |
+
"resolveJsonModule": true,
|
| 13 |
+
"strict": true,
|
| 14 |
+
"isolatedModules": true,
|
| 15 |
+
"noEmit": true,
|
| 16 |
+
"emitDeclarationOnly": false,
|
| 17 |
+
"outDir": "node_modules/.ts-dist",
|
| 18 |
+
"types": ["vite/client", "node", "electron"]
|
| 19 |
+
},
|
| 20 |
+
"references": [{ "path": "../app" }],
|
| 21 |
+
"include": ["src", "package.json"],
|
| 22 |
+
"exclude": ["src/**/*.test.ts"]
|
| 23 |
+
}
|
packages/docs/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2023 Mintlify
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
packages/docs/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Mintlify Starter Kit
|
| 2 |
+
|
| 3 |
+
Use the starter kit to get your docs deployed and ready to customize.
|
| 4 |
+
|
| 5 |
+
Click the green **Use this template** button at the top of this repo to copy the Mintlify starter kit. The starter kit contains examples with
|
| 6 |
+
|
| 7 |
+
- Guide pages
|
| 8 |
+
- Navigation
|
| 9 |
+
- Customizations
|
| 10 |
+
- API reference pages
|
| 11 |
+
- Use of popular components
|
| 12 |
+
|
| 13 |
+
**[Follow the full quickstart guide](https://starter.mintlify.com/quickstart)**
|
| 14 |
+
|
| 15 |
+
## Development
|
| 16 |
+
|
| 17 |
+
Install the [Mintlify CLI](https://www.npmjs.com/package/mint) to preview your documentation changes locally. To install, use the following command:
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
npm i -g mint
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
Run the following command at the root of your documentation, where your `docs.json` is located:
|
| 24 |
+
|
| 25 |
+
```
|
| 26 |
+
mint dev
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
View your local preview at `http://localhost:3000`.
|
| 30 |
+
|
| 31 |
+
## Publishing changes
|
| 32 |
+
|
| 33 |
+
Install our GitHub app from your [dashboard](https://dashboard.mintlify.com/settings/organization/github-app) to propagate changes from your repo to your deployment. Changes are deployed to production automatically after pushing to the default branch.
|
| 34 |
+
|
| 35 |
+
## Need help?
|
| 36 |
+
|
| 37 |
+
### Troubleshooting
|
| 38 |
+
|
| 39 |
+
- If your dev environment isn't running: Run `mint update` to ensure you have the most recent version of the CLI.
|
| 40 |
+
- If a page loads as a 404: Make sure you are running in a folder with a valid `docs.json`.
|
| 41 |
+
|
| 42 |
+
### Resources
|
| 43 |
+
|
| 44 |
+
- [Mintlify documentation](https://mintlify.com/docs)
|
packages/docs/development.mdx
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: "Development"
|
| 3 |
+
description: "Preview changes locally to update your docs"
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
<Info>**Prerequisites**: - Node.js version 19 or higher - A docs repository with a `docs.json` file</Info>
|
| 7 |
+
|
| 8 |
+
Follow these steps to install and run Mintlify on your operating system.
|
| 9 |
+
|
| 10 |
+
<Steps>
|
| 11 |
+
<Step title="Install the Mintlify CLI">
|
| 12 |
+
|
| 13 |
+
```bash
|
| 14 |
+
npm i -g mint
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
</Step>
|
| 18 |
+
|
| 19 |
+
<Step title="Preview locally">
|
| 20 |
+
|
| 21 |
+
Navigate to your docs directory where your `docs.json` file is located, and run the following command:
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
mint dev
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
A local preview of your documentation will be available at `http://localhost:3000`.
|
| 28 |
+
|
| 29 |
+
</Step>
|
| 30 |
+
</Steps>
|
| 31 |
+
|
| 32 |
+
## Custom ports
|
| 33 |
+
|
| 34 |
+
By default, Mintlify uses port 3000. You can customize the port Mintlify runs on by using the `--port` flag. For example, to run Mintlify on port 3333, use this command:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
mint dev --port 3333
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
If you attempt to run Mintlify on a port that's already in use, it will use the next available port:
|
| 41 |
+
|
| 42 |
+
```md
|
| 43 |
+
Port 3000 is already in use. Trying 3001 instead.
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Mintlify versions
|
| 47 |
+
|
| 48 |
+
Please note that each CLI release is associated with a specific version of Mintlify. If your local preview does not align with the production version, please update the CLI:
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
npm mint update
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## Validating links
|
| 55 |
+
|
| 56 |
+
The CLI can assist with validating links in your documentation. To identify any broken links, use the following command:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
mint broken-links
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Deployment
|
| 63 |
+
|
| 64 |
+
If the deployment is successful, you should see the following:
|
| 65 |
+
|
| 66 |
+
<Frame>
|
| 67 |
+
<img
|
| 68 |
+
src="/images/checks-passed.png"
|
| 69 |
+
alt="Screenshot of a deployment confirmation message that says All checks have passed."
|
| 70 |
+
style={{ borderRadius: "0.5rem" }}
|
| 71 |
+
/>
|
| 72 |
+
</Frame>
|
| 73 |
+
|
| 74 |
+
## Code formatting
|
| 75 |
+
|
| 76 |
+
We suggest using extensions on your IDE to recognize and format MDX. If you're a VSCode user, consider the [MDX VSCode extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting.
|
| 77 |
+
|
| 78 |
+
## Troubleshooting
|
| 79 |
+
|
| 80 |
+
<AccordionGroup>
|
| 81 |
+
<Accordion title='Error: Could not load the "sharp" module using the darwin-arm64 runtime'>
|
| 82 |
+
|
| 83 |
+
This may be due to an outdated version of node. Try the following:
|
| 84 |
+
1. Remove the currently-installed version of the CLI: `npm remove -g mint`
|
| 85 |
+
2. Upgrade to Node v19 or higher.
|
| 86 |
+
3. Reinstall the CLI: `npm i -g mint`
|
| 87 |
+
|
| 88 |
+
</Accordion>
|
| 89 |
+
|
| 90 |
+
<Accordion title="Issue: Encountering an unknown error">
|
| 91 |
+
|
| 92 |
+
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Then run `mint dev` again.
|
| 93 |
+
</Accordion>
|
| 94 |
+
</AccordionGroup>
|
| 95 |
+
|
| 96 |
+
Curious about what changed in the latest CLI version? Check out the [CLI changelog](https://www.npmjs.com/package/mintlify?activeTab=versions).
|
packages/docs/docs.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://mintlify.com/docs.json",
|
| 3 |
+
"theme": "mint",
|
| 4 |
+
"name": "@opencode-ai/docs",
|
| 5 |
+
"colors": {
|
| 6 |
+
"primary": "#16A34A",
|
| 7 |
+
"light": "#07C983",
|
| 8 |
+
"dark": "#15803D"
|
| 9 |
+
},
|
| 10 |
+
"favicon": "/favicon-v3.svg",
|
| 11 |
+
"navigation": {
|
| 12 |
+
"tabs": [
|
| 13 |
+
{
|
| 14 |
+
"tab": "SDK",
|
| 15 |
+
"groups": [
|
| 16 |
+
{
|
| 17 |
+
"group": "Getting started",
|
| 18 |
+
"pages": ["index", "quickstart", "development"],
|
| 19 |
+
"openapi": "https://opencode.ai/openapi.json"
|
| 20 |
+
}
|
| 21 |
+
]
|
| 22 |
+
}
|
| 23 |
+
],
|
| 24 |
+
"global": {}
|
| 25 |
+
},
|
| 26 |
+
"logo": {
|
| 27 |
+
"light": "/logo/light.svg",
|
| 28 |
+
"dark": "/logo/dark.svg"
|
| 29 |
+
},
|
| 30 |
+
"navbar": {
|
| 31 |
+
"links": [
|
| 32 |
+
{
|
| 33 |
+
"label": "Support",
|
| 34 |
+
"href": "mailto:hi@mintlify.com"
|
| 35 |
+
}
|
| 36 |
+
],
|
| 37 |
+
"primary": {
|
| 38 |
+
"type": "button",
|
| 39 |
+
"label": "Dashboard",
|
| 40 |
+
"href": "https://dashboard.mintlify.com"
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"contextual": {
|
| 44 |
+
"options": ["copy", "view", "chatgpt", "claude", "perplexity", "mcp", "cursor", "vscode"]
|
| 45 |
+
},
|
| 46 |
+
"footer": {
|
| 47 |
+
"socials": {
|
| 48 |
+
"x": "https://x.com/mintlify",
|
| 49 |
+
"github": "https://github.com/mintlify",
|
| 50 |
+
"linkedin": "https://linkedin.com/company/mintlify"
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
}
|
packages/docs/favicon-v3.svg
ADDED
|
|