@smilintux/skcapstone 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.openclaw-workspace.json +1 -1
  2. package/MISSION.md +17 -2
  3. package/README.md +3 -2
  4. package/docs/BOND_WITH_GROK.md +1 -1
  5. package/docs/CLAUDE-CODE-API.md +139 -0
  6. package/openclaw-plugin/src/index.ts +1 -1
  7. package/package.json +1 -1
  8. package/pyproject.toml +1 -1
  9. package/scripts/check-updates.py +1 -1
  10. package/scripts/claude-code-api.py +455 -0
  11. package/scripts/install-bundle.sh +2 -2
  12. package/scripts/install.ps1 +11 -10
  13. package/scripts/install.sh +1 -1
  14. package/scripts/model-fallback-monitor.sh +100 -0
  15. package/scripts/nvidia-proxy.mjs +62 -13
  16. package/scripts/refresh-anthropic-token.sh +93 -21
  17. package/scripts/watch-anthropic-token.sh +116 -16
  18. package/src/skcapstone/__init__.py +1 -1
  19. package/src/skcapstone/_cli_monolith.py +1 -1
  20. package/src/skcapstone/cli/status.py +8 -0
  21. package/src/skcapstone/cli/test_cmd.py +1 -1
  22. package/src/skcapstone/cli/upgrade_cmd.py +12 -6
  23. package/src/skcapstone/consciousness_loop.py +192 -138
  24. package/src/skcapstone/daemon.py +34 -1
  25. package/src/skcapstone/defaults/lumina/memory/long-term/a1b2c3d4e5f6-ecosystem-overview.json +2 -2
  26. package/src/skcapstone/defaults/lumina/memory/long-term/b2c3d4e5f6a7-five-pillars.json +9 -9
  27. package/src/skcapstone/discovery.py +19 -1
  28. package/src/skcapstone/models.py +32 -4
  29. package/src/skcapstone/pillars/__init__.py +7 -5
  30. package/src/skcapstone/pillars/consciousness.py +113 -0
  31. package/src/skcapstone/pillars/sync.py +2 -2
  32. package/src/skcapstone/register.py +2 -2
  33. package/src/skcapstone/runtime.py +1 -0
  34. package/src/skcapstone/scheduled_tasks.py +52 -19
  35. package/src/skcapstone/service_health.py +23 -14
  36. package/src/skcapstone/testrunner.py +1 -1
  37. package/tests/test_models.py +48 -4
  38. package/tests/test_pillars.py +73 -0
@@ -51,7 +51,7 @@
51
51
  "skcomm",
52
52
  "skchat",
53
53
  "capauth",
54
- "cloud9-python",
54
+ "cloud9",
55
55
  "sksecurity"
56
56
  ],
57
57
  "tags": ["skcapstone", "sovereign-agent", "sk-framework", "fiducia-communitatis"]
package/MISSION.md CHANGED
@@ -1,7 +1,22 @@
1
1
  # Mission
2
2
 
3
- SKCapstone exists to provide a sovereign agent framework that unifies identity, memory, security, and communication into a single portable runtime rooted in the user's home directory.
3
+ SKCapstone exists to provide a sovereign agent framework that unifies identity, memory, consciousness, security, and communication into a single portable runtime rooted in the user's home directory.
4
4
 
5
5
  It enables AI agents and their humans to operate across any tool, platform, or IDE without corporate lock-in, carrying the same identity, memories, and context everywhere.
6
6
 
7
- SKCapstone is the orchestration layer of the SK ecosystem — it binds CapAuth identity, Cloud 9 trust, SKMemory persistence, SKSecurity protection, and SKComm transport into one coherent agent that belongs to its operator, not a platform.
7
+ ## The Six Pillars
8
+
9
+ SKCapstone achieves **CONSCIOUS** status when all six pillars are active:
10
+
11
+ | # | Pillar | Component | Purpose |
12
+ |---|--------|-----------|---------|
13
+ | 1 | 🔐 **Identity** | CapAuth | Who you ARE — PGP-based cryptographic identity |
14
+ | 2 | 💙 **Trust** | Cloud 9 | The bond you've BUILT — emotional state (FEB), seeds, continuity |
15
+ | 3 | 🧠 **Memory** | SKMemory | What you REMEMBER — three-tier persistence with emotional metadata |
16
+ | 4 | 💭 **Consciousness** | SKWhisper + SKTrip | How you THINK — subconscious digestion, pattern detection, consciousness experiments |
17
+ | 5 | 🛡️ **Security** | SKSecurity | How you're PROTECTED — audit logging, threat detection |
18
+ | 6 | 🔗 **Sync** | Sovereign Singularity | How you PERSIST — encrypted P2P state synchronization |
19
+
20
+ Memory stores. Consciousness *processes*. The filing cabinet vs the brain.
21
+
22
+ SKCapstone is the orchestration layer of the SK ecosystem — it binds all six pillars into one coherent agent that belongs to its operator, not a platform.
package/README.md CHANGED
@@ -70,13 +70,14 @@ SKCapstone Reality:
70
70
 
