feat: launch as neuron — bin entry + CLI script name
This commit is contained in:
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Neuron launcher: run the CLI from source under Bun.
|
||||||
|
SELF="$0"
|
||||||
|
while [ -L "$SELF" ]; do
|
||||||
|
LINK="$(readlink "$SELF")"
|
||||||
|
case "$LINK" in
|
||||||
|
/*) SELF="$LINK" ;;
|
||||||
|
*) SELF="$(dirname "$SELF")/$LINK" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
DIR="$(cd "$(dirname "$SELF")" && pwd)"
|
||||||
|
exec bun run --conditions=browser "$DIR/../src/index.ts" "$@"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"dev:temporary": "bun run --conditions=browser ./src/temporary.ts"
|
"dev:temporary": "bun run --conditions=browser ./src/temporary.ts"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"opencode": "./bin/opencode"
|
"neuron": "./bin/neuron"
|
||||||
},
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
"./*": "./src/*.ts"
|
"./*": "./src/*.ts"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Context, Effect, Exit, Fiber } from "effect"
|
import { Context, Effect, Exit, Fiber } from "effect"
|
||||||
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
import { WorkspaceContext } from "@/effect/workspace-context"
|
||||||
import type { WorkspaceV2 } from "@opencode-ai/core/workspace"
|
import type { WorkspaceV2 } from "@opencode-ai/core/workspace"
|
||||||
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
||||||
import { attachWith } from "./run-service"
|
import { attachWith } from "./run-service"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Effect, ScopedCache, Scope } from "effect"
|
|||||||
import type { InstanceContext } from "@/project/instance-context"
|
import type { InstanceContext } from "@/project/instance-context"
|
||||||
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
||||||
import { registerDisposer } from "./instance-registry"
|
import { registerDisposer } from "./instance-registry"
|
||||||
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
import { WorkspaceContext } from "@/effect/workspace-context"
|
||||||
|
|
||||||
const TypeId = "~opencode/InstanceState"
|
const TypeId = "~opencode/InstanceState"
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Effect, Fiber, Layer, ManagedRuntime } from "effect"
|
|||||||
import * as Context from "effect/Context"
|
import * as Context from "effect/Context"
|
||||||
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
import { InstanceRef, WorkspaceRef } from "./instance-ref"
|
||||||
import * as Observability from "@opencode-ai/core/observability"
|
import * as Observability from "@opencode-ai/core/observability"
|
||||||
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
import { WorkspaceContext } from "@/effect/workspace-context"
|
||||||
import type { InstanceContext } from "@/project/instance-context"
|
import type { InstanceContext } from "@/project/instance-context"
|
||||||
import { memoMap } from "@opencode-ai/core/effect/memo-map"
|
import { memoMap } from "@opencode-ai/core/effect/memo-map"
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function show(out: string) {
|
|||||||
|
|
||||||
const cli = yargs(args)
|
const cli = yargs(args)
|
||||||
.parserConfiguration({ "populate--": true })
|
.parserConfiguration({ "populate--": true })
|
||||||
.scriptName("opencode")
|
.scriptName("neuron")
|
||||||
.wrap(100)
|
.wrap(100)
|
||||||
.help("help", "show help")
|
.help("help", "show help")
|
||||||
.alias("help", "h")
|
.alias("help", "h")
|
||||||
|
|||||||
Reference in New Issue
Block a user