Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .codex/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sandbox_mode = "workspace-write"
[mcp_servers.core-agent]
command = "core-agent"
args = ["mcp"]
required = true
required = false
startup_timeout_sec = 15
tool_timeout_sec = 120

Expand Down
64 changes: 64 additions & 0 deletions .codex/config.toml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Core Agent — Codex Configuration
# Shared between CLI and IDE extension

model = "gpt-5.4"
model_reasoning_effort = "xhigh"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
personality = "pragmatic"

# Default to LEM when available
# oss_provider = "ollama"

[profiles.review]
model = "gpt-5.4"
model_reasoning_effort = "xhigh"
approval_policy = "never"
sandbox_mode = "read-only"

[profiles.quick]
model = "gpt-5.4"
model_reasoning_effort = "low"
approval_policy = "never"

[profiles.implement]
model = "gpt-5.4"
model_reasoning_effort = "high"
approval_policy = "never"
sandbox_mode = "workspace-write"

[profiles.lem]
model = "lem-4b"
model_provider = "ollama"
model_reasoning_effort = "high"
approval_policy = "never"
sandbox_mode = "workspace-write"

# Core Agent MCP Server
[mcp_servers.core-agent]
command = "core-agent"
args = ["mcp"]
required = true
startup_timeout_sec = 15
tool_timeout_sec = 120

[mcp_servers.core-agent.env]
FORGE_TOKEN = "${FORGE_TOKEN}"
CORE_BRAIN_KEY = "${CORE_BRAIN_KEY}"
MONITOR_INTERVAL = "15s"

# Model providers: codex CLI 0.122+ ships built-in `ollama` and `lmstudio`
# providers pointing at the same default localhost ports, so project-level
# overrides are both redundant and rejected ("reserved built-in provider IDs").

# Agent configuration
[agents]
max_threads = 4
max_depth = 1
job_max_runtime_seconds = 600

# Features
[features]
multi_agent = true
shell_snapshot = true
undo = true
12 changes: 7 additions & 5 deletions .core/reference/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
// "deploy/to/homelab" → "cmd.deploy.to.homelab.description"
package core


// CommandAction is the function signature for command handlers.
//
// func(opts core.Options) core.Result
type CommandAction func(Options) Result