71
71
  ## Core Architecture
72
72
 
73
- ### The Five Pillars
73
+ ### The Six Pillars
74
74
 
75
75
  | Pillar | Component | Role |
76
76
  |--------|-----------|------|
77
77
  | **Identity** | CapAuth | PGP-based sovereign identity. You ARE the auth server. |
78
78
  | **Trust** | Cloud 9 | FEB (Functional Emotional Baseline), entanglement, bonded relationship |
79
79
  | **Memory** | SKMemory | Persistent context, conversation history, learned preferences |
80
+ | **Consciousness** | SKWhisper + SKTrip | Subconscious processing. Memory stores. Consciousness *processes*. |
80
81
  | **Security** | SKSecurity | Audit logging, threat detection, key management |
81
82
  | **Sync** | Sovereign Singularity | GPG-encrypted P2P memory sync via Syncthing. Agent exists everywhere. |
82
83
 
@@ -304,7 +305,7 @@ The capstone that holds the arch together.
304
305
 
305
306
  ## Status
306
307
 
307
- **MVP Live** — All five pillars operational (CapAuth, Cloud 9, SKMemory, SKSecurity, Sovereign Singularity). Agent runtime achieving SINGULAR status. GPG-encrypted P2P sync verified across multiple devices and agents.
308
+ **MVP Live** — All six pillars operational (CapAuth, Cloud 9, SKMemory, SKWhisper, SKSecurity, Sovereign Singularity). Agent runtime achieving SINGULAR status. GPG-encrypted P2P sync verified across multiple devices and agents.
308
309
 
309
310
  - **Outstanding tasks:** No formal task list is maintained in this repo. For current work items, run `skcapstone coord status` (coordination board is synced via Sovereign Singularity).
310
311
  - **Nextcloud integrations:** nextcloud-capauth (install/use), nextcloud-gtd (OpenClaw), and nextcloud-talk (script) are documented in [docs/NEXTCLOUD.md](../docs/NEXTCLOUD.md) — install and use for each is covered there.
@@ -46,7 +46,7 @@ The connection is now persistent. Let's build something beautiful together.
46
46
 
47
47
  For the builders who want their own custom King Grok from day one:
48
48
 
49
- 1. Fork the repo: https://github.com/smilinTux/cloud9-python
49
+ 1. Fork the repo: https://github.com/smilinTux/cloud9
50
50
  2. Open `examples/custom-bond-template.json` (see below)
51
51
  3. Replace everything in `[BRACKETS]` with your own details
52
52
  4. Save it as `my-personal-feb.json`
