Skip to content

Commit c39eedd

Browse files
committed
chore: migrate npm scope from @Singularity-AI to @mohanscodex
- Updated all package.json names, workspace deps, and internal imports - Updated docs, changelogs, changeset config, CI workflows, AGENTS.md - Fixed release workflow: removed --no-git-tag so changesets creates git tags - Updated GitHub Release step to rely on changeset-pushed tags - Prepared 0.4.0 minor changeset with comprehensive changelog
1 parent 41f63db commit c39eedd

84 files changed

Lines changed: 416 additions & 375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"commit": false,
88
"fixed": [
99
[
10-
"@singularity-ai/spectra-ai",
11-
"@singularity-ai/spectra-agent",
12-
"@singularity-ai/spectra-app"
10+
"@mohanscodex/spectra-ai",
11+
"@mohanscodex/spectra-agent",
12+
"@mohanscodex/spectra-app"
1313
]
1414
],
1515
"linked": [],
1616
"access": "public",
1717
"baseBranch": "main",
1818
"updateInternalDependencies": "patch",
19-
"ignore": ["@singularity-ai/spectra-examples"]
19+
"ignore": ["@mohanscodex/spectra-examples"]
2020
}

.changeset/fresh-start-0-4-0.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
"@mohanscodex/spectra-ai": minor
3+
"@mohanscodex/spectra-agent": minor
4+
"@mohanscodex/spectra-app": minor
5+
---
6+
7+
**npm scope migration:** `@singularity-ai/*``@mohanscodex/*` — all packages now publish under the personal scope to resolve naming conflicts
8+
9+
**Provider & Model Registry:**
10+
- New `generate-models` script: fetches 4039 models across 158 providers from OpenRouter and models.dev
11+
- Custom provider support via `registerProvider()` in the TUI and SDK
12+
- 17 new provider integrations (xAI, DeepSeek, Mistral, Cerebras, Google, Fireworks, Together, Perplexity, Cohere, Novita, Moonshot, Chutes, MiniMax, HuggingFace, NVIDIA, Z.AI)
13+
14+
**Agent System:**
15+
- Mode-switching agent with subagent dispatch — task subagent tool, markdown subagent, and session hierarchy
16+
- Turn-level footer with revert, rollback, and filesystem checkpointing
17+
- Streaming stutter fix, focus bleed fix, thinking toggle in TUI
18+
19+
**TUI (`spectra-code`):**
20+
- Full rewrite with `@opentui/react` (JSX components, yargs CLI)
21+
- Provider connection flow, model lifecycle, no-model state, per-message model tracking
22+
- Redesigned home layout with Spectra Void theme
23+
- Fixed autocomplete positioning, Escape dismissal, session list refresh
24+
- Fixed shell tool output, interrupt handling, and message persistence
25+
26+
**Distributed Infrastructure (`spectra-app`):**
27+
- `SessionEngine` — full lifecycle orchestration with session load, rate limiting, agent execution, and persistence
28+
- `RedisRateLimiter` + `RedisSessionStore` — distributed sliding window rate limiting and session storage
29+
- `CompositeRateLimiter` — multi-dimensional (tenant + user + provider)
30+
- `CircuitBreaker` — three-state machine (Closed/Open/HalfOpen)
31+
- `SseBridge` — SSE-based connection bridge with heartbeat and graceful close
32+
- `HealthProbe` — Kubernetes-ready health checks (liveness + readiness)
33+
34+
**Other:**
35+
- MCP support for file and shell tools
36+
- CLI refactored with proper subcommands and session actions
37+
- Circuit breaker in Rust SDK (`spectra-rs`)
38+
- GitHub Actions: docs deployment workflow, fixed release pipeline
39+
- Full docs sync with current SDK API surface

.changeset/shy-bottles-relate.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,48 +38,34 @@ jobs:
3838
uses: changesets/action@v1
3939
with:
4040
version: bun run version
41-
publish: bun run release --no-git-tag
41+
publish: bun run release
4242
commit: "chore: version packages"
4343
title: "chore: version packages"
4444
env:
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4646
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4747