// Command is the DTO for an executable operation.
// Commands are declarative — they carry enough information for multiple consumers:
//
// - core.Cli() runs the Action
//
// - core/cli adds rich help, completion, man pages
//
// - go-process wraps Managed commands with lifecycle (PID, health, signals)
//
// c.Command("serve", core.Command{
// Action: handler,
// Managed: "process.daemon", // go-process provides start/stop/restart
// })
// c.Command("serve", core.Command{
// Action: handler,
// Managed: "process.daemon", // go-process provides start/stop/restart
// })
type Command struct {
Name string
Description string // i18n key — derived from path if empty
Expand Down
22 changes: 11 additions & 11 deletions .core/reference/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ type CoreOption func(*Core) Result
// c.Run()
func New(opts ...CoreOption) *Core {
c := &Core{
app: &App{},
data: &Data{Registry: NewRegistry[*Embed]()},
drive: &Drive{Registry: NewRegistry[*DriveHandle]()},
fs: (&Fs{}).New("/"),
config: (&Config{}).New(),
error: &ErrorPanic{},
log: &ErrorLog{},
lock: &Lock{locks: NewRegistry[*sync.RWMutex]()},
ipc: &Ipc{actions: NewRegistry[*Action](), tasks: NewRegistry[*Task]()},
info: systemInfo,
i18n: &I18n{},
app: &App{},
data: &Data{Registry: NewRegistry[*Embed]()},
drive: &Drive{Registry: NewRegistry[*DriveHandle]()},
fs: (&Fs{}).New("/"),
config: (&Config{}).New(),
error: &ErrorPanic{},
log: &ErrorLog{},
lock: &Lock{locks: NewRegistry[*sync.RWMutex]()},
ipc: &Ipc{actions: NewRegistry[*Action](), tasks: NewRegistry[*Task]()},
info: systemInfo,
i18n: &I18n{},
api: &API{protocols: NewRegistry[StreamFactory]()},
services: &ServiceRegistry{Registry: NewRegistry[*Service]()},
commands: &CommandRegistry{Registry: NewRegistry[*Command]()},
Expand Down
14 changes: 10 additions & 4 deletions .core/reference/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func GeneratePack(pkg ScannedPackage) Result {
return Result{b.String(), true}
}

b.WriteString("import \"dappco.re/go/core\"\n\n")
b.WriteString("import \"dappco.re/go\"\n\n")
b.WriteString("func init() {\n")

// Pack groups (entire directories)
Expand Down Expand Up @@ -287,12 +287,18 @@ func compress(input string) (string, error) {
return "", err
}
if _, err := gz.Write([]byte(input)); err != nil {
_ = gz.Close()
_ = b64.Close()
if closeErr := gz.Close(); closeErr != nil {
return "", err
}
if closeErr := b64.Close(); closeErr != nil {
return "", err
}
return "", err
}
if err := gz.Close(); err != nil {
_ = b64.Close()
if closeErr := b64.Close(); closeErr != nil {
return "", err
}
return "", err
}
if err := b64.Close(); err != nil {
Expand Down
4 changes: 3 additions & 1 deletion .core/reference/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ func (i *I18n) SetTranslator(t Translator) {
locale := i.locale
i.mu.Unlock()
if t != nil && locale != "" {
_ = t.SetLanguage(locale)
if result := t.SetLanguage(locale); !result.OK {
return
}
}
}

Expand Down
1 change: 0 additions & 1 deletion .core/reference/ipc.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,3 @@ func (c *Core) RegisterActions(handlers ...func(*Core, Message) Result) {
c.ipc.ipcHandlers = append(c.ipc.ipcHandlers, handlers...)
c.ipc.ipcMu.Unlock()
}

43 changes: 43 additions & 0 deletions .deps/core-compat/ax7_triplets_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package core

import coretest "dappco.re/go"

func TestAX7_NewRegistry_Good(t *coretest.T) {
reg := NewRegistry[string]()
coretest.AssertNotNil(t, reg)
coretest.AssertEqual(t, 0, reg.Len())
}

func TestAX7_NewRegistry_Bad(t *coretest.T) {
reg := NewRegistry[int]()
got := reg.Get("missing")
coretest.AssertFalse(t, got.OK)
coretest.AssertNil(t, got.Value)
}

func TestAX7_NewRegistry_Ugly(t *coretest.T) {
reg := NewRegistry[*int]()
reg.Set("", nil)
got := reg.Get("")
coretest.AssertTrue(t, got.OK)
coretest.AssertNil(t, got.Value)
}

func TestAX7_NewServiceRuntime_Good(t *coretest.T) {
runtime := NewServiceRuntime(New(), "opts")
coretest.AssertNotNil(t, runtime)
coretest.AssertNotNil(t, runtime.Core)
}

func TestAX7_NewServiceRuntime_Bad(t *coretest.T) {
runtime := NewServiceRuntime[string](nil, "")
coretest.AssertNotNil(t, runtime)
coretest.AssertNil(t, runtime.Core)
}

func TestAX7_NewServiceRuntime_Ugly(t *coretest.T) {
opts := map[string]string{"name": "api"}
runtime := NewServiceRuntime(New(), opts)
coretest.AssertEqual(t, "api", runtime.Options["name"])
coretest.AssertNotNil(t, runtime.Core)
}
103 changes: 103 additions & 0 deletions .deps/core-compat/core.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package core

import newcore "dappco.re/go"

type Action = newcore.Action
type ActionHandler = newcore.ActionHandler
type App = newcore.App
type AtomicPointer[T any] = newcore.AtomicPointer[T]
type Cli = newcore.Cli
type Command = newcore.Command
type CommandAction = newcore.CommandAction
type Core = newcore.Core
type CoreOption = newcore.CoreOption
type Embed = newcore.Embed
type Fs = newcore.Fs
type Lock = newcore.Lock
type Log = newcore.Log
type Message = newcore.Message
type Mutex = newcore.Mutex
type Once = newcore.Once
type Option = newcore.Option
type Options = newcore.Options
type Process = newcore.Process
type Query = newcore.Query
type Registry[T any] = newcore.Registry[T]
type Result = newcore.Result
type RWMutex = newcore.RWMutex
type Service = newcore.Service
type ServiceRuntime[T any] = newcore.ServiceRuntime[T]
type Startable = newcore.Startable
type Stoppable = newcore.Stoppable
type Translator = newcore.Translator

var As = newcore.As
var Atoi = newcore.Atoi
var CleanPath = newcore.CleanPath
var Concat = newcore.Concat
var Contains = newcore.Contains
var E = newcore.E
var Env = newcore.Env
var ErrorJoin = newcore.ErrorJoin
var Exit = newcore.Exit
var FormatInt = newcore.FormatInt
var HasPrefix = newcore.HasPrefix
var HasSuffix = newcore.HasSuffix
var ID = newcore.ID
var Itoa = newcore.Itoa
var Is = newcore.Is
var IsDigit = newcore.IsDigit
var IsLetter = newcore.IsLetter
var IsSpace = newcore.IsSpace
var JSONMarshal = newcore.JSONMarshal
var JSONMarshalString = newcore.JSONMarshalString
var JSONUnmarshal = newcore.JSONUnmarshal
var JSONUnmarshalString = newcore.JSONUnmarshalString
var Join = newcore.Join
var JoinPath = newcore.JoinPath
var Lower = newcore.Lower
var New = newcore.New
var NewBuffer = newcore.NewBuffer
var NewBuilder = newcore.NewBuilder
var NewError = newcore.NewError
var NewOptions = newcore.NewOptions
var NewReader = newcore.NewReader
var Operation = newcore.Operation
var Path = newcore.Path
var PathBase = newcore.PathBase
var PathDir = newcore.PathDir
var PathExt = newcore.PathExt
var PathGlob = newcore.PathGlob
var PathIsAbs = newcore.PathIsAbs
var PathJoin = newcore.PathJoin
var Print = newcore.Print
var Println = newcore.Println
var ReadAll = newcore.ReadAll
var Replace = newcore.Replace
var SHA256 = newcore.SHA256
var Security = newcore.Security
var Split = newcore.Split
var SplitN = newcore.SplitN
var Sprint = newcore.Sprint
var Sprintf = newcore.Sprintf
var ParseInt = newcore.ParseInt
var Trim = newcore.Trim
var TrimPrefix = newcore.TrimPrefix
var TrimSuffix = newcore.TrimSuffix
var Upper = newcore.Upper
var ValidateName = newcore.ValidateName
var URLParse = newcore.URLParse
var URLEncode = newcore.URLEncode
var Warn = newcore.Warn
var WithName = newcore.WithName
var WithOption = newcore.WithOption
var WithService = newcore.WithService
var Wrap = newcore.Wrap

func NewRegistry[T any]() *Registry[T] {
return newcore.NewRegistry[T]()
}

func NewServiceRuntime[T any](c *Core, opts T) *ServiceRuntime[T] {
return newcore.NewServiceRuntime(c, opts)
}
5 changes: 5 additions & 0 deletions .deps/core-compat/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module dappco.re/go/core

go 1.26.0

require dappco.re/go v0.9.0
2 changes: 1 addition & 1 deletion cmd/core-agent/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package main
import (
"os"

"dappco.re/go"
"dappco.re/go/agent/pkg/agentic"
"dappco.re/go/core"
)

type applicationCommandSet struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/core-agent/commands_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package main

import (
"dappco.re/go/core"
"dappco.re/go"
)

func Example_registerApplicationCommands() {
Expand Down
Loading