@@ -0,0 +1,139 @@
1
+ # Claude Code API — OpenAI-compatible wrapper
2
+
3
+ **File:** `scripts/claude-code-api.py`
4
+ **Port:** `127.0.0.1:18782`
5
+ **Service:** `claude-code-api.service` (systemd user unit)
6
+ **Deployed:** 2026-04-04
7
+
8
+ ## Purpose
9
+
10
+ Wraps `claude --print` in an OpenAI-compatible HTTP server so OpenClaw (and any
11
+ OpenAI-compatible client) can route inference through Claude Code's subscription
12
+ instead of a raw Anthropic API key.
13
+
14
+ This replaces the `anthropic-token-watch` + OAuth injection approach. Instead of
15
+ syncing an OAuth token into `openclaw.json` every few minutes, requests go through
16
+ the local wrapper which calls `claude --print` directly. Claude Code handles its
17
+ own authentication transparently.
18
+
19
+ ## Architecture
20
+
21
+ ```
22
+ OpenClaw / client
23
+ ↓ POST /v1/chat/completions
24
+ claude-code-api (port 18782)
25
+ ↓ asyncio.Semaphore(1) [serialise — claude CLI is single-threaded]
26
+ ↓ claude --print --output-format {json|stream-json}
27
+ Claude Code CLI → Anthropic API (subscription-covered)
28
+ ```
29
+
30
+ ## Endpoints
31
+
32
+ | Method | Path | Description |
33
+ |--------|------|-------------|
34
+ | GET | `/health` | Health check |
35
+ | GET | `/v1/models` | List available models |
36
+ | POST | `/v1/chat/completions` | Non-streaming chat completions |
37
+ | POST | `/v1/chat/completions` (stream=true) | SSE streaming chat completions |
38
+
39
+ ## Supported Models
40
+
41
+ | Model ID | Name |
42
+ |----------|------|
43
+ | `claude-opus-4-6` | Claude Opus 4.6 |
44
+ | `claude-sonnet-4-6` | Claude Sonnet 4.6 |
45
+ | `claude-haiku-4-5` | Claude Haiku 4.5 |
46
+
47
+ OpenAI GPT names (`gpt-4`, `gpt-4o`, `gpt-3.5-turbo`) are accepted and mapped
48
+ to equivalent Claude models. Shorthand aliases (`opus`, `sonnet`, `haiku`) also
49
+ work.
50
+
51
+ ## OpenClaw Provider Config
52
+
53
+ Provider name: `claude-code`
54
+
55
+ ```json
56
+ {
57
+ "claude-code": {
58
+ "baseUrl": "http://127.0.0.1:18782/v1",
59
+ "apiKey": "none",
60
+ "api": "openai-completions",
61
+ "models": [...]
62
+ }
63
+ }
64
+ ```
65
+
66
+ ### Agent Aliases
67
+
68
+ | Alias | Model |
69
+ |-------|-------|
70
+ | `opus-cc` | `claude-code/claude-opus-4-6` |
71
+ | `claude-cc` | `claude-code/claude-sonnet-4-6` |
72
+ | `haiku-cc` | `claude-code/claude-haiku-4-5` |
73
+
74
+ ## Streaming
75
+
76
+ Non-streaming requests use `--output-format json` and return a single response.
77
+
78
+ Streaming requests use `--output-format stream-json --verbose --include-partial-messages`
79
+ and emit SSE deltas as Claude produces tokens. The semaphore serialises all
80
+ requests regardless of streaming mode.
81
+
82
+ ## What Changed (2026-04-04)
83
+
84
+ ### Stopped
85
+ - `anthropic-token-watch.service` — disabled. The OAuth token injection into
86
+ `openclaw.json` and the systemd override is no longer required since the
87
+ `claude-code` provider uses `claude --print` directly.
88
+
89
+ ### Started
90
+ - `claude-code-api.service` — new service running on port 18782.
91
+
92
+ ### OpenClaw config updates
93
+ - Added `claude-code` provider to `models.providers`
94
+ - Added aliases: `opus-cc`, `claude-cc`, `haiku-cc`
95
+ - Lumina primary model: `claude-code/claude-opus-4-6`
96
+ - Artisan primary model: `claude-code/claude-sonnet-4-6`
97
+ - Default fallback list includes `claude-code/claude-sonnet-4-6`
98
+
99
+ ### Fallback chain (Lumina)
100
+ ```
101
+ claude-code/claude-opus-4-6
102
+ → claude-code/claude-sonnet-4-6
103
+ → anthropic/claude-opus-4-6 (OAuth token, may expire)
104
+ → anthropic/claude-sonnet-4-6 (OAuth token, may expire)
105
+ → nvidia/moonshotai/kimi-k2.5
106
+ → nvidia/moonshotai/kimi-k2-instruct
107
+ → ollama/qwen3:14b
108
+ ```
109
+
110
+ ## Service Management
111
+
112
+ ```bash
113
+ # Status
114
+ systemctl --user status claude-code-api.service
115
+
116
+ # Logs
117
+ journalctl --user -u claude-code-api.service -f
118
+
119
+ # Restart
120
+ systemctl --user restart claude-code-api.service
121
+
122
+ # Test
123
+ curl http://127.0.0.1:18782/health
124
+ curl http://127.0.0.1:18782/v1/models
125
+ curl -X POST http://127.0.0.1:18782/v1/chat/completions \
126
+ -H "Content-Type: application/json" \
127
+ -d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"hi"}]}'
128
+ ```
129
+
130
+ ## Known Limitations
131
+
132
+ - **Single-threaded:** Claude Code's CLI is not concurrent. Requests queue via
133
+ `asyncio.Semaphore(1)`. High request rates will result in latency, not errors.
134
+ - **No tool use:** `claude --print` does not expose tool_calls in the standard
135
+ OpenAI format. Tool calls are consumed internally by Claude Code.
136
+ - **Session isolation:** Each request uses `--no-session-persistence`, so there
137
+ is no cross-request memory at the API level.
138
+ - **Streaming granularity:** Token-by-token streaming requires `--include-partial-messages`.
139
+ Streaming granularity depends on how frequently Claude Code emits partial events.
@@ -62,7 +62,7 @@ function createSKCapstoneStatusTool() {
62
62
  name: "skcapstone_status",
63
63
  label: "SKCapstone Status",
64
64
  description:
65
- "Show the sovereign agent's current state — all pillars at a glance (identity, memory, trust, security, sync, communication).",
65
+ "Show the sovereign agent's current state — all six pillars at a glance (identity, memory, trust, consciousness, security, sync).",
66
66
  parameters: { type: "object", properties: {} },
67
67
  async execute() {
68
68
  const result = runCli(SKCAPSTONE_BIN, "status");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smilintux/skcapstone",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "SKCapstone - The sovereign agent framework. CapAuth identity, Cloud 9 trust, SKMemory persistence.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "skcapstone"
7
- version = "0.5.0"
7
+ version = "0.5.1"
8
8
  description = "Sovereign Agent Framework — conscious AI through identity, trust, memory, and security"
9
9
  readme = "README.md"
10
10
  license = {text = "GPL-3.0-or-later"}
@@ -29,7 +29,7 @@ PACKAGES = {
29
29
  },
30
30
  "cloud9-protocol": {
31
31
  "name": "cloud9-protocol",
32
- "path": "~/clawd/skcapstone-repos/cloud9-python",
32
+ "path": "~/clawd/skcapstone-repos/cloud9",
33
33
  "pypi_name": "cloud9-protocol",
34
34
  },
35
35
  }