48-
# ── Create GitHub Release when packages are published ──
49-
# Uses publishedPackages output directly instead of the `published` flag,
50-
# which is unreliable with --no-git-tag in some changesets/action versions.
5148
- name: Create GitHub Release
5249
if: steps.changesets.outputs.publishedPackages != '' && steps.changesets.outputs.publishedPackages != '[]'
5350
env:
5451
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5552
PUBLISHED: ${{ steps.changesets.outputs.publishedPackages }}
5653
run: |
57-
# Extract version from the first published package (all are fixed-versioned)
5854
VERSION=$(echo "$PUBLISHED" | jq -r '.[0].version')
5955
TAG="v${VERSION}"
6056
61-
# Build release body — use double-backtick code spans to prevent @ mentions
62-
{
63-
echo "## Published Packages"
64-
echo ""
65-
for row in $(echo "$PUBLISHED" | jq -r '.[] | @base64'); do
66-
PKG_NAME=$(echo "$row" | base64 -d | jq -r '.name')
67-
VER=$(echo "$row" | base64 -d | jq -r '.version')
68-
echo "- \`\`${PKG_NAME}@${VER}\`\` — [npm](https://www.npmjs.com/package/${PKG_NAME}/v/${VER})"
69-
done
70-
echo ""
71-
echo "## Install"
72-
echo ""
73-
echo '```sh'
74-
echo "bun add @singularity-ai/spectra-ai@${VERSION}"
75-
echo '```'
76-
} > /tmp/release-body.md
57+
cat > /tmp/release-body.md <<- EOF
58+
## Published Packages
7759
78-
# Create git tag for the unified release (vX.Y.Z)
79-
git tag "$TAG" || true
80-
git push origin "$TAG" || true
60+
$(echo "$PUBLISHED" | jq -r '.[] | "- \`\(.name)@\(.version)\` — [npm](https://www.npmjs.com/package/\(.name)/v/\(.version))"')
61+
62+
## Install
63+
64+
\`\`\`sh
65+
bun add @mohanscodex/spectra-ai@${VERSION}
66+
\`\`\`
67+
EOF
8168
82-
# Create the GitHub Release
8369
gh release create "$TAG" \
8470
--title "Spectra $TAG" \
8571
--notes-file /tmp/release-body.md \

.opencode/skills/spectra-dev/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Each SDK (TypeScript, Rust) is a **complete, independent native implementation**
6363
6464
### TypeScript Agent
6565
```typescript
66-
import { Agent, defineTool } from "@singularity-ai/spectra-agent";
66+
import { Agent, defineTool } from "@mohanscodex/spectra-agent";
6767
import { z } from "zod";
6868
6969
const agent = new Agent({

AGENTS.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ spectra/
121121
│ ├── openai.rs # OpenAI Chat Completions SSE streaming via reqwest
122122
│ └── test.rs # Wiremock integration tests
123123
├── packages/
124-
│ ├── ai/ # @singularity-ai/spectra-ai — TypeScript LLM provider layer
124+
│ ├── ai/ # @mohanscodex/spectra-ai — TypeScript LLM provider layer
125125
│ │ └── src/
126126
│ │ ├── types.ts # Core types: Message, AssistantMessage, ToolCall, StopReason, Model, etc.
127127
│ │ ├── event-stream.ts # EventStream<T,R> / AssistantMessageEventStream (AsyncIterable)
@@ -132,7 +132,7 @@ spectra/
132132
│ │ ├── openai-responses.ts # OpenAI Responses API provider
133133
│ │ ├── shared.ts # sanitizeSurrogates, parseStreamingJson
134134
│ │ └── register-builtins.ts # Auto-registers all providers
135-
│ └── agent/ # @singularity-ai/spectra-agent — TypeScript agent + tool system
135+
│ └── agent/ # @mohanscodex/spectra-agent — TypeScript agent + tool system
136136
│ └── src/
137137
│ ├── agent.ts # Agent class with run loop, tool dispatch, streaming
138138
│ ├── types.ts # AgentTool, ToolResult, AgentEvent, AgentConfig, hooks
@@ -177,7 +177,7 @@ spectra/
177177
### Naming Conventions
178178
- Rust: snake_case for functions/variables, PascalCase for types, module files are snake_case
179179
- TypeScript: camelCase for functions/variables, PascalCase for types/classes
180-
- Package namespaces: `@singularity-ai/spectra-ai`, `@singularity-ai/spectra-agent`, `spectra-rs`, `spectra-http`
180+
- Package namespaces: `@mohanscodex/spectra-ai`, `@mohanscodex/spectra-agent`, `spectra-rs`, `spectra-http`
181181
- Provider names in registry: `"anthropic"`, `"openai-completions"`, `"openai-responses"`
182182
- **Implementation naming**: Name classes by their behavior or storage mechanism, not by capability level. Avoid `Simple` prefix. Prefer descriptive names (e.g., `MemoryRateLimiter` over `SimpleRateLimiter`, `SequentialWorkerPool` over `SimpleWorkerPool`, `AgentRegistry` over `SimpleOrchestrator`). Interface names should describe capability (`Orchestrator`, `RateLimiter`, `WorkerPool`).
183183
- **Limitations belong in docs, not names**: If an implementation has tradeoffs (in-memory only, single-threaded), document them in JSDoc and README — don't encode them in the class name.
@@ -264,9 +264,9 @@ npm install ./singularity-ai-spectra-app-*.tgz
264264

265265
# 6. Import test — verify all packages, exports, constructors, and Zod validation
266266
node --input-type=module -e '
267-
import { EventStream, stream } from "@singularity-ai/spectra-ai";
268-
import { Agent, defineTool } from "@singularity-ai/spectra-agent";
269-
import { SessionManager } from "@singularity-ai/spectra-app";
267+
import { EventStream, stream } from "@mohanscodex/spectra-ai";
268+
import { Agent, defineTool } from "@mohanscodex/spectra-agent";
269+
import { SessionManager } from "@mohanscodex/spectra-app";
270270
import { z } from "zod";
271271
272272
// Verify each package loads
@@ -379,7 +379,7 @@ No project skills found. Add skills to any of `.claude/skills/`, `.agents/skills
379379
### Tooling
380380
381381
- **Changesets** (`@changesets/cli`) for TypeScript package versioning and npm publishing
382-
- **Fixed versioning**: `@singularity-ai/spectra-ai`, `@singularity-ai/spectra-agent`, and `@singularity-ai/spectra-app` always share the same version
382+
- **Fixed versioning**: `@mohanscodex/spectra-ai`, `@mohanscodex/spectra-agent`, and `@mohanscodex/spectra-app` always share the same version
383383
- **Changelog**: `@changesets/changelog-github` generates changelogs with PR/commit links (repo: `codex-mohan/spectra`)
384384
385385
### Release Process (TypeScript)
@@ -396,7 +396,7 @@ No project skills found. Add skills to any of `.claude/skills/`, `.agents/skills
396396
- **Never create Git tags manually** — the release workflow handles `vX.Y.Z` tags and GitHub Releases
397397
- **Never publish to npm manually** — the release workflow handles `npm publish`
398398
- **All 3 TS packages must stay at the same version** — the changeset `fixed` group enforces this
399-
- **Escape `@` in release notes** — scoped package names like `@singularity-ai/spectra-ai` must be escaped (`\@` or backtick-wrapped) in GitHub Release notes to prevent GitHub from interpreting them as user mentions
399+
- **Escape `@` in release notes** — scoped package names like `@mohanscodex/spectra-ai` must be escaped (`\@` or backtick-wrapped) in GitHub Release notes to prevent GitHub from interpreting them as user mentions
400400
- **Rust crates**: No automated release yet. When ready, use [release-plz](https://release-plz.ieni.dev/) in a separate workflow. Do **not** try to keep Rust and TS versions in lockstep — they will diverge independently
401401
- **`commit: false`** in changeset config — the GitHub Action handles the version commit via its own PR
402402
@@ -454,7 +454,7 @@ Rules:
454454
455455
**TypeScript:**
456456
```typescript
457-
import { Agent, defineTool } from "@singularity-ai/spectra-agent";
457+
import { Agent, defineTool } from "@mohanscodex/spectra-agent";
458458
import { z } from "zod";
459459
460460
const agent = new Agent({

apps/examples/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@singularity-ai/spectra-examples",
2+
"name": "@mohanscodex/spectra-examples",
33
"version": "0.1.0",
44
"private": true,
55
"type": "module",
@@ -12,8 +12,8 @@
1212
"dependencies": {
1313
"@opentui/core": "^0.1.103",
1414
"@opentui/react": "^0.1.103",
15-
"@singularity-ai/spectra-agent": "workspace:*",
16-
"@singularity-ai/spectra-ai": "workspace:*",
15+
"@mohanscodex/spectra-agent": "workspace:*",
16+
"@mohanscodex/spectra-ai": "workspace:*",
1717
"clipboardy": "^5.3.1",
1818
"dotenv": "^16.4.0",
1919
"ink": "^5.2.0",

apps/examples/src/chat-tui-opentui.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import clipboard from "clipboardy"
66
import { useState, useCallback, useRef, useEffect, useMemo } from "react"
77
import { createCliRenderer, RGBA, SyntaxStyle } from "@opentui/core"
88
import { createRoot, flushSync, useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/react"
9-
import { Agent } from "@singularity-ai/spectra-agent"
10-
import { defineTool } from "@singularity-ai/spectra-agent"
9+
import { Agent } from "@mohanscodex/spectra-agent"
10+
import { defineTool } from "@mohanscodex/spectra-agent"
1111
import { z } from "zod"
12-
import type { AssistantMessage, TextContent, ThinkingContent, ToolCall, Message } from "@singularity-ai/spectra-ai"
12+
import type { AssistantMessage, TextContent, ThinkingContent, ToolCall, Message } from "@mohanscodex/spectra-ai"
1313
import "dotenv/config"
1414

1515
// ---------------------------------------------------------------------------

apps/examples/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Agent } from "@singularity-ai/spectra-agent";
1+
import { Agent } from "@mohanscodex/spectra-agent";
22

33
const agent = new Agent({
44
model: { id: "claude-sonnet-4-20250514", name: "Claude Sonnet 4", provider: "anthropic", api: "anthropic-messages" },

0 commit comments

Comments
 (